@23blocks/block-content 3.1.1 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js
CHANGED
|
@@ -428,6 +428,21 @@ function createCommentsService(transport, _config) {
|
|
|
428
428
|
async delete (uniqueId) {
|
|
429
429
|
await transport.delete(`/comments/${uniqueId}`);
|
|
430
430
|
},
|
|
431
|
+
async reply (parentCommentUniqueId, data) {
|
|
432
|
+
const response = await transport.post('/comments', {
|
|
433
|
+
comment: {
|
|
434
|
+
post_unique_id: data.postUniqueId,
|
|
435
|
+
content: data.content,
|
|
436
|
+
thumbnail_url: data.thumbnailUrl,
|
|
437
|
+
image_url: data.imageUrl,
|
|
438
|
+
content_url: data.contentUrl,
|
|
439
|
+
media_url: data.mediaUrl,
|
|
440
|
+
parent_id: parentCommentUniqueId,
|
|
441
|
+
payload: data.payload
|
|
442
|
+
}
|
|
443
|
+
});
|
|
444
|
+
return decodeOne(response, commentMapper);
|
|
445
|
+
},
|
|
431
446
|
// Engagement
|
|
432
447
|
async like (uniqueId) {
|
|
433
448
|
const response = await transport.post(`/comments/${uniqueId}/like`, {});
|
|
@@ -436,6 +451,22 @@ function createCommentsService(transport, _config) {
|
|
|
436
451
|
async dislike (uniqueId) {
|
|
437
452
|
const response = await transport.post(`/comments/${uniqueId}/dislike`, {});
|
|
438
453
|
return decodeOne(response, commentMapper);
|
|
454
|
+
},
|
|
455
|
+
async save (uniqueId) {
|
|
456
|
+
const response = await transport.put(`/comments/${uniqueId}/save`, {});
|
|
457
|
+
return decodeOne(response, commentMapper);
|
|
458
|
+
},
|
|
459
|
+
async unsave (uniqueId) {
|
|
460
|
+
const response = await transport.delete(`/comments/${uniqueId}/unsave`);
|
|
461
|
+
return decodeOne(response, commentMapper);
|
|
462
|
+
},
|
|
463
|
+
async follow (uniqueId) {
|
|
464
|
+
const response = await transport.put(`/comments/${uniqueId}/follow`, {});
|
|
465
|
+
return decodeOne(response, commentMapper);
|
|
466
|
+
},
|
|
467
|
+
async unfollow (uniqueId) {
|
|
468
|
+
const response = await transport.delete(`/comments/${uniqueId}/unfollow`);
|
|
469
|
+
return decodeOne(response, commentMapper);
|
|
439
470
|
}
|
|
440
471
|
};
|
|
441
472
|
}
|
|
@@ -6,8 +6,13 @@ export interface CommentsService {
|
|
|
6
6
|
create(data: CreateCommentRequest): Promise<Comment>;
|
|
7
7
|
update(uniqueId: string, data: UpdateCommentRequest): Promise<Comment>;
|
|
8
8
|
delete(uniqueId: string): Promise<void>;
|
|
9
|
+
reply(parentCommentUniqueId: string, data: Omit<CreateCommentRequest, 'parentId'>): Promise<Comment>;
|
|
9
10
|
like(uniqueId: string): Promise<Comment>;
|
|
10
11
|
dislike(uniqueId: string): Promise<Comment>;
|
|
12
|
+
save(uniqueId: string): Promise<Comment>;
|
|
13
|
+
unsave(uniqueId: string): Promise<Comment>;
|
|
14
|
+
follow(uniqueId: string): Promise<Comment>;
|
|
15
|
+
unfollow(uniqueId: string): Promise<Comment>;
|
|
11
16
|
}
|
|
12
17
|
export declare function createCommentsService(transport: Transport, _config: {
|
|
13
18
|
appId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comments.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/comments.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,OAAO,EACP,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,kBAAkB,CAAC;AAG1B,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;IAChE,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACxC,MAAM,CAAC,IAAI,EAAE,oBAAoB,GAAG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