@23blocks/block-content 3.1.0 → 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
  }
@@ -745,4 +776,4 @@ const contentBlockMetadata = {
745
776
  ]
746
777
  };
747
778
 
748
- export { categoryMapper, commentMapper, contentBlockMetadata, createCategoriesService, createCommentsService, createContentBlock, createPostsService, createTagsService, postMapper, tagMapper };
779
+ export { categoryMapper, commentMapper, contentBlockMetadata, contentUserMapper, createCategoriesService, createCommentsService, createContentBlock, createContentUsersService, createPostsService, createTagsService, postMapper, tagMapper };
@@ -1,7 +1,6 @@
1
1
  export { createContentBlock, contentBlockMetadata } from './lib/content.block';
2
2
  export type { ContentBlock, ContentBlockConfig } from './lib/content.block';
3
- export type { Post, CreatePostRequest, UpdatePostRequest, ListPostsParams, Comment, CreateCommentRequest, UpdateCommentRequest, ListCommentsParams, Category, CreateCategoryRequest, UpdateCategoryRequest, ListCategoriesParams, Tag, CreateTagRequest, UpdateTagRequest, ListTagsParams, } from './lib/types';
4
- export type { PostsService, CommentsService, CategoriesService, TagsService, } from './lib/services';
5
- export { createPostsService, createCommentsService, createCategoriesService, createTagsService, } from './lib/services';
6
- export { postMapper, commentMapper, categoryMapper, tagMapper, } from './lib/mappers';
3
+ export * from './lib/types';
4
+ export * from './lib/services';
5
+ export * from './lib/mappers';
7
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAG5E,YAAY,EAEV,IAAI,EACJ,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EAEf,OAAO,EACP,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAElB,QAAQ,EACR,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EAEpB,GAAG,EACH,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,GACf,MAAM,aAAa,CAAC;AAGrB,YAAY,EACV,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,WAAW,GACZ,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,UAAU,EACV,aAAa,EACb,cAAc,EACd,SAAS,GACV,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAG5E,cAAc,aAAa,CAAC;AAG5B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,eAAe,CAAC"}
@@ -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,C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