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