@wix/auto_sdk_feedback_comments 1.0.0 → 1.0.2

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.
@@ -1,547 +1,111 @@
1
- /**
2
- * A Comment is a note left on a specific location of a site page as part of a feedback session.
3
- *
4
- * Site visitors leave comments while reviewing a site; the site owner reads them, triages them by
5
- * `status`, replies to them, and deletes them.
6
- */
7
- interface Comment {
1
+ import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
+ import { Comment, CursorQuery, QueryCommentsResponse, StatusWithLiterals, UpdateCommentStatusOptions, UpdateCommentStatusResponse, CommentReply, CreateCommentReplyOptions, CreateCommentReplyResponse, UpdateCommentReplyIdentifiers, UpdateCommentReplyOptions, UpdateCommentReplyResponse, DeleteCommentReplyIdentifiers, DeleteCommentReplyResponse, CommentCreatedEnvelope, CommentDeletedEnvelope, CommentUpdatedEnvelope } from './index.typings.mjs';
3
+ export { AccountInfo, AccountInfoMetadata, ActionEvent, BaseEventMetadata, Breakpoint, CommentLocation, CreateCommentReplyRequest, CreateCommentRequest, CreateCommentResponse, CursorPaging, CursorPagingMetadata, CursorQueryPagingMethodOneOf, Cursors, DeleteCommentReplyRequest, DeleteCommentRequest, DeleteCommentResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, GetCommentRequest, GetCommentResponse, IdentificationData, IdentificationDataIdOneOf, MessageEnvelope, Position, QueryCommentsRequest, RestoreInfo, SortOrder, SortOrderWithLiterals, Sorting, Status, UpdateCommentReplyRequest, UpdateCommentRequest, UpdateCommentResponse, UpdateCommentStatusRequest, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.mjs';
4
+
5
+ declare function getComment$1(httpClient: HttpClient): GetCommentSignature;
6
+ interface GetCommentSignature {
8
7
  /**
9
- * Comment ID.
10
- * @format GUID
11
- * @readonly
8
+ * Retrieves a Comment.
9
+ * @param - ID of the Comment to retrieve.
10
+ * @returns The requested Comment.
12
11
  */
13
- _id?: string;
12
+ (commentId: string): Promise<NonNullablePaths<Comment, `_id` | `feedbackId` | `metaSiteId` | `commenterId` | `message` | `status` | `commentLocation.pageId` | `commentLocation.x` | `commentLocation.y` | `commentLocation.breakpoint._id` | `commentLocation.breakpoint.minWidth` | `commentLocation.breakpoint.maxWidth` | `commentLocation.innerPath` | `commentLocation.position.selector` | `commentLocation.position.offsetXPct` | `commentLocation.position.offsetYPct` | `commentLocation.position.innerPath` | `replies` | `replies.${number}.replierId` | `replies.${number}.message`, 2>>;
13
+ }
14
+ declare function queryComments$1(httpClient: HttpClient): QueryCommentsSignature;
15
+ interface QueryCommentsSignature {
14
16
  /**
15
- * Revision number, which increments by 1 each time the Comment is updated.
16
- * To prevent conflicting changes,
17
- * the current revision must be passed when updating the Comment.
17
+ * Retrieves a list of Comments, given the provided [paging, filtering, and sorting][1].
18
18
  *
19
- * Ignored when creating a Comment.
20
- * @readonly
21
- */
22
- revision?: string | null;
23
- /**
24
- * Date and time the Comment was created.
25
- * @readonly
26
- */
27
- _createdDate?: Date | null;
28
- /**
29
- * Date and time the Comment was last updated.
30
- * @readonly
31
- */
32
- _updatedDate?: Date | null;
33
- /**
34
- * ID of the feedback session the Comment belongs to.
35
- * @format GUID
36
- * @readonly
37
- */
38
- feedbackId?: string;
39
- /**
40
- * ID of the site the Comment was left on.
41
- * @format GUID
42
- * @readonly
43
- */
44
- metaSiteId?: string;
45
- /**
46
- * ID of the Wix user or site visitor who left the Comment.
47
- * @format GUID
48
- * @readonly
49
- */
50
- commenterId?: string;
51
- /**
52
- * Text of the Comment.
53
- * @minLength 2
54
- * @maxLength 2000
55
- */
56
- message?: string;
57
- /**
58
- * Triage status of the Comment.
19
+ * Up to 1,000 Comments can be returned per request.
59
20
  *
60
- * Read-only: the site owner changes it with Update Comment Status, and no other flow may set it.
61
- * @readonly
62
- */
63
- status?: StatusWithLiterals;
64
- /** Where on the page the Comment is anchored. */
65
- commentLocation?: CommentLocation;
66
- /**
67
- * Replies to the Comment, ordered oldest first.
21
+ * To learn how to query Comments, see [API Query Language][2].
68
22
  *
69
- * A reply is addressed by its index in this list, so indexes shift when a reply is deleted.
70
- * Pass the Comment's current `revision` when updating or deleting a reply to be sure the index
71
- * you're addressing is still the one you read.
72
- * @readonly
73
- * @maxSize 1000
74
- */
75
- replies?: CommentReply[];
76
- }
77
- /** Triage status of a comment. */
78
- declare enum Status {
79
- /** The comment hasn't been read yet. */
80
- NEW = "NEW",
81
- /** The comment has been read but isn't resolved. */
82
- OPEN = "OPEN",
83
- /** The comment has been dealt with. */
84
- RESOLVED = "RESOLVED"
85
- }
86
- /** @enumType */
87
- type StatusWithLiterals = Status | 'NEW' | 'OPEN' | 'RESOLVED';
88
- /** Where on a site page a Comment is anchored. */
89
- interface CommentLocation {
90
- /**
91
- * ID of the editor page the Comment was left on.
92
- * @maxLength 100
93
- */
94
- pageId?: string;
95
- /** Horizontal position of the Comment on the page. */
96
- x?: number;
97
- /** Vertical position of the Comment on the page. */
98
- y?: number;
99
- /** Responsive-design breakpoint the Comment was left at. */
100
- breakpoint?: Breakpoint;
101
- /**
102
- * Inner path of the Wix dynamic page the Comment was left on.
103
- * @maxLength 2048
104
- */
105
- innerPath?: string;
106
- /** Position of the Comment relative to the element it's attached to. */
107
- position?: Position;
108
- }
109
- /** Responsive-design breakpoint a Comment was left at. */
110
- interface Breakpoint {
111
- /**
112
- * Breakpoint ID.
113
- * @maxLength 100
114
- */
115
- _id?: string;
116
- /** Lowest viewport width the breakpoint applies to, in pixels. */
117
- minWidth?: number;
118
- /** Highest viewport width the breakpoint applies to, in pixels. */
119
- maxWidth?: number;
120
- }
121
- /** Position of a Comment relative to the page element it's attached to. */
122
- interface Position {
123
- /**
124
- * DOM selector of the target element.
125
- * @maxLength 1024
126
- */
127
- selector?: string;
128
- /** Horizontal offset within the element, as a percentage of its width. */
129
- offsetXPct?: number;
130
- /** Vertical offset within the element, as a percentage of its height. */
131
- offsetYPct?: number;
132
- /**
133
- * Inner path of the Wix dynamic page the element is on.
134
- * @maxLength 2048
135
- */
136
- innerPath?: string;
137
- }
138
- /** A reply to a Comment. */
139
- interface CommentReply {
140
- /**
141
- * ID of the Wix user or site visitor who wrote the reply.
142
- * @format GUID
143
- * @readonly
144
- */
145
- replierId?: string;
146
- /**
147
- * Text of the reply.
148
- * @minLength 1
149
- * @maxLength 2000
23
+ * [1]: https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging
24
+ * [2]: https://dev.wix.com/docs/rest/articles/getting-started/api-query-language
25
+ * @param - Query options.
150
26
  */
151
- message?: string;
152
- /**
153
- * Date and time the reply was created.
154
- * @readonly
155
- */
156
- _createdDate?: Date | null;
157
- }
158
- interface GetCommentRequest {
159
- /**
160
- * ID of the Comment to retrieve.
161
- * @format GUID
162
- */
163
- commentId: string;
27
+ (query: CursorQuery): Promise<NonNullablePaths<QueryCommentsResponse, `comments` | `comments.${number}._id` | `comments.${number}.feedbackId` | `comments.${number}.metaSiteId` | `comments.${number}.commenterId` | `comments.${number}.message` | `comments.${number}.status` | `comments.${number}.commentLocation.pageId` | `comments.${number}.commentLocation.x` | `comments.${number}.commentLocation.y` | `comments.${number}.commentLocation.breakpoint._id` | `comments.${number}.commentLocation.breakpoint.minWidth` | `comments.${number}.commentLocation.breakpoint.maxWidth` | `comments.${number}.commentLocation.innerPath` | `comments.${number}.commentLocation.position.selector` | `comments.${number}.commentLocation.position.offsetXPct` | `comments.${number}.commentLocation.position.offsetYPct` | `comments.${number}.commentLocation.position.innerPath`, 4>>;
164
28
  }
165
- interface GetCommentResponse {
166
- /** The requested Comment. */
167
- comment?: Comment;
168
- }
169
- interface QueryCommentsRequest {
170
- /** Query options. */
171
- query?: CursorQuery;
172
- }
173
- interface CursorQuery extends CursorQueryPagingMethodOneOf {
29
+ declare function updateCommentStatus$1(httpClient: HttpClient): UpdateCommentStatusSignature;
30
+ interface UpdateCommentStatusSignature {
174
31
  /**
175
- * Cursor paging options.
32
+ * Updates the triage status of a Comment.
176
33
  *
177
- * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
178
- */
179
- cursorPaging?: CursorPaging;
180
- /**
181
- * Filter object.
34
+ * This is the only part of a Comment the site owner may change — the text belongs to whoever
35
+ * wrote it.
182
36
  *
183
- * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).
37
+ * Each time the Comment is updated, `revision` increments by 1. The current `revision` must be
38
+ * passed, which ensures you're working with the latest Comment and prevents unintended
39
+ * overwrites.
40
+ * @param - ID of the Comment to triage.
41
+ * @param - Status to set on the Comment.
184
42
  */
185
- filter?: Record<string, any> | null;
186
- /**
187
- * Sort object.
188
- *
189
- * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).
190
- * @maxSize 5
191
- */
192
- sort?: Sorting[];
43
+ (commentId: string, status: StatusWithLiterals, options: NonNullablePaths<UpdateCommentStatusOptions, `revision`, 0>): Promise<NonNullablePaths<UpdateCommentStatusResponse, `comment._id` | `comment.feedbackId` | `comment.metaSiteId` | `comment.commenterId` | `comment.message` | `comment.status` | `comment.commentLocation.pageId` | `comment.commentLocation.x` | `comment.commentLocation.y` | `comment.commentLocation.breakpoint._id` | `comment.commentLocation.breakpoint.minWidth` | `comment.commentLocation.breakpoint.maxWidth` | `comment.commentLocation.innerPath` | `comment.commentLocation.position.selector` | `comment.commentLocation.position.offsetXPct` | `comment.commentLocation.position.offsetYPct` | `comment.commentLocation.position.innerPath` | `comment.replies` | `comment.replies.${number}.replierId` | `comment.replies.${number}.message`, 3>>;
193
44
  }
194
- /** @oneof */
195
- interface CursorQueryPagingMethodOneOf {
45
+ declare function deleteComment$1(httpClient: HttpClient): DeleteCommentSignature;
46
+ interface DeleteCommentSignature {
196
47
  /**
197
- * Cursor paging options.
48
+ * Deletes a Comment.
198
49
  *
199
- * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
50
+ * Deleting a Comment also deletes its replies.
51
+ * @param - ID of the Comment to delete.
200
52
  */
201
- cursorPaging?: CursorPaging;
53
+ (commentId: string): Promise<void>;
202
54
  }
203
- interface Sorting {
55
+ declare function createCommentReply$1(httpClient: HttpClient): CreateCommentReplySignature;
56
+ interface CreateCommentReplySignature {
204
57
  /**
205
- * Name of the field to sort by.
206
- * @maxLength 512
207
- */
208
- fieldName?: string;
209
- /** Sort order. */
210
- order?: SortOrderWithLiterals;
211
- }
212
- declare enum SortOrder {
213
- ASC = "ASC",
214
- DESC = "DESC"
215
- }
216
- /** @enumType */
217
- type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';
218
- interface CursorPaging {
219
- /**
220
- * Maximum number of items to return in the results.
221
- * @max 100
222
- */
223
- limit?: number | null;
224
- /**
225
- * Pointer to the next or previous page in the list of results.
58
+ * Adds a reply to a Comment.
226
59
  *
227
- * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
228
- * Not relevant for the first request.
229
- * @maxLength 16000
60
+ * The reply is attributed to the calling user, or to the calling app when the call carries no
61
+ * user identity.
62
+ * @param - ID of the Comment to reply to.
63
+ * @param - The reply to add. Only `message` is honored.
230
64
  */
231
- cursor?: string | null;
232
- }
233
- interface QueryCommentsResponse {
234
- /** The retrieved Comments. */
235
- comments?: Comment[];
236
- /** Paging metadata. */
237
- pagingMetadata?: CursorPagingMetadata;
65
+ (commentId: string, reply: NonNullablePaths<CommentReply, `message`, 0>, options: NonNullablePaths<CreateCommentReplyOptions, `revision`, 0>): Promise<NonNullablePaths<CreateCommentReplyResponse, `comment._id` | `comment.feedbackId` | `comment.metaSiteId` | `comment.commenterId` | `comment.message` | `comment.status` | `comment.commentLocation.pageId` | `comment.commentLocation.x` | `comment.commentLocation.y` | `comment.commentLocation.breakpoint._id` | `comment.commentLocation.breakpoint.minWidth` | `comment.commentLocation.breakpoint.maxWidth` | `comment.commentLocation.innerPath` | `comment.commentLocation.position.selector` | `comment.commentLocation.position.offsetXPct` | `comment.commentLocation.position.offsetYPct` | `comment.commentLocation.position.innerPath` | `comment.replies` | `comment.replies.${number}.replierId` | `comment.replies.${number}.message`, 3>>;
238
66
  }
239
- interface CursorPagingMetadata {
240
- /** Number of items returned in current page. */
241
- count?: number | null;
242
- /** Cursor strings that point to the next page, previous page, or both. */
243
- cursors?: Cursors;
67
+ declare function updateCommentReply$1(httpClient: HttpClient): UpdateCommentReplySignature;
68
+ interface UpdateCommentReplySignature {
244
69
  /**
245
- * Whether there are more pages to retrieve following the current page.
70
+ * Updates the text of one of the caller's own replies to a Comment.
246
71
  *
247
- * + `true`: Another page of results can be retrieved.
248
- * + `false`: This is the last page.
249
- */
250
- hasNext?: boolean | null;
251
- }
252
- interface Cursors {
253
- /**
254
- * Cursor string pointing to the next page in the list of results.
255
- * @maxLength 16000
256
- */
257
- next?: string | null;
258
- /**
259
- * Cursor pointing to the previous page in the list of results.
260
- * @maxLength 16000
261
- */
262
- prev?: string | null;
263
- }
264
- interface UpdateCommentStatusRequest {
265
- /**
266
- * ID of the Comment to triage.
267
- * @format GUID
268
- */
269
- commentId: string;
270
- /** Status to set on the Comment. */
271
- status: StatusWithLiterals;
272
- /** Current revision of the Comment. */
273
- revision: string | null;
274
- }
275
- interface UpdateCommentStatusResponse {
276
- /** The updated Comment. */
277
- comment?: Comment;
278
- }
279
- interface DeleteCommentRequest {
280
- /**
281
- * ID of the Comment to delete.
282
- * @format GUID
283
- */
284
- commentId: string;
285
- }
286
- interface DeleteCommentResponse {
287
- }
288
- interface CreateCommentReplyRequest {
289
- /**
290
- * ID of the Comment to reply to.
291
- * @format GUID
292
- */
293
- commentId: string;
294
- /** The reply to add. Only `message` is honored. */
295
- reply: CommentReply;
296
- /** Current revision of the Comment. */
297
- revision: string | null;
298
- }
299
- interface CreateCommentReplyResponse {
300
- /** The Comment, including the new reply. */
301
- comment?: Comment;
302
- }
303
- interface UpdateCommentReplyRequest {
304
- /**
305
- * ID of the Comment the reply belongs to.
306
- * @format GUID
307
- */
308
- commentId: string;
309
- /** Position of the reply in the Comment's `replies` list. */
310
- replyIndex: number;
311
- /**
312
- * New text for the reply.
313
- * @minLength 1
314
- * @maxLength 2000
315
- */
316
- message: string;
317
- /** Current revision of the Comment. */
318
- revision: string | null;
319
- }
320
- interface UpdateCommentReplyResponse {
321
- /** The Comment, including the updated reply. */
322
- comment?: Comment;
323
- }
324
- interface DeleteCommentReplyRequest {
325
- /**
326
- * ID of the Comment the reply belongs to.
327
- * @format GUID
328
- */
329
- commentId: string;
330
- /** Position of the reply in the Comment's `replies` list. */
331
- replyIndex: number;
332
- /** Current revision of the Comment. */
333
- revision: string | null;
334
- }
335
- interface DeleteCommentReplyResponse {
336
- /** The Comment, without the deleted reply. */
337
- comment?: Comment;
338
- }
339
- interface DomainEvent extends DomainEventBodyOneOf {
340
- createdEvent?: EntityCreatedEvent;
341
- updatedEvent?: EntityUpdatedEvent;
342
- deletedEvent?: EntityDeletedEvent;
343
- actionEvent?: ActionEvent;
344
- /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
345
- _id?: string;
346
- /**
347
- * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
348
- * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
349
- */
350
- entityFqdn?: string;
351
- /**
352
- * Event action name, placed at the top level to make it easier for users to dispatch messages.
353
- * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
354
- */
355
- slug?: string;
356
- /** ID of the entity associated with the event. */
357
- entityId?: string;
358
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
359
- eventTime?: Date | null;
360
- /**
361
- * Whether the event was triggered as a result of a privacy regulation application
362
- * (for example, GDPR).
363
- */
364
- triggeredByAnonymizeRequest?: boolean | null;
365
- /** If present, indicates the action that triggered the event. */
366
- originatedFrom?: string | null;
367
- /**
368
- * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.
369
- * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
370
- */
371
- entityEventSequence?: string | null;
372
- }
373
- /** @oneof */
374
- interface DomainEventBodyOneOf {
375
- createdEvent?: EntityCreatedEvent;
376
- updatedEvent?: EntityUpdatedEvent;
377
- deletedEvent?: EntityDeletedEvent;
378
- actionEvent?: ActionEvent;
379
- }
380
- interface EntityCreatedEvent {
381
- entity?: string;
382
- }
383
- interface RestoreInfo {
384
- deletedDate?: Date | null;
385
- }
386
- interface EntityUpdatedEvent {
387
- /**
388
- * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
389
- * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
390
- * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
391
- */
392
- currentEntity?: string;
393
- }
394
- interface EntityDeletedEvent {
395
- /** Entity that was deleted. */
396
- deletedEntity?: string | null;
397
- }
398
- interface ActionEvent {
399
- body?: string;
400
- }
401
- interface MessageEnvelope {
402
- /**
403
- * App instance ID.
404
- * @format GUID
405
- */
406
- instanceId?: string | null;
407
- /**
408
- * Event type.
409
- * @maxLength 150
410
- */
411
- eventType?: string;
412
- /** The identification type and identity data. */
413
- identity?: IdentificationData;
414
- /** Stringify payload. */
415
- data?: string;
416
- /** Details related to the account */
417
- accountInfo?: AccountInfo;
418
- }
419
- interface IdentificationData extends IdentificationDataIdOneOf {
420
- /**
421
- * ID of a site visitor that has not logged in to the site.
422
- * @format GUID
423
- */
424
- anonymousVisitorId?: string;
425
- /**
426
- * ID of a site visitor that has logged in to the site.
427
- * @format GUID
428
- */
429
- memberId?: string;
430
- /**
431
- * ID of a Wix user (site owner, contributor, etc.).
432
- * @format GUID
433
- */
434
- wixUserId?: string;
435
- /**
436
- * ID of an app.
437
- * @format GUID
72
+ * The reply is addressed by `reply_index`, its position in the Comment's `replies` list. Because
73
+ * indexes shift when a reply is deleted, the Comment's current `revision` must be passed; a stale
74
+ * `revision` is rejected rather than applied to whichever reply now sits at that index.
75
+ * @param - New text for the reply.
438
76
  */
439
- appId?: string;
440
- /** @readonly */
441
- identityType?: WebhookIdentityTypeWithLiterals;
77
+ (identifiers: NonNullablePaths<UpdateCommentReplyIdentifiers, `commentId` | `replyIndex`, 0>, message: string, options: NonNullablePaths<UpdateCommentReplyOptions, `revision`, 0>): Promise<NonNullablePaths<UpdateCommentReplyResponse, `comment._id` | `comment.feedbackId` | `comment.metaSiteId` | `comment.commenterId` | `comment.message` | `comment.status` | `comment.commentLocation.pageId` | `comment.commentLocation.x` | `comment.commentLocation.y` | `comment.commentLocation.breakpoint._id` | `comment.commentLocation.breakpoint.minWidth` | `comment.commentLocation.breakpoint.maxWidth` | `comment.commentLocation.innerPath` | `comment.commentLocation.position.selector` | `comment.commentLocation.position.offsetXPct` | `comment.commentLocation.position.offsetYPct` | `comment.commentLocation.position.innerPath` | `comment.replies` | `comment.replies.${number}.replierId` | `comment.replies.${number}.message`, 3>>;
442
78
  }
443
- /** @oneof */
444
- interface IdentificationDataIdOneOf {
445
- /**
446
- * ID of a site visitor that has not logged in to the site.
447
- * @format GUID
448
- */
449
- anonymousVisitorId?: string;
79
+ declare function deleteCommentReply$1(httpClient: HttpClient): DeleteCommentReplySignature;
80
+ interface DeleteCommentReplySignature {
450
81
  /**
451
- * ID of a site visitor that has logged in to the site.
452
- * @format GUID
453
- */
454
- memberId?: string;
455
- /**
456
- * ID of a Wix user (site owner, contributor, etc.).
457
- * @format GUID
458
- */
459
- wixUserId?: string;
460
- /**
461
- * ID of an app.
462
- * @format GUID
463
- */
464
- appId?: string;
465
- }
466
- declare enum WebhookIdentityType {
467
- UNKNOWN = "UNKNOWN",
468
- ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
469
- MEMBER = "MEMBER",
470
- WIX_USER = "WIX_USER",
471
- APP = "APP"
472
- }
473
- /** @enumType */
474
- type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
475
- interface AccountInfo {
476
- /**
477
- * ID of the Wix account associated with the event.
478
- * @format GUID
479
- */
480
- accountId?: string | null;
481
- /**
482
- * ID of the parent Wix account. Only included when accountId belongs to a child account.
483
- * @format GUID
484
- */
485
- parentAccountId?: string | null;
486
- /**
487
- * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.
488
- * @format GUID
489
- */
490
- siteId?: string | null;
491
- }
492
- interface CreateCommentRequest {
493
- /**
494
- * ID of the feedback session to leave the Comment on.
495
- * @format GUID
496
- */
497
- feedbackId?: string;
498
- /** The Comment to leave. */
499
- comment?: Comment;
500
- }
501
- interface CreateCommentResponse {
502
- /** The created Comment. */
503
- comment?: Comment;
504
- }
505
- interface UpdateCommentRequest {
506
- /**
507
- * The Comment to update, carrying its `id`, its current `revision`, and the new values for the
508
- * fields named in `field_mask`.
509
- */
510
- comment?: Comment;
511
- }
512
- interface UpdateCommentResponse {
513
- /** The updated Comment. */
514
- comment?: Comment;
515
- }
516
- interface UpdateCommentStatusOptions {
517
- /** Current revision of the Comment. */
518
- revision: string | null;
519
- }
520
- interface CreateCommentReplyOptions {
521
- /** Current revision of the Comment. */
522
- revision: string | null;
523
- }
524
- interface UpdateCommentReplyIdentifiers {
525
- /**
526
- * ID of the Comment the reply belongs to.
527
- * @format GUID
528
- */
529
- commentId: string;
530
- /** Position of the reply in the Comment's `replies` list. */
531
- replyIndex: number;
532
- }
533
- interface UpdateCommentReplyOptions {
534
- /** Current revision of the Comment. */
535
- revision: string | null;
536
- }
537
- interface DeleteCommentReplyIdentifiers {
538
- /**
539
- * ID of the Comment the reply belongs to.
540
- * @format GUID
82
+ * Deletes a reply to a Comment.
83
+ *
84
+ * The site owner may delete any reply, not only their own, as part of moderating the Comment.
85
+ *
86
+ * The reply is addressed by `reply_index`, its position in the Comment's `replies` list. Because
87
+ * indexes shift when a reply is deleted, the Comment's current `revision` must be passed; a stale
88
+ * `revision` is rejected rather than applied to whichever reply now sits at that index.
89
+ * @param - Current revision of the Comment.
541
90
  */
542
- commentId: string;
543
- /** Position of the reply in the Comment's `replies` list. */
544
- replyIndex: number;
91
+ (identifiers: NonNullablePaths<DeleteCommentReplyIdentifiers, `commentId` | `replyIndex`, 0>, revision: string): Promise<NonNullablePaths<DeleteCommentReplyResponse, `comment._id` | `comment.feedbackId` | `comment.metaSiteId` | `comment.commenterId` | `comment.message` | `comment.status` | `comment.commentLocation.pageId` | `comment.commentLocation.x` | `comment.commentLocation.y` | `comment.commentLocation.breakpoint._id` | `comment.commentLocation.breakpoint.minWidth` | `comment.commentLocation.breakpoint.maxWidth` | `comment.commentLocation.innerPath` | `comment.commentLocation.position.selector` | `comment.commentLocation.position.offsetXPct` | `comment.commentLocation.position.offsetYPct` | `comment.commentLocation.position.innerPath` | `comment.replies` | `comment.replies.${number}.replierId` | `comment.replies.${number}.message`, 3>>;
545
92
  }
93
+ declare const onCommentCreated$1: EventDefinition<CommentCreatedEnvelope, "wix.partners.feedback.v1.comment_created">;
94
+ declare const onCommentDeleted$1: EventDefinition<CommentDeletedEnvelope, "wix.partners.feedback.v1.comment_deleted">;
95
+ declare const onCommentUpdated$1: EventDefinition<CommentUpdatedEnvelope, "wix.partners.feedback.v1.comment_updated">;
96
+
97
+ declare const getComment: MaybeContext<BuildRESTFunction<typeof getComment$1> & typeof getComment$1>;
98
+ declare const queryComments: MaybeContext<BuildRESTFunction<typeof queryComments$1> & typeof queryComments$1>;
99
+ declare const updateCommentStatus: MaybeContext<BuildRESTFunction<typeof updateCommentStatus$1> & typeof updateCommentStatus$1>;
100
+ declare const deleteComment: MaybeContext<BuildRESTFunction<typeof deleteComment$1> & typeof deleteComment$1>;
101
+ declare const createCommentReply: MaybeContext<BuildRESTFunction<typeof createCommentReply$1> & typeof createCommentReply$1>;
102
+ declare const updateCommentReply: MaybeContext<BuildRESTFunction<typeof updateCommentReply$1> & typeof updateCommentReply$1>;
103
+ declare const deleteCommentReply: MaybeContext<BuildRESTFunction<typeof deleteCommentReply$1> & typeof deleteCommentReply$1>;
104
+ /** */
105
+ declare const onCommentCreated: BuildEventDefinition<typeof onCommentCreated$1> & typeof onCommentCreated$1;
106
+ /** */
107
+ declare const onCommentDeleted: BuildEventDefinition<typeof onCommentDeleted$1> & typeof onCommentDeleted$1;
108
+ /** */
109
+ declare const onCommentUpdated: BuildEventDefinition<typeof onCommentUpdated$1> & typeof onCommentUpdated$1;
546
110
 
547
- export { type AccountInfo, type ActionEvent, type Breakpoint, type Comment, type CommentLocation, type CommentReply, type CreateCommentReplyOptions, type CreateCommentReplyRequest, type CreateCommentReplyResponse, type CreateCommentRequest, type CreateCommentResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DeleteCommentReplyIdentifiers, type DeleteCommentReplyRequest, type DeleteCommentReplyResponse, type DeleteCommentRequest, type DeleteCommentResponse, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type GetCommentRequest, type GetCommentResponse, type IdentificationData, type IdentificationDataIdOneOf, type MessageEnvelope, type Position, type QueryCommentsRequest, type QueryCommentsResponse, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, Status, type StatusWithLiterals, type UpdateCommentReplyIdentifiers, type UpdateCommentReplyOptions, type UpdateCommentReplyRequest, type UpdateCommentReplyResponse, type UpdateCommentRequest, type UpdateCommentResponse, type UpdateCommentStatusOptions, type UpdateCommentStatusRequest, type UpdateCommentStatusResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals };
111
+ export { Comment, CommentCreatedEnvelope, CommentDeletedEnvelope, CommentReply, CommentUpdatedEnvelope, CreateCommentReplyOptions, CreateCommentReplyResponse, CursorQuery, DeleteCommentReplyIdentifiers, DeleteCommentReplyResponse, QueryCommentsResponse, StatusWithLiterals, UpdateCommentReplyIdentifiers, UpdateCommentReplyOptions, UpdateCommentReplyResponse, UpdateCommentStatusOptions, UpdateCommentStatusResponse, createCommentReply, deleteComment, deleteCommentReply, getComment, onCommentCreated, onCommentDeleted, onCommentUpdated, queryComments, updateCommentReply, updateCommentStatus };