@wix/auto_sdk_comments_comments 1.0.16 → 1.0.18

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