@automate.ax/integration-contracts 0.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/airtable/api.d.ts +19 -0
- package/dist/airtable/api.js +44 -0
- package/dist/airtable/index.d.ts +353 -0
- package/dist/airtable/index.js +32 -0
- package/dist/airtable/schemas.d.ts +716 -0
- package/dist/airtable/schemas.js +184 -0
- package/dist/asana/api.d.ts +70 -0
- package/dist/asana/api.js +119 -0
- package/dist/asana/index.d.ts +384 -0
- package/dist/asana/index.js +38 -0
- package/dist/asana/schemas.d.ts +1060 -0
- package/dist/asana/schemas.js +512 -0
- package/dist/brevo/api.d.ts +31 -0
- package/dist/brevo/api.js +64 -0
- package/dist/brevo/index.d.ts +822 -0
- package/dist/brevo/index.js +51 -0
- package/dist/brevo/schemas.d.ts +1217 -0
- package/dist/brevo/schemas.js +332 -0
- package/dist/github/index.d.ts +37 -0
- package/dist/github/index.js +106 -0
- package/dist/github/schemas.d.ts +8014 -0
- package/dist/github/schemas.js +113 -0
- package/dist/gmail/gmail.d.ts +172 -0
- package/dist/gmail/gmail.js +405 -0
- package/dist/gmail/index.d.ts +262 -0
- package/dist/gmail/index.js +23 -0
- package/dist/gmail/schemas.d.ts +444 -0
- package/dist/gmail/schemas.js +242 -0
- package/dist/google-calendar/event-schemas.d.ts +117 -0
- package/dist/google-calendar/event-schemas.js +13 -0
- package/dist/google-calendar/google-calendar.d.ts +147 -0
- package/dist/google-calendar/google-calendar.js +583 -0
- package/dist/google-calendar/index.d.ts +365 -0
- package/dist/google-calendar/index.js +24 -0
- package/dist/google-calendar/schemas.d.ts +592 -0
- package/dist/google-calendar/schemas.js +379 -0
- package/dist/google-forms/event-schemas.d.ts +105 -0
- package/dist/google-forms/event-schemas.js +20 -0
- package/dist/google-forms/google-forms.d.ts +243 -0
- package/dist/google-forms/google-forms.js +581 -0
- package/dist/google-forms/index.d.ts +141 -0
- package/dist/google-forms/index.js +20 -0
- package/dist/google-forms/schemas.d.ts +618 -0
- package/dist/google-forms/schemas.js +383 -0
- package/dist/linear/api.d.ts +63 -0
- package/dist/linear/api.js +88 -0
- package/dist/linear/index.d.ts +1338 -0
- package/dist/linear/index.js +55 -0
- package/dist/linear/schemas.d.ts +1795 -0
- package/dist/linear/schemas.js +760 -0
- package/dist/outlook/graph.d.ts +34 -0
- package/dist/outlook/graph.js +98 -0
- package/dist/outlook/index.d.ts +115 -0
- package/dist/outlook/index.js +11 -0
- package/dist/outlook/schemas.d.ts +529 -0
- package/dist/outlook/schemas.js +312 -0
- package/dist/resend/index.d.ts +707 -0
- package/dist/resend/index.js +54 -0
- package/dist/resend/schemas.d.ts +1033 -0
- package/dist/resend/schemas.js +377 -0
- package/dist/slack/index.d.ts +151 -0
- package/dist/slack/index.js +22 -0
- package/dist/slack/schemas.d.ts +641 -0
- package/dist/slack/schemas.js +581 -0
- package/dist/teams/graph.d.ts +33 -0
- package/dist/teams/graph.js +95 -0
- package/dist/teams/index.d.ts +164 -0
- package/dist/teams/index.js +21 -0
- package/dist/teams/schemas.d.ts +675 -0
- package/dist/teams/schemas.js +365 -0
- package/dist/trello/api.d.ts +69 -0
- package/dist/trello/api.js +140 -0
- package/dist/trello/event-schemas.d.ts +1101 -0
- package/dist/trello/event-schemas.js +233 -0
- package/dist/trello/index.d.ts +721 -0
- package/dist/trello/index.js +35 -0
- package/dist/trello/schemas.d.ts +283 -0
- package/dist/trello/schemas.js +401 -0
- package/dist/triggers.d.ts +26 -0
- package/dist/triggers.js +33 -0
- package/dist/vercel/index.d.ts +1065 -0
- package/dist/vercel/index.js +114 -0
- package/dist/vercel/schemas.d.ts +1518 -0
- package/dist/vercel/schemas.js +335 -0
- package/dist/whatsapp/api.d.ts +62 -0
- package/dist/whatsapp/api.js +121 -0
- package/dist/whatsapp/index.d.ts +614 -0
- package/dist/whatsapp/index.js +35 -0
- package/dist/whatsapp/schemas.d.ts +926 -0
- package/dist/whatsapp/schemas.js +326 -0
- package/package.json +169 -0
- package/src/airtable/api.ts +66 -0
- package/src/airtable/index.ts +41 -0
- package/src/airtable/schemas.ts +231 -0
- package/src/asana/api.ts +171 -0
- package/src/asana/index.ts +49 -0
- package/src/asana/schemas.ts +655 -0
- package/src/brevo/api.ts +89 -0
- package/src/brevo/index.ts +66 -0
- package/src/brevo/schemas.ts +449 -0
- package/src/github/index.ts +217 -0
- package/src/github/schemas.ts +435 -0
- package/src/gmail/gmail.ts +577 -0
- package/src/gmail/index.ts +26 -0
- package/src/gmail/schemas.ts +327 -0
- package/src/google-calendar/event-schemas.ts +16 -0
- package/src/google-calendar/google-calendar.ts +727 -0
- package/src/google-calendar/index.ts +27 -0
- package/src/google-calendar/schemas.ts +529 -0
- package/src/google-forms/event-schemas.ts +26 -0
- package/src/google-forms/google-forms.ts +683 -0
- package/src/google-forms/index.ts +23 -0
- package/src/google-forms/schemas.ts +499 -0
- package/src/linear/api.ts +141 -0
- package/src/linear/index.ts +71 -0
- package/src/linear/schemas.ts +1060 -0
- package/src/outlook/graph.ts +132 -0
- package/src/outlook/index.ts +14 -0
- package/src/outlook/schemas.ts +388 -0
- package/src/resend/index.ts +70 -0
- package/src/resend/schemas.ts +462 -0
- package/src/slack/index.ts +29 -0
- package/src/slack/schemas.ts +737 -0
- package/src/teams/graph.ts +130 -0
- package/src/teams/index.ts +27 -0
- package/src/teams/schemas.ts +463 -0
- package/src/trello/api.ts +190 -0
- package/src/trello/event-schemas.ts +290 -0
- package/src/trello/index.ts +45 -0
- package/src/trello/schemas.ts +507 -0
- package/src/triggers.ts +68 -0
- package/src/vercel/index.ts +147 -0
- package/src/vercel/schemas.ts +594 -0
- package/src/whatsapp/api.ts +171 -0
- package/src/whatsapp/index.ts +46 -0
- package/src/whatsapp/schemas.ts +341 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from "zod"
|
|
2
|
+
import { GOOGLE_CALENDAR_EVENT_DELETED_SCHEMA } from "./event-schemas"
|
|
3
|
+
import { CALENDAR_EVENT_SCHEMA } from "./schemas"
|
|
4
|
+
|
|
5
|
+
export * from "./event-schemas"
|
|
6
|
+
export * from "./google-calendar"
|
|
7
|
+
export * from "./schemas"
|
|
8
|
+
|
|
9
|
+
/** Canonical Google Calendar collection selected by one subscription. */
|
|
10
|
+
export const GOOGLE_CALENDAR_TRIGGER_CONFIG_SCHEMA = z.object({
|
|
11
|
+
calendarId: z.string(),
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
export const googleCalendarTriggerContracts = {
|
|
15
|
+
"googleCalendar.event.created": {
|
|
16
|
+
configSchema: GOOGLE_CALENDAR_TRIGGER_CONFIG_SCHEMA,
|
|
17
|
+
eventSchema: CALENDAR_EVENT_SCHEMA,
|
|
18
|
+
},
|
|
19
|
+
"googleCalendar.event.deleted": {
|
|
20
|
+
configSchema: GOOGLE_CALENDAR_TRIGGER_CONFIG_SCHEMA,
|
|
21
|
+
eventSchema: GOOGLE_CALENDAR_EVENT_DELETED_SCHEMA,
|
|
22
|
+
},
|
|
23
|
+
"googleCalendar.event.updated": {
|
|
24
|
+
configSchema: GOOGLE_CALENDAR_TRIGGER_CONFIG_SCHEMA,
|
|
25
|
+
eventSchema: CALENDAR_EVENT_SCHEMA,
|
|
26
|
+
},
|
|
27
|
+
} as const
|
|
@@ -0,0 +1,529 @@
|
|
|
1
|
+
import { z } from "zod"
|
|
2
|
+
|
|
3
|
+
export const CALENDAR_REFERENCE_SCHEMA = z.string().trim().min(1)
|
|
4
|
+
export const EVENT_REFERENCE_SCHEMA = z.string().trim().min(1)
|
|
5
|
+
export const RFC3339_SCHEMA = z.iso.datetime({ offset: true })
|
|
6
|
+
export const DATE_SCHEMA = z.iso.date()
|
|
7
|
+
export const SEND_UPDATES_SCHEMA = z.enum(["all", "externalOnly", "none"])
|
|
8
|
+
export const EVENT_STATUS_SCHEMA = z.enum([
|
|
9
|
+
"confirmed",
|
|
10
|
+
"tentative",
|
|
11
|
+
"cancelled",
|
|
12
|
+
])
|
|
13
|
+
export const RESPONSE_STATUS_SCHEMA = z.enum([
|
|
14
|
+
"needsAction",
|
|
15
|
+
"declined",
|
|
16
|
+
"tentative",
|
|
17
|
+
"accepted",
|
|
18
|
+
])
|
|
19
|
+
|
|
20
|
+
export const EVENT_TIME_SCHEMA = z.object({
|
|
21
|
+
/** All-day calendar date, when this is an all-day event. */
|
|
22
|
+
date: DATE_SCHEMA.optional(),
|
|
23
|
+
|
|
24
|
+
/** RFC 3339 instant, when this is a timed event. */
|
|
25
|
+
dateTime: z.string().optional(),
|
|
26
|
+
|
|
27
|
+
/** IANA timezone associated with the date-time. */
|
|
28
|
+
timeZone: z.string().optional(),
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
export const EVENT_SCHEDULE_INPUT_SCHEMA = z.union([
|
|
32
|
+
z
|
|
33
|
+
.object({
|
|
34
|
+
/** Inclusive all-day start date. */
|
|
35
|
+
startDate: DATE_SCHEMA,
|
|
36
|
+
|
|
37
|
+
/** Exclusive all-day end date. Defaults to the next day. */
|
|
38
|
+
endDate: DATE_SCHEMA.optional(),
|
|
39
|
+
})
|
|
40
|
+
.refine(
|
|
41
|
+
({ endDate, startDate }) => !endDate || endDate > startDate,
|
|
42
|
+
"The all-day end date must follow the start date.",
|
|
43
|
+
),
|
|
44
|
+
z
|
|
45
|
+
.object({
|
|
46
|
+
/** Exclusive RFC 3339 ending instant. */
|
|
47
|
+
end: RFC3339_SCHEMA,
|
|
48
|
+
|
|
49
|
+
/** Inclusive RFC 3339 starting instant. */
|
|
50
|
+
start: RFC3339_SCHEMA,
|
|
51
|
+
|
|
52
|
+
/** IANA timezone used to expand recurrence rules. */
|
|
53
|
+
timeZone: z.string().min(1).optional(),
|
|
54
|
+
})
|
|
55
|
+
.refine(
|
|
56
|
+
({ end, start }) => new Date(end).getTime() > new Date(start).getTime(),
|
|
57
|
+
"The event end must follow its start.",
|
|
58
|
+
),
|
|
59
|
+
])
|
|
60
|
+
|
|
61
|
+
export const EVENT_PRINCIPAL_SCHEMA = z.object({
|
|
62
|
+
/** Human-readable name. */
|
|
63
|
+
displayName: z.string().optional(),
|
|
64
|
+
|
|
65
|
+
/** Email address, when available. */
|
|
66
|
+
email: z.string().optional(),
|
|
67
|
+
|
|
68
|
+
/** Whether this principal is the authenticated user. */
|
|
69
|
+
self: z.boolean(),
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
export const EVENT_ATTENDEE_INPUT_SCHEMA = z.object({
|
|
73
|
+
/** Number of guests accompanying the attendee. */
|
|
74
|
+
additionalGuests: z.number().int().nonnegative().optional(),
|
|
75
|
+
|
|
76
|
+
/** Optional invitation response comment. */
|
|
77
|
+
comment: z.string().optional(),
|
|
78
|
+
|
|
79
|
+
/** Attendee email address. */
|
|
80
|
+
email: z.email(),
|
|
81
|
+
|
|
82
|
+
/** Human-readable attendee name. */
|
|
83
|
+
displayName: z.string().optional(),
|
|
84
|
+
|
|
85
|
+
/** Whether attendance is optional. */
|
|
86
|
+
optional: z.boolean().optional(),
|
|
87
|
+
|
|
88
|
+
/** Whether this attendee represents a room or other resource. */
|
|
89
|
+
resource: z.boolean().optional(),
|
|
90
|
+
|
|
91
|
+
/** Initial invitation response. */
|
|
92
|
+
responseStatus: RESPONSE_STATUS_SCHEMA.optional(),
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
export const EVENT_ATTENDEE_SCHEMA = EVENT_ATTENDEE_INPUT_SCHEMA.extend({
|
|
96
|
+
/** Whether this attendee organized the event. */
|
|
97
|
+
organizer: z.boolean(),
|
|
98
|
+
|
|
99
|
+
/** Whether this attendee is the authenticated user. */
|
|
100
|
+
self: z.boolean(),
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
export const EVENT_ATTACHMENT_INPUT_SCHEMA = z.object({
|
|
104
|
+
/** Google Drive file ID, when applicable. */
|
|
105
|
+
fileId: z.string().min(1).optional(),
|
|
106
|
+
|
|
107
|
+
/** Public or authenticated URL to the attachment. */
|
|
108
|
+
fileUrl: z.url(),
|
|
109
|
+
|
|
110
|
+
/** Attachment media type. */
|
|
111
|
+
mimeType: z.string().min(1).optional(),
|
|
112
|
+
|
|
113
|
+
/** Human-readable attachment title. */
|
|
114
|
+
title: z.string().optional(),
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
export const EVENT_ATTACHMENT_SCHEMA = EVENT_ATTACHMENT_INPUT_SCHEMA.extend({
|
|
118
|
+
/** Provider icon URL. */
|
|
119
|
+
iconLink: z.string().optional(),
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
export const EVENT_REMINDER_SCHEMA = z.object({
|
|
123
|
+
/** Number of minutes before the event. */
|
|
124
|
+
minutes: z.number().int().nonnegative(),
|
|
125
|
+
|
|
126
|
+
/** Reminder delivery method. */
|
|
127
|
+
method: z.enum(["email", "popup"]),
|
|
128
|
+
})
|
|
129
|
+
|
|
130
|
+
export const EVENT_REMINDERS_INPUT_SCHEMA = z.union([
|
|
131
|
+
z.object({
|
|
132
|
+
/** Use the calendar's default reminder configuration. */
|
|
133
|
+
useDefault: z.literal(true),
|
|
134
|
+
}),
|
|
135
|
+
z.object({
|
|
136
|
+
/** Event-specific reminders, including an empty array for no reminders. */
|
|
137
|
+
overrides: EVENT_REMINDER_SCHEMA.array().max(5),
|
|
138
|
+
|
|
139
|
+
/** Use event-specific reminders. */
|
|
140
|
+
useDefault: z.literal(false),
|
|
141
|
+
}),
|
|
142
|
+
])
|
|
143
|
+
|
|
144
|
+
export const EVENT_DETAILS_INPUT_SCHEMA = z.object({
|
|
145
|
+
/** Event attachments. Google Drive attachment URLs are supported. */
|
|
146
|
+
attachments: EVENT_ATTACHMENT_INPUT_SCHEMA.array().max(25).optional(),
|
|
147
|
+
|
|
148
|
+
/** People and resources invited to the event. */
|
|
149
|
+
attendees: EVENT_ATTENDEE_INPUT_SCHEMA.array().optional(),
|
|
150
|
+
|
|
151
|
+
/** Calendar event color ID. */
|
|
152
|
+
colorId: z.string().min(1).optional(),
|
|
153
|
+
|
|
154
|
+
/** Description, which may contain HTML. */
|
|
155
|
+
description: z.string().optional(),
|
|
156
|
+
|
|
157
|
+
/** Application-defined properties. */
|
|
158
|
+
extendedProperties: z
|
|
159
|
+
.object({
|
|
160
|
+
private: z.record(z.string(), z.string()).optional(),
|
|
161
|
+
shared: z.record(z.string(), z.string()).optional(),
|
|
162
|
+
})
|
|
163
|
+
.optional(),
|
|
164
|
+
|
|
165
|
+
/** Whether attendees may invite other people. */
|
|
166
|
+
guestsCanInviteOthers: z.boolean().optional(),
|
|
167
|
+
|
|
168
|
+
/** Whether attendees may modify the event. */
|
|
169
|
+
guestsCanModify: z.boolean().optional(),
|
|
170
|
+
|
|
171
|
+
/** Whether attendees may see one another. */
|
|
172
|
+
guestsCanSeeOtherGuests: z.boolean().optional(),
|
|
173
|
+
|
|
174
|
+
/** Free-form event location. */
|
|
175
|
+
location: z.string().optional(),
|
|
176
|
+
|
|
177
|
+
/** RFC 5545 recurrence lines such as `RRULE:FREQ=WEEKLY;BYDAY=MO`. */
|
|
178
|
+
recurrence: z.string().min(1).array().optional(),
|
|
179
|
+
|
|
180
|
+
/** Event reminder behavior. */
|
|
181
|
+
reminders: EVENT_REMINDERS_INPUT_SCHEMA.optional(),
|
|
182
|
+
|
|
183
|
+
/** Timed or all-day event schedule. */
|
|
184
|
+
schedule: EVENT_SCHEDULE_INPUT_SCHEMA.optional(),
|
|
185
|
+
|
|
186
|
+
/** Human-readable event title. */
|
|
187
|
+
summary: z.string().trim().min(1).optional(),
|
|
188
|
+
|
|
189
|
+
/** Whether the event blocks time. */
|
|
190
|
+
transparency: z.enum(["opaque", "transparent"]).optional(),
|
|
191
|
+
|
|
192
|
+
/** Event visibility. */
|
|
193
|
+
visibility: z
|
|
194
|
+
.enum(["default", "public", "private", "confidential"])
|
|
195
|
+
.optional(),
|
|
196
|
+
})
|
|
197
|
+
|
|
198
|
+
export const EVENT_CONFERENCE_SCHEMA = z.object({
|
|
199
|
+
/** Provider conference identifier. */
|
|
200
|
+
conferenceId: z.string().optional(),
|
|
201
|
+
|
|
202
|
+
/** Current asynchronous creation status. */
|
|
203
|
+
creationStatus: z.enum(["pending", "success", "failure"]).optional(),
|
|
204
|
+
|
|
205
|
+
/** Conference entry points such as video, phone, or SIP. */
|
|
206
|
+
entryPoints: z
|
|
207
|
+
.object({
|
|
208
|
+
/** Human-readable entry-point label. */
|
|
209
|
+
label: z.string().optional(),
|
|
210
|
+
|
|
211
|
+
/** PIN or passcode, when applicable. */
|
|
212
|
+
passcode: z.string().optional(),
|
|
213
|
+
|
|
214
|
+
/** Entry-point type. */
|
|
215
|
+
type: z.string(),
|
|
216
|
+
|
|
217
|
+
/** Join URI. */
|
|
218
|
+
uri: z.string(),
|
|
219
|
+
})
|
|
220
|
+
.array(),
|
|
221
|
+
|
|
222
|
+
/** Human-readable conference solution name. */
|
|
223
|
+
name: z.string().optional(),
|
|
224
|
+
})
|
|
225
|
+
|
|
226
|
+
export const EXTENDED_PROPERTIES_SCHEMA = z.object({
|
|
227
|
+
/** Properties private to this calendar copy of the event. */
|
|
228
|
+
private: z.record(z.string(), z.string()),
|
|
229
|
+
|
|
230
|
+
/** Properties shared between attendee copies of the event. */
|
|
231
|
+
shared: z.record(z.string(), z.string()),
|
|
232
|
+
})
|
|
233
|
+
|
|
234
|
+
export const CALENDAR_EVENT_SCHEMA = z.object({
|
|
235
|
+
/** Event attachments. */
|
|
236
|
+
attachments: EVENT_ATTACHMENT_SCHEMA.array(),
|
|
237
|
+
|
|
238
|
+
/** Invited people and resources. */
|
|
239
|
+
attendees: EVENT_ATTENDEE_SCHEMA.array(),
|
|
240
|
+
|
|
241
|
+
/** Calendar from which this representation was read. */
|
|
242
|
+
calendarId: z.string(),
|
|
243
|
+
|
|
244
|
+
/** Calendar color palette identifier. */
|
|
245
|
+
colorId: z.string().optional(),
|
|
246
|
+
|
|
247
|
+
/** Conference connection details. */
|
|
248
|
+
conference: EVENT_CONFERENCE_SCHEMA.optional(),
|
|
249
|
+
|
|
250
|
+
/** Event creation timestamp. */
|
|
251
|
+
createdAt: z.string().optional(),
|
|
252
|
+
|
|
253
|
+
/** Event creator. */
|
|
254
|
+
creator: EVENT_PRINCIPAL_SCHEMA.optional(),
|
|
255
|
+
|
|
256
|
+
/** Description, which may contain HTML. */
|
|
257
|
+
description: z.string().optional(),
|
|
258
|
+
|
|
259
|
+
/** Exclusive event end. Omitted on deleted synchronization tombstones. */
|
|
260
|
+
end: EVENT_TIME_SCHEMA.optional(),
|
|
261
|
+
|
|
262
|
+
/** Application-defined properties. */
|
|
263
|
+
extendedProperties: EXTENDED_PROPERTIES_SCHEMA,
|
|
264
|
+
|
|
265
|
+
/** Whether attendees may invite other people. */
|
|
266
|
+
guestsCanInviteOthers: z.boolean(),
|
|
267
|
+
|
|
268
|
+
/** Whether attendees may modify the event. */
|
|
269
|
+
guestsCanModify: z.boolean(),
|
|
270
|
+
|
|
271
|
+
/** Whether attendees may see one another. */
|
|
272
|
+
guestsCanSeeOtherGuests: z.boolean(),
|
|
273
|
+
|
|
274
|
+
/** Google Meet or other primary conference URL. */
|
|
275
|
+
hangoutLink: z.string().optional(),
|
|
276
|
+
|
|
277
|
+
/** Browser URL for this event. */
|
|
278
|
+
htmlLink: z.string().optional(),
|
|
279
|
+
|
|
280
|
+
/** Immutable provider event ID. */
|
|
281
|
+
id: z.string(),
|
|
282
|
+
|
|
283
|
+
/** Cross-calendar iCalendar UID. */
|
|
284
|
+
iCalUID: z.string().optional(),
|
|
285
|
+
|
|
286
|
+
/** Free-form event location. */
|
|
287
|
+
location: z.string().optional(),
|
|
288
|
+
|
|
289
|
+
/** Original scheduled start for a recurring instance. */
|
|
290
|
+
originalStart: EVENT_TIME_SCHEMA.optional(),
|
|
291
|
+
|
|
292
|
+
/** Event organizer. */
|
|
293
|
+
organizer: EVENT_PRINCIPAL_SCHEMA.optional(),
|
|
294
|
+
|
|
295
|
+
/** Recurrence lines using RFC 5545 syntax. */
|
|
296
|
+
recurrence: z.string().array(),
|
|
297
|
+
|
|
298
|
+
/** Parent recurring event ID for an expanded instance. */
|
|
299
|
+
recurringEventId: z.string().optional(),
|
|
300
|
+
|
|
301
|
+
/** Effective reminder configuration. */
|
|
302
|
+
reminders: z.object({
|
|
303
|
+
overrides: EVENT_REMINDER_SCHEMA.array(),
|
|
304
|
+
useDefault: z.boolean(),
|
|
305
|
+
}),
|
|
306
|
+
|
|
307
|
+
/** Event revision sequence. */
|
|
308
|
+
sequence: z.number().int().nonnegative(),
|
|
309
|
+
|
|
310
|
+
/** Inclusive event start. Omitted on deleted synchronization tombstones. */
|
|
311
|
+
start: EVENT_TIME_SCHEMA.optional(),
|
|
312
|
+
|
|
313
|
+
/** Event lifecycle status. */
|
|
314
|
+
status: EVENT_STATUS_SCHEMA,
|
|
315
|
+
|
|
316
|
+
/** Human-readable event title. */
|
|
317
|
+
summary: z.string(),
|
|
318
|
+
|
|
319
|
+
/** Whether the event blocks time. */
|
|
320
|
+
transparency: z.enum(["opaque", "transparent"]),
|
|
321
|
+
|
|
322
|
+
/** Provider event type. */
|
|
323
|
+
type: z.string(),
|
|
324
|
+
|
|
325
|
+
/** Last update timestamp. */
|
|
326
|
+
updatedAt: z.string().optional(),
|
|
327
|
+
|
|
328
|
+
/** Event visibility. */
|
|
329
|
+
visibility: z.enum(["default", "public", "private", "confidential"]),
|
|
330
|
+
})
|
|
331
|
+
|
|
332
|
+
export const EVENT_PAGE_SCHEMA = z.object({
|
|
333
|
+
/** Matching events. */
|
|
334
|
+
events: CALENDAR_EVENT_SCHEMA.array(),
|
|
335
|
+
|
|
336
|
+
/** Token for fetching the next page. */
|
|
337
|
+
nextPageToken: z.string().optional(),
|
|
338
|
+
|
|
339
|
+
/** Token for a future incremental synchronization. */
|
|
340
|
+
nextSyncToken: z.string().optional(),
|
|
341
|
+
|
|
342
|
+
/** Calendar timezone returned by Google. */
|
|
343
|
+
timeZone: z.string().optional(),
|
|
344
|
+
|
|
345
|
+
/** Last modification time of the calendar. */
|
|
346
|
+
updatedAt: z.string().optional(),
|
|
347
|
+
})
|
|
348
|
+
|
|
349
|
+
export const REMINDER_SCHEMA = z.object({
|
|
350
|
+
/** Number of minutes before an event. */
|
|
351
|
+
minutes: z.number().int().nonnegative(),
|
|
352
|
+
|
|
353
|
+
/** Reminder delivery method. */
|
|
354
|
+
method: z.string(),
|
|
355
|
+
})
|
|
356
|
+
|
|
357
|
+
export const CALENDAR_NOTIFICATION_SCHEMA = z.object({
|
|
358
|
+
/** Email notification category. */
|
|
359
|
+
type: z.enum([
|
|
360
|
+
"eventCreation",
|
|
361
|
+
"eventChange",
|
|
362
|
+
"eventCancellation",
|
|
363
|
+
"eventResponse",
|
|
364
|
+
"agenda",
|
|
365
|
+
]),
|
|
366
|
+
})
|
|
367
|
+
|
|
368
|
+
export const CALENDAR_SCHEMA = z.object({
|
|
369
|
+
/** Access role of the authenticated user. */
|
|
370
|
+
accessRole: z.string().optional(),
|
|
371
|
+
|
|
372
|
+
/** Whether a resource calendar automatically accepts invitations. */
|
|
373
|
+
autoAcceptInvitations: z.boolean(),
|
|
374
|
+
|
|
375
|
+
/** Calendar background color. */
|
|
376
|
+
backgroundColor: z.string().optional(),
|
|
377
|
+
|
|
378
|
+
/** Calendar color palette identifier. */
|
|
379
|
+
colorId: z.string().optional(),
|
|
380
|
+
|
|
381
|
+
/** Conference solution types allowed on this calendar. */
|
|
382
|
+
conferenceSolutionTypes: z.string().array(),
|
|
383
|
+
|
|
384
|
+
/** Default event reminders. */
|
|
385
|
+
defaultReminders: REMINDER_SCHEMA.array(),
|
|
386
|
+
|
|
387
|
+
/** Owner email for a secondary calendar. */
|
|
388
|
+
dataOwner: z.string().optional(),
|
|
389
|
+
|
|
390
|
+
/** Whether this calendar-list entry was deleted. */
|
|
391
|
+
deleted: z.boolean(),
|
|
392
|
+
|
|
393
|
+
/** Human-readable calendar description. */
|
|
394
|
+
description: z.string().optional(),
|
|
395
|
+
|
|
396
|
+
/** Calendar foreground color. */
|
|
397
|
+
foregroundColor: z.string().optional(),
|
|
398
|
+
|
|
399
|
+
/** Whether this calendar is hidden from the list. */
|
|
400
|
+
hidden: z.boolean(),
|
|
401
|
+
|
|
402
|
+
/** Immutable calendar identifier. */
|
|
403
|
+
id: z.string(),
|
|
404
|
+
|
|
405
|
+
/** Free-form calendar location. */
|
|
406
|
+
location: z.string().optional(),
|
|
407
|
+
|
|
408
|
+
/** Email notifications configured for this calendar. */
|
|
409
|
+
notifications: CALENDAR_NOTIFICATION_SCHEMA.array(),
|
|
410
|
+
|
|
411
|
+
/** Whether this is the authenticated user's primary calendar. */
|
|
412
|
+
primary: z.boolean(),
|
|
413
|
+
|
|
414
|
+
/** Whether events appear in the Google Calendar UI. */
|
|
415
|
+
selected: z.boolean(),
|
|
416
|
+
|
|
417
|
+
/** Human-readable calendar title. */
|
|
418
|
+
summary: z.string(),
|
|
419
|
+
|
|
420
|
+
/** User-specific title override. */
|
|
421
|
+
summaryOverride: z.string().optional(),
|
|
422
|
+
|
|
423
|
+
/** IANA calendar timezone. */
|
|
424
|
+
timeZone: z.string().optional(),
|
|
425
|
+
})
|
|
426
|
+
|
|
427
|
+
export const CALENDAR_PAGE_SCHEMA = z.object({
|
|
428
|
+
/** Visible calendars. */
|
|
429
|
+
calendars: CALENDAR_SCHEMA.array(),
|
|
430
|
+
|
|
431
|
+
/** Token for fetching the next page. */
|
|
432
|
+
nextPageToken: z.string().optional(),
|
|
433
|
+
|
|
434
|
+
/** Token for a future incremental synchronization. */
|
|
435
|
+
nextSyncToken: z.string().optional(),
|
|
436
|
+
})
|
|
437
|
+
|
|
438
|
+
export const BUSY_PERIOD_SCHEMA = z.object({
|
|
439
|
+
/** Exclusive busy-period end. */
|
|
440
|
+
end: z.string(),
|
|
441
|
+
|
|
442
|
+
/** Inclusive busy-period start. */
|
|
443
|
+
start: z.string(),
|
|
444
|
+
})
|
|
445
|
+
|
|
446
|
+
export const FREE_BUSY_CALENDAR_SCHEMA = z.object({
|
|
447
|
+
/** Busy periods for the calendar. */
|
|
448
|
+
busy: BUSY_PERIOD_SCHEMA.array(),
|
|
449
|
+
|
|
450
|
+
/** Calendar identifier. */
|
|
451
|
+
calendarId: z.string(),
|
|
452
|
+
|
|
453
|
+
/** Provider errors encountered for this calendar. */
|
|
454
|
+
errors: z
|
|
455
|
+
.object({
|
|
456
|
+
domain: z.string().optional(),
|
|
457
|
+
reason: z.string().optional(),
|
|
458
|
+
})
|
|
459
|
+
.array(),
|
|
460
|
+
})
|
|
461
|
+
|
|
462
|
+
export const FREE_BUSY_SCHEMA = z.object({
|
|
463
|
+
/** Per-calendar free/busy results. */
|
|
464
|
+
calendars: FREE_BUSY_CALENDAR_SCHEMA.array(),
|
|
465
|
+
|
|
466
|
+
/** Exclusive query end. */
|
|
467
|
+
timeMax: z.string(),
|
|
468
|
+
|
|
469
|
+
/** Inclusive query start. */
|
|
470
|
+
timeMin: z.string(),
|
|
471
|
+
})
|
|
472
|
+
|
|
473
|
+
export const AVAILABILITY_SLOT_SCHEMA = BUSY_PERIOD_SCHEMA.extend({
|
|
474
|
+
/** Slot duration in minutes. */
|
|
475
|
+
durationMinutes: z.number().int().positive(),
|
|
476
|
+
})
|
|
477
|
+
|
|
478
|
+
export const COLOR_PALETTE_SCHEMA = z.object({
|
|
479
|
+
/** Calendar color definitions keyed by color ID. */
|
|
480
|
+
calendars: z.record(
|
|
481
|
+
z.string(),
|
|
482
|
+
z.object({ background: z.string(), foreground: z.string() }),
|
|
483
|
+
),
|
|
484
|
+
|
|
485
|
+
/** Event color definitions keyed by color ID. */
|
|
486
|
+
events: z.record(
|
|
487
|
+
z.string(),
|
|
488
|
+
z.object({ background: z.string(), foreground: z.string() }),
|
|
489
|
+
),
|
|
490
|
+
|
|
491
|
+
/** Palette update timestamp. */
|
|
492
|
+
updatedAt: z.string().optional(),
|
|
493
|
+
})
|
|
494
|
+
|
|
495
|
+
export const ACL_SCOPE_SCHEMA = z
|
|
496
|
+
.object({
|
|
497
|
+
/** ACL scope type. */
|
|
498
|
+
type: z.enum(["default", "user", "group", "domain"]),
|
|
499
|
+
|
|
500
|
+
/** Email address or domain. Omitted for the default public scope. */
|
|
501
|
+
value: z.string().min(1).optional(),
|
|
502
|
+
})
|
|
503
|
+
.refine(
|
|
504
|
+
({ type, value }) =>
|
|
505
|
+
type === "default" ? value === undefined : value !== undefined,
|
|
506
|
+
"User, group, and domain scopes require a value; default scope does not.",
|
|
507
|
+
)
|
|
508
|
+
|
|
509
|
+
export const ACL_RULE_SCHEMA = z.object({
|
|
510
|
+
/** Immutable ACL rule identifier. */
|
|
511
|
+
id: z.string(),
|
|
512
|
+
|
|
513
|
+
/** Permission role. */
|
|
514
|
+
role: z.enum(["none", "freeBusyReader", "reader", "writer", "owner"]),
|
|
515
|
+
|
|
516
|
+
/** Principal or public scope receiving access. */
|
|
517
|
+
scope: ACL_SCOPE_SCHEMA,
|
|
518
|
+
})
|
|
519
|
+
|
|
520
|
+
export const ACL_PAGE_SCHEMA = z.object({
|
|
521
|
+
/** Access rules. */
|
|
522
|
+
rules: ACL_RULE_SCHEMA.array(),
|
|
523
|
+
|
|
524
|
+
/** Token for fetching the next page. */
|
|
525
|
+
nextPageToken: z.string().optional(),
|
|
526
|
+
|
|
527
|
+
/** Token for a future incremental synchronization. */
|
|
528
|
+
nextSyncToken: z.string().optional(),
|
|
529
|
+
})
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FORM_SCHEMA } from "./schemas"
|
|
2
|
+
import { z } from "zod"
|
|
3
|
+
|
|
4
|
+
export const GOOGLE_FORMS_NOTIFICATION_SCHEMA = z.object({
|
|
5
|
+
/** Provider event category that caused the notification. */
|
|
6
|
+
eventType: z.enum(["SCHEMA", "RESPONSES"]),
|
|
7
|
+
|
|
8
|
+
/** Google Form that changed. */
|
|
9
|
+
formId: z.string(),
|
|
10
|
+
|
|
11
|
+
/** Pub/Sub message identifier. */
|
|
12
|
+
messageId: z.string(),
|
|
13
|
+
|
|
14
|
+
/** Pub/Sub publication timestamp. */
|
|
15
|
+
publishTime: z.string(),
|
|
16
|
+
|
|
17
|
+
/** Google Forms watch that produced the notification. */
|
|
18
|
+
watchId: z.string(),
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
export const GOOGLE_FORMS_FORM_CHANGED_EVENT_SCHEMA = FORM_SCHEMA.extend({
|
|
22
|
+
/** Original provider notification metadata. */
|
|
23
|
+
event: GOOGLE_FORMS_NOTIFICATION_SCHEMA.extend({
|
|
24
|
+
eventType: z.literal("SCHEMA"),
|
|
25
|
+
}),
|
|
26
|
+
})
|