@meowinc/meow-sdk 0.7.2 → 0.9.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/dist/account/activity/get-user-activity.d.ts +19 -0
- package/dist/account/activity/get-user-activity.js +10 -0
- package/dist/account/activity/index.d.ts +6 -0
- package/dist/account/activity/index.js +10 -0
- package/dist/account/index.d.ts +2 -0
- package/dist/account/index.js +3 -0
- package/dist/account/sessions/get-current.d.ts +16 -0
- package/dist/account/sessions/get-current.js +11 -0
- package/dist/account/sessions/index.d.ts +1 -0
- package/dist/account/sessions/index.js +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { MeowResult } from "../../types";
|
|
2
|
+
export interface Response {
|
|
3
|
+
items: {
|
|
4
|
+
id: number;
|
|
5
|
+
createdAt: string;
|
|
6
|
+
payload: ActivityPayloadType;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
type ActivityPayloadType = {
|
|
10
|
+
type: "appCreated";
|
|
11
|
+
appId: number;
|
|
12
|
+
} | {
|
|
13
|
+
type: "serviceCreated";
|
|
14
|
+
serviceId: number;
|
|
15
|
+
} | {
|
|
16
|
+
type: "accountCreated";
|
|
17
|
+
};
|
|
18
|
+
export declare function request(userLogin: string): Promise<MeowResult<Response>>;
|
|
19
|
+
export {};
|
|
@@ -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(userLogin) {
|
|
5
|
+
return await new HttpClient()
|
|
6
|
+
.withUrl(`${ACCOUNT_API}/v1/activity/${userLogin}`)
|
|
7
|
+
.withMethodGet()
|
|
8
|
+
.send()
|
|
9
|
+
.then((r) => r.mapError(ErrorToMessage));
|
|
10
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AuthorizationProvider } from "../..";
|
|
2
|
+
export declare class ActivityRequests {
|
|
3
|
+
private readonly authProvider;
|
|
4
|
+
constructor(authProvider: AuthorizationProvider);
|
|
5
|
+
getUserActivity(userLogin: string): Promise<import("../../types").MeowResult<import("./get-user-activity").Response>>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { request as getUserActivity } from "./get-user-activity";
|
|
2
|
+
export class ActivityRequests {
|
|
3
|
+
authProvider;
|
|
4
|
+
constructor(authProvider) {
|
|
5
|
+
this.authProvider = authProvider;
|
|
6
|
+
}
|
|
7
|
+
async getUserActivity(userLogin) {
|
|
8
|
+
return getUserActivity(userLogin);
|
|
9
|
+
}
|
|
10
|
+
}
|
package/dist/account/index.d.ts
CHANGED
|
@@ -5,9 +5,11 @@ import { SessionsRequests } from "./sessions";
|
|
|
5
5
|
import { UserRequests } from "./user";
|
|
6
6
|
import { ServiceRequests } from "./service";
|
|
7
7
|
import { ServicesPermissionsRequests } from "./services-permissions";
|
|
8
|
+
import { ActivityRequests } from "./activity";
|
|
8
9
|
export { type VerificationType } from "./types";
|
|
9
10
|
export declare const ACCOUNT_API = "https://account.meowinc.tech/api";
|
|
10
11
|
export declare class AccountClient {
|
|
12
|
+
activity: ActivityRequests;
|
|
11
13
|
app: AppRequests;
|
|
12
14
|
auth: AuthRequests;
|
|
13
15
|
user: UserRequests;
|
package/dist/account/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { SessionsRequests } from "./sessions";
|
|
|
4
4
|
import { UserRequests } from "./user";
|
|
5
5
|
import { ServiceRequests } from "./service";
|
|
6
6
|
import { ServicesPermissionsRequests } from "./services-permissions";
|
|
7
|
+
import { ActivityRequests } from "./activity";
|
|
7
8
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
8
9
|
const permissions = [
|
|
9
10
|
"account.getAccountInformation",
|
|
@@ -14,6 +15,7 @@ const permissions = [
|
|
|
14
15
|
];
|
|
15
16
|
export const ACCOUNT_API = "https://account.meowinc.tech/api";
|
|
16
17
|
export class AccountClient {
|
|
18
|
+
activity;
|
|
17
19
|
app;
|
|
18
20
|
auth;
|
|
19
21
|
user;
|
|
@@ -21,6 +23,7 @@ export class AccountClient {
|
|
|
21
23
|
servicePermissions;
|
|
22
24
|
sessions;
|
|
23
25
|
constructor(authorizationProvider) {
|
|
26
|
+
this.activity = new ActivityRequests(authorizationProvider);
|
|
24
27
|
this.auth = new AuthRequests(authorizationProvider);
|
|
25
28
|
this.app = new AppRequests(authorizationProvider);
|
|
26
29
|
this.user = new UserRequests(authorizationProvider);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AuthorizationProvider } from "../..";
|
|
2
|
+
import { MeowResult } from "../../types";
|
|
3
|
+
export interface Response {
|
|
4
|
+
items: {
|
|
5
|
+
id: number;
|
|
6
|
+
expiredAt: string;
|
|
7
|
+
createdAt: string;
|
|
8
|
+
permissions: string[];
|
|
9
|
+
app?: {
|
|
10
|
+
id: number;
|
|
11
|
+
name: string;
|
|
12
|
+
displayId: string;
|
|
13
|
+
};
|
|
14
|
+
}[];
|
|
15
|
+
}
|
|
16
|
+
export declare function request(auth: AuthorizationProvider): Promise<MeowResult<Response>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ACCOUNT_API } from "..";
|
|
2
|
+
import { ErrorToMessage } from "../../error";
|
|
3
|
+
import { HttpClient } from "../../http-client";
|
|
4
|
+
export async function request(auth) {
|
|
5
|
+
return await new HttpClient()
|
|
6
|
+
.withMethodGet()
|
|
7
|
+
.withUrl(`${ACCOUNT_API}/v1/sessions/my`)
|
|
8
|
+
.withAuthorization(auth)
|
|
9
|
+
.send()
|
|
10
|
+
.then((r) => r.mapError(ErrorToMessage));
|
|
11
|
+
}
|
|
@@ -5,4 +5,5 @@ export declare class SessionsRequests {
|
|
|
5
5
|
constructor(authProvider: AuthorizationProvider);
|
|
6
6
|
noVerificationRequtestToken(): Promise<import("../../types").MeowResult<import("./request-token").Response>>;
|
|
7
7
|
createSession(payload: CreateSessionPayload): Promise<import("../../types").MeowResult<import("./create").Response>>;
|
|
8
|
+
getCurrentSessions(): Promise<import("../../types").MeowResult<import("./get-current").Response>>;
|
|
8
9
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { request as createSession } from "./create";
|
|
2
2
|
import { request as requestToken } from "./request-token";
|
|
3
|
+
import { request as getCurrentSessions } from "./get-current";
|
|
3
4
|
export class SessionsRequests {
|
|
4
5
|
authProvider;
|
|
5
6
|
constructor(authProvider) {
|
|
@@ -13,4 +14,7 @@ export class SessionsRequests {
|
|
|
13
14
|
async createSession(payload) {
|
|
14
15
|
return await createSession(payload, this.authProvider);
|
|
15
16
|
}
|
|
17
|
+
async getCurrentSessions() {
|
|
18
|
+
return getCurrentSessions(this.authProvider);
|
|
19
|
+
}
|
|
16
20
|
}
|