@meowinc/meow-sdk 0.15.2 → 0.15.4
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/index.d.ts +1 -0
- package/dist/index.js +3 -0
- package/package.json +1 -1
- package/dist/account/auth/add-email.d.ts +0 -6
- package/dist/account/auth/add-email.js +0 -14
- package/dist/account/auth/log-in.d.ts +0 -16
- package/dist/account/auth/log-in.js +0 -11
- package/dist/account/auth/submit-add-email.d.ts +0 -3
- package/dist/account/auth/submit-add-email.js +0 -15
- package/dist/mail/auth/create-mailbox.d.ts +0 -6
- package/dist/mail/auth/create-mailbox.js +0 -11
- package/dist/mail/auth/index.d.ts +0 -7
- package/dist/mail/auth/index.js +0 -14
- package/dist/mail/auth/my.d.ts +0 -9
- package/dist/mail/auth/my.js +0 -11
- package/dist/mail/email/deleteEmailById.d.ts +0 -3
- package/dist/mail/email/deleteEmailById.js +0 -11
- package/dist/mail/email/get-email-with-filter.d.ts +0 -20
- package/dist/mail/email/get-email-with-filter.js +0 -15
- package/dist/mail/email/getEmailById.d.ts +0 -6
- package/dist/mail/email/getEmailById.js +0 -11
- package/dist/mail/email/sendMessage.d.ts +0 -3
- package/dist/mail/email/sendMessage.js +0 -16
- package/dist/mail/email/set-read-status.d.ts +0 -3
- package/dist/mail/email/set-read-status.js +0 -12
- package/dist/mail/email/setReadStatus.d.ts +0 -3
- package/dist/mail/email/setReadStatus.js +0 -12
- package/dist/mail/email-group/indexs.d.ts +0 -6
- package/dist/mail/email-group/indexs.js +0 -10
- package/dist/utils.d.ts +0 -3
- package/dist/utils.js +0 -5
package/dist/index.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export declare class MeowSdkClient<T extends AuthorizationProvider> {
|
|
|
28
28
|
tryUpdateAuth(forceUpdate?: boolean): Promise<MeowResult<void>>;
|
|
29
29
|
isContainExpectedPermission(permission: string): boolean;
|
|
30
30
|
isContainsExpectedPermissions(expected: string[]): boolean;
|
|
31
|
+
signOut(): void;
|
|
31
32
|
static fromAuthorizationProvider<T extends AuthorizationProvider>(provider: AuthorizationProvider): MeowSdkClient<T>;
|
|
32
33
|
static setGlobalTimeout(timeout?: number): void;
|
|
33
34
|
}
|
package/dist/index.js
CHANGED
|
@@ -75,6 +75,9 @@ export class MeowSdkClient {
|
|
|
75
75
|
}
|
|
76
76
|
return parsedToken.containsPermissions(expected);
|
|
77
77
|
}
|
|
78
|
+
signOut() {
|
|
79
|
+
this.authProvider.updateTokens(undefined, undefined);
|
|
80
|
+
}
|
|
78
81
|
static fromAuthorizationProvider(provider) {
|
|
79
82
|
return new MeowSdkClient(provider);
|
|
80
83
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { AuthorizationProvider } from "../..";
|
|
2
|
-
import { MeowResult } from "../../types";
|
|
3
|
-
export interface Response {
|
|
4
|
-
sessionId: string;
|
|
5
|
-
}
|
|
6
|
-
export declare function request(mailbox: string, authorizationProvider: AuthorizationProvider): Promise<MeowResult<Response>>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ACCOUNT_API } from "..";
|
|
2
|
-
import { ErrorToMessage } from "../../error";
|
|
3
|
-
import { HttpClient } from "../../http-client";
|
|
4
|
-
export async function request(mailbox, authorizationProvider) {
|
|
5
|
-
return await new HttpClient()
|
|
6
|
-
.withUrl(`${ACCOUNT_API}/v1/auth/2fa/email`)
|
|
7
|
-
.withAuthorization(authorizationProvider)
|
|
8
|
-
.withMethodPost()
|
|
9
|
-
.withJsonBody({
|
|
10
|
-
mailbox,
|
|
11
|
-
})
|
|
12
|
-
.send()
|
|
13
|
-
.then((r) => r.mapError(ErrorToMessage));
|
|
14
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { MeowResult } from "../../types";
|
|
2
|
-
type Payload = {
|
|
3
|
-
login: string;
|
|
4
|
-
password: string;
|
|
5
|
-
type: "base";
|
|
6
|
-
} | {
|
|
7
|
-
requestId: string;
|
|
8
|
-
code: string;
|
|
9
|
-
type: "twoFactor";
|
|
10
|
-
};
|
|
11
|
-
export interface Response {
|
|
12
|
-
accessToken: string;
|
|
13
|
-
refreshToken: string;
|
|
14
|
-
}
|
|
15
|
-
export declare function request(payload: Payload): Promise<MeowResult<Response>>;
|
|
16
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ACCOUNT_API } from "..";
|
|
2
|
-
import { ErrorToMessage } from "../../error";
|
|
3
|
-
import { HttpClient } from "../../http-client";
|
|
4
|
-
export async function request(payload) {
|
|
5
|
-
return await new HttpClient()
|
|
6
|
-
.withMethodPost()
|
|
7
|
-
.withUrl(`${ACCOUNT_API}/v1/auth/log-in`)
|
|
8
|
-
.withJsonBody(payload)
|
|
9
|
-
.send()
|
|
10
|
-
.then((r) => r.mapError(ErrorToMessage));
|
|
11
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ACCOUNT_API } from "..";
|
|
2
|
-
import { ErrorToMessage } from "../../error";
|
|
3
|
-
import { HttpClient } from "../../http-client";
|
|
4
|
-
export async function request(sessionId, code, authorizationProvider) {
|
|
5
|
-
return await new HttpClient()
|
|
6
|
-
.withUrl(`${ACCOUNT_API}/v1/auth/2fa/email/submit`)
|
|
7
|
-
.withMethodPost()
|
|
8
|
-
.withAuthorization(authorizationProvider)
|
|
9
|
-
.withJsonBody({
|
|
10
|
-
sessionId,
|
|
11
|
-
code,
|
|
12
|
-
})
|
|
13
|
-
.send()
|
|
14
|
-
.then((r) => r.mapError(ErrorToMessage));
|
|
15
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { AuthorizationProvider } from "../../auth-provider";
|
|
2
|
-
import { MeowResult } from "../../types";
|
|
3
|
-
export interface Response {
|
|
4
|
-
created_id: number;
|
|
5
|
-
}
|
|
6
|
-
export declare function request(authorizationProvider: AuthorizationProvider): Promise<MeowResult<Response>>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { MAIL_API } from "..";
|
|
2
|
-
import { ErrorToMessage } from "../../error";
|
|
3
|
-
import { HttpClient } from "../../http-client";
|
|
4
|
-
export async function request(authorizationProvider) {
|
|
5
|
-
return await new HttpClient()
|
|
6
|
-
.withAuthorization(authorizationProvider)
|
|
7
|
-
.withMethodPost()
|
|
8
|
-
.withUrl(`${MAIL_API}/v1/auth/create-mail-box`)
|
|
9
|
-
.send()
|
|
10
|
-
.then((r) => r.mapError(ErrorToMessage));
|
|
11
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { AuthorizationProvider } from "../../auth-provider";
|
|
2
|
-
export declare class AuthRequests {
|
|
3
|
-
private authorizationProvider;
|
|
4
|
-
constructor(authorizationProvider: AuthorizationProvider);
|
|
5
|
-
getMyMailbox(): Promise<import("../../types").MeowResult<import("./my").Response>>;
|
|
6
|
-
createMailbox(): Promise<import("../../types").MeowResult<import("./create-mailbox").Response>>;
|
|
7
|
-
}
|
package/dist/mail/auth/index.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { request as myRequest } from "./my";
|
|
2
|
-
import { request as createMailbox } from "./create-mailbox";
|
|
3
|
-
export class AuthRequests {
|
|
4
|
-
authorizationProvider;
|
|
5
|
-
constructor(authorizationProvider) {
|
|
6
|
-
this.authorizationProvider = authorizationProvider;
|
|
7
|
-
}
|
|
8
|
-
async getMyMailbox() {
|
|
9
|
-
return await myRequest(this.authorizationProvider);
|
|
10
|
-
}
|
|
11
|
-
async createMailbox() {
|
|
12
|
-
return await createMailbox(this.authorizationProvider);
|
|
13
|
-
}
|
|
14
|
-
}
|
package/dist/mail/auth/my.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { AuthorizationProvider } from "../../auth-provider";
|
|
2
|
-
import { MeowResult } from "../../types";
|
|
3
|
-
export interface Response {
|
|
4
|
-
mailbox: {
|
|
5
|
-
address: string;
|
|
6
|
-
id: number;
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
export declare function request(authProvider: AuthorizationProvider): Promise<MeowResult<Response>>;
|
package/dist/mail/auth/my.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { MAIL_API } from "..";
|
|
2
|
-
import { ErrorToMessage } from "../../error";
|
|
3
|
-
import { HttpClient } from "../../http-client";
|
|
4
|
-
export async function request(authProvider) {
|
|
5
|
-
return await new HttpClient()
|
|
6
|
-
.withMethodGet()
|
|
7
|
-
.withUrl(`${MAIL_API}/v1/auth/my`)
|
|
8
|
-
.withAuthorization(authProvider)
|
|
9
|
-
.send()
|
|
10
|
-
.then((r) => r.mapError(ErrorToMessage));
|
|
11
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { MAIL_API } from "..";
|
|
2
|
-
import { ErrorToMessage } from "../../error";
|
|
3
|
-
import { HttpClient } from "../../http-client";
|
|
4
|
-
export async function request(id, authorizationProvider) {
|
|
5
|
-
return await new HttpClient()
|
|
6
|
-
.withMethodDelete()
|
|
7
|
-
.withUrl(`${MAIL_API}/v1/email/${id}`)
|
|
8
|
-
.withAuthorization(authorizationProvider)
|
|
9
|
-
.send()
|
|
10
|
-
.then((r) => r.mapError(ErrorToMessage));
|
|
11
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { AuthorizationProvider } from "../../auth-provider";
|
|
2
|
-
import { MeowResult } from "../../types";
|
|
3
|
-
import { EmailModel } from "../types";
|
|
4
|
-
export interface Response {
|
|
5
|
-
count: number;
|
|
6
|
-
pageCount: number;
|
|
7
|
-
query: {
|
|
8
|
-
isBase64?: boolean;
|
|
9
|
-
isReceived?: boolean;
|
|
10
|
-
page: number;
|
|
11
|
-
subject?: string;
|
|
12
|
-
};
|
|
13
|
-
items: EmailModel[];
|
|
14
|
-
}
|
|
15
|
-
export declare function request(authorizationProvider: AuthorizationProvider, queryParameters: {
|
|
16
|
-
isBase64?: boolean;
|
|
17
|
-
isReceived?: boolean;
|
|
18
|
-
page: number;
|
|
19
|
-
subject?: string;
|
|
20
|
-
}): Promise<MeowResult<Response>>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { MAIL_API } from "..";
|
|
2
|
-
import { ErrorToMessage } from "../../error";
|
|
3
|
-
import { HttpClient } from "../../http-client";
|
|
4
|
-
export async function request(authorizationProvider, queryParameters) {
|
|
5
|
-
return await new HttpClient()
|
|
6
|
-
.withAuthorization(authorizationProvider)
|
|
7
|
-
.withMethodGet()
|
|
8
|
-
.withParam("page", queryParameters.page.toString())
|
|
9
|
-
.withParam("subject", queryParameters.subject?.toString())
|
|
10
|
-
.withParam("isReceived", queryParameters.isReceived?.toString())
|
|
11
|
-
.withParam("isBase64", queryParameters.isBase64?.toString())
|
|
12
|
-
.withUrl(`${MAIL_API}/v1/email/filter`)
|
|
13
|
-
.send()
|
|
14
|
-
.then((res) => res.mapError(ErrorToMessage));
|
|
15
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { AuthorizationProvider } from "../../auth-provider";
|
|
2
|
-
import { MeowResult } from "../../types";
|
|
3
|
-
import { EmailModel } from "../types";
|
|
4
|
-
type Response = EmailModel;
|
|
5
|
-
export declare function request(id: number, authorizationProvider: AuthorizationProvider): Promise<MeowResult<Response>>;
|
|
6
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { MAIL_API } from "..";
|
|
2
|
-
import { ErrorToMessage } from "../../error";
|
|
3
|
-
import { HttpClient } from "../../http-client";
|
|
4
|
-
export async function request(id, authorizationProvider) {
|
|
5
|
-
return await new HttpClient()
|
|
6
|
-
.withMethodGet()
|
|
7
|
-
.withUrl(`${MAIL_API}/v1/email/${id}`)
|
|
8
|
-
.withAuthorization(authorizationProvider)
|
|
9
|
-
.send()
|
|
10
|
-
.then((r) => r.mapError(ErrorToMessage));
|
|
11
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { MAIL_API } from "..";
|
|
2
|
-
import { ErrorToMessage } from "../../error";
|
|
3
|
-
import { HttpClient } from "../../http-client";
|
|
4
|
-
export async function request(to, subject, content, authorizationProvider) {
|
|
5
|
-
return await new HttpClient()
|
|
6
|
-
.withMethodPost()
|
|
7
|
-
.withAuthorization(authorizationProvider)
|
|
8
|
-
.withUrl(`${MAIL_API}/v1/email/send-message`)
|
|
9
|
-
.withJsonBody({
|
|
10
|
-
to,
|
|
11
|
-
subject,
|
|
12
|
-
content,
|
|
13
|
-
})
|
|
14
|
-
.send()
|
|
15
|
-
.then((r) => r.mapError(ErrorToMessage));
|
|
16
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { MAIL_API } from "..";
|
|
2
|
-
import { ErrorToMessage } from "../../error";
|
|
3
|
-
import { HttpClient } from "../../http-client";
|
|
4
|
-
export async function request(id, isRead, authorizationProvider) {
|
|
5
|
-
return new HttpClient()
|
|
6
|
-
.withMethodPut()
|
|
7
|
-
.withUrl(`${MAIL_API}/v1/email/my/set-read`)
|
|
8
|
-
.withAuthorization(authorizationProvider)
|
|
9
|
-
.withJsonBody({ mailId: id, isRead })
|
|
10
|
-
.send()
|
|
11
|
-
.then((r) => r.mapError(ErrorToMessage));
|
|
12
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { MAIL_API } from "..";
|
|
2
|
-
import { ErrorToMessage } from "../../error";
|
|
3
|
-
import { HttpClient } from "../../http-client";
|
|
4
|
-
export async function request(id, isRead, authorizationProvider) {
|
|
5
|
-
return new HttpClient()
|
|
6
|
-
.withMethodPut()
|
|
7
|
-
.withUrl(`${MAIL_API}/v1/email/my/set-read`)
|
|
8
|
-
.withAuthorization(authorizationProvider)
|
|
9
|
-
.withJsonBody({ mailId: id, isRead })
|
|
10
|
-
.send()
|
|
11
|
-
.then((r) => r.mapError(ErrorToMessage));
|
|
12
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { AuthorizationProvider } from "../../auth-provider";
|
|
2
|
-
export declare class EmailGroupRequests {
|
|
3
|
-
private authorizationProvider;
|
|
4
|
-
constructor(authorizationProvider: AuthorizationProvider);
|
|
5
|
-
getEmailsByEmailGroup(email_group_id: number): Promise<import("../../types").MeowResult<import("./get-emails-by-email-group\u200B").Response>>;
|
|
6
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { request as getEmailsByEmailGroup } from "./get-emails-by-email-group";
|
|
2
|
-
export class EmailGroupRequests {
|
|
3
|
-
authorizationProvider;
|
|
4
|
-
constructor(authorizationProvider) {
|
|
5
|
-
this.authorizationProvider = authorizationProvider;
|
|
6
|
-
}
|
|
7
|
-
async getEmailsByEmailGroup(email_group_id) {
|
|
8
|
-
return await getEmailsByEmailGroup(email_group_id, this.authorizationProvider);
|
|
9
|
-
}
|
|
10
|
-
}
|
package/dist/utils.d.ts
DELETED