@frogbotai/piece-gmail 0.27.0 → 0.29.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/actions/customApiCall.d.ts +3 -23
- package/dist/actions/customApiCall.d.ts.map +1 -1
- package/dist/actions/customApiCall.js +3 -2
- package/dist/actions/customApiCall.js.map +1 -1
- package/dist/actions/getEmail.d.ts +17 -44
- package/dist/actions/getEmail.d.ts.map +1 -1
- package/dist/actions/getEmail.js +5 -3
- package/dist/actions/getEmail.js.map +1 -1
- package/dist/actions/replyToEmail.d.ts +38 -57
- package/dist/actions/replyToEmail.d.ts.map +1 -1
- package/dist/actions/replyToEmail.js +7 -5
- package/dist/actions/replyToEmail.js.map +1 -1
- package/dist/actions/searchEmails.d.ts +16 -26
- package/dist/actions/searchEmails.d.ts.map +1 -1
- package/dist/actions/searchEmails.js +3 -2
- package/dist/actions/searchEmails.js.map +1 -1
- package/dist/actions/send.d.ts +12 -35
- package/dist/actions/send.d.ts.map +1 -1
- package/dist/actions/send.js +5 -3
- package/dist/actions/send.js.map +1 -1
- package/dist/define.d.ts +42 -0
- package/dist/define.d.ts.map +1 -0
- package/dist/define.js +3 -0
- package/dist/define.js.map +1 -0
- package/dist/index.d.ts +175 -250
- package/dist/index.d.ts.map +1 -1
- package/dist/triggers/newEmail.d.ts +35 -20
- package/dist/triggers/newEmail.d.ts.map +1 -1
- package/dist/triggers/newEmail.js +4 -3
- package/dist/triggers/newEmail.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { type PieceRunArgs } from 'frogbot/pieces';
|
|
2
1
|
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
declare const inputSchema: z.ZodObject<{
|
|
2
|
+
export declare const customApiCall: import("frogbot").PieceActionDefinition<z.ZodObject<{
|
|
5
3
|
method: z.ZodEnum<{
|
|
6
4
|
GET: "GET";
|
|
7
5
|
POST: "POST";
|
|
@@ -12,25 +10,7 @@ declare const inputSchema: z.ZodObject<{
|
|
|
12
10
|
path: z.ZodString;
|
|
13
11
|
query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
14
12
|
body: z.ZodOptional<z.ZodUnknown>;
|
|
15
|
-
}, z.core.$strip
|
|
16
|
-
|
|
17
|
-
slug: string;
|
|
18
|
-
description: string;
|
|
19
|
-
input: z.ZodObject<{
|
|
20
|
-
method: z.ZodEnum<{
|
|
21
|
-
GET: "GET";
|
|
22
|
-
POST: "POST";
|
|
23
|
-
PUT: "PUT";
|
|
24
|
-
PATCH: "PATCH";
|
|
25
|
-
DELETE: "DELETE";
|
|
26
|
-
}>;
|
|
27
|
-
path: z.ZodString;
|
|
28
|
-
query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
29
|
-
body: z.ZodOptional<z.ZodUnknown>;
|
|
30
|
-
}, z.core.$strip>;
|
|
31
|
-
output: z.ZodUnknown;
|
|
32
|
-
idempotent: boolean;
|
|
33
|
-
run({ client, input }: PieceRunArgs<z.output<typeof inputSchema>, object, Gmail>): Promise<unknown>;
|
|
13
|
+
}, z.core.$strip>, z.ZodUnknown, Record<string, never>, import("googleapis").gmail_v1.Gmail, unknown> & {
|
|
14
|
+
slug: "customApiCall";
|
|
34
15
|
};
|
|
35
|
-
export {};
|
|
36
16
|
//# sourceMappingURL=customApiCall.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customApiCall.d.ts","sourceRoot":"","sources":["../../src/actions/customApiCall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"customApiCall.d.ts","sourceRoot":"","sources":["../../src/actions/customApiCall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;CAoBxB,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { defineAction } from '../define.js';
|
|
2
3
|
const inputSchema = z.object({
|
|
3
4
|
method: z.enum(['GET', 'POST', 'PUT', 'PATCH', 'DELETE']),
|
|
4
5
|
path: z.string().startsWith('/'),
|
|
5
6
|
query: z.record(z.string(), z.union([z.string(), z.number(), z.boolean()])).optional(),
|
|
6
7
|
body: z.unknown().optional(),
|
|
7
8
|
});
|
|
8
|
-
export const customApiCall = {
|
|
9
|
+
export const customApiCall = defineAction({
|
|
9
10
|
slug: 'customApiCall',
|
|
10
11
|
description: 'Make an authenticated Gmail API call.',
|
|
11
12
|
input: inputSchema,
|
|
@@ -23,5 +24,5 @@ export const customApiCall = {
|
|
|
23
24
|
data: input.body,
|
|
24
25
|
})).data;
|
|
25
26
|
},
|
|
26
|
-
};
|
|
27
|
+
});
|
|
27
28
|
//# sourceMappingURL=customApiCall.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customApiCall.js","sourceRoot":"","sources":["../../src/actions/customApiCall.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"customApiCall.js","sourceRoot":"","sources":["../../src/actions/customApiCall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IACzD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC;IAChC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACtF,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAC;IACxC,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,uCAAuC;IACpD,KAAK,EAAE,WAAW;IAClB,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;IACnB,UAAU,EAAE,KAAK;IACjB,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE;QACzB,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;QAC7C,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,CAAC,SAAS,IAAI,OAAO,CAAC,EAAE,CAAC;YACvE,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;QAChF,CAAC;QACD,OAAO,CACL,MAAM,OAAO,CAAC,OAAO,CAAC;YACpB,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,GAAG,EAAE,wCAAwC,KAAK,CAAC,IAAI,EAAE;YACzD,MAAM,EAAE,KAAK,CAAC,KAAK;YACnB,IAAI,EAAE,KAAK,CAAC,IAAI;SACjB,CAAC,CACH,CAAC,IAAI,CAAC;IACT,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,53 +1,26 @@
|
|
|
1
|
-
import { type PieceRunArgs } from 'frogbot/pieces';
|
|
2
1
|
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
declare const inputSchema: z.ZodObject<{
|
|
2
|
+
export declare const getEmail: import("frogbot").PieceActionDefinition<z.ZodObject<{
|
|
5
3
|
messageId: z.ZodString;
|
|
6
4
|
format: z.ZodDefault<z.ZodEnum<{
|
|
5
|
+
metadata: "metadata";
|
|
7
6
|
full: "full";
|
|
8
7
|
minimal: "minimal";
|
|
9
8
|
raw: "raw";
|
|
10
|
-
metadata: "metadata";
|
|
11
9
|
}>>;
|
|
12
|
-
}, z.core.$strip
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
threadId: z.ZodOptional<z.ZodString>;
|
|
28
|
-
labelIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
29
|
-
snippet: z.ZodOptional<z.ZodString>;
|
|
30
|
-
payload: z.ZodOptional<z.ZodUnknown>;
|
|
31
|
-
}, z.core.$loose>;
|
|
32
|
-
idempotent: boolean;
|
|
33
|
-
run({ client, input, req }: PieceRunArgs<z.output<typeof inputSchema>, object, Gmail>): Promise<import("googleapis").gmail_v1.Schema$Message | {
|
|
34
|
-
attachments: {
|
|
35
|
-
id: string | number;
|
|
36
|
-
name: string;
|
|
37
|
-
mimeType: string;
|
|
38
|
-
url: unknown;
|
|
39
|
-
}[];
|
|
40
|
-
classificationLabelValues?: import("googleapis").gmail_v1.Schema$ClassificationLabelValue[];
|
|
41
|
-
historyId?: string | null;
|
|
42
|
-
id?: string | null;
|
|
43
|
-
internalDate?: string | null;
|
|
44
|
-
labelIds?: string[] | null;
|
|
45
|
-
payload?: import("googleapis").gmail_v1.Schema$MessagePart;
|
|
46
|
-
raw?: string | null;
|
|
47
|
-
sizeEstimate?: number | null;
|
|
48
|
-
snippet?: string | null;
|
|
49
|
-
threadId?: string | null;
|
|
50
|
-
}>;
|
|
10
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
11
|
+
id: z.ZodOptional<z.ZodString>;
|
|
12
|
+
threadId: z.ZodOptional<z.ZodString>;
|
|
13
|
+
labelIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
14
|
+
snippet: z.ZodOptional<z.ZodString>;
|
|
15
|
+
payload: z.ZodOptional<z.ZodUnknown>;
|
|
16
|
+
}, z.core.$loose>, Record<string, never>, import("googleapis").gmail_v1.Gmail, {
|
|
17
|
+
[x: string]: unknown;
|
|
18
|
+
id?: string | undefined;
|
|
19
|
+
threadId?: string | undefined;
|
|
20
|
+
labelIds?: string[] | undefined;
|
|
21
|
+
snippet?: string | undefined;
|
|
22
|
+
payload?: unknown;
|
|
23
|
+
}> & {
|
|
24
|
+
slug: "getEmail";
|
|
51
25
|
};
|
|
52
|
-
export {};
|
|
53
26
|
//# sourceMappingURL=getEmail.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEmail.d.ts","sourceRoot":"","sources":["../../src/actions/getEmail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"getEmail.d.ts","sourceRoot":"","sources":["../../src/actions/getEmail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;CAcnB,CAAC"}
|
package/dist/actions/getEmail.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { defineAction } from '../define.js';
|
|
2
3
|
import { emailOutput, saveAttachments } from '../mail.js';
|
|
3
4
|
const inputSchema = z.object({
|
|
4
5
|
messageId: z.string(),
|
|
5
6
|
format: z.enum(['minimal', 'full', 'raw', 'metadata']).default('full'),
|
|
6
7
|
});
|
|
7
|
-
export const getEmail = {
|
|
8
|
+
export const getEmail = defineAction({
|
|
8
9
|
slug: 'getEmail',
|
|
9
10
|
description: 'Get an email by ID.',
|
|
10
11
|
input: inputSchema,
|
|
@@ -12,7 +13,8 @@ export const getEmail = {
|
|
|
12
13
|
idempotent: true,
|
|
13
14
|
async run({ client, input, req }) {
|
|
14
15
|
const message = (await client.users.messages.get({ userId: 'me', id: input.messageId, format: input.format })).data;
|
|
15
|
-
|
|
16
|
+
const email = input.format === 'full' ? await saveAttachments(client, req, message) : message;
|
|
17
|
+
return email;
|
|
16
18
|
},
|
|
17
|
-
};
|
|
19
|
+
});
|
|
18
20
|
//# sourceMappingURL=getEmail.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEmail.js","sourceRoot":"","sources":["../../src/actions/getEmail.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getEmail.js","sourceRoot":"","sources":["../../src/actions/getEmail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE1D,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;CACvE,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAG,YAAY,CAAC;IACnC,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,qBAAqB;IAClC,KAAK,EAAE,WAAW;IAClB,MAAM,EAAE,WAAW;IACnB,UAAU,EAAE,IAAI;IAChB,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE;QAC9B,MAAM,OAAO,GAAG,CACd,MAAM,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAC7F,CAAC,IAAI,CAAC;QACP,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,eAAe,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QAE9F,OAAO,KAAqC,CAAC;IAC/C,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { type PieceRunArgs } from 'frogbot/pieces';
|
|
2
1
|
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
declare const inputSchema: z.ZodObject<{
|
|
2
|
+
export declare const replyToEmail: import("frogbot").PieceActionDefinition<z.ZodObject<{
|
|
5
3
|
body: z.ZodString;
|
|
6
4
|
bodyType: z.ZodDefault<z.ZodEnum<{
|
|
7
5
|
plainText: "plainText";
|
|
@@ -16,60 +14,43 @@ declare const inputSchema: z.ZodObject<{
|
|
|
16
14
|
reply: "reply";
|
|
17
15
|
replyAll: "replyAll";
|
|
18
16
|
}>>;
|
|
19
|
-
}, z.core.$strip
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
fileId: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
31
|
-
name: z.ZodOptional<z.ZodString>;
|
|
32
|
-
}, z.core.$strip>>>;
|
|
33
|
-
messageId: z.ZodString;
|
|
34
|
-
replyType: z.ZodDefault<z.ZodEnum<{
|
|
35
|
-
reply: "reply";
|
|
36
|
-
replyAll: "replyAll";
|
|
37
|
-
}>>;
|
|
38
|
-
}, z.core.$strip>;
|
|
39
|
-
output: z.ZodObject<{
|
|
40
|
-
id: z.ZodOptional<z.ZodString>;
|
|
41
|
-
threadId: z.ZodOptional<z.ZodString>;
|
|
42
|
-
labelIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
43
|
-
}, z.core.$loose>;
|
|
44
|
-
idempotent: boolean;
|
|
45
|
-
run: (args: PieceRunArgs<z.output<typeof inputSchema>, object, Gmail>) => Promise<import("googleapis").gmail_v1.Schema$Message>;
|
|
17
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
18
|
+
id: z.ZodOptional<z.ZodString>;
|
|
19
|
+
threadId: z.ZodOptional<z.ZodString>;
|
|
20
|
+
labelIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
21
|
+
}, z.core.$loose>, Record<string, never>, import("googleapis").gmail_v1.Gmail, {
|
|
22
|
+
[x: string]: unknown;
|
|
23
|
+
id?: string | undefined;
|
|
24
|
+
threadId?: string | undefined;
|
|
25
|
+
labelIds?: string[] | undefined;
|
|
26
|
+
}> & {
|
|
27
|
+
slug: "replyToEmail";
|
|
46
28
|
};
|
|
47
|
-
export declare const createDraftReply: {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
29
|
+
export declare const createDraftReply: import("frogbot").PieceActionDefinition<z.ZodObject<{
|
|
30
|
+
body: z.ZodString;
|
|
31
|
+
bodyType: z.ZodDefault<z.ZodEnum<{
|
|
32
|
+
plainText: "plainText";
|
|
33
|
+
html: "html";
|
|
34
|
+
}>>;
|
|
35
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
36
|
+
fileId: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
37
|
+
name: z.ZodOptional<z.ZodString>;
|
|
38
|
+
}, z.core.$strip>>>;
|
|
39
|
+
messageId: z.ZodString;
|
|
40
|
+
replyType: z.ZodDefault<z.ZodEnum<{
|
|
41
|
+
reply: "reply";
|
|
42
|
+
replyAll: "replyAll";
|
|
43
|
+
}>>;
|
|
44
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
45
|
+
id: z.ZodOptional<z.ZodString>;
|
|
46
|
+
threadId: z.ZodOptional<z.ZodString>;
|
|
47
|
+
labelIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
48
|
+
}, z.core.$loose>, Record<string, never>, import("googleapis").gmail_v1.Gmail, {
|
|
49
|
+
[x: string]: unknown;
|
|
50
|
+
id?: string | undefined;
|
|
51
|
+
threadId?: string | undefined;
|
|
52
|
+
labelIds?: string[] | undefined;
|
|
53
|
+
}> & {
|
|
54
|
+
slug: "createDraftReply";
|
|
73
55
|
};
|
|
74
|
-
export {};
|
|
75
56
|
//# sourceMappingURL=replyToEmail.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replyToEmail.d.ts","sourceRoot":"","sources":["../../src/actions/replyToEmail.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"replyToEmail.d.ts","sourceRoot":"","sources":["../../src/actions/replyToEmail.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqDxB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;CAOvB,CAAC;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;CAO3B,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { defineAction } from '../define.js';
|
|
2
3
|
import { createRawMessage, findHeader, getOriginal, messageBody, messageOutput, splitAddresses, } from '../mail.js';
|
|
3
4
|
const inputSchema = z.object({
|
|
4
5
|
messageId: z.string(),
|
|
@@ -21,25 +22,26 @@ async function replyMessage({ client, input, req, draft, }) {
|
|
|
21
22
|
extraHeaders: [`In-Reply-To: ${messageId}`, `References: ${messageId}`],
|
|
22
23
|
}),
|
|
23
24
|
};
|
|
24
|
-
|
|
25
|
+
const sent = draft
|
|
25
26
|
? ((await client.users.drafts.create({ userId: 'me', requestBody: { message } })).data
|
|
26
27
|
.message ?? {})
|
|
27
28
|
: (await client.users.messages.send({ userId: 'me', requestBody: message })).data;
|
|
29
|
+
return sent;
|
|
28
30
|
}
|
|
29
|
-
export const replyToEmail = {
|
|
31
|
+
export const replyToEmail = defineAction({
|
|
30
32
|
slug: 'replyToEmail',
|
|
31
33
|
description: 'Reply to an existing email.',
|
|
32
34
|
input: inputSchema,
|
|
33
35
|
output: messageOutput,
|
|
34
36
|
idempotent: false,
|
|
35
37
|
run: (args) => replyMessage({ ...args, draft: false }),
|
|
36
|
-
};
|
|
37
|
-
export const createDraftReply = {
|
|
38
|
+
});
|
|
39
|
+
export const createDraftReply = defineAction({
|
|
38
40
|
slug: 'createDraftReply',
|
|
39
41
|
description: 'Create a draft reply to an existing email.',
|
|
40
42
|
input: inputSchema,
|
|
41
43
|
output: messageOutput,
|
|
42
44
|
idempotent: false,
|
|
43
45
|
run: (args) => replyMessage({ ...args, draft: true }),
|
|
44
|
-
};
|
|
46
|
+
});
|
|
45
47
|
//# sourceMappingURL=replyToEmail.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replyToEmail.js","sourceRoot":"","sources":["../../src/actions/replyToEmail.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,WAAW,EACX,aAAa,EACb,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CA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,MAAM,CAAC,MAAM,gBAAgB,GAAG,YAAY,CAAC;IAC3C,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,4CAA4C;IACzD,KAAK,EAAE,WAAW;IAClB,MAAM,EAAE,aAAa;IACrB,UAAU,EAAE,KAAK;IACjB,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;CACtD,CAAC,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { type PieceRunArgs } from 'frogbot/pieces';
|
|
2
1
|
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
declare const inputSchema: z.ZodObject<{
|
|
2
|
+
export declare const searchEmails: import("frogbot").PieceActionDefinition<z.ZodObject<{
|
|
5
3
|
query: z.ZodOptional<z.ZodString>;
|
|
6
4
|
from: z.ZodOptional<z.ZodString>;
|
|
7
5
|
to: z.ZodOptional<z.ZodString>;
|
|
@@ -9,28 +7,20 @@ declare const inputSchema: z.ZodObject<{
|
|
|
9
7
|
labelIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
10
8
|
maxResults: z.ZodDefault<z.ZodNumber>;
|
|
11
9
|
includeSpamTrash: z.ZodDefault<z.ZodBoolean>;
|
|
12
|
-
}, z.core.$strip
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
threadId: z.ZodOptional<z.ZodString>;
|
|
28
|
-
labelIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
29
|
-
snippet: z.ZodOptional<z.ZodString>;
|
|
30
|
-
payload: z.ZodOptional<z.ZodUnknown>;
|
|
31
|
-
}, z.core.$loose>>;
|
|
32
|
-
idempotent: boolean;
|
|
33
|
-
run({ client, input, req }: PieceRunArgs<z.output<typeof inputSchema>, object, Gmail>): Promise<{}[]>;
|
|
10
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
11
|
+
id: z.ZodOptional<z.ZodString>;
|
|
12
|
+
threadId: z.ZodOptional<z.ZodString>;
|
|
13
|
+
labelIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
14
|
+
snippet: z.ZodOptional<z.ZodString>;
|
|
15
|
+
payload: z.ZodOptional<z.ZodUnknown>;
|
|
16
|
+
}, z.core.$loose>>, Record<string, never>, import("googleapis").gmail_v1.Gmail, {
|
|
17
|
+
[x: string]: unknown;
|
|
18
|
+
id?: string | undefined;
|
|
19
|
+
threadId?: string | undefined;
|
|
20
|
+
labelIds?: string[] | undefined;
|
|
21
|
+
snippet?: string | undefined;
|
|
22
|
+
payload?: unknown;
|
|
23
|
+
}[]> & {
|
|
24
|
+
slug: "searchEmails";
|
|
34
25
|
};
|
|
35
|
-
export {};
|
|
36
26
|
//# sourceMappingURL=searchEmails.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchEmails.d.ts","sourceRoot":"","sources":["../../src/actions/searchEmails.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"searchEmails.d.ts","sourceRoot":"","sources":["../../src/actions/searchEmails.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;CAoBvB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { defineAction } from '../define.js';
|
|
2
3
|
import { emailOutput, getOriginal, saveAttachments, searchQuery } from '../mail.js';
|
|
3
4
|
const inputSchema = z.object({
|
|
4
5
|
query: z.string().optional(),
|
|
@@ -9,7 +10,7 @@ const inputSchema = z.object({
|
|
|
9
10
|
maxResults: z.number().int().min(1).max(500).default(20),
|
|
10
11
|
includeSpamTrash: z.boolean().default(false),
|
|
11
12
|
});
|
|
12
|
-
export const searchEmails = {
|
|
13
|
+
export const searchEmails = defineAction({
|
|
13
14
|
slug: 'searchEmails',
|
|
14
15
|
description: 'Search emails using Gmail search syntax and common filters.',
|
|
15
16
|
input: inputSchema,
|
|
@@ -25,5 +26,5 @@ export const searchEmails = {
|
|
|
25
26
|
});
|
|
26
27
|
return Promise.all((list.data.messages ?? []).map(async ({ id }) => id ? saveAttachments(client, req, await getOriginal(client, id)) : {}));
|
|
27
28
|
},
|
|
28
|
-
};
|
|
29
|
+
});
|
|
29
30
|
//# sourceMappingURL=searchEmails.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchEmails.js","sourceRoot":"","sources":["../../src/actions/searchEmails.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"searchEmails.js","sourceRoot":"","sources":["../../src/actions/searchEmails.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEpF,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACxC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC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|
-
declare const inputSchema: z.ZodObject<{
|
|
2
|
+
export declare const send: import("frogbot").PieceActionDefinition<z.ZodObject<{
|
|
5
3
|
replyTo: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6
4
|
senderName: z.ZodOptional<z.ZodString>;
|
|
7
5
|
from: z.ZodOptional<z.ZodString>;
|
|
@@ -20,37 +18,16 @@ declare const inputSchema: z.ZodObject<{
|
|
|
20
18
|
to: z.ZodArray<z.ZodString>;
|
|
21
19
|
cc: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
22
20
|
bcc: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
23
|
-
}, z.core.$strip
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
bodyType: z.ZodDefault<z.ZodEnum<{
|
|
35
|
-
plainText: "plainText";
|
|
36
|
-
html: "html";
|
|
37
|
-
}>>;
|
|
38
|
-
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
39
|
-
fileId: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
40
|
-
name: z.ZodOptional<z.ZodString>;
|
|
41
|
-
}, z.core.$strip>>>;
|
|
42
|
-
subject: z.ZodString;
|
|
43
|
-
to: z.ZodArray<z.ZodString>;
|
|
44
|
-
cc: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
45
|
-
bcc: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
46
|
-
}, z.core.$strip>;
|
|
47
|
-
output: z.ZodObject<{
|
|
48
|
-
id: z.ZodOptional<z.ZodString>;
|
|
49
|
-
threadId: z.ZodOptional<z.ZodString>;
|
|
50
|
-
labelIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
51
|
-
}, z.core.$loose>;
|
|
52
|
-
idempotent: boolean;
|
|
53
|
-
run({ client, input, req }: PieceRunArgs<z.output<typeof inputSchema>, object, Gmail>): Promise<import("googleapis").gmail_v1.Schema$Message>;
|
|
21
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
22
|
+
id: z.ZodOptional<z.ZodString>;
|
|
23
|
+
threadId: z.ZodOptional<z.ZodString>;
|
|
24
|
+
labelIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
25
|
+
}, z.core.$loose>, Record<string, never>, import("googleapis").gmail_v1.Gmail, {
|
|
26
|
+
[x: string]: unknown;
|
|
27
|
+
id?: string | undefined;
|
|
28
|
+
threadId?: string | undefined;
|
|
29
|
+
labelIds?: string[] | undefined;
|
|
30
|
+
}> & {
|
|
31
|
+
slug: "send";
|
|
54
32
|
};
|
|
55
|
-
export {};
|
|
56
33
|
//# sourceMappingURL=send.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../src/actions/send.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../src/actions/send.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBxB,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuBf,CAAC"}
|
package/dist/actions/send.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { defineAction } from '../define.js';
|
|
2
3
|
import { createRawMessage, messageBody, messageOutput, recipients } from '../mail.js';
|
|
3
4
|
const inputSchema = z.object({
|
|
4
5
|
...recipients,
|
|
@@ -10,7 +11,7 @@ const inputSchema = z.object({
|
|
|
10
11
|
inReplyTo: z.string().optional(),
|
|
11
12
|
draft: z.boolean().default(false),
|
|
12
13
|
});
|
|
13
|
-
export const send = {
|
|
14
|
+
export const send = defineAction({
|
|
14
15
|
slug: 'send',
|
|
15
16
|
description: 'Send an email or save it as a draft.',
|
|
16
17
|
input: inputSchema,
|
|
@@ -26,10 +27,11 @@ export const send = {
|
|
|
26
27
|
.data.messages?.[0]?.threadId ?? undefined;
|
|
27
28
|
}
|
|
28
29
|
const message = { threadId, raw: await createRawMessage({ input, req, extraHeaders }) };
|
|
29
|
-
|
|
30
|
+
const sent = input.draft
|
|
30
31
|
? ((await client.users.drafts.create({ userId: 'me', requestBody: { message } })).data
|
|
31
32
|
.message ?? {})
|
|
32
33
|
: (await client.users.messages.send({ userId: 'me', requestBody: message })).data;
|
|
34
|
+
return sent;
|
|
33
35
|
},
|
|
34
|
-
};
|
|
36
|
+
});
|
|
35
37
|
//# sourceMappingURL=send.js.map
|
package/dist/actions/send.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send.js","sourceRoot":"","sources":["../../src/actions/send.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"send.js","sourceRoot":"","sources":["../../src/actions/send.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAEtF,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,GAAG,UAAU;IACb,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,GAAG,WAAW;IACd,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC/C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IACnC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,KAA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AK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QAEpF,OAAO,IAAsC,CAAC;IAChD,CAAC;CACF,CAAC,CAAC"}
|
package/dist/define.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare const defineAction: <const TSlug extends string, TInput extends import("zod").ZodType, TOutput extends import("zod").ZodType | undefined = undefined, TResult = unknown>(action: TOutput extends unknown ? import("frogbot").PieceActionDefinition<TInput, TOutput, Record<string, never>, import("googleapis").gmail_v1.Gmail, TOutput extends import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>> ? import("zod").infer<TOutput> : TResult> & {
|
|
2
|
+
slug: TSlug;
|
|
3
|
+
} : never) => import("frogbot").PieceActionDefinition<TInput, TOutput, Record<string, never>, import("googleapis").gmail_v1.Gmail, TOutput extends import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>> ? import("zod").infer<TOutput> : TResult> & {
|
|
4
|
+
slug: TSlug;
|
|
5
|
+
}, definePollingTrigger: <const TSlug extends string, TInput extends import("zod").ZodType, TOutput extends import("zod").ZodType | undefined = undefined>(trigger: TOutput extends unknown ? {
|
|
6
|
+
slug: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
description: string;
|
|
9
|
+
input: TInput;
|
|
10
|
+
output?: TOutput | undefined;
|
|
11
|
+
sample?: (TOutput extends import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>> ? import("zod").infer<TOutput> : import("frogbot").PieceJSON) | undefined;
|
|
12
|
+
} & {
|
|
13
|
+
type: "polling";
|
|
14
|
+
schedule?: string;
|
|
15
|
+
run(args: import("frogbot").PieceRunArgs<import("zod").infer<TInput>, Record<string, never>, import("googleapis").gmail_v1.Gmail> & {
|
|
16
|
+
cursor?: import("frogbot").PieceJSON | undefined;
|
|
17
|
+
}): Promise<{
|
|
18
|
+
events: (TOutput extends import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>> ? import("zod").infer<TOutput> : import("frogbot").PieceJSON)[];
|
|
19
|
+
cursor?: import("frogbot").PieceJSON | undefined;
|
|
20
|
+
}>;
|
|
21
|
+
} & {
|
|
22
|
+
slug: TSlug;
|
|
23
|
+
} : never) => {
|
|
24
|
+
slug: string;
|
|
25
|
+
label?: string;
|
|
26
|
+
description: string;
|
|
27
|
+
input: TInput;
|
|
28
|
+
output?: TOutput | undefined;
|
|
29
|
+
sample?: (TOutput extends import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>> ? import("zod").infer<TOutput> : import("frogbot").PieceJSON) | undefined;
|
|
30
|
+
} & {
|
|
31
|
+
type: "polling";
|
|
32
|
+
schedule?: string;
|
|
33
|
+
run(args: import("frogbot").PieceRunArgs<import("zod").infer<TInput>, Record<string, never>, import("googleapis").gmail_v1.Gmail> & {
|
|
34
|
+
cursor?: import("frogbot").PieceJSON | undefined;
|
|
35
|
+
}): Promise<{
|
|
36
|
+
events: (TOutput extends import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>> ? import("zod").infer<TOutput> : import("frogbot").PieceJSON)[];
|
|
37
|
+
cursor?: import("frogbot").PieceJSON | undefined;
|
|
38
|
+
}>;
|
|
39
|
+
} & {
|
|
40
|
+
slug: TSlug;
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=define.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../src/define.ts"],"names":[],"mappings":"AAIA,eAAO,MAAQ,YAAY;;;;GAAE,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAgC,CAAC"}
|
package/dist/define.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define.js","sourceRoot":"","sources":["../src/define.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAIpD,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,oBAAoB,EAAE,GAAG,kBAAkB,EAAS,CAAC"}
|