@kronos-integration/interceptor-webhook 2.0.6 → 3.0.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.
Files changed (2) hide show
  1. package/package.json +4 -4
  2. 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": "2.0.6",
3
+ "version": "3.0.1",
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": "^11.0.4",
32
- "pacc": "^3.7.0"
31
+ "@kronos-integration/interceptor": "^12.0.3",
32
+ "pacc": "^3.13.2"
33
33
  },
34
34
  "devDependencies": {
35
- "@kronos-integration/endpoint": "^10.0.4",
35
+ "@kronos-integration/endpoint": "^10.1.1",
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 { mergeAttributeDefinitions, prepareAttributesDefinitions } from "pacc";
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 get configurationAttributes() {
14
- return mergeAttributeDefinitions(
15
- prepareAttributesDefinitions({
16
- secret: {
17
- description: "secret to authorize request",
18
- type: "string",
19
- private: true
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
+ };