@wix/auto_sdk_comments_comments 1.0.9 → 1.0.11

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 (130) 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} +686 -247
  26. package/build/cjs/src/comments-v2-comment-comments.universal.js +1599 -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 +2512 -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/{internal/meta.d.ts → es/src/comments-v2-comment-comments.types.d.ts} +558 -240
  51. package/build/es/src/comments-v2-comment-comments.types.js +383 -0
  52. package/build/es/src/comments-v2-comment-comments.types.js.map +1 -0
  53. package/build/{comments-v2-comment-comments.universal-Bt560XJw.d.ts → es/src/comments-v2-comment-comments.universal.d.ts} +686 -247
  54. package/build/es/src/comments-v2-comment-comments.universal.js +1554 -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 +109 -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 +2533 -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 +1341 -0
  76. package/build/internal/cjs/src/comments-v2-comment-comments.public.js.map +1 -0
  77. package/build/{meta.d.mts → internal/cjs/src/comments-v2-comment-comments.types.d.ts} +558 -240
  78. package/build/internal/cjs/src/comments-v2-comment-comments.types.js +386 -0
  79. package/build/internal/cjs/src/comments-v2-comment-comments.types.js.map +1 -0
  80. package/build/internal/{comments-v2-comment-comments.universal-Bt560XJw.d.ts → cjs/src/comments-v2-comment-comments.universal.d.ts} +686 -247
  81. package/build/internal/cjs/src/comments-v2-comment-comments.universal.js +1599 -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 +2512 -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/{meta.d.ts → internal/es/src/comments-v2-comment-comments.types.d.ts} +558 -240
  105. package/build/internal/es/src/comments-v2-comment-comments.types.js +383 -0
  106. package/build/internal/es/src/comments-v2-comment-comments.types.js.map +1 -0
  107. package/build/internal/{comments-v2-comment-comments.universal-Bt560XJw.d.mts → es/src/comments-v2-comment-comments.universal.d.ts} +686 -247
  108. package/build/internal/es/src/comments-v2-comment-comments.universal.js +1554 -0
  109. package/build/internal/es/src/comments-v2-comment-comments.universal.js.map +1 -0
  110. package/package.json +11 -12
  111. package/build/index.d.mts +0 -249
  112. package/build/index.d.ts +0 -249
  113. package/build/index.js +0 -5232
  114. package/build/index.js.map +0 -1
  115. package/build/index.mjs +0 -5145
  116. package/build/index.mjs.map +0 -1
  117. package/build/internal/index.d.mts +0 -249
  118. package/build/internal/index.d.ts +0 -249
  119. package/build/internal/index.js +0 -5232
  120. package/build/internal/index.js.map +0 -1
  121. package/build/internal/index.mjs +0 -5145
  122. package/build/internal/index.mjs.map +0 -1
  123. package/build/internal/meta.js +0 -2832
  124. package/build/internal/meta.js.map +0 -1
  125. package/build/internal/meta.mjs +0 -2788
  126. package/build/internal/meta.mjs.map +0 -1
  127. package/build/meta.js +0 -2832
  128. package/build/meta.js.map +0 -1
  129. package/build/meta.mjs +0 -2788
  130. package/build/meta.mjs.map +0 -1
