automate.ax 0.3.1 → 0.4.1
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/README.md +58 -6
- package/dist/automation/account-planning.d.ts +17 -0
- package/dist/automation/account-planning.d.ts.map +1 -0
- package/dist/automation/account-planning.js +48 -0
- package/dist/automation/actions.d.ts +2 -1
- package/dist/automation/actions.d.ts.map +1 -1
- package/dist/automation/actions.js +3 -36
- package/dist/cli/commands/deploy.d.ts.map +1 -1
- package/dist/cli/commands/deploy.js +4 -4
- package/dist/cli/usage.d.ts +2 -1
- package/dist/cli/usage.d.ts.map +1 -1
- package/dist/cli/usage.js +2 -1
- package/dist/components/core/actions.d.ts +29 -0
- package/dist/components/core/actions.d.ts.map +1 -0
- package/dist/components/core/actions.js +57 -0
- package/dist/components/core/index.d.ts +3 -0
- package/dist/components/core/index.d.ts.map +1 -0
- package/dist/components/core/index.js +2 -0
- package/dist/components/core/triggers.d.ts +21 -0
- package/dist/components/core/triggers.d.ts.map +1 -0
- package/dist/components/core/triggers.js +9 -0
- package/dist/components/gmail/actions/add-label.d.ts +12 -0
- package/dist/components/gmail/actions/add-label.d.ts.map +1 -0
- package/dist/components/gmail/actions/add-label.js +33 -0
- package/dist/components/gmail/actions/archive.d.ts +9 -0
- package/dist/components/gmail/actions/archive.d.ts.map +1 -0
- package/dist/components/gmail/actions/archive.js +7 -0
- package/dist/components/gmail/actions/create-label.d.ts +43 -0
- package/dist/components/gmail/actions/create-label.d.ts.map +1 -0
- package/dist/components/gmail/actions/create-label.js +27 -0
- package/dist/components/gmail/actions/delete-draft.d.ts +6 -0
- package/dist/components/gmail/actions/delete-draft.d.ts.map +1 -0
- package/dist/components/gmail/actions/delete-draft.js +20 -0
- package/dist/components/gmail/actions/delete-label.d.ts +6 -0
- package/dist/components/gmail/actions/delete-label.d.ts.map +1 -0
- package/dist/components/gmail/actions/delete-label.js +22 -0
- package/dist/components/gmail/actions/draft-email.d.ts +66 -0
- package/dist/components/gmail/actions/draft-email.d.ts.map +1 -0
- package/dist/components/gmail/actions/draft-email.js +32 -0
- package/dist/components/gmail/actions/draft-reply.d.ts +67 -0
- package/dist/components/gmail/actions/draft-reply.d.ts.map +1 -0
- package/dist/components/gmail/actions/draft-reply.js +42 -0
- package/dist/components/gmail/actions/forward.d.ts +67 -0
- package/dist/components/gmail/actions/forward.d.ts.map +1 -0
- package/dist/components/gmail/actions/forward.js +130 -0
- package/dist/components/gmail/actions/get-draft.d.ts +66 -0
- package/dist/components/gmail/actions/get-draft.d.ts.map +1 -0
- package/dist/components/gmail/actions/get-draft.js +28 -0
- package/dist/components/gmail/actions/get-message.d.ts +68 -0
- package/dist/components/gmail/actions/get-message.d.ts.map +1 -0
- package/dist/components/gmail/actions/get-message.js +24 -0
- package/dist/components/gmail/actions/get-messages.d.ts +63 -0
- package/dist/components/gmail/actions/get-messages.d.ts.map +1 -0
- package/dist/components/gmail/actions/get-messages.js +23 -0
- package/dist/components/gmail/actions/get-profile.d.ts +8 -0
- package/dist/components/gmail/actions/get-profile.d.ts.map +1 -0
- package/dist/components/gmail/actions/get-profile.js +23 -0
- package/dist/components/gmail/actions/get-raw-message.d.ts +11 -0
- package/dist/components/gmail/actions/get-raw-message.d.ts.map +1 -0
- package/dist/components/gmail/actions/get-raw-message.js +28 -0
- package/dist/components/gmail/actions/get-thread.d.ts +67 -0
- package/dist/components/gmail/actions/get-thread.d.ts.map +1 -0
- package/dist/components/gmail/actions/get-thread.js +28 -0
- package/dist/components/gmail/actions/has-label.d.ts +7 -0
- package/dist/components/gmail/actions/has-label.d.ts.map +1 -0
- package/dist/components/gmail/actions/has-label.js +23 -0
- package/dist/components/gmail/actions/index.d.ts +42 -0
- package/dist/components/gmail/actions/index.d.ts.map +1 -0
- package/dist/components/gmail/actions/index.js +41 -0
- package/dist/components/gmail/actions/is-important.d.ts +5 -0
- package/dist/components/gmail/actions/is-important.d.ts.map +1 -0
- package/dist/components/gmail/actions/is-important.js +3 -0
- package/dist/components/gmail/actions/is-starred.d.ts +5 -0
- package/dist/components/gmail/actions/is-starred.d.ts.map +1 -0
- package/dist/components/gmail/actions/is-starred.js +3 -0
- package/dist/components/gmail/actions/is-unread.d.ts +5 -0
- package/dist/components/gmail/actions/is-unread.d.ts.map +1 -0
- package/dist/components/gmail/actions/is-unread.js +3 -0
- package/dist/components/gmail/actions/list-labels.d.ts +27 -0
- package/dist/components/gmail/actions/list-labels.d.ts.map +1 -0
- package/dist/components/gmail/actions/list-labels.js +15 -0
- package/dist/components/gmail/actions/mark-as-important.d.ts +5 -0
- package/dist/components/gmail/actions/mark-as-important.d.ts.map +1 -0
- package/dist/components/gmail/actions/mark-as-important.js +3 -0
- package/dist/components/gmail/actions/mark-as-not-spam.d.ts +5 -0
- package/dist/components/gmail/actions/mark-as-not-spam.d.ts.map +1 -0
- package/dist/components/gmail/actions/mark-as-not-spam.js +3 -0
- package/dist/components/gmail/actions/mark-as-read.d.ts +5 -0
- package/dist/components/gmail/actions/mark-as-read.d.ts.map +1 -0
- package/dist/components/gmail/actions/mark-as-read.js +3 -0
- package/dist/components/gmail/actions/mark-as-spam.d.ts +5 -0
- package/dist/components/gmail/actions/mark-as-spam.d.ts.map +1 -0
- package/dist/components/gmail/actions/mark-as-spam.js +3 -0
- package/dist/components/gmail/actions/mark-as-unread.d.ts +5 -0
- package/dist/components/gmail/actions/mark-as-unread.d.ts.map +1 -0
- package/dist/components/gmail/actions/mark-as-unread.js +3 -0
- package/dist/components/gmail/actions/modify-labels.d.ts +12 -0
- package/dist/components/gmail/actions/modify-labels.d.ts.map +1 -0
- package/dist/components/gmail/actions/modify-labels.js +41 -0
- package/dist/components/gmail/actions/move-to-inbox.d.ts +5 -0
- package/dist/components/gmail/actions/move-to-inbox.d.ts.map +1 -0
- package/dist/components/gmail/actions/move-to-inbox.js +3 -0
- package/dist/components/gmail/actions/remove-label.d.ts +12 -0
- package/dist/components/gmail/actions/remove-label.d.ts.map +1 -0
- package/dist/components/gmail/actions/remove-label.js +33 -0
- package/dist/components/gmail/actions/reply-thread.d.ts +65 -0
- package/dist/components/gmail/actions/reply-thread.d.ts.map +1 -0
- package/dist/components/gmail/actions/reply-thread.js +35 -0
- package/dist/components/gmail/actions/reply.d.ts +66 -0
- package/dist/components/gmail/actions/reply.d.ts.map +1 -0
- package/dist/components/gmail/actions/reply.js +23 -0
- package/dist/components/gmail/actions/search-drafts.d.ts +18 -0
- package/dist/components/gmail/actions/search-drafts.d.ts.map +1 -0
- package/dist/components/gmail/actions/search-drafts.js +50 -0
- package/dist/components/gmail/actions/search-messages.d.ts +16 -0
- package/dist/components/gmail/actions/search-messages.d.ts.map +1 -0
- package/dist/components/gmail/actions/search-messages.js +45 -0
- package/dist/components/gmail/actions/search-threads.d.ts +15 -0
- package/dist/components/gmail/actions/search-threads.d.ts.map +1 -0
- package/dist/components/gmail/actions/search-threads.js +43 -0
- package/dist/components/gmail/actions/send-draft.d.ts +11 -0
- package/dist/components/gmail/actions/send-draft.d.ts.map +1 -0
- package/dist/components/gmail/actions/send-draft.js +18 -0
- package/dist/components/gmail/actions/send-email.d.ts +65 -0
- package/dist/components/gmail/actions/send-email.d.ts.map +1 -0
- package/dist/components/gmail/actions/send-email.js +35 -0
- package/dist/components/gmail/actions/star.d.ts +5 -0
- package/dist/components/gmail/actions/star.d.ts.map +1 -0
- package/dist/components/gmail/actions/star.js +3 -0
- package/dist/components/gmail/actions/trash.d.ts +15 -0
- package/dist/components/gmail/actions/trash.d.ts.map +1 -0
- package/dist/components/gmail/actions/trash.js +26 -0
- package/dist/components/gmail/actions/unmark-as-important.d.ts +5 -0
- package/dist/components/gmail/actions/unmark-as-important.d.ts.map +1 -0
- package/dist/components/gmail/actions/unmark-as-important.js +3 -0
- package/dist/components/gmail/actions/unstar.d.ts +5 -0
- package/dist/components/gmail/actions/unstar.d.ts.map +1 -0
- package/dist/components/gmail/actions/unstar.js +3 -0
- package/dist/components/gmail/actions/untrash.d.ts +15 -0
- package/dist/components/gmail/actions/untrash.d.ts.map +1 -0
- package/dist/components/gmail/actions/untrash.js +26 -0
- package/dist/components/gmail/actions/update-draft.d.ts +67 -0
- package/dist/components/gmail/actions/update-draft.d.ts.map +1 -0
- package/dist/components/gmail/actions/update-draft.js +67 -0
- package/dist/components/gmail/actions/update-label.d.ts +44 -0
- package/dist/components/gmail/actions/update-label.d.ts.map +1 -0
- package/dist/components/gmail/actions/update-label.js +38 -0
- package/dist/components/gmail/index.d.ts +5 -0
- package/dist/components/gmail/index.d.ts.map +1 -0
- package/dist/components/gmail/index.js +4 -0
- package/dist/components/gmail/lib/action-factories.d.ts +27 -0
- package/dist/components/gmail/lib/action-factories.d.ts.map +1 -0
- package/dist/components/gmail/lib/action-factories.js +55 -0
- package/dist/components/gmail/lib/gmail.d.ts +178 -0
- package/dist/components/gmail/lib/gmail.d.ts.map +1 -0
- package/dist/components/gmail/lib/gmail.js +411 -0
- package/dist/components/gmail/lib/schemas.d.ts +380 -0
- package/dist/components/gmail/lib/schemas.d.ts.map +1 -0
- package/dist/components/gmail/lib/schemas.js +226 -0
- package/dist/components/gmail/lib/scopes.d.ts +10 -0
- package/dist/components/gmail/lib/scopes.d.ts.map +1 -0
- package/dist/components/gmail/lib/scopes.js +16 -0
- package/dist/components/gmail/triggers/index.d.ts +2 -0
- package/dist/components/gmail/triggers/index.d.ts.map +1 -0
- package/dist/components/gmail/triggers/index.js +1 -0
- package/dist/components/gmail/triggers/on-new-email.d.ts +75 -0
- package/dist/components/gmail/triggers/on-new-email.d.ts.map +1 -0
- package/dist/components/gmail/triggers/on-new-email.js +30 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/package.json +26 -6
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Retrieves and fully parses up to 100 Gmail messages in one action. */
|
|
3
|
+
export declare const getMessages: import("../../..").DefinedAction<z.ZodObject<{
|
|
4
|
+
messageIds: z.ZodArray<z.ZodString>;
|
|
5
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
6
|
+
messageId: z.ZodString;
|
|
7
|
+
threadId: z.ZodString;
|
|
8
|
+
historyId: z.ZodOptional<z.ZodString>;
|
|
9
|
+
labelIds: z.ZodArray<z.ZodString>;
|
|
10
|
+
attachments: z.ZodArray<z.ZodObject<{
|
|
11
|
+
contentId: z.ZodOptional<z.ZodString>;
|
|
12
|
+
description: z.ZodOptional<z.ZodString>;
|
|
13
|
+
disposition: z.ZodOptional<z.ZodEnum<{
|
|
14
|
+
attachment: "attachment";
|
|
15
|
+
inline: "inline";
|
|
16
|
+
}>>;
|
|
17
|
+
file: z.ZodCustom<File, File>;
|
|
18
|
+
filename: z.ZodString;
|
|
19
|
+
mimeType: z.ZodString;
|
|
20
|
+
related: z.ZodBoolean;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
bcc: z.ZodArray<z.ZodObject<{
|
|
23
|
+
address: z.ZodString;
|
|
24
|
+
name: z.ZodOptional<z.ZodString>;
|
|
25
|
+
}, z.core.$strip>>;
|
|
26
|
+
cc: z.ZodArray<z.ZodObject<{
|
|
27
|
+
address: z.ZodString;
|
|
28
|
+
name: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, z.core.$strip>>;
|
|
30
|
+
deliveredTo: z.ZodOptional<z.ZodString>;
|
|
31
|
+
from: z.ZodOptional<z.ZodObject<{
|
|
32
|
+
address: z.ZodString;
|
|
33
|
+
name: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, z.core.$strip>>;
|
|
35
|
+
headers: z.ZodArray<z.ZodObject<{
|
|
36
|
+
name: z.ZodString;
|
|
37
|
+
value: z.ZodString;
|
|
38
|
+
}, z.core.$strip>>;
|
|
39
|
+
html: z.ZodOptional<z.ZodString>;
|
|
40
|
+
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
41
|
+
rfc822MessageId: z.ZodOptional<z.ZodString>;
|
|
42
|
+
receivedAt: z.ZodNullable<z.ZodDate>;
|
|
43
|
+
references: z.ZodArray<z.ZodString>;
|
|
44
|
+
replyTo: z.ZodArray<z.ZodObject<{
|
|
45
|
+
address: z.ZodString;
|
|
46
|
+
name: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, z.core.$strip>>;
|
|
48
|
+
returnPath: z.ZodOptional<z.ZodString>;
|
|
49
|
+
sender: z.ZodOptional<z.ZodObject<{
|
|
50
|
+
address: z.ZodString;
|
|
51
|
+
name: z.ZodOptional<z.ZodString>;
|
|
52
|
+
}, z.core.$strip>>;
|
|
53
|
+
sentAt: z.ZodOptional<z.ZodDate>;
|
|
54
|
+
sizeEstimate: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
snippet: z.ZodOptional<z.ZodString>;
|
|
56
|
+
subject: z.ZodString;
|
|
57
|
+
text: z.ZodOptional<z.ZodString>;
|
|
58
|
+
to: z.ZodArray<z.ZodObject<{
|
|
59
|
+
address: z.ZodString;
|
|
60
|
+
name: z.ZodOptional<z.ZodString>;
|
|
61
|
+
}, z.core.$strip>>;
|
|
62
|
+
}, z.core.$strip>>, "google">;
|
|
63
|
+
//# sourceMappingURL=get-messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-messages.d.ts","sourceRoot":"","sources":["../../../../src/components/gmail/actions/get-messages.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,yEAAyE;AACzE,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA0BpB,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import pMap from "p-map";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { defineAction } from "../../../automation/actions.js";
|
|
4
|
+
import { getGmailApi, getGmailMessage } from "../lib/gmail.js";
|
|
5
|
+
import { GMAIL_READ_REQUIREMENT } from "../lib/scopes.js";
|
|
6
|
+
import { MESSAGE_SCHEMA } from "../lib/schemas.js";
|
|
7
|
+
/** Retrieves and fully parses up to 100 Gmail messages in one action. */
|
|
8
|
+
export const getMessages = defineAction("Get Gmail messages")
|
|
9
|
+
.describe("Gets multiple parsed Gmail messages with headers and attachments.")
|
|
10
|
+
.account("google", GMAIL_READ_REQUIREMENT)
|
|
11
|
+
.input(z.object({
|
|
12
|
+
/** One to 100 immutable Gmail message IDs. */
|
|
13
|
+
messageIds: z.string().min(1).array().min(1).max(100),
|
|
14
|
+
}))
|
|
15
|
+
.output(MESSAGE_SCHEMA.array())
|
|
16
|
+
.handler(async ({ account, input }) => {
|
|
17
|
+
const gmailApi = getGmailApi(account.secret);
|
|
18
|
+
return await pMap(input.messageIds, async (messageId) => getGmailMessage((await gmailApi.users.messages.get({
|
|
19
|
+
format: "raw",
|
|
20
|
+
id: messageId,
|
|
21
|
+
userId: "me",
|
|
22
|
+
})).data), { concurrency: 20 });
|
|
23
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Returns basic mailbox information for the authenticated Gmail account. */
|
|
2
|
+
export declare const getProfile: import("../../..").DefinedAction<import("better-auth").StandardSchemaV1<Record<string, never>, Record<string, never>>, import("zod").ZodObject<{
|
|
3
|
+
emailAddress: import("zod").ZodString;
|
|
4
|
+
historyId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
5
|
+
messagesTotal: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
6
|
+
threadsTotal: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
7
|
+
}, import("zod/v4/core").$strip>, "google">;
|
|
8
|
+
//# sourceMappingURL=get-profile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-profile.d.ts","sourceRoot":"","sources":["../../../../src/components/gmail/actions/get-profile.ts"],"names":[],"mappings":"AAKA,6EAA6E;AAC7E,eAAO,MAAM,UAAU;;;;;2CAmBnB,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineAction } from "../../../automation/actions.js";
|
|
2
|
+
import { getGmailApi } from "../lib/gmail.js";
|
|
3
|
+
import { GMAIL_METADATA_REQUIREMENT } from "../lib/scopes.js";
|
|
4
|
+
import { PROFILE_SCHEMA } from "../lib/schemas.js";
|
|
5
|
+
/** Returns basic mailbox information for the authenticated Gmail account. */
|
|
6
|
+
export const getProfile = defineAction("Get Gmail profile")
|
|
7
|
+
.describe("Gets the authenticated Gmail address and mailbox totals.")
|
|
8
|
+
.account("google", GMAIL_METADATA_REQUIREMENT)
|
|
9
|
+
.output(PROFILE_SCHEMA)
|
|
10
|
+
.handler(async ({ account }) => {
|
|
11
|
+
const { data: profile } = await getGmailApi(account.secret).users.getProfile({
|
|
12
|
+
userId: "me",
|
|
13
|
+
});
|
|
14
|
+
if (!profile.emailAddress) {
|
|
15
|
+
throw new Error("Gmail returned an incomplete profile.");
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
emailAddress: profile.emailAddress,
|
|
19
|
+
historyId: profile.historyId ?? undefined,
|
|
20
|
+
messagesTotal: profile.messagesTotal ?? undefined,
|
|
21
|
+
threadsTotal: profile.threadsTotal ?? undefined,
|
|
22
|
+
};
|
|
23
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Returns the base64url-encoded RFC 5322 source of one Gmail message.
|
|
4
|
+
*
|
|
5
|
+
* Most automations should prefer `getMessage`; this action is an escape hatch
|
|
6
|
+
* for protocols or parsers that require the untouched message source.
|
|
7
|
+
*/
|
|
8
|
+
export declare const getRawMessage: import("../../..").DefinedAction<z.ZodObject<{
|
|
9
|
+
messageId: z.ZodString;
|
|
10
|
+
}, z.core.$strip>, z.ZodString, "google">;
|
|
11
|
+
//# sourceMappingURL=get-raw-message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-raw-message.d.ts","sourceRoot":"","sources":["../../../../src/components/gmail/actions/get-raw-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB;;;;;GAKG;AACH,eAAO,MAAM,aAAa;;yCAoBtB,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineAction } from "../../../automation/actions.js";
|
|
3
|
+
import { getGmailApi } from "../lib/gmail.js";
|
|
4
|
+
import { GMAIL_READ_REQUIREMENT } from "../lib/scopes.js";
|
|
5
|
+
/**
|
|
6
|
+
* Returns the base64url-encoded RFC 5322 source of one Gmail message.
|
|
7
|
+
*
|
|
8
|
+
* Most automations should prefer `getMessage`; this action is an escape hatch
|
|
9
|
+
* for protocols or parsers that require the untouched message source.
|
|
10
|
+
*/
|
|
11
|
+
export const getRawMessage = defineAction("Get raw Gmail message")
|
|
12
|
+
.describe("Gets the untouched base64url-encoded RFC 5322 message.")
|
|
13
|
+
.account("google", GMAIL_READ_REQUIREMENT)
|
|
14
|
+
.input(z.object({
|
|
15
|
+
/** Immutable Gmail message ID. */
|
|
16
|
+
messageId: z.string().min(1),
|
|
17
|
+
}))
|
|
18
|
+
.output(z.string())
|
|
19
|
+
.handler(async ({ account, input }) => {
|
|
20
|
+
const { data: message } = await getGmailApi(account.secret).users.messages.get({
|
|
21
|
+
format: "raw",
|
|
22
|
+
id: input.messageId,
|
|
23
|
+
userId: "me",
|
|
24
|
+
});
|
|
25
|
+
if (!message.raw)
|
|
26
|
+
throw new Error("Gmail did not return the raw message.");
|
|
27
|
+
return message.raw;
|
|
28
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Retrieves one Gmail thread with every message fully parsed. */
|
|
3
|
+
export declare const getThread: import("../../..").DefinedAction<z.ZodObject<{
|
|
4
|
+
threadId: z.ZodString;
|
|
5
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6
|
+
threadId: z.ZodString;
|
|
7
|
+
historyId: z.ZodOptional<z.ZodString>;
|
|
8
|
+
messages: z.ZodArray<z.ZodObject<{
|
|
9
|
+
messageId: z.ZodString;
|
|
10
|
+
threadId: z.ZodString;
|
|
11
|
+
historyId: z.ZodOptional<z.ZodString>;
|
|
12
|
+
labelIds: z.ZodArray<z.ZodString>;
|
|
13
|
+
attachments: z.ZodArray<z.ZodObject<{
|
|
14
|
+
contentId: z.ZodOptional<z.ZodString>;
|
|
15
|
+
description: z.ZodOptional<z.ZodString>;
|
|
16
|
+
disposition: z.ZodOptional<z.ZodEnum<{
|
|
17
|
+
attachment: "attachment";
|
|
18
|
+
inline: "inline";
|
|
19
|
+
}>>;
|
|
20
|
+
file: z.ZodCustom<File, File>;
|
|
21
|
+
filename: z.ZodString;
|
|
22
|
+
mimeType: z.ZodString;
|
|
23
|
+
related: z.ZodBoolean;
|
|
24
|
+
}, z.core.$strip>>;
|
|
25
|
+
bcc: z.ZodArray<z.ZodObject<{
|
|
26
|
+
address: z.ZodString;
|
|
27
|
+
name: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, z.core.$strip>>;
|
|
29
|
+
cc: z.ZodArray<z.ZodObject<{
|
|
30
|
+
address: z.ZodString;
|
|
31
|
+
name: z.ZodOptional<z.ZodString>;
|
|
32
|
+
}, z.core.$strip>>;
|
|
33
|
+
deliveredTo: z.ZodOptional<z.ZodString>;
|
|
34
|
+
from: z.ZodOptional<z.ZodObject<{
|
|
35
|
+
address: z.ZodString;
|
|
36
|
+
name: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, z.core.$strip>>;
|
|
38
|
+
headers: z.ZodArray<z.ZodObject<{
|
|
39
|
+
name: z.ZodString;
|
|
40
|
+
value: z.ZodString;
|
|
41
|
+
}, z.core.$strip>>;
|
|
42
|
+
html: z.ZodOptional<z.ZodString>;
|
|
43
|
+
inReplyTo: z.ZodOptional<z.ZodString>;
|
|
44
|
+
rfc822MessageId: z.ZodOptional<z.ZodString>;
|
|
45
|
+
receivedAt: z.ZodNullable<z.ZodDate>;
|
|
46
|
+
references: z.ZodArray<z.ZodString>;
|
|
47
|
+
replyTo: z.ZodArray<z.ZodObject<{
|
|
48
|
+
address: z.ZodString;
|
|
49
|
+
name: z.ZodOptional<z.ZodString>;
|
|
50
|
+
}, z.core.$strip>>;
|
|
51
|
+
returnPath: z.ZodOptional<z.ZodString>;
|
|
52
|
+
sender: z.ZodOptional<z.ZodObject<{
|
|
53
|
+
address: z.ZodString;
|
|
54
|
+
name: z.ZodOptional<z.ZodString>;
|
|
55
|
+
}, z.core.$strip>>;
|
|
56
|
+
sentAt: z.ZodOptional<z.ZodDate>;
|
|
57
|
+
sizeEstimate: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
snippet: z.ZodOptional<z.ZodString>;
|
|
59
|
+
subject: z.ZodString;
|
|
60
|
+
text: z.ZodOptional<z.ZodString>;
|
|
61
|
+
to: z.ZodArray<z.ZodObject<{
|
|
62
|
+
address: z.ZodString;
|
|
63
|
+
name: z.ZodOptional<z.ZodString>;
|
|
64
|
+
}, z.core.$strip>>;
|
|
65
|
+
}, z.core.$strip>>;
|
|
66
|
+
}, z.core.$strip>, "google">;
|
|
67
|
+
//# sourceMappingURL=get-thread.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-thread.d.ts","sourceRoot":"","sources":["../../../../src/components/gmail/actions/get-thread.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,kEAAkE;AAClE,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAwBlB,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineAction } from "../../../automation/actions.js";
|
|
3
|
+
import { getGmailApi, getGmailMessage } from "../lib/gmail.js";
|
|
4
|
+
import { GMAIL_READ_REQUIREMENT } from "../lib/scopes.js";
|
|
5
|
+
import { THREAD_SCHEMA } from "../lib/schemas.js";
|
|
6
|
+
/** Retrieves one Gmail thread with every message fully parsed. */
|
|
7
|
+
export const getThread = defineAction("Get Gmail thread")
|
|
8
|
+
.describe("Gets a Gmail thread with parsed messages and attachments.")
|
|
9
|
+
.account("google", GMAIL_READ_REQUIREMENT)
|
|
10
|
+
.input(z.object({
|
|
11
|
+
/** Immutable Gmail thread ID. */
|
|
12
|
+
threadId: z.string().min(1),
|
|
13
|
+
}))
|
|
14
|
+
.output(THREAD_SCHEMA)
|
|
15
|
+
.handler(async ({ account, input }) => {
|
|
16
|
+
const { data: thread } = await getGmailApi(account.secret).users.threads.get({
|
|
17
|
+
format: "raw",
|
|
18
|
+
id: input.threadId,
|
|
19
|
+
userId: "me",
|
|
20
|
+
});
|
|
21
|
+
if (!thread.id)
|
|
22
|
+
throw new Error("Gmail returned an incomplete thread.");
|
|
23
|
+
return {
|
|
24
|
+
historyId: thread.historyId ?? undefined,
|
|
25
|
+
messages: await Promise.all((thread.messages ?? []).map(getGmailMessage)),
|
|
26
|
+
threadId: thread.id,
|
|
27
|
+
};
|
|
28
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Checks whether a Gmail message has a label by display name or ID. */
|
|
3
|
+
export declare const hasLabel: import("../../..").DefinedAction<z.ZodObject<{
|
|
4
|
+
label: z.ZodString;
|
|
5
|
+
messageId: z.ZodString;
|
|
6
|
+
}, z.core.$strip>, z.ZodBoolean, "google">;
|
|
7
|
+
//# sourceMappingURL=has-label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"has-label.d.ts","sourceRoot":"","sources":["../../../../src/components/gmail/actions/has-label.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB,wEAAwE;AACxE,eAAO,MAAM,QAAQ;;;0CAoBjB,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineAction } from "../../../automation/actions.js";
|
|
3
|
+
import { findLabelId, getGmailApi, getMessageMetadata } from "../lib/gmail.js";
|
|
4
|
+
import { GMAIL_READ_REQUIREMENT } from "../lib/scopes.js";
|
|
5
|
+
/** Checks whether a Gmail message has a label by display name or ID. */
|
|
6
|
+
export const hasLabel = defineAction("Check Gmail label")
|
|
7
|
+
.describe("Checks whether a Gmail message carries a label.")
|
|
8
|
+
.account("google", GMAIL_READ_REQUIREMENT)
|
|
9
|
+
.input(z.object({
|
|
10
|
+
/** Gmail label display name or immutable ID. */
|
|
11
|
+
label: z.string().min(1),
|
|
12
|
+
/** Immutable Gmail message ID to inspect. */
|
|
13
|
+
messageId: z.string().min(1),
|
|
14
|
+
}))
|
|
15
|
+
.output(z.boolean())
|
|
16
|
+
.handler(async ({ account, input }) => {
|
|
17
|
+
const gmailApi = getGmailApi(account.secret);
|
|
18
|
+
const [labelId, message] = await Promise.all([
|
|
19
|
+
findLabelId(gmailApi, input.label),
|
|
20
|
+
getMessageMetadata(gmailApi, input.messageId),
|
|
21
|
+
]);
|
|
22
|
+
return message.labelIds?.includes(labelId) ?? false;
|
|
23
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export * from "./add-label.js";
|
|
2
|
+
export * from "./archive.js";
|
|
3
|
+
export * from "./create-label.js";
|
|
4
|
+
export * from "./delete-draft.js";
|
|
5
|
+
export * from "./delete-label.js";
|
|
6
|
+
export * from "./draft-email.js";
|
|
7
|
+
export * from "./draft-reply.js";
|
|
8
|
+
export * from "./forward.js";
|
|
9
|
+
export * from "./get-draft.js";
|
|
10
|
+
export * from "./get-message.js";
|
|
11
|
+
export * from "./get-messages.js";
|
|
12
|
+
export * from "./get-profile.js";
|
|
13
|
+
export * from "./get-raw-message.js";
|
|
14
|
+
export * from "./get-thread.js";
|
|
15
|
+
export * from "./has-label.js";
|
|
16
|
+
export * from "./is-important.js";
|
|
17
|
+
export * from "./is-starred.js";
|
|
18
|
+
export * from "./is-unread.js";
|
|
19
|
+
export * from "./list-labels.js";
|
|
20
|
+
export * from "./mark-as-important.js";
|
|
21
|
+
export * from "./mark-as-not-spam.js";
|
|
22
|
+
export * from "./mark-as-read.js";
|
|
23
|
+
export * from "./mark-as-spam.js";
|
|
24
|
+
export * from "./mark-as-unread.js";
|
|
25
|
+
export * from "./modify-labels.js";
|
|
26
|
+
export * from "./move-to-inbox.js";
|
|
27
|
+
export * from "./remove-label.js";
|
|
28
|
+
export * from "./reply.js";
|
|
29
|
+
export * from "./reply-thread.js";
|
|
30
|
+
export * from "./search-drafts.js";
|
|
31
|
+
export * from "./search-messages.js";
|
|
32
|
+
export * from "./search-threads.js";
|
|
33
|
+
export * from "./send-draft.js";
|
|
34
|
+
export * from "./send-email.js";
|
|
35
|
+
export * from "./star.js";
|
|
36
|
+
export * from "./trash.js";
|
|
37
|
+
export * from "./unmark-as-important.js";
|
|
38
|
+
export * from "./unstar.js";
|
|
39
|
+
export * from "./untrash.js";
|
|
40
|
+
export * from "./update-draft.js";
|
|
41
|
+
export * from "./update-label.js";
|
|
42
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/gmail/actions/index.ts"],"names":[],"mappings":"AAAA,+BAA2B;AAC3B,6BAAyB;AACzB,kCAA8B;AAC9B,kCAA8B;AAC9B,kCAA8B;AAC9B,iCAA6B;AAC7B,iCAA6B;AAC7B,6BAAyB;AACzB,+BAA2B;AAC3B,iCAA6B;AAC7B,kCAA8B;AAC9B,iCAA6B;AAC7B,qCAAiC;AACjC,gCAA4B;AAC5B,+BAA2B;AAC3B,kCAA8B;AAC9B,gCAA4B;AAC5B,+BAA2B;AAC3B,iCAA6B;AAC7B,uCAAmC;AACnC,sCAAkC;AAClC,kCAA8B;AAC9B,kCAA8B;AAC9B,oCAAgC;AAChC,mCAA+B;AAC/B,mCAA+B;AAC/B,kCAA8B;AAC9B,2BAAuB;AACvB,kCAA8B;AAC9B,mCAA+B;AAC/B,qCAAiC;AACjC,oCAAgC;AAChC,gCAA4B;AAC5B,gCAA4B;AAC5B,0BAAsB;AACtB,2BAAuB;AACvB,yCAAqC;AACrC,4BAAwB;AACxB,6BAAyB;AACzB,kCAA8B;AAC9B,kCAA8B"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export * from "./add-label.js";
|
|
2
|
+
export * from "./archive.js";
|
|
3
|
+
export * from "./create-label.js";
|
|
4
|
+
export * from "./delete-draft.js";
|
|
5
|
+
export * from "./delete-label.js";
|
|
6
|
+
export * from "./draft-email.js";
|
|
7
|
+
export * from "./draft-reply.js";
|
|
8
|
+
export * from "./forward.js";
|
|
9
|
+
export * from "./get-draft.js";
|
|
10
|
+
export * from "./get-message.js";
|
|
11
|
+
export * from "./get-messages.js";
|
|
12
|
+
export * from "./get-profile.js";
|
|
13
|
+
export * from "./get-raw-message.js";
|
|
14
|
+
export * from "./get-thread.js";
|
|
15
|
+
export * from "./has-label.js";
|
|
16
|
+
export * from "./is-important.js";
|
|
17
|
+
export * from "./is-starred.js";
|
|
18
|
+
export * from "./is-unread.js";
|
|
19
|
+
export * from "./list-labels.js";
|
|
20
|
+
export * from "./mark-as-important.js";
|
|
21
|
+
export * from "./mark-as-not-spam.js";
|
|
22
|
+
export * from "./mark-as-read.js";
|
|
23
|
+
export * from "./mark-as-spam.js";
|
|
24
|
+
export * from "./mark-as-unread.js";
|
|
25
|
+
export * from "./modify-labels.js";
|
|
26
|
+
export * from "./move-to-inbox.js";
|
|
27
|
+
export * from "./remove-label.js";
|
|
28
|
+
export * from "./reply.js";
|
|
29
|
+
export * from "./reply-thread.js";
|
|
30
|
+
export * from "./search-drafts.js";
|
|
31
|
+
export * from "./search-messages.js";
|
|
32
|
+
export * from "./search-threads.js";
|
|
33
|
+
export * from "./send-draft.js";
|
|
34
|
+
export * from "./send-email.js";
|
|
35
|
+
export * from "./star.js";
|
|
36
|
+
export * from "./trash.js";
|
|
37
|
+
export * from "./unmark-as-important.js";
|
|
38
|
+
export * from "./unstar.js";
|
|
39
|
+
export * from "./untrash.js";
|
|
40
|
+
export * from "./update-draft.js";
|
|
41
|
+
export * from "./update-label.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Checks whether Gmail currently considers a message important. */
|
|
2
|
+
export declare const isImportant: import("../../..").DefinedAction<import("zod").ZodObject<{
|
|
3
|
+
messageId: import("zod").ZodString;
|
|
4
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodBoolean, "google">;
|
|
5
|
+
//# sourceMappingURL=is-important.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-important.d.ts","sourceRoot":"","sources":["../../../../src/components/gmail/actions/is-important.ts"],"names":[],"mappings":"AAEA,oEAAoE;AACpE,eAAO,MAAM,WAAW;;qEAIvB,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { defineMessageLabelPredicate } from "../lib/action-factories.js";
|
|
2
|
+
/** Checks whether Gmail currently considers a message important. */
|
|
3
|
+
export const isImportant = defineMessageLabelPredicate("Check whether Gmail message is important", "Checks whether Gmail considers a message important.", "IMPORTANT");
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Checks whether a Gmail message is currently starred. */
|
|
2
|
+
export declare const isStarred: import("../../..").DefinedAction<import("zod").ZodObject<{
|
|
3
|
+
messageId: import("zod").ZodString;
|
|
4
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodBoolean, "google">;
|
|
5
|
+
//# sourceMappingURL=is-starred.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-starred.d.ts","sourceRoot":"","sources":["../../../../src/components/gmail/actions/is-starred.ts"],"names":[],"mappings":"AAEA,2DAA2D;AAC3D,eAAO,MAAM,SAAS;;qEAIrB,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { defineMessageLabelPredicate } from "../lib/action-factories.js";
|
|
2
|
+
/** Checks whether a Gmail message is currently starred. */
|
|
3
|
+
export const isStarred = defineMessageLabelPredicate("Check whether Gmail message is starred", "Checks whether a Gmail message is starred.", "STARRED");
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Checks whether a Gmail message is currently unread. */
|
|
2
|
+
export declare const isUnread: import("../../..").DefinedAction<import("zod").ZodObject<{
|
|
3
|
+
messageId: import("zod").ZodString;
|
|
4
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodBoolean, "google">;
|
|
5
|
+
//# sourceMappingURL=is-unread.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-unread.d.ts","sourceRoot":"","sources":["../../../../src/components/gmail/actions/is-unread.ts"],"names":[],"mappings":"AAEA,0DAA0D;AAC1D,eAAO,MAAM,QAAQ;;qEAIpB,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { defineMessageLabelPredicate } from "../lib/action-factories.js";
|
|
2
|
+
/** Checks whether a Gmail message is currently unread. */
|
|
3
|
+
export const isUnread = defineMessageLabelPredicate("Check whether Gmail message is unread", "Checks whether a Gmail message is unread.", "UNREAD");
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** Lists all Gmail system and user labels with available counts and colors. */
|
|
2
|
+
export declare const listLabels: import("../../..").DefinedAction<import("better-auth").StandardSchemaV1<Record<string, never>, Record<string, never>>, import("zod").ZodArray<import("zod").ZodObject<{
|
|
3
|
+
color: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
4
|
+
backgroundColor: import("zod").ZodString;
|
|
5
|
+
textColor: import("zod").ZodString;
|
|
6
|
+
}, import("zod/v4/core").$strip>>;
|
|
7
|
+
labelId: import("zod").ZodString;
|
|
8
|
+
labelListVisibility: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
9
|
+
labelHide: "labelHide";
|
|
10
|
+
labelShow: "labelShow";
|
|
11
|
+
labelShowIfUnread: "labelShowIfUnread";
|
|
12
|
+
}>>;
|
|
13
|
+
messageListVisibility: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
14
|
+
hide: "hide";
|
|
15
|
+
show: "show";
|
|
16
|
+
}>>;
|
|
17
|
+
messagesTotal: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
18
|
+
messagesUnread: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
19
|
+
name: import("zod").ZodString;
|
|
20
|
+
threadsTotal: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
21
|
+
threadsUnread: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
22
|
+
type: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
23
|
+
system: "system";
|
|
24
|
+
user: "user";
|
|
25
|
+
}>>;
|
|
26
|
+
}, import("zod/v4/core").$strip>>, "google">;
|
|
27
|
+
//# sourceMappingURL=list-labels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-labels.d.ts","sourceRoot":"","sources":["../../../../src/components/gmail/actions/list-labels.ts"],"names":[],"mappings":"AAKA,+EAA+E;AAC/E,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;4CASnB,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineAction } from "../../../automation/actions.js";
|
|
2
|
+
import { getGmailApi, toGmailLabel } from "../lib/gmail.js";
|
|
3
|
+
import { GMAIL_METADATA_REQUIREMENT } from "../lib/scopes.js";
|
|
4
|
+
import { LABEL_SCHEMA } from "../lib/schemas.js";
|
|
5
|
+
/** Lists all Gmail system and user labels with available counts and colors. */
|
|
6
|
+
export const listLabels = defineAction("List Gmail labels")
|
|
7
|
+
.describe("Lists Gmail labels with visibility, count, and color metadata.")
|
|
8
|
+
.account("google", GMAIL_METADATA_REQUIREMENT)
|
|
9
|
+
.output(LABEL_SCHEMA.array())
|
|
10
|
+
.handler(async ({ account }) => {
|
|
11
|
+
const { data } = await getGmailApi(account.secret).users.labels.list({
|
|
12
|
+
userId: "me",
|
|
13
|
+
});
|
|
14
|
+
return (data.labels ?? []).map(toGmailLabel);
|
|
15
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Adds Gmail's Important marker to one or many messages. */
|
|
2
|
+
export declare const markAsImportant: import("../../..").DefinedAction<import("zod").ZodObject<{
|
|
3
|
+
messageIds: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>]>;
|
|
4
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodArray<import("zod").ZodString>, "google">;
|
|
5
|
+
//# sourceMappingURL=mark-as-important.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mark-as-important.d.ts","sourceRoot":"","sources":["../../../../src/components/gmail/actions/mark-as-important.ts"],"names":[],"mappings":"AAEA,6DAA6D;AAC7D,eAAO,MAAM,eAAe;;4FAI3B,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { defineMessageLabelMutation } from "../lib/action-factories.js";
|
|
2
|
+
/** Adds Gmail's Important marker to one or many messages. */
|
|
3
|
+
export const markAsImportant = defineMessageLabelMutation("Mark Gmail messages as important", "Marks Gmail messages as important.", { addLabelIds: ["IMPORTANT"] });
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Moves one or many Gmail messages out of Spam and into the inbox. */
|
|
2
|
+
export declare const markAsNotSpam: import("../../..").DefinedAction<import("zod").ZodObject<{
|
|
3
|
+
messageIds: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>]>;
|
|
4
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodArray<import("zod").ZodString>, "google">;
|
|
5
|
+
//# sourceMappingURL=mark-as-not-spam.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mark-as-not-spam.d.ts","sourceRoot":"","sources":["../../../../src/components/gmail/actions/mark-as-not-spam.ts"],"names":[],"mappings":"AAEA,uEAAuE;AACvE,eAAO,MAAM,aAAa;;4FAIzB,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { defineMessageLabelMutation } from "../lib/action-factories.js";
|
|
2
|
+
/** Moves one or many Gmail messages out of Spam and into the inbox. */
|
|
3
|
+
export const markAsNotSpam = defineMessageLabelMutation("Mark Gmail messages as not spam", "Removes Spam and restores Inbox on Gmail messages.", { addLabelIds: ["INBOX"], removeLabelIds: ["SPAM"] });
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Marks one or many Gmail messages as read. */
|
|
2
|
+
export declare const markAsRead: import("../../..").DefinedAction<import("zod").ZodObject<{
|
|
3
|
+
messageIds: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>]>;
|
|
4
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodArray<import("zod").ZodString>, "google">;
|
|
5
|
+
//# sourceMappingURL=mark-as-read.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mark-as-read.d.ts","sourceRoot":"","sources":["../../../../src/components/gmail/actions/mark-as-read.ts"],"names":[],"mappings":"AAEA,gDAAgD;AAChD,eAAO,MAAM,UAAU;;4FAItB,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Moves one or many Gmail messages into Spam. */
|
|
2
|
+
export declare const markAsSpam: import("../../..").DefinedAction<import("zod").ZodObject<{
|
|
3
|
+
messageIds: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>]>;
|
|
4
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodArray<import("zod").ZodString>, "google">;
|
|
5
|
+
//# sourceMappingURL=mark-as-spam.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mark-as-spam.d.ts","sourceRoot":"","sources":["../../../../src/components/gmail/actions/mark-as-spam.ts"],"names":[],"mappings":"AAEA,kDAAkD;AAClD,eAAO,MAAM,UAAU;;4FAItB,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { defineMessageLabelMutation } from "../lib/action-factories.js";
|
|
2
|
+
/** Moves one or many Gmail messages into Spam. */
|
|
3
|
+
export const markAsSpam = defineMessageLabelMutation("Mark Gmail messages as spam", "Moves Gmail messages to Spam.", { addLabelIds: ["SPAM"], removeLabelIds: ["INBOX"] });
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Marks one or many Gmail messages as unread. */
|
|
2
|
+
export declare const markAsUnread: import("../../..").DefinedAction<import("zod").ZodObject<{
|
|
3
|
+
messageIds: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>]>;
|
|
4
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodArray<import("zod").ZodString>, "google">;
|
|
5
|
+
//# sourceMappingURL=mark-as-unread.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mark-as-unread.d.ts","sourceRoot":"","sources":["../../../../src/components/gmail/actions/mark-as-unread.ts"],"names":[],"mappings":"AAEA,kDAAkD;AAClD,eAAO,MAAM,YAAY;;4FAIxB,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { defineMessageLabelMutation } from "../lib/action-factories.js";
|
|
2
|
+
/** Marks one or many Gmail messages as unread. */
|
|
3
|
+
export const markAsUnread = defineMessageLabelMutation("Mark Gmail messages as unread", "Marks Gmail messages as unread.", { addLabelIds: ["UNREAD"] });
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Adds and removes multiple Gmail labels in one batch request.
|
|
4
|
+
*
|
|
5
|
+
* Label display names and immutable IDs may be mixed in either list.
|
|
6
|
+
*/
|
|
7
|
+
export declare const modifyLabels: import("../../..").DefinedAction<z.ZodObject<{
|
|
8
|
+
add: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
9
|
+
messageIds: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
10
|
+
remove: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
11
|
+
}, z.core.$strip>, z.ZodArray<z.ZodString>, "google">;
|
|
12
|
+
//# sourceMappingURL=modify-labels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modify-labels.d.ts","sourceRoot":"","sources":["../../../../src/components/gmail/actions/modify-labels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB;;;;GAIG;AACH,eAAO,MAAM,YAAY;;;;qDAqCrB,CAAA"}
|