@flink-app/github-app-plugin 2.0.0-alpha.73 → 2.0.0-alpha.75
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/CHANGELOG.md +14 -0
- package/dist/handlers/WebhookHandler.js +1 -1
- package/dist/repos/GitHubInstallationRepo.js +2 -2
- package/dist/repos/GitHubWebhookEventRepo.js +1 -1
- package/examples/basic-installation.ts +1 -1
- package/examples/with-jwt-auth.ts +1 -1
- package/package.json +4 -4
- package/src/handlers/WebhookHandler.ts +1 -1
- package/src/repos/GitHubInstallationRepo.ts +2 -2
- package/src/repos/GitHubWebhookEventRepo.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.0.0-alpha.75
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @flink-app/flink@2.0.0-alpha.75
|
|
8
|
+
|
|
9
|
+
## 2.0.0-alpha.74
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
- @flink-app/flink@2.0.0-alpha.74
|
|
16
|
+
|
|
3
17
|
## 2.0.0-alpha.73
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -149,7 +149,7 @@ const WebhookHandler = async ({ ctx, req }) => {
|
|
|
149
149
|
try {
|
|
150
150
|
const webhookEvent = await ctx.repos.githubWebhookEventRepo.getOne({ deliveryId });
|
|
151
151
|
if (webhookEvent && webhookEvent._id) {
|
|
152
|
-
await ctx.repos.githubWebhookEventRepo.
|
|
152
|
+
await ctx.repos.githubWebhookEventRepo.updateById(webhookEvent._id, {
|
|
153
153
|
processed: true,
|
|
154
154
|
processedAt: new Date(),
|
|
155
155
|
error: error.message,
|
|
@@ -46,7 +46,7 @@ class GitHubInstallationRepo extends flink_1.FlinkRepo {
|
|
|
46
46
|
if (!installation) {
|
|
47
47
|
return null;
|
|
48
48
|
}
|
|
49
|
-
const updated = await this.
|
|
49
|
+
const updated = await this.updateById(installation._id, {
|
|
50
50
|
repositories,
|
|
51
51
|
updatedAt: new Date(),
|
|
52
52
|
});
|
|
@@ -63,7 +63,7 @@ class GitHubInstallationRepo extends flink_1.FlinkRepo {
|
|
|
63
63
|
if (!installation) {
|
|
64
64
|
return null;
|
|
65
65
|
}
|
|
66
|
-
const updated = await this.
|
|
66
|
+
const updated = await this.updateById(installation._id, {
|
|
67
67
|
suspendedAt: new Date(),
|
|
68
68
|
suspendedBy,
|
|
69
69
|
updatedAt: new Date(),
|
|
@@ -24,7 +24,7 @@ class GitHubWebhookEventRepo extends flink_1.FlinkRepo {
|
|
|
24
24
|
* @returns The updated event
|
|
25
25
|
*/
|
|
26
26
|
async markProcessed(eventId) {
|
|
27
|
-
const updated = await this.
|
|
27
|
+
const updated = await this.updateById(eventId, {
|
|
28
28
|
processed: true,
|
|
29
29
|
processedAt: new Date(),
|
|
30
30
|
});
|
|
@@ -38,7 +38,7 @@ class UserRepo extends FlinkRepo<AppContext, User> {
|
|
|
38
38
|
|
|
39
39
|
const installations = user.githubInstallations || [];
|
|
40
40
|
if (!installations.includes(installationId)) {
|
|
41
|
-
await this.
|
|
41
|
+
await this.updateById(userId, {
|
|
42
42
|
githubInstallations: [...installations, installationId],
|
|
43
43
|
});
|
|
44
44
|
}
|
|
@@ -106,7 +106,7 @@ async function start() {
|
|
|
106
106
|
if (user) {
|
|
107
107
|
const installations = user.githubInstallations || [];
|
|
108
108
|
if (!installations.includes(installationId)) {
|
|
109
|
-
await ctx.repos.userRepo.
|
|
109
|
+
await ctx.repos.userRepo.updateById(userId, {
|
|
110
110
|
githubInstallations: [...installations, installationId],
|
|
111
111
|
});
|
|
112
112
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flink-app/github-app-plugin",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.75",
|
|
4
4
|
"description": "Flink plugin for GitHub App integration with installation management and webhook handling",
|
|
5
5
|
"author": "joel@frost.se",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"mongodb": "^6.15.0",
|
|
24
|
-
"@flink-app/flink": ">=2.0.0-alpha.
|
|
24
|
+
"@flink-app/flink": ">=2.0.0-alpha.75"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"jsonwebtoken": "^9.0.2"
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"mongodb-memory-server": "^10.2.3",
|
|
34
34
|
"ts-node": "^10.9.2",
|
|
35
35
|
"tsc-watch": "^4.2.9",
|
|
36
|
-
"@flink-app/flink": "2.0.0-alpha.
|
|
37
|
-
"@flink-app/test-utils": "2.0.0-alpha.
|
|
36
|
+
"@flink-app/flink": "2.0.0-alpha.75",
|
|
37
|
+
"@flink-app/test-utils": "2.0.0-alpha.75"
|
|
38
38
|
},
|
|
39
39
|
"gitHead": "4243e3b3cd6d4e1ca001a61baa8436bf2bbe4113",
|
|
40
40
|
"scripts": {
|
|
@@ -139,7 +139,7 @@ const WebhookHandler = async ({ ctx, req }: { ctx: GitHubAppInternalContext; req
|
|
|
139
139
|
try {
|
|
140
140
|
const webhookEvent = await ctx.repos.githubWebhookEventRepo.getOne({ deliveryId });
|
|
141
141
|
if (webhookEvent && webhookEvent._id) {
|
|
142
|
-
await ctx.repos.githubWebhookEventRepo.
|
|
142
|
+
await ctx.repos.githubWebhookEventRepo.updateById(webhookEvent._id, {
|
|
143
143
|
processed: true,
|
|
144
144
|
processedAt: new Date(),
|
|
145
145
|
error: error.message,
|
|
@@ -52,7 +52,7 @@ class GitHubInstallationRepo extends FlinkRepo<any, GitHubInstallation> {
|
|
|
52
52
|
return null;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
const updated = await this.
|
|
55
|
+
const updated = await this.updateById(installation._id!, {
|
|
56
56
|
repositories,
|
|
57
57
|
updatedAt: new Date(),
|
|
58
58
|
});
|
|
@@ -72,7 +72,7 @@ class GitHubInstallationRepo extends FlinkRepo<any, GitHubInstallation> {
|
|
|
72
72
|
return null;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
const updated = await this.
|
|
75
|
+
const updated = await this.updateById(installation._id!, {
|
|
76
76
|
suspendedAt: new Date(),
|
|
77
77
|
suspendedBy,
|
|
78
78
|
updatedAt: new Date(),
|
|
@@ -27,7 +27,7 @@ class GitHubWebhookEventRepo extends FlinkRepo<any, WebhookEvent> {
|
|
|
27
27
|
* @returns The updated event
|
|
28
28
|
*/
|
|
29
29
|
async markProcessed(eventId: string): Promise<WebhookEvent | null> {
|
|
30
|
-
const updated = await this.
|
|
30
|
+
const updated = await this.updateById(eventId, {
|
|
31
31
|
processed: true,
|
|
32
32
|
processedAt: new Date(),
|
|
33
33
|
});
|