@meowinc/meow-sdk 0.5.0 → 0.6.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/.prettierrc +4 -4
- package/dist/mail/email-group/create-email-group/342/200/213.d.ts +14 -0
- package/dist/mail/{email/sendMessage.js → email-group/create-email-group/342/200/213.js} +5 -9
- package/dist/mail/{email/deleteEmailById.d.ts → email-group/delete-email-group/342/200/213.d.ts} +1 -1
- package/dist/mail/{email/deleteEmailById.js → email-group/delete-email-group/342/200/213.js} +1 -1
- package/dist/mail/email-group/get-user-email-groups/342/200/213.d.ts +14 -0
- package/dist/mail/{email/getEmailById.js → email-group/get-user-email-groups/342/200/213.js} +5 -5
- package/dist/mail/email-group/index.d.ts +10 -0
- package/dist/mail/email-group/index.js +22 -0
- package/dist/mail/index.d.ts +1 -1
- package/dist/mail/index.js +1 -1
- package/package.json +32 -32
- package/tsconfig.json +19 -19
- package/dist/account/auth/add-email.d.ts +0 -6
- package/dist/account/auth/add-email.js +0 -14
- package/dist/account/auth/submit-add-email.d.ts +0 -3
- package/dist/account/auth/submit-add-email.js +0 -15
- package/dist/mail/email/getEmailById.d.ts +0 -6
- package/dist/mail/email/sendMessage.d.ts +0 -3
- package/dist/mail/email/setReadStatus.d.ts +0 -3
- package/dist/mail/email/setReadStatus.js +0 -12
package/.prettierrc
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"tabWidth": 4,
|
|
3
|
-
"printWidth": 120,
|
|
4
|
-
"endOfLine": "lf"
|
|
1
|
+
{
|
|
2
|
+
"tabWidth": 4,
|
|
3
|
+
"printWidth": 120,
|
|
4
|
+
"endOfLine": "lf"
|
|
5
5
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AuthorizationProvider } from "../..";
|
|
2
|
+
import { MeowResult } from "../../types";
|
|
3
|
+
export interface Payload {
|
|
4
|
+
name: string;
|
|
5
|
+
constrains: {
|
|
6
|
+
from: string[] | null;
|
|
7
|
+
subject: string | null;
|
|
8
|
+
to: string[] | null;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface Response {
|
|
12
|
+
createdId: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function request(payload: Payload, authorizationProvider: AuthorizationProvider): Promise<MeowResult<Response>>;
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { MAIL_API } from "..";
|
|
2
|
-
import { ErrorToMessage } from "../../error";
|
|
3
2
|
import { HttpClient } from "../../http-client";
|
|
4
|
-
|
|
3
|
+
import { ErrorToMessage } from "../../error";
|
|
4
|
+
export async function request(payload, authorizationProvider) {
|
|
5
5
|
return await new HttpClient()
|
|
6
|
-
.withMethodPost()
|
|
7
6
|
.withAuthorization(authorizationProvider)
|
|
8
|
-
.
|
|
9
|
-
.
|
|
10
|
-
|
|
11
|
-
subject,
|
|
12
|
-
content,
|
|
13
|
-
})
|
|
7
|
+
.withMethodPost()
|
|
8
|
+
.withUrl(`${MAIL_API}/v1/email-group/`)
|
|
9
|
+
.withJsonBody(payload)
|
|
14
10
|
.send()
|
|
15
11
|
.then((r) => r.mapError(ErrorToMessage));
|
|
16
12
|
}
|
package/dist/mail/{email/deleteEmailById.js → email-group/delete-email-group/342/200/213.js}
RENAMED
|
@@ -4,7 +4,7 @@ import { HttpClient } from "../../http-client";
|
|
|
4
4
|
export async function request(id, authorizationProvider) {
|
|
5
5
|
return await new HttpClient()
|
|
6
6
|
.withMethodDelete()
|
|
7
|
-
.withUrl(`${MAIL_API}/v1/email/${id}`)
|
|
7
|
+
.withUrl(`${MAIL_API}/v1/email-group/${id}`)
|
|
8
8
|
.withAuthorization(authorizationProvider)
|
|
9
9
|
.send()
|
|
10
10
|
.then((r) => r.mapError(ErrorToMessage));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AuthorizationProvider } from "../../auth-provider";
|
|
2
|
+
import { MeowResult } from "../../types";
|
|
3
|
+
export interface Response {
|
|
4
|
+
items: {
|
|
5
|
+
id: number;
|
|
6
|
+
name: string;
|
|
7
|
+
constrains: {
|
|
8
|
+
from: string[] | null;
|
|
9
|
+
to: string[] | null;
|
|
10
|
+
subject: string | null;
|
|
11
|
+
};
|
|
12
|
+
}[];
|
|
13
|
+
}
|
|
14
|
+
export declare function request(authorizationProvider: AuthorizationProvider): Promise<MeowResult<Response>>;
|
package/dist/mail/{email/getEmailById.js → email-group/get-user-email-groups/342/200/213.js}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { MAIL_API } from "..";
|
|
2
|
-
import { ErrorToMessage } from "../../error";
|
|
3
1
|
import { HttpClient } from "../../http-client";
|
|
4
|
-
|
|
2
|
+
import { MAIL_API } from "../index";
|
|
3
|
+
import { ErrorToMessage } from "../../error";
|
|
4
|
+
export async function request(authorizationProvider) {
|
|
5
5
|
return await new HttpClient()
|
|
6
|
-
.
|
|
7
|
-
.withUrl(`${MAIL_API}/v1/email/${id}`)
|
|
6
|
+
.withUrl(`${MAIL_API}/v1/email-group/my`)
|
|
8
7
|
.withAuthorization(authorizationProvider)
|
|
8
|
+
.withMethodGet()
|
|
9
9
|
.send()
|
|
10
10
|
.then((r) => r.mapError(ErrorToMessage));
|
|
11
11
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AuthorizationProvider } from "../../auth-provider";
|
|
2
|
+
import { Payload as CreateEmailGroupPayload } from "./create-email-group";
|
|
3
|
+
export declare class EmailGroupRequests {
|
|
4
|
+
private authorizationProvider;
|
|
5
|
+
constructor(authorizationProvider: AuthorizationProvider);
|
|
6
|
+
getEmailsByEmailGroup(email_group_id: number): Promise<import("../../types").MeowResult<import("./get-emails-by-email-group\u200B").Response>>;
|
|
7
|
+
getUserEmailGroups(): Promise<import("../../types").MeowResult<import("./get-user-email-groups\u200B").Response>>;
|
|
8
|
+
deleteEmailGroup(email_group_id: number): Promise<import("../../types").MeowResult<void>>;
|
|
9
|
+
createEmailGroup(payload: CreateEmailGroupPayload): Promise<import("../../types").MeowResult<import("./create-email-group\u200B").Response>>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { request as getEmailsByEmailGroup } from "./get-emails-by-email-group";
|
|
2
|
+
import { request as getUserEmailGroups } from "./get-user-email-groups";
|
|
3
|
+
import { request as deleteEmailGroup } from "./delete-email-group";
|
|
4
|
+
import { request as createEmailGroup } from "./create-email-group";
|
|
5
|
+
export class EmailGroupRequests {
|
|
6
|
+
authorizationProvider;
|
|
7
|
+
constructor(authorizationProvider) {
|
|
8
|
+
this.authorizationProvider = authorizationProvider;
|
|
9
|
+
}
|
|
10
|
+
async getEmailsByEmailGroup(email_group_id) {
|
|
11
|
+
return await getEmailsByEmailGroup(email_group_id, this.authorizationProvider);
|
|
12
|
+
}
|
|
13
|
+
async getUserEmailGroups() {
|
|
14
|
+
return await getUserEmailGroups(this.authorizationProvider);
|
|
15
|
+
}
|
|
16
|
+
async deleteEmailGroup(email_group_id) {
|
|
17
|
+
return await deleteEmailGroup(email_group_id, this.authorizationProvider);
|
|
18
|
+
}
|
|
19
|
+
async createEmailGroup(payload) {
|
|
20
|
+
return await createEmailGroup(payload, this.authorizationProvider);
|
|
21
|
+
}
|
|
22
|
+
}
|
package/dist/mail/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { AuthorizationProvider } from "../auth-provider";
|
|
|
2
2
|
import { MailboxRequests } from "./mailbox";
|
|
3
3
|
import { EmailRequests } from "./email";
|
|
4
4
|
import { AdminRequests } from "./admin";
|
|
5
|
-
import { EmailGroupRequests } from "./email-group
|
|
5
|
+
import { EmailGroupRequests } from "./email-group";
|
|
6
6
|
export declare const MAIL_API = "https://mail.meowinc.tech/api";
|
|
7
7
|
export declare class MailClient {
|
|
8
8
|
mailbox: MailboxRequests;
|
package/dist/mail/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MailboxRequests } from "./mailbox";
|
|
2
2
|
import { EmailRequests } from "./email";
|
|
3
3
|
import { AdminRequests } from "./admin";
|
|
4
|
-
import { EmailGroupRequests } from "./email-group
|
|
4
|
+
import { EmailGroupRequests } from "./email-group";
|
|
5
5
|
export const MAIL_API = "https://mail.meowinc.tech/api";
|
|
6
6
|
export class MailClient {
|
|
7
7
|
mailbox;
|
package/package.json
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@meowinc/meow-sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Meow SDK",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"sdk"
|
|
7
|
-
],
|
|
8
|
-
"homepage": "https://github.com/ProjectMeowInc/meow-sdk-ts#readme",
|
|
9
|
-
"bugs": {
|
|
10
|
-
"url": "https://github.com/ProjectMeowInc/meow-sdk-ts/issues"
|
|
11
|
-
},
|
|
12
|
-
"repository": {
|
|
13
|
-
"type": "git",
|
|
14
|
-
"url": "git+https://github.com/ProjectMeowInc/meow-sdk-ts.git"
|
|
15
|
-
},
|
|
16
|
-
"license": "MIT",
|
|
17
|
-
"author": "BlackSoulHub",
|
|
18
|
-
"type": "module",
|
|
19
|
-
"main": "dist/index.js",
|
|
20
|
-
"types": "dist/index.d.ts",
|
|
21
|
-
"scripts": {
|
|
22
|
-
"build": "tsc",
|
|
23
|
-
"prettier": "prettier ./src --write"
|
|
24
|
-
},
|
|
25
|
-
"dependencies": {
|
|
26
|
-
"@meowinc/result": ">=0.0.13",
|
|
27
|
-
"jwt-decode": ">=4"
|
|
28
|
-
},
|
|
29
|
-
"devDependencies": {
|
|
30
|
-
"typescript": "^5.9.3"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@meowinc/meow-sdk",
|
|
3
|
+
"version": "0.6.0",
|
|
4
|
+
"description": "Meow SDK",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"sdk"
|
|
7
|
+
],
|
|
8
|
+
"homepage": "https://github.com/ProjectMeowInc/meow-sdk-ts#readme",
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/ProjectMeowInc/meow-sdk-ts/issues"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/ProjectMeowInc/meow-sdk-ts.git"
|
|
15
|
+
},
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"author": "BlackSoulHub",
|
|
18
|
+
"type": "module",
|
|
19
|
+
"main": "dist/index.js",
|
|
20
|
+
"types": "dist/index.d.ts",
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsc",
|
|
23
|
+
"prettier": "prettier ./src --write"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@meowinc/result": ">=0.0.13",
|
|
27
|
+
"jwt-decode": ">=4"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"typescript": "^5.9.3"
|
|
31
|
+
}
|
|
32
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
// File Layout
|
|
4
|
-
"rootDir": "./src",
|
|
5
|
-
"outDir": "./dist",
|
|
6
|
-
|
|
7
|
-
"module": "ES2022",
|
|
8
|
-
"moduleResolution": "bundler",
|
|
9
|
-
"target": "ES2024",
|
|
10
|
-
"declaration": true,
|
|
11
|
-
|
|
12
|
-
"strict": true,
|
|
13
|
-
"noImplicitAny": true,
|
|
14
|
-
"esModuleInterop": true,
|
|
15
|
-
"strictNullChecks": true,
|
|
16
|
-
},
|
|
17
|
-
"exclude": ["node_modules"],
|
|
18
|
-
"include": ["src/**/*"],
|
|
19
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
// File Layout
|
|
4
|
+
"rootDir": "./src",
|
|
5
|
+
"outDir": "./dist",
|
|
6
|
+
|
|
7
|
+
"module": "ES2022",
|
|
8
|
+
"moduleResolution": "bundler",
|
|
9
|
+
"target": "ES2024",
|
|
10
|
+
"declaration": true,
|
|
11
|
+
|
|
12
|
+
"strict": true,
|
|
13
|
+
"noImplicitAny": true,
|
|
14
|
+
"esModuleInterop": true,
|
|
15
|
+
"strictNullChecks": true,
|
|
16
|
+
},
|
|
17
|
+
"exclude": ["node_modules"],
|
|
18
|
+
"include": ["src/**/*"],
|
|
19
|
+
}
|
|
@@ -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,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
|
-
import { EmailModel } from "../types";
|
|
4
|
-
type Response = EmailModel;
|
|
5
|
-
export declare function request(id: number, authorizationProvider: AuthorizationProvider): Promise<MeowResult<Response>>;
|
|
6
|
-
export {};
|
|
@@ -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
|
-
}
|