anixartjs 0.0.6 → 0.0.7

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,5 +1,5 @@
1
1
  import { Anixart } from "../client";
2
- import { IPageableResponse, IResponse, IBaseApiParams, ICollectionResponse, IRelease, ICollection, IReleaseInCollectionRequest, ICollectionCreateRequest } from "../types";
2
+ import { IPageableResponse, IResponse, IBaseApiParams, ICollectionResponse, IRelease, ICollection, IReleaseInCollectionRequest, ICollectionCreateRequest, ICollectionComment } from "../types";
3
3
  /**
4
4
  * Класс коллекции
5
5
  *
@@ -27,4 +27,7 @@ export declare class Collection {
27
27
  */
28
28
  addReleaseToCollection(collectionId: number, releaseId: number, options?: IBaseApiParams): Promise<IResponse>;
29
29
  deleteCollection(id: number, options?: IBaseApiParams): Promise<IResponse>;
30
+ getComments(id: number, page: number, sort: number, options?: IBaseApiParams): Promise<IPageableResponse<ICollectionComment>>;
31
+ getComment(id: number, options?: IBaseApiParams): Promise<IResponse & ICollectionComment>;
32
+ getCommentReplies(id: number, page: number, sort: number, options?: IBaseApiParams): Promise<IPageableResponse<ICollectionComment>>;
30
33
  }
@@ -53,5 +53,14 @@ class Collection {
53
53
  async deleteCollection(id, options) {
54
54
  return await this.client.call({ path: `/collectionMy/delete/${id}`, ...options });
55
55
  }
56
+ async getComments(id, page, sort, options) {
57
+ return await this.client.call({ path: `/collection/comment/all/${id}/${page}`, queryParams: { sort }, ...options });
58
+ }
59
+ async getComment(id, options) {
60
+ return await this.client.call({ path: `/collection/comment/${id}`, ...options });
61
+ }
62
+ async getCommentReplies(id, page, sort, options) {
63
+ return await this.client.call({ path: `/collection/comment/replies/${id}/${page}`, queryParams: { sort }, method: "POST", ...options });
64
+ }
56
65
  }
57
66
  exports.Collection = Collection;
@@ -2,6 +2,7 @@ import { IProfile } from "./profile";
2
2
  import { IRelease } from "./release";
3
3
  import { IResponse } from "./response";
4
4
  import { IBaseRequestPageable } from "./request";
5
+ import { BaseComment } from "../classes/BaseComment";
5
6
  export interface ICollection {
6
7
  '@id': number;
7
8
  id: number;
@@ -36,3 +37,6 @@ export interface ICollectionCreateRequest {
36
37
  releases: number[];
37
38
  is_private: boolean;
38
39
  }
40
+ export interface ICollectionComment extends BaseComment {
41
+ collection: ICollection;
42
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anixartjs",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Anixart API Wrapper for NodeJS",
5
5
  "type": "commonjs",
6
6
  "main": "dist/index.js",