@automate.ax/integration-contracts 0.147.1 → 0.148.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/close/events.d.ts +4 -4
- package/dist/close/schemas.d.ts +6 -6
- package/dist/google-drive/index.d.ts +3 -3
- package/dist/kit/api.d.ts +78 -0
- package/dist/kit/api.js +386 -0
- package/dist/kit/events.d.ts +437 -0
- package/dist/kit/events.js +285 -0
- package/dist/kit/index.d.ts +6 -0
- package/dist/kit/index.js +5 -0
- package/dist/kit/openapi-operations.generated.d.ts +5 -0
- package/dist/kit/openapi-operations.generated.js +5 -0
- package/dist/kit/openapi-types.generated.d.ts +9485 -0
- package/dist/kit/openapi-types.generated.js +1 -0
- package/dist/kit/operation-manifest.d.ts +657 -0
- package/dist/kit/operation-manifest.js +98 -0
- package/dist/kit/schemas.d.ts +42 -0
- package/dist/kit/schemas.js +43 -0
- package/dist/kit/types.d.ts +41 -0
- package/dist/kit/types.js +1 -0
- package/dist/notion/schemas.d.ts +108 -108
- package/dist/resend/action-schemas.d.ts +14 -14
- package/dist/triggers.d.ts +2 -1
- package/package.json +9 -2
- package/src/kit/api.ts +523 -0
- package/src/kit/events.ts +352 -0
- package/src/kit/index.ts +6 -0
- package/src/kit/openapi-operations.generated.ts +7 -0
- package/src/kit/openapi-types.generated.ts +9710 -0
- package/src/kit/operation-manifest.ts +771 -0
- package/src/kit/schemas.ts +93 -0
- package/src/kit/types.ts +87 -0
- package/src/triggers.ts +2 -0
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
import { type Encodable } from "@automate.ax/codec";
|
|
2
|
+
import * as z from "zod";
|
|
3
|
+
/** Kit webhook event types currently available for endpoint subscriptions. */
|
|
4
|
+
export declare const KIT_WEBHOOK_EVENT_TYPES: readonly ["subscriber.created", "subscriber.activated", "subscriber.unsubscribed", "subscriber.bounced", "subscriber.complained", "subscriber.subscribed_to_form", "subscriber.added_to_sequence", "subscriber.sequence_completed", "subscriber.tag_added", "subscriber.tag_removed", "subscriber.custom_field_value_updated", "tag.created", "tag.deleted", "custom_field.created", "custom_field.deleted", "sequence.created", "sequence.deleted", "sequence.published", "sequence.disabled", "broadcast.created", "broadcast.sent", "broadcast.deleted", "post.published"];
|
|
5
|
+
export type KitWebhookEventType = (typeof KIT_WEBHOOK_EVENT_TYPES)[number];
|
|
6
|
+
declare const KIT_EVENT_DATA_SCHEMAS: {
|
|
7
|
+
readonly "broadcast.created": z.ZodObject<{
|
|
8
|
+
broadcast: z.ZodObject<{
|
|
9
|
+
createdAt: z.ZodISODateTime;
|
|
10
|
+
description: z.ZodNullable<z.ZodString>;
|
|
11
|
+
id: z.ZodNumber;
|
|
12
|
+
previewText: z.ZodNullable<z.ZodString>;
|
|
13
|
+
public: z.ZodBoolean;
|
|
14
|
+
publicationId: z.ZodNumber;
|
|
15
|
+
publishedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
16
|
+
sendAt: z.ZodNullable<z.ZodISODateTime>;
|
|
17
|
+
status: z.ZodString;
|
|
18
|
+
subject: z.ZodString;
|
|
19
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
20
|
+
}, z.core.$loose>;
|
|
21
|
+
readonly "broadcast.deleted": z.ZodObject<{
|
|
22
|
+
broadcast: z.ZodObject<{
|
|
23
|
+
createdAt: z.ZodISODateTime;
|
|
24
|
+
description: z.ZodNullable<z.ZodString>;
|
|
25
|
+
id: z.ZodNumber;
|
|
26
|
+
previewText: z.ZodNullable<z.ZodString>;
|
|
27
|
+
public: z.ZodBoolean;
|
|
28
|
+
publicationId: z.ZodNumber;
|
|
29
|
+
publishedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
30
|
+
sendAt: z.ZodNullable<z.ZodISODateTime>;
|
|
31
|
+
status: z.ZodString;
|
|
32
|
+
subject: z.ZodString;
|
|
33
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
34
|
+
}, z.core.$loose>;
|
|
35
|
+
readonly "broadcast.sent": z.ZodObject<{
|
|
36
|
+
broadcast: z.ZodObject<{
|
|
37
|
+
createdAt: z.ZodISODateTime;
|
|
38
|
+
description: z.ZodNullable<z.ZodString>;
|
|
39
|
+
id: z.ZodNumber;
|
|
40
|
+
previewText: z.ZodNullable<z.ZodString>;
|
|
41
|
+
public: z.ZodBoolean;
|
|
42
|
+
publicationId: z.ZodNumber;
|
|
43
|
+
publishedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
44
|
+
sendAt: z.ZodNullable<z.ZodISODateTime>;
|
|
45
|
+
status: z.ZodString;
|
|
46
|
+
subject: z.ZodString;
|
|
47
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
48
|
+
}, z.core.$loose>;
|
|
49
|
+
readonly "custom_field.created": z.ZodObject<{
|
|
50
|
+
customField: z.ZodObject<{
|
|
51
|
+
id: z.ZodNumber;
|
|
52
|
+
key: z.ZodString;
|
|
53
|
+
label: z.ZodString;
|
|
54
|
+
name: z.ZodString;
|
|
55
|
+
value: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
56
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
57
|
+
}, z.core.$loose>;
|
|
58
|
+
readonly "custom_field.deleted": z.ZodObject<{
|
|
59
|
+
customField: z.ZodObject<{
|
|
60
|
+
id: z.ZodNumber;
|
|
61
|
+
key: z.ZodString;
|
|
62
|
+
label: z.ZodString;
|
|
63
|
+
name: z.ZodString;
|
|
64
|
+
value: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
65
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
66
|
+
}, z.core.$loose>;
|
|
67
|
+
readonly "post.published": z.ZodObject<{
|
|
68
|
+
post: z.ZodObject<{
|
|
69
|
+
id: z.ZodNumber;
|
|
70
|
+
isPaid: z.ZodBoolean;
|
|
71
|
+
publicUrl: z.ZodURL;
|
|
72
|
+
publicationId: z.ZodNumber;
|
|
73
|
+
publishedAt: z.ZodISODateTime;
|
|
74
|
+
slug: z.ZodString;
|
|
75
|
+
title: z.ZodString;
|
|
76
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
77
|
+
}, z.core.$loose>;
|
|
78
|
+
readonly "sequence.created": z.ZodObject<{
|
|
79
|
+
sequence: z.ZodObject<{
|
|
80
|
+
active: z.ZodBoolean;
|
|
81
|
+
createdAt: z.ZodISODateTime;
|
|
82
|
+
emailTemplateId: z.ZodNullable<z.ZodNumber>;
|
|
83
|
+
hold: z.ZodBoolean;
|
|
84
|
+
id: z.ZodNumber;
|
|
85
|
+
name: z.ZodString;
|
|
86
|
+
repeat: z.ZodBoolean;
|
|
87
|
+
updatedAt: z.ZodISODateTime;
|
|
88
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
89
|
+
}, z.core.$loose>;
|
|
90
|
+
readonly "sequence.deleted": z.ZodObject<{
|
|
91
|
+
sequence: z.ZodObject<{
|
|
92
|
+
active: z.ZodBoolean;
|
|
93
|
+
createdAt: z.ZodISODateTime;
|
|
94
|
+
emailTemplateId: z.ZodNullable<z.ZodNumber>;
|
|
95
|
+
hold: z.ZodBoolean;
|
|
96
|
+
id: z.ZodNumber;
|
|
97
|
+
name: z.ZodString;
|
|
98
|
+
repeat: z.ZodBoolean;
|
|
99
|
+
updatedAt: z.ZodISODateTime;
|
|
100
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
101
|
+
}, z.core.$loose>;
|
|
102
|
+
readonly "sequence.disabled": z.ZodObject<{
|
|
103
|
+
sequence: z.ZodObject<{
|
|
104
|
+
active: z.ZodBoolean;
|
|
105
|
+
createdAt: z.ZodISODateTime;
|
|
106
|
+
emailTemplateId: z.ZodNullable<z.ZodNumber>;
|
|
107
|
+
hold: z.ZodBoolean;
|
|
108
|
+
id: z.ZodNumber;
|
|
109
|
+
name: z.ZodString;
|
|
110
|
+
repeat: z.ZodBoolean;
|
|
111
|
+
updatedAt: z.ZodISODateTime;
|
|
112
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
113
|
+
}, z.core.$loose>;
|
|
114
|
+
readonly "sequence.published": z.ZodObject<{
|
|
115
|
+
sequence: z.ZodObject<{
|
|
116
|
+
active: z.ZodBoolean;
|
|
117
|
+
createdAt: z.ZodISODateTime;
|
|
118
|
+
emailTemplateId: z.ZodNullable<z.ZodNumber>;
|
|
119
|
+
hold: z.ZodBoolean;
|
|
120
|
+
id: z.ZodNumber;
|
|
121
|
+
name: z.ZodString;
|
|
122
|
+
repeat: z.ZodBoolean;
|
|
123
|
+
updatedAt: z.ZodISODateTime;
|
|
124
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
125
|
+
}, z.core.$loose>;
|
|
126
|
+
readonly "subscriber.activated": z.ZodObject<{
|
|
127
|
+
subscriber: z.ZodObject<{
|
|
128
|
+
createdAt: z.ZodISODateTime;
|
|
129
|
+
emailAddress: z.ZodEmail;
|
|
130
|
+
fields: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
|
|
131
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
132
|
+
id: z.ZodNumber;
|
|
133
|
+
state: z.ZodEnum<{
|
|
134
|
+
cancelled: "cancelled";
|
|
135
|
+
active: "active";
|
|
136
|
+
inactive: "inactive";
|
|
137
|
+
bounced: "bounced";
|
|
138
|
+
complained: "complained";
|
|
139
|
+
}>;
|
|
140
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
141
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
142
|
+
readonly "subscriber.added_to_sequence": z.ZodObject<{
|
|
143
|
+
subscriber: z.ZodObject<{
|
|
144
|
+
createdAt: z.ZodISODateTime;
|
|
145
|
+
emailAddress: z.ZodEmail;
|
|
146
|
+
fields: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
|
|
147
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
148
|
+
id: z.ZodNumber;
|
|
149
|
+
state: z.ZodEnum<{
|
|
150
|
+
cancelled: "cancelled";
|
|
151
|
+
active: "active";
|
|
152
|
+
inactive: "inactive";
|
|
153
|
+
bounced: "bounced";
|
|
154
|
+
complained: "complained";
|
|
155
|
+
}>;
|
|
156
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
157
|
+
sequence: z.ZodObject<{
|
|
158
|
+
active: z.ZodBoolean;
|
|
159
|
+
createdAt: z.ZodISODateTime;
|
|
160
|
+
emailTemplateId: z.ZodNullable<z.ZodNumber>;
|
|
161
|
+
hold: z.ZodBoolean;
|
|
162
|
+
id: z.ZodNumber;
|
|
163
|
+
name: z.ZodString;
|
|
164
|
+
repeat: z.ZodBoolean;
|
|
165
|
+
updatedAt: z.ZodISODateTime;
|
|
166
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
167
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
168
|
+
readonly "subscriber.bounced": z.ZodObject<{
|
|
169
|
+
subscriber: z.ZodObject<{
|
|
170
|
+
createdAt: z.ZodISODateTime;
|
|
171
|
+
emailAddress: z.ZodEmail;
|
|
172
|
+
fields: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
|
|
173
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
174
|
+
id: z.ZodNumber;
|
|
175
|
+
state: z.ZodEnum<{
|
|
176
|
+
cancelled: "cancelled";
|
|
177
|
+
active: "active";
|
|
178
|
+
inactive: "inactive";
|
|
179
|
+
bounced: "bounced";
|
|
180
|
+
complained: "complained";
|
|
181
|
+
}>;
|
|
182
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
183
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
184
|
+
readonly "subscriber.complained": z.ZodObject<{
|
|
185
|
+
subscriber: z.ZodObject<{
|
|
186
|
+
createdAt: z.ZodISODateTime;
|
|
187
|
+
emailAddress: z.ZodEmail;
|
|
188
|
+
fields: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
|
|
189
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
190
|
+
id: z.ZodNumber;
|
|
191
|
+
state: z.ZodEnum<{
|
|
192
|
+
cancelled: "cancelled";
|
|
193
|
+
active: "active";
|
|
194
|
+
inactive: "inactive";
|
|
195
|
+
bounced: "bounced";
|
|
196
|
+
complained: "complained";
|
|
197
|
+
}>;
|
|
198
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
199
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
200
|
+
readonly "subscriber.created": z.ZodObject<{
|
|
201
|
+
subscriber: z.ZodObject<{
|
|
202
|
+
createdAt: z.ZodISODateTime;
|
|
203
|
+
emailAddress: z.ZodEmail;
|
|
204
|
+
fields: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
|
|
205
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
206
|
+
id: z.ZodNumber;
|
|
207
|
+
state: z.ZodEnum<{
|
|
208
|
+
cancelled: "cancelled";
|
|
209
|
+
active: "active";
|
|
210
|
+
inactive: "inactive";
|
|
211
|
+
bounced: "bounced";
|
|
212
|
+
complained: "complained";
|
|
213
|
+
}>;
|
|
214
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
215
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
216
|
+
readonly "subscriber.custom_field_value_updated": z.ZodObject<{
|
|
217
|
+
subscriber: z.ZodObject<{
|
|
218
|
+
createdAt: z.ZodISODateTime;
|
|
219
|
+
emailAddress: z.ZodEmail;
|
|
220
|
+
fields: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
|
|
221
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
222
|
+
id: z.ZodNumber;
|
|
223
|
+
state: z.ZodEnum<{
|
|
224
|
+
cancelled: "cancelled";
|
|
225
|
+
active: "active";
|
|
226
|
+
inactive: "inactive";
|
|
227
|
+
bounced: "bounced";
|
|
228
|
+
complained: "complained";
|
|
229
|
+
}>;
|
|
230
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
231
|
+
customField: z.ZodObject<{
|
|
232
|
+
id: z.ZodNumber;
|
|
233
|
+
key: z.ZodString;
|
|
234
|
+
label: z.ZodString;
|
|
235
|
+
name: z.ZodString;
|
|
236
|
+
value: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
237
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
238
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
239
|
+
readonly "subscriber.sequence_completed": z.ZodObject<{
|
|
240
|
+
subscriber: z.ZodObject<{
|
|
241
|
+
createdAt: z.ZodISODateTime;
|
|
242
|
+
emailAddress: z.ZodEmail;
|
|
243
|
+
fields: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
|
|
244
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
245
|
+
id: z.ZodNumber;
|
|
246
|
+
state: z.ZodEnum<{
|
|
247
|
+
cancelled: "cancelled";
|
|
248
|
+
active: "active";
|
|
249
|
+
inactive: "inactive";
|
|
250
|
+
bounced: "bounced";
|
|
251
|
+
complained: "complained";
|
|
252
|
+
}>;
|
|
253
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
254
|
+
sequence: z.ZodObject<{
|
|
255
|
+
active: z.ZodBoolean;
|
|
256
|
+
createdAt: z.ZodISODateTime;
|
|
257
|
+
emailTemplateId: z.ZodNullable<z.ZodNumber>;
|
|
258
|
+
hold: z.ZodBoolean;
|
|
259
|
+
id: z.ZodNumber;
|
|
260
|
+
name: z.ZodString;
|
|
261
|
+
repeat: z.ZodBoolean;
|
|
262
|
+
updatedAt: z.ZodISODateTime;
|
|
263
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
264
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
265
|
+
readonly "subscriber.subscribed_to_form": z.ZodObject<{
|
|
266
|
+
subscriber: z.ZodObject<{
|
|
267
|
+
createdAt: z.ZodISODateTime;
|
|
268
|
+
emailAddress: z.ZodEmail;
|
|
269
|
+
fields: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
|
|
270
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
271
|
+
id: z.ZodNumber;
|
|
272
|
+
state: z.ZodEnum<{
|
|
273
|
+
cancelled: "cancelled";
|
|
274
|
+
active: "active";
|
|
275
|
+
inactive: "inactive";
|
|
276
|
+
bounced: "bounced";
|
|
277
|
+
complained: "complained";
|
|
278
|
+
}>;
|
|
279
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
280
|
+
form: z.ZodObject<{
|
|
281
|
+
archived: z.ZodBoolean;
|
|
282
|
+
createdAt: z.ZodISODateTime;
|
|
283
|
+
format: z.ZodString;
|
|
284
|
+
id: z.ZodNumber;
|
|
285
|
+
name: z.ZodString;
|
|
286
|
+
type: z.ZodEnum<{
|
|
287
|
+
embed: "embed";
|
|
288
|
+
hosted: "hosted";
|
|
289
|
+
}>;
|
|
290
|
+
uid: z.ZodString;
|
|
291
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
292
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
293
|
+
readonly "subscriber.tag_added": z.ZodObject<{
|
|
294
|
+
subscriber: z.ZodObject<{
|
|
295
|
+
createdAt: z.ZodISODateTime;
|
|
296
|
+
emailAddress: z.ZodEmail;
|
|
297
|
+
fields: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
|
|
298
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
299
|
+
id: z.ZodNumber;
|
|
300
|
+
state: z.ZodEnum<{
|
|
301
|
+
cancelled: "cancelled";
|
|
302
|
+
active: "active";
|
|
303
|
+
inactive: "inactive";
|
|
304
|
+
bounced: "bounced";
|
|
305
|
+
complained: "complained";
|
|
306
|
+
}>;
|
|
307
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
308
|
+
tag: z.ZodObject<{
|
|
309
|
+
createdAt: z.ZodISODateTime;
|
|
310
|
+
id: z.ZodNumber;
|
|
311
|
+
name: z.ZodString;
|
|
312
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
313
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
314
|
+
readonly "subscriber.tag_removed": z.ZodObject<{
|
|
315
|
+
subscriber: z.ZodObject<{
|
|
316
|
+
createdAt: z.ZodISODateTime;
|
|
317
|
+
emailAddress: z.ZodEmail;
|
|
318
|
+
fields: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
|
|
319
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
320
|
+
id: z.ZodNumber;
|
|
321
|
+
state: z.ZodEnum<{
|
|
322
|
+
cancelled: "cancelled";
|
|
323
|
+
active: "active";
|
|
324
|
+
inactive: "inactive";
|
|
325
|
+
bounced: "bounced";
|
|
326
|
+
complained: "complained";
|
|
327
|
+
}>;
|
|
328
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
329
|
+
tag: z.ZodObject<{
|
|
330
|
+
createdAt: z.ZodISODateTime;
|
|
331
|
+
id: z.ZodNumber;
|
|
332
|
+
name: z.ZodString;
|
|
333
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
334
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
335
|
+
readonly "subscriber.unsubscribed": z.ZodObject<{
|
|
336
|
+
subscriber: z.ZodObject<{
|
|
337
|
+
createdAt: z.ZodISODateTime;
|
|
338
|
+
emailAddress: z.ZodEmail;
|
|
339
|
+
fields: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
|
|
340
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
341
|
+
id: z.ZodNumber;
|
|
342
|
+
state: z.ZodEnum<{
|
|
343
|
+
cancelled: "cancelled";
|
|
344
|
+
active: "active";
|
|
345
|
+
inactive: "inactive";
|
|
346
|
+
bounced: "bounced";
|
|
347
|
+
complained: "complained";
|
|
348
|
+
}>;
|
|
349
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
350
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
351
|
+
readonly "tag.created": z.ZodObject<{
|
|
352
|
+
tag: z.ZodObject<{
|
|
353
|
+
createdAt: z.ZodISODateTime;
|
|
354
|
+
id: z.ZodNumber;
|
|
355
|
+
name: z.ZodString;
|
|
356
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
357
|
+
}, z.core.$loose>;
|
|
358
|
+
readonly "tag.deleted": z.ZodObject<{
|
|
359
|
+
tag: z.ZodObject<{
|
|
360
|
+
createdAt: z.ZodISODateTime;
|
|
361
|
+
id: z.ZodNumber;
|
|
362
|
+
name: z.ZodString;
|
|
363
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<Encodable, Encodable>>>>;
|
|
364
|
+
}, z.core.$loose>;
|
|
365
|
+
};
|
|
366
|
+
/** One normalized Kit webhook event narrowed by provider type. */
|
|
367
|
+
export type KitEvent<TType extends KitWebhookEventType = KitWebhookEventType> = TType extends KitWebhookEventType ? {
|
|
368
|
+
readonly [key: string]: Encodable;
|
|
369
|
+
created: string;
|
|
370
|
+
data: z.output<(typeof KIT_EVENT_DATA_SCHEMAS)[TType]> & {
|
|
371
|
+
readonly [key: string]: Encodable;
|
|
372
|
+
};
|
|
373
|
+
id: string;
|
|
374
|
+
type: TType;
|
|
375
|
+
} : never;
|
|
376
|
+
/** One parsed Kit webhook delivery containing one to 100 same-type events. */
|
|
377
|
+
export interface KitWebhookEnvelope {
|
|
378
|
+
readonly [key: string]: Encodable;
|
|
379
|
+
deliveryId: number;
|
|
380
|
+
events: KitEvent[];
|
|
381
|
+
}
|
|
382
|
+
export declare const KIT_TRIGGER_CONFIG_SCHEMA: z.ZodObject<{}, z.core.$strip>;
|
|
383
|
+
/** Validates any currently available normalized Kit event. */
|
|
384
|
+
export declare const KIT_EVENT_SCHEMA: z.ZodType<KitEvent>;
|
|
385
|
+
/** Parses and normalizes Kit's provider-native delivery envelope. */
|
|
386
|
+
export declare const KIT_WEBHOOK_ENVELOPE_SCHEMA: z.ZodType<KitWebhookEnvelope>;
|
|
387
|
+
/** Platform event type emitted for each exact Kit provider event. */
|
|
388
|
+
export declare const KIT_EVENT_TYPE_MAP: {
|
|
389
|
+
readonly "broadcast.created": "kit.broadcast.created";
|
|
390
|
+
readonly "broadcast.deleted": "kit.broadcast.deleted";
|
|
391
|
+
readonly "broadcast.sent": "kit.broadcast.sent";
|
|
392
|
+
readonly "custom_field.created": "kit.customField.created";
|
|
393
|
+
readonly "custom_field.deleted": "kit.customField.deleted";
|
|
394
|
+
readonly "post.published": "kit.post.published";
|
|
395
|
+
readonly "sequence.created": "kit.sequence.created";
|
|
396
|
+
readonly "sequence.deleted": "kit.sequence.deleted";
|
|
397
|
+
readonly "sequence.disabled": "kit.sequence.disabled";
|
|
398
|
+
readonly "sequence.published": "kit.sequence.published";
|
|
399
|
+
readonly "subscriber.activated": "kit.subscriber.activated";
|
|
400
|
+
readonly "subscriber.added_to_sequence": "kit.subscriber.addedToSequence";
|
|
401
|
+
readonly "subscriber.bounced": "kit.subscriber.bounced";
|
|
402
|
+
readonly "subscriber.complained": "kit.subscriber.complained";
|
|
403
|
+
readonly "subscriber.created": "kit.subscriber.created";
|
|
404
|
+
readonly "subscriber.custom_field_value_updated": "kit.subscriber.customFieldValueUpdated";
|
|
405
|
+
readonly "subscriber.sequence_completed": "kit.subscriber.sequenceCompleted";
|
|
406
|
+
readonly "subscriber.subscribed_to_form": "kit.subscriber.subscribedToForm";
|
|
407
|
+
readonly "subscriber.tag_added": "kit.subscriber.tagAdded";
|
|
408
|
+
readonly "subscriber.tag_removed": "kit.subscriber.tagRemoved";
|
|
409
|
+
readonly "subscriber.unsubscribed": "kit.subscriber.unsubscribed";
|
|
410
|
+
readonly "tag.created": "kit.tag.created";
|
|
411
|
+
readonly "tag.deleted": "kit.tag.deleted";
|
|
412
|
+
};
|
|
413
|
+
type KitTriggerContract<TEvent> = {
|
|
414
|
+
readonly configSchema: typeof KIT_TRIGGER_CONFIG_SCHEMA;
|
|
415
|
+
readonly eventSchema: z.ZodType<TEvent>;
|
|
416
|
+
};
|
|
417
|
+
/** Semantic contracts keyed by every public Kit platform event type. */
|
|
418
|
+
type KitSemanticContracts = {
|
|
419
|
+
readonly [TType in KitWebhookEventType as (typeof KIT_EVENT_TYPE_MAP)[TType]]: KitTriggerContract<KitEvent<TType>>;
|
|
420
|
+
} & {
|
|
421
|
+
readonly "kit.event": KitTriggerContract<KitEvent>;
|
|
422
|
+
};
|
|
423
|
+
/** Exact provider-to-platform Kit trigger contract map. */
|
|
424
|
+
export declare const kitTriggerContracts: KitSemanticContracts;
|
|
425
|
+
/**
|
|
426
|
+
* Builds a schema narrowed to one exact Kit webhook event.
|
|
427
|
+
*
|
|
428
|
+
* @param type Provider event type.
|
|
429
|
+
*/
|
|
430
|
+
export declare function kitSemanticEventSchema<TType extends KitWebhookEventType>(type: TType): z.ZodType<KitEvent<TType>>;
|
|
431
|
+
/**
|
|
432
|
+
* Returns the broad and exact platform types for one Kit event.
|
|
433
|
+
*
|
|
434
|
+
* @param type Provider event type.
|
|
435
|
+
*/
|
|
436
|
+
export declare function getKitEventTypes(type: KitWebhookEventType): readonly ["kit.event", "kit.broadcast.created" | "kit.broadcast.deleted" | "kit.broadcast.sent" | "kit.customField.created" | "kit.customField.deleted" | "kit.post.published" | "kit.sequence.created" | "kit.sequence.deleted" | "kit.sequence.disabled" | "kit.sequence.published" | "kit.subscriber.activated" | "kit.subscriber.addedToSequence" | "kit.subscriber.bounced" | "kit.subscriber.complained" | "kit.subscriber.created" | "kit.subscriber.customFieldValueUpdated" | "kit.subscriber.sequenceCompleted" | "kit.subscriber.subscribedToForm" | "kit.subscriber.tagAdded" | "kit.subscriber.tagRemoved" | "kit.subscriber.unsubscribed" | "kit.tag.created" | "kit.tag.deleted"];
|
|
437
|
+
export {};
|