@uniformdev/webhooks 20.31.0 → 20.31.1-alpha.7
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/index.d.mts +584 -638
- package/dist/index.d.ts +584 -638
- package/dist/index.esm.js +47 -51
- package/dist/index.js +47 -51
- package/dist/index.mjs +47 -51
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -3,14 +3,22 @@ import { z as z2 } from "zod";
|
|
|
3
3
|
|
|
4
4
|
// src/definition.ts
|
|
5
5
|
import { z } from "zod";
|
|
6
|
+
var addEventTypeToSchema = (schema, eventType) => z.object({
|
|
7
|
+
...schema.shape,
|
|
8
|
+
eventType: z.literal(eventType)
|
|
9
|
+
});
|
|
6
10
|
var isDefinition = (obj) => {
|
|
7
11
|
return Object.hasOwn(obj, "_definition") && obj["_definition"];
|
|
8
12
|
};
|
|
9
13
|
var definition = (options, example) => {
|
|
10
14
|
return {
|
|
11
15
|
...options,
|
|
16
|
+
schema: addEventTypeToSchema(options.schema, options.event),
|
|
12
17
|
_definition: true,
|
|
13
|
-
example
|
|
18
|
+
example: {
|
|
19
|
+
...example,
|
|
20
|
+
eventType: options.event
|
|
21
|
+
}
|
|
14
22
|
};
|
|
15
23
|
};
|
|
16
24
|
var webhookInitiatorSchema = z.strictObject({
|
|
@@ -39,24 +47,18 @@ var CompositionTriggerPayloadSchema = z2.object({
|
|
|
39
47
|
id: z2.string()
|
|
40
48
|
}).optional()
|
|
41
49
|
});
|
|
42
|
-
var CompositionDeletePayloadSchema = CompositionCorePayloadSchema.
|
|
43
|
-
z2.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
state: z2.number(),
|
|
55
|
-
edit_url: z2.string(),
|
|
56
|
-
api_url: z2.string(),
|
|
57
|
-
edge_url: z2.string()
|
|
58
|
-
})
|
|
59
|
-
);
|
|
50
|
+
var CompositionDeletePayloadSchema = CompositionCorePayloadSchema.extend({
|
|
51
|
+
state: z2.number().optional()
|
|
52
|
+
});
|
|
53
|
+
var CompositionRestorePayloadSchema = CompositionCorePayloadSchema.extend({
|
|
54
|
+
state: z2.number()
|
|
55
|
+
});
|
|
56
|
+
var CompositionPayloadSchema = CompositionCorePayloadSchema.extend({
|
|
57
|
+
state: z2.number(),
|
|
58
|
+
edit_url: z2.string(),
|
|
59
|
+
api_url: z2.string(),
|
|
60
|
+
edge_url: z2.string()
|
|
61
|
+
});
|
|
60
62
|
var ReleaseCompositionPayloadSchema = z2.object({
|
|
61
63
|
release: z2.object({
|
|
62
64
|
id: z2.string(),
|
|
@@ -70,7 +72,7 @@ var CompositionChangedDefinition = definition(
|
|
|
70
72
|
event: "composition.changed",
|
|
71
73
|
name: "Composition Changed",
|
|
72
74
|
description: "Triggers when a composition has been changed.",
|
|
73
|
-
schema: CompositionPayloadSchema.
|
|
75
|
+
schema: CompositionPayloadSchema.extend(CompositionTriggerPayloadSchema.shape)
|
|
74
76
|
},
|
|
75
77
|
{
|
|
76
78
|
id: "0b9d2118-f2d0-4fe6-9d46-7c661abaf474",
|
|
@@ -106,7 +108,7 @@ var CompositionDeletedDefinition = definition(
|
|
|
106
108
|
event: "composition.deleted",
|
|
107
109
|
name: "Composition Deleted",
|
|
108
110
|
description: "Triggers when a composition has been deleted.",
|
|
109
|
-
schema: CompositionDeletePayloadSchema.
|
|
111
|
+
schema: CompositionDeletePayloadSchema.extend(CompositionTriggerPayloadSchema.shape)
|
|
110
112
|
},
|
|
111
113
|
{
|
|
112
114
|
id: "0b9d2118-f2d0-4fe6-9d46-7c661abaf474",
|
|
@@ -139,7 +141,7 @@ var CompositionPublishedDefinition = definition(
|
|
|
139
141
|
event: "composition.published",
|
|
140
142
|
name: "Composition Published",
|
|
141
143
|
description: "Triggers when a composition has been published.",
|
|
142
|
-
schema: CompositionPayloadSchema.
|
|
144
|
+
schema: CompositionPayloadSchema.extend(CompositionTriggerPayloadSchema.shape)
|
|
143
145
|
},
|
|
144
146
|
{
|
|
145
147
|
id: "0b9d2118-f2d0-4fe6-9d46-7c661abaf474",
|
|
@@ -175,7 +177,7 @@ var CompositionReleaseChangedDefinition = definition(
|
|
|
175
177
|
event: "composition.release.changed",
|
|
176
178
|
name: "Composition Changed on Release",
|
|
177
179
|
description: "Triggers when a composition has been changed or copied to a pre-launch release.",
|
|
178
|
-
schema: CompositionPayloadSchema.
|
|
180
|
+
schema: CompositionPayloadSchema.extend(ReleaseCompositionPayloadSchema.shape)
|
|
179
181
|
},
|
|
180
182
|
{
|
|
181
183
|
release: {
|
|
@@ -211,7 +213,7 @@ var CompositionReleaseDeletedDefinition = definition(
|
|
|
211
213
|
event: "composition.release.deleted",
|
|
212
214
|
name: "Composition Deleted on Release",
|
|
213
215
|
description: "Triggers when a composition is deleted that is attached to a pre-launch release.",
|
|
214
|
-
schema: CompositionDeletePayloadSchema.
|
|
216
|
+
schema: CompositionDeletePayloadSchema.extend(ReleaseCompositionPayloadSchema.shape)
|
|
215
217
|
},
|
|
216
218
|
{
|
|
217
219
|
release: {
|
|
@@ -244,7 +246,7 @@ var CompositionReleasePublishedDefinition = definition(
|
|
|
244
246
|
event: "composition.release.published",
|
|
245
247
|
name: "Composition Published on Release",
|
|
246
248
|
description: "Triggers when a composition has been published that is attached to an pre-launch release.",
|
|
247
|
-
schema: CompositionPayloadSchema.
|
|
249
|
+
schema: CompositionPayloadSchema.extend(ReleaseCompositionPayloadSchema.shape)
|
|
248
250
|
},
|
|
249
251
|
{
|
|
250
252
|
release: {
|
|
@@ -280,7 +282,7 @@ var CompositionReleaseRestoredDefinition = definition(
|
|
|
280
282
|
event: "composition.release.restored",
|
|
281
283
|
name: "Composition Restored on Release",
|
|
282
284
|
description: "Triggers when a composition deleted in a pre-launch release is restored.",
|
|
283
|
-
schema: CompositionRestorePayloadSchema.
|
|
285
|
+
schema: CompositionRestorePayloadSchema.extend(ReleaseCompositionPayloadSchema.shape)
|
|
284
286
|
},
|
|
285
287
|
{
|
|
286
288
|
release: {
|
|
@@ -327,24 +329,18 @@ var EntryTriggerPayloadSchema = z3.object({
|
|
|
327
329
|
id: z3.string()
|
|
328
330
|
}).optional()
|
|
329
331
|
});
|
|
330
|
-
var EntryDeletePayloadSchema = EntryCorePayloadSchema.
|
|
331
|
-
z3.
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
)
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
)
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
state: z3.number(),
|
|
343
|
-
edit_url: z3.string(),
|
|
344
|
-
api_url: z3.string(),
|
|
345
|
-
edge_url: z3.string()
|
|
346
|
-
})
|
|
347
|
-
);
|
|
332
|
+
var EntryDeletePayloadSchema = EntryCorePayloadSchema.extend({
|
|
333
|
+
state: z3.number().optional()
|
|
334
|
+
});
|
|
335
|
+
var EntryRestorePayloadSchema = EntryCorePayloadSchema.extend({
|
|
336
|
+
state: z3.number()
|
|
337
|
+
});
|
|
338
|
+
var EntryPayloadSchema = EntryCorePayloadSchema.extend({
|
|
339
|
+
state: z3.number(),
|
|
340
|
+
edit_url: z3.string(),
|
|
341
|
+
api_url: z3.string(),
|
|
342
|
+
edge_url: z3.string()
|
|
343
|
+
});
|
|
348
344
|
var ReleaseEntryPayloadSchema = z3.object({
|
|
349
345
|
release: z3.object({
|
|
350
346
|
id: z3.string(),
|
|
@@ -358,7 +354,7 @@ var EntryChangedDefinition = definition(
|
|
|
358
354
|
event: "entry.changed",
|
|
359
355
|
name: "Entry Changed",
|
|
360
356
|
description: "Triggers when an entry has been changed.",
|
|
361
|
-
schema: EntryPayloadSchema.
|
|
357
|
+
schema: EntryPayloadSchema.extend(EntryTriggerPayloadSchema.shape)
|
|
362
358
|
},
|
|
363
359
|
{
|
|
364
360
|
id: "e5c95c60-314b-4700-9035-6f9c2a4ff800",
|
|
@@ -394,7 +390,7 @@ var EntryDeletedDefinition = definition(
|
|
|
394
390
|
event: "entry.deleted",
|
|
395
391
|
name: "Entry Deleted",
|
|
396
392
|
description: "Triggers when an entry has been deleted.",
|
|
397
|
-
schema: EntryDeletePayloadSchema.
|
|
393
|
+
schema: EntryDeletePayloadSchema.extend(EntryTriggerPayloadSchema.shape)
|
|
398
394
|
},
|
|
399
395
|
{
|
|
400
396
|
id: "e5c95c60-314b-4700-9035-6f9c2a4ff800",
|
|
@@ -427,7 +423,7 @@ var EntryPublishedDefinition = definition(
|
|
|
427
423
|
event: "entry.published",
|
|
428
424
|
name: "Entry Published",
|
|
429
425
|
description: "Triggers when an entry has been published.",
|
|
430
|
-
schema: EntryPayloadSchema.
|
|
426
|
+
schema: EntryPayloadSchema.extend(EntryTriggerPayloadSchema.shape)
|
|
431
427
|
},
|
|
432
428
|
{
|
|
433
429
|
id: "e5c95c60-314b-4700-9035-6f9c2a4ff800",
|
|
@@ -463,7 +459,7 @@ var EntryReleaseChangedDefinition = definition(
|
|
|
463
459
|
event: "entry.release.changed",
|
|
464
460
|
name: "Entry Changed on Release",
|
|
465
461
|
description: "Triggers when an entry has been changed that is attached to a pre-launch release.",
|
|
466
|
-
schema: EntryPayloadSchema.
|
|
462
|
+
schema: EntryPayloadSchema.extend(ReleaseEntryPayloadSchema.shape)
|
|
467
463
|
},
|
|
468
464
|
{
|
|
469
465
|
release: {
|
|
@@ -499,7 +495,7 @@ var EntryReleaseDeletedDefinition = definition(
|
|
|
499
495
|
event: "entry.release.deleted",
|
|
500
496
|
name: "Entry Deleted on Release",
|
|
501
497
|
description: "Triggers when an entry has been deleted that is attached to a pre-launch release.",
|
|
502
|
-
schema: EntryDeletePayloadSchema.
|
|
498
|
+
schema: EntryDeletePayloadSchema.extend(ReleaseEntryPayloadSchema.shape)
|
|
503
499
|
},
|
|
504
500
|
{
|
|
505
501
|
release: {
|
|
@@ -532,7 +528,7 @@ var EntryReleasePublishedDefinition = definition(
|
|
|
532
528
|
event: "entry.release.published",
|
|
533
529
|
name: "Entry Published on Release",
|
|
534
530
|
description: "Triggers when an entry has been published that is attached to a pre-launch release.",
|
|
535
|
-
schema: EntryPayloadSchema.
|
|
531
|
+
schema: EntryPayloadSchema.extend(ReleaseEntryPayloadSchema.shape)
|
|
536
532
|
},
|
|
537
533
|
{
|
|
538
534
|
release: {
|
|
@@ -568,7 +564,7 @@ var EntryReleaseRestoredDefinition = definition(
|
|
|
568
564
|
event: "entry.release.restored",
|
|
569
565
|
name: "Entry Restored on Release",
|
|
570
566
|
description: "Triggers when an entry deleted in a pre-launch release is restored.",
|
|
571
|
-
schema: EntryRestorePayloadSchema.
|
|
567
|
+
schema: EntryRestorePayloadSchema.extend(ReleaseEntryPayloadSchema.shape)
|
|
572
568
|
},
|
|
573
569
|
{
|
|
574
570
|
release: {
|
package/dist/index.js
CHANGED
|
@@ -102,14 +102,22 @@ var import_zod2 = require("zod");
|
|
|
102
102
|
|
|
103
103
|
// src/definition.ts
|
|
104
104
|
var import_zod = require("zod");
|
|
105
|
+
var addEventTypeToSchema = (schema, eventType) => import_zod.z.object({
|
|
106
|
+
...schema.shape,
|
|
107
|
+
eventType: import_zod.z.literal(eventType)
|
|
108
|
+
});
|
|
105
109
|
var isDefinition = (obj) => {
|
|
106
110
|
return Object.hasOwn(obj, "_definition") && obj["_definition"];
|
|
107
111
|
};
|
|
108
112
|
var definition = (options, example) => {
|
|
109
113
|
return {
|
|
110
114
|
...options,
|
|
115
|
+
schema: addEventTypeToSchema(options.schema, options.event),
|
|
111
116
|
_definition: true,
|
|
112
|
-
example
|
|
117
|
+
example: {
|
|
118
|
+
...example,
|
|
119
|
+
eventType: options.event
|
|
120
|
+
}
|
|
113
121
|
};
|
|
114
122
|
};
|
|
115
123
|
var webhookInitiatorSchema = import_zod.z.strictObject({
|
|
@@ -138,24 +146,18 @@ var CompositionTriggerPayloadSchema = import_zod2.z.object({
|
|
|
138
146
|
id: import_zod2.z.string()
|
|
139
147
|
}).optional()
|
|
140
148
|
});
|
|
141
|
-
var CompositionDeletePayloadSchema = CompositionCorePayloadSchema.
|
|
142
|
-
import_zod2.z.
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
)
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
)
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
state: import_zod2.z.number(),
|
|
154
|
-
edit_url: import_zod2.z.string(),
|
|
155
|
-
api_url: import_zod2.z.string(),
|
|
156
|
-
edge_url: import_zod2.z.string()
|
|
157
|
-
})
|
|
158
|
-
);
|
|
149
|
+
var CompositionDeletePayloadSchema = CompositionCorePayloadSchema.extend({
|
|
150
|
+
state: import_zod2.z.number().optional()
|
|
151
|
+
});
|
|
152
|
+
var CompositionRestorePayloadSchema = CompositionCorePayloadSchema.extend({
|
|
153
|
+
state: import_zod2.z.number()
|
|
154
|
+
});
|
|
155
|
+
var CompositionPayloadSchema = CompositionCorePayloadSchema.extend({
|
|
156
|
+
state: import_zod2.z.number(),
|
|
157
|
+
edit_url: import_zod2.z.string(),
|
|
158
|
+
api_url: import_zod2.z.string(),
|
|
159
|
+
edge_url: import_zod2.z.string()
|
|
160
|
+
});
|
|
159
161
|
var ReleaseCompositionPayloadSchema = import_zod2.z.object({
|
|
160
162
|
release: import_zod2.z.object({
|
|
161
163
|
id: import_zod2.z.string(),
|
|
@@ -169,7 +171,7 @@ var CompositionChangedDefinition = definition(
|
|
|
169
171
|
event: "composition.changed",
|
|
170
172
|
name: "Composition Changed",
|
|
171
173
|
description: "Triggers when a composition has been changed.",
|
|
172
|
-
schema: CompositionPayloadSchema.
|
|
174
|
+
schema: CompositionPayloadSchema.extend(CompositionTriggerPayloadSchema.shape)
|
|
173
175
|
},
|
|
174
176
|
{
|
|
175
177
|
id: "0b9d2118-f2d0-4fe6-9d46-7c661abaf474",
|
|
@@ -205,7 +207,7 @@ var CompositionDeletedDefinition = definition(
|
|
|
205
207
|
event: "composition.deleted",
|
|
206
208
|
name: "Composition Deleted",
|
|
207
209
|
description: "Triggers when a composition has been deleted.",
|
|
208
|
-
schema: CompositionDeletePayloadSchema.
|
|
210
|
+
schema: CompositionDeletePayloadSchema.extend(CompositionTriggerPayloadSchema.shape)
|
|
209
211
|
},
|
|
210
212
|
{
|
|
211
213
|
id: "0b9d2118-f2d0-4fe6-9d46-7c661abaf474",
|
|
@@ -238,7 +240,7 @@ var CompositionPublishedDefinition = definition(
|
|
|
238
240
|
event: "composition.published",
|
|
239
241
|
name: "Composition Published",
|
|
240
242
|
description: "Triggers when a composition has been published.",
|
|
241
|
-
schema: CompositionPayloadSchema.
|
|
243
|
+
schema: CompositionPayloadSchema.extend(CompositionTriggerPayloadSchema.shape)
|
|
242
244
|
},
|
|
243
245
|
{
|
|
244
246
|
id: "0b9d2118-f2d0-4fe6-9d46-7c661abaf474",
|
|
@@ -274,7 +276,7 @@ var CompositionReleaseChangedDefinition = definition(
|
|
|
274
276
|
event: "composition.release.changed",
|
|
275
277
|
name: "Composition Changed on Release",
|
|
276
278
|
description: "Triggers when a composition has been changed or copied to a pre-launch release.",
|
|
277
|
-
schema: CompositionPayloadSchema.
|
|
279
|
+
schema: CompositionPayloadSchema.extend(ReleaseCompositionPayloadSchema.shape)
|
|
278
280
|
},
|
|
279
281
|
{
|
|
280
282
|
release: {
|
|
@@ -310,7 +312,7 @@ var CompositionReleaseDeletedDefinition = definition(
|
|
|
310
312
|
event: "composition.release.deleted",
|
|
311
313
|
name: "Composition Deleted on Release",
|
|
312
314
|
description: "Triggers when a composition is deleted that is attached to a pre-launch release.",
|
|
313
|
-
schema: CompositionDeletePayloadSchema.
|
|
315
|
+
schema: CompositionDeletePayloadSchema.extend(ReleaseCompositionPayloadSchema.shape)
|
|
314
316
|
},
|
|
315
317
|
{
|
|
316
318
|
release: {
|
|
@@ -343,7 +345,7 @@ var CompositionReleasePublishedDefinition = definition(
|
|
|
343
345
|
event: "composition.release.published",
|
|
344
346
|
name: "Composition Published on Release",
|
|
345
347
|
description: "Triggers when a composition has been published that is attached to an pre-launch release.",
|
|
346
|
-
schema: CompositionPayloadSchema.
|
|
348
|
+
schema: CompositionPayloadSchema.extend(ReleaseCompositionPayloadSchema.shape)
|
|
347
349
|
},
|
|
348
350
|
{
|
|
349
351
|
release: {
|
|
@@ -379,7 +381,7 @@ var CompositionReleaseRestoredDefinition = definition(
|
|
|
379
381
|
event: "composition.release.restored",
|
|
380
382
|
name: "Composition Restored on Release",
|
|
381
383
|
description: "Triggers when a composition deleted in a pre-launch release is restored.",
|
|
382
|
-
schema: CompositionRestorePayloadSchema.
|
|
384
|
+
schema: CompositionRestorePayloadSchema.extend(ReleaseCompositionPayloadSchema.shape)
|
|
383
385
|
},
|
|
384
386
|
{
|
|
385
387
|
release: {
|
|
@@ -426,24 +428,18 @@ var EntryTriggerPayloadSchema = import_zod3.z.object({
|
|
|
426
428
|
id: import_zod3.z.string()
|
|
427
429
|
}).optional()
|
|
428
430
|
});
|
|
429
|
-
var EntryDeletePayloadSchema = EntryCorePayloadSchema.
|
|
430
|
-
import_zod3.z.
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
)
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
)
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
state: import_zod3.z.number(),
|
|
442
|
-
edit_url: import_zod3.z.string(),
|
|
443
|
-
api_url: import_zod3.z.string(),
|
|
444
|
-
edge_url: import_zod3.z.string()
|
|
445
|
-
})
|
|
446
|
-
);
|
|
431
|
+
var EntryDeletePayloadSchema = EntryCorePayloadSchema.extend({
|
|
432
|
+
state: import_zod3.z.number().optional()
|
|
433
|
+
});
|
|
434
|
+
var EntryRestorePayloadSchema = EntryCorePayloadSchema.extend({
|
|
435
|
+
state: import_zod3.z.number()
|
|
436
|
+
});
|
|
437
|
+
var EntryPayloadSchema = EntryCorePayloadSchema.extend({
|
|
438
|
+
state: import_zod3.z.number(),
|
|
439
|
+
edit_url: import_zod3.z.string(),
|
|
440
|
+
api_url: import_zod3.z.string(),
|
|
441
|
+
edge_url: import_zod3.z.string()
|
|
442
|
+
});
|
|
447
443
|
var ReleaseEntryPayloadSchema = import_zod3.z.object({
|
|
448
444
|
release: import_zod3.z.object({
|
|
449
445
|
id: import_zod3.z.string(),
|
|
@@ -457,7 +453,7 @@ var EntryChangedDefinition = definition(
|
|
|
457
453
|
event: "entry.changed",
|
|
458
454
|
name: "Entry Changed",
|
|
459
455
|
description: "Triggers when an entry has been changed.",
|
|
460
|
-
schema: EntryPayloadSchema.
|
|
456
|
+
schema: EntryPayloadSchema.extend(EntryTriggerPayloadSchema.shape)
|
|
461
457
|
},
|
|
462
458
|
{
|
|
463
459
|
id: "e5c95c60-314b-4700-9035-6f9c2a4ff800",
|
|
@@ -493,7 +489,7 @@ var EntryDeletedDefinition = definition(
|
|
|
493
489
|
event: "entry.deleted",
|
|
494
490
|
name: "Entry Deleted",
|
|
495
491
|
description: "Triggers when an entry has been deleted.",
|
|
496
|
-
schema: EntryDeletePayloadSchema.
|
|
492
|
+
schema: EntryDeletePayloadSchema.extend(EntryTriggerPayloadSchema.shape)
|
|
497
493
|
},
|
|
498
494
|
{
|
|
499
495
|
id: "e5c95c60-314b-4700-9035-6f9c2a4ff800",
|
|
@@ -526,7 +522,7 @@ var EntryPublishedDefinition = definition(
|
|
|
526
522
|
event: "entry.published",
|
|
527
523
|
name: "Entry Published",
|
|
528
524
|
description: "Triggers when an entry has been published.",
|
|
529
|
-
schema: EntryPayloadSchema.
|
|
525
|
+
schema: EntryPayloadSchema.extend(EntryTriggerPayloadSchema.shape)
|
|
530
526
|
},
|
|
531
527
|
{
|
|
532
528
|
id: "e5c95c60-314b-4700-9035-6f9c2a4ff800",
|
|
@@ -562,7 +558,7 @@ var EntryReleaseChangedDefinition = definition(
|
|
|
562
558
|
event: "entry.release.changed",
|
|
563
559
|
name: "Entry Changed on Release",
|
|
564
560
|
description: "Triggers when an entry has been changed that is attached to a pre-launch release.",
|
|
565
|
-
schema: EntryPayloadSchema.
|
|
561
|
+
schema: EntryPayloadSchema.extend(ReleaseEntryPayloadSchema.shape)
|
|
566
562
|
},
|
|
567
563
|
{
|
|
568
564
|
release: {
|
|
@@ -598,7 +594,7 @@ var EntryReleaseDeletedDefinition = definition(
|
|
|
598
594
|
event: "entry.release.deleted",
|
|
599
595
|
name: "Entry Deleted on Release",
|
|
600
596
|
description: "Triggers when an entry has been deleted that is attached to a pre-launch release.",
|
|
601
|
-
schema: EntryDeletePayloadSchema.
|
|
597
|
+
schema: EntryDeletePayloadSchema.extend(ReleaseEntryPayloadSchema.shape)
|
|
602
598
|
},
|
|
603
599
|
{
|
|
604
600
|
release: {
|
|
@@ -631,7 +627,7 @@ var EntryReleasePublishedDefinition = definition(
|
|
|
631
627
|
event: "entry.release.published",
|
|
632
628
|
name: "Entry Published on Release",
|
|
633
629
|
description: "Triggers when an entry has been published that is attached to a pre-launch release.",
|
|
634
|
-
schema: EntryPayloadSchema.
|
|
630
|
+
schema: EntryPayloadSchema.extend(ReleaseEntryPayloadSchema.shape)
|
|
635
631
|
},
|
|
636
632
|
{
|
|
637
633
|
release: {
|
|
@@ -667,7 +663,7 @@ var EntryReleaseRestoredDefinition = definition(
|
|
|
667
663
|
event: "entry.release.restored",
|
|
668
664
|
name: "Entry Restored on Release",
|
|
669
665
|
description: "Triggers when an entry deleted in a pre-launch release is restored.",
|
|
670
|
-
schema: EntryRestorePayloadSchema.
|
|
666
|
+
schema: EntryRestorePayloadSchema.extend(ReleaseEntryPayloadSchema.shape)
|
|
671
667
|
},
|
|
672
668
|
{
|
|
673
669
|
release: {
|
package/dist/index.mjs
CHANGED
|
@@ -3,14 +3,22 @@ import { z as z2 } from "zod";
|
|
|
3
3
|
|
|
4
4
|
// src/definition.ts
|
|
5
5
|
import { z } from "zod";
|
|
6
|
+
var addEventTypeToSchema = (schema, eventType) => z.object({
|
|
7
|
+
...schema.shape,
|
|
8
|
+
eventType: z.literal(eventType)
|
|
9
|
+
});
|
|
6
10
|
var isDefinition = (obj) => {
|
|
7
11
|
return Object.hasOwn(obj, "_definition") && obj["_definition"];
|
|
8
12
|
};
|
|
9
13
|
var definition = (options, example) => {
|
|
10
14
|
return {
|
|
11
15
|
...options,
|
|
16
|
+
schema: addEventTypeToSchema(options.schema, options.event),
|
|
12
17
|
_definition: true,
|
|
13
|
-
example
|
|
18
|
+
example: {
|
|
19
|
+
...example,
|
|
20
|
+
eventType: options.event
|
|
21
|
+
}
|
|
14
22
|
};
|
|
15
23
|
};
|
|
16
24
|
var webhookInitiatorSchema = z.strictObject({
|
|
@@ -39,24 +47,18 @@ var CompositionTriggerPayloadSchema = z2.object({
|
|
|
39
47
|
id: z2.string()
|
|
40
48
|
}).optional()
|
|
41
49
|
});
|
|
42
|
-
var CompositionDeletePayloadSchema = CompositionCorePayloadSchema.
|
|
43
|
-
z2.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
state: z2.number(),
|
|
55
|
-
edit_url: z2.string(),
|
|
56
|
-
api_url: z2.string(),
|
|
57
|
-
edge_url: z2.string()
|
|
58
|
-
})
|
|
59
|
-
);
|
|
50
|
+
var CompositionDeletePayloadSchema = CompositionCorePayloadSchema.extend({
|
|
51
|
+
state: z2.number().optional()
|
|
52
|
+
});
|
|
53
|
+
var CompositionRestorePayloadSchema = CompositionCorePayloadSchema.extend({
|
|
54
|
+
state: z2.number()
|
|
55
|
+
});
|
|
56
|
+
var CompositionPayloadSchema = CompositionCorePayloadSchema.extend({
|
|
57
|
+
state: z2.number(),
|
|
58
|
+
edit_url: z2.string(),
|
|
59
|
+
api_url: z2.string(),
|
|
60
|
+
edge_url: z2.string()
|
|
61
|
+
});
|
|
60
62
|
var ReleaseCompositionPayloadSchema = z2.object({
|
|
61
63
|
release: z2.object({
|
|
62
64
|
id: z2.string(),
|
|
@@ -70,7 +72,7 @@ var CompositionChangedDefinition = definition(
|
|
|
70
72
|
event: "composition.changed",
|
|
71
73
|
name: "Composition Changed",
|
|
72
74
|
description: "Triggers when a composition has been changed.",
|
|
73
|
-
schema: CompositionPayloadSchema.
|
|
75
|
+
schema: CompositionPayloadSchema.extend(CompositionTriggerPayloadSchema.shape)
|
|
74
76
|
},
|
|
75
77
|
{
|
|
76
78
|
id: "0b9d2118-f2d0-4fe6-9d46-7c661abaf474",
|
|
@@ -106,7 +108,7 @@ var CompositionDeletedDefinition = definition(
|
|
|
106
108
|
event: "composition.deleted",
|
|
107
109
|
name: "Composition Deleted",
|
|
108
110
|
description: "Triggers when a composition has been deleted.",
|
|
109
|
-
schema: CompositionDeletePayloadSchema.
|
|
111
|
+
schema: CompositionDeletePayloadSchema.extend(CompositionTriggerPayloadSchema.shape)
|
|
110
112
|
},
|
|
111
113
|
{
|
|
112
114
|
id: "0b9d2118-f2d0-4fe6-9d46-7c661abaf474",
|
|
@@ -139,7 +141,7 @@ var CompositionPublishedDefinition = definition(
|
|
|
139
141
|
event: "composition.published",
|
|
140
142
|
name: "Composition Published",
|
|
141
143
|
description: "Triggers when a composition has been published.",
|
|
142
|
-
schema: CompositionPayloadSchema.
|
|
144
|
+
schema: CompositionPayloadSchema.extend(CompositionTriggerPayloadSchema.shape)
|
|
143
145
|
},
|
|
144
146
|
{
|
|
145
147
|
id: "0b9d2118-f2d0-4fe6-9d46-7c661abaf474",
|
|
@@ -175,7 +177,7 @@ var CompositionReleaseChangedDefinition = definition(
|
|
|
175
177
|
event: "composition.release.changed",
|
|
176
178
|
name: "Composition Changed on Release",
|
|
177
179
|
description: "Triggers when a composition has been changed or copied to a pre-launch release.",
|
|
178
|
-
schema: CompositionPayloadSchema.
|
|
180
|
+
schema: CompositionPayloadSchema.extend(ReleaseCompositionPayloadSchema.shape)
|
|
179
181
|
},
|
|
180
182
|
{
|
|
181
183
|
release: {
|
|
@@ -211,7 +213,7 @@ var CompositionReleaseDeletedDefinition = definition(
|
|
|
211
213
|
event: "composition.release.deleted",
|
|
212
214
|
name: "Composition Deleted on Release",
|
|
213
215
|
description: "Triggers when a composition is deleted that is attached to a pre-launch release.",
|
|
214
|
-
schema: CompositionDeletePayloadSchema.
|
|
216
|
+
schema: CompositionDeletePayloadSchema.extend(ReleaseCompositionPayloadSchema.shape)
|
|
215
217
|
},
|
|
216
218
|
{
|
|
217
219
|
release: {
|
|
@@ -244,7 +246,7 @@ var CompositionReleasePublishedDefinition = definition(
|
|
|
244
246
|
event: "composition.release.published",
|
|
245
247
|
name: "Composition Published on Release",
|
|
246
248
|
description: "Triggers when a composition has been published that is attached to an pre-launch release.",
|
|
247
|
-
schema: CompositionPayloadSchema.
|
|
249
|
+
schema: CompositionPayloadSchema.extend(ReleaseCompositionPayloadSchema.shape)
|
|
248
250
|
},
|
|
249
251
|
{
|
|
250
252
|
release: {
|
|
@@ -280,7 +282,7 @@ var CompositionReleaseRestoredDefinition = definition(
|
|
|
280
282
|
event: "composition.release.restored",
|
|
281
283
|
name: "Composition Restored on Release",
|
|
282
284
|
description: "Triggers when a composition deleted in a pre-launch release is restored.",
|
|
283
|
-
schema: CompositionRestorePayloadSchema.
|
|
285
|
+
schema: CompositionRestorePayloadSchema.extend(ReleaseCompositionPayloadSchema.shape)
|
|
284
286
|
},
|
|
285
287
|
{
|
|
286
288
|
release: {
|
|
@@ -327,24 +329,18 @@ var EntryTriggerPayloadSchema = z3.object({
|
|
|
327
329
|
id: z3.string()
|
|
328
330
|
}).optional()
|
|
329
331
|
});
|
|
330
|
-
var EntryDeletePayloadSchema = EntryCorePayloadSchema.
|
|
331
|
-
z3.
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
)
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
)
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
state: z3.number(),
|
|
343
|
-
edit_url: z3.string(),
|
|
344
|
-
api_url: z3.string(),
|
|
345
|
-
edge_url: z3.string()
|
|
346
|
-
})
|
|
347
|
-
);
|
|
332
|
+
var EntryDeletePayloadSchema = EntryCorePayloadSchema.extend({
|
|
333
|
+
state: z3.number().optional()
|
|
334
|
+
});
|
|
335
|
+
var EntryRestorePayloadSchema = EntryCorePayloadSchema.extend({
|
|
336
|
+
state: z3.number()
|
|
337
|
+
});
|
|
338
|
+
var EntryPayloadSchema = EntryCorePayloadSchema.extend({
|
|
339
|
+
state: z3.number(),
|
|
340
|
+
edit_url: z3.string(),
|
|
341
|
+
api_url: z3.string(),
|
|
342
|
+
edge_url: z3.string()
|
|
343
|
+
});
|
|
348
344
|
var ReleaseEntryPayloadSchema = z3.object({
|
|
349
345
|
release: z3.object({
|
|
350
346
|
id: z3.string(),
|
|
@@ -358,7 +354,7 @@ var EntryChangedDefinition = definition(
|
|
|
358
354
|
event: "entry.changed",
|
|
359
355
|
name: "Entry Changed",
|
|
360
356
|
description: "Triggers when an entry has been changed.",
|
|
361
|
-
schema: EntryPayloadSchema.
|
|
357
|
+
schema: EntryPayloadSchema.extend(EntryTriggerPayloadSchema.shape)
|
|
362
358
|
},
|
|
363
359
|
{
|
|
364
360
|
id: "e5c95c60-314b-4700-9035-6f9c2a4ff800",
|
|
@@ -394,7 +390,7 @@ var EntryDeletedDefinition = definition(
|
|
|
394
390
|
event: "entry.deleted",
|
|
395
391
|
name: "Entry Deleted",
|
|
396
392
|
description: "Triggers when an entry has been deleted.",
|
|
397
|
-
schema: EntryDeletePayloadSchema.
|
|
393
|
+
schema: EntryDeletePayloadSchema.extend(EntryTriggerPayloadSchema.shape)
|
|
398
394
|
},
|
|
399
395
|
{
|
|
400
396
|
id: "e5c95c60-314b-4700-9035-6f9c2a4ff800",
|
|
@@ -427,7 +423,7 @@ var EntryPublishedDefinition = definition(
|
|
|
427
423
|
event: "entry.published",
|
|
428
424
|
name: "Entry Published",
|
|
429
425
|
description: "Triggers when an entry has been published.",
|
|
430
|
-
schema: EntryPayloadSchema.
|
|
426
|
+
schema: EntryPayloadSchema.extend(EntryTriggerPayloadSchema.shape)
|
|
431
427
|
},
|
|
432
428
|
{
|
|
433
429
|
id: "e5c95c60-314b-4700-9035-6f9c2a4ff800",
|
|
@@ -463,7 +459,7 @@ var EntryReleaseChangedDefinition = definition(
|
|
|
463
459
|
event: "entry.release.changed",
|
|
464
460
|
name: "Entry Changed on Release",
|
|
465
461
|
description: "Triggers when an entry has been changed that is attached to a pre-launch release.",
|
|
466
|
-
schema: EntryPayloadSchema.
|
|
462
|
+
schema: EntryPayloadSchema.extend(ReleaseEntryPayloadSchema.shape)
|
|
467
463
|
},
|
|
468
464
|
{
|
|
469
465
|
release: {
|
|
@@ -499,7 +495,7 @@ var EntryReleaseDeletedDefinition = definition(
|
|
|
499
495
|
event: "entry.release.deleted",
|
|
500
496
|
name: "Entry Deleted on Release",
|
|
501
497
|
description: "Triggers when an entry has been deleted that is attached to a pre-launch release.",
|
|
502
|
-
schema: EntryDeletePayloadSchema.
|
|
498
|
+
schema: EntryDeletePayloadSchema.extend(ReleaseEntryPayloadSchema.shape)
|
|
503
499
|
},
|
|
504
500
|
{
|
|
505
501
|
release: {
|
|
@@ -532,7 +528,7 @@ var EntryReleasePublishedDefinition = definition(
|
|
|
532
528
|
event: "entry.release.published",
|
|
533
529
|
name: "Entry Published on Release",
|
|
534
530
|
description: "Triggers when an entry has been published that is attached to a pre-launch release.",
|
|
535
|
-
schema: EntryPayloadSchema.
|
|
531
|
+
schema: EntryPayloadSchema.extend(ReleaseEntryPayloadSchema.shape)
|
|
536
532
|
},
|
|
537
533
|
{
|
|
538
534
|
release: {
|
|
@@ -568,7 +564,7 @@ var EntryReleaseRestoredDefinition = definition(
|
|
|
568
564
|
event: "entry.release.restored",
|
|
569
565
|
name: "Entry Restored on Release",
|
|
570
566
|
description: "Triggers when an entry deleted in a pre-launch release is restored.",
|
|
571
|
-
schema: EntryRestorePayloadSchema.
|
|
567
|
+
schema: EntryRestorePayloadSchema.extend(ReleaseEntryPayloadSchema.shape)
|
|
572
568
|
},
|
|
573
569
|
{
|
|
574
570
|
release: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/webhooks",
|
|
3
|
-
"version": "20.31.
|
|
3
|
+
"version": "20.31.1-alpha.7+9d96376c09",
|
|
4
4
|
"description": "Uniform Webhooks",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "9d96376c09c3471f9ed1810db163c825314f9146"
|
|
45
45
|
}
|