@wix/auto_sdk_comments_comments 1.0.6 → 1.0.8

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