@@ -0,0 +1,1599 @@
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
+ {
457
+ transformFn: image_1.transformSDKImageToRESTImage,
458
+ paths: [
459
+ { path: 'comment.content.attachments.image' },
460
+ { path: 'comment.draftContent.attachments.image' },
461
+ ],
462
+ },
463
+ {
464
+ transformFn: video_v2_1.transformSDKVideoV2ToRESTVideoV2,
465
+ paths: [
466
+ { path: 'comment.content.attachments.video' },
467
+ { path: 'comment.draftContent.attachments.video' },
468
+ ],
469
+ },
470
+ {
471
+ transformFn: audio_1.transformSDKAudioToRESTAudio,
472
+ paths: [
473
+ { path: 'comment.content.attachments.audio' },
474
+ { path: 'comment.draftContent.attachments.audio' },
475
+ ],
476
+ },
477
+ {
478
+ transformFn: document_1.transformSDKDocumentToRESTDocument,
479
+ paths: [
480
+ { path: 'comment.content.attachments.document' },
481
+ { path: 'comment.draftContent.attachments.document' },
482
+ ],
483
+ },
484
+ ]);
485
+ const reqOpts = ambassadorWixCommentsV2Comment.createComment(payload);
486
+ sideEffects?.onSiteCall?.();
487
+ try {
488
+ const result = await httpClient.request(reqOpts);
489
+ sideEffects?.onSuccess?.(result);
490
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
491
+ {
492
+ transformFn: image_2.transformRESTImageToSDKImage,
493
+ paths: [
494
+ { path: 'comment.content.attachments.image' },
495
+ { path: 'comment.draftContent.attachments.image' },
496
+ ],
497
+ },
498
+ {
499
+ transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
500
+ paths: [
501
+ { path: 'comment.content.attachments.video' },
502
+ { path: 'comment.draftContent.attachments.video' },
503
+ ],
504
+ },
505
+ {
506
+ transformFn: audio_2.transformRESTAudioToSDKAudio,
507
+ paths: [
508
+ { path: 'comment.content.attachments.audio' },
509
+ { path: 'comment.draftContent.attachments.audio' },
510
+ ],
511
+ },
512
+ {
513
+ transformFn: document_2.transformRESTDocumentToSDKDocument,
514
+ paths: [
515
+ { path: 'comment.content.attachments.document' },
516
+ { path: 'comment.draftContent.attachments.document' },
517
+ ],
518
+ },
519
+ ]))?.comment;
520
+ }
521
+ catch (err) {
522
+ const transformedError = (0, transform_error_1.transformError)(err, {
523
+ spreadPathsToArguments: {},
524
+ explicitPathsToArguments: { comment: '$[0]' },
525
+ singleArgumentUnchanged: false,
526
+ }, ['comment']);
527
+ sideEffects?.onError?.(err);
528
+ throw transformedError;
529
+ }
530
+ }
531
+ exports.createComment = createComment;
532
+ /**
533
+ * Retrieves a comment.
534
+ * @param commentId - ID of the comment to retrieve.
535
+ * @public
536
+ * @requiredField commentId
537
+ * @permissionId WIX_COMMENTS.COMMENT_READ
538
+ * @permissionScope Read Comments
539
+ * @permissionScopeId SCOPE.DC_COMMENTS.READ.COMMENTS
540
+ * @permissionScope Manage Comments
541
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
542
+ * @applicableIdentity APP
543
+ * @returns Retrieved comment.
544
+ * @fqn wix.comments.ng.v1.CommentsNg.GetComment
545
+ */
546
+ async function getComment(commentId) {
547
+ // @ts-ignore
548
+ const { httpClient, sideEffects } = arguments[1];
549
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
550
+ commentId: commentId,
551
+ });
552
+ const reqOpts = ambassadorWixCommentsV2Comment.getComment(payload);
553
+ sideEffects?.onSiteCall?.();
554
+ try {
555
+ const result = await httpClient.request(reqOpts);
556
+ sideEffects?.onSuccess?.(result);
557
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
558
+ {
559
+ transformFn: image_2.transformRESTImageToSDKImage,
560
+ paths: [
561
+ { path: 'comment.content.attachments.image' },
562
+ { path: 'comment.draftContent.attachments.image' },
563
+ ],
564
+ },
565
+ {
566
+ transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
567
+ paths: [
568
+ { path: 'comment.content.attachments.video' },
569
+ { path: 'comment.draftContent.attachments.video' },
570
+ ],
571
+ },
572
+ {
573
+ transformFn: audio_2.transformRESTAudioToSDKAudio,
574
+ paths: [
575
+ { path: 'comment.content.attachments.audio' },
576
+ { path: 'comment.draftContent.attachments.audio' },
577
+ ],
578
+ },
579
+ {
580
+ transformFn: document_2.transformRESTDocumentToSDKDocument,
581
+ paths: [
582
+ { path: 'comment.content.attachments.document' },
583
+ { path: 'comment.draftContent.attachments.document' },
584
+ ],
585
+ },
586
+ ]))?.comment;
587
+ }
588
+ catch (err) {
589
+ const transformedError = (0, transform_error_1.transformError)(err, {
590
+ spreadPathsToArguments: {},
591
+ explicitPathsToArguments: { commentId: '$[0]' },
592
+ singleArgumentUnchanged: false,
593
+ }, ['commentId']);
594
+ sideEffects?.onError?.(err);
595
+ throw transformedError;
596
+ }
597
+ }
598
+ exports.getComment = getComment;
599
+ /**
600
+ * Updates a comment.
601
+ *
602
+ * Each time the comment is updated, `revision` increments by 1. The current `revision` must be
603
+ * passed when updating the comment. This ensures you're working with the latest comment and
604
+ * prevents unintended overwrites.
605
+ * @param _id - Comment ID.
606
+ * @public
607
+ * @requiredField _id
608
+ * @requiredField comment
609
+ * @requiredField comment.revision
610
+ * @permissionId WIX_COMMENTS.COMMENT_UPDATE
611
+ * @permissionScope Manage Comments
612
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
613
+ * @applicableIdentity APP
614
+ * @returns Updated comment.
615
+ * @fqn wix.comments.ng.v1.CommentsNg.UpdateComment
616
+ */
617
+ async function updateComment(_id, comment) {
618
+ // @ts-ignore
619
+ const { httpClient, sideEffects } = arguments[2];
620
+ const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ comment: { ...comment, id: _id } }), [
621
+ {
622
+ transformFn: image_1.transformSDKImageToRESTImage,
623
+ paths: [
624
+ { path: 'comment.content.attachments.image' },
625
+ { path: 'comment.draftContent.attachments.image' },
626
+ ],
627
+ },
628
+ {
629
+ transformFn: video_v2_1.transformSDKVideoV2ToRESTVideoV2,
630
+ paths: [
631
+ { path: 'comment.content.attachments.video' },
632
+ { path: 'comment.draftContent.attachments.video' },
633
+ ],
634
+ },
635
+ {
636
+ transformFn: audio_1.transformSDKAudioToRESTAudio,
637
+ paths: [
638
+ { path: 'comment.content.attachments.audio' },
639
+ { path: 'comment.draftContent.attachments.audio' },
640
+ ],
641
+ },
642
+ {
643
+ transformFn: document_1.transformSDKDocumentToRESTDocument,
644
+ paths: [
645
+ { path: 'comment.content.attachments.document' },
646
+ { path: 'comment.draftContent.attachments.document' },
647
+ ],
648
+ },
649
+ ]);
650
+ const reqOpts = ambassadorWixCommentsV2Comment.updateComment(payload);
651
+ sideEffects?.onSiteCall?.();
652
+ try {
653
+ const result = await httpClient.request(reqOpts);
654
+ sideEffects?.onSuccess?.(result);
655
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
656
+ {
657
+ transformFn: image_2.transformRESTImageToSDKImage,
658
+ paths: [
659
+ { path: 'comment.content.attachments.image' },
660
+ { path: 'comment.draftContent.attachments.image' },
661
+ ],
662
+ },
663
+ {
664
+ transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
665
+ paths: [
666
+ { path: 'comment.content.attachments.video' },
667
+ { path: 'comment.draftContent.attachments.video' },
668
+ ],
669
+ },
670
+ {
671
+ transformFn: audio_2.transformRESTAudioToSDKAudio,
672
+ paths: [
673
+ { path: 'comment.content.attachments.audio' },
674
+ { path: 'comment.draftContent.attachments.audio' },
675
+ ],
676
+ },
677
+ {
678
+ transformFn: document_2.transformRESTDocumentToSDKDocument,
679
+ paths: [
680
+ { path: 'comment.content.attachments.document' },
681
+ { path: 'comment.draftContent.attachments.document' },
682
+ ],
683
+ },
684
+ ]))?.comment;
685
+ }
686
+ catch (err) {
687
+ const transformedError = (0, transform_error_1.transformError)(err, {
688
+ spreadPathsToArguments: { comment: '$[1]' },
689
+ explicitPathsToArguments: { 'comment.id': '$[0]' },
690
+ singleArgumentUnchanged: false,
691
+ }, ['_id', 'comment']);
692
+ sideEffects?.onError?.(err);
693
+ throw transformedError;
694
+ }
695
+ }
696
+ exports.updateComment = updateComment;
697
+ /**
698
+ * Deletes a comment.
699
+ *
700
+ * This method deletes the `content` of the comment and sets its `status` to `DELETED`.
701
+ * @param commentId - ID of the comment to delete.
702
+ * @public
703
+ * @requiredField commentId
704
+ * @permissionId WIX_COMMENTS.COMMENT_DELETE
705
+ * @permissionScope Manage Comments
706
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
707
+ * @applicableIdentity APP
708
+ * @fqn wix.comments.ng.v1.CommentsNg.DeleteComment
709
+ */
710
+ async function deleteComment(commentId) {
711
+ // @ts-ignore
712
+ const { httpClient, sideEffects } = arguments[1];
713
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
714
+ commentId: commentId,
715
+ });
716
+ const reqOpts = ambassadorWixCommentsV2Comment.deleteComment(payload);
717
+ sideEffects?.onSiteCall?.();
718
+ try {
719
+ const result = await httpClient.request(reqOpts);
720
+ sideEffects?.onSuccess?.(result);
721
+ }
722
+ catch (err) {
723
+ const transformedError = (0, transform_error_1.transformError)(err, {
724
+ spreadPathsToArguments: {},
725
+ explicitPathsToArguments: { commentId: '$[0]' },
726
+ singleArgumentUnchanged: false,
727
+ }, ['commentId']);
728
+ sideEffects?.onError?.(err);
729
+ throw transformedError;
730
+ }
731
+ }
732
+ exports.deleteComment = deleteComment;
733
+ /**
734
+ * Moderates the draft content of a comment.
735
+ *
736
+ * - `APPROVE`: Moves `draftContent` to `content` and updates the comment `status` to `PUBLISHED`.
737
+ * - `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`.
738
+ * @param commentId - ID of the comment to moderate.
739
+ * @param revision - Revision number, which increments by `1` each time the comment is updated.
740
+ *
741
+ * To prevent conflicting changes, the current `revision` must be passed when updating the comment.
742
+ * @public
743
+ * @documentationMaturity preview
744
+ * @requiredField commentId
745
+ * @requiredField revision
746
+ * @permissionId WIX_COMMENTS.COMMENT_MODERATE_DRAFT_CONTENT
747
+ * @permissionScope Manage Comments
748
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
749
+ * @applicableIdentity APP
750
+ * @fqn wix.comments.ng.v1.CommentsNg.ModerateDraftContent
751
+ */
752
+ async function moderateDraftContent(commentId, revision, options) {
753
+ // @ts-ignore
754
+ const { httpClient, sideEffects } = arguments[3];
755
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
756
+ commentId: commentId,
757
+ revision: revision,
758
+ draftContentAction: options?.draftContentAction,
759
+ });
760
+ const reqOpts = ambassadorWixCommentsV2Comment.moderateDraftContent(payload);
761
+ sideEffects?.onSiteCall?.();
762
+ try {
763
+ const result = await httpClient.request(reqOpts);
764
+ sideEffects?.onSuccess?.(result);
765
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
766
+ {
767
+ transformFn: image_2.transformRESTImageToSDKImage,
768
+ paths: [
769
+ { path: 'comment.content.attachments.image' },
770
+ { path: 'comment.draftContent.attachments.image' },
771
+ ],
772
+ },
773
+ {
774
+ transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
775
+ paths: [
776
+ { path: 'comment.content.attachments.video' },
777
+ { path: 'comment.draftContent.attachments.video' },
778
+ ],
779
+ },
780
+ {
781
+ transformFn: audio_2.transformRESTAudioToSDKAudio,
782
+ paths: [
783
+ { path: 'comment.content.attachments.audio' },
784
+ { path: 'comment.draftContent.attachments.audio' },
785
+ ],
786
+ },
787
+ {
788
+ transformFn: document_2.transformRESTDocumentToSDKDocument,
789
+ paths: [
790
+ { path: 'comment.content.attachments.document' },
791
+ { path: 'comment.draftContent.attachments.document' },
792
+ ],
793
+ },
794
+ ]));
795
+ }
796
+ catch (err) {
797
+ const transformedError = (0, transform_error_1.transformError)(err, {
798
+ spreadPathsToArguments: {},
799
+ explicitPathsToArguments: {
800
+ commentId: '$[0]',
801
+ revision: '$[1]',
802
+ draftContentAction: '$[2].draftContentAction',
803
+ },
804
+ singleArgumentUnchanged: false,
805
+ }, ['commentId', 'revision', 'options']);
806
+ sideEffects?.onError?.(err);
807
+ throw transformedError;
808
+ }
809
+ }
810
+ exports.moderateDraftContent = moderateDraftContent;
811
+ /**
812
+ * Creates a query to retrieve a list of comments.
813
+ *
814
+ * The `queryComments()` function builds a query to retrieve a list of comments and returns a [`CommentsQueryBuilder`](#commentsquerybuilder) object.
815
+ *
816
+ * The returned object contains the query definition, which is typically used to run the query using the [`find()`](#commentsquerybuilder/find) function.
817
+ *
818
+ * 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.
819
+ *
820
+ * `queryComments()` runs with the following `CommentsQueryBuilder` default that you can override:
821
+ * + `ascending("_id")`
822
+ *
823
+ * 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"`.
824
+ *
825
+ * 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).
826
+ * @public
827
+ * @requiredField appId
828
+ * @param appId - App ID to query comments for.
829
+ * @permissionScope Read Comments
830
+ * @permissionScopeId SCOPE.DC_COMMENTS.READ.COMMENTS
831
+ * @permissionScope Manage Comments
832
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
833
+ * @permissionId WIX_COMMENTS.COMMENT_QUERY
834
+ * @applicableIdentity APP
835
+ * @fqn wix.comments.ng.v1.CommentsNg.QueryComments
836
+ */
837
+ function queryComments(appId) {
838
+ // @ts-ignore
839
+ const { httpClient, sideEffects } = arguments[1];
840
+ return (0, query_builder_1.queryBuilder)({
841
+ func: async (payload) => {
842
+ const reqOpts = ambassadorWixCommentsV2Comment.queryComments(payload);
843
+ sideEffects?.onSiteCall?.();
844
+ try {
845
+ const result = await httpClient.request(reqOpts);
846
+ sideEffects?.onSuccess?.(result);
847
+ return result;
848
+ }
849
+ catch (err) {
850
+ sideEffects?.onError?.(err);
851
+ throw err;
852
+ }
853
+ },
854
+ requestTransformer: (query) => {
855
+ const args = [query, appId, {}];
856
+ return (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
857
+ appId: args?.[1],
858
+ ...args?.[2],
859
+ query: args?.[0],
860
+ });
861
+ },
862
+ responseTransformer: ({ data }) => {
863
+ const transformedData = (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(data, [
864
+ {
865
+ transformFn: image_2.transformRESTImageToSDKImage,
866
+ paths: [
867
+ { path: 'comments.content.attachments.image' },
868
+ { path: 'comments.draftContent.attachments.image' },
869
+ ],
870
+ },
871
+ {
872
+ transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
873
+ paths: [
874
+ { path: 'comments.content.attachments.video' },
875
+ { path: 'comments.draftContent.attachments.video' },
876
+ ],
877
+ },
878
+ {
879
+ transformFn: audio_2.transformRESTAudioToSDKAudio,
880
+ paths: [
881
+ { path: 'comments.content.attachments.audio' },
882
+ { path: 'comments.draftContent.attachments.audio' },
883
+ ],
884
+ },
885
+ {
886
+ transformFn: document_2.transformRESTDocumentToSDKDocument,
887
+ paths: [
888
+ { path: 'comments.content.attachments.document' },
889
+ { path: 'comments.draftContent.attachments.document' },
890
+ ],
891
+ },
892
+ ]));
893
+ return {
894
+ items: transformedData?.comments,
895
+ pagingMetadata: transformedData?.pagingMetadata,
896
+ };
897
+ },
898
+ errorTransformer: (err) => {
899
+ const transformedError = (0, transform_error_1.transformError)(err, {
900
+ spreadPathsToArguments: {},
901
+ explicitPathsToArguments: { appId: '$[1]', query: '$[0]' },
902
+ singleArgumentUnchanged: false,
903
+ });
904
+ throw transformedError;
905
+ },
906
+ pagingMethod: 'CURSOR',
907
+ transformationPaths: {},
908
+ });
909
+ }
910
+ exports.queryComments = queryComments;
911
+ /**
912
+ * Sets `marked` to `TRUE` to mark a comment.
913
+ *
914
+ * Call Query Comments to filter for marked comments to then apply customization to.
915
+ * See Sample Flows for an example.
916
+ * @param commentId - ID of the comment to mark.
917
+ * @public
918
+ * @requiredField commentId
919
+ * @permissionId WIX_COMMENTS.COMMENT_MARK
920
+ * @permissionScope Manage Comments
921
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
922
+ * @applicableIdentity APP
923
+ * @fqn wix.comments.ng.v1.CommentsNg.MarkComment
924
+ */
925
+ async function markComment(commentId) {
926
+ // @ts-ignore
927
+ const { httpClient, sideEffects } = arguments[1];
928
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
929
+ commentId: commentId,
930
+ });
931
+ const reqOpts = ambassadorWixCommentsV2Comment.markComment(payload);
932
+ sideEffects?.onSiteCall?.();
933
+ try {
934
+ const result = await httpClient.request(reqOpts);
935
+ sideEffects?.onSuccess?.(result);
936
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
937
+ {
938
+ transformFn: image_2.transformRESTImageToSDKImage,
939
+ paths: [
940
+ { path: 'comment.content.attachments.image' },
941
+ { path: 'comment.draftContent.attachments.image' },
942
+ ],
943
+ },
944
+ {
945
+ transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
946
+ paths: [
947
+ { path: 'comment.content.attachments.video' },
948
+ { path: 'comment.draftContent.attachments.video' },
949
+ ],
950
+ },
951
+ {
952
+ transformFn: audio_2.transformRESTAudioToSDKAudio,
953
+ paths: [
954
+ { path: 'comment.content.attachments.audio' },
955
+ { path: 'comment.draftContent.attachments.audio' },
956
+ ],
957
+ },
958
+ {
959
+ transformFn: document_2.transformRESTDocumentToSDKDocument,
960
+ paths: [
961
+ { path: 'comment.content.attachments.document' },
962
+ { path: 'comment.draftContent.attachments.document' },
963
+ ],
964
+ },
965
+ ]));
966
+ }
967
+ catch (err) {
968
+ const transformedError = (0, transform_error_1.transformError)(err, {
969
+ spreadPathsToArguments: {},
970
+ explicitPathsToArguments: { commentId: '$[0]' },
971
+ singleArgumentUnchanged: false,
972
+ }, ['commentId']);
973
+ sideEffects?.onError?.(err);
974
+ throw transformedError;
975
+ }
976
+ }
977
+ exports.markComment = markComment;
978
+ /**
979
+ * Sets `marked` to `FALSE` to unmark a comment.
980
+ * @param commentId - ID of the comment to unmark.
981
+ * @public
982
+ * @requiredField commentId
983
+ * @permissionId WIX_COMMENTS.COMMENT_MARK
984
+ * @permissionScope Manage Comments
985
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
986
+ * @applicableIdentity APP
987
+ * @fqn wix.comments.ng.v1.CommentsNg.UnmarkComment
988
+ */
989
+ async function unmarkComment(commentId) {
990
+ // @ts-ignore
991
+ const { httpClient, sideEffects } = arguments[1];
992
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
993
+ commentId: commentId,
994
+ });
995
+ const reqOpts = ambassadorWixCommentsV2Comment.unmarkComment(payload);
996
+ sideEffects?.onSiteCall?.();
997
+ try {
998
+ const result = await httpClient.request(reqOpts);
999
+ sideEffects?.onSuccess?.(result);
1000
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
1001
+ {
1002
+ transformFn: image_2.transformRESTImageToSDKImage,
1003
+ paths: [
1004
+ { path: 'comment.content.attachments.image' },
1005
+ { path: 'comment.draftContent.attachments.image' },
1006
+ ],
1007
+ },
1008
+ {
1009
+ transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
1010
+ paths: [
1011
+ { path: 'comment.content.attachments.video' },
1012
+ { path: 'comment.draftContent.attachments.video' },
1013
+ ],
1014
+ },
1015
+ {
1016
+ transformFn: audio_2.transformRESTAudioToSDKAudio,
1017
+ paths: [
1018
+ { path: 'comment.content.attachments.audio' },
1019
+ { path: 'comment.draftContent.attachments.audio' },
1020
+ ],
1021
+ },
1022
+ {
1023
+ transformFn: document_2.transformRESTDocumentToSDKDocument,
1024
+ paths: [
1025
+ { path: 'comment.content.attachments.document' },
1026
+ { path: 'comment.draftContent.attachments.document' },
1027
+ ],
1028
+ },
1029
+ ]));
1030
+ }
1031
+ catch (err) {
1032
+ const transformedError = (0, transform_error_1.transformError)(err, {
1033
+ spreadPathsToArguments: {},
1034
+ explicitPathsToArguments: { commentId: '$[0]' },
1035
+ singleArgumentUnchanged: false,
1036
+ }, ['commentId']);
1037
+ sideEffects?.onError?.(err);
1038
+ throw transformedError;
1039
+ }
1040
+ }
1041
+ exports.unmarkComment = unmarkComment;
1042
+ /**
1043
+ * Hides a comment in a widget. The comment status becomes `HIDDEN`.
1044
+ * @param commentId - ID of the comment to hide.
1045
+ * @public
1046
+ * @documentationMaturity preview
1047
+ * @requiredField commentId
1048
+ * @permissionId WIX_COMMENTS.COMMENT_HIDE
1049
+ * @permissionScope Manage Comments
1050
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
1051
+ * @applicableIdentity APP
1052
+ * @fqn wix.comments.ng.v1.CommentsNg.HideComment
1053
+ */
1054
+ async function hideComment(commentId) {
1055
+ // @ts-ignore
1056
+ const { httpClient, sideEffects } = arguments[1];
1057
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1058
+ commentId: commentId,
1059
+ });
1060
+ const reqOpts = ambassadorWixCommentsV2Comment.hideComment(payload);
1061
+ sideEffects?.onSiteCall?.();
1062
+ try {
1063
+ const result = await httpClient.request(reqOpts);
1064
+ sideEffects?.onSuccess?.(result);
1065
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
1066
+ {
1067
+ transformFn: image_2.transformRESTImageToSDKImage,
1068
+ paths: [
1069
+ { path: 'comment.content.attachments.image' },
1070
+ { path: 'comment.draftContent.attachments.image' },
1071
+ ],
1072
+ },
1073
+ {
1074
+ transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
1075
+ paths: [
1076
+ { path: 'comment.content.attachments.video' },
1077
+ { path: 'comment.draftContent.attachments.video' },
1078
+ ],
1079
+ },
1080
+ {
1081
+ transformFn: audio_2.transformRESTAudioToSDKAudio,
1082
+ paths: [
1083
+ { path: 'comment.content.attachments.audio' },
1084
+ { path: 'comment.draftContent.attachments.audio' },
1085
+ ],
1086
+ },
1087
+ {
1088
+ transformFn: document_2.transformRESTDocumentToSDKDocument,
1089
+ paths: [
1090
+ { path: 'comment.content.attachments.document' },
1091
+ { path: 'comment.draftContent.attachments.document' },
1092
+ ],
1093
+ },
1094
+ ]));
1095
+ }
1096
+ catch (err) {
1097
+ const transformedError = (0, transform_error_1.transformError)(err, {
1098
+ spreadPathsToArguments: {},
1099
+ explicitPathsToArguments: { commentId: '$[0]' },
1100
+ singleArgumentUnchanged: false,
1101
+ }, ['commentId']);
1102
+ sideEffects?.onError?.(err);
1103
+ throw transformedError;
1104
+ }
1105
+ }
1106
+ exports.hideComment = hideComment;
1107
+ /**
1108
+ * Publishes a comment with the `HIDDEN` status. The comment status becomes `PUBLISHED`.
1109
+ *
1110
+ * To publish a new comment, call Create Comment.
1111
+ * @param commentId - ID of the comment to publish.
1112
+ * @public
1113
+ * @documentationMaturity preview
1114
+ * @requiredField commentId
1115
+ * @permissionId WIX_COMMENTS.COMMENT_PUBLISH
1116
+ * @permissionScope Manage Comments
1117
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
1118
+ * @applicableIdentity APP
1119
+ * @fqn wix.comments.ng.v1.CommentsNg.PublishComment
1120
+ */
1121
+ async function publishComment(commentId) {
1122
+ // @ts-ignore
1123
+ const { httpClient, sideEffects } = arguments[1];
1124
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1125
+ commentId: commentId,
1126
+ });
1127
+ const reqOpts = ambassadorWixCommentsV2Comment.publishComment(payload);
1128
+ sideEffects?.onSiteCall?.();
1129
+ try {
1130
+ const result = await httpClient.request(reqOpts);
1131
+ sideEffects?.onSuccess?.(result);
1132
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
1133
+ {
1134
+ transformFn: image_2.transformRESTImageToSDKImage,
1135
+ paths: [
1136
+ { path: 'comment.content.attachments.image' },
1137
+ { path: 'comment.draftContent.attachments.image' },
1138
+ ],
1139
+ },
1140
+ {
1141
+ transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
1142
+ paths: [
1143
+ { path: 'comment.content.attachments.video' },
1144
+ { path: 'comment.draftContent.attachments.video' },
1145
+ ],
1146
+ },
1147
+ {
1148
+ transformFn: audio_2.transformRESTAudioToSDKAudio,
1149
+ paths: [
1150
+ { path: 'comment.content.attachments.audio' },
1151
+ { path: 'comment.draftContent.attachments.audio' },
1152
+ ],
1153
+ },
1154
+ {
1155
+ transformFn: document_2.transformRESTDocumentToSDKDocument,
1156
+ paths: [
1157
+ { path: 'comment.content.attachments.document' },
1158
+ { path: 'comment.draftContent.attachments.document' },
1159
+ ],
1160
+ },
1161
+ ]));
1162
+ }
1163
+ catch (err) {
1164
+ const transformedError = (0, transform_error_1.transformError)(err, {
1165
+ spreadPathsToArguments: {},
1166
+ explicitPathsToArguments: { commentId: '$[0]' },
1167
+ singleArgumentUnchanged: false,
1168
+ }, ['commentId']);
1169
+ sideEffects?.onError?.(err);
1170
+ throw transformedError;
1171
+ }
1172
+ }
1173
+ exports.publishComment = publishComment;
1174
+ /**
1175
+ * Counts comments, given the specified filtering. Comments with the `HIDDEN` status are not included in the response.
1176
+ * @param appId - App ID to count the comments of.
1177
+ * @public
1178
+ * @requiredField appId
1179
+ * @permissionId WIX_COMMENTS.COMMENT_COUNT
1180
+ * @permissionScope Manage Comments
1181
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
1182
+ * @applicableIdentity APP
1183
+ * @fqn wix.comments.ng.v1.CommentsNg.CountComments
1184
+ */
1185
+ async function countComments(appId, options) {
1186
+ // @ts-ignore
1187
+ const { httpClient, sideEffects } = arguments[2];
1188
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1189
+ appId: appId,
1190
+ filter: options?.filter,
1191
+ });
1192
+ const reqOpts = ambassadorWixCommentsV2Comment.countComments(payload);
1193
+ sideEffects?.onSiteCall?.();
1194
+ try {
1195
+ const result = await httpClient.request(reqOpts);
1196
+ sideEffects?.onSuccess?.(result);
1197
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
1198
+ }
1199
+ catch (err) {
1200
+ const transformedError = (0, transform_error_1.transformError)(err, {
1201
+ spreadPathsToArguments: {},
1202
+ explicitPathsToArguments: { appId: '$[0]', filter: '$[1].filter' },
1203
+ singleArgumentUnchanged: false,
1204
+ }, ['appId', 'options']);
1205
+ sideEffects?.onError?.(err);
1206
+ throw transformedError;
1207
+ }
1208
+ }
1209
+ exports.countComments = countComments;
1210
+ /**
1211
+ * Lists published comments and replies from a specified resource, such as a blog post.
1212
+ * @param appId - ID of the app from which the comments are listed.
1213
+ * @public
1214
+ * @documentationMaturity preview
1215
+ * @requiredField appId
1216
+ * @requiredField options.contextId
1217
+ * @requiredField options.resourceId
1218
+ * @permissionId WIX_COMMENTS.COMMENT_LIST
1219
+ * @permissionScope Read Comments
1220
+ * @permissionScopeId SCOPE.DC_COMMENTS.READ.COMMENTS
1221
+ * @permissionScope Manage Comments
1222
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
1223
+ * @applicableIdentity APP
1224
+ * @fqn wix.comments.ng.v1.CommentsNg.ListCommentsByResource
1225
+ */
1226
+ async function listCommentsByResource(appId, options) {
1227
+ // @ts-ignore
1228
+ const { httpClient, sideEffects } = arguments[2];
1229
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1230
+ appId: appId,
1231
+ contextId: options?.contextId,
1232
+ contextType: options?.contextType,
1233
+ resourceId: options?.resourceId,
1234
+ commentSort: options?.commentSort,
1235
+ replySort: options?.replySort,
1236
+ cursorPaging: options?.cursorPaging,
1237
+ });
1238
+ const reqOpts = ambassadorWixCommentsV2Comment.listCommentsByResource(payload);
1239
+ sideEffects?.onSiteCall?.();
1240
+ try {
1241
+ const result = await httpClient.request(reqOpts);
1242
+ sideEffects?.onSuccess?.(result);
1243
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
1244
+ {
1245
+ transformFn: image_2.transformRESTImageToSDKImage,
1246
+ paths: [
1247
+ { path: 'comments.content.attachments.image' },
1248
+ { path: 'comments.draftContent.attachments.image' },
1249
+ { path: 'commentReplies.*.replies.content.attachments.image' },
1250
+ { path: 'commentReplies.*.replies.draftContent.attachments.image' },
1251
+ ],
1252
+ },
1253
+ {
1254
+ transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
1255
+ paths: [
1256
+ { path: 'comments.content.attachments.video' },
1257
+ { path: 'comments.draftContent.attachments.video' },
1258
+ { path: 'commentReplies.*.replies.content.attachments.video' },
1259
+ { path: 'commentReplies.*.replies.draftContent.attachments.video' },
1260
+ ],
1261
+ },
1262
+ {
1263
+ transformFn: audio_2.transformRESTAudioToSDKAudio,
1264
+ paths: [
1265
+ { path: 'comments.content.attachments.audio' },
1266
+ { path: 'comments.draftContent.attachments.audio' },
1267
+ { path: 'commentReplies.*.replies.content.attachments.audio' },
1268
+ { path: 'commentReplies.*.replies.draftContent.attachments.audio' },
1269
+ ],
1270
+ },
1271
+ {
1272
+ transformFn: document_2.transformRESTDocumentToSDKDocument,
1273
+ paths: [
1274
+ { path: 'comments.content.attachments.document' },
1275
+ { path: 'comments.draftContent.attachments.document' },
1276
+ { path: 'commentReplies.*.replies.content.attachments.document' },
1277
+ {
1278
+ path: 'commentReplies.*.replies.draftContent.attachments.document',
1279
+ },
1280
+ ],
1281
+ },
1282
+ ]));
1283
+ }
1284
+ catch (err) {
1285
+ const transformedError = (0, transform_error_1.transformError)(err, {
1286
+ spreadPathsToArguments: {},
1287
+ explicitPathsToArguments: {
1288
+ appId: '$[0]',
1289
+ contextId: '$[1].contextId',
1290
+ contextType: '$[1].contextType',
1291
+ resourceId: '$[1].resourceId',
1292
+ commentSort: '$[1].commentSort',
1293
+ replySort: '$[1].replySort',
1294
+ cursorPaging: '$[1].cursorPaging',
1295
+ },
1296
+ singleArgumentUnchanged: false,
1297
+ }, ['appId', 'options']);
1298
+ sideEffects?.onError?.(err);
1299
+ throw transformedError;
1300
+ }
1301
+ }
1302
+ exports.listCommentsByResource = listCommentsByResource;
1303
+ /**
1304
+ * Returns a thread of a comment or a reply.
1305
+ *
1306
+ * 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.
1307
+ *
1308
+ * 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.
1309
+ * @param commentId - Comment ID.
1310
+ * @public
1311
+ * @documentationMaturity preview
1312
+ * @requiredField commentId
1313
+ * @permissionId WIX_COMMENTS.COMMENT_THREAD
1314
+ * @permissionScope Read Comments
1315
+ * @permissionScopeId SCOPE.DC_COMMENTS.READ.COMMENTS
1316
+ * @permissionScope Manage Comments
1317
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
1318
+ * @applicableIdentity APP
1319
+ * @fqn wix.comments.ng.v1.CommentsNg.GetCommentThread
1320
+ */
1321
+ async function getCommentThread(commentId, options) {
1322
+ // @ts-ignore
1323
+ const { httpClient, sideEffects } = arguments[2];
1324
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1325
+ commentId: commentId,
1326
+ appId: options?.appId,
1327
+ commentSort: options?.commentSort,
1328
+ replySort: options?.replySort,
1329
+ });
1330
+ const reqOpts = ambassadorWixCommentsV2Comment.getCommentThread(payload);
1331
+ sideEffects?.onSiteCall?.();
1332
+ try {
1333
+ const result = await httpClient.request(reqOpts);
1334
+ sideEffects?.onSuccess?.(result);
1335
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
1336
+ {
1337
+ transformFn: image_2.transformRESTImageToSDKImage,
1338
+ paths: [
1339
+ { path: 'comments.content.attachments.image' },
1340
+ { path: 'comments.draftContent.attachments.image' },
1341
+ { path: 'commentReplies.*.replies.content.attachments.image' },
1342
+ { path: 'commentReplies.*.replies.draftContent.attachments.image' },
1343
+ ],
1344
+ },
1345
+ {
1346
+ transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
1347
+ paths: [
1348
+ { path: 'comments.content.attachments.video' },
1349
+ { path: 'comments.draftContent.attachments.video' },
1350
+ { path: 'commentReplies.*.replies.content.attachments.video' },
1351
+ { path: 'commentReplies.*.replies.draftContent.attachments.video' },
1352
+ ],
1353
+ },
1354
+ {
1355
+ transformFn: audio_2.transformRESTAudioToSDKAudio,
1356
+ paths: [
1357
+ { path: 'comments.content.attachments.audio' },
1358
+ { path: 'comments.draftContent.attachments.audio' },
1359
+ { path: 'commentReplies.*.replies.content.attachments.audio' },
1360
+ { path: 'commentReplies.*.replies.draftContent.attachments.audio' },
1361
+ ],
1362
+ },
1363
+ {
1364
+ transformFn: document_2.transformRESTDocumentToSDKDocument,
1365
+ paths: [
1366
+ { path: 'comments.content.attachments.document' },
1367
+ { path: 'comments.draftContent.attachments.document' },
1368
+ { path: 'commentReplies.*.replies.content.attachments.document' },
1369
+ {
1370
+ path: 'commentReplies.*.replies.draftContent.attachments.document',
1371
+ },
1372
+ ],
1373
+ },
1374
+ ]));
1375
+ }
1376
+ catch (err) {
1377
+ const transformedError = (0, transform_error_1.transformError)(err, {
1378
+ spreadPathsToArguments: {},
1379
+ explicitPathsToArguments: {
1380
+ commentId: '$[0]',
1381
+ appId: '$[1].appId',
1382
+ commentSort: '$[1].commentSort',
1383
+ replySort: '$[1].replySort',
1384
+ },
1385
+ singleArgumentUnchanged: false,
1386
+ }, ['commentId', 'options']);
1387
+ sideEffects?.onError?.(err);
1388
+ throw transformedError;
1389
+ }
1390
+ }
1391
+ exports.getCommentThread = getCommentThread;
1392
+ /**
1393
+ * Publishes multiple comments with the `HIDDEN` status. The comment status becomes `PUBLISHED`.
1394
+ * @param appId - ID of the app where to publish the comment.
1395
+ * @public
1396
+ * @documentationMaturity preview
1397
+ * @requiredField appId
1398
+ * @requiredField options
1399
+ * @requiredField options.filter
1400
+ * @permissionId WIX_COMMENTS.BULK_COMMENT_PUBLISH
1401
+ * @permissionScope Manage Comments
1402
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
1403
+ * @applicableIdentity APP
1404
+ * @fqn wix.comments.ng.v1.CommentsNg.BulkPublishComment
1405
+ */
1406
+ async function bulkPublishComment(appId, options) {
1407
+ // @ts-ignore
1408
+ const { httpClient, sideEffects } = arguments[2];
1409
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1410
+ appId: appId,
1411
+ filter: options?.filter,
1412
+ });
1413
+ const reqOpts = ambassadorWixCommentsV2Comment.bulkPublishComment(payload);
1414
+ sideEffects?.onSiteCall?.();
1415
+ try {
1416
+ const result = await httpClient.request(reqOpts);
1417
+ sideEffects?.onSuccess?.(result);
1418
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
1419
+ }
1420
+ catch (err) {
1421
+ const transformedError = (0, transform_error_1.transformError)(err, {
1422
+ spreadPathsToArguments: {},
1423
+ explicitPathsToArguments: { appId: '$[0]', filter: '$[1].filter' },
1424
+ singleArgumentUnchanged: false,
1425
+ }, ['appId', 'options']);
1426
+ sideEffects?.onError?.(err);
1427
+ throw transformedError;
1428
+ }
1429
+ }
1430
+ exports.bulkPublishComment = bulkPublishComment;
1431
+ /**
1432
+ * Hides multiple comments. The comment status becomes `HIDDEN`.
1433
+ * @param appId - ID of the app where to hide the comments.
1434
+ * @public
1435
+ * @documentationMaturity preview
1436
+ * @requiredField appId
1437
+ * @requiredField options
1438
+ * @requiredField options.filter
1439
+ * @permissionId WIX_COMMENTS.BULK_COMMENT_HIDE
1440
+ * @permissionScope Manage Comments
1441
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
1442
+ * @applicableIdentity APP
1443
+ * @fqn wix.comments.ng.v1.CommentsNg.BulkHideComment
1444
+ */
1445
+ async function bulkHideComment(appId, options) {
1446
+ // @ts-ignore
1447
+ const { httpClient, sideEffects } = arguments[2];
1448
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1449
+ appId: appId,
1450
+ filter: options?.filter,
1451
+ });
1452
+ const reqOpts = ambassadorWixCommentsV2Comment.bulkHideComment(payload);
1453
+ sideEffects?.onSiteCall?.();
1454
+ try {
1455
+ const result = await httpClient.request(reqOpts);
1456
+ sideEffects?.onSuccess?.(result);
1457
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
1458
+ }
1459
+ catch (err) {
1460
+ const transformedError = (0, transform_error_1.transformError)(err, {
1461
+ spreadPathsToArguments: {},
1462
+ explicitPathsToArguments: { appId: '$[0]', filter: '$[1].filter' },
1463
+ singleArgumentUnchanged: false,
1464
+ }, ['appId', 'options']);
1465
+ sideEffects?.onError?.(err);
1466
+ throw transformedError;
1467
+ }
1468
+ }
1469
+ exports.bulkHideComment = bulkHideComment;
1470
+ /**
1471
+ * Deletes multiple comments.
1472
+ * @param appId - ID of the app where to delete the comments.
1473
+ * @public
1474
+ * @documentationMaturity preview
1475
+ * @requiredField appId
1476
+ * @requiredField options
1477
+ * @requiredField options.filter
1478
+ * @permissionId WIX_COMMENTS.BULK_COMMENT_DELETE
1479
+ * @permissionScope Manage Comments
1480
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
1481
+ * @applicableIdentity APP
1482
+ * @fqn wix.comments.ng.v1.CommentsNg.BulkDeleteComment
1483
+ */
1484
+ async function bulkDeleteComment(appId, options) {
1485
+ // @ts-ignore
1486
+ const { httpClient, sideEffects } = arguments[2];
1487
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1488
+ appId: appId,
1489
+ filter: options?.filter,
1490
+ });
1491
+ const reqOpts = ambassadorWixCommentsV2Comment.bulkDeleteComment(payload);
1492
+ sideEffects?.onSiteCall?.();
1493
+ try {
1494
+ const result = await httpClient.request(reqOpts);
1495
+ sideEffects?.onSuccess?.(result);
1496
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
1497
+ }
1498
+ catch (err) {
1499
+ const transformedError = (0, transform_error_1.transformError)(err, {
1500
+ spreadPathsToArguments: {},
1501
+ explicitPathsToArguments: { appId: '$[0]', filter: '$[1].filter' },
1502
+ singleArgumentUnchanged: false,
1503
+ }, ['appId', 'options']);
1504
+ sideEffects?.onError?.(err);
1505
+ throw transformedError;
1506
+ }
1507
+ }
1508
+ exports.bulkDeleteComment = bulkDeleteComment;
1509
+ /**
1510
+ * Moderates the draft content of multiple comments.
1511
+ * @param appId - ID of the app where to moderate the comments.
1512
+ * @public
1513
+ * @documentationMaturity preview
1514
+ * @requiredField appId
1515
+ * @requiredField options
1516
+ * @requiredField options.draftContentAction
1517
+ * @requiredField options.filter
1518
+ * @permissionId WIX_COMMENTS.BULK_COMMENT_MODERATE_DRAFT_CONTENT
1519
+ * @permissionScope Manage Comments
1520
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
1521
+ * @applicableIdentity APP
1522
+ * @fqn wix.comments.ng.v1.CommentsNg.BulkModerateDraftContent
1523
+ */
1524
+ async function bulkModerateDraftContent(appId, options) {
1525
+ // @ts-ignore
1526
+ const { httpClient, sideEffects } = arguments[2];
1527
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1528
+ appId: appId,
1529
+ filter: options?.filter,
1530
+ draftContentAction: options?.draftContentAction,
1531
+ });
1532
+ const reqOpts = ambassadorWixCommentsV2Comment.bulkModerateDraftContent(payload);
1533
+ sideEffects?.onSiteCall?.();
1534
+ try {
1535
+ const result = await httpClient.request(reqOpts);
1536
+ sideEffects?.onSuccess?.(result);
1537
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
1538
+ }
1539
+ catch (err) {
1540
+ const transformedError = (0, transform_error_1.transformError)(err, {
1541
+ spreadPathsToArguments: {},
1542
+ explicitPathsToArguments: {
1543
+ appId: '$[0]',
1544
+ filter: '$[1].filter',
1545
+ draftContentAction: '$[1].draftContentAction',
1546
+ },
1547
+ singleArgumentUnchanged: false,
1548
+ }, ['appId', 'options']);
1549
+ sideEffects?.onError?.(err);
1550
+ throw transformedError;
1551
+ }
1552
+ }
1553
+ exports.bulkModerateDraftContent = bulkModerateDraftContent;
1554
+ /**
1555
+ * Moves multiple comments to another resource.
1556
+ * @param appId - ID of the app from which to move the comments.
1557
+ * @public
1558
+ * @documentationMaturity preview
1559
+ * @requiredField appId
1560
+ * @requiredField options.destination.contextId
1561
+ * @requiredField options.destination.resourceId
1562
+ * @requiredField options.filter
1563
+ * @permissionId WIX_COMMENTS.BULK_COMMENT_MOVE
1564
+ * @permissionScope Manage Comments
1565
+ * @permissionScopeId SCOPE.DC_COMMENTS.MANAGE.COMMENTS
1566
+ * @applicableIdentity APP
1567
+ * @fqn wix.comments.ng.v1.CommentsNg.BulkMoveCommentByFilter
1568
+ */
1569
+ async function bulkMoveCommentByFilter(appId, options) {
1570
+ // @ts-ignore
1571
+ const { httpClient, sideEffects } = arguments[2];
1572
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
1573
+ appId: appId,
1574
+ filter: options?.filter,
1575
+ destination: options?.destination,
1576
+ });
1577
+ const reqOpts = ambassadorWixCommentsV2Comment.bulkMoveCommentByFilter(payload);
1578
+ sideEffects?.onSiteCall?.();
1579
+ try {
1580
+ const result = await httpClient.request(reqOpts);
1581
+ sideEffects?.onSuccess?.(result);
1582
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
1583
+ }
1584
+ catch (err) {
1585
+ const transformedError = (0, transform_error_1.transformError)(err, {
1586
+ spreadPathsToArguments: {},
1587
+ explicitPathsToArguments: {
1588
+ appId: '$[0]',
1589
+ filter: '$[1].filter',
1590
+ destination: '$[1].destination',
1591
+ },
1592
+ singleArgumentUnchanged: false,
1593
+ }, ['appId', 'options']);
1594
+ sideEffects?.onError?.(err);
1595
+ throw transformedError;
1596
+ }
1597
+ }
1598
+ exports.bulkMoveCommentByFilter = bulkMoveCommentByFilter;
1599
+ //# sourceMappingURL=comments-v2-comment-comments.universal.js.map