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