terse-types 0.1.5 → 0.1.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.
@@ -21,9 +21,10 @@ export function formatGithubTrigger(event) {
21
21
  "pull_request.synchronize": "Pull Request Updated (new commits added)",
22
22
  "pull_request.closed": "Pull Request Closed",
23
23
  "pull_request.merged": "Pull Request Merged",
24
+ "pull_request.comment.edited": "Pull Request Comment Edited",
24
25
  "issue_comment.created": "Issue Comment Created"
25
26
  };
26
- const eventDescription = eventTypeDescriptions[event.eventType] || event.eventType;
27
+ const eventDescription = event.eventType === "issue_comment.created" && event.issue.isPullRequest ? "Pull Request Comment Created" : eventTypeDescriptions[event.eventType] || event.eventType;
27
28
  const repoInfo = [
28
29
  `Repository: ${event.repository.owner}/${event.repository.name}`,
29
30
  `Repository ID: ${event.repository.id}`,
@@ -31,10 +32,11 @@ export function formatGithubTrigger(event) {
31
32
  `View on GitHub: https://github.com/${event.repository.owner}/${event.repository.name}`
32
33
  ].join("\n");
33
34
  const senderInfo = [`Actor: ${event.sender.login}`, ...(event.sender.email ? [`Email: ${event.sender.email}`] : [])].join("\n");
34
- const branch = event.eventType === "issue_comment.created" ? undefined : event.branch;
35
+ const isCommentEvent = event.eventType === "issue_comment.created" || event.eventType === "pull_request.comment.edited";
36
+ const branch = isCommentEvent ? undefined : event.branch;
35
37
  const branchInfo = branch ? `Branch: ${branch}` : null;
36
38
  let prInfo = "";
37
- if (event.eventType !== "issue_comment.created" && event.pullRequest) {
39
+ if (!isCommentEvent && event.pullRequest) {
38
40
  const pr = event.pullRequest;
39
41
  const author = pr.author ?? pr.user;
40
42
  const prLines = [
@@ -51,7 +53,7 @@ export function formatGithubTrigger(event) {
51
53
  prInfo = prLines.join("\n");
52
54
  }
53
55
  let commentInfo = "";
54
- if (event.eventType === "issue_comment.created") {
56
+ if (isCommentEvent) {
55
57
  const c = event.comment;
56
58
  const target = event.issue;
57
59
  const kind = target.isPullRequest ? "Pull Request" : "Issue";
@@ -69,7 +71,7 @@ export function formatGithubTrigger(event) {
69
71
  commentInfo = commentLines.join("\n");
70
72
  }
71
73
  let commitsInfo = "";
72
- const commits = event.eventType === "issue_comment.created" ? [] : event.commits;
74
+ const commits = isCommentEvent ? [] : event.commits;
73
75
  if (commits.length > 0) {
74
76
  const commitLines = [];
75
77
  commitLines.push(`Commits (${commits.length}):`);
@@ -86,7 +88,7 @@ export function formatGithubTrigger(event) {
86
88
  });
87
89
  commitsInfo = commitLines.join("\n");
88
90
  }
89
- const targetSectionLabel = event.eventType === "issue_comment.created" ? (event.issue.isPullRequest ? "Pull Request Information" : "Issue Information") : "Pull Request Information";
91
+ const targetSectionLabel = isCommentEvent ? (event.issue.isPullRequest ? "Pull Request Information" : "Issue Information") : "Pull Request Information";
90
92
  return [
91
93
  `Incoming GitHub Event: ${eventDescription}`,
92
94
  `\nRepository Information:\n${indentMultiline(repoInfo)}`,
@@ -101,7 +103,7 @@ export function debugGithubTrigger(event) {
101
103
  return `GitHub Event: ${event.eventType} - ${event.repository.owner}/${event.repository.name} - ${event.sender.login}`;
102
104
  }
103
105
  export function formatGithubDisplay(event) {
104
- if (event.eventType === "issue_comment.created") {
106
+ if (event.eventType === "issue_comment.created" || event.eventType === "pull_request.comment.edited") {
105
107
  const kind = event.issue.isPullRequest ? "PR" : "Issue";
106
108
  return {
107
109
  title: `Comment on #${event.issue.number} ${truncateForDisplay(event.issue.title, 80)}`,
@@ -566,6 +566,139 @@ export declare const GithubPRCommentCreatedTriggerSchema: z.ZodObject<{
566
566
  }, z.core.$strip>;
567
567
  }, z.core.$strip>;
568
568
  export type GithubPRCommentCreatedTrigger = z.infer<typeof GithubPRCommentCreatedTriggerSchema>;
569
+ export declare const GithubPRCommentEditedTriggerSchema: z.ZodObject<{
570
+ integrationType: z.ZodLiteral<IntegrationType.GITHUB>;
571
+ username: z.ZodString;
572
+ installationId: z.ZodNumber;
573
+ repositoryName: z.ZodString;
574
+ repository: z.ZodObject<{
575
+ id: z.ZodNumber;
576
+ name: z.ZodString;
577
+ owner: z.ZodString;
578
+ defaultBranch: z.ZodString;
579
+ }, z.core.$strip>;
580
+ sender: z.ZodObject<{
581
+ login: z.ZodString;
582
+ email: z.ZodOptional<z.ZodString>;
583
+ }, z.core.$strip>;
584
+ eventType: z.ZodLiteral<"pull_request.comment.edited">;
585
+ issue: z.ZodObject<{
586
+ id: z.ZodNumber;
587
+ number: z.ZodNumber;
588
+ title: z.ZodString;
589
+ body: z.ZodOptional<z.ZodString>;
590
+ state: z.ZodEnum<{
591
+ open: "open";
592
+ closed: "closed";
593
+ }>;
594
+ url: z.ZodString;
595
+ author: z.ZodObject<{
596
+ login: z.ZodString;
597
+ email: z.ZodOptional<z.ZodString>;
598
+ }, z.core.$strip>;
599
+ isPullRequest: z.ZodLiteral<true>;
600
+ }, z.core.$strip>;
601
+ comment: z.ZodObject<{
602
+ id: z.ZodNumber;
603
+ body: z.ZodString;
604
+ author: z.ZodObject<{
605
+ login: z.ZodString;
606
+ email: z.ZodOptional<z.ZodString>;
607
+ }, z.core.$strip>;
608
+ url: z.ZodString;
609
+ createdAt: z.ZodString;
610
+ updatedAt: z.ZodString;
611
+ }, z.core.$strip>;
612
+ }, z.core.$strip>;
613
+ export type GithubPRCommentEditedTrigger = z.infer<typeof GithubPRCommentEditedTriggerSchema>;
614
+ export declare const GithubPRCommentTriggerSchema: z.ZodUnion<readonly [z.ZodObject<{
615
+ integrationType: z.ZodLiteral<IntegrationType.GITHUB>;
616
+ username: z.ZodString;
617
+ installationId: z.ZodNumber;
618
+ repositoryName: z.ZodString;
619
+ repository: z.ZodObject<{
620
+ id: z.ZodNumber;
621
+ name: z.ZodString;
622
+ owner: z.ZodString;
623
+ defaultBranch: z.ZodString;
624
+ }, z.core.$strip>;
625
+ sender: z.ZodObject<{
626
+ login: z.ZodString;
627
+ email: z.ZodOptional<z.ZodString>;
628
+ }, z.core.$strip>;
629
+ eventType: z.ZodLiteral<"issue_comment.created">;
630
+ issue: z.ZodObject<{
631
+ id: z.ZodNumber;
632
+ number: z.ZodNumber;
633
+ title: z.ZodString;
634
+ body: z.ZodOptional<z.ZodString>;
635
+ state: z.ZodEnum<{
636
+ open: "open";
637
+ closed: "closed";
638
+ }>;
639
+ url: z.ZodString;
640
+ author: z.ZodObject<{
641
+ login: z.ZodString;
642
+ email: z.ZodOptional<z.ZodString>;
643
+ }, z.core.$strip>;
644
+ isPullRequest: z.ZodLiteral<true>;
645
+ }, z.core.$strip>;
646
+ comment: z.ZodObject<{
647
+ id: z.ZodNumber;
648
+ body: z.ZodString;
649
+ author: z.ZodObject<{
650
+ login: z.ZodString;
651
+ email: z.ZodOptional<z.ZodString>;
652
+ }, z.core.$strip>;
653
+ url: z.ZodString;
654
+ createdAt: z.ZodString;
655
+ updatedAt: z.ZodString;
656
+ }, z.core.$strip>;
657
+ }, z.core.$strip>, z.ZodObject<{
658
+ integrationType: z.ZodLiteral<IntegrationType.GITHUB>;
659
+ username: z.ZodString;
660
+ installationId: z.ZodNumber;
661
+ repositoryName: z.ZodString;
662
+ repository: z.ZodObject<{
663
+ id: z.ZodNumber;
664
+ name: z.ZodString;
665
+ owner: z.ZodString;
666
+ defaultBranch: z.ZodString;
667
+ }, z.core.$strip>;
668
+ sender: z.ZodObject<{
669
+ login: z.ZodString;
670
+ email: z.ZodOptional<z.ZodString>;
671
+ }, z.core.$strip>;
672
+ eventType: z.ZodLiteral<"pull_request.comment.edited">;
673
+ issue: z.ZodObject<{
674
+ id: z.ZodNumber;
675
+ number: z.ZodNumber;
676
+ title: z.ZodString;
677
+ body: z.ZodOptional<z.ZodString>;
678
+ state: z.ZodEnum<{
679
+ open: "open";
680
+ closed: "closed";
681
+ }>;
682
+ url: z.ZodString;
683
+ author: z.ZodObject<{
684
+ login: z.ZodString;
685
+ email: z.ZodOptional<z.ZodString>;
686
+ }, z.core.$strip>;
687
+ isPullRequest: z.ZodLiteral<true>;
688
+ }, z.core.$strip>;
689
+ comment: z.ZodObject<{
690
+ id: z.ZodNumber;
691
+ body: z.ZodString;
692
+ author: z.ZodObject<{
693
+ login: z.ZodString;
694
+ email: z.ZodOptional<z.ZodString>;
695
+ }, z.core.$strip>;
696
+ url: z.ZodString;
697
+ createdAt: z.ZodString;
698
+ updatedAt: z.ZodString;
699
+ }, z.core.$strip>;
700
+ }, z.core.$strip>]>;
701
+ export type GithubPRCommentTrigger = z.infer<typeof GithubPRCommentTriggerSchema>;
569
702
  export declare const GithubPRTriggerSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
570
703
  integrationType: z.ZodLiteral<IntegrationType.GITHUB>;
571
704
  username: z.ZodString;
@@ -1070,6 +1203,49 @@ export declare const GithubTriggerSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1070
1203
  createdAt: z.ZodString;
1071
1204
  updatedAt: z.ZodString;
1072
1205
  }, z.core.$strip>;
1206
+ }, z.core.$strip>, z.ZodObject<{
1207
+ integrationType: z.ZodLiteral<IntegrationType.GITHUB>;
1208
+ username: z.ZodString;
1209
+ installationId: z.ZodNumber;
1210
+ repositoryName: z.ZodString;
1211
+ repository: z.ZodObject<{
1212
+ id: z.ZodNumber;
1213
+ name: z.ZodString;
1214
+ owner: z.ZodString;
1215
+ defaultBranch: z.ZodString;
1216
+ }, z.core.$strip>;
1217
+ sender: z.ZodObject<{
1218
+ login: z.ZodString;
1219
+ email: z.ZodOptional<z.ZodString>;
1220
+ }, z.core.$strip>;
1221
+ eventType: z.ZodLiteral<"pull_request.comment.edited">;
1222
+ issue: z.ZodObject<{
1223
+ id: z.ZodNumber;
1224
+ number: z.ZodNumber;
1225
+ title: z.ZodString;
1226
+ body: z.ZodOptional<z.ZodString>;
1227
+ state: z.ZodEnum<{
1228
+ open: "open";
1229
+ closed: "closed";
1230
+ }>;
1231
+ url: z.ZodString;
1232
+ author: z.ZodObject<{
1233
+ login: z.ZodString;
1234
+ email: z.ZodOptional<z.ZodString>;
1235
+ }, z.core.$strip>;
1236
+ isPullRequest: z.ZodLiteral<true>;
1237
+ }, z.core.$strip>;
1238
+ comment: z.ZodObject<{
1239
+ id: z.ZodNumber;
1240
+ body: z.ZodString;
1241
+ author: z.ZodObject<{
1242
+ login: z.ZodString;
1243
+ email: z.ZodOptional<z.ZodString>;
1244
+ }, z.core.$strip>;
1245
+ url: z.ZodString;
1246
+ createdAt: z.ZodString;
1247
+ updatedAt: z.ZodString;
1248
+ }, z.core.$strip>;
1073
1249
  }, z.core.$strip>], "eventType">;
1074
1250
  export type GithubTrigger = z.infer<typeof GithubTriggerSchema>;
1075
1251
  export declare const GmailParsedAttachmentSchema: z.ZodObject<{
@@ -1266,6 +1442,7 @@ export declare const TriggerTypeSchema: z.ZodUnion<readonly [z.ZodEnum<{
1266
1442
  readonly PR_CLOSED: "pull_request.closed";
1267
1443
  readonly PR_SYNCHRONIZE: "pull_request.synchronize";
1268
1444
  readonly PR_COMMENT_CREATED: "pull_request.comment.created";
1445
+ readonly PR_COMMENT_EDITED: "pull_request.comment.edited";
1269
1446
  readonly ISSUE_COMMENT_CREATED: "issue_comment.created";
1270
1447
  }>, z.ZodEnum<{
1271
1448
  readonly ISSUE_CREATED: "issue.created";
@@ -1340,6 +1517,7 @@ export declare const baseTriggerSchema: z.ZodObject<{
1340
1517
  readonly PR_CLOSED: "pull_request.closed";
1341
1518
  readonly PR_SYNCHRONIZE: "pull_request.synchronize";
1342
1519
  readonly PR_COMMENT_CREATED: "pull_request.comment.created";
1520
+ readonly PR_COMMENT_EDITED: "pull_request.comment.edited";
1343
1521
  readonly ISSUE_COMMENT_CREATED: "issue_comment.created";
1344
1522
  }>, z.ZodEnum<{
1345
1523
  readonly ISSUE_CREATED: "issue.created";
@@ -5664,6 +5842,49 @@ export declare const TriggerSchema: z.ZodUnion<readonly [z.ZodDiscriminatedUnion
5664
5842
  createdAt: z.ZodString;
5665
5843
  updatedAt: z.ZodString;
5666
5844
  }, z.core.$strip>;
5845
+ }, z.core.$strip>, z.ZodObject<{
5846
+ integrationType: z.ZodLiteral<IntegrationType.GITHUB>;
5847
+ username: z.ZodString;
5848
+ installationId: z.ZodNumber;
5849
+ repositoryName: z.ZodString;
5850
+ repository: z.ZodObject<{
5851
+ id: z.ZodNumber;
5852
+ name: z.ZodString;
5853
+ owner: z.ZodString;
5854
+ defaultBranch: z.ZodString;
5855
+ }, z.core.$strip>;
5856
+ sender: z.ZodObject<{
5857
+ login: z.ZodString;
5858
+ email: z.ZodOptional<z.ZodString>;
5859
+ }, z.core.$strip>;
5860
+ eventType: z.ZodLiteral<"pull_request.comment.edited">;
5861
+ issue: z.ZodObject<{
5862
+ id: z.ZodNumber;
5863
+ number: z.ZodNumber;
5864
+ title: z.ZodString;
5865
+ body: z.ZodOptional<z.ZodString>;
5866
+ state: z.ZodEnum<{
5867
+ open: "open";
5868
+ closed: "closed";
5869
+ }>;
5870
+ url: z.ZodString;
5871
+ author: z.ZodObject<{
5872
+ login: z.ZodString;
5873
+ email: z.ZodOptional<z.ZodString>;
5874
+ }, z.core.$strip>;
5875
+ isPullRequest: z.ZodLiteral<true>;
5876
+ }, z.core.$strip>;
5877
+ comment: z.ZodObject<{
5878
+ id: z.ZodNumber;
5879
+ body: z.ZodString;
5880
+ author: z.ZodObject<{
5881
+ login: z.ZodString;
5882
+ email: z.ZodOptional<z.ZodString>;
5883
+ }, z.core.$strip>;
5884
+ url: z.ZodString;
5885
+ createdAt: z.ZodString;
5886
+ updatedAt: z.ZodString;
5887
+ }, z.core.$strip>;
5667
5888
  }, z.core.$strip>], "eventType">, z.ZodObject<{
5668
5889
  integrationType: z.ZodLiteral<IntegrationType.GMAIL>;
5669
5890
  eventType: z.ZodEnum<{
@@ -7670,6 +7891,49 @@ export declare const TriggerArraySchema: z.ZodArray<z.ZodUnion<readonly [z.ZodDi
7670
7891
  createdAt: z.ZodString;
7671
7892
  updatedAt: z.ZodString;
7672
7893
  }, z.core.$strip>;
7894
+ }, z.core.$strip>, z.ZodObject<{
7895
+ integrationType: z.ZodLiteral<IntegrationType.GITHUB>;
7896
+ username: z.ZodString;
7897
+ installationId: z.ZodNumber;
7898
+ repositoryName: z.ZodString;
7899
+ repository: z.ZodObject<{
7900
+ id: z.ZodNumber;
7901
+ name: z.ZodString;
7902
+ owner: z.ZodString;
7903
+ defaultBranch: z.ZodString;
7904
+ }, z.core.$strip>;
7905
+ sender: z.ZodObject<{
7906
+ login: z.ZodString;
7907
+ email: z.ZodOptional<z.ZodString>;
7908
+ }, z.core.$strip>;
7909
+ eventType: z.ZodLiteral<"pull_request.comment.edited">;
7910
+ issue: z.ZodObject<{
7911
+ id: z.ZodNumber;
7912
+ number: z.ZodNumber;
7913
+ title: z.ZodString;
7914
+ body: z.ZodOptional<z.ZodString>;
7915
+ state: z.ZodEnum<{
7916
+ open: "open";
7917
+ closed: "closed";
7918
+ }>;
7919
+ url: z.ZodString;
7920
+ author: z.ZodObject<{
7921
+ login: z.ZodString;
7922
+ email: z.ZodOptional<z.ZodString>;
7923
+ }, z.core.$strip>;
7924
+ isPullRequest: z.ZodLiteral<true>;
7925
+ }, z.core.$strip>;
7926
+ comment: z.ZodObject<{
7927
+ id: z.ZodNumber;
7928
+ body: z.ZodString;
7929
+ author: z.ZodObject<{
7930
+ login: z.ZodString;
7931
+ email: z.ZodOptional<z.ZodString>;
7932
+ }, z.core.$strip>;
7933
+ url: z.ZodString;
7934
+ createdAt: z.ZodString;
7935
+ updatedAt: z.ZodString;
7936
+ }, z.core.$strip>;
7673
7937
  }, z.core.$strip>], "eventType">, z.ZodObject<{
7674
7938
  integrationType: z.ZodLiteral<IntegrationType.GMAIL>;
7675
7939
  eventType: z.ZodEnum<{
@@ -9345,6 +9609,7 @@ export declare const serializedEventSchema: z.ZodObject<{
9345
9609
  readonly PR_CLOSED: "pull_request.closed";
9346
9610
  readonly PR_SYNCHRONIZE: "pull_request.synchronize";
9347
9611
  readonly PR_COMMENT_CREATED: "pull_request.comment.created";
9612
+ readonly PR_COMMENT_EDITED: "pull_request.comment.edited";
9348
9613
  readonly ISSUE_COMMENT_CREATED: "issue_comment.created";
9349
9614
  }>, z.ZodEnum<{
9350
9615
  readonly ISSUE_CREATED: "issue.created";
@@ -9407,6 +9672,7 @@ export declare const serializedEventSchema: z.ZodObject<{
9407
9672
  }>, z.ZodLiteral<"webhook">, z.ZodLiteral<"cron">, z.ZodLiteral<"webmonitor">, z.ZodLiteral<"manual_sample">]>;
9408
9673
  formattedContent: z.ZodString;
9409
9674
  debugLog: z.ZodString;
9675
+ triggeredAt: z.ZodDefault<z.ZodISODateTime>;
9410
9676
  display: z.ZodOptional<z.ZodObject<{
9411
9677
  title: z.ZodString;
9412
9678
  subtitle: z.ZodString;
@@ -9753,6 +10019,49 @@ export declare const serializedEventSchema: z.ZodObject<{
9753
10019
  createdAt: z.ZodString;
9754
10020
  updatedAt: z.ZodString;
9755
10021
  }, z.core.$strip>;
10022
+ }, z.core.$strip>, z.ZodObject<{
10023
+ integrationType: z.ZodLiteral<IntegrationType.GITHUB>;
10024
+ username: z.ZodString;
10025
+ installationId: z.ZodNumber;
10026
+ repositoryName: z.ZodString;
10027
+ repository: z.ZodObject<{
10028
+ id: z.ZodNumber;
10029
+ name: z.ZodString;
10030
+ owner: z.ZodString;
10031
+ defaultBranch: z.ZodString;
10032
+ }, z.core.$strip>;
10033
+ sender: z.ZodObject<{
10034
+ login: z.ZodString;
10035
+ email: z.ZodOptional<z.ZodString>;
10036
+ }, z.core.$strip>;
10037
+ eventType: z.ZodLiteral<"pull_request.comment.edited">;
10038
+ issue: z.ZodObject<{
10039
+ id: z.ZodNumber;
10040
+ number: z.ZodNumber;
10041
+ title: z.ZodString;
10042
+ body: z.ZodOptional<z.ZodString>;
10043
+ state: z.ZodEnum<{
10044
+ open: "open";
10045
+ closed: "closed";
10046
+ }>;
10047
+ url: z.ZodString;
10048
+ author: z.ZodObject<{
10049
+ login: z.ZodString;
10050
+ email: z.ZodOptional<z.ZodString>;
10051
+ }, z.core.$strip>;
10052
+ isPullRequest: z.ZodLiteral<true>;
10053
+ }, z.core.$strip>;
10054
+ comment: z.ZodObject<{
10055
+ id: z.ZodNumber;
10056
+ body: z.ZodString;
10057
+ author: z.ZodObject<{
10058
+ login: z.ZodString;
10059
+ email: z.ZodOptional<z.ZodString>;
10060
+ }, z.core.$strip>;
10061
+ url: z.ZodString;
10062
+ createdAt: z.ZodString;
10063
+ updatedAt: z.ZodString;
10064
+ }, z.core.$strip>;
9756
10065
  }, z.core.$strip>], "eventType">, z.ZodObject<{
9757
10066
  integrationType: z.ZodLiteral<IntegrationType.GMAIL>;
9758
10067
  eventType: z.ZodEnum<{
@@ -11415,6 +11724,7 @@ export type SerializedEvent = z.infer<typeof serializedEventSchema>;
11415
11724
  export declare const eventFixtureOverridesSchema: z.ZodObject<{
11416
11725
  formattedContent: z.ZodOptional<z.ZodString>;
11417
11726
  debugLog: z.ZodOptional<z.ZodString>;
11727
+ triggeredAt: z.ZodOptional<z.ZodISODateTime>;
11418
11728
  }, z.core.$strip>;
11419
11729
  export declare const eventFixtureSchema: z.ZodIntersection<z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
11420
11730
  integrationType: z.ZodLiteral<IntegrationType.SLACK>;
@@ -11758,6 +12068,49 @@ export declare const eventFixtureSchema: z.ZodIntersection<z.ZodUnion<readonly [
11758
12068
  createdAt: z.ZodString;
11759
12069
  updatedAt: z.ZodString;
11760
12070
  }, z.core.$strip>;
12071
+ }, z.core.$strip>, z.ZodObject<{
12072
+ integrationType: z.ZodLiteral<IntegrationType.GITHUB>;
12073
+ username: z.ZodString;
12074
+ installationId: z.ZodNumber;
12075
+ repositoryName: z.ZodString;
12076
+ repository: z.ZodObject<{
12077
+ id: z.ZodNumber;
12078
+ name: z.ZodString;
12079
+ owner: z.ZodString;
12080
+ defaultBranch: z.ZodString;
12081
+ }, z.core.$strip>;
12082
+ sender: z.ZodObject<{
12083
+ login: z.ZodString;
12084
+ email: z.ZodOptional<z.ZodString>;
12085
+ }, z.core.$strip>;
12086
+ eventType: z.ZodLiteral<"pull_request.comment.edited">;
12087
+ issue: z.ZodObject<{
12088
+ id: z.ZodNumber;
12089
+ number: z.ZodNumber;
12090
+ title: z.ZodString;
12091
+ body: z.ZodOptional<z.ZodString>;
12092
+ state: z.ZodEnum<{
12093
+ open: "open";
12094
+ closed: "closed";
12095
+ }>;
12096
+ url: z.ZodString;
12097
+ author: z.ZodObject<{
12098
+ login: z.ZodString;
12099
+ email: z.ZodOptional<z.ZodString>;
12100
+ }, z.core.$strip>;
12101
+ isPullRequest: z.ZodLiteral<true>;
12102
+ }, z.core.$strip>;
12103
+ comment: z.ZodObject<{
12104
+ id: z.ZodNumber;
12105
+ body: z.ZodString;
12106
+ author: z.ZodObject<{
12107
+ login: z.ZodString;
12108
+ email: z.ZodOptional<z.ZodString>;
12109
+ }, z.core.$strip>;
12110
+ url: z.ZodString;
12111
+ createdAt: z.ZodString;
12112
+ updatedAt: z.ZodString;
12113
+ }, z.core.$strip>;
11761
12114
  }, z.core.$strip>], "eventType">, z.ZodObject<{
11762
12115
  integrationType: z.ZodLiteral<IntegrationType.GMAIL>;
11763
12116
  eventType: z.ZodEnum<{
@@ -13417,6 +13770,7 @@ export declare const eventFixtureSchema: z.ZodIntersection<z.ZodUnion<readonly [
13417
13770
  }, z.core.$strip>]>, z.ZodObject<{
13418
13771
  formattedContent: z.ZodOptional<z.ZodString>;
13419
13772
  debugLog: z.ZodOptional<z.ZodString>;
13773
+ triggeredAt: z.ZodOptional<z.ZodISODateTime>;
13420
13774
  }, z.core.$strip>>;
13421
13775
  export type EventFixture = z.infer<typeof eventFixtureSchema>;
13422
13776
  export declare function hydrateSerializedEvent(fixture: EventFixture): SerializedEvent;
@@ -13818,6 +14172,51 @@ export declare const TriggerDefinitions: {
13818
14172
  updatedAt: z.ZodString;
13819
14173
  }, z.core.$strip>;
13820
14174
  }, z.core.$strip>>;
14175
+ GithubPRCommentEditedTrigger: ConcreteTriggerDefinition<z.ZodObject<{
14176
+ integrationType: z.ZodLiteral<IntegrationType.GITHUB>;
14177
+ username: z.ZodString;
14178
+ installationId: z.ZodNumber;
14179
+ repositoryName: z.ZodString;
14180
+ repository: z.ZodObject<{
14181
+ id: z.ZodNumber;
14182
+ name: z.ZodString;
14183
+ owner: z.ZodString;
14184
+ defaultBranch: z.ZodString;
14185
+ }, z.core.$strip>;
14186
+ sender: z.ZodObject<{
14187
+ login: z.ZodString;
14188
+ email: z.ZodOptional<z.ZodString>;
14189
+ }, z.core.$strip>;
14190
+ eventType: z.ZodLiteral<"pull_request.comment.edited">;
14191
+ issue: z.ZodObject<{
14192
+ id: z.ZodNumber;
14193
+ number: z.ZodNumber;
14194
+ title: z.ZodString;
14195
+ body: z.ZodOptional<z.ZodString>;
14196
+ state: z.ZodEnum<{
14197
+ open: "open";
14198
+ closed: "closed";
14199
+ }>;
14200
+ url: z.ZodString;
14201
+ author: z.ZodObject<{
14202
+ login: z.ZodString;
14203
+ email: z.ZodOptional<z.ZodString>;
14204
+ }, z.core.$strip>;
14205
+ isPullRequest: z.ZodLiteral<true>;
14206
+ }, z.core.$strip>;
14207
+ comment: z.ZodObject<{
14208
+ id: z.ZodNumber;
14209
+ body: z.ZodString;
14210
+ author: z.ZodObject<{
14211
+ login: z.ZodString;
14212
+ email: z.ZodOptional<z.ZodString>;
14213
+ }, z.core.$strip>;
14214
+ url: z.ZodString;
14215
+ createdAt: z.ZodString;
14216
+ updatedAt: z.ZodString;
14217
+ }, z.core.$strip>;
14218
+ }, z.core.$strip>>;
14219
+ GithubPRCommentTrigger: import("./TriggerDefinition.js").UnionTriggerDefinition;
13821
14220
  GithubPRTrigger: import("./TriggerDefinition.js").UnionTriggerDefinition;
13822
14221
  GithubTrigger: import("./TriggerDefinition.js").UnionTriggerDefinition;
13823
14222
  GmailTrigger: ConcreteTriggerDefinition<z.ZodObject<{
package/dist/Triggers.js CHANGED
@@ -155,8 +155,14 @@ export const GithubPRCommentCreatedTriggerSchema = GithubTriggerBaseSchema.exten
155
155
  issue: pullRequestCommentTargetSchema,
156
156
  comment: issueCommentSchema
157
157
  });
158
+ export const GithubPRCommentEditedTriggerSchema = GithubTriggerBaseSchema.extend({
159
+ eventType: z.literal(GitHubEventType.PR_COMMENT_EDITED),
160
+ issue: pullRequestCommentTargetSchema,
161
+ comment: issueCommentSchema
162
+ });
163
+ export const GithubPRCommentTriggerSchema = z.union([GithubPRCommentCreatedTriggerSchema, GithubPRCommentEditedTriggerSchema]);
158
164
  export const GithubPRTriggerSchema = z.discriminatedUnion("eventType", [GithubPROpenedTriggerSchema, GithubPRSynchronizedTriggerSchema, GithubPRClosedTriggerSchema, GithubPRMergedTriggerSchema]);
159
- export const GithubTriggerSchema = z.discriminatedUnion("eventType", [GithubPushTriggerSchema, GithubPRTriggerSchema, GithubIssueCommentCreatedTriggerSchema]);
165
+ export const GithubTriggerSchema = z.discriminatedUnion("eventType", [GithubPushTriggerSchema, GithubPRTriggerSchema, GithubIssueCommentCreatedTriggerSchema, GithubPRCommentEditedTriggerSchema]);
160
166
  export const GmailParsedAttachmentSchema = z.object({
161
167
  attachmentId: z.string(),
162
168
  filename: z.string(),
@@ -743,12 +749,14 @@ export const serializedEventSchema = z.object({
743
749
  eventType: TriggerTypeSchema,
744
750
  formattedContent: z.string(),
745
751
  debugLog: z.string(),
752
+ triggeredAt: z.iso.datetime({ offset: true }).default(() => new Date().toISOString()),
746
753
  display: serializedEventDisplaySchema.optional(),
747
754
  data: TriggerSchema
748
755
  });
749
756
  export const eventFixtureOverridesSchema = z.object({
750
757
  formattedContent: z.string().optional(),
751
- debugLog: z.string().optional()
758
+ debugLog: z.string().optional(),
759
+ triggeredAt: z.iso.datetime({ offset: true }).optional()
752
760
  });
753
761
  export const eventFixtureSchema = z.intersection(TriggerSchema, eventFixtureOverridesSchema);
754
762
  export function hydrateSerializedEvent(fixture) {
@@ -759,6 +767,7 @@ export function hydrateSerializedEvent(fixture) {
759
767
  eventType: trigger.eventType,
760
768
  formattedContent: fixture.formattedContent ?? formatTriggerForAgent(trigger),
761
769
  debugLog: fixture.debugLog ?? debugTrigger(trigger),
770
+ triggeredAt: fixture.triggeredAt ?? new Date().toISOString(),
762
771
  display: displayTrigger(trigger),
763
772
  data: trigger
764
773
  };
@@ -767,7 +776,8 @@ export function toEventFixture(event) {
767
776
  return {
768
777
  ...event.data,
769
778
  formattedContent: event.formattedContent,
770
- debugLog: event.debugLog
779
+ debugLog: event.debugLog,
780
+ triggeredAt: event.triggeredAt
771
781
  };
772
782
  }
773
783
  const slackPresenter = {
@@ -904,13 +914,23 @@ export const TriggerDefinitions = {
904
914
  eventTypes: [GitHubEventType.PR_COMMENT_CREATED],
905
915
  presenter: githubPresenter
906
916
  }),
917
+ GithubPRCommentEditedTrigger: defineTrigger({
918
+ integration: IntegrationType.GITHUB,
919
+ schema: GithubPRCommentEditedTriggerSchema,
920
+ eventTypes: [GitHubEventType.PR_COMMENT_EDITED],
921
+ presenter: githubPresenter
922
+ }),
923
+ GithubPRCommentTrigger: defineTriggerUnion({
924
+ integration: IntegrationType.GITHUB,
925
+ members: ["GithubPRCommentCreatedTrigger", "GithubPRCommentEditedTrigger"]
926
+ }),
907
927
  GithubPRTrigger: defineTriggerUnion({
908
928
  integration: IntegrationType.GITHUB,
909
929
  members: ["GithubPROpenedTrigger", "GithubPRSynchronizedTrigger", "GithubPRClosedTrigger", "GithubPRMergedTrigger"]
910
930
  }),
911
931
  GithubTrigger: defineTriggerUnion({
912
932
  integration: IntegrationType.GITHUB,
913
- members: ["GithubPushTrigger", "GithubPRTrigger", "GithubIssueCommentCreatedTrigger"],
933
+ members: ["GithubPushTrigger", "GithubPRTrigger", "GithubIssueCommentCreatedTrigger", "GithubPRCommentEditedTrigger"],
914
934
  presenter: githubPresenter
915
935
  }),
916
936
  GmailTrigger: defineTrigger({