@meowinc/meow-sdk 0.15.5 → 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.
@@ -1 +1,6 @@
1
1
  export type VerificationType = "noVerification" | "loginPassword";
2
+ export interface AppModel {
3
+ id: number;
4
+ displayId: string;
5
+ name: string;
6
+ }
@@ -0,0 +1,6 @@
1
+ import { MeowResult } from "../../types";
2
+ import { AppModel } from "../types";
3
+ export interface Response {
4
+ items: AppModel[];
5
+ }
6
+ export declare function request(login: string): Promise<MeowResult<Response>>;
@@ -0,0 +1,10 @@
1
+ import { ACCOUNT_API } from "..";
2
+ import { ErrorToMessage } from "../../error";
3
+ import { HttpClient } from "../../http-client";
4
+ export async function request(login) {
5
+ return new HttpClient()
6
+ .withUrl(`${ACCOUNT_API}/v1/user/${login}/used-apps`)
7
+ .withMethodGet()
8
+ .send()
9
+ .then((r) => r.mapError(ErrorToMessage));
10
+ }
@@ -6,6 +6,7 @@ export interface Response {
6
6
  role: UserRole;
7
7
  status: string;
8
8
  avatar?: string;
9
+ tags: string[];
9
10
  registrationDate: Date;
10
11
  }
11
12
  export declare function request(login: string): Promise<import("@meowinc/result").Result<Response, string>>;
@@ -6,4 +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>>;
10
+ getUsedAppsByLogin(login: string): Promise<import("../../types").MeowResult<import("./get-used-apps-by-login").Response>>;
9
11
  }
@@ -1,6 +1,8 @@
1
1
  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
+ import { request as getUsedAppsByLoginRequest } from "./get-used-apps-by-login";
5
+ import { request as updateUserTagsRequest } from "./update-user-tags";
4
6
  export class UserRequests {
5
7
  authProvider;
6
8
  constructor(authProvider) {
@@ -15,4 +17,10 @@ export class UserRequests {
15
17
  async updateUserLastActivity(payload) {
16
18
  return await updateUserLastActivity(payload, this.authProvider);
17
19
  }
20
+ async updateUserTags(tags) {
21
+ return await updateUserTagsRequest({ tags }, this.authProvider);
22
+ }
23
+ async getUsedAppsByLogin(login) {
24
+ return await getUsedAppsByLoginRequest(login);
25
+ }
18
26
  }
@@ -0,0 +1,7 @@
1
+ import { AuthorizationProvider } from "../..";
2
+ import { MeowResult } from "../../types";
3
+ interface Payload {
4
+ tags: string[];
5
+ }
6
+ export declare function request(payload: Payload, auth: AuthorizationProvider): Promise<MeowResult<void>>;
7
+ export {};
@@ -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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meowinc/meow-sdk",
3
- "version": "0.15.5",
3
+ "version": "0.17.0",
4
4
  "description": "Meow SDK",
5
5
  "keywords": [
6
6
  "sdk"