@wix/auto_sdk_comments_comments 1.0.7 → 1.0.9

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