@kronos-integration/interceptor-webhook 2.0.6 → 3.0.0
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/package.json +4 -4
- package/src/webhook.mjs +13 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kronos-integration/interceptor-webhook",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"lint:docs": "documentation lint ./src/**/*.mjs"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@kronos-integration/interceptor": "^
|
|
32
|
-
"pacc": "^3.
|
|
31
|
+
"@kronos-integration/interceptor": "^12.0.2",
|
|
32
|
+
"pacc": "^3.11.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@kronos-integration/endpoint": "^10.0.
|
|
35
|
+
"@kronos-integration/endpoint": "^10.0.5",
|
|
36
36
|
"ava": "^6.4.1",
|
|
37
37
|
"c8": "^10.1.3",
|
|
38
38
|
"documentation": "^14.0.3",
|
package/src/webhook.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createHmac } from "crypto";
|
|
2
2
|
import { Interceptor } from "@kronos-integration/interceptor";
|
|
3
|
-
import {
|
|
3
|
+
import { prepareAttributesDefinitions, secret_attribute } from "pacc";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
*
|
|
@@ -10,18 +10,15 @@ export class GithubHookInterceptor extends Interceptor {
|
|
|
10
10
|
return "github-webhook";
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
static
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
super.configurationAttributes
|
|
23
|
-
);
|
|
24
|
-
}
|
|
13
|
+
static attributes = prepareAttributesDefinitions(
|
|
14
|
+
{
|
|
15
|
+
secret: {
|
|
16
|
+
...secret_attribute,
|
|
17
|
+
description: "secret to authorize request"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
Interceptor.attributes
|
|
21
|
+
);
|
|
25
22
|
|
|
26
23
|
async receive(endpoint, next, ctx) {
|
|
27
24
|
const [sig, event, id] = headers(ctx, [
|
|
@@ -48,7 +45,7 @@ export class GithubHookInterceptor extends Interceptor {
|
|
|
48
45
|
}
|
|
49
46
|
|
|
50
47
|
/**
|
|
51
|
-
*
|
|
48
|
+
*
|
|
52
49
|
*/
|
|
53
50
|
export class GiteaHookInterceptor extends Interceptor {
|
|
54
51
|
static get name() {
|
|
@@ -77,7 +74,7 @@ export class GiteaHookInterceptor extends Interceptor {
|
|
|
77
74
|
}
|
|
78
75
|
|
|
79
76
|
/**
|
|
80
|
-
*
|
|
77
|
+
*
|
|
81
78
|
*/
|
|
82
79
|
export class BitbucketHookInterceptor extends Interceptor {
|
|
83
80
|
static get name() {
|
|
@@ -123,7 +120,6 @@ async function rawBody(req) {
|
|
|
123
120
|
return chunks.join("");
|
|
124
121
|
}
|
|
125
122
|
|
|
126
|
-
|
|
127
123
|
const RESPONSE_HEADERS = {
|
|
128
124
|
"content-type": "application/json"
|
|
129
|
-
};
|
|
125
|
+
};
|