@frogbotai/piece-google-calendar 0.22.0 → 0.24.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.
@@ -0,0 +1,419 @@
1
+ import type { PieceRunArgs } from 'frogbot/pieces';
2
+ import type { calendar_v3 } from 'googleapis';
3
+ import { z } from 'zod';
4
+ import { type GoogleCalendar } from '../client.js';
5
+ import { colors } from './options.js';
6
+ declare const createInput: z.ZodObject<{
7
+ endDateTime: z.ZodOptional<z.ZodISODateTime>;
8
+ location: z.ZodOptional<z.ZodString>;
9
+ description: z.ZodOptional<z.ZodString>;
10
+ colorId: z.ZodOptional<z.ZodString>;
11
+ attendees: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
12
+ createMeetLink: z.ZodOptional<z.ZodBoolean>;
13
+ calendarId: z.ZodString;
14
+ title: z.ZodString;
15
+ startDateTime: z.ZodISODateTime;
16
+ sendUpdates: z.ZodDefault<z.ZodEnum<{
17
+ all: "all";
18
+ externalOnly: "externalOnly";
19
+ none: "none";
20
+ }>>;
21
+ guestsCanModify: z.ZodDefault<z.ZodBoolean>;
22
+ guestsCanInviteOthers: z.ZodDefault<z.ZodBoolean>;
23
+ guestsCanSeeOtherGuests: z.ZodDefault<z.ZodBoolean>;
24
+ }, z.core.$strip>;
25
+ export declare const createEvent: {
26
+ slug: string;
27
+ description: string;
28
+ input: z.ZodObject<{
29
+ endDateTime: z.ZodOptional<z.ZodISODateTime>;
30
+ location: z.ZodOptional<z.ZodString>;
31
+ description: z.ZodOptional<z.ZodString>;
32
+ colorId: z.ZodOptional<z.ZodString>;
33
+ attendees: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
34
+ createMeetLink: z.ZodOptional<z.ZodBoolean>;
35
+ calendarId: z.ZodString;
36
+ title: z.ZodString;
37
+ startDateTime: z.ZodISODateTime;
38
+ sendUpdates: z.ZodDefault<z.ZodEnum<{
39
+ all: "all";
40
+ externalOnly: "externalOnly";
41
+ none: "none";
42
+ }>>;
43
+ guestsCanModify: z.ZodDefault<z.ZodBoolean>;
44
+ guestsCanInviteOthers: z.ZodDefault<z.ZodBoolean>;
45
+ guestsCanSeeOtherGuests: z.ZodDefault<z.ZodBoolean>;
46
+ }, z.core.$strip>;
47
+ output: z.ZodObject<{
48
+ id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
49
+ kind: z.ZodOptional<z.ZodNullable<z.ZodString>>;
50
+ etag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
51
+ status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
52
+ summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
53
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
54
+ location: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55
+ htmlLink: z.ZodOptional<z.ZodNullable<z.ZodString>>;
56
+ hangoutLink: z.ZodOptional<z.ZodNullable<z.ZodString>>;
57
+ colorId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
58
+ eventType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
59
+ start: z.ZodOptional<z.ZodObject<{
60
+ date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
61
+ dateTime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
62
+ timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
63
+ }, z.core.$loose>>;
64
+ end: z.ZodOptional<z.ZodObject<{
65
+ date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
66
+ dateTime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
67
+ timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
68
+ }, z.core.$loose>>;
69
+ recurrence: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
70
+ recurringEventId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
71
+ attendees: z.ZodOptional<z.ZodArray<z.ZodObject<{
72
+ email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
73
+ displayName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
74
+ responseStatus: z.ZodOptional<z.ZodNullable<z.ZodString>>;
75
+ optional: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
76
+ organizer: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
77
+ self: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
78
+ }, z.core.$loose>>>;
79
+ guestsCanModify: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
80
+ guestsCanInviteOthers: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
81
+ guestsCanSeeOtherGuests: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
82
+ conferenceData: z.ZodOptional<z.ZodObject<{
83
+ conferenceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
84
+ createRequest: z.ZodOptional<z.ZodObject<{
85
+ requestId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
86
+ status: z.ZodOptional<z.ZodObject<{
87
+ statusCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
88
+ }, z.core.$loose>>;
89
+ }, z.core.$loose>>;
90
+ entryPoints: z.ZodOptional<z.ZodArray<z.ZodObject<{
91
+ entryPointType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
92
+ uri: z.ZodOptional<z.ZodNullable<z.ZodString>>;
93
+ }, z.core.$loose>>>;
94
+ }, z.core.$loose>>;
95
+ }, z.core.$loose>;
96
+ idempotent: boolean;
97
+ options: {
98
+ calendarId: ({ client, req }: {
99
+ client: GoogleCalendar;
100
+ req: import("frogbot").FrogbotRequest;
101
+ }) => Promise<{
102
+ label: string;
103
+ value: string;
104
+ }[]>;
105
+ colorId: typeof colors;
106
+ };
107
+ run({ client, input, req, }: PieceRunArgs<z.output<typeof createInput>, object, GoogleCalendar>): Promise<calendar_v3.Schema$Event>;
108
+ };
109
+ declare const updateInput: z.ZodObject<{
110
+ calendarId: z.ZodString;
111
+ eventId: z.ZodString;
112
+ title: z.ZodOptional<z.ZodString>;
113
+ startDateTime: z.ZodOptional<z.ZodISODateTime>;
114
+ endDateTime: z.ZodOptional<z.ZodISODateTime>;
115
+ location: z.ZodOptional<z.ZodString>;
116
+ description: z.ZodOptional<z.ZodString>;
117
+ colorId: z.ZodOptional<z.ZodString>;
118
+ attendees: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
119
+ guestsCanModify: z.ZodOptional<z.ZodBoolean>;
120
+ guestsCanInviteOthers: z.ZodOptional<z.ZodBoolean>;
121
+ guestsCanSeeOtherGuests: z.ZodOptional<z.ZodBoolean>;
122
+ sendUpdates: z.ZodOptional<z.ZodEnum<{
123
+ all: "all";
124
+ externalOnly: "externalOnly";
125
+ none: "none";
126
+ }>>;
127
+ createMeetLink: z.ZodOptional<z.ZodBoolean>;
128
+ }, z.core.$strip>;
129
+ export declare const updateEvent: {
130
+ slug: string;
131
+ description: string;
132
+ input: z.ZodObject<{
133
+ calendarId: z.ZodString;
134
+ eventId: z.ZodString;
135
+ title: z.ZodOptional<z.ZodString>;
136
+ startDateTime: z.ZodOptional<z.ZodISODateTime>;
137
+ endDateTime: z.ZodOptional<z.ZodISODateTime>;
138
+ location: z.ZodOptional<z.ZodString>;
139
+ description: z.ZodOptional<z.ZodString>;
140
+ colorId: z.ZodOptional<z.ZodString>;
141
+ attendees: z.ZodOptional<z.ZodArray<z.ZodEmail>>;
142
+ guestsCanModify: z.ZodOptional<z.ZodBoolean>;
143
+ guestsCanInviteOthers: z.ZodOptional<z.ZodBoolean>;
144
+ guestsCanSeeOtherGuests: z.ZodOptional<z.ZodBoolean>;
145
+ sendUpdates: z.ZodOptional<z.ZodEnum<{
146
+ all: "all";
147
+ externalOnly: "externalOnly";
148
+ none: "none";
149
+ }>>;
150
+ createMeetLink: z.ZodOptional<z.ZodBoolean>;
151
+ }, z.core.$strip>;
152
+ output: z.ZodObject<{
153
+ id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
154
+ kind: z.ZodOptional<z.ZodNullable<z.ZodString>>;
155
+ etag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
156
+ status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
157
+ summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
158
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
159
+ location: z.ZodOptional<z.ZodNullable<z.ZodString>>;
160
+ htmlLink: z.ZodOptional<z.ZodNullable<z.ZodString>>;
161
+ hangoutLink: z.ZodOptional<z.ZodNullable<z.ZodString>>;
162
+ colorId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
163
+ eventType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
164
+ start: z.ZodOptional<z.ZodObject<{
165
+ date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
166
+ dateTime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
167
+ timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
168
+ }, z.core.$loose>>;
169
+ end: z.ZodOptional<z.ZodObject<{
170
+ date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
171
+ dateTime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
172
+ timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
173
+ }, z.core.$loose>>;
174
+ recurrence: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
175
+ recurringEventId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
176
+ attendees: z.ZodOptional<z.ZodArray<z.ZodObject<{
177
+ email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
178
+ displayName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
179
+ responseStatus: z.ZodOptional<z.ZodNullable<z.ZodString>>;
180
+ optional: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
181
+ organizer: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
182
+ self: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
183
+ }, z.core.$loose>>>;
184
+ guestsCanModify: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
185
+ guestsCanInviteOthers: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
186
+ guestsCanSeeOtherGuests: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
187
+ conferenceData: z.ZodOptional<z.ZodObject<{
188
+ conferenceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
189
+ createRequest: z.ZodOptional<z.ZodObject<{
190
+ requestId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
191
+ status: z.ZodOptional<z.ZodObject<{
192
+ statusCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
193
+ }, z.core.$loose>>;
194
+ }, z.core.$loose>>;
195
+ entryPoints: z.ZodOptional<z.ZodArray<z.ZodObject<{
196
+ entryPointType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
197
+ uri: z.ZodOptional<z.ZodNullable<z.ZodString>>;
198
+ }, z.core.$loose>>>;
199
+ }, z.core.$loose>>;
200
+ }, z.core.$loose>;
201
+ idempotent: boolean;
202
+ options: {
203
+ calendarId: ({ client, req }: {
204
+ client: GoogleCalendar;
205
+ req: import("frogbot").FrogbotRequest;
206
+ }) => Promise<{
207
+ label: string;
208
+ value: string;
209
+ }[]>;
210
+ colorId: typeof colors;
211
+ };
212
+ run({ client, input, req, }: PieceRunArgs<z.output<typeof updateInput>, object, GoogleCalendar>): Promise<calendar_v3.Schema$Event>;
213
+ };
214
+ declare const attendeesInput: z.ZodObject<{
215
+ calendarId: z.ZodString;
216
+ eventId: z.ZodString;
217
+ attendees: z.ZodArray<z.ZodEmail>;
218
+ sendUpdates: z.ZodOptional<z.ZodEnum<{
219
+ all: "all";
220
+ externalOnly: "externalOnly";
221
+ none: "none";
222
+ }>>;
223
+ }, z.core.$strip>;
224
+ export declare const addAttendees: {
225
+ slug: string;
226
+ description: string;
227
+ input: z.ZodObject<{
228
+ calendarId: z.ZodString;
229
+ eventId: z.ZodString;
230
+ attendees: z.ZodArray<z.ZodEmail>;
231
+ sendUpdates: z.ZodOptional<z.ZodEnum<{
232
+ all: "all";
233
+ externalOnly: "externalOnly";
234
+ none: "none";
235
+ }>>;
236
+ }, z.core.$strip>;
237
+ output: z.ZodObject<{
238
+ id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
239
+ kind: z.ZodOptional<z.ZodNullable<z.ZodString>>;
240
+ etag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
241
+ status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
242
+ summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
243
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
244
+ location: z.ZodOptional<z.ZodNullable<z.ZodString>>;
245
+ htmlLink: z.ZodOptional<z.ZodNullable<z.ZodString>>;
246
+ hangoutLink: z.ZodOptional<z.ZodNullable<z.ZodString>>;
247
+ colorId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
248
+ eventType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
249
+ start: z.ZodOptional<z.ZodObject<{
250
+ date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
251
+ dateTime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
252
+ timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
253
+ }, z.core.$loose>>;
254
+ end: z.ZodOptional<z.ZodObject<{
255
+ date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
256
+ dateTime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
257
+ timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
258
+ }, z.core.$loose>>;
259
+ recurrence: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
260
+ recurringEventId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
261
+ attendees: z.ZodOptional<z.ZodArray<z.ZodObject<{
262
+ email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
263
+ displayName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
264
+ responseStatus: z.ZodOptional<z.ZodNullable<z.ZodString>>;
265
+ optional: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
266
+ organizer: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
267
+ self: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
268
+ }, z.core.$loose>>>;
269
+ guestsCanModify: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
270
+ guestsCanInviteOthers: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
271
+ guestsCanSeeOtherGuests: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
272
+ conferenceData: z.ZodOptional<z.ZodObject<{
273
+ conferenceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
274
+ createRequest: z.ZodOptional<z.ZodObject<{
275
+ requestId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
276
+ status: z.ZodOptional<z.ZodObject<{
277
+ statusCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
278
+ }, z.core.$loose>>;
279
+ }, z.core.$loose>>;
280
+ entryPoints: z.ZodOptional<z.ZodArray<z.ZodObject<{
281
+ entryPointType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
282
+ uri: z.ZodOptional<z.ZodNullable<z.ZodString>>;
283
+ }, z.core.$loose>>>;
284
+ }, z.core.$loose>>;
285
+ }, z.core.$loose>;
286
+ idempotent: boolean;
287
+ options: {
288
+ calendarId: ({ client, req }: {
289
+ client: GoogleCalendar;
290
+ req: import("frogbot").FrogbotRequest;
291
+ }) => Promise<{
292
+ label: string;
293
+ value: string;
294
+ }[]>;
295
+ };
296
+ run({ client, input, req, }: PieceRunArgs<z.output<typeof attendeesInput>, object, GoogleCalendar>): Promise<calendar_v3.Schema$Event>;
297
+ };
298
+ declare const quickInput: z.ZodObject<{
299
+ calendarId: z.ZodString;
300
+ text: z.ZodString;
301
+ sendUpdates: z.ZodDefault<z.ZodEnum<{
302
+ all: "all";
303
+ externalOnly: "externalOnly";
304
+ none: "none";
305
+ }>>;
306
+ }, z.core.$strip>;
307
+ export declare const createQuickEvent: {
308
+ slug: string;
309
+ description: string;
310
+ input: z.ZodObject<{
311
+ calendarId: z.ZodString;
312
+ text: z.ZodString;
313
+ sendUpdates: z.ZodDefault<z.ZodEnum<{
314
+ all: "all";
315
+ externalOnly: "externalOnly";
316
+ none: "none";
317
+ }>>;
318
+ }, z.core.$strip>;
319
+ output: z.ZodObject<{
320
+ id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
321
+ kind: z.ZodOptional<z.ZodNullable<z.ZodString>>;
322
+ etag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
323
+ status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
324
+ summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
325
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
326
+ location: z.ZodOptional<z.ZodNullable<z.ZodString>>;
327
+ htmlLink: z.ZodOptional<z.ZodNullable<z.ZodString>>;
328
+ hangoutLink: z.ZodOptional<z.ZodNullable<z.ZodString>>;
329
+ colorId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
330
+ eventType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
331
+ start: z.ZodOptional<z.ZodObject<{
332
+ date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
333
+ dateTime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
334
+ timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
335
+ }, z.core.$loose>>;
336
+ end: z.ZodOptional<z.ZodObject<{
337
+ date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
338
+ dateTime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
339
+ timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
340
+ }, z.core.$loose>>;
341
+ recurrence: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
342
+ recurringEventId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
343
+ attendees: z.ZodOptional<z.ZodArray<z.ZodObject<{
344
+ email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
345
+ displayName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
346
+ responseStatus: z.ZodOptional<z.ZodNullable<z.ZodString>>;
347
+ optional: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
348
+ organizer: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
349
+ self: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
350
+ }, z.core.$loose>>>;
351
+ guestsCanModify: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
352
+ guestsCanInviteOthers: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
353
+ guestsCanSeeOtherGuests: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
354
+ conferenceData: z.ZodOptional<z.ZodObject<{
355
+ conferenceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
356
+ createRequest: z.ZodOptional<z.ZodObject<{
357
+ requestId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
358
+ status: z.ZodOptional<z.ZodObject<{
359
+ statusCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
360
+ }, z.core.$loose>>;
361
+ }, z.core.$loose>>;
362
+ entryPoints: z.ZodOptional<z.ZodArray<z.ZodObject<{
363
+ entryPointType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
364
+ uri: z.ZodOptional<z.ZodNullable<z.ZodString>>;
365
+ }, z.core.$loose>>>;
366
+ }, z.core.$loose>>;
367
+ }, z.core.$loose>;
368
+ idempotent: boolean;
369
+ options: {
370
+ calendarId: ({ client, req }: {
371
+ client: GoogleCalendar;
372
+ req: import("frogbot").FrogbotRequest;
373
+ }) => Promise<{
374
+ label: string;
375
+ value: string;
376
+ }[]>;
377
+ };
378
+ run({ client, input, req, }: PieceRunArgs<z.output<typeof quickInput>, object, GoogleCalendar>): Promise<calendar_v3.Schema$Event>;
379
+ };
380
+ declare const deleteInput: z.ZodObject<{
381
+ calendarId: z.ZodString;
382
+ eventId: z.ZodString;
383
+ sendUpdates: z.ZodOptional<z.ZodEnum<{
384
+ all: "all";
385
+ externalOnly: "externalOnly";
386
+ none: "none";
387
+ }>>;
388
+ }, z.core.$strip>;
389
+ export declare const deleteEvent: {
390
+ slug: string;
391
+ description: string;
392
+ input: z.ZodObject<{
393
+ calendarId: z.ZodString;
394
+ eventId: z.ZodString;
395
+ sendUpdates: z.ZodOptional<z.ZodEnum<{
396
+ all: "all";
397
+ externalOnly: "externalOnly";
398
+ none: "none";
399
+ }>>;
400
+ }, z.core.$strip>;
401
+ output: z.ZodObject<{
402
+ deleted: z.ZodLiteral<true>;
403
+ }, z.core.$strip>;
404
+ idempotent: boolean;
405
+ options: {
406
+ calendarId: ({ client, req }: {
407
+ client: GoogleCalendar;
408
+ req: import("frogbot").FrogbotRequest;
409
+ }) => Promise<{
410
+ label: string;
411
+ value: string;
412
+ }[]>;
413
+ };
414
+ run({ client, input, req, }: PieceRunArgs<z.output<typeof deleteInput>, object, GoogleCalendar>): Promise<{
415
+ deleted: true;
416
+ }>;
417
+ };
418
+ export {};
419
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/actions/events.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,KAAK,cAAc,EAAkB,MAAM,cAAc,CAAC;AAUnE,OAAO,EAAa,MAAM,EAAE,MAAM,cAAc,CAAC;AA0BjD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;iBAab,CAAC;AACL,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAYnB,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC;CAiBtE,CAAC;AAEF,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;iBAKb,CAAC;AACL,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAYnB,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC;CA6BtE,CAAC;AAEF,QAAA,MAAM,cAAc;;;;;;;;;iBAGlB,CAAC;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAYpB,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,cAAc,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC;CAsBzE,CAAC;AAEF,QAAA,MAAM,UAAU;;;;;;;;iBAId,CAAC;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAYxB,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,UAAU,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC;CAGrE,CAAC;AAEF,QAAA,MAAM,WAAW;;;;;;;;iBAAiE,CAAC;AACnF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;iCAWnB,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC;;;CAItE,CAAC"}
@@ -0,0 +1,165 @@
1
+ import { randomUUID } from 'node:crypto';
2
+ import { z } from 'zod';
3
+ import { requestOptions } from '../client.js';
4
+ import { calendarId, dateTime, eventFields, eventOutput, eventReference, sendUpdates, validRange, } from '../config.js';
5
+ import { calendars, colors } from './options.js';
6
+ function eventBody(input) {
7
+ const body = {};
8
+ if (input.title !== undefined)
9
+ body.summary = input.title;
10
+ if (input.startDateTime !== undefined)
11
+ body.start = { dateTime: input.startDateTime };
12
+ if (input.endDateTime !== undefined)
13
+ body.end = { dateTime: input.endDateTime };
14
+ if (input.attendees !== undefined)
15
+ body.attendees = input.attendees.map((email) => ({ email }));
16
+ for (const field of ['location', 'description', 'colorId']) {
17
+ if (input[field] !== undefined)
18
+ body[field] = input[field];
19
+ }
20
+ for (const field of [
21
+ 'guestsCanModify',
22
+ 'guestsCanInviteOthers',
23
+ 'guestsCanSeeOtherGuests',
24
+ ]) {
25
+ if (input[field] !== undefined)
26
+ body[field] = input[field];
27
+ }
28
+ if (input.createMeetLink) {
29
+ body.conferenceData = {
30
+ createRequest: { requestId: randomUUID(), conferenceSolutionKey: { type: 'hangoutsMeet' } },
31
+ };
32
+ }
33
+ return body;
34
+ }
35
+ const createInput = eventFields
36
+ .extend({
37
+ calendarId,
38
+ title: z.string().min(1),
39
+ startDateTime: dateTime,
40
+ sendUpdates: sendUpdates.default('all'),
41
+ guestsCanModify: z.boolean().default(false),
42
+ guestsCanInviteOthers: z.boolean().default(false),
43
+ guestsCanSeeOtherGuests: z.boolean().default(false),
44
+ })
45
+ .refine((input) => validRange({ start: input.startDateTime, end: input.endDateTime }), {
46
+ message: 'End date must be after start date.',
47
+ path: ['endDateTime'],
48
+ });
49
+ export const createEvent = {
50
+ slug: 'createEvent',
51
+ description: 'Create an event with attendees, guest permissions, notifications, and an optional Google Meet conference. Duration defaults to 30 minutes.',
52
+ input: createInput,
53
+ output: eventOutput,
54
+ idempotent: false,
55
+ options: { calendarId: calendars('writer'), colorId: colors },
56
+ async run({ client, input, req, }) {
57
+ const body = eventBody(input);
58
+ body.end ??= {
59
+ dateTime: new Date(Date.parse(input.startDateTime) + 30 * 60_000).toISOString(),
60
+ };
61
+ return (await client.events.insert({
62
+ calendarId: input.calendarId,
63
+ sendUpdates: input.sendUpdates,
64
+ conferenceDataVersion: input.createMeetLink ? 1 : 0,
65
+ requestBody: body,
66
+ }, requestOptions(req))).data;
67
+ },
68
+ };
69
+ const updateInput = eventReference
70
+ .extend(eventFields.shape)
71
+ .refine((input) => validRange({ start: input.startDateTime, end: input.endDateTime }), {
72
+ message: 'End date must be after start date.',
73
+ path: ['endDateTime'],
74
+ });
75
+ export const updateEvent = {
76
+ slug: 'updateEvent',
77
+ description: 'Update only supplied event fields, preserving omitted fields. An empty attendees array clears guests.',
78
+ input: updateInput,
79
+ output: eventOutput,
80
+ idempotent: false,
81
+ options: { calendarId: calendars('writer'), colorId: colors },
82
+ async run({ client, input, req, }) {
83
+ const reference = { calendarId: input.calendarId, eventId: input.eventId };
84
+ const { data: existing } = await client.events.get(reference, requestOptions(req));
85
+ const body = eventBody(input);
86
+ if (body.start)
87
+ body.start = { date: null, timeZone: existing.start?.timeZone, ...body.start };
88
+ if (body.end)
89
+ body.end = { date: null, timeZone: existing.end?.timeZone, ...body.end };
90
+ if (!validRange({
91
+ start: body.start?.dateTime ?? existing.start?.dateTime,
92
+ end: body.end?.dateTime ?? existing.end?.dateTime,
93
+ })) {
94
+ throw new Error('End date must be after start date.');
95
+ }
96
+ return (await client.events.patch({
97
+ ...reference,
98
+ sendUpdates: input.sendUpdates,
99
+ conferenceDataVersion: input.createMeetLink ? 1 : undefined,
100
+ requestBody: body,
101
+ }, {
102
+ ...requestOptions(req),
103
+ headers: existing.etag ? { 'If-Match': existing.etag } : undefined,
104
+ })).data;
105
+ },
106
+ };
107
+ const attendeesInput = eventReference.extend({
108
+ attendees: z.array(z.email()).min(1),
109
+ sendUpdates: sendUpdates.optional(),
110
+ });
111
+ export const addAttendees = {
112
+ slug: 'addAttendees',
113
+ description: 'Append attendees to an event while retaining existing attendees and their RSVP details.',
114
+ input: attendeesInput,
115
+ output: eventOutput,
116
+ idempotent: false,
117
+ options: { calendarId: calendars('writer') },
118
+ async run({ client, input, req, }) {
119
+ const reference = { calendarId: input.calendarId, eventId: input.eventId };
120
+ const { data: existing } = await client.events.get(reference, requestOptions(req));
121
+ return (await client.events.patch({
122
+ ...reference,
123
+ sendUpdates: input.sendUpdates,
124
+ requestBody: {
125
+ attendees: [
126
+ ...(existing.attendees ?? []),
127
+ ...input.attendees.map((email) => ({ email })),
128
+ ],
129
+ },
130
+ }, {
131
+ ...requestOptions(req),
132
+ headers: existing.etag ? { 'If-Match': existing.etag } : undefined,
133
+ })).data;
134
+ },
135
+ };
136
+ const quickInput = z.object({
137
+ calendarId,
138
+ text: z.string().trim().min(1),
139
+ sendUpdates: sendUpdates.default('none'),
140
+ });
141
+ export const createQuickEvent = {
142
+ slug: 'createQuickEvent',
143
+ description: 'Create an event from a natural-language description using Google Calendar quick add.',
144
+ input: quickInput,
145
+ output: eventOutput,
146
+ idempotent: false,
147
+ options: { calendarId: calendars('writer') },
148
+ async run({ client, input, req, }) {
149
+ return (await client.events.quickAdd(input, requestOptions(req))).data;
150
+ },
151
+ };
152
+ const deleteInput = eventReference.extend({ sendUpdates: sendUpdates.optional() });
153
+ export const deleteEvent = {
154
+ slug: 'deleteEvent',
155
+ description: 'Delete an event, optionally notifying guests.',
156
+ input: deleteInput,
157
+ output: z.object({ deleted: z.literal(true) }),
158
+ idempotent: true,
159
+ options: { calendarId: calendars('writer') },
160
+ async run({ client, input, req, }) {
161
+ await client.events.delete(input, requestOptions(req));
162
+ return { deleted: true };
163
+ },
164
+ };
165
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/actions/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAuB,cAAc,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EACL,UAAU,EACV,QAAQ,EACR,WAAW,EACX,WAAW,EACX,cAAc,EACd,WAAW,EACX,UAAU,GACX,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,cAAc,CA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AC,CAAC,CAAC;QACvD,OAAO,EAAE,OAAO,EAAE,IAAa,EAAE,CAAC;IACpC,CAAC;CACF,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { FrogbotRequest } from 'frogbot';
2
+ import { type GoogleCalendar } from '../client.js';
3
+ type CalendarOptionsArgs = {
4
+ client: GoogleCalendar;
5
+ req: FrogbotRequest;
6
+ };
7
+ export declare const calendars: (minAccessRole?: "writer") => ({ client, req }: CalendarOptionsArgs) => Promise<{
8
+ label: string;
9
+ value: string;
10
+ }[]>;
11
+ export declare function colors({ client, req }: CalendarOptionsArgs): Promise<{
12
+ label: string;
13
+ value: string;
14
+ }[]>;
15
+ export {};
16
+ //# sourceMappingURL=options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/actions/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,OAAO,EAAE,KAAK,cAAc,EAAkB,MAAM,cAAc,CAAC;AAEnE,KAAK,mBAAmB,GAAG;IAAE,MAAM,EAAE,cAAc,CAAC;IAAC,GAAG,EAAE,cAAc,CAAA;CAAE,CAAC;AAE3E,eAAO,MAAM,SAAS,mBACH,QAAQ,uBACD,mBAAmB;WACX,MAAM;WAAS,MAAM;IAkBpD,CAAC;AAEJ,wBAAsB,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,mBAAmB;;;KAMhE"}
@@ -0,0 +1,26 @@
1
+ import { requestOptions } from '../client.js';
2
+ export const calendars = (minAccessRole) => async ({ client, req }) => {
3
+ const options = [];
4
+ let pageToken;
5
+ do {
6
+ const { data } = await client.calendarList.list({ maxResults: 250, minAccessRole, pageToken }, requestOptions(req));
7
+ for (const calendar of data.items ?? []) {
8
+ if (calendar.id) {
9
+ options.push({
10
+ label: calendar.summaryOverride ?? calendar.summary ?? calendar.id,
11
+ value: calendar.id,
12
+ });
13
+ }
14
+ }
15
+ pageToken = data.nextPageToken ?? undefined;
16
+ } while (pageToken);
17
+ return options;
18
+ };
19
+ export async function colors({ client, req }) {
20
+ const { data } = await client.colors.get({}, requestOptions(req));
21
+ return Object.entries(data.event ?? {}).map(([value, color]) => ({
22
+ label: color.background ?? value,
23
+ value,
24
+ }));
25
+ }
26
+ //# sourceMappingURL=options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/actions/options.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,cAAc,EAAE,MAAM,cAAc,CAAC;AAInE,MAAM,CAAC,MAAM,SAAS,GACpB,CAAC,aAAwB,EAAE,EAAE,CAC7B,KAAK,EAAE,EAAE,MAAM,EAAE,GAAG,EAAuB,EAAE,EAAE;IAC7C,MAAM,OAAO,GAA4C,EAAE,CAAC;IAC5D,IAAI,SAA6B,CAAC;IAClC,GAAG,CAAC;QACF,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,IAAI,CAC7C,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,EAAE,SAAS,EAAE,EAC7C,cAAc,CAAC,GAAG,CAAC,CACpB,CAAC;QACF,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC;YACxC,IAAI,QAAQ,CAAC,EAAE,EAAE,CAAC;gBAChB,OAAO,CAAC,IAAI,CAAC;oBACX,KAAK,EAAE,QAAQ,CAAC,eAAe,IAAI,QAAQ,CAAC,OAAO,IAAI,QAAQ,CAAC,EAAE;oBAClE,KAAK,EAAE,QAAQ,CAAC,EAAE;iBACnB,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QACD,SAAS,GAAG,IAAI,CAAC,aAAa,IAAI,SAAS,CAAC;IAC9C,CAAC,QAAQ,SAAS,EAAE;IACpB,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEJ,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,EAAE,MAAM,EA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