@uniformdev/webhooks 20.50.1-alpha.2 → 20.50.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.esm.js CHANGED
@@ -1,6 +1,3 @@
1
- // src/composition/common.ts
2
- import * as z2 from "zod/v3";
3
-
4
1
  // src/definition.ts
5
2
  import * as z from "zod/v3";
6
3
  var addEventTypeToSchema = (schema, eventType) => z.object({
@@ -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/v3";
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/v3";
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/v3";
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/v3";
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/v3";
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,24 @@ 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/v3";
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.object({
726
+ name: z7.string(),
727
+ inherited: z7.boolean(),
728
+ path: z7.string()
659
729
  })
660
730
  ).optional(),
661
731
  initiator: webhookInitiatorSchema
@@ -686,24 +756,24 @@ var ProjectMapNodeDeleteDefinition = definition(
686
756
  var ProjectMapNodeDeletedEventName = ProjectMapNodeDeleteDefinition["event"];
687
757
 
688
758
  // src/project-map/projectMap.node.insert.ts
689
- import * as z7 from "zod/v3";
759
+ import * as z8 from "zod/v3";
690
760
  var ProjectMapNodeInsertDefinition = definition(
691
761
  {
692
762
  event: "projectmap.node.insert",
693
763
  name: "Project Map Node Inserted",
694
764
  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()
765
+ schema: z8.object({
766
+ id: z8.string(),
767
+ name: z8.string(),
768
+ project_map_id: z8.string(),
769
+ project_id: z8.string(),
770
+ path: z8.string(),
771
+ composition_id: z8.string().optional(),
772
+ locales: z8.record(
773
+ z8.object({
774
+ name: z8.string(),
775
+ inherited: z8.boolean(),
776
+ path: z8.string()
707
777
  })
708
778
  ).optional(),
709
779
  initiator: webhookInitiatorSchema
@@ -734,26 +804,26 @@ var ProjectMapNodeInsertDefinition = definition(
734
804
  var ProjectMapNodeInsertedEventName = ProjectMapNodeInsertDefinition["event"];
735
805
 
736
806
  // src/project-map/projectMap.node.update.ts
737
- import * as z8 from "zod/v3";
807
+ import * as z9 from "zod/v3";
738
808
  var ProjectMapNodeUpdateDefinition = definition(
739
809
  {
740
810
  event: "projectmap.node.update",
741
811
  name: "Project Map Node Updated",
742
812
  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()
813
+ schema: z9.object({
814
+ id: z9.string(),
815
+ name: z9.string(),
816
+ project_map_id: z9.string(),
817
+ project_id: z9.string(),
818
+ path: z9.string(),
819
+ composition_id: z9.string().optional(),
820
+ previous_path: z9.string(),
821
+ locales: z9.record(
822
+ z9.object({
823
+ name: z9.string(),
824
+ inherited: z9.boolean(),
825
+ path: z9.string(),
826
+ previous_path: z9.string()
757
827
  })
758
828
  ).optional(),
759
829
  initiator: webhookInitiatorSchema
@@ -786,16 +856,16 @@ var ProjectMapNodeUpdateDefinition = definition(
786
856
  var ProjectMapNodeUpdatedEventName = ProjectMapNodeUpdateDefinition["event"];
787
857
 
788
858
  // src/project-map/projectMap.update.ts
789
- import * as z9 from "zod/v3";
859
+ import * as z10 from "zod/v3";
790
860
  var ProjectMapUpdateDefinition = definition(
791
861
  {
792
862
  event: "projectmap.update",
793
863
  name: "Project map Updated",
794
864
  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(),
865
+ schema: z10.object({
866
+ id: z10.string(),
867
+ base_url: z10.string().optional(),
868
+ project_id: z10.string(),
799
869
  initiator: webhookInitiatorSchema
800
870
  })
801
871
  },
@@ -814,18 +884,18 @@ var ProjectMapUpdateDefinition = definition(
814
884
  var ProjectMapUpdatedEventName = ProjectMapUpdateDefinition["event"];
815
885
 
816
886
  // src/redirect/redirect.delete.ts
817
- import * as z10 from "zod/v3";
887
+ import * as z11 from "zod/v3";
818
888
  var RedirectDeleteDefinition = definition(
819
889
  {
820
890
  event: "redirect.delete",
821
891
  name: "Redirect Deleted",
822
892
  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(),
893
+ schema: z11.object({
894
+ project_id: z11.string(),
895
+ id: z11.string(),
896
+ source_url: z11.string(),
897
+ target_url: z11.string(),
898
+ target_status_code: z11.number(),
829
899
  initiator: webhookInitiatorSchema
830
900
  })
831
901
  },
@@ -846,18 +916,18 @@ var RedirectDeleteDefinition = definition(
846
916
  var RedirectDeletedEventName = RedirectDeleteDefinition["event"];
847
917
 
848
918
  // src/redirect/redirect.insert.ts
849
- import * as z11 from "zod/v3";
919
+ import * as z12 from "zod/v3";
850
920
  var RedirectInsertDefinition = definition(
851
921
  {
852
922
  event: "redirect.insert",
853
923
  name: "Redirect Inserted",
854
924
  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(),
925
+ schema: z12.object({
926
+ project_id: z12.string(),
927
+ id: z12.string(),
928
+ source_url: z12.string(),
929
+ target_url: z12.string(),
930
+ target_status_code: z12.number(),
861
931
  initiator: webhookInitiatorSchema
862
932
  })
863
933
  },
@@ -878,18 +948,18 @@ var RedirectInsertDefinition = definition(
878
948
  var RedirectInsertedEventName = RedirectInsertDefinition["event"];
879
949
 
880
950
  // src/redirect/redirect.update.ts
881
- import * as z12 from "zod/v3";
951
+ import * as z13 from "zod/v3";
882
952
  var RedirectUpdateDefinition = definition(
883
953
  {
884
954
  event: "redirect.update",
885
955
  name: "Redirect Updated",
886
956
  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(),
957
+ schema: z13.object({
958
+ project_id: z13.string(),
959
+ id: z13.string(),
960
+ source_url: z13.string(),
961
+ target_url: z13.string(),
962
+ target_status_code: z13.number(),
893
963
  initiator: webhookInitiatorSchema
894
964
  })
895
965
  },
@@ -910,19 +980,19 @@ var RedirectUpdateDefinition = definition(
910
980
  var RedirectUpdatedEventName = RedirectUpdateDefinition["event"];
911
981
 
912
982
  // 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()
983
+ import * as z14 from "zod/v3";
984
+ var ReleasePayloadSchema = z14.object({
985
+ id: z14.string(),
986
+ state: z14.enum(["open", "locked", "queued", "launching", "launched", "deleting"]),
987
+ name: z14.string(),
988
+ project: z14.object({
989
+ id: z14.string(),
990
+ url: z14.string()
921
991
  }),
922
- autoLaunchSchedule: z13.number().optional(),
923
- autoLaunchScheduleTimeZone: z13.string().optional(),
924
- edit_url: z13.string(),
925
- api_url: z13.string()
992
+ autoLaunchSchedule: z14.number().optional(),
993
+ autoLaunchScheduleTimeZone: z14.string().optional(),
994
+ edit_url: z14.string(),
995
+ api_url: z14.string()
926
996
  });
927
997
 
928
998
  // src/release/release.changed.ts
@@ -1044,30 +1114,30 @@ var ArchivedReleaseLaunchStartedDefinition = definition(
1044
1114
  );
1045
1115
 
1046
1116
  // 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()
1117
+ import * as z15 from "zod/v3";
1118
+ var WorkflowReferenceSchema = z15.strictObject({
1119
+ workflowId: z15.string(),
1120
+ workflowName: z15.string(),
1121
+ stageId: z15.string(),
1122
+ stageName: z15.string()
1053
1123
  });
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()
1124
+ var WorkflowEntitySchema = z15.strictObject({
1125
+ type: z15.enum(["entry", "component"]),
1126
+ name: z15.string(),
1127
+ id: z15.string(),
1128
+ editionId: z15.string().optional(),
1129
+ releaseId: z15.string().optional(),
1130
+ url: z15.string()
1061
1131
  });
1062
- var WorkflowTransitionPayloadSchema = z14.strictObject({
1132
+ var WorkflowTransitionPayloadSchema = z15.strictObject({
1063
1133
  entity: WorkflowEntitySchema,
1064
1134
  newStage: WorkflowReferenceSchema,
1065
1135
  previousStage: WorkflowReferenceSchema.optional(),
1066
1136
  initiator: webhookInitiatorSchema,
1067
- timestamp: z14.string(),
1068
- project: z14.object({
1069
- id: z14.string(),
1070
- url: z14.string()
1137
+ timestamp: z15.string(),
1138
+ project: z15.object({
1139
+ id: z15.string(),
1140
+ url: z15.string()
1071
1141
  })
1072
1142
  });
1073
1143
 
@@ -1116,6 +1186,12 @@ var WorkflowTransitionDefinition = definition(
1116
1186
  var WorkflowTransitionEventName = WorkflowTransitionDefinition["event"];
1117
1187
  export {
1118
1188
  ArchivedReleaseLaunchStartedDefinition,
1189
+ AssetDeletePayloadSchema,
1190
+ AssetDeletedDefinition,
1191
+ AssetDeletedEventName,
1192
+ AssetPayloadSchema,
1193
+ AssetPublishedDefinition,
1194
+ AssetPublishedEventName,
1119
1195
  CompositionChangedDefinition,
1120
1196
  CompositionChangedEventName,
1121
1197
  CompositionDeletePayloadSchema,