@meowinc/meow-sdk 0.16.0 → 0.17.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.
|
@@ -6,5 +6,6 @@ export declare class UserRequests {
|
|
|
6
6
|
getUserByLogin(login: string): Promise<import("@meowinc/result").Result<import("./get-user-by-login").Response, string>>;
|
|
7
7
|
getUserLastActivity(login: string): Promise<import("../../types").MeowResult<import("./get-user-last-activity").Response>>;
|
|
8
8
|
updateUserLastActivity(payload: UpdateUserLastActivityPayload): Promise<import("../../types").MeowResult<void>>;
|
|
9
|
+
updateUserTags(tags: string[]): Promise<import("../../types").MeowResult<void>>;
|
|
9
10
|
getUsedAppsByLogin(login: string): Promise<import("../../types").MeowResult<import("./get-used-apps-by-login").Response>>;
|
|
10
11
|
}
|
|
@@ -2,6 +2,7 @@ import { request as getUserByLoginRequest } from "./get-user-by-login";
|
|
|
2
2
|
import { request as getUserLastActivity } from "./get-user-last-activity";
|
|
3
3
|
import { request as updateUserLastActivity, } from "./update-user-last-activity";
|
|
4
4
|
import { request as getUsedAppsByLoginRequest } from "./get-used-apps-by-login";
|
|
5
|
+
import { request as updateUserTagsRequest } from "./update-user-tags";
|
|
5
6
|
export class UserRequests {
|
|
6
7
|
authProvider;
|
|
7
8
|
constructor(authProvider) {
|
|
@@ -16,6 +17,9 @@ export class UserRequests {
|
|
|
16
17
|
async updateUserLastActivity(payload) {
|
|
17
18
|
return await updateUserLastActivity(payload, this.authProvider);
|
|
18
19
|
}
|
|
20
|
+
async updateUserTags(tags) {
|
|
21
|
+
return await updateUserTagsRequest({ tags }, this.authProvider);
|
|
22
|
+
}
|
|
19
23
|
async getUsedAppsByLogin(login) {
|
|
20
24
|
return await getUsedAppsByLoginRequest(login);
|
|
21
25
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ACCOUNT_API } from "..";
|
|
2
|
+
import { ErrorToMessage } from "../../error";
|
|
3
|
+
import { HttpClient } from "../../http-client";
|
|
4
|
+
export async function request(payload, auth) {
|
|
5
|
+
return await new HttpClient()
|
|
6
|
+
.withUrl(`${ACCOUNT_API}/v1/user/tags`)
|
|
7
|
+
.withMethodPut()
|
|
8
|
+
.withAuthorization(auth)
|
|
9
|
+
.withJsonBody(payload)
|
|
10
|
+
.send()
|
|
11
|
+
.then((r) => r.mapError(ErrorToMessage));
|
|
12
|
+
}
|