@uniformdev/webhooks 20.49.2 → 20.49.3-alpha.47

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.esm.js CHANGED
@@ -1,8 +1,5 @@
1
- // src/composition/common.ts
2
- import * as z2 from "zod/v3";
3
-
4
1
  // src/definition.ts
5
- import * as z from "zod/v3";
2
+ import * as z from "zod";
6
3
  var addEventTypeToSchema = (schema, eventType) => z.object({
7
4
  ...schema.shape,
8
5
  eventType: z.literal(eventType)
@@ -28,11 +25,10 @@ var webhookInitiatorSchema = z.strictObject({
28
25
  is_api_key: z.boolean()
29
26
  });
30
27
 
31
- // src/composition/common.ts
32
- var CompositionCorePayloadSchema = z2.object({
28
+ // src/asset/common.ts
29
+ import * as z2 from "zod";
30
+ var AssetCorePayloadSchema = z2.object({
33
31
  id: z2.string(),
34
- editionId: z2.string().optional(),
35
- slug: z2.string().optional(),
36
32
  name: z2.string(),
37
33
  type: z2.string(),
38
34
  project: z2.object({
@@ -41,28 +37,102 @@ var CompositionCorePayloadSchema = z2.object({
41
37
  }),
42
38
  initiator: webhookInitiatorSchema
43
39
  });
44
- var CompositionTriggerPayloadSchema = z2.object({
45
- trigger: z2.object({
46
- type: z2.enum(["release"]),
47
- id: z2.string()
40
+ var AssetPayloadSchema = AssetCorePayloadSchema.extend({
41
+ api_url: z2.string(),
42
+ edit_url: z2.string()
43
+ });
44
+ var AssetDeletePayloadSchema = AssetCorePayloadSchema;
45
+
46
+ // src/asset/asset.deleted.ts
47
+ var AssetDeletedDefinition = definition(
48
+ {
49
+ event: "asset.deleted",
50
+ name: "Asset Deleted",
51
+ description: "Triggers when an asset has been deleted.",
52
+ schema: AssetDeletePayloadSchema
53
+ },
54
+ {
55
+ id: "9e02e29f-116f-4ad0-beac-910944144d22",
56
+ name: "Some asset",
57
+ type: "image",
58
+ project: {
59
+ id: "9b4e1604-6033-4c86-a189-5bebe2478613",
60
+ url: `https://uniform.app/projects/9b4e1604-6033-4c86-a189-5bebe2478613`
61
+ },
62
+ initiator: {
63
+ id: "useruniqueid",
64
+ email: "foo@bar.com",
65
+ name: "A User",
66
+ is_api_key: false
67
+ }
68
+ }
69
+ );
70
+ var AssetDeletedEventName = AssetDeletedDefinition["event"];
71
+
72
+ // src/asset/asset.published.ts
73
+ var AssetPublishedDefinition = definition(
74
+ {
75
+ event: "asset.published",
76
+ name: "Asset Published",
77
+ description: "Triggers when an asset has been published.",
78
+ schema: AssetPayloadSchema
79
+ },
80
+ {
81
+ id: "9e02e29f-116f-4ad0-beac-910944144d22",
82
+ name: "Some asset",
83
+ type: "image",
84
+ project: {
85
+ id: "9b4e1604-6033-4c86-a189-5bebe2478613",
86
+ url: `https://uniform.app/projects/9b4e1604-6033-4c86-a189-5bebe2478613`
87
+ },
88
+ edit_url: `https://uniform.app/projects/9b4e1604-6033-4c86-a189-5bebe2478613/dashboards/canvas/assets?assetId=9e02e29f-116f-4ad0-beac-910944144d22`,
89
+ api_url: `https://uniform.app/api/v1/assets?assetId=9e02e29f-116f-4ad0-beac-910944144d22&projectId=9b4e1604-6033-4c86-a189-5bebe2478613`,
90
+ initiator: {
91
+ id: "useruniqueid",
92
+ email: "foo@bar.com",
93
+ name: "A User",
94
+ is_api_key: false
95
+ }
96
+ }
97
+ );
98
+ var AssetPublishedEventName = AssetPublishedDefinition["event"];
99
+
100
+ // src/composition/common.ts
101
+ import * as z3 from "zod";
102
+ var CompositionCorePayloadSchema = z3.object({
103
+ id: z3.string(),
104
+ editionId: z3.string().optional(),
105
+ slug: z3.string().optional(),
106
+ name: z3.string(),
107
+ type: z3.string(),
108
+ project: z3.object({
109
+ id: z3.string(),
110
+ url: z3.string()
111
+ }),
112
+ initiator: webhookInitiatorSchema
113
+ });
114
+ var CompositionTriggerPayloadSchema = z3.object({
115
+ trigger: z3.object({
116
+ type: z3.enum(["release"]),
117
+ id: z3.string()
48
118
  }).optional()
49
119
  });
50
120
  var CompositionDeletePayloadSchema = CompositionCorePayloadSchema.extend({
51
- state: z2.number().optional()
121
+ state: z3.number().optional()
52
122
  });
53
123
  var CompositionRestorePayloadSchema = CompositionCorePayloadSchema.extend({
54
- state: z2.number()
124
+ state: z3.number()
55
125
  });
56
126
  var CompositionPayloadSchema = CompositionCorePayloadSchema.extend({
57
- state: z2.number(),
58
- edit_url: z2.string(),
59
- api_url: z2.string(),
60
- edge_url: z2.string()
127
+ state: z3.number(),
128
+ edit_url: z3.string(),
129
+ api_url: z3.string(),
130
+ edge_url: z3.string()
61
131
  });
62
- var ReleaseCompositionPayloadSchema = z2.object({
63
- release: z2.object({
64
- id: z2.string(),
65
- url: z2.string()
132
+ var ReleaseCompositionPayloadSchema = z3.object({
133
+ release: z3.object({
134
+ id: z3.string(),
135
+ url: z3.string()
66
136
  })
67
137
  });
68
138
 
@@ -310,41 +380,41 @@ var CompositionReleaseRestoredDefinition = definition(
310
380
  var CompositionReleaseRestoredEventName = CompositionReleaseRestoredDefinition["event"];
311
381
 
312
382
  // src/entry/common.ts
313
- import * as z3 from "zod/v3";
314
- var EntryCorePayloadSchema = z3.object({
315
- id: z3.string(),
316
- editionId: z3.string().optional(),
317
- slug: z3.string().optional(),
318
- name: z3.string(),
319
- type: z3.string(),
320
- project: z3.object({
321
- id: z3.string(),
322
- url: z3.string()
383
+ import * as z4 from "zod";
384
+ var EntryCorePayloadSchema = z4.object({
385
+ id: z4.string(),
386
+ editionId: z4.string().optional(),
387
+ slug: z4.string().optional(),
388
+ name: z4.string(),
389
+ type: z4.string(),
390
+ project: z4.object({
391
+ id: z4.string(),
392
+ url: z4.string()
323
393
  }),
324
394
  initiator: webhookInitiatorSchema
325
395
  });
326
- var EntryTriggerPayloadSchema = z3.object({
327
- trigger: z3.object({
328
- type: z3.enum(["release"]),
329
- id: z3.string()
396
+ var EntryTriggerPayloadSchema = z4.object({
397
+ trigger: z4.object({
398
+ type: z4.enum(["release"]),
399
+ id: z4.string()
330
400
  }).optional()
331
401
  });
332
402
  var EntryDeletePayloadSchema = EntryCorePayloadSchema.extend({
333
- state: z3.number().optional()
403
+ state: z4.number().optional()
334
404
  });
335
405
  var EntryRestorePayloadSchema = EntryCorePayloadSchema.extend({
336
- state: z3.number()
406
+ state: z4.number()
337
407
  });
338
408
  var EntryPayloadSchema = EntryCorePayloadSchema.extend({
339
- state: z3.number(),
340
- edit_url: z3.string(),
341
- api_url: z3.string(),
342
- edge_url: z3.string()
409
+ state: z4.number(),
410
+ edit_url: z4.string(),
411
+ api_url: z4.string(),
412
+ edge_url: z4.string()
343
413
  });
344
- var ReleaseEntryPayloadSchema = z3.object({
345
- release: z3.object({
346
- id: z3.string(),
347
- url: z3.string()
414
+ var ReleaseEntryPayloadSchema = z4.object({
415
+ release: z4.object({
416
+ id: z4.string(),
417
+ url: z4.string()
348
418
  })
349
419
  });
350
420
 
@@ -592,17 +662,17 @@ var EntryReleaseRestoredDefinition = definition(
592
662
  var EntryReleaseRestoredEventName = EntryReleaseRestoredDefinition["event"];
593
663
 
594
664
  // src/manifest/manifest.published.ts
595
- import * as z4 from "zod/v3";
665
+ import * as z5 from "zod";
596
666
  var ManifestPublishedDefinition = definition(
597
667
  {
598
668
  event: "manifest.published",
599
669
  name: "Manifest Published",
600
670
  description: "Triggers when a manifest has been published.",
601
- schema: z4.object({
602
- timestamp: z4.string(),
603
- site: z4.object({
604
- id: z4.string(),
605
- name: z4.string()
671
+ schema: z5.object({
672
+ timestamp: z5.string(),
673
+ site: z5.object({
674
+ id: z5.string(),
675
+ name: z5.string()
606
676
  })
607
677
  })
608
678
  },
@@ -617,16 +687,16 @@ var ManifestPublishedDefinition = definition(
617
687
  var ManifestPublishedEventName = ManifestPublishedDefinition["event"];
618
688
 
619
689
  // src/project-map/projectMap.delete.ts
620
- import * as z5 from "zod/v3";
690
+ import * as z6 from "zod";
621
691
  var ProjectMapDeleteDefinition = definition(
622
692
  {
623
693
  event: "projectmap.delete",
624
694
  name: "Project Map Deleted",
625
695
  description: "Triggers when a project map is deleted.",
626
- schema: z5.object({
627
- id: z5.string(),
628
- base_url: z5.string().optional(),
629
- project_id: z5.string()
696
+ schema: z6.object({
697
+ id: z6.string(),
698
+ base_url: z6.string().optional(),
699
+ project_id: z6.string()
630
700
  })
631
701
  },
632
702
  {
@@ -638,24 +708,25 @@ var ProjectMapDeleteDefinition = definition(
638
708
  var ProjectMapDeletedEventName = ProjectMapDeleteDefinition["event"];
639
709
 
640
710
  // src/project-map/projectMap.node.delete.ts
641
- import * as z6 from "zod/v3";
711
+ import * as z7 from "zod";
642
712
  var ProjectMapNodeDeleteDefinition = definition(
643
713
  {
644
714
  event: "projectmap.node.delete",
645
715
  name: "Project Map Node Deleted",
646
716
  description: "Triggers when a project map node is deleted.",
647
- schema: z6.object({
648
- project_id: z6.string(),
649
- project_map_id: z6.string(),
650
- name: z6.string(),
651
- id: z6.string(),
652
- path: z6.string(),
653
- composition_id: z6.string().optional(),
654
- locales: z6.record(
655
- z6.object({
656
- name: z6.string(),
657
- inherited: z6.boolean(),
658
- path: z6.string()
717
+ schema: z7.object({
718
+ project_id: z7.string(),
719
+ project_map_id: z7.string(),
720
+ name: z7.string(),
721
+ id: z7.string(),
722
+ path: z7.string(),
723
+ composition_id: z7.string().optional(),
724
+ locales: z7.record(
725
+ z7.string(),
726
+ z7.object({
727
+ name: z7.string(),
728
+ inherited: z7.boolean(),
729
+ path: z7.string()
659
730
  })
660
731
  ).optional(),
661
732
  initiator: webhookInitiatorSchema
@@ -686,24 +757,25 @@ var ProjectMapNodeDeleteDefinition = definition(
686
757
  var ProjectMapNodeDeletedEventName = ProjectMapNodeDeleteDefinition["event"];
687
758
 
688
759
  // src/project-map/projectMap.node.insert.ts
689
- import * as z7 from "zod/v3";
760
+ import * as z8 from "zod";
690
761
  var ProjectMapNodeInsertDefinition = definition(
691
762
  {
692
763
  event: "projectmap.node.insert",
693
764
  name: "Project Map Node Inserted",
694
765
  description: "Triggers when a project map node is inserted.",
695
- schema: z7.object({
696
- id: z7.string(),
697
- name: z7.string(),
698
- project_map_id: z7.string(),
699
- project_id: z7.string(),
700
- path: z7.string(),
701
- composition_id: z7.string().optional(),
702
- locales: z7.record(
703
- z7.object({
704
- name: z7.string(),
705
- inherited: z7.boolean(),
706
- path: z7.string()
766
+ schema: z8.object({
767
+ id: z8.string(),
768
+ name: z8.string(),
769
+ project_map_id: z8.string(),
770
+ project_id: z8.string(),
771
+ path: z8.string(),
772
+ composition_id: z8.string().optional(),
773
+ locales: z8.record(
774
+ z8.string(),
775
+ z8.object({
776
+ name: z8.string(),
777
+ inherited: z8.boolean(),
778
+ path: z8.string()
707
779
  })
708
780
  ).optional(),
709
781
  initiator: webhookInitiatorSchema
@@ -734,26 +806,27 @@ var ProjectMapNodeInsertDefinition = definition(
734
806
  var ProjectMapNodeInsertedEventName = ProjectMapNodeInsertDefinition["event"];
735
807
 
736
808
  // src/project-map/projectMap.node.update.ts
737
- import * as z8 from "zod/v3";
809
+ import * as z9 from "zod";
738
810
  var ProjectMapNodeUpdateDefinition = definition(
739
811
  {
740
812
  event: "projectmap.node.update",
741
813
  name: "Project Map Node Updated",
742
814
  description: "Triggers when a project map node is updated.",
743
- schema: z8.object({
744
- id: z8.string(),
745
- name: z8.string(),
746
- project_map_id: z8.string(),
747
- project_id: z8.string(),
748
- path: z8.string(),
749
- composition_id: z8.string().optional(),
750
- previous_path: z8.string(),
751
- locales: z8.record(
752
- z8.object({
753
- name: z8.string(),
754
- inherited: z8.boolean(),
755
- path: z8.string(),
756
- previous_path: z8.string()
815
+ schema: z9.object({
816
+ id: z9.string(),
817
+ name: z9.string(),
818
+ project_map_id: z9.string(),
819
+ project_id: z9.string(),
820
+ path: z9.string(),
821
+ composition_id: z9.string().optional(),
822
+ previous_path: z9.string(),
823
+ locales: z9.record(
824
+ z9.string(),
825
+ z9.object({
826
+ name: z9.string(),
827
+ inherited: z9.boolean(),
828
+ path: z9.string(),
829
+ previous_path: z9.string()
757
830
  })
758
831
  ).optional(),
759
832
  initiator: webhookInitiatorSchema
@@ -786,16 +859,16 @@ var ProjectMapNodeUpdateDefinition = definition(
786
859
  var ProjectMapNodeUpdatedEventName = ProjectMapNodeUpdateDefinition["event"];
787
860
 
788
861
  // src/project-map/projectMap.update.ts
789
- import * as z9 from "zod/v3";
862
+ import * as z10 from "zod";
790
863
  var ProjectMapUpdateDefinition = definition(
791
864
  {
792
865
  event: "projectmap.update",
793
866
  name: "Project map Updated",
794
867
  description: "Triggers when a project map is updated or created.",
795
- schema: z9.object({
796
- id: z9.string(),
797
- base_url: z9.string().optional(),
798
- project_id: z9.string(),
868
+ schema: z10.object({
869
+ id: z10.string(),
870
+ base_url: z10.string().optional(),
871
+ project_id: z10.string(),
799
872
  initiator: webhookInitiatorSchema
800
873
  })
801
874
  },
@@ -814,18 +887,18 @@ var ProjectMapUpdateDefinition = definition(
814
887
  var ProjectMapUpdatedEventName = ProjectMapUpdateDefinition["event"];
815
888
 
816
889
  // src/redirect/redirect.delete.ts
817
- import * as z10 from "zod/v3";
890
+ import * as z11 from "zod";
818
891
  var RedirectDeleteDefinition = definition(
819
892
  {
820
893
  event: "redirect.delete",
821
894
  name: "Redirect Deleted",
822
895
  description: "Triggers when a redirect is deleted.",
823
- schema: z10.object({
824
- project_id: z10.string(),
825
- id: z10.string(),
826
- source_url: z10.string(),
827
- target_url: z10.string(),
828
- target_status_code: z10.number(),
896
+ schema: z11.object({
897
+ project_id: z11.string(),
898
+ id: z11.string(),
899
+ source_url: z11.string(),
900
+ target_url: z11.string(),
901
+ target_status_code: z11.number(),
829
902
  initiator: webhookInitiatorSchema
830
903
  })
831
904
  },
@@ -846,18 +919,18 @@ var RedirectDeleteDefinition = definition(
846
919
  var RedirectDeletedEventName = RedirectDeleteDefinition["event"];
847
920
 
848
921
  // src/redirect/redirect.insert.ts
849
- import * as z11 from "zod/v3";
922
+ import * as z12 from "zod";
850
923
  var RedirectInsertDefinition = definition(
851
924
  {
852
925
  event: "redirect.insert",
853
926
  name: "Redirect Inserted",
854
927
  description: "Triggers when a redirect is inserted.",
855
- schema: z11.object({
856
- project_id: z11.string(),
857
- id: z11.string(),
858
- source_url: z11.string(),
859
- target_url: z11.string(),
860
- target_status_code: z11.number(),
928
+ schema: z12.object({
929
+ project_id: z12.string(),
930
+ id: z12.string(),
931
+ source_url: z12.string(),
932
+ target_url: z12.string(),
933
+ target_status_code: z12.number(),
861
934
  initiator: webhookInitiatorSchema
862
935
  })
863
936
  },
@@ -878,18 +951,18 @@ var RedirectInsertDefinition = definition(
878
951
  var RedirectInsertedEventName = RedirectInsertDefinition["event"];
879
952
 
880
953
  // src/redirect/redirect.update.ts
881
- import * as z12 from "zod/v3";
954
+ import * as z13 from "zod";
882
955
  var RedirectUpdateDefinition = definition(
883
956
  {
884
957
  event: "redirect.update",
885
958
  name: "Redirect Updated",
886
959
  description: "Triggers when a redirect is updated.",
887
- schema: z12.object({
888
- project_id: z12.string(),
889
- id: z12.string(),
890
- source_url: z12.string(),
891
- target_url: z12.string(),
892
- target_status_code: z12.number(),
960
+ schema: z13.object({
961
+ project_id: z13.string(),
962
+ id: z13.string(),
963
+ source_url: z13.string(),
964
+ target_url: z13.string(),
965
+ target_status_code: z13.number(),
893
966
  initiator: webhookInitiatorSchema
894
967
  })
895
968
  },
@@ -910,19 +983,19 @@ var RedirectUpdateDefinition = definition(
910
983
  var RedirectUpdatedEventName = RedirectUpdateDefinition["event"];
911
984
 
912
985
  // src/release/common.ts
913
- import * as z13 from "zod/v3";
914
- var ReleasePayloadSchema = z13.object({
915
- id: z13.string(),
916
- state: z13.enum(["open", "locked", "queued", "launching", "launched", "deleting"]),
917
- name: z13.string(),
918
- project: z13.object({
919
- id: z13.string(),
920
- url: z13.string()
986
+ import * as z14 from "zod";
987
+ var ReleasePayloadSchema = z14.object({
988
+ id: z14.string(),
989
+ state: z14.enum(["open", "locked", "queued", "launching", "launched", "deleting"]),
990
+ name: z14.string(),
991
+ project: z14.object({
992
+ id: z14.string(),
993
+ url: z14.string()
921
994
  }),
922
- autoLaunchSchedule: z13.number().optional(),
923
- autoLaunchScheduleTimeZone: z13.string().optional(),
924
- edit_url: z13.string(),
925
- api_url: z13.string()
995
+ autoLaunchSchedule: z14.number().optional(),
996
+ autoLaunchScheduleTimeZone: z14.string().optional(),
997
+ edit_url: z14.string(),
998
+ api_url: z14.string()
926
999
  });
927
1000
 
928
1001
  // src/release/release.changed.ts
@@ -1044,30 +1117,30 @@ var ArchivedReleaseLaunchStartedDefinition = definition(
1044
1117
  );
1045
1118
 
1046
1119
  // src/workflow/common.ts
1047
- import * as z14 from "zod/v3";
1048
- var WorkflowReferenceSchema = z14.strictObject({
1049
- workflowId: z14.string(),
1050
- workflowName: z14.string(),
1051
- stageId: z14.string(),
1052
- stageName: z14.string()
1120
+ import * as z15 from "zod";
1121
+ var WorkflowReferenceSchema = z15.strictObject({
1122
+ workflowId: z15.string(),
1123
+ workflowName: z15.string(),
1124
+ stageId: z15.string(),
1125
+ stageName: z15.string()
1053
1126
  });
1054
- var WorkflowEntitySchema = z14.strictObject({
1055
- type: z14.enum(["entry", "component"]),
1056
- name: z14.string(),
1057
- id: z14.string(),
1058
- editionId: z14.string().optional(),
1059
- releaseId: z14.string().optional(),
1060
- url: z14.string()
1127
+ var WorkflowEntitySchema = z15.strictObject({
1128
+ type: z15.enum(["entry", "component"]),
1129
+ name: z15.string(),
1130
+ id: z15.string(),
1131
+ editionId: z15.string().optional(),
1132
+ releaseId: z15.string().optional(),
1133
+ url: z15.string()
1061
1134
  });
1062
- var WorkflowTransitionPayloadSchema = z14.strictObject({
1135
+ var WorkflowTransitionPayloadSchema = z15.strictObject({
1063
1136
  entity: WorkflowEntitySchema,
1064
1137
  newStage: WorkflowReferenceSchema,
1065
1138
  previousStage: WorkflowReferenceSchema.optional(),
1066
1139
  initiator: webhookInitiatorSchema,
1067
- timestamp: z14.string(),
1068
- project: z14.object({
1069
- id: z14.string(),
1070
- url: z14.string()
1140
+ timestamp: z15.string(),
1141
+ project: z15.object({
1142
+ id: z15.string(),
1143
+ url: z15.string()
1071
1144
  })
1072
1145
  });
1073
1146
 
@@ -1116,6 +1189,12 @@ var WorkflowTransitionDefinition = definition(
1116
1189
  var WorkflowTransitionEventName = WorkflowTransitionDefinition["event"];
1117
1190
  export {
1118
1191
  ArchivedReleaseLaunchStartedDefinition,
1192
+ AssetDeletePayloadSchema,
1193
+ AssetDeletedDefinition,
1194
+ AssetDeletedEventName,
1195
+ AssetPayloadSchema,
1196
+ AssetPublishedDefinition,
1197
+ AssetPublishedEventName,
1119
1198
  CompositionChangedDefinition,
1120
1199
  CompositionChangedEventName,
1121
1200
  CompositionDeletePayloadSchema,