@uniformdev/webhooks 20.50.1-alpha.4 → 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.js CHANGED
@@ -31,6 +31,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  var src_exports = {};
32
32
  __export(src_exports, {
33
33
  ArchivedReleaseLaunchStartedDefinition: () => ArchivedReleaseLaunchStartedDefinition,
34
+ AssetDeletePayloadSchema: () => AssetDeletePayloadSchema,
35
+ AssetDeletedDefinition: () => AssetDeletedDefinition,
36
+ AssetDeletedEventName: () => AssetDeletedEventName,
37
+ AssetPayloadSchema: () => AssetPayloadSchema,
38
+ AssetPublishedDefinition: () => AssetPublishedDefinition,
39
+ AssetPublishedEventName: () => AssetPublishedEventName,
34
40
  CompositionChangedDefinition: () => CompositionChangedDefinition,
35
41
  CompositionChangedEventName: () => CompositionChangedEventName,
36
42
  CompositionDeletePayloadSchema: () => CompositionDeletePayloadSchema,
@@ -107,9 +113,6 @@ __export(src_exports, {
107
113
  });
108
114
  module.exports = __toCommonJS(src_exports);
109
115
 
110
- // src/composition/common.ts
111
- var z2 = __toESM(require("zod/v3"));
112
-
113
116
  // src/definition.ts
114
117
  var z = __toESM(require("zod/v3"));
115
118
  var addEventTypeToSchema = (schema, eventType) => z.object({
@@ -137,11 +140,10 @@ var webhookInitiatorSchema = z.strictObject({
137
140
  is_api_key: z.boolean()
138
141
  });
139
142
 
140
- // src/composition/common.ts
141
- var CompositionCorePayloadSchema = z2.object({
143
+ // src/asset/common.ts
144
+ var z2 = __toESM(require("zod/v3"));
145
+ var AssetCorePayloadSchema = z2.object({
142
146
  id: z2.string(),
143
- editionId: z2.string().optional(),
144
- slug: z2.string().optional(),
145
147
  name: z2.string(),
146
148
  type: z2.string(),
147
149
  project: z2.object({
@@ -150,28 +152,102 @@ var CompositionCorePayloadSchema = z2.object({
150
152
  }),
151
153
  initiator: webhookInitiatorSchema
152
154
  });
153
- var CompositionTriggerPayloadSchema = z2.object({
154
- trigger: z2.object({
155
- type: z2.enum(["release"]),
156
- id: z2.string()
155
+ var AssetPayloadSchema = AssetCorePayloadSchema.extend({
156
+ api_url: z2.string(),
157
+ edit_url: z2.string()
158
+ });
159
+ var AssetDeletePayloadSchema = AssetCorePayloadSchema;
160
+
161
+ // src/asset/asset.deleted.ts
162
+ var AssetDeletedDefinition = definition(
163
+ {
164
+ event: "asset.deleted",
165
+ name: "Asset Deleted",
166
+ description: "Triggers when an asset has been deleted.",
167
+ schema: AssetDeletePayloadSchema
168
+ },
169
+ {
170
+ id: "9e02e29f-116f-4ad0-beac-910944144d22",
171
+ name: "Some asset",
172
+ type: "image",
173
+ project: {
174
+ id: "9b4e1604-6033-4c86-a189-5bebe2478613",
175
+ url: `https://uniform.app/projects/9b4e1604-6033-4c86-a189-5bebe2478613`
176
+ },
177
+ initiator: {
178
+ id: "useruniqueid",
179
+ email: "foo@bar.com",
180
+ name: "A User",
181
+ is_api_key: false
182
+ }
183
+ }
184
+ );
185
+ var AssetDeletedEventName = AssetDeletedDefinition["event"];
186
+
187
+ // src/asset/asset.published.ts
188
+ var AssetPublishedDefinition = definition(
189
+ {
190
+ event: "asset.published",
191
+ name: "Asset Published",
192
+ description: "Triggers when an asset has been published.",
193
+ schema: AssetPayloadSchema
194
+ },
195
+ {
196
+ id: "9e02e29f-116f-4ad0-beac-910944144d22",
197
+ name: "Some asset",
198
+ type: "image",
199
+ project: {
200
+ id: "9b4e1604-6033-4c86-a189-5bebe2478613",
201
+ url: `https://uniform.app/projects/9b4e1604-6033-4c86-a189-5bebe2478613`
202
+ },
203
+ edit_url: `https://uniform.app/projects/9b4e1604-6033-4c86-a189-5bebe2478613/dashboards/canvas/assets?assetId=9e02e29f-116f-4ad0-beac-910944144d22`,
204
+ api_url: `https://uniform.app/api/v1/assets?assetId=9e02e29f-116f-4ad0-beac-910944144d22&projectId=9b4e1604-6033-4c86-a189-5bebe2478613`,
205
+ initiator: {
206
+ id: "useruniqueid",
207
+ email: "foo@bar.com",
208
+ name: "A User",
209
+ is_api_key: false
210
+ }
211
+ }
212
+ );
213
+ var AssetPublishedEventName = AssetPublishedDefinition["event"];
214
+
215
+ // src/composition/common.ts
216
+ var z3 = __toESM(require("zod/v3"));
217
+ var CompositionCorePayloadSchema = z3.object({
218
+ id: z3.string(),
219
+ editionId: z3.string().optional(),
220
+ slug: z3.string().optional(),
221
+ name: z3.string(),
222
+ type: z3.string(),
223
+ project: z3.object({
224
+ id: z3.string(),
225
+ url: z3.string()
226
+ }),
227
+ initiator: webhookInitiatorSchema
228
+ });
229
+ var CompositionTriggerPayloadSchema = z3.object({
230
+ trigger: z3.object({
231
+ type: z3.enum(["release"]),
232
+ id: z3.string()
157
233
  }).optional()
158
234
  });
159
235
  var CompositionDeletePayloadSchema = CompositionCorePayloadSchema.extend({
160
- state: z2.number().optional()
236
+ state: z3.number().optional()
161
237
  });
162
238
  var CompositionRestorePayloadSchema = CompositionCorePayloadSchema.extend({
163
- state: z2.number()
239
+ state: z3.number()
164
240
  });
165
241
  var CompositionPayloadSchema = CompositionCorePayloadSchema.extend({
166
- state: z2.number(),
167
- edit_url: z2.string(),
168
- api_url: z2.string(),
169
- edge_url: z2.string()
242
+ state: z3.number(),
243
+ edit_url: z3.string(),
244
+ api_url: z3.string(),
245
+ edge_url: z3.string()
170
246
  });
171
- var ReleaseCompositionPayloadSchema = z2.object({
172
- release: z2.object({
173
- id: z2.string(),
174
- url: z2.string()
247
+ var ReleaseCompositionPayloadSchema = z3.object({
248
+ release: z3.object({
249
+ id: z3.string(),
250
+ url: z3.string()
175
251
  })
176
252
  });
177
253
 
@@ -419,41 +495,41 @@ var CompositionReleaseRestoredDefinition = definition(
419
495
  var CompositionReleaseRestoredEventName = CompositionReleaseRestoredDefinition["event"];
420
496
 
421
497
  // src/entry/common.ts
422
- var z3 = __toESM(require("zod/v3"));
423
- var EntryCorePayloadSchema = z3.object({
424
- id: z3.string(),
425
- editionId: z3.string().optional(),
426
- slug: z3.string().optional(),
427
- name: z3.string(),
428
- type: z3.string(),
429
- project: z3.object({
430
- id: z3.string(),
431
- url: z3.string()
498
+ var z4 = __toESM(require("zod/v3"));
499
+ var EntryCorePayloadSchema = z4.object({
500
+ id: z4.string(),
501
+ editionId: z4.string().optional(),
502
+ slug: z4.string().optional(),
503
+ name: z4.string(),
504
+ type: z4.string(),
505
+ project: z4.object({
506
+ id: z4.string(),
507
+ url: z4.string()
432
508
  }),
433
509
  initiator: webhookInitiatorSchema
434
510
  });
435
- var EntryTriggerPayloadSchema = z3.object({
436
- trigger: z3.object({
437
- type: z3.enum(["release"]),
438
- id: z3.string()
511
+ var EntryTriggerPayloadSchema = z4.object({
512
+ trigger: z4.object({
513
+ type: z4.enum(["release"]),
514
+ id: z4.string()
439
515
  }).optional()
440
516
  });
441
517
  var EntryDeletePayloadSchema = EntryCorePayloadSchema.extend({
442
- state: z3.number().optional()
518
+ state: z4.number().optional()
443
519
  });
444
520
  var EntryRestorePayloadSchema = EntryCorePayloadSchema.extend({
445
- state: z3.number()
521
+ state: z4.number()
446
522
  });
447
523
  var EntryPayloadSchema = EntryCorePayloadSchema.extend({
448
- state: z3.number(),
449
- edit_url: z3.string(),
450
- api_url: z3.string(),
451
- edge_url: z3.string()
524
+ state: z4.number(),
525
+ edit_url: z4.string(),
526
+ api_url: z4.string(),
527
+ edge_url: z4.string()
452
528
  });
453
- var ReleaseEntryPayloadSchema = z3.object({
454
- release: z3.object({
455
- id: z3.string(),
456
- url: z3.string()
529
+ var ReleaseEntryPayloadSchema = z4.object({
530
+ release: z4.object({
531
+ id: z4.string(),
532
+ url: z4.string()
457
533
  })
458
534
  });
459
535
 
@@ -701,17 +777,17 @@ var EntryReleaseRestoredDefinition = definition(
701
777
  var EntryReleaseRestoredEventName = EntryReleaseRestoredDefinition["event"];
702
778
 
703
779
  // src/manifest/manifest.published.ts
704
- var z4 = __toESM(require("zod/v3"));
780
+ var z5 = __toESM(require("zod/v3"));
705
781
  var ManifestPublishedDefinition = definition(
706
782
  {
707
783
  event: "manifest.published",
708
784
  name: "Manifest Published",
709
785
  description: "Triggers when a manifest has been published.",
710
- schema: z4.object({
711
- timestamp: z4.string(),
712
- site: z4.object({
713
- id: z4.string(),
714
- name: z4.string()
786
+ schema: z5.object({
787
+ timestamp: z5.string(),
788
+ site: z5.object({
789
+ id: z5.string(),
790
+ name: z5.string()
715
791
  })
716
792
  })
717
793
  },
@@ -726,16 +802,16 @@ var ManifestPublishedDefinition = definition(
726
802
  var ManifestPublishedEventName = ManifestPublishedDefinition["event"];
727
803
 
728
804
  // src/project-map/projectMap.delete.ts
729
- var z5 = __toESM(require("zod/v3"));
805
+ var z6 = __toESM(require("zod/v3"));
730
806
  var ProjectMapDeleteDefinition = definition(
731
807
  {
732
808
  event: "projectmap.delete",
733
809
  name: "Project Map Deleted",
734
810
  description: "Triggers when a project map is deleted.",
735
- schema: z5.object({
736
- id: z5.string(),
737
- base_url: z5.string().optional(),
738
- project_id: z5.string()
811
+ schema: z6.object({
812
+ id: z6.string(),
813
+ base_url: z6.string().optional(),
814
+ project_id: z6.string()
739
815
  })
740
816
  },
741
817
  {
@@ -747,24 +823,24 @@ var ProjectMapDeleteDefinition = definition(
747
823
  var ProjectMapDeletedEventName = ProjectMapDeleteDefinition["event"];
748
824
 
749
825
  // src/project-map/projectMap.node.delete.ts
750
- var z6 = __toESM(require("zod/v3"));
826
+ var z7 = __toESM(require("zod/v3"));
751
827
  var ProjectMapNodeDeleteDefinition = definition(
752
828
  {
753
829
  event: "projectmap.node.delete",
754
830
  name: "Project Map Node Deleted",
755
831
  description: "Triggers when a project map node is deleted.",
756
- schema: z6.object({
757
- project_id: z6.string(),
758
- project_map_id: z6.string(),
759
- name: z6.string(),
760
- id: z6.string(),
761
- path: z6.string(),
762
- composition_id: z6.string().optional(),
763
- locales: z6.record(
764
- z6.object({
765
- name: z6.string(),
766
- inherited: z6.boolean(),
767
- path: z6.string()
832
+ schema: z7.object({
833
+ project_id: z7.string(),
834
+ project_map_id: z7.string(),
835
+ name: z7.string(),
836
+ id: z7.string(),
837
+ path: z7.string(),
838
+ composition_id: z7.string().optional(),
839
+ locales: z7.record(
840
+ z7.object({
841
+ name: z7.string(),
842
+ inherited: z7.boolean(),
843
+ path: z7.string()
768
844
  })
769
845
  ).optional(),
770
846
  initiator: webhookInitiatorSchema
@@ -795,24 +871,24 @@ var ProjectMapNodeDeleteDefinition = definition(
795
871
  var ProjectMapNodeDeletedEventName = ProjectMapNodeDeleteDefinition["event"];
796
872
 
797
873
  // src/project-map/projectMap.node.insert.ts
798
- var z7 = __toESM(require("zod/v3"));
874
+ var z8 = __toESM(require("zod/v3"));
799
875
  var ProjectMapNodeInsertDefinition = definition(
800
876
  {
801
877
  event: "projectmap.node.insert",
802
878
  name: "Project Map Node Inserted",
803
879
  description: "Triggers when a project map node is inserted.",
804
- schema: z7.object({
805
- id: z7.string(),
806
- name: z7.string(),
807
- project_map_id: z7.string(),
808
- project_id: z7.string(),
809
- path: z7.string(),
810
- composition_id: z7.string().optional(),
811
- locales: z7.record(
812
- z7.object({
813
- name: z7.string(),
814
- inherited: z7.boolean(),
815
- path: z7.string()
880
+ schema: z8.object({
881
+ id: z8.string(),
882
+ name: z8.string(),
883
+ project_map_id: z8.string(),
884
+ project_id: z8.string(),
885
+ path: z8.string(),
886
+ composition_id: z8.string().optional(),
887
+ locales: z8.record(
888
+ z8.object({
889
+ name: z8.string(),
890
+ inherited: z8.boolean(),
891
+ path: z8.string()
816
892
  })
817
893
  ).optional(),
818
894
  initiator: webhookInitiatorSchema
@@ -843,26 +919,26 @@ var ProjectMapNodeInsertDefinition = definition(
843
919
  var ProjectMapNodeInsertedEventName = ProjectMapNodeInsertDefinition["event"];
844
920
 
845
921
  // src/project-map/projectMap.node.update.ts
846
- var z8 = __toESM(require("zod/v3"));
922
+ var z9 = __toESM(require("zod/v3"));
847
923
  var ProjectMapNodeUpdateDefinition = definition(
848
924
  {
849
925
  event: "projectmap.node.update",
850
926
  name: "Project Map Node Updated",
851
927
  description: "Triggers when a project map node is updated.",
852
- schema: z8.object({
853
- id: z8.string(),
854
- name: z8.string(),
855
- project_map_id: z8.string(),
856
- project_id: z8.string(),
857
- path: z8.string(),
858
- composition_id: z8.string().optional(),
859
- previous_path: z8.string(),
860
- locales: z8.record(
861
- z8.object({
862
- name: z8.string(),
863
- inherited: z8.boolean(),
864
- path: z8.string(),
865
- previous_path: z8.string()
928
+ schema: z9.object({
929
+ id: z9.string(),
930
+ name: z9.string(),
931
+ project_map_id: z9.string(),
932
+ project_id: z9.string(),
933
+ path: z9.string(),
934
+ composition_id: z9.string().optional(),
935
+ previous_path: z9.string(),
936
+ locales: z9.record(
937
+ z9.object({
938
+ name: z9.string(),
939
+ inherited: z9.boolean(),
940
+ path: z9.string(),
941
+ previous_path: z9.string()
866
942
  })
867
943
  ).optional(),
868
944
  initiator: webhookInitiatorSchema
@@ -895,16 +971,16 @@ var ProjectMapNodeUpdateDefinition = definition(
895
971
  var ProjectMapNodeUpdatedEventName = ProjectMapNodeUpdateDefinition["event"];
896
972
 
897
973
  // src/project-map/projectMap.update.ts
898
- var z9 = __toESM(require("zod/v3"));
974
+ var z10 = __toESM(require("zod/v3"));
899
975
  var ProjectMapUpdateDefinition = definition(
900
976
  {
901
977
  event: "projectmap.update",
902
978
  name: "Project map Updated",
903
979
  description: "Triggers when a project map is updated or created.",
904
- schema: z9.object({
905
- id: z9.string(),
906
- base_url: z9.string().optional(),
907
- project_id: z9.string(),
980
+ schema: z10.object({
981
+ id: z10.string(),
982
+ base_url: z10.string().optional(),
983
+ project_id: z10.string(),
908
984
  initiator: webhookInitiatorSchema
909
985
  })
910
986
  },
@@ -923,18 +999,18 @@ var ProjectMapUpdateDefinition = definition(
923
999
  var ProjectMapUpdatedEventName = ProjectMapUpdateDefinition["event"];
924
1000
 
925
1001
  // src/redirect/redirect.delete.ts
926
- var z10 = __toESM(require("zod/v3"));
1002
+ var z11 = __toESM(require("zod/v3"));
927
1003
  var RedirectDeleteDefinition = definition(
928
1004
  {
929
1005
  event: "redirect.delete",
930
1006
  name: "Redirect Deleted",
931
1007
  description: "Triggers when a redirect is deleted.",
932
- schema: z10.object({
933
- project_id: z10.string(),
934
- id: z10.string(),
935
- source_url: z10.string(),
936
- target_url: z10.string(),
937
- target_status_code: z10.number(),
1008
+ schema: z11.object({
1009
+ project_id: z11.string(),
1010
+ id: z11.string(),
1011
+ source_url: z11.string(),
1012
+ target_url: z11.string(),
1013
+ target_status_code: z11.number(),
938
1014
  initiator: webhookInitiatorSchema
939
1015
  })
940
1016
  },
@@ -955,18 +1031,18 @@ var RedirectDeleteDefinition = definition(
955
1031
  var RedirectDeletedEventName = RedirectDeleteDefinition["event"];
956
1032
 
957
1033
  // src/redirect/redirect.insert.ts
958
- var z11 = __toESM(require("zod/v3"));
1034
+ var z12 = __toESM(require("zod/v3"));
959
1035
  var RedirectInsertDefinition = definition(
960
1036
  {
961
1037
  event: "redirect.insert",
962
1038
  name: "Redirect Inserted",
963
1039
  description: "Triggers when a redirect is inserted.",
964
- schema: z11.object({
965
- project_id: z11.string(),
966
- id: z11.string(),
967
- source_url: z11.string(),
968
- target_url: z11.string(),
969
- target_status_code: z11.number(),
1040
+ schema: z12.object({
1041
+ project_id: z12.string(),
1042
+ id: z12.string(),
1043
+ source_url: z12.string(),
1044
+ target_url: z12.string(),
1045
+ target_status_code: z12.number(),
970
1046
  initiator: webhookInitiatorSchema
971
1047
  })
972
1048
  },
@@ -987,18 +1063,18 @@ var RedirectInsertDefinition = definition(
987
1063
  var RedirectInsertedEventName = RedirectInsertDefinition["event"];
988
1064
 
989
1065
  // src/redirect/redirect.update.ts
990
- var z12 = __toESM(require("zod/v3"));
1066
+ var z13 = __toESM(require("zod/v3"));
991
1067
  var RedirectUpdateDefinition = definition(
992
1068
  {
993
1069
  event: "redirect.update",
994
1070
  name: "Redirect Updated",
995
1071
  description: "Triggers when a redirect is updated.",
996
- schema: z12.object({
997
- project_id: z12.string(),
998
- id: z12.string(),
999
- source_url: z12.string(),
1000
- target_url: z12.string(),
1001
- target_status_code: z12.number(),
1072
+ schema: z13.object({
1073
+ project_id: z13.string(),
1074
+ id: z13.string(),
1075
+ source_url: z13.string(),
1076
+ target_url: z13.string(),
1077
+ target_status_code: z13.number(),
1002
1078
  initiator: webhookInitiatorSchema
1003
1079
  })
1004
1080
  },
@@ -1019,19 +1095,19 @@ var RedirectUpdateDefinition = definition(
1019
1095
  var RedirectUpdatedEventName = RedirectUpdateDefinition["event"];
1020
1096
 
1021
1097
  // src/release/common.ts
1022
- var z13 = __toESM(require("zod/v3"));
1023
- var ReleasePayloadSchema = z13.object({
1024
- id: z13.string(),
1025
- state: z13.enum(["open", "locked", "queued", "launching", "launched", "deleting"]),
1026
- name: z13.string(),
1027
- project: z13.object({
1028
- id: z13.string(),
1029
- url: z13.string()
1098
+ var z14 = __toESM(require("zod/v3"));
1099
+ var ReleasePayloadSchema = z14.object({
1100
+ id: z14.string(),
1101
+ state: z14.enum(["open", "locked", "queued", "launching", "launched", "deleting"]),
1102
+ name: z14.string(),
1103
+ project: z14.object({
1104
+ id: z14.string(),
1105
+ url: z14.string()
1030
1106
  }),
1031
- autoLaunchSchedule: z13.number().optional(),
1032
- autoLaunchScheduleTimeZone: z13.string().optional(),
1033
- edit_url: z13.string(),
1034
- api_url: z13.string()
1107
+ autoLaunchSchedule: z14.number().optional(),
1108
+ autoLaunchScheduleTimeZone: z14.string().optional(),
1109
+ edit_url: z14.string(),
1110
+ api_url: z14.string()
1035
1111
  });
1036
1112
 
1037
1113
  // src/release/release.changed.ts
@@ -1153,30 +1229,30 @@ var ArchivedReleaseLaunchStartedDefinition = definition(
1153
1229
  );
1154
1230
 
1155
1231
  // src/workflow/common.ts
1156
- var z14 = __toESM(require("zod/v3"));
1157
- var WorkflowReferenceSchema = z14.strictObject({
1158
- workflowId: z14.string(),
1159
- workflowName: z14.string(),
1160
- stageId: z14.string(),
1161
- stageName: z14.string()
1232
+ var z15 = __toESM(require("zod/v3"));
1233
+ var WorkflowReferenceSchema = z15.strictObject({
1234
+ workflowId: z15.string(),
1235
+ workflowName: z15.string(),
1236
+ stageId: z15.string(),
1237
+ stageName: z15.string()
1162
1238
  });
1163
- var WorkflowEntitySchema = z14.strictObject({
1164
- type: z14.enum(["entry", "component"]),
1165
- name: z14.string(),
1166
- id: z14.string(),
1167
- editionId: z14.string().optional(),
1168
- releaseId: z14.string().optional(),
1169
- url: z14.string()
1239
+ var WorkflowEntitySchema = z15.strictObject({
1240
+ type: z15.enum(["entry", "component"]),
1241
+ name: z15.string(),
1242
+ id: z15.string(),
1243
+ editionId: z15.string().optional(),
1244
+ releaseId: z15.string().optional(),
1245
+ url: z15.string()
1170
1246
  });
1171
- var WorkflowTransitionPayloadSchema = z14.strictObject({
1247
+ var WorkflowTransitionPayloadSchema = z15.strictObject({
1172
1248
  entity: WorkflowEntitySchema,
1173
1249
  newStage: WorkflowReferenceSchema,
1174
1250
  previousStage: WorkflowReferenceSchema.optional(),
1175
1251
  initiator: webhookInitiatorSchema,
1176
- timestamp: z14.string(),
1177
- project: z14.object({
1178
- id: z14.string(),
1179
- url: z14.string()
1252
+ timestamp: z15.string(),
1253
+ project: z15.object({
1254
+ id: z15.string(),
1255
+ url: z15.string()
1180
1256
  })
1181
1257
  });
1182
1258
 
@@ -1226,6 +1302,12 @@ var WorkflowTransitionEventName = WorkflowTransitionDefinition["event"];
1226
1302
  // Annotate the CommonJS export names for ESM import in node:
1227
1303
  0 && (module.exports = {
1228
1304
  ArchivedReleaseLaunchStartedDefinition,
1305
+ AssetDeletePayloadSchema,
1306
+ AssetDeletedDefinition,
1307
+ AssetDeletedEventName,
1308
+ AssetPayloadSchema,
1309
+ AssetPublishedDefinition,
1310
+ AssetPublishedEventName,
1229
1311
  CompositionChangedDefinition,
1230
1312
  CompositionChangedEventName,
1231
1313
  CompositionDeletePayloadSchema,