rate-core 0.0.4 → 0.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rate-core",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "rate",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./src/index.ts",
package/src/index.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Attributes, Search, SearchResult } from './core';
2
2
  import {
3
- Comment, CommentFilter, InfoRepository, Rate, RateCommentRepository, RateCommentQuery, RateFilter, RateReactionRepository,
4
- RateRepository, Rater, ShortComment, ShortRate
3
+ Comment, CommentFilter, InfoRepository, Rate, RateCommentQuery, RateCommentRepository, RateFilter, Rater,
4
+ RateReactionRepository, RateRepository, ShortComment, ShortRate
5
5
  } from './rate';
6
6
 
7
7
  export * from './rate';
@@ -142,7 +142,7 @@ export class CommentQuery implements RateCommentQuery {
142
142
  constructor(protected find: Search<Comment, CommentFilter>, protected repository: CommentRepository, private queryURL?: (ids: string[]) => Promise<URL[]>) {
143
143
  this.load = this.load.bind(this);
144
144
  this.search = this.search.bind(this);
145
- this.getComments = this.getComments.bind(this)
145
+ this.getComments = this.getComments.bind(this);
146
146
  }
147
147
  load(id: string, ctx?: any): Promise<Comment|null> {
148
148
  return this.repository.load(id, ctx);
package/src/rate.ts CHANGED
@@ -46,8 +46,9 @@ export interface Rater {
46
46
  comment(comment: Comment): Promise<number>;
47
47
  removeComment(id: string, author: string, ctx?: any): Promise<number>;
48
48
  updateComment(comment: Comment): Promise<number>;
49
+ getComments(id: string, author: string, limit?: number): Promise<Comment[]>;
50
+ getComment(id: string): Promise<Comment|null>;
49
51
  }
50
-
51
52
  export interface RateReactionRepository {
52
53
  remove(id: string, author: string, userId: string, ctx?: any): Promise<number>;
53
54
  save(id: string, author: string, userId: string, type: number): Promise<number>;