@citec-spbu/contracts 1.0.19 → 1.0.21
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/events/collector/index.d.ts +1 -0
- package/dist/events/collector/index.js +17 -0
- package/dist/events/collector/normalized-event-published.interface.d.ts +142 -0
- package/dist/events/collector/normalized-event-published.interface.js +2 -0
- package/dist/events/index.d.ts +1 -0
- package/dist/events/index.js +17 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./normalized-event-published.interface";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./normalized-event-published.interface"), exports);
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
interface _NormalizedEventPublished<T = unknown, P = unknown> {
|
|
2
|
+
id: string;
|
|
3
|
+
source: "github";
|
|
4
|
+
type: T;
|
|
5
|
+
publishedAt: Date;
|
|
6
|
+
payload: P;
|
|
7
|
+
repositoryOwner: {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
url: string;
|
|
11
|
+
avatarUrl: string;
|
|
12
|
+
};
|
|
13
|
+
repository: {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
url: string;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
interface UserPayload {
|
|
20
|
+
id: string;
|
|
21
|
+
login: string;
|
|
22
|
+
}
|
|
23
|
+
interface CommitEventPayload {
|
|
24
|
+
sha: string;
|
|
25
|
+
message: string;
|
|
26
|
+
author: UserPayload;
|
|
27
|
+
stats: {
|
|
28
|
+
additions: number;
|
|
29
|
+
deletions: number;
|
|
30
|
+
};
|
|
31
|
+
committedAt: Date;
|
|
32
|
+
}
|
|
33
|
+
interface IssueCreatedEventPayload {
|
|
34
|
+
id: string;
|
|
35
|
+
number: number;
|
|
36
|
+
author: UserPayload;
|
|
37
|
+
title: string;
|
|
38
|
+
description: string | null;
|
|
39
|
+
state: "open" | "closed";
|
|
40
|
+
commentCount: number;
|
|
41
|
+
createdAt: Date;
|
|
42
|
+
closedAt: Date | null;
|
|
43
|
+
}
|
|
44
|
+
interface IssueStateChangedEventPayload {
|
|
45
|
+
eventId: string;
|
|
46
|
+
issueId: string;
|
|
47
|
+
actor: UserPayload;
|
|
48
|
+
event: "closed" | "reopened";
|
|
49
|
+
createdAt: Date;
|
|
50
|
+
}
|
|
51
|
+
interface IssueAssigneeEventPayload {
|
|
52
|
+
eventId: string;
|
|
53
|
+
issueId: string;
|
|
54
|
+
event: "assigned" | "unassigned";
|
|
55
|
+
actor: UserPayload;
|
|
56
|
+
assignee: UserPayload;
|
|
57
|
+
createdAt: Date;
|
|
58
|
+
}
|
|
59
|
+
interface IssueLabelEventPayload {
|
|
60
|
+
eventId: string;
|
|
61
|
+
issueId: string;
|
|
62
|
+
actor: UserPayload;
|
|
63
|
+
event: "labeled" | "unlabeled";
|
|
64
|
+
label: string;
|
|
65
|
+
createdAt: Date;
|
|
66
|
+
}
|
|
67
|
+
interface IssueCommentEventPayload {
|
|
68
|
+
eventId: string;
|
|
69
|
+
issueId: string;
|
|
70
|
+
actor: UserPayload;
|
|
71
|
+
event: "commented";
|
|
72
|
+
body: string;
|
|
73
|
+
createdAt: Date;
|
|
74
|
+
}
|
|
75
|
+
interface PullRequestCreatedPayload {
|
|
76
|
+
id: string;
|
|
77
|
+
number: number;
|
|
78
|
+
name: string;
|
|
79
|
+
description: string | null;
|
|
80
|
+
state: "open" | "closed";
|
|
81
|
+
author: UserPayload;
|
|
82
|
+
commentCount: number;
|
|
83
|
+
additions: number;
|
|
84
|
+
deletions: number;
|
|
85
|
+
createdAt: Date;
|
|
86
|
+
updatedAt: Date;
|
|
87
|
+
closedAt: Date | null;
|
|
88
|
+
}
|
|
89
|
+
interface PullRequestStateChangedEventPayload {
|
|
90
|
+
eventId: string;
|
|
91
|
+
prId: string;
|
|
92
|
+
event: "reopened" | "merged" | "closed";
|
|
93
|
+
actor: UserPayload;
|
|
94
|
+
createdAt: Date;
|
|
95
|
+
}
|
|
96
|
+
interface PullRequestAssigneeEventPayload {
|
|
97
|
+
eventId: string;
|
|
98
|
+
prId: string;
|
|
99
|
+
event: "assigned" | "unassigned";
|
|
100
|
+
actor: UserPayload;
|
|
101
|
+
assignee: UserPayload;
|
|
102
|
+
createdAt: Date;
|
|
103
|
+
}
|
|
104
|
+
interface PullRequestLabelEventPayload {
|
|
105
|
+
eventId: string;
|
|
106
|
+
issueId: string;
|
|
107
|
+
actor: UserPayload;
|
|
108
|
+
event: "labeled" | "unlabeled";
|
|
109
|
+
label: string;
|
|
110
|
+
createdAt: Date;
|
|
111
|
+
}
|
|
112
|
+
interface PullRequestReviewRequestEventPayload {
|
|
113
|
+
eventId: string;
|
|
114
|
+
prId: string;
|
|
115
|
+
event: "review_requested";
|
|
116
|
+
actor: UserPayload;
|
|
117
|
+
requestedReviewer: UserPayload;
|
|
118
|
+
createdAt: Date;
|
|
119
|
+
}
|
|
120
|
+
interface PullRequestReviewEventPayload {
|
|
121
|
+
eventId: string;
|
|
122
|
+
prId: string;
|
|
123
|
+
event: "reviewed";
|
|
124
|
+
actor: UserPayload;
|
|
125
|
+
body: string;
|
|
126
|
+
createdAt: Date;
|
|
127
|
+
updatedAt: Date;
|
|
128
|
+
}
|
|
129
|
+
interface PullRequestCommentEventPayload {
|
|
130
|
+
eventId: string;
|
|
131
|
+
prId: string;
|
|
132
|
+
event: "commented";
|
|
133
|
+
actor: UserPayload;
|
|
134
|
+
body: string;
|
|
135
|
+
createdAt: Date;
|
|
136
|
+
updatedAt: Date;
|
|
137
|
+
}
|
|
138
|
+
export type NormalizedEventPublished = _NormalizedEventPublished<"commit.created", CommitEventPayload> | _NormalizedEventPublished<"issue.created", IssueCreatedEventPayload> | _NormalizedEventPublished<"issue.state_changed", IssueStateChangedEventPayload> | _NormalizedEventPublished<"issue.assigned", IssueAssigneeEventPayload> | _NormalizedEventPublished<"issue.labeled", IssueLabelEventPayload> | _NormalizedEventPublished<"issue.commented", IssueCommentEventPayload> | _NormalizedEventPublished<"pull_request.created", PullRequestCreatedPayload> | _NormalizedEventPublished<"pull_request.state_changed", PullRequestStateChangedEventPayload> | _NormalizedEventPublished<"pull_request.assigned", PullRequestAssigneeEventPayload> | _NormalizedEventPublished<"pull_request.labeled", PullRequestLabelEventPayload> | _NormalizedEventPublished<"pull_request.review_requested", PullRequestReviewRequestEventPayload> | _NormalizedEventPublished<"pull_request.reviewed", PullRequestReviewEventPayload> | _NormalizedEventPublished<"pull_request.commented", PullRequestCommentEventPayload>;
|
|
139
|
+
export type ExtractEvent<T extends NormalizedEventPublished["type"]> = Extract<NormalizedEventPublished, {
|
|
140
|
+
type: T;
|
|
141
|
+
}>;
|
|
142
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./collector";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./collector"), exports);
|