useresponse 1.0.10 → 1.1.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/README.md +1 -1
- package/dist/api/AdditionalAPI.d.ts +1 -1
- package/dist/api/AdditionalAPI.js +2 -2
- package/dist/api/AuthAPI.d.ts +2 -2
- package/dist/api/ChatsAPI.d.ts +4 -4
- package/dist/api/CommentsAPI.d.ts +1 -1
- package/dist/api/CommentsAPI.js +2 -2
- package/dist/api/ObjectsAPI.d.ts +5 -5
- package/dist/api/ObjectsAPI.js +6 -6
- package/dist/interfaces/UseResponseInterfaces.d.ts +0 -14
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# useresponse [](https://www.npmjs.com/package/useresponse)
|
|
2
2
|
|
|
3
|
-
A [useresponse](https://www.useresponse.com/) API client. For a documentation on the API see [
|
|
3
|
+
A [useresponse](https://www.useresponse.com/) API client (API v7.0). For a documentation on the API see [the useresponse API reference](https://api.useresponse.com).
|
|
4
4
|
|
|
5
5
|
### Installation
|
|
6
6
|
|
|
@@ -22,10 +22,10 @@ class AdditionalAPI {
|
|
|
22
22
|
return data;
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
getStatuses() {
|
|
25
|
+
getStatuses(options) {
|
|
26
26
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27
27
|
const endpoint = Endpoints_1.Endpoint.Additional.statuses();
|
|
28
|
-
const { data } = yield this.apiClient.get(endpoint);
|
|
28
|
+
const { data } = yield this.apiClient.get(endpoint, { params: options });
|
|
29
29
|
return data;
|
|
30
30
|
});
|
|
31
31
|
}
|
package/dist/api/AuthAPI.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { APIClient } from '@ffflorian/api-client';
|
|
2
|
-
import type {
|
|
2
|
+
import type { LoginParams, User } from '../interfaces';
|
|
3
3
|
export declare class AuthAPI {
|
|
4
4
|
private readonly apiClient;
|
|
5
5
|
constructor(apiClient: APIClient);
|
|
6
|
-
login(loginData:
|
|
6
|
+
login(loginData: LoginParams): Promise<User>;
|
|
7
7
|
}
|
package/dist/api/ChatsAPI.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { APIClient } from '@ffflorian/api-client';
|
|
2
|
-
import {
|
|
2
|
+
import type { ChatMessagesPaginator, ChatsResponse, GetChatResponse } from '../interfaces';
|
|
3
3
|
export interface GetAllChatOptions {
|
|
4
|
-
authorId?:
|
|
4
|
+
authorId?: number;
|
|
5
5
|
page?: number;
|
|
6
6
|
}
|
|
7
7
|
export declare class ChatsAPI {
|
|
8
8
|
private readonly apiClient;
|
|
9
9
|
constructor(apiClient: APIClient);
|
|
10
|
-
getAllChats(options?: GetAllChatOptions): Promise<
|
|
11
|
-
getChat(chatId: string): Promise<
|
|
10
|
+
getAllChats(options?: GetAllChatOptions): Promise<ChatsResponse>;
|
|
11
|
+
getChat(chatId: string): Promise<GetChatResponse>;
|
|
12
12
|
getMessages(chatId: string): Promise<ChatMessagesPaginator>;
|
|
13
13
|
}
|
|
@@ -6,7 +6,7 @@ export declare class CommentsAPI {
|
|
|
6
6
|
addComment(comment: CommentAddParams): Promise<CommentActionResponse>;
|
|
7
7
|
editComment(commentId: string, comment: CommentEditParams): Promise<CommentActionResponse>;
|
|
8
8
|
getComments(options?: Record<string, unknown>): Promise<CommentsListResponse>;
|
|
9
|
-
getObjectComments(objectId: string): Promise<CommentsListResponse>;
|
|
9
|
+
getObjectComments(objectId: string, options?: Record<string, unknown>): Promise<CommentsListResponse>;
|
|
10
10
|
recoverComment(commentId: string): Promise<CommentActionResponse>;
|
|
11
11
|
toggleBestComment(commentId: string): Promise<CommentActionResponse>;
|
|
12
12
|
toggleVoteComment(commentId: string): Promise<CommentActionResponse>;
|
package/dist/api/CommentsAPI.js
CHANGED
|
@@ -36,10 +36,10 @@ class CommentsAPI {
|
|
|
36
36
|
return data;
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
getObjectComments(objectId) {
|
|
39
|
+
getObjectComments(objectId, options) {
|
|
40
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
41
|
const endpoint = Endpoints_1.Endpoint.Comments.objectComments(objectId);
|
|
42
|
-
const { data } = yield this.apiClient.get(endpoint);
|
|
42
|
+
const { data } = yield this.apiClient.get(endpoint, { params: options });
|
|
43
43
|
return data;
|
|
44
44
|
});
|
|
45
45
|
}
|
package/dist/api/ObjectsAPI.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { APIClient } from '@ffflorian/api-client';
|
|
2
|
-
import type { CreateObjectResponse, EditObjectResponse, ObjectAddParams, ObjectEditParams,
|
|
2
|
+
import type { CreateObjectResponse, EditObjectResponse, ObjectAddParams, ObjectEditParams, SearchResponse, Object as UseResponseObject } from '../interfaces';
|
|
3
3
|
export declare class ObjectsAPI {
|
|
4
4
|
private readonly apiClient;
|
|
5
5
|
constructor(apiClient: APIClient);
|
|
@@ -9,11 +9,11 @@ export declare class ObjectsAPI {
|
|
|
9
9
|
deleteObject(objectId: string): Promise<EditObjectResponse>;
|
|
10
10
|
editObject(objectId: string, object: ObjectEditParams): Promise<EditObjectResponse>;
|
|
11
11
|
getObject(objectId: string): Promise<UseResponseObject>;
|
|
12
|
-
getTickets(options?: Record<string, unknown>): Promise<
|
|
12
|
+
getTickets(options?: Record<string, unknown>): Promise<SearchResponse>;
|
|
13
13
|
search(options?: Record<string, unknown>): Promise<SearchResponse>;
|
|
14
|
-
subscribe(objectId: string): Promise<EditObjectResponse>;
|
|
14
|
+
subscribe(objectId: string, userId?: number): Promise<EditObjectResponse>;
|
|
15
15
|
toggleComments(objectId: string): Promise<EditObjectResponse>;
|
|
16
|
-
toggleVote(objectId: string): Promise<EditObjectResponse>;
|
|
16
|
+
toggleVote(objectId: string, value: 'down' | 'revert' | 'up'): Promise<EditObjectResponse>;
|
|
17
17
|
trashObject(objectId: string): Promise<EditObjectResponse>;
|
|
18
|
-
unsubscribe(objectId: string): Promise<EditObjectResponse>;
|
|
18
|
+
unsubscribe(objectId: string, userId?: number): Promise<EditObjectResponse>;
|
|
19
19
|
}
|
package/dist/api/ObjectsAPI.js
CHANGED
|
@@ -71,10 +71,10 @@ class ObjectsAPI {
|
|
|
71
71
|
return data;
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
|
-
subscribe(objectId) {
|
|
74
|
+
subscribe(objectId, userId) {
|
|
75
75
|
return __awaiter(this, void 0, void 0, function* () {
|
|
76
76
|
const endpoint = Endpoints_1.Endpoint.Objects.subscribe(objectId);
|
|
77
|
-
const { data } = yield this.apiClient.post(endpoint);
|
|
77
|
+
const { data } = yield this.apiClient.post(endpoint, undefined, { params: { user_id: userId } });
|
|
78
78
|
return data;
|
|
79
79
|
});
|
|
80
80
|
}
|
|
@@ -85,10 +85,10 @@ class ObjectsAPI {
|
|
|
85
85
|
return data;
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
|
-
toggleVote(objectId) {
|
|
88
|
+
toggleVote(objectId, value) {
|
|
89
89
|
return __awaiter(this, void 0, void 0, function* () {
|
|
90
90
|
const endpoint = Endpoints_1.Endpoint.Objects.toggleVote(objectId);
|
|
91
|
-
const { data } = yield this.apiClient.post(endpoint);
|
|
91
|
+
const { data } = yield this.apiClient.post(endpoint, undefined, { params: { value } });
|
|
92
92
|
return data;
|
|
93
93
|
});
|
|
94
94
|
}
|
|
@@ -99,10 +99,10 @@ class ObjectsAPI {
|
|
|
99
99
|
return data;
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
|
-
unsubscribe(objectId) {
|
|
102
|
+
unsubscribe(objectId, userId) {
|
|
103
103
|
return __awaiter(this, void 0, void 0, function* () {
|
|
104
104
|
const endpoint = Endpoints_1.Endpoint.Objects.unsubscribe(objectId);
|
|
105
|
-
const { data } = yield this.apiClient.post(endpoint);
|
|
105
|
+
const { data } = yield this.apiClient.post(endpoint, undefined, { params: { user_id: userId } });
|
|
106
106
|
return data;
|
|
107
107
|
});
|
|
108
108
|
}
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
export interface APIResult<T> {
|
|
2
|
-
currentPage?: number;
|
|
3
|
-
data: T;
|
|
4
|
-
firstPage: number;
|
|
5
|
-
lastPage: number;
|
|
6
|
-
nextPage: number;
|
|
7
|
-
objectsPerPage: number;
|
|
8
|
-
totalObjects: number;
|
|
9
|
-
totalPages: number;
|
|
10
|
-
}
|
|
11
1
|
export interface Attachment {
|
|
12
2
|
directUrl?: string;
|
|
13
3
|
icon?: string;
|
|
@@ -308,10 +298,6 @@ export interface Forum {
|
|
|
308
298
|
export interface GetChatResponse {
|
|
309
299
|
success?: Chat;
|
|
310
300
|
}
|
|
311
|
-
export interface LoginData {
|
|
312
|
-
password: string;
|
|
313
|
-
username: string;
|
|
314
|
-
}
|
|
315
301
|
export interface LoginParams {
|
|
316
302
|
/** @example support@useresponse.com */
|
|
317
303
|
email: string;
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "Florian Imdahl <git@ffflorian.de>",
|
|
3
3
|
"dependencies": {
|
|
4
|
-
"@ffflorian/api-client": "2.5.
|
|
4
|
+
"@ffflorian/api-client": "2.5.11"
|
|
5
5
|
},
|
|
6
|
-
"description": "A useresponse API client",
|
|
6
|
+
"description": "A useresponse API client (API v7.0)",
|
|
7
7
|
"devDependencies": {
|
|
8
8
|
"@types/node": "~26",
|
|
9
|
-
"rimraf": "6.1.
|
|
9
|
+
"rimraf": "6.1.4",
|
|
10
10
|
"typedoc": "0.28.20",
|
|
11
11
|
"typescript": "7.0.2",
|
|
12
|
-
"vite": "8.3.
|
|
13
|
-
"vitest": "5.0
|
|
12
|
+
"vite": "8.3.6",
|
|
13
|
+
"vitest": "5.1.0"
|
|
14
14
|
},
|
|
15
15
|
"engines": {
|
|
16
16
|
"node": ">= 21"
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"dist": "yarn clean && yarn build",
|
|
40
40
|
"test": "vitest"
|
|
41
41
|
},
|
|
42
|
-
"version": "1.0
|
|
42
|
+
"version": "1.1.0"
|
|
43
43
|
}
|