@frogbotai/piece-google-calendar 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 +26 -0
- package/dist/actions/customApiCall.d.ts +1 -53
- package/dist/actions/customApiCall.d.ts.map +1 -1
- package/dist/actions/customApiCall.js +6 -186
- package/dist/actions/customApiCall.js.map +1 -1
- package/dist/actions/events.d.ts +5 -5
- 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 +19 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +19 -4
- 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 +32 -58
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -5
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# `@frogbotai/piece-google-calendar`
|
|
2
|
+
|
|
3
|
+
Create, find, and update Google Calendar events.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { createGoogle } from '@frogbotai/piece-google';
|
|
9
|
+
import { createGoogleCalendar } from '@frogbotai/piece-google-calendar';
|
|
10
|
+
|
|
11
|
+
export const google = createGoogle({
|
|
12
|
+
oauth: {
|
|
13
|
+
clientId: process.env.GOOGLE_CLIENT_ID!,
|
|
14
|
+
clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
export const googleCalendar = createGoogleCalendar({ oauth: google.oauth });
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## OAuth scopes
|
|
21
|
+
|
|
22
|
+
Change the requested scopes with the factory's `scopes` option: `createGoogleCalendar({ oauth, scopes: ({ defaultScopes }) => [...defaultScopes, 'calendar.events.readonly'] })` adds one, and an array replaces the defaults. `googleCalendarScopes` maps each name to the provider's scope string. Names stand for `https://www.googleapis.com/auth/<name>`, except `openid`.
|
|
23
|
+
|
|
24
|
+
- Always requested: `openid`, `userinfo.email`, `userinfo.profile`.
|
|
25
|
+
- Defaults: `calendar.events`, `calendar.readonly`.
|
|
26
|
+
- Also available: `calendar`, `calendar.events.readonly`, `calendar.events.owned`, `calendar.events.owned.readonly`, `calendar.events.freebusy`, `calendar.events.public.readonly`, `calendar.calendarlist`, `calendar.calendarlist.readonly`, `calendar.calendars`, `calendar.calendars.readonly`, `calendar.acls`, `calendar.acls.readonly`, `calendar.freebusy`, `calendar.settings.readonly`, `calendar.app.created`.
|
|
@@ -1,54 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const customApiCall: import("frogbot").PieceActionDefinition<z.ZodObject<{
|
|
3
|
-
method: z.ZodEnum<{
|
|
4
|
-
GET: "GET";
|
|
5
|
-
POST: "POST";
|
|
6
|
-
PATCH: "PATCH";
|
|
7
|
-
PUT: "PUT";
|
|
8
|
-
DELETE: "DELETE";
|
|
9
|
-
HEAD: "HEAD";
|
|
10
|
-
OPTIONS: "OPTIONS";
|
|
11
|
-
}>;
|
|
12
|
-
path: z.ZodString;
|
|
13
|
-
headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
14
|
-
query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>>>;
|
|
15
|
-
bodyType: z.ZodDefault<z.ZodEnum<{
|
|
16
|
-
formData: "formData";
|
|
17
|
-
json: "json";
|
|
18
|
-
none: "none";
|
|
19
|
-
raw: "raw";
|
|
20
|
-
}>>;
|
|
21
|
-
body: z.ZodOptional<z.ZodJSONSchema>;
|
|
22
|
-
formData: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
23
|
-
name: z.ZodString;
|
|
24
|
-
type: z.ZodLiteral<"text">;
|
|
25
|
-
value: z.ZodString;
|
|
26
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
27
|
-
name: z.ZodString;
|
|
28
|
-
type: z.ZodLiteral<"file">;
|
|
29
|
-
filename: z.ZodString;
|
|
30
|
-
contentType: z.ZodDefault<z.ZodString>;
|
|
31
|
-
base64: z.ZodBase64;
|
|
32
|
-
}, z.core.$strip>], "type">>>;
|
|
33
|
-
responseIsBinary: z.ZodDefault<z.ZodBoolean>;
|
|
34
|
-
failsafe: z.ZodDefault<z.ZodBoolean>;
|
|
35
|
-
timeout: z.ZodOptional<z.ZodNumber>;
|
|
36
|
-
followRedirects: z.ZodDefault<z.ZodLiteral<false>>;
|
|
37
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
38
|
-
status: z.ZodNumber;
|
|
39
|
-
headers: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
40
|
-
body: z.ZodUnion<readonly [z.ZodJSONSchema, z.ZodObject<{
|
|
41
|
-
base64: z.ZodString;
|
|
42
|
-
contentType: z.ZodString;
|
|
43
|
-
}, z.core.$strip>]>;
|
|
44
|
-
}, z.core.$strip>, Record<string, never>, import("googleapis").calendar_v3.Calendar, {
|
|
45
|
-
status: number;
|
|
46
|
-
headers: Record<string, string>;
|
|
47
|
-
body: z.core.util.JSONType | {
|
|
48
|
-
base64: string;
|
|
49
|
-
contentType: string;
|
|
50
|
-
};
|
|
51
|
-
}> & {
|
|
52
|
-
slug: "customApiCall";
|
|
53
|
-
};
|
|
1
|
+
export declare const customApiCall: import("frogbot/pieces").CustomApiCallAction<Record<string, never>, import("googleapis").calendar_v3.Calendar>;
|
|
54
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,gHAIxB,CAAC"}
|
|
@@ -1,189 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
z.number(),
|
|
8
|
-
z.boolean()
|
|
9
|
-
]);
|
|
10
|
-
const formField = z.discriminatedUnion('type', [
|
|
11
|
-
z.object({
|
|
12
|
-
name: z.string().min(1),
|
|
13
|
-
type: z.literal('text'),
|
|
14
|
-
value: z.string()
|
|
15
|
-
}),
|
|
16
|
-
z.object({
|
|
17
|
-
name: z.string().min(1),
|
|
18
|
-
type: z.literal('file'),
|
|
19
|
-
filename: z.string().min(1),
|
|
20
|
-
contentType: z.string().min(1).default('application/octet-stream'),
|
|
21
|
-
base64: z.base64()
|
|
22
|
-
})
|
|
23
|
-
]);
|
|
24
|
-
function providerUrl(path) {
|
|
25
|
-
if (/[\s\\\p{Cc}]/u.test(path) || path.startsWith('//')) {
|
|
26
|
-
throw new Error('URL must target the Google Calendar v3 API.');
|
|
27
|
-
}
|
|
28
|
-
const url = new URL(path.startsWith('/') ? `${baseUrl}${path}` : path);
|
|
29
|
-
if (url.origin !== 'https://www.googleapis.com' || url.username || url.password || url.hash || url.pathname !== '/calendar/v3' && !url.pathname.startsWith('/calendar/v3/')) {
|
|
30
|
-
throw new Error('URL must target the Google Calendar v3 API.');
|
|
31
|
-
}
|
|
32
|
-
let decoded = url.pathname;
|
|
33
|
-
for(let index = 0; index < 3; index++){
|
|
34
|
-
decoded = decodeURIComponent(decoded);
|
|
35
|
-
if (decoded.split('/').some((part)=>part === '.' || part === '..') || /[\\\p{Cc}]/u.test(decoded)) {
|
|
36
|
-
throw new Error('URL must target the Google Calendar v3 API.');
|
|
37
|
-
}
|
|
38
|
-
if (!/%[\da-f]{2}/i.test(decoded)) break;
|
|
39
|
-
}
|
|
40
|
-
return url.toString();
|
|
41
|
-
}
|
|
42
|
-
const inputSchema = z.object({
|
|
43
|
-
method: z.enum([
|
|
44
|
-
'GET',
|
|
45
|
-
'POST',
|
|
46
|
-
'PATCH',
|
|
47
|
-
'PUT',
|
|
48
|
-
'DELETE',
|
|
49
|
-
'HEAD',
|
|
50
|
-
'OPTIONS'
|
|
51
|
-
]),
|
|
52
|
-
path: z.string().min(1).refine((path)=>{
|
|
53
|
-
try {
|
|
54
|
-
providerUrl(path);
|
|
55
|
-
return true;
|
|
56
|
-
} catch {
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
}, 'URL must target the Google Calendar v3 API.'),
|
|
60
|
-
headers: z.record(z.string(), z.string()).default({}).refine((headers)=>Object.keys(headers).every((name)=>![
|
|
61
|
-
'authorization',
|
|
62
|
-
'proxy-authorization',
|
|
63
|
-
'host',
|
|
64
|
-
'cookie',
|
|
65
|
-
'content-length',
|
|
66
|
-
'transfer-encoding'
|
|
67
|
-
].includes(name.toLowerCase())), 'Authentication and transport headers cannot be overridden.'),
|
|
68
|
-
query: z.record(z.string(), z.union([
|
|
69
|
-
scalar,
|
|
70
|
-
z.array(scalar)
|
|
71
|
-
])).optional(),
|
|
72
|
-
bodyType: z.enum([
|
|
73
|
-
'none',
|
|
74
|
-
'json',
|
|
75
|
-
'raw',
|
|
76
|
-
'formData'
|
|
77
|
-
]).default('json'),
|
|
78
|
-
body: z.json().optional(),
|
|
79
|
-
formData: z.array(formField).optional(),
|
|
80
|
-
responseIsBinary: z.boolean().default(false),
|
|
81
|
-
failsafe: z.boolean().default(false),
|
|
82
|
-
timeout: z.number().positive().optional().describe('Request timeout in seconds.'),
|
|
83
|
-
followRedirects: z.literal(false).default(false)
|
|
84
|
-
}).superRefine((input, context)=>{
|
|
85
|
-
if (input.bodyType === 'raw' && typeof input.body !== 'string') {
|
|
86
|
-
context.addIssue({
|
|
87
|
-
code: 'custom',
|
|
88
|
-
path: [
|
|
89
|
-
'body'
|
|
90
|
-
],
|
|
91
|
-
message: 'Raw body must be a string.'
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
if (input.bodyType === 'formData' && !input.formData) {
|
|
95
|
-
context.addIssue({
|
|
96
|
-
code: 'custom',
|
|
97
|
-
path: [
|
|
98
|
-
'formData'
|
|
99
|
-
],
|
|
100
|
-
message: 'Form data fields are required.'
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
if ([
|
|
104
|
-
'GET',
|
|
105
|
-
'HEAD'
|
|
106
|
-
].includes(input.method) && (input.body !== undefined || input.formData !== undefined)) {
|
|
107
|
-
context.addIssue({
|
|
108
|
-
code: 'custom',
|
|
109
|
-
path: [
|
|
110
|
-
'body'
|
|
111
|
-
],
|
|
112
|
-
message: 'GET and HEAD requests cannot have a body.'
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
const output = z.object({
|
|
117
|
-
status: z.number().int(),
|
|
118
|
-
headers: z.record(z.string(), z.string()),
|
|
119
|
-
body: z.union([
|
|
120
|
-
z.json(),
|
|
121
|
-
z.object({
|
|
122
|
-
base64: z.string(),
|
|
123
|
-
contentType: z.string()
|
|
124
|
-
})
|
|
125
|
-
])
|
|
126
|
-
});
|
|
127
|
-
export const customApiCall = defineAction({
|
|
128
|
-
slug: 'customApiCall',
|
|
129
|
-
description: 'Call the authenticated Google Calendar v3 API. Supports JSON, raw text, multipart text and base64 files, and base64 binary responses. Redirects are rejected.',
|
|
130
|
-
input: inputSchema,
|
|
131
|
-
output,
|
|
132
|
-
idempotent: false,
|
|
133
|
-
async run ({ client, input, req }) {
|
|
134
|
-
const transport = client.context._options.auth;
|
|
135
|
-
if (!transport || typeof transport === 'string' || !('request' in transport)) {
|
|
136
|
-
throw new Error('Google Calendar client is missing authenticated transport.');
|
|
137
|
-
}
|
|
138
|
-
const headers = new Headers(input.headers);
|
|
139
|
-
let data = input.bodyType === 'none' ? undefined : input.body;
|
|
140
|
-
if (input.bodyType === 'json' && data !== undefined) {
|
|
141
|
-
data = JSON.stringify(data);
|
|
142
|
-
if (!headers.has('content-type')) headers.set('content-type', 'application/json');
|
|
143
|
-
}
|
|
144
|
-
if (input.bodyType === 'raw' && !headers.has('content-type')) {
|
|
145
|
-
headers.set('content-type', 'text/plain');
|
|
146
|
-
}
|
|
147
|
-
if (input.bodyType === 'formData') {
|
|
148
|
-
const form = new FormData();
|
|
149
|
-
for (const field of input.formData ?? []){
|
|
150
|
-
if (field.type === 'text') form.append(field.name, field.value);
|
|
151
|
-
else {
|
|
152
|
-
form.append(field.name, new Blob([
|
|
153
|
-
Buffer.from(field.base64, 'base64')
|
|
154
|
-
], {
|
|
155
|
-
type: field.contentType
|
|
156
|
-
}), field.filename);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
headers.delete('content-type');
|
|
160
|
-
data = form;
|
|
161
|
-
}
|
|
162
|
-
const response = await transport.request({
|
|
163
|
-
...requestOptions(req),
|
|
164
|
-
url: providerUrl(input.path),
|
|
165
|
-
method: input.method,
|
|
166
|
-
headers,
|
|
167
|
-
params: input.query,
|
|
168
|
-
data,
|
|
169
|
-
timeout: input.timeout === undefined ? undefined : input.timeout * 1000,
|
|
170
|
-
responseType: input.responseIsBinary ? 'arraybuffer' : 'json',
|
|
171
|
-
redirect: 'manual',
|
|
172
|
-
maxRedirects: 0,
|
|
173
|
-
validateStatus: (status)=>status >= 200 && status < 300 || input.failsafe
|
|
174
|
-
});
|
|
175
|
-
if (response.status >= 300 && response.status < 400) {
|
|
176
|
-
throw new Error('Google Calendar API redirects are not allowed.');
|
|
177
|
-
}
|
|
178
|
-
return {
|
|
179
|
-
status: response.status,
|
|
180
|
-
headers: Object.fromEntries(response.headers.entries()),
|
|
181
|
-
body: input.responseIsBinary ? {
|
|
182
|
-
base64: Buffer.from(response.data).toString('base64'),
|
|
183
|
-
contentType: response.headers.get('content-type') ?? 'application/octet-stream'
|
|
184
|
-
} : response.data ?? null
|
|
185
|
-
};
|
|
186
|
-
}
|
|
1
|
+
import { authorize } from '../client.js';
|
|
2
|
+
import { defineCustomApiCall } from '../define.js';
|
|
3
|
+
export const customApiCall = defineCustomApiCall({
|
|
4
|
+
name: 'Google Calendar',
|
|
5
|
+
baseUrl: 'https://www.googleapis.com/calendar/v3',
|
|
6
|
+
authorize: ({ client, url, headers })=>authorize(client, url, headers)
|
|
187
7
|
});
|
|
188
8
|
|
|
189
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/actions/events.d.ts
CHANGED
|
@@ -11,9 +11,9 @@ export declare const createEvent: import("frogbot").PieceActionDefinition<z.ZodO
|
|
|
11
11
|
title: z.ZodString;
|
|
12
12
|
startDateTime: z.ZodISODateTime;
|
|
13
13
|
sendUpdates: z.ZodDefault<z.ZodEnum<{
|
|
14
|
-
none: "none";
|
|
15
14
|
all: "all";
|
|
16
15
|
externalOnly: "externalOnly";
|
|
16
|
+
none: "none";
|
|
17
17
|
}>>;
|
|
18
18
|
guestsCanModify: z.ZodDefault<z.ZodBoolean>;
|
|
19
19
|
guestsCanInviteOthers: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -139,9 +139,9 @@ export declare const updateEvent: import("frogbot").PieceActionDefinition<z.ZodO
|
|
|
139
139
|
guestsCanInviteOthers: z.ZodOptional<z.ZodBoolean>;
|
|
140
140
|
guestsCanSeeOtherGuests: z.ZodOptional<z.ZodBoolean>;
|
|
141
141
|
sendUpdates: z.ZodOptional<z.ZodEnum<{
|
|
142
|
-
none: "none";
|
|
143
142
|
all: "all";
|
|
144
143
|
externalOnly: "externalOnly";
|
|
144
|
+
none: "none";
|
|
145
145
|
}>>;
|
|
146
146
|
createMeetLink: z.ZodOptional<z.ZodBoolean>;
|
|
147
147
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -256,9 +256,9 @@ export declare const addAttendees: import("frogbot").PieceActionDefinition<z.Zod
|
|
|
256
256
|
eventId: z.ZodString;
|
|
257
257
|
attendees: z.ZodArray<z.ZodEmail>;
|
|
258
258
|
sendUpdates: z.ZodOptional<z.ZodEnum<{
|
|
259
|
-
none: "none";
|
|
260
259
|
all: "all";
|
|
261
260
|
externalOnly: "externalOnly";
|
|
261
|
+
none: "none";
|
|
262
262
|
}>>;
|
|
263
263
|
}, z.core.$strip>, z.ZodObject<{
|
|
264
264
|
id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -371,9 +371,9 @@ export declare const createQuickEvent: import("frogbot").PieceActionDefinition<z
|
|
|
371
371
|
calendarId: z.ZodString;
|
|
372
372
|
text: z.ZodString;
|
|
373
373
|
sendUpdates: z.ZodDefault<z.ZodEnum<{
|
|
374
|
-
none: "none";
|
|
375
374
|
all: "all";
|
|
376
375
|
externalOnly: "externalOnly";
|
|
376
|
+
none: "none";
|
|
377
377
|
}>>;
|
|
378
378
|
}, z.core.$strip>, z.ZodObject<{
|
|
379
379
|
id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -486,9 +486,9 @@ export declare const deleteEvent: import("frogbot").PieceActionDefinition<z.ZodO
|
|
|
486
486
|
calendarId: z.ZodString;
|
|
487
487
|
eventId: z.ZodString;
|
|
488
488
|
sendUpdates: z.ZodOptional<z.ZodEnum<{
|
|
489
|
-
none: "none";
|
|
490
489
|
all: "all";
|
|
491
490
|
externalOnly: "externalOnly";
|
|
491
|
+
none: "none";
|
|
492
492
|
}>>;
|
|
493
493
|
}, z.core.$strip>, z.ZodObject<{
|
|
494
494
|
deleted: z.ZodLiteral<true>;
|
package/dist/client.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export type GoogleCalendar = calendar_v3.Calendar;
|
|
|
4
4
|
export declare function createGoogleCalendarClient({ auth }: {
|
|
5
5
|
auth: unknown;
|
|
6
6
|
}): calendar_v3.Calendar;
|
|
7
|
+
export declare function authorize(client: GoogleCalendar, url: URL, headers: Headers): Promise<void>;
|
|
7
8
|
export declare function requestOptions(req: FrogBotRequest): {
|
|
8
9
|
signal: AbortSignal | undefined;
|
|
9
10
|
retry: boolean;
|
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,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,KAAK,WAAW,EAAU,MAAM,YAAY,CAAC;AAItD,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,QAAQ,CAAC;AAElD,wBAAgB,0BAA0B,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,wBAUrE;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,cAAc;;;EAIjD"}
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,KAAK,WAAW,EAAU,MAAM,YAAY,CAAC;AAItD,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,QAAQ,CAAC;AAElD,wBAAgB,0BAA0B,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,wBAUrE;AAED,wBAAsB,SAAS,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,iBAOjF;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,cAAc;;;EAIjD"}
|
package/dist/client.js
CHANGED
|
@@ -12,6 +12,13 @@ export function createGoogleCalendarClient({ 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] Google Calendar client is missing authenticated transport.');
|
|
19
|
+
}
|
|
20
|
+
(await auth.getRequestHeaders(url)).forEach((value, key)=>headers.set(key, value));
|
|
21
|
+
}
|
|
15
22
|
export function requestOptions(req) {
|
|
16
23
|
req.signal?.throwIfAborted();
|
|
17
24
|
return {
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/client.ts"],"names":["google","googleCalendarAuth","createGoogleCalendarClient","auth","credential","parse","oauth","OAuth2","setCredentials","access_token","accessToken","refresh_token","refreshToken","calendar","version","requestOptions","req","signal","throwIfAborted","undefined","retry"],"mappings":"AACA,SAA2BA,MAAM,QAAQ,aAAa;AAEtD,SAASC,kBAAkB,QAAQ,cAAc;AAIjD,OAAO,SAASC,2BAA2B,EAAEC,IAAI,EAAqB;IACpE,MAAMC,aAAaH,mBAAmBI,KAAK,CAACF;IAC5C,MAAMG,QAAQ,IAAIN,OAAOG,IAAI,CAACI,MAAM;IAEpCD,MAAME,cAAc,CAAC;QACnBC,cAAcL,WAAWM,WAAW;QACpCC,eAAeP,WAAWQ,YAAY;IACxC;IAEA,OAAOZ,OAAOa,QAAQ,CAAC;QAAEC,SAAS;QAAMX,MAAMG;IAAM;AACtD;AAEA,OAAO,
|
|
1
|
+
{"version":3,"sources":["../src/client.ts"],"names":["google","googleCalendarAuth","createGoogleCalendarClient","auth","credential","parse","oauth","OAuth2","setCredentials","access_token","accessToken","refresh_token","refreshToken","calendar","version","authorize","client","url","headers","context","_options","Error","getRequestHeaders","forEach","value","key","set","requestOptions","req","signal","throwIfAborted","undefined","retry"],"mappings":"AACA,SAA2BA,MAAM,QAAQ,aAAa;AAEtD,SAASC,kBAAkB,QAAQ,cAAc;AAIjD,OAAO,SAASC,2BAA2B,EAAEC,IAAI,EAAqB;IACpE,MAAMC,aAAaH,mBAAmBI,KAAK,CAACF;IAC5C,MAAMG,QAAQ,IAAIN,OAAOG,IAAI,CAACI,MAAM;IAEpCD,MAAME,cAAc,CAAC;QACnBC,cAAcL,WAAWM,WAAW;QACpCC,eAAeP,WAAWQ,YAAY;IACxC;IAEA,OAAOZ,OAAOa,QAAQ,CAAC;QAAEC,SAAS;QAAMX,MAAMG;IAAM;AACtD;AAEA,OAAO,eAAeS,UAAUC,MAAsB,EAAEC,GAAQ,EAAEC,OAAgB;IAChF,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;AAEA,OAAO,SAASG,eAAeC,GAAmB;IAChDA,IAAIC,MAAM,EAAEC;IAEZ,OAAO;QAAED,QAAQD,IAAIC,MAAM,IAAIE;QAAWC,OAAO;IAAM;AACzD","file":"client.js"}
|
package/dist/config.d.ts
CHANGED
|
@@ -3,7 +3,25 @@ export declare const googleCalendarAuth: z.ZodObject<{
|
|
|
3
3
|
accessToken: z.ZodString;
|
|
4
4
|
refreshToken: z.ZodOptional<z.ZodString>;
|
|
5
5
|
}, z.core.$strip>;
|
|
6
|
-
export declare const googleCalendarScopes:
|
|
6
|
+
export declare const googleCalendarScopes: {
|
|
7
|
+
readonly calendar: "https://www.googleapis.com/auth/calendar";
|
|
8
|
+
readonly 'calendar.readonly': "https://www.googleapis.com/auth/calendar.readonly";
|
|
9
|
+
readonly 'calendar.events': "https://www.googleapis.com/auth/calendar.events";
|
|
10
|
+
readonly 'calendar.events.readonly': "https://www.googleapis.com/auth/calendar.events.readonly";
|
|
11
|
+
readonly 'calendar.events.owned': "https://www.googleapis.com/auth/calendar.events.owned";
|
|
12
|
+
readonly 'calendar.events.owned.readonly': "https://www.googleapis.com/auth/calendar.events.owned.readonly";
|
|
13
|
+
readonly 'calendar.events.freebusy': "https://www.googleapis.com/auth/calendar.events.freebusy";
|
|
14
|
+
readonly 'calendar.events.public.readonly': "https://www.googleapis.com/auth/calendar.events.public.readonly";
|
|
15
|
+
readonly 'calendar.calendarlist': "https://www.googleapis.com/auth/calendar.calendarlist";
|
|
16
|
+
readonly 'calendar.calendarlist.readonly': "https://www.googleapis.com/auth/calendar.calendarlist.readonly";
|
|
17
|
+
readonly 'calendar.calendars': "https://www.googleapis.com/auth/calendar.calendars";
|
|
18
|
+
readonly 'calendar.calendars.readonly': "https://www.googleapis.com/auth/calendar.calendars.readonly";
|
|
19
|
+
readonly 'calendar.acls': "https://www.googleapis.com/auth/calendar.acls";
|
|
20
|
+
readonly 'calendar.acls.readonly': "https://www.googleapis.com/auth/calendar.acls.readonly";
|
|
21
|
+
readonly 'calendar.freebusy': "https://www.googleapis.com/auth/calendar.freebusy";
|
|
22
|
+
readonly 'calendar.settings.readonly': "https://www.googleapis.com/auth/calendar.settings.readonly";
|
|
23
|
+
readonly 'calendar.app.created': "https://www.googleapis.com/auth/calendar.app.created";
|
|
24
|
+
};
|
|
7
25
|
export declare const calendarId: z.ZodString;
|
|
8
26
|
export declare const eventId: z.ZodString;
|
|
9
27
|
export declare const dateTime: z.ZodISODateTime;
|
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,kBAAkB;;;iBAG7B,CAAC;AACH,eAAO,MAAM,oBAAoB,
|
|
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,kBAAkB;;;iBAG7B,CAAC;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;CAqBvB,CAAC;AAEX,eAAO,MAAM,UAAU,aAAuD,CAAC;AAC/E,eAAO,MAAM,OAAO,aAAiE,CAAC;AACtF,eAAO,MAAM,QAAQ,kBAAmC,CAAC;AACzD,eAAO,MAAM,WAAW;;;;EAA0C,CAAC;AACnE,eAAO,MAAM,cAAc;;;iBAAoC,CAAC;AAChE,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;iBAatB,CAAC;AAUH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0DR,CAAC;AAEjB,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,WAExF"}
|
package/dist/config.js
CHANGED
|
@@ -9,10 +9,25 @@ export const googleCalendarAuth = z.object({
|
|
|
9
9
|
secret: true
|
|
10
10
|
})
|
|
11
11
|
});
|
|
12
|
-
export const googleCalendarScopes =
|
|
13
|
-
'https://www.googleapis.com/auth/calendar
|
|
14
|
-
'https://www.googleapis.com/auth/calendar.readonly'
|
|
15
|
-
|
|
12
|
+
export const googleCalendarScopes = {
|
|
13
|
+
calendar: 'https://www.googleapis.com/auth/calendar',
|
|
14
|
+
'calendar.readonly': 'https://www.googleapis.com/auth/calendar.readonly',
|
|
15
|
+
'calendar.events': 'https://www.googleapis.com/auth/calendar.events',
|
|
16
|
+
'calendar.events.readonly': 'https://www.googleapis.com/auth/calendar.events.readonly',
|
|
17
|
+
'calendar.events.owned': 'https://www.googleapis.com/auth/calendar.events.owned',
|
|
18
|
+
'calendar.events.owned.readonly': 'https://www.googleapis.com/auth/calendar.events.owned.readonly',
|
|
19
|
+
'calendar.events.freebusy': 'https://www.googleapis.com/auth/calendar.events.freebusy',
|
|
20
|
+
'calendar.events.public.readonly': 'https://www.googleapis.com/auth/calendar.events.public.readonly',
|
|
21
|
+
'calendar.calendarlist': 'https://www.googleapis.com/auth/calendar.calendarlist',
|
|
22
|
+
'calendar.calendarlist.readonly': 'https://www.googleapis.com/auth/calendar.calendarlist.readonly',
|
|
23
|
+
'calendar.calendars': 'https://www.googleapis.com/auth/calendar.calendars',
|
|
24
|
+
'calendar.calendars.readonly': 'https://www.googleapis.com/auth/calendar.calendars.readonly',
|
|
25
|
+
'calendar.acls': 'https://www.googleapis.com/auth/calendar.acls',
|
|
26
|
+
'calendar.acls.readonly': 'https://www.googleapis.com/auth/calendar.acls.readonly',
|
|
27
|
+
'calendar.freebusy': 'https://www.googleapis.com/auth/calendar.freebusy',
|
|
28
|
+
'calendar.settings.readonly': 'https://www.googleapis.com/auth/calendar.settings.readonly',
|
|
29
|
+
'calendar.app.created': 'https://www.googleapis.com/auth/calendar.app.created'
|
|
30
|
+
};
|
|
16
31
|
export const calendarId = z.string().trim().min(1).meta({
|
|
17
32
|
label: 'Calendar'
|
|
18
33
|
});
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/config.ts"],"names":["z","googleCalendarAuth","object","accessToken","string","min","meta","label","secret","refreshToken","optional","googleCalendarScopes","calendarId","trim","eventId","max","dateTime","iso","datetime","offset","sendUpdates","enum","eventReference","eventFields","title","startDateTime","endDateTime","location","description","colorId","attendees","array","email","guestsCanModify","boolean","guestsCanInviteOthers","guestsCanSeeOtherGuests","createMeetLink","eventDateTime","date","nullish","timeZone","passthrough","eventOutput","id","kind","etag","status","summary","htmlLink","hangoutLink","eventType","start","end","recurrence","recurringEventId","displayName","responseStatus","organizer","self","conferenceData","conferenceId","createRequest","requestId","statusCode","entryPoints","entryPointType","uri","validRange","Date","parse"],"mappings":"AAAA,SAASA,CAAC,QAAQ,MAAM;AAExB,OAAO,MAAMC,qBAAqBD,EAAEE,MAAM,CAAC;IACzCC,aAAaH,EAAEI,MAAM,GAAGC,GAAG,CAAC,GAAGC,IAAI,CAAC;QAAEC,OAAO;QAAgBC,QAAQ;IAAK;IAC1EC,cAAcT,EAAEI,MAAM,GAAGC,GAAG,CAAC,GAAGK,QAAQ,GAAGJ,IAAI,CAAC;QAAEC,OAAO;QAAiBC,QAAQ;IAAK;AACzF,GAAG;AACH,OAAO,MAAMG,uBAAuB;
|
|
1
|
+
{"version":3,"sources":["../src/config.ts"],"names":["z","googleCalendarAuth","object","accessToken","string","min","meta","label","secret","refreshToken","optional","googleCalendarScopes","calendar","calendarId","trim","eventId","max","dateTime","iso","datetime","offset","sendUpdates","enum","eventReference","eventFields","title","startDateTime","endDateTime","location","description","colorId","attendees","array","email","guestsCanModify","boolean","guestsCanInviteOthers","guestsCanSeeOtherGuests","createMeetLink","eventDateTime","date","nullish","timeZone","passthrough","eventOutput","id","kind","etag","status","summary","htmlLink","hangoutLink","eventType","start","end","recurrence","recurringEventId","displayName","responseStatus","organizer","self","conferenceData","conferenceId","createRequest","requestId","statusCode","entryPoints","entryPointType","uri","validRange","Date","parse"],"mappings":"AAAA,SAASA,CAAC,QAAQ,MAAM;AAExB,OAAO,MAAMC,qBAAqBD,EAAEE,MAAM,CAAC;IACzCC,aAAaH,EAAEI,MAAM,GAAGC,GAAG,CAAC,GAAGC,IAAI,CAAC;QAAEC,OAAO;QAAgBC,QAAQ;IAAK;IAC1EC,cAAcT,EAAEI,MAAM,GAAGC,GA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AO;QACzBgB,aAAazD,EAAEI,MAAM,GAAGqC,OAAO;QAC/BiB,gBAAgB1D,EAAEI,MAAM,GAAGqC,OAAO;QAClC/B,UAAUV,EAAEmC,OAAO,GAAGM,OAAO;QAC7BkB,WAAW3D,EAAEmC,OAAO,GAAGM,OAAO;QAC9BmB,MAAM5D,EAAEmC,OAAO,GAAGM,OAAO;IAC3B,GACCE,WAAW,IAEfjC,QAAQ;IACXwB,iBAAiBlC,EAAEmC,OAAO,GAAGM,OAAO;IACpCL,uBAAuBpC,EAAEmC,OAAO,GAAGM,OAAO;IAC1CJ,yBAAyBrC,EAAEmC,OAAO,GAAGM,OAAO;IAC5CoB,gBAAgB7D,EACbE,MAAM,CAAC;QACN4D,cAAc9D,EAAEI,MAAM,GAAGqC,OAAO;QAChCsB,eAAe/D,EACZE,MAAM,CAAC;YACN8D,WAAWhE,EAAEI,MAAM,GAAGqC,OAAO;YAC7BO,QAAQhD,EAAEE,MAAM,CAAC;gBAAE+D,YAAYjE,EAAEI,MAAM,GAAGqC,OAAO;YAAG,GAAGE,WAAW,GAAGjC,QAAQ;QAC/E,GACCiC,WAAW,GACXjC,QAAQ;QACXwD,aAAalE,EACVgC,KAAK,CACJhC,EACGE,MAAM,CAAC;YACNiE,gBAAgBnE,EAAEI,MAAM,GAAGqC,OAAO;YAClC2B,KAAKpE,EAAEI,MAAM,GAAGqC,OAAO;QACzB,GACCE,WAAW,IAEfjC,QAAQ;IACb,GACCiC,WAAW,GACXjC,QAAQ;AACb,GACCiC,WAAW,GAAG;AAEjB,OAAO,SAAS0B,WAAW,EAAEhB,KAAK,EAAEC,GAAG,EAAkD;IACvF,OAAO,CAACD,SAAS,CAACC,OAAOgB,KAAKC,KAAK,CAACjB,OAAOgB,KAAKC,KAAK,CAAClB;AACxD","file":"config.js"}
|
package/dist/define.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ 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").calendar_v3.Calendar, TOutput extends import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>> ? import("zod").infer<TOutput> : TResult> & {
|
|
4
4
|
slug: TSlug;
|
|
5
|
-
}
|
|
5
|
+
}, defineCustomApiCall: (config: import("frogbot/pieces").CustomApiCallConfig<import("googleapis").calendar_v3.Calendar>) => import("frogbot/pieces").CustomApiCallAction<Record<string, never>, import("googleapis").calendar_v3.Calendar>;
|
|
6
6
|
//# sourceMappingURL=define.d.ts.map
|
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;;;;
|
|
1
|
+
{"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../src/define.ts"],"names":[],"mappings":"AAIA,eAAO,MAAQ,YAAY;;;;GAAE,mBAAmB,qNAAyC,CAAC"}
|
package/dist/define.js
CHANGED
package/dist/define.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/define.ts"],"names":["createPieceHelpers","defineAction"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,iBAAiB;AAIpD,OAAO,MAAM,EAAEC,YAAY,EAAE,
|
|
1
|
+
{"version":3,"sources":["../src/define.ts"],"names":["createPieceHelpers","defineAction","defineCustomApiCall"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,iBAAiB;AAIpD,OAAO,MAAM,EAAEC,YAAY,EAAEC,mBAAmB,EAAE,GAAGF,qBAAqC","file":"define.js"}
|
package/dist/index.d.ts
CHANGED
|
@@ -15,7 +15,32 @@ export declare const createGoogleCalendar: import("frogbot").PieceFactory<{
|
|
|
15
15
|
}, import("zod/v4/core").$strip>;
|
|
16
16
|
readonly client: typeof createGoogleCalendarClient;
|
|
17
17
|
readonly oauth: {
|
|
18
|
-
readonly scopes:
|
|
18
|
+
readonly scopes: {
|
|
19
|
+
readonly catalog: {
|
|
20
|
+
readonly calendar: "https://www.googleapis.com/auth/calendar";
|
|
21
|
+
readonly 'calendar.readonly': "https://www.googleapis.com/auth/calendar.readonly";
|
|
22
|
+
readonly 'calendar.events': "https://www.googleapis.com/auth/calendar.events";
|
|
23
|
+
readonly 'calendar.events.readonly': "https://www.googleapis.com/auth/calendar.events.readonly";
|
|
24
|
+
readonly 'calendar.events.owned': "https://www.googleapis.com/auth/calendar.events.owned";
|
|
25
|
+
readonly 'calendar.events.owned.readonly': "https://www.googleapis.com/auth/calendar.events.owned.readonly";
|
|
26
|
+
readonly 'calendar.events.freebusy': "https://www.googleapis.com/auth/calendar.events.freebusy";
|
|
27
|
+
readonly 'calendar.events.public.readonly': "https://www.googleapis.com/auth/calendar.events.public.readonly";
|
|
28
|
+
readonly 'calendar.calendarlist': "https://www.googleapis.com/auth/calendar.calendarlist";
|
|
29
|
+
readonly 'calendar.calendarlist.readonly': "https://www.googleapis.com/auth/calendar.calendarlist.readonly";
|
|
30
|
+
readonly 'calendar.calendars': "https://www.googleapis.com/auth/calendar.calendars";
|
|
31
|
+
readonly 'calendar.calendars.readonly': "https://www.googleapis.com/auth/calendar.calendars.readonly";
|
|
32
|
+
readonly 'calendar.acls': "https://www.googleapis.com/auth/calendar.acls";
|
|
33
|
+
readonly 'calendar.acls.readonly': "https://www.googleapis.com/auth/calendar.acls.readonly";
|
|
34
|
+
readonly 'calendar.freebusy': "https://www.googleapis.com/auth/calendar.freebusy";
|
|
35
|
+
readonly 'calendar.settings.readonly': "https://www.googleapis.com/auth/calendar.settings.readonly";
|
|
36
|
+
readonly 'calendar.app.created': "https://www.googleapis.com/auth/calendar.app.created";
|
|
37
|
+
readonly openid: "openid";
|
|
38
|
+
readonly 'userinfo.email': "https://www.googleapis.com/auth/userinfo.email";
|
|
39
|
+
readonly 'userinfo.profile': "https://www.googleapis.com/auth/userinfo.profile";
|
|
40
|
+
};
|
|
41
|
+
readonly defaults: readonly ["calendar.events", "calendar.readonly"];
|
|
42
|
+
readonly required: ("openid" | "userinfo.email" | "userinfo.profile")[];
|
|
43
|
+
};
|
|
19
44
|
readonly toAuth: ({ tokens }: {
|
|
20
45
|
tokens: import("frogbot").OAuthTokens;
|
|
21
46
|
}) => {
|
|
@@ -43,9 +68,9 @@ export declare const createGoogleCalendar: import("frogbot").PieceFactory<{
|
|
|
43
68
|
eventId: import("zod").ZodString;
|
|
44
69
|
attendees: import("zod").ZodArray<import("zod").ZodEmail>;
|
|
45
70
|
sendUpdates: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
46
|
-
none: "none";
|
|
47
71
|
all: "all";
|
|
48
72
|
externalOnly: "externalOnly";
|
|
73
|
+
none: "none";
|
|
49
74
|
}>>;
|
|
50
75
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
51
76
|
id: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
@@ -157,9 +182,9 @@ export declare const createGoogleCalendar: import("frogbot").PieceFactory<{
|
|
|
157
182
|
calendarId: import("zod").ZodString;
|
|
158
183
|
text: import("zod").ZodString;
|
|
159
184
|
sendUpdates: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
160
|
-
none: "none";
|
|
161
185
|
all: "all";
|
|
162
186
|
externalOnly: "externalOnly";
|
|
187
|
+
none: "none";
|
|
163
188
|
}>>;
|
|
164
189
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
165
190
|
id: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
@@ -278,9 +303,9 @@ export declare const createGoogleCalendar: import("frogbot").PieceFactory<{
|
|
|
278
303
|
title: import("zod").ZodString;
|
|
279
304
|
startDateTime: import("zod").ZodISODateTime;
|
|
280
305
|
sendUpdates: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
281
|
-
none: "none";
|
|
282
306
|
all: "all";
|
|
283
307
|
externalOnly: "externalOnly";
|
|
308
|
+
none: "none";
|
|
284
309
|
}>>;
|
|
285
310
|
guestsCanModify: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
286
311
|
guestsCanInviteOthers: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
@@ -544,9 +569,9 @@ export declare const createGoogleCalendar: import("frogbot").PieceFactory<{
|
|
|
544
569
|
guestsCanInviteOthers: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
545
570
|
guestsCanSeeOtherGuests: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
546
571
|
sendUpdates: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
547
|
-
none: "none";
|
|
548
572
|
all: "all";
|
|
549
573
|
externalOnly: "externalOnly";
|
|
574
|
+
none: "none";
|
|
550
575
|
}>>;
|
|
551
576
|
createMeetLink: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
552
577
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
@@ -659,9 +684,9 @@ export declare const createGoogleCalendar: import("frogbot").PieceFactory<{
|
|
|
659
684
|
calendarId: import("zod").ZodString;
|
|
660
685
|
eventId: import("zod").ZodString;
|
|
661
686
|
sendUpdates: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
662
|
-
none: "none";
|
|
663
687
|
all: "all";
|
|
664
688
|
externalOnly: "externalOnly";
|
|
689
|
+
none: "none";
|
|
665
690
|
}>>;
|
|
666
691
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
667
692
|
deleted: import("zod").ZodLiteral<true>;
|
|
@@ -829,57 +854,6 @@ export declare const createGoogleCalendar: import("frogbot").PieceFactory<{
|
|
|
829
854
|
} | undefined;
|
|
830
855
|
}> & {
|
|
831
856
|
slug: "getEvent";
|
|
832
|
-
}, import("frogbot").
|
|
833
|
-
method: import("zod").ZodEnum<{
|
|
834
|
-
GET: "GET";
|
|
835
|
-
POST: "POST";
|
|
836
|
-
PATCH: "PATCH";
|
|
837
|
-
PUT: "PUT";
|
|
838
|
-
DELETE: "DELETE";
|
|
839
|
-
HEAD: "HEAD";
|
|
840
|
-
OPTIONS: "OPTIONS";
|
|
841
|
-
}>;
|
|
842
|
-
path: import("zod").ZodString;
|
|
843
|
-
headers: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
844
|
-
query: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnion<readonly [import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber, import("zod").ZodBoolean]>, import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber, import("zod").ZodBoolean]>>]>>>;
|
|
845
|
-
bodyType: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
846
|
-
formData: "formData";
|
|
847
|
-
json: "json";
|
|
848
|
-
none: "none";
|
|
849
|
-
raw: "raw";
|
|
850
|
-
}>>;
|
|
851
|
-
body: import("zod").ZodOptional<import("zod").ZodJSONSchema>;
|
|
852
|
-
formData: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
853
|
-
name: import("zod").ZodString;
|
|
854
|
-
type: import("zod").ZodLiteral<"text">;
|
|
855
|
-
value: import("zod").ZodString;
|
|
856
|
-
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
857
|
-
name: import("zod").ZodString;
|
|
858
|
-
type: import("zod").ZodLiteral<"file">;
|
|
859
|
-
filename: import("zod").ZodString;
|
|
860
|
-
contentType: import("zod").ZodDefault<import("zod").ZodString>;
|
|
861
|
-
base64: import("zod").ZodBase64;
|
|
862
|
-
}, import("zod/v4/core").$strip>], "type">>>;
|
|
863
|
-
responseIsBinary: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
864
|
-
failsafe: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
865
|
-
timeout: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
866
|
-
followRedirects: import("zod").ZodDefault<import("zod").ZodLiteral<false>>;
|
|
867
|
-
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
868
|
-
status: import("zod").ZodNumber;
|
|
869
|
-
headers: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>;
|
|
870
|
-
body: import("zod").ZodUnion<readonly [import("zod").ZodJSONSchema, import("zod").ZodObject<{
|
|
871
|
-
base64: import("zod").ZodString;
|
|
872
|
-
contentType: import("zod").ZodString;
|
|
873
|
-
}, import("zod/v4/core").$strip>]>;
|
|
874
|
-
}, import("zod/v4/core").$strip>, Record<string, never>, import("googleapis").calendar_v3.Calendar, {
|
|
875
|
-
status: number;
|
|
876
|
-
headers: Record<string, string>;
|
|
877
|
-
body: import("zod").JSONType | {
|
|
878
|
-
base64: string;
|
|
879
|
-
contentType: string;
|
|
880
|
-
};
|
|
881
|
-
}> & {
|
|
882
|
-
slug: "customApiCall";
|
|
883
|
-
}];
|
|
857
|
+
}, import("frogbot/pieces").CustomApiCallAction<Record<string, never>, import("googleapis").calendar_v3.Calendar>];
|
|
884
858
|
}>;
|
|
885
859
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAsB,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEvE,eAAO,MAAM,qBAAqB,8JAUxB,CAAC;AACX,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAEhC,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAsB,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEvE,e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} 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 { addAttendees, createEvent, createQuickEvent, deleteEvent, updateEvent } from './actions/events.js';
|
|
@@ -28,10 +28,17 @@ export const createGoogleCalendar = definePiece({
|
|
|
28
28
|
client: createGoogleCalendarClient,
|
|
29
29
|
oauth: {
|
|
30
30
|
...googleOAuth,
|
|
31
|
-
scopes:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
scopes: {
|
|
32
|
+
catalog: {
|
|
33
|
+
...googleScopes,
|
|
34
|
+
...googleCalendarScopes
|
|
35
|
+
},
|
|
36
|
+
defaults: [
|
|
37
|
+
'calendar.events',
|
|
38
|
+
'calendar.readonly'
|
|
39
|
+
],
|
|
40
|
+
required: googleOAuth.scopes.required
|
|
41
|
+
},
|
|
35
42
|
toAuth: ({ tokens })=>({
|
|
36
43
|
accessToken: tokens.access_token ?? '',
|
|
37
44
|
refreshToken: tokens.refresh_token
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":["googleOAuth","definePiece","customApiCall","addAttendees","createEvent","createQuickEvent","deleteEvent","updateEvent","findFreeBusyPeriods","getEvent","listEvents","createGoogleCalendarClient","googleCalendarAuth","googleCalendarScopes","googleCalendarActions","createGoogleCalendar","slug","label","admin","description","group","auth","client","oauth","scopes","toAuth","tokens","accessToken","access_token","refreshToken","refresh_token","actions"],"mappings":"AAAA,SAASA,WAAW,QAAQ,0BAA0B;
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":["googleOAuth","googleScopes","definePiece","customApiCall","addAttendees","createEvent","createQuickEvent","deleteEvent","updateEvent","findFreeBusyPeriods","getEvent","listEvents","createGoogleCalendarClient","googleCalendarAuth","googleCalendarScopes","googleCalendarActions","createGoogleCalendar","slug","label","admin","description","group","auth","client","oauth","scopes","catalog","defaults","required","toAuth","tokens","accessToken","access_token","refreshToken","refresh_token","actions"],"mappings":"AAAA,SAASA,WAAW,EAAEC,YAAY,QAAQ,0BAA0B;AACpE,SAASC,WAAW,QAAQ,iBAAiB;AAE7C,SAASC,aAAa,QAAQ,6BAA6B;AAC3D,SACEC,YAAY,EACZC,WAAW,EACXC,gBAAgB,EAChBC,WAAW,EACXC,WAAW,QACN,sBAAsB;AAC7B,SAASC,mBAAmB,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,oBAAoB;AAC9E,SAASC,0BAA0B,QAAQ,cAAc;AACzD,SAASC,kBAAkB,EAAEC,oBAAoB,QAAQ,cAAc;AAEvE,OAAO,MAAMC,wBAAwB;IACnC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAU;AACX,SAASD,oBAAoB,GAAG;AAEhC,OAAO,MAAME,uBAAuBd,YAAY;IAC9Ce,MAAM;IACNC,OAAO;IACPC,OAAO;QACLC,aAAa;QACbC,OAAO;IACT;IACAC,MAAMT;IACNU,QAAQX;IACRY,OAAO;QACL,GAAGxB,WAAW;QACdyB,QAAQ;YACNC,SAAS;gBAAE,GAAGzB,YAAY;gBAAE,GAAGa,oBAAoB;YAAC;YACpDa,UAAU;gBAAC;gBAAmB;aAAoB;YAClDC,UAAU5B,YAAYyB,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;QACP/B;QACAE;QACAD;QACAM;QACAH;QACAD;QACAE;QACAC;QACAP;KACD;AACH,GAAG","file":"index.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frogbotai/piece-google-calendar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.33.0",
|
|
4
4
|
"description": "Google Calendar 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"
|