@meowinc/meow-sdk 0.15.4 → 0.16.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,4 +6,5 @@ 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
+ getUsedAppsByLogin(login: string): Promise<import("../../types").MeowResult<import("./get-used-apps-by-login").Response>>;
9
10
  }
@@ -1,6 +1,7 @@
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";
4
5
  export class UserRequests {
5
6
  authProvider;
6
7
  constructor(authProvider) {
@@ -15,4 +16,7 @@ export class UserRequests {
15
16
  async updateUserLastActivity(payload) {
16
17
  return await updateUserLastActivity(payload, this.authProvider);
17
18
  }
19
+ async getUsedAppsByLogin(login) {
20
+ return await getUsedAppsByLoginRequest(login);
21
+ }
18
22
  }
package/dist/index.d.ts CHANGED
@@ -24,6 +24,7 @@ export declare class MeowSdkClient<T extends AuthorizationProvider> {
24
24
  updateTokens(accessToken: string, refreshToken: string): void;
25
25
  getAccessToken(): UndefinedString;
26
26
  getParsedAccessToken(): AccessToken | undefined;
27
+ getRefreshToken(): UndefinedString;
27
28
  onAuthorizationUpdated(callback: AuthorizationUpdateHandler): this;
28
29
  tryUpdateAuth(forceUpdate?: boolean): Promise<MeowResult<void>>;
29
30
  isContainExpectedPermission(permission: string): boolean;
package/dist/index.js CHANGED
@@ -40,6 +40,9 @@ export class MeowSdkClient {
40
40
  }
41
41
  return new AccessToken(token);
42
42
  }
43
+ getRefreshToken() {
44
+ return this.authProvider.getRefreshToken();
45
+ }
43
46
  onAuthorizationUpdated(callback) {
44
47
  this.authProvider.onUpdate(callback);
45
48
  return this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meowinc/meow-sdk",
3
- "version": "0.15.4",
3
+ "version": "0.16.0",
4
4
  "description": "Meow SDK",
5
5
  "keywords": [
6
6
  "sdk"