@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,594 @@
|
|
|
1
|
+
import { z } from "zod"
|
|
2
|
+
|
|
3
|
+
export const VERCEL_DEPLOYMENT_EVENT_TYPES = [
|
|
4
|
+
"deployment.created",
|
|
5
|
+
"deployment.ready",
|
|
6
|
+
"deployment.succeeded",
|
|
7
|
+
"deployment.error",
|
|
8
|
+
"deployment.canceled",
|
|
9
|
+
"deployment.promoted",
|
|
10
|
+
] as const
|
|
11
|
+
|
|
12
|
+
export const VERCEL_PROJECT_EVENT_TYPES = [
|
|
13
|
+
"project.created",
|
|
14
|
+
"project.removed",
|
|
15
|
+
"project.renamed",
|
|
16
|
+
] as const
|
|
17
|
+
|
|
18
|
+
export const VERCEL_PROJECT_ENVIRONMENT_VARIABLE_EVENT_TYPES = [
|
|
19
|
+
"project.env-variable.created",
|
|
20
|
+
"project.env-variable.updated",
|
|
21
|
+
"project.env-variable.deleted",
|
|
22
|
+
] as const
|
|
23
|
+
|
|
24
|
+
export const VERCEL_PROJECT_DOMAIN_EVENT_TYPES = [
|
|
25
|
+
"project.domain.created",
|
|
26
|
+
"project.domain.updated",
|
|
27
|
+
"project.domain.deleted",
|
|
28
|
+
"project.domain.verified",
|
|
29
|
+
"project.domain.unverified",
|
|
30
|
+
"project.domain.moved",
|
|
31
|
+
] as const
|
|
32
|
+
|
|
33
|
+
export const VERCEL_INTEGRATION_CONFIGURATION_EVENT_TYPES = [
|
|
34
|
+
"integration-configuration.permission-upgraded",
|
|
35
|
+
"integration-configuration.removed",
|
|
36
|
+
"integration-configuration.scope-change-confirmed",
|
|
37
|
+
"integration-configuration.transferred",
|
|
38
|
+
] as const
|
|
39
|
+
|
|
40
|
+
export const VERCEL_WEBHOOK_EVENT_TYPES = [
|
|
41
|
+
...VERCEL_DEPLOYMENT_EVENT_TYPES,
|
|
42
|
+
...VERCEL_PROJECT_EVENT_TYPES,
|
|
43
|
+
...VERCEL_PROJECT_ENVIRONMENT_VARIABLE_EVENT_TYPES,
|
|
44
|
+
...VERCEL_PROJECT_DOMAIN_EVENT_TYPES,
|
|
45
|
+
...VERCEL_INTEGRATION_CONFIGURATION_EVENT_TYPES,
|
|
46
|
+
] as const
|
|
47
|
+
|
|
48
|
+
const VERCEL_TEAM_ACTOR_SCHEMA = z
|
|
49
|
+
.looseObject({
|
|
50
|
+
/** Stable Vercel team ID. */
|
|
51
|
+
id: z.string(),
|
|
52
|
+
})
|
|
53
|
+
.catchall(z.json())
|
|
54
|
+
|
|
55
|
+
const VERCEL_USER_ACTOR_SCHEMA = z
|
|
56
|
+
.looseObject({
|
|
57
|
+
/** Stable Vercel user ID. */
|
|
58
|
+
id: z.string(),
|
|
59
|
+
})
|
|
60
|
+
.catchall(z.json())
|
|
61
|
+
|
|
62
|
+
const VERCEL_ACTOR_SCHEMA = z.object({
|
|
63
|
+
/** Team that owns the affected resource, for team installations. */
|
|
64
|
+
team: VERCEL_TEAM_ACTOR_SCHEMA.nullable(),
|
|
65
|
+
|
|
66
|
+
/** User that initiated the event, when available. */
|
|
67
|
+
user: VERCEL_USER_ACTOR_SCHEMA.nullable(),
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
const VERCEL_PROJECT_REFERENCE_SCHEMA = z
|
|
71
|
+
.looseObject({
|
|
72
|
+
/** Stable Vercel project ID. */
|
|
73
|
+
id: z.string(),
|
|
74
|
+
|
|
75
|
+
/** Current project name, when included by Vercel. */
|
|
76
|
+
name: z.string().optional(),
|
|
77
|
+
})
|
|
78
|
+
.catchall(z.json())
|
|
79
|
+
|
|
80
|
+
const VERCEL_NAMED_PROJECT_REFERENCE_SCHEMA =
|
|
81
|
+
VERCEL_PROJECT_REFERENCE_SCHEMA.extend({
|
|
82
|
+
/** Current project name. */
|
|
83
|
+
name: z.string(),
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
const VERCEL_DEPLOYMENT_REFERENCE_SCHEMA = z
|
|
87
|
+
.looseObject({
|
|
88
|
+
/** Stable Vercel deployment ID. */
|
|
89
|
+
id: z.string(),
|
|
90
|
+
|
|
91
|
+
/** Deployment or project name. */
|
|
92
|
+
name: z.string(),
|
|
93
|
+
|
|
94
|
+
/** Vercel deployment hostname. */
|
|
95
|
+
url: z.string(),
|
|
96
|
+
})
|
|
97
|
+
.catchall(z.json())
|
|
98
|
+
|
|
99
|
+
const VERCEL_DOMAIN_REFERENCE_SCHEMA = z
|
|
100
|
+
.looseObject({
|
|
101
|
+
/** Project domain name. */
|
|
102
|
+
name: z.string(),
|
|
103
|
+
})
|
|
104
|
+
.catchall(z.json())
|
|
105
|
+
|
|
106
|
+
const VERCEL_DEPLOYMENT_EVENT_PAYLOAD_SCHEMA = VERCEL_ACTOR_SCHEMA.extend({
|
|
107
|
+
/** Deployment affected by this event. */
|
|
108
|
+
deployment: VERCEL_DEPLOYMENT_REFERENCE_SCHEMA,
|
|
109
|
+
|
|
110
|
+
/** Project that owns the deployment. */
|
|
111
|
+
project: VERCEL_PROJECT_REFERENCE_SCHEMA,
|
|
112
|
+
|
|
113
|
+
/** Deployment target, when one was assigned. */
|
|
114
|
+
target: z.enum(["production", "staging"]).nullable().optional(),
|
|
115
|
+
}).catchall(z.json())
|
|
116
|
+
|
|
117
|
+
const VERCEL_PROJECT_EVENT_PAYLOAD_SCHEMA = VERCEL_ACTOR_SCHEMA.extend({
|
|
118
|
+
/** Project affected by this event. */
|
|
119
|
+
project: VERCEL_NAMED_PROJECT_REFERENCE_SCHEMA,
|
|
120
|
+
}).catchall(z.json())
|
|
121
|
+
|
|
122
|
+
const VERCEL_PROJECT_RENAMED_EVENT_PAYLOAD_SCHEMA =
|
|
123
|
+
VERCEL_PROJECT_EVENT_PAYLOAD_SCHEMA.extend({
|
|
124
|
+
/** Project name before the rename. */
|
|
125
|
+
previousName: z.string(),
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
const VERCEL_PROJECT_ENVIRONMENT_VARIABLE_EVENT_PAYLOAD_SCHEMA =
|
|
129
|
+
VERCEL_ACTOR_SCHEMA.extend({
|
|
130
|
+
/** Stable environment variable ID. */
|
|
131
|
+
envVarId: z.string(),
|
|
132
|
+
|
|
133
|
+
/** Stable project ID. */
|
|
134
|
+
projectId: z.string(),
|
|
135
|
+
}).catchall(z.json())
|
|
136
|
+
|
|
137
|
+
const VERCEL_PROJECT_ENVIRONMENT_VARIABLE_DELETED_EVENT_PAYLOAD_SCHEMA =
|
|
138
|
+
VERCEL_PROJECT_ENVIRONMENT_VARIABLE_EVENT_PAYLOAD_SCHEMA.extend({
|
|
139
|
+
/** Stable environment variable ID, when Vercel still has it. */
|
|
140
|
+
envVarId: z.string().nullable(),
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
const VERCEL_PROJECT_DOMAIN_EVENT_PAYLOAD_SCHEMA = VERCEL_ACTOR_SCHEMA.extend({
|
|
144
|
+
/** Domain affected by this event. */
|
|
145
|
+
domain: VERCEL_DOMAIN_REFERENCE_SCHEMA,
|
|
146
|
+
|
|
147
|
+
/** Project that owns the domain. */
|
|
148
|
+
project: VERCEL_PROJECT_REFERENCE_SCHEMA,
|
|
149
|
+
}).catchall(z.json())
|
|
150
|
+
|
|
151
|
+
const VERCEL_PROJECT_DOMAIN_UPDATED_EVENT_PAYLOAD_SCHEMA =
|
|
152
|
+
VERCEL_ACTOR_SCHEMA.extend({
|
|
153
|
+
/** Project-domain settings before the update. */
|
|
154
|
+
previous: z
|
|
155
|
+
.looseObject({
|
|
156
|
+
domain: z.string(),
|
|
157
|
+
gitBranch: z.string().nullable(),
|
|
158
|
+
redirect: z.string().nullable(),
|
|
159
|
+
redirectStatusCode: z.number().int().nullable(),
|
|
160
|
+
})
|
|
161
|
+
.catchall(z.json()),
|
|
162
|
+
|
|
163
|
+
/** Project-domain settings after the update. */
|
|
164
|
+
next: z
|
|
165
|
+
.looseObject({
|
|
166
|
+
domain: z.string(),
|
|
167
|
+
gitBranch: z.string().nullable(),
|
|
168
|
+
redirect: z.string().nullable(),
|
|
169
|
+
redirectStatusCode: z.number().int().nullable(),
|
|
170
|
+
})
|
|
171
|
+
.catchall(z.json()),
|
|
172
|
+
|
|
173
|
+
/** Project that owns the domain. */
|
|
174
|
+
project: VERCEL_PROJECT_REFERENCE_SCHEMA,
|
|
175
|
+
})
|
|
176
|
+
|
|
177
|
+
const VERCEL_PROJECT_DOMAIN_MOVED_EVENT_PAYLOAD_SCHEMA =
|
|
178
|
+
VERCEL_ACTOR_SCHEMA.extend({
|
|
179
|
+
/** Domain moved between projects. */
|
|
180
|
+
domain: VERCEL_DOMAIN_REFERENCE_SCHEMA,
|
|
181
|
+
|
|
182
|
+
/** Project that previously owned the domain. */
|
|
183
|
+
from: z.looseObject({ projectId: z.string() }).catchall(z.json()),
|
|
184
|
+
|
|
185
|
+
/** Whether the move left a redirect on the previous project. */
|
|
186
|
+
isRedirect: z.boolean(),
|
|
187
|
+
|
|
188
|
+
/** Project that now owns the domain. */
|
|
189
|
+
to: z.looseObject({ projectId: z.string() }).catchall(z.json()),
|
|
190
|
+
})
|
|
191
|
+
|
|
192
|
+
const VERCEL_INTEGRATION_CONFIGURATION_SCHEMA = z
|
|
193
|
+
.looseObject({
|
|
194
|
+
/** Stable Vercel integration configuration ID. */
|
|
195
|
+
id: z.string(),
|
|
196
|
+
|
|
197
|
+
/** Project access mode selected for the installation. */
|
|
198
|
+
projectSelection: z.enum(["all", "selected"]).optional(),
|
|
199
|
+
|
|
200
|
+
/** Stable IDs of projects selected for the installation. */
|
|
201
|
+
projects: z.string().array().optional(),
|
|
202
|
+
|
|
203
|
+
/** OAuth scopes approved for the installation. */
|
|
204
|
+
scopes: z.string().array().optional(),
|
|
205
|
+
})
|
|
206
|
+
.catchall(z.json())
|
|
207
|
+
|
|
208
|
+
const VERCEL_INTEGRATION_CONFIGURATION_EVENT_PAYLOAD_SCHEMA =
|
|
209
|
+
VERCEL_ACTOR_SCHEMA.extend({
|
|
210
|
+
/** Integration installation configuration affected by this event. */
|
|
211
|
+
configuration: VERCEL_INTEGRATION_CONFIGURATION_SCHEMA,
|
|
212
|
+
}).catchall(z.json())
|
|
213
|
+
|
|
214
|
+
const VERCEL_INTEGRATION_CONFIGURATION_PERMISSION_UPGRADED_EVENT_PAYLOAD_SCHEMA =
|
|
215
|
+
VERCEL_INTEGRATION_CONFIGURATION_EVENT_PAYLOAD_SCHEMA.extend({
|
|
216
|
+
configuration: VERCEL_INTEGRATION_CONFIGURATION_SCHEMA.extend({
|
|
217
|
+
/** Current project access mode. */
|
|
218
|
+
projectSelection: z.enum(["all", "selected"]),
|
|
219
|
+
|
|
220
|
+
/** Project IDs currently available to the installation. */
|
|
221
|
+
projects: z.string().array(),
|
|
222
|
+
}),
|
|
223
|
+
|
|
224
|
+
/** Project IDs added to and removed from the installation. */
|
|
225
|
+
projects: z.object({
|
|
226
|
+
added: z.string().array(),
|
|
227
|
+
removed: z.string().array(),
|
|
228
|
+
}),
|
|
229
|
+
})
|
|
230
|
+
|
|
231
|
+
const VERCEL_INTEGRATION_CONFIGURATION_REMOVED_EVENT_PAYLOAD_SCHEMA =
|
|
232
|
+
VERCEL_INTEGRATION_CONFIGURATION_EVENT_PAYLOAD_SCHEMA.extend({
|
|
233
|
+
configuration: VERCEL_INTEGRATION_CONFIGURATION_SCHEMA.extend({
|
|
234
|
+
/** Project IDs available before the installation was removed. */
|
|
235
|
+
projects: z.string().array(),
|
|
236
|
+
}),
|
|
237
|
+
})
|
|
238
|
+
|
|
239
|
+
const VERCEL_INTEGRATION_CONFIGURATION_SCOPE_CHANGE_CONFIRMED_EVENT_PAYLOAD_SCHEMA =
|
|
240
|
+
VERCEL_INTEGRATION_CONFIGURATION_EVENT_PAYLOAD_SCHEMA.extend({
|
|
241
|
+
configuration: VERCEL_INTEGRATION_CONFIGURATION_SCHEMA.extend({
|
|
242
|
+
/** OAuth scopes approved after the change. */
|
|
243
|
+
scopes: z.string().array(),
|
|
244
|
+
}),
|
|
245
|
+
})
|
|
246
|
+
|
|
247
|
+
const VERCEL_INTEGRATION_CONFIGURATION_TRANSFERRED_EVENT_PAYLOAD_SCHEMA = z
|
|
248
|
+
.looseObject({
|
|
249
|
+
/** Integration installation configuration that was transferred. */
|
|
250
|
+
configuration: VERCEL_INTEGRATION_CONFIGURATION_SCHEMA,
|
|
251
|
+
|
|
252
|
+
/** Stable installation ID. */
|
|
253
|
+
installationId: z.string(),
|
|
254
|
+
|
|
255
|
+
/** New personal-account owner ID, when transferred to a user. */
|
|
256
|
+
newAccountId: z.string().nullable(),
|
|
257
|
+
|
|
258
|
+
/** New team owner ID, when transferred to a team. */
|
|
259
|
+
newTeamId: z.string().nullable(),
|
|
260
|
+
|
|
261
|
+
/** Previous personal-account owner ID, when transferred from a user. */
|
|
262
|
+
previousAccountId: z.string().nullable(),
|
|
263
|
+
|
|
264
|
+
/** Previous team owner ID, when transferred from a team. */
|
|
265
|
+
previousTeamId: z.string().nullable(),
|
|
266
|
+
})
|
|
267
|
+
.catchall(z.json())
|
|
268
|
+
|
|
269
|
+
/** Vercel deployment-created webhook. */
|
|
270
|
+
export const VERCEL_DEPLOYMENT_CREATED_EVENT_SCHEMA = vercelWebhookEventSchema(
|
|
271
|
+
z.literal("deployment.created"),
|
|
272
|
+
VERCEL_DEPLOYMENT_EVENT_PAYLOAD_SCHEMA,
|
|
273
|
+
)
|
|
274
|
+
|
|
275
|
+
/** Vercel deployment-ready webhook. */
|
|
276
|
+
export const VERCEL_DEPLOYMENT_READY_EVENT_SCHEMA = vercelWebhookEventSchema(
|
|
277
|
+
z.literal("deployment.ready"),
|
|
278
|
+
VERCEL_DEPLOYMENT_EVENT_PAYLOAD_SCHEMA,
|
|
279
|
+
)
|
|
280
|
+
|
|
281
|
+
/** Vercel deployment-succeeded webhook. */
|
|
282
|
+
export const VERCEL_DEPLOYMENT_SUCCEEDED_EVENT_SCHEMA =
|
|
283
|
+
vercelWebhookEventSchema(
|
|
284
|
+
z.literal("deployment.succeeded"),
|
|
285
|
+
VERCEL_DEPLOYMENT_EVENT_PAYLOAD_SCHEMA,
|
|
286
|
+
)
|
|
287
|
+
|
|
288
|
+
/** Vercel deployment-error webhook. */
|
|
289
|
+
export const VERCEL_DEPLOYMENT_FAILED_EVENT_SCHEMA = vercelWebhookEventSchema(
|
|
290
|
+
z.literal("deployment.error"),
|
|
291
|
+
VERCEL_DEPLOYMENT_EVENT_PAYLOAD_SCHEMA,
|
|
292
|
+
)
|
|
293
|
+
|
|
294
|
+
/** Vercel deployment-canceled webhook. */
|
|
295
|
+
export const VERCEL_DEPLOYMENT_CANCELED_EVENT_SCHEMA = vercelWebhookEventSchema(
|
|
296
|
+
z.literal("deployment.canceled"),
|
|
297
|
+
VERCEL_DEPLOYMENT_EVENT_PAYLOAD_SCHEMA,
|
|
298
|
+
)
|
|
299
|
+
|
|
300
|
+
/** Vercel deployment-promoted webhook. */
|
|
301
|
+
export const VERCEL_DEPLOYMENT_PROMOTED_EVENT_SCHEMA = vercelWebhookEventSchema(
|
|
302
|
+
z.literal("deployment.promoted"),
|
|
303
|
+
VERCEL_DEPLOYMENT_EVENT_PAYLOAD_SCHEMA,
|
|
304
|
+
)
|
|
305
|
+
|
|
306
|
+
/** Vercel project-created webhook. */
|
|
307
|
+
export const VERCEL_PROJECT_CREATED_EVENT_SCHEMA = vercelWebhookEventSchema(
|
|
308
|
+
z.literal("project.created"),
|
|
309
|
+
VERCEL_PROJECT_EVENT_PAYLOAD_SCHEMA,
|
|
310
|
+
)
|
|
311
|
+
|
|
312
|
+
/** Vercel project-removed webhook. */
|
|
313
|
+
export const VERCEL_PROJECT_REMOVED_EVENT_SCHEMA = vercelWebhookEventSchema(
|
|
314
|
+
z.literal("project.removed"),
|
|
315
|
+
VERCEL_PROJECT_EVENT_PAYLOAD_SCHEMA,
|
|
316
|
+
)
|
|
317
|
+
|
|
318
|
+
/** Vercel project-renamed webhook. */
|
|
319
|
+
export const VERCEL_PROJECT_RENAMED_EVENT_SCHEMA = vercelWebhookEventSchema(
|
|
320
|
+
z.literal("project.renamed"),
|
|
321
|
+
VERCEL_PROJECT_RENAMED_EVENT_PAYLOAD_SCHEMA,
|
|
322
|
+
)
|
|
323
|
+
|
|
324
|
+
/** Vercel project environment-variable-created webhook. */
|
|
325
|
+
export const VERCEL_PROJECT_ENVIRONMENT_VARIABLE_CREATED_EVENT_SCHEMA =
|
|
326
|
+
vercelWebhookEventSchema(
|
|
327
|
+
z.literal("project.env-variable.created"),
|
|
328
|
+
VERCEL_PROJECT_ENVIRONMENT_VARIABLE_EVENT_PAYLOAD_SCHEMA,
|
|
329
|
+
)
|
|
330
|
+
|
|
331
|
+
/** Vercel project environment-variable-updated webhook. */
|
|
332
|
+
export const VERCEL_PROJECT_ENVIRONMENT_VARIABLE_UPDATED_EVENT_SCHEMA =
|
|
333
|
+
vercelWebhookEventSchema(
|
|
334
|
+
z.literal("project.env-variable.updated"),
|
|
335
|
+
VERCEL_PROJECT_ENVIRONMENT_VARIABLE_EVENT_PAYLOAD_SCHEMA,
|
|
336
|
+
)
|
|
337
|
+
|
|
338
|
+
/** Vercel project environment-variable-deleted webhook. */
|
|
339
|
+
export const VERCEL_PROJECT_ENVIRONMENT_VARIABLE_DELETED_EVENT_SCHEMA =
|
|
340
|
+
vercelWebhookEventSchema(
|
|
341
|
+
z.literal("project.env-variable.deleted"),
|
|
342
|
+
VERCEL_PROJECT_ENVIRONMENT_VARIABLE_DELETED_EVENT_PAYLOAD_SCHEMA,
|
|
343
|
+
)
|
|
344
|
+
|
|
345
|
+
/** Vercel project-domain-created webhook. */
|
|
346
|
+
export const VERCEL_PROJECT_DOMAIN_CREATED_EVENT_SCHEMA =
|
|
347
|
+
vercelWebhookEventSchema(
|
|
348
|
+
z.literal("project.domain.created"),
|
|
349
|
+
VERCEL_PROJECT_DOMAIN_EVENT_PAYLOAD_SCHEMA,
|
|
350
|
+
)
|
|
351
|
+
|
|
352
|
+
/** Vercel project-domain-updated webhook. */
|
|
353
|
+
export const VERCEL_PROJECT_DOMAIN_UPDATED_EVENT_SCHEMA =
|
|
354
|
+
vercelWebhookEventSchema(
|
|
355
|
+
z.literal("project.domain.updated"),
|
|
356
|
+
VERCEL_PROJECT_DOMAIN_UPDATED_EVENT_PAYLOAD_SCHEMA,
|
|
357
|
+
)
|
|
358
|
+
|
|
359
|
+
/** Vercel project-domain-deleted webhook. */
|
|
360
|
+
export const VERCEL_PROJECT_DOMAIN_DELETED_EVENT_SCHEMA =
|
|
361
|
+
vercelWebhookEventSchema(
|
|
362
|
+
z.literal("project.domain.deleted"),
|
|
363
|
+
VERCEL_PROJECT_DOMAIN_EVENT_PAYLOAD_SCHEMA,
|
|
364
|
+
)
|
|
365
|
+
|
|
366
|
+
/** Vercel project-domain-verified webhook. */
|
|
367
|
+
export const VERCEL_PROJECT_DOMAIN_VERIFIED_EVENT_SCHEMA =
|
|
368
|
+
vercelWebhookEventSchema(
|
|
369
|
+
z.literal("project.domain.verified"),
|
|
370
|
+
VERCEL_PROJECT_DOMAIN_EVENT_PAYLOAD_SCHEMA,
|
|
371
|
+
)
|
|
372
|
+
|
|
373
|
+
/** Vercel project-domain-unverified webhook. */
|
|
374
|
+
export const VERCEL_PROJECT_DOMAIN_UNVERIFIED_EVENT_SCHEMA =
|
|
375
|
+
vercelWebhookEventSchema(
|
|
376
|
+
z.literal("project.domain.unverified"),
|
|
377
|
+
VERCEL_PROJECT_DOMAIN_EVENT_PAYLOAD_SCHEMA,
|
|
378
|
+
)
|
|
379
|
+
|
|
380
|
+
/** Vercel project-domain-moved webhook. */
|
|
381
|
+
export const VERCEL_PROJECT_DOMAIN_MOVED_EVENT_SCHEMA =
|
|
382
|
+
vercelWebhookEventSchema(
|
|
383
|
+
z.literal("project.domain.moved"),
|
|
384
|
+
VERCEL_PROJECT_DOMAIN_MOVED_EVENT_PAYLOAD_SCHEMA,
|
|
385
|
+
)
|
|
386
|
+
|
|
387
|
+
/** Vercel integration-configuration permission-upgraded webhook. */
|
|
388
|
+
export const VERCEL_INTEGRATION_CONFIGURATION_PERMISSION_UPGRADED_EVENT_SCHEMA =
|
|
389
|
+
vercelWebhookEventSchema(
|
|
390
|
+
z.literal("integration-configuration.permission-upgraded"),
|
|
391
|
+
VERCEL_INTEGRATION_CONFIGURATION_PERMISSION_UPGRADED_EVENT_PAYLOAD_SCHEMA,
|
|
392
|
+
)
|
|
393
|
+
|
|
394
|
+
/** Vercel integration-configuration-removed webhook. */
|
|
395
|
+
export const VERCEL_INTEGRATION_CONFIGURATION_REMOVED_EVENT_SCHEMA =
|
|
396
|
+
vercelWebhookEventSchema(
|
|
397
|
+
z.literal("integration-configuration.removed"),
|
|
398
|
+
VERCEL_INTEGRATION_CONFIGURATION_REMOVED_EVENT_PAYLOAD_SCHEMA,
|
|
399
|
+
)
|
|
400
|
+
|
|
401
|
+
/** Vercel integration-configuration scope-change-confirmed webhook. */
|
|
402
|
+
export const VERCEL_INTEGRATION_CONFIGURATION_SCOPE_CHANGE_CONFIRMED_EVENT_SCHEMA =
|
|
403
|
+
vercelWebhookEventSchema(
|
|
404
|
+
z.literal("integration-configuration.scope-change-confirmed"),
|
|
405
|
+
VERCEL_INTEGRATION_CONFIGURATION_SCOPE_CHANGE_CONFIRMED_EVENT_PAYLOAD_SCHEMA,
|
|
406
|
+
)
|
|
407
|
+
|
|
408
|
+
/** Vercel integration-configuration-transferred webhook. */
|
|
409
|
+
export const VERCEL_INTEGRATION_CONFIGURATION_TRANSFERRED_EVENT_SCHEMA =
|
|
410
|
+
vercelWebhookEventSchema(
|
|
411
|
+
z.literal("integration-configuration.transferred"),
|
|
412
|
+
VERCEL_INTEGRATION_CONFIGURATION_TRANSFERRED_EVENT_PAYLOAD_SCHEMA,
|
|
413
|
+
)
|
|
414
|
+
|
|
415
|
+
/** Supported Vercel deployment lifecycle webhook. */
|
|
416
|
+
export const VERCEL_DEPLOYMENT_EVENT_SCHEMA = z.discriminatedUnion("type", [
|
|
417
|
+
VERCEL_DEPLOYMENT_CREATED_EVENT_SCHEMA,
|
|
418
|
+
VERCEL_DEPLOYMENT_READY_EVENT_SCHEMA,
|
|
419
|
+
VERCEL_DEPLOYMENT_SUCCEEDED_EVENT_SCHEMA,
|
|
420
|
+
VERCEL_DEPLOYMENT_FAILED_EVENT_SCHEMA,
|
|
421
|
+
VERCEL_DEPLOYMENT_CANCELED_EVENT_SCHEMA,
|
|
422
|
+
VERCEL_DEPLOYMENT_PROMOTED_EVENT_SCHEMA,
|
|
423
|
+
])
|
|
424
|
+
|
|
425
|
+
/** Supported Vercel project lifecycle webhook. */
|
|
426
|
+
export const VERCEL_PROJECT_EVENT_SCHEMA = z.discriminatedUnion("type", [
|
|
427
|
+
VERCEL_PROJECT_CREATED_EVENT_SCHEMA,
|
|
428
|
+
VERCEL_PROJECT_REMOVED_EVENT_SCHEMA,
|
|
429
|
+
VERCEL_PROJECT_RENAMED_EVENT_SCHEMA,
|
|
430
|
+
])
|
|
431
|
+
|
|
432
|
+
/** Supported Vercel project environment-variable webhook. */
|
|
433
|
+
export const VERCEL_PROJECT_ENVIRONMENT_VARIABLE_EVENT_SCHEMA =
|
|
434
|
+
z.discriminatedUnion("type", [
|
|
435
|
+
VERCEL_PROJECT_ENVIRONMENT_VARIABLE_CREATED_EVENT_SCHEMA,
|
|
436
|
+
VERCEL_PROJECT_ENVIRONMENT_VARIABLE_UPDATED_EVENT_SCHEMA,
|
|
437
|
+
VERCEL_PROJECT_ENVIRONMENT_VARIABLE_DELETED_EVENT_SCHEMA,
|
|
438
|
+
])
|
|
439
|
+
|
|
440
|
+
/** Supported Vercel project-domain webhook. */
|
|
441
|
+
export const VERCEL_PROJECT_DOMAIN_EVENT_SCHEMA = z.discriminatedUnion("type", [
|
|
442
|
+
VERCEL_PROJECT_DOMAIN_CREATED_EVENT_SCHEMA,
|
|
443
|
+
VERCEL_PROJECT_DOMAIN_UPDATED_EVENT_SCHEMA,
|
|
444
|
+
VERCEL_PROJECT_DOMAIN_DELETED_EVENT_SCHEMA,
|
|
445
|
+
VERCEL_PROJECT_DOMAIN_VERIFIED_EVENT_SCHEMA,
|
|
446
|
+
VERCEL_PROJECT_DOMAIN_UNVERIFIED_EVENT_SCHEMA,
|
|
447
|
+
VERCEL_PROJECT_DOMAIN_MOVED_EVENT_SCHEMA,
|
|
448
|
+
])
|
|
449
|
+
|
|
450
|
+
/** Supported Vercel integration-configuration webhook. */
|
|
451
|
+
export const VERCEL_INTEGRATION_CONFIGURATION_EVENT_SCHEMA =
|
|
452
|
+
z.discriminatedUnion("type", [
|
|
453
|
+
VERCEL_INTEGRATION_CONFIGURATION_PERMISSION_UPGRADED_EVENT_SCHEMA,
|
|
454
|
+
VERCEL_INTEGRATION_CONFIGURATION_REMOVED_EVENT_SCHEMA,
|
|
455
|
+
VERCEL_INTEGRATION_CONFIGURATION_SCOPE_CHANGE_CONFIRMED_EVENT_SCHEMA,
|
|
456
|
+
VERCEL_INTEGRATION_CONFIGURATION_TRANSFERRED_EVENT_SCHEMA,
|
|
457
|
+
])
|
|
458
|
+
|
|
459
|
+
/** Every Vercel webhook handled by the integration. */
|
|
460
|
+
export const VERCEL_WEBHOOK_EVENT_SCHEMA = z.discriminatedUnion("type", [
|
|
461
|
+
VERCEL_DEPLOYMENT_CREATED_EVENT_SCHEMA,
|
|
462
|
+
VERCEL_DEPLOYMENT_READY_EVENT_SCHEMA,
|
|
463
|
+
VERCEL_DEPLOYMENT_SUCCEEDED_EVENT_SCHEMA,
|
|
464
|
+
VERCEL_DEPLOYMENT_FAILED_EVENT_SCHEMA,
|
|
465
|
+
VERCEL_DEPLOYMENT_CANCELED_EVENT_SCHEMA,
|
|
466
|
+
VERCEL_DEPLOYMENT_PROMOTED_EVENT_SCHEMA,
|
|
467
|
+
VERCEL_PROJECT_CREATED_EVENT_SCHEMA,
|
|
468
|
+
VERCEL_PROJECT_REMOVED_EVENT_SCHEMA,
|
|
469
|
+
VERCEL_PROJECT_RENAMED_EVENT_SCHEMA,
|
|
470
|
+
VERCEL_PROJECT_ENVIRONMENT_VARIABLE_CREATED_EVENT_SCHEMA,
|
|
471
|
+
VERCEL_PROJECT_ENVIRONMENT_VARIABLE_UPDATED_EVENT_SCHEMA,
|
|
472
|
+
VERCEL_PROJECT_ENVIRONMENT_VARIABLE_DELETED_EVENT_SCHEMA,
|
|
473
|
+
VERCEL_PROJECT_DOMAIN_CREATED_EVENT_SCHEMA,
|
|
474
|
+
VERCEL_PROJECT_DOMAIN_UPDATED_EVENT_SCHEMA,
|
|
475
|
+
VERCEL_PROJECT_DOMAIN_DELETED_EVENT_SCHEMA,
|
|
476
|
+
VERCEL_PROJECT_DOMAIN_VERIFIED_EVENT_SCHEMA,
|
|
477
|
+
VERCEL_PROJECT_DOMAIN_UNVERIFIED_EVENT_SCHEMA,
|
|
478
|
+
VERCEL_PROJECT_DOMAIN_MOVED_EVENT_SCHEMA,
|
|
479
|
+
VERCEL_INTEGRATION_CONFIGURATION_PERMISSION_UPGRADED_EVENT_SCHEMA,
|
|
480
|
+
VERCEL_INTEGRATION_CONFIGURATION_REMOVED_EVENT_SCHEMA,
|
|
481
|
+
VERCEL_INTEGRATION_CONFIGURATION_SCOPE_CHANGE_CONFIRMED_EVENT_SCHEMA,
|
|
482
|
+
VERCEL_INTEGRATION_CONFIGURATION_TRANSFERRED_EVENT_SCHEMA,
|
|
483
|
+
])
|
|
484
|
+
|
|
485
|
+
export type VercelDeploymentCreatedEvent = z.output<
|
|
486
|
+
typeof VERCEL_DEPLOYMENT_CREATED_EVENT_SCHEMA
|
|
487
|
+
>
|
|
488
|
+
export type VercelDeploymentReadyEvent = z.output<
|
|
489
|
+
typeof VERCEL_DEPLOYMENT_READY_EVENT_SCHEMA
|
|
490
|
+
>
|
|
491
|
+
export type VercelDeploymentSucceededEvent = z.output<
|
|
492
|
+
typeof VERCEL_DEPLOYMENT_SUCCEEDED_EVENT_SCHEMA
|
|
493
|
+
>
|
|
494
|
+
export type VercelDeploymentFailedEvent = z.output<
|
|
495
|
+
typeof VERCEL_DEPLOYMENT_FAILED_EVENT_SCHEMA
|
|
496
|
+
>
|
|
497
|
+
export type VercelDeploymentCanceledEvent = z.output<
|
|
498
|
+
typeof VERCEL_DEPLOYMENT_CANCELED_EVENT_SCHEMA
|
|
499
|
+
>
|
|
500
|
+
export type VercelDeploymentPromotedEvent = z.output<
|
|
501
|
+
typeof VERCEL_DEPLOYMENT_PROMOTED_EVENT_SCHEMA
|
|
502
|
+
>
|
|
503
|
+
export type VercelProjectCreatedEvent = z.output<
|
|
504
|
+
typeof VERCEL_PROJECT_CREATED_EVENT_SCHEMA
|
|
505
|
+
>
|
|
506
|
+
export type VercelProjectRemovedEvent = z.output<
|
|
507
|
+
typeof VERCEL_PROJECT_REMOVED_EVENT_SCHEMA
|
|
508
|
+
>
|
|
509
|
+
export type VercelProjectRenamedEvent = z.output<
|
|
510
|
+
typeof VERCEL_PROJECT_RENAMED_EVENT_SCHEMA
|
|
511
|
+
>
|
|
512
|
+
export type VercelProjectEnvironmentVariableCreatedEvent = z.output<
|
|
513
|
+
typeof VERCEL_PROJECT_ENVIRONMENT_VARIABLE_CREATED_EVENT_SCHEMA
|
|
514
|
+
>
|
|
515
|
+
export type VercelProjectEnvironmentVariableUpdatedEvent = z.output<
|
|
516
|
+
typeof VERCEL_PROJECT_ENVIRONMENT_VARIABLE_UPDATED_EVENT_SCHEMA
|
|
517
|
+
>
|
|
518
|
+
export type VercelProjectEnvironmentVariableDeletedEvent = z.output<
|
|
519
|
+
typeof VERCEL_PROJECT_ENVIRONMENT_VARIABLE_DELETED_EVENT_SCHEMA
|
|
520
|
+
>
|
|
521
|
+
export type VercelProjectDomainCreatedEvent = z.output<
|
|
522
|
+
typeof VERCEL_PROJECT_DOMAIN_CREATED_EVENT_SCHEMA
|
|
523
|
+
>
|
|
524
|
+
export type VercelProjectDomainUpdatedEvent = z.output<
|
|
525
|
+
typeof VERCEL_PROJECT_DOMAIN_UPDATED_EVENT_SCHEMA
|
|
526
|
+
>
|
|
527
|
+
export type VercelProjectDomainDeletedEvent = z.output<
|
|
528
|
+
typeof VERCEL_PROJECT_DOMAIN_DELETED_EVENT_SCHEMA
|
|
529
|
+
>
|
|
530
|
+
export type VercelProjectDomainVerifiedEvent = z.output<
|
|
531
|
+
typeof VERCEL_PROJECT_DOMAIN_VERIFIED_EVENT_SCHEMA
|
|
532
|
+
>
|
|
533
|
+
export type VercelProjectDomainUnverifiedEvent = z.output<
|
|
534
|
+
typeof VERCEL_PROJECT_DOMAIN_UNVERIFIED_EVENT_SCHEMA
|
|
535
|
+
>
|
|
536
|
+
export type VercelProjectDomainMovedEvent = z.output<
|
|
537
|
+
typeof VERCEL_PROJECT_DOMAIN_MOVED_EVENT_SCHEMA
|
|
538
|
+
>
|
|
539
|
+
export type VercelIntegrationConfigurationPermissionUpgradedEvent = z.output<
|
|
540
|
+
typeof VERCEL_INTEGRATION_CONFIGURATION_PERMISSION_UPGRADED_EVENT_SCHEMA
|
|
541
|
+
>
|
|
542
|
+
export type VercelIntegrationConfigurationRemovedEvent = z.output<
|
|
543
|
+
typeof VERCEL_INTEGRATION_CONFIGURATION_REMOVED_EVENT_SCHEMA
|
|
544
|
+
>
|
|
545
|
+
export type VercelIntegrationConfigurationScopeChangeConfirmedEvent = z.output<
|
|
546
|
+
typeof VERCEL_INTEGRATION_CONFIGURATION_SCOPE_CHANGE_CONFIRMED_EVENT_SCHEMA
|
|
547
|
+
>
|
|
548
|
+
export type VercelIntegrationConfigurationTransferredEvent = z.output<
|
|
549
|
+
typeof VERCEL_INTEGRATION_CONFIGURATION_TRANSFERRED_EVENT_SCHEMA
|
|
550
|
+
>
|
|
551
|
+
|
|
552
|
+
export type VercelDeploymentEvent = z.output<
|
|
553
|
+
typeof VERCEL_DEPLOYMENT_EVENT_SCHEMA
|
|
554
|
+
>
|
|
555
|
+
export type VercelProjectEvent = z.output<typeof VERCEL_PROJECT_EVENT_SCHEMA>
|
|
556
|
+
export type VercelProjectEnvironmentVariableEvent = z.output<
|
|
557
|
+
typeof VERCEL_PROJECT_ENVIRONMENT_VARIABLE_EVENT_SCHEMA
|
|
558
|
+
>
|
|
559
|
+
export type VercelProjectDomainEvent = z.output<
|
|
560
|
+
typeof VERCEL_PROJECT_DOMAIN_EVENT_SCHEMA
|
|
561
|
+
>
|
|
562
|
+
export type VercelIntegrationConfigurationEvent = z.output<
|
|
563
|
+
typeof VERCEL_INTEGRATION_CONFIGURATION_EVENT_SCHEMA
|
|
564
|
+
>
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* Creates one typed Vercel webhook envelope schema.
|
|
568
|
+
*
|
|
569
|
+
* @param type - Provider event discriminator schema.
|
|
570
|
+
* @param payload - Provider payload schema for the event.
|
|
571
|
+
*/
|
|
572
|
+
function vercelWebhookEventSchema<
|
|
573
|
+
TType extends z.ZodType<(typeof VERCEL_WEBHOOK_EVENT_TYPES)[number]>,
|
|
574
|
+
TPayload extends z.ZodType,
|
|
575
|
+
>(type: TType, payload: TPayload) {
|
|
576
|
+
return z
|
|
577
|
+
.looseObject({
|
|
578
|
+
/** When Vercel created the event, as Unix milliseconds. */
|
|
579
|
+
createdAt: z.number().int().nonnegative(),
|
|
580
|
+
|
|
581
|
+
/** Stable webhook delivery ID. */
|
|
582
|
+
id: z.string(),
|
|
583
|
+
|
|
584
|
+
/** Vercel region that emitted the event. */
|
|
585
|
+
region: z.string().nullable(),
|
|
586
|
+
|
|
587
|
+
/** Provider payload for this event type. */
|
|
588
|
+
payload,
|
|
589
|
+
|
|
590
|
+
/** Provider event discriminator. */
|
|
591
|
+
type,
|
|
592
|
+
})
|
|
593
|
+
.catchall(z.json())
|
|
594
|
+
}
|