@wix/auto_sdk_comments_comments 1.0.16 → 1.0.18

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