@frogbotai/piece-gmail 0.31.0 → 0.33.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/README.md +9 -1
- package/dist/actions/customApiCall.d.ts +1 -15
- package/dist/actions/customApiCall.d.ts.map +1 -1
- package/dist/actions/customApiCall.js +6 -36
- package/dist/actions/customApiCall.js.map +1 -1
- package/dist/client.d.ts +1 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +7 -0
- package/dist/client.js.map +1 -1
- package/dist/config.d.ts +12 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +12 -5
- package/dist/config.js.map +1 -1
- package/dist/define.d.ts +1 -1
- package/dist/define.d.ts.map +1 -1
- package/dist/define.js +1 -1
- package/dist/define.js.map +1 -1
- package/dist/index.d.ts +20 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -5
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -15,6 +15,14 @@ export const gmail = createGmail({
|
|
|
15
15
|
});
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
+
## OAuth scopes
|
|
19
|
+
|
|
20
|
+
Change the requested scopes with the factory's `scopes` option: `createGmail({ oauth, scopes: ({ defaultScopes }) => [...defaultScopes, 'gmail.labels'] })` adds one, and an array replaces the defaults. `gmailScopes` maps each name to the provider's scope string. Names stand for `https://www.googleapis.com/auth/<name>`, except `openid` and `mail.google.com` (`https://mail.google.com/`).
|
|
21
|
+
|
|
22
|
+
- Always requested: `openid`, `userinfo.email`, `userinfo.profile`.
|
|
23
|
+
- Defaults: `gmail.send`, `gmail.readonly`, `gmail.compose`.
|
|
24
|
+
- Also available: `mail.google.com`, `gmail.modify`, `gmail.insert`, `gmail.labels`, `gmail.metadata`, `gmail.settings.basic`, `gmail.settings.sharing`.
|
|
25
|
+
|
|
18
26
|
## Actions
|
|
19
27
|
|
|
20
28
|
| Upstream action slug | Previous wrapper export | Native action | Notes |
|
|
@@ -25,7 +33,7 @@ export const gmail = createGmail({
|
|
|
25
33
|
| `create_draft_reply` | `createDraftReply` | `createDraftReply` | |
|
|
26
34
|
| `gmail_get_mail` | `gmailGetMail` | `getEmail` | |
|
|
27
35
|
| `gmail_search_mail` | `gmailSearchMail` | `searchEmails` | |
|
|
28
|
-
| `custom_api_call` | `customApiCall` | `customApiCall` |
|
|
36
|
+
| `custom_api_call` | `customApiCall` | `customApiCall` | Paths are relative to `/gmail/v1`. |
|
|
29
37
|
|
|
30
38
|
## Triggers
|
|
31
39
|
|
|
@@ -1,16 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const customApiCall: import("frogbot").PieceActionDefinition<z.ZodObject<{
|
|
3
|
-
method: z.ZodEnum<{
|
|
4
|
-
GET: "GET";
|
|
5
|
-
POST: "POST";
|
|
6
|
-
PUT: "PUT";
|
|
7
|
-
PATCH: "PATCH";
|
|
8
|
-
DELETE: "DELETE";
|
|
9
|
-
}>;
|
|
10
|
-
path: z.ZodString;
|
|
11
|
-
query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
12
|
-
body: z.ZodOptional<z.ZodUnknown>;
|
|
13
|
-
}, z.core.$strip>, z.ZodUnknown, Record<string, never>, import("googleapis").gmail_v1.Gmail, unknown> & {
|
|
14
|
-
slug: "customApiCall";
|
|
15
|
-
};
|
|
1
|
+
export declare const customApiCall: import("frogbot/pieces").CustomApiCallAction<Record<string, never>, import("googleapis").gmail_v1.Gmail>;
|
|
16
2
|
//# sourceMappingURL=customApiCall.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customApiCall.d.ts","sourceRoot":"","sources":["../../src/actions/customApiCall.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"customApiCall.d.ts","sourceRoot":"","sources":["../../src/actions/customApiCall.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,0GAIxB,CAAC"}
|
|
@@ -1,39 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
'PUT',
|
|
8
|
-
'PATCH',
|
|
9
|
-
'DELETE'
|
|
10
|
-
]),
|
|
11
|
-
path: z.string().startsWith('/'),
|
|
12
|
-
query: z.record(z.string(), z.union([
|
|
13
|
-
z.string(),
|
|
14
|
-
z.number(),
|
|
15
|
-
z.boolean()
|
|
16
|
-
])).optional(),
|
|
17
|
-
body: z.unknown().optional()
|
|
18
|
-
});
|
|
19
|
-
export const customApiCall = defineAction({
|
|
20
|
-
slug: 'customApiCall',
|
|
21
|
-
description: 'Make an authenticated Gmail API call.',
|
|
22
|
-
input: inputSchema,
|
|
23
|
-
output: z.unknown(),
|
|
24
|
-
idempotent: false,
|
|
25
|
-
async run ({ client, input }) {
|
|
26
|
-
const request = client.context._options.auth;
|
|
27
|
-
if (!request || typeof request === 'string' || !('request' in request)) {
|
|
28
|
-
throw new Error('[frogbot] Gmail client is missing authenticated transport.');
|
|
29
|
-
}
|
|
30
|
-
return (await request.request({
|
|
31
|
-
method: input.method,
|
|
32
|
-
url: `https://gmail.googleapis.com/gmail/v1${input.path}`,
|
|
33
|
-
params: input.query,
|
|
34
|
-
data: input.body
|
|
35
|
-
})).data;
|
|
36
|
-
}
|
|
1
|
+
import { authorize } from '../client.js';
|
|
2
|
+
import { defineCustomApiCall } from '../define.js';
|
|
3
|
+
export const customApiCall = defineCustomApiCall({
|
|
4
|
+
name: 'Gmail',
|
|
5
|
+
baseUrl: 'https://gmail.googleapis.com/gmail/v1',
|
|
6
|
+
authorize: ({ client, url, headers })=>authorize(client, url, headers)
|
|
37
7
|
});
|
|
38
8
|
|
|
39
9
|
//# sourceMappingURL=customApiCall.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/actions/customApiCall.ts"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../src/actions/customApiCall.ts"],"names":["authorize","defineCustomApiCall","customApiCall","name","baseUrl","client","url","headers"],"mappings":"AAAA,SAASA,SAAS,QAAQ,eAAe;AACzC,SAASC,mBAAmB,QAAQ,eAAe;AAEnD,OAAO,MAAMC,gBAAgBD,oBAAoB;IAC/CE,MAAM;IACNC,SAAS;IACTJ,WAAW,CAAC,EAAEK,MAAM,EAAEC,GAAG,EAAEC,OAAO,EAAE,GAAKP,UAAUK,QAAQC,KAAKC;AAClE,GAAG","file":"customApiCall.js"}
|
package/dist/client.d.ts
CHANGED
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAU,MAAM,YAAY,CAAC;AAInD,MAAM,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;AAEnC,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,kBAU5D"}
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAU,MAAM,YAAY,CAAC;AAInD,MAAM,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;AAEnC,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,kBAU5D;AAED,wBAAsB,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,iBAOxE"}
|
package/dist/client.js
CHANGED
|
@@ -12,5 +12,12 @@ export function createGmailClient({ auth }) {
|
|
|
12
12
|
auth: oauth
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
+
export async function authorize(client, url, headers) {
|
|
16
|
+
const auth = client.context._options.auth;
|
|
17
|
+
if (!auth || typeof auth === 'string') {
|
|
18
|
+
throw new Error('[frogbot] Gmail client is missing authenticated transport.');
|
|
19
|
+
}
|
|
20
|
+
(await auth.getRequestHeaders(url)).forEach((value, key)=>headers.set(key, value));
|
|
21
|
+
}
|
|
15
22
|
|
|
16
23
|
//# sourceMappingURL=client.js.map
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/client.ts"],"names":["google","gmailAuth","createGmailClient","auth","credential","parse","oauth","OAuth2","setCredentials","access_token","accessToken","refresh_token","refreshToken","gmail","version"],"mappings":"AAAA,SAAwBA,MAAM,QAAQ,aAAa;AAEnD,SAASC,SAAS,QAAQ,cAAc;AAIxC,OAAO,SAASC,kBAAkB,EAAEC,IAAI,EAAqB;IAC3D,MAAMC,aAAaH,UAAUI,KAAK,CAACF;IACnC,MAAMG,QAAQ,IAAIN,OAAOG,IAAI,CAACI,MAAM;IAEpCD,MAAME,cAAc,CAAC;QACnBC,cAAcL,WAAWM,WAAW;QACpCC,eAAeP,WAAWQ,YAAY;IACxC;IAEA,OAAOZ,OAAOa,KAAK,CAAC;QAAEC,SAAS;QAAMX,MAAMG;IAAM;AACnD","file":"client.js"}
|
|
1
|
+
{"version":3,"sources":["../src/client.ts"],"names":["google","gmailAuth","createGmailClient","auth","credential","parse","oauth","OAuth2","setCredentials","access_token","accessToken","refresh_token","refreshToken","gmail","version","authorize","client","url","headers","context","_options","Error","getRequestHeaders","forEach","value","key","set"],"mappings":"AAAA,SAAwBA,MAAM,QAAQ,aAAa;AAEnD,SAASC,SAAS,QAAQ,cAAc;AAIxC,OAAO,SAASC,kBAAkB,EAAEC,IAAI,EAAqB;IAC3D,MAAMC,aAAaH,UAAUI,KAAK,CAACF;IACnC,MAAMG,QAAQ,IAAIN,OAAOG,IAAI,CAACI,MAAM;IAEpCD,MAAME,cAAc,CAAC;QACnBC,cAAcL,WAAWM,WAAW;QACpCC,eAAeP,WAAWQ,YAAY;IACxC;IAEA,OAAOZ,OAAOa,KAAK,CAAC;QAAEC,SAAS;QAAMX,MAAMG;IAAM;AACnD;AAEA,OAAO,eAAeS,UAAUC,MAAa,EAAEC,GAAQ,EAAEC,OAAgB;IACvE,MAAMf,OAAOa,OAAOG,OAAO,CAACC,QAAQ,CAACjB,IAAI;IACzC,IAAI,CAACA,QAAQ,OAAOA,SAAS,UAAU;QACrC,MAAM,IAAIkB,MAAM;IAClB;IAEC,CAAA,MAAMlB,KAAKmB,iBAAiB,CAACL,IAAG,EAAGM,OAAO,CAAC,CAACC,OAAOC,MAAQP,QAAQQ,GAAG,CAACD,KAAKD;AAC/E","file":"client.js"}
|
package/dist/config.d.ts
CHANGED
|
@@ -3,5 +3,16 @@ export declare const gmailAuth: z.ZodObject<{
|
|
|
3
3
|
accessToken: z.ZodString;
|
|
4
4
|
refreshToken: z.ZodOptional<z.ZodString>;
|
|
5
5
|
}, z.core.$strip>;
|
|
6
|
-
export declare const gmailScopes:
|
|
6
|
+
export declare const gmailScopes: {
|
|
7
|
+
readonly 'mail.google.com': "https://mail.google.com/";
|
|
8
|
+
readonly 'gmail.modify': "https://www.googleapis.com/auth/gmail.modify";
|
|
9
|
+
readonly 'gmail.readonly': "https://www.googleapis.com/auth/gmail.readonly";
|
|
10
|
+
readonly 'gmail.compose': "https://www.googleapis.com/auth/gmail.compose";
|
|
11
|
+
readonly 'gmail.send': "https://www.googleapis.com/auth/gmail.send";
|
|
12
|
+
readonly 'gmail.insert': "https://www.googleapis.com/auth/gmail.insert";
|
|
13
|
+
readonly 'gmail.labels': "https://www.googleapis.com/auth/gmail.labels";
|
|
14
|
+
readonly 'gmail.metadata': "https://www.googleapis.com/auth/gmail.metadata";
|
|
15
|
+
readonly 'gmail.settings.basic': "https://www.googleapis.com/auth/gmail.settings.basic";
|
|
16
|
+
readonly 'gmail.settings.sharing': "https://www.googleapis.com/auth/gmail.settings.sharing";
|
|
17
|
+
};
|
|
7
18
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,SAAS;;;iBAGpB,CAAC;AACH,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,SAAS;;;iBAGpB,CAAC;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;CAWd,CAAC"}
|
package/dist/config.js
CHANGED
|
@@ -9,10 +9,17 @@ export const gmailAuth = z.object({
|
|
|
9
9
|
secret: true
|
|
10
10
|
})
|
|
11
11
|
});
|
|
12
|
-
export const gmailScopes =
|
|
13
|
-
'https://
|
|
14
|
-
'https://www.googleapis.com/auth/gmail.
|
|
15
|
-
'https://www.googleapis.com/auth/gmail.
|
|
16
|
-
|
|
12
|
+
export const gmailScopes = {
|
|
13
|
+
'mail.google.com': 'https://mail.google.com/',
|
|
14
|
+
'gmail.modify': 'https://www.googleapis.com/auth/gmail.modify',
|
|
15
|
+
'gmail.readonly': 'https://www.googleapis.com/auth/gmail.readonly',
|
|
16
|
+
'gmail.compose': 'https://www.googleapis.com/auth/gmail.compose',
|
|
17
|
+
'gmail.send': 'https://www.googleapis.com/auth/gmail.send',
|
|
18
|
+
'gmail.insert': 'https://www.googleapis.com/auth/gmail.insert',
|
|
19
|
+
'gmail.labels': 'https://www.googleapis.com/auth/gmail.labels',
|
|
20
|
+
'gmail.metadata': 'https://www.googleapis.com/auth/gmail.metadata',
|
|
21
|
+
'gmail.settings.basic': 'https://www.googleapis.com/auth/gmail.settings.basic',
|
|
22
|
+
'gmail.settings.sharing': 'https://www.googleapis.com/auth/gmail.settings.sharing'
|
|
23
|
+
};
|
|
17
24
|
|
|
18
25
|
//# sourceMappingURL=config.js.map
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/config.ts"],"names":["z","gmailAuth","object","accessToken","string","min","meta","label","secret","refreshToken","optional","gmailScopes"],"mappings":"AAAA,SAASA,CAAC,QAAQ,MAAM;AAExB,OAAO,MAAMC,YAAYD,EAAEE,MAAM,CAAC;IAChCC,aAAaH,EAAEI,MAAM,GAAGC,GAAG,CAAC,GAAGC,IAAI,CAAC;QAAEC,OAAO;QAAgBC,QAAQ;IAAK;IAC1EC,cAAcT,EAAEI,MAAM,GAAGM,QAAQ,GAAGJ,IAAI,CAAC;QAAEC,OAAO;QAAiBC,QAAQ;IAAK;AAClF,GAAG;AACH,OAAO,MAAMG,cAAc;IACzB;
|
|
1
|
+
{"version":3,"sources":["../src/config.ts"],"names":["z","gmailAuth","object","accessToken","string","min","meta","label","secret","refreshToken","optional","gmailScopes"],"mappings":"AAAA,SAASA,CAAC,QAAQ,MAAM;AAExB,OAAO,MAAMC,YAAYD,EAAEE,MAAM,CAAC;IAChCC,aAAaH,EAAEI,MAAM,GAAGC,GAAG,CAAC,GAAGC,IAAI,CAAC;QAAEC,OAAO;QAAgBC,QAAQ;IAAK;IAC1EC,cAAcT,EAAEI,MAAM,GAAGM,QAAQ,GAAGJ,IAAI,CAAC;QAAEC,OAAO;QAAiBC,QAAQ;IAAK;AAClF,GAAG;AACH,OAAO,MAAMG,cAAc;IACzB,mBAAmB;IACnB,gBAAgB;IAChB,kBAAkB;IAClB,iBAAiB;IACjB,cAAc;IACd,gBAAgB;IAChB,gBAAgB;IAChB,kBAAkB;IAClB,wBAAwB;IACxB,0BAA0B;AAC5B,EAAW","file":"config.js"}
|
package/dist/define.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export declare const defineAction: <const TSlug extends string, TInput extends i
|
|
|
2
2
|
slug: TSlug;
|
|
3
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
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 ? {
|
|
5
|
+
}, defineCustomApiCall: (config: import("frogbot/pieces").CustomApiCallConfig<import("googleapis").gmail_v1.Gmail>) => import("frogbot/pieces").CustomApiCallAction<Record<string, never>, import("googleapis").gmail_v1.Gmail>, definePollingTrigger: <const TSlug extends string, TInput extends import("zod").ZodType, TOutput extends import("zod").ZodType | undefined = undefined>(trigger: TOutput extends unknown ? {
|
|
6
6
|
slug: string;
|
|
7
7
|
label?: string;
|
|
8
8
|
description: string;
|
package/dist/define.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../src/define.ts"],"names":[],"mappings":"AAIA,eAAO,MAAQ,YAAY;;;;GAAE,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../src/define.ts"],"names":[],"mappings":"AAIA,eAAO,MAAQ,YAAY;;;;GAAE,mBAAmB,2MAAE,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACzC,CAAC"}
|
package/dist/define.js
CHANGED
package/dist/define.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/define.ts"],"names":["createPieceHelpers","defineAction","definePollingTrigger"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,iBAAiB;AAIpD,OAAO,MAAM,EAAEC,YAAY,EAAEC,oBAAoB,EAAE,
|
|
1
|
+
{"version":3,"sources":["../src/define.ts"],"names":["createPieceHelpers","defineAction","defineCustomApiCall","definePollingTrigger"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,iBAAiB;AAIpD,OAAO,MAAM,EAAEC,YAAY,EAAEC,mBAAmB,EAAEC,oBAAoB,EAAE,GACtEH,qBAA4B","file":"define.js"}
|
package/dist/index.d.ts
CHANGED
|
@@ -16,7 +16,25 @@ export declare const createGmail: import("frogbot").PieceFactory<{
|
|
|
16
16
|
}, import("zod/v4/core").$strip>;
|
|
17
17
|
readonly client: typeof createGmailClient;
|
|
18
18
|
readonly oauth: {
|
|
19
|
-
readonly scopes:
|
|
19
|
+
readonly scopes: {
|
|
20
|
+
readonly catalog: {
|
|
21
|
+
readonly 'mail.google.com': "https://mail.google.com/";
|
|
22
|
+
readonly 'gmail.modify': "https://www.googleapis.com/auth/gmail.modify";
|
|
23
|
+
readonly 'gmail.readonly': "https://www.googleapis.com/auth/gmail.readonly";
|
|
24
|
+
readonly 'gmail.compose': "https://www.googleapis.com/auth/gmail.compose";
|
|
25
|
+
readonly 'gmail.send': "https://www.googleapis.com/auth/gmail.send";
|
|
26
|
+
readonly 'gmail.insert': "https://www.googleapis.com/auth/gmail.insert";
|
|
27
|
+
readonly 'gmail.labels': "https://www.googleapis.com/auth/gmail.labels";
|
|
28
|
+
readonly 'gmail.metadata': "https://www.googleapis.com/auth/gmail.metadata";
|
|
29
|
+
readonly 'gmail.settings.basic': "https://www.googleapis.com/auth/gmail.settings.basic";
|
|
30
|
+
readonly 'gmail.settings.sharing': "https://www.googleapis.com/auth/gmail.settings.sharing";
|
|
31
|
+
readonly openid: "openid";
|
|
32
|
+
readonly 'userinfo.email': "https://www.googleapis.com/auth/userinfo.email";
|
|
33
|
+
readonly 'userinfo.profile': "https://www.googleapis.com/auth/userinfo.profile";
|
|
34
|
+
};
|
|
35
|
+
readonly defaults: readonly ["gmail.send", "gmail.readonly", "gmail.compose"];
|
|
36
|
+
readonly required: ("openid" | "userinfo.email" | "userinfo.profile")[];
|
|
37
|
+
};
|
|
20
38
|
readonly toAuth: ({ tokens }: {
|
|
21
39
|
tokens: import("frogbot").OAuthTokens;
|
|
22
40
|
}) => {
|
|
@@ -167,20 +185,7 @@ export declare const createGmail: import("frogbot").PieceFactory<{
|
|
|
167
185
|
payload?: unknown;
|
|
168
186
|
}[]> & {
|
|
169
187
|
slug: "searchEmails";
|
|
170
|
-
}, import("frogbot").
|
|
171
|
-
method: import("zod").ZodEnum<{
|
|
172
|
-
GET: "GET";
|
|
173
|
-
POST: "POST";
|
|
174
|
-
PUT: "PUT";
|
|
175
|
-
PATCH: "PATCH";
|
|
176
|
-
DELETE: "DELETE";
|
|
177
|
-
}>;
|
|
178
|
-
path: import("zod").ZodString;
|
|
179
|
-
query: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber, import("zod").ZodBoolean]>>>;
|
|
180
|
-
body: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
181
|
-
}, import("zod/v4/core").$strip>, import("zod").ZodUnknown, Record<string, never>, import("googleapis").gmail_v1.Gmail, unknown> & {
|
|
182
|
-
slug: "customApiCall";
|
|
183
|
-
}];
|
|
188
|
+
}, import("frogbot/pieces").CustomApiCallAction<Record<string, never>, import("googleapis").gmail_v1.Gmail>];
|
|
184
189
|
readonly triggers: readonly [{
|
|
185
190
|
slug: string;
|
|
186
191
|
label?: string;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAa,WAAW,EAAE,MAAM,aAAa,CAAC;AAGrD,eAAO,MAAM,YAAY,oGAOf,CAAC;AACX,eAAO,MAAM,aAAa,uBAAwB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAa,WAAW,EAAE,MAAM,aAAa,CAAC;AAGrD,eAAO,MAAM,YAAY,oGAOf,CAAC;AACX,eAAO,MAAM,aAAa,uBAAwB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAEV,SACF;;wBAA4D,SAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBtF,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { googleOAuth } from '@frogbotai/piece-google';
|
|
1
|
+
import { googleOAuth, googleScopes } from '@frogbotai/piece-google';
|
|
2
2
|
import { definePiece } from 'frogbot/pieces';
|
|
3
3
|
import { customApiCall } from './actions/customApiCall.js';
|
|
4
4
|
import { getEmail } from './actions/getEmail.js';
|
|
@@ -31,10 +31,18 @@ export const createGmail = definePiece({
|
|
|
31
31
|
client: createGmailClient,
|
|
32
32
|
oauth: {
|
|
33
33
|
...googleOAuth,
|
|
34
|
-
scopes:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
scopes: {
|
|
35
|
+
catalog: {
|
|
36
|
+
...googleScopes,
|
|
37
|
+
...gmailScopes
|
|
38
|
+
},
|
|
39
|
+
defaults: [
|
|
40
|
+
'gmail.send',
|
|
41
|
+
'gmail.readonly',
|
|
42
|
+
'gmail.compose'
|
|
43
|
+
],
|
|
44
|
+
required: googleOAuth.scopes.required
|
|
45
|
+
},
|
|
38
46
|
toAuth: ({ tokens })=>({
|
|
39
47
|
accessToken: tokens.access_token ?? '',
|
|
40
48
|
refreshToken: tokens.refresh_token
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":["googleOAuth","definePiece","customApiCall","getEmail","createDraftReply","replyToEmail","searchEmails","send","createGmailClient","gmailAuth","gmailScopes","newEmail","gmailActions","gmailTriggers","createGmail","slug","label","admin","description","group","auth","client","oauth","scopes","toAuth","tokens","accessToken","access_token","refreshToken","refresh_token","actions","triggers"],"mappings":"AAAA,SAASA,WAAW,QAAQ,0BAA0B;
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":["googleOAuth","googleScopes","definePiece","customApiCall","getEmail","createDraftReply","replyToEmail","searchEmails","send","createGmailClient","gmailAuth","gmailScopes","newEmail","gmailActions","gmailTriggers","createGmail","slug","label","admin","description","group","auth","client","oauth","scopes","catalog","defaults","required","toAuth","tokens","accessToken","access_token","refreshToken","refresh_token","actions","triggers"],"mappings":"AAAA,SAASA,WAAW,EAAEC,YAAY,QAAQ,0BAA0B;AACpE,SAASC,WAAW,QAAQ,iBAAiB;AAE7C,SAASC,aAAa,QAAQ,6BAA6B;AAC3D,SAASC,QAAQ,QAAQ,wBAAwB;AACjD,SAASC,gBAAgB,EAAEC,YAAY,QAAQ,4BAA4B;AAC3E,SAASC,YAAY,QAAQ,4BAA4B;AACzD,SAASC,IAAI,QAAQ,oBAAoB;AACzC,SAASC,iBAAiB,QAAQ,cAAc;AAChD,SAASC,SAAS,EAAEC,WAAW,QAAQ,cAAc;AACrD,SAASC,QAAQ,QAAQ,yBAAyB;AAElD,OAAO,MAAMC,eAAe;IAC1B;IACA;IACA;IACA;IACA;IACA;CACD,CAAU;AACX,OAAO,MAAMC,gBAAgB;IAAC;CAAW,CAAU;AACnD,SAASH,WAAW,GAAG;AAEvB,OAAO,MAAMI,cAAcb,YAAY;IACrCc,MAAM;IACNC,OAAO;IACPC,OAAO;QAAEC,aAAa;QAAgDC,OAAO;IAAgB;IAC7FC,MAAMX;IACNY,QAAQb;IACRc,OAAO;QACL,GAAGvB,WAAW;QACdwB,QAAQ;YACNC,SAAS;gBAAE,GAAGxB,YAAY;gBAAE,GAAGU,WAAW;YAAC;YAC3Ce,UAAU;gBAAC;gBAAc;gBAAkB;aAAgB;YAC3DC,UAAU3B,YAAYwB,MAAM,CAACG,QAAQ;QACvC;QACAC,QAAQ,CAAC,EAAEC,MAAM,EAAE,GAAM,CAAA;gBACvBC,aAAaD,OAAOE,YAAY,IAAI;gBACpCC,cAAcH,OAAOI,aAAa;YACpC,CAAA;IACF;IACAC,SAAS;QAAC1B;QAAMF;QAAcD;QAAkBD;QAAUG;QAAcJ;KAAc;IACtFgC,UAAU;QAACvB;KAAS;AACtB,GAAG","file":"index.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frogbotai/piece-gmail",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.33.0",
|
|
4
4
|
"description": "Gmail tools for FrogBot.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Colby Gilbert",
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"googleapis": "^180.0.0",
|
|
28
28
|
"zod": "^4.3.6",
|
|
29
|
-
"@frogbotai/piece-google": "0.
|
|
29
|
+
"@frogbotai/piece-google": "0.33.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"frogbot": "0.
|
|
32
|
+
"frogbot": "0.33.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"typescript": "5.6.2",
|
|
36
|
-
"frogbot": "0.
|
|
36
|
+
"frogbot": "0.33.0"
|
|
37
37
|
},
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|