@octokit/webhooks 13.7.3 → 13.7.5
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/README.md
CHANGED
|
@@ -96,8 +96,9 @@ source.onmessage = (event) => {
|
|
|
96
96
|
8. [webhooks.onError()](#webhooksonerror)
|
|
97
97
|
9. [webhooks.removeListener()](#webhooksremovelistener)
|
|
98
98
|
10. [createNodeMiddleware()](#createnodemiddleware)
|
|
99
|
-
11. [
|
|
100
|
-
12. [
|
|
99
|
+
11. [createWebMiddleware()](#createwebmiddleware)
|
|
100
|
+
12. [Webhook events](#webhook-events)
|
|
101
|
+
13. [emitterEventNames](#emittereventnames)
|
|
101
102
|
|
|
102
103
|
### Constructor
|
|
103
104
|
|
|
@@ -570,6 +571,63 @@ Used for internal logging. Defaults to [`console`](https://developer.mozilla.org
|
|
|
570
571
|
<tbody>
|
|
571
572
|
</table>
|
|
572
573
|
|
|
574
|
+
### createWebMiddleware()
|
|
575
|
+
|
|
576
|
+
```js
|
|
577
|
+
import { Webhooks, createWebMiddleware } from "@octokit/webhooks";
|
|
578
|
+
|
|
579
|
+
const webhooks = new Webhooks({
|
|
580
|
+
secret: "mysecret",
|
|
581
|
+
});
|
|
582
|
+
|
|
583
|
+
const middleware = createWebMiddleware(webhooks, { path: "/webhooks" });
|
|
584
|
+
|
|
585
|
+
// Example usage in Deno
|
|
586
|
+
Deno.serve({ port: 3000 }, middleware);
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
The middleware returned from `createWebMiddleware` can also be used in serverless environments like AWS Lambda, Cloudflare Workers, and Vercel.
|
|
590
|
+
|
|
591
|
+
<table width="100%">
|
|
592
|
+
<tbody valign="top">
|
|
593
|
+
<tr>
|
|
594
|
+
<td>
|
|
595
|
+
<code>webhooks</code>
|
|
596
|
+
<em>
|
|
597
|
+
Webhooks instance
|
|
598
|
+
</em>
|
|
599
|
+
</td>
|
|
600
|
+
<td>
|
|
601
|
+
<strong>Required.</strong>
|
|
602
|
+
</td>
|
|
603
|
+
</tr>
|
|
604
|
+
<tr>
|
|
605
|
+
<td>
|
|
606
|
+
<code>path</code>
|
|
607
|
+
<em>
|
|
608
|
+
string
|
|
609
|
+
</em>
|
|
610
|
+
</td>
|
|
611
|
+
<td>
|
|
612
|
+
Custom path to match requests against. Defaults to <code>/api/github/webhooks</code>.
|
|
613
|
+
</td>
|
|
614
|
+
</tr>
|
|
615
|
+
<tr>
|
|
616
|
+
<td>
|
|
617
|
+
<code>log</code>
|
|
618
|
+
<em>
|
|
619
|
+
object
|
|
620
|
+
</em>
|
|
621
|
+
</td>
|
|
622
|
+
<td>
|
|
623
|
+
|
|
624
|
+
Used for internal logging. Defaults to [`console`](https://developer.mozilla.org/en-US/docs/Web/API/console) with `debug` and `info` doing nothing.
|
|
625
|
+
|
|
626
|
+
</td>
|
|
627
|
+
</tr>
|
|
628
|
+
<tbody>
|
|
629
|
+
</table>
|
|
630
|
+
|
|
573
631
|
### Webhook events
|
|
574
632
|
|
|
575
633
|
See the full list of [event types with example payloads](https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads/).
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Webhooks } from "../../index.js";
|
|
2
2
|
import type { MiddlewareOptions } from "../types.js";
|
|
3
|
-
export declare function createWebMiddleware(webhooks: Webhooks, { path, log, }?: MiddlewareOptions): (request: Request) => Promise<
|
|
3
|
+
export declare function createWebMiddleware(webhooks: Webhooks, { path, log, }?: MiddlewareOptions): (request: Request) => Promise<Response>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Webhooks } from "../../index.js";
|
|
2
2
|
import type { MiddlewareOptions } from "../types.js";
|
|
3
|
-
export declare function middleware(webhooks: Webhooks, options: Required<MiddlewareOptions>, request: Request): Promise<
|
|
3
|
+
export declare function middleware(webhooks: Webhooks, options: Required<MiddlewareOptions>, request: Request): Promise<Response>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octokit/webhooks",
|
|
3
|
-
"version": "13.7.
|
|
3
|
+
"version": "13.7.5",
|
|
4
4
|
"description": "GitHub webhook events toolset for Node.js",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"repository": "github:octokit/webhooks.js",
|
|
@@ -8,21 +8,21 @@
|
|
|
8
8
|
"author": "Gregor Martynus (https://twitter.com/gr2m)",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@octokit/openapi-webhooks-types": "10.
|
|
11
|
+
"@octokit/openapi-webhooks-types": "10.3.0",
|
|
12
12
|
"@octokit/request-error": "^6.1.7",
|
|
13
13
|
"@octokit/webhooks-methods": "^5.1.1"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@octokit/openapi-webhooks": "10.
|
|
16
|
+
"@octokit/openapi-webhooks": "10.3.0",
|
|
17
17
|
"@octokit/tsconfig": "^4.0.0",
|
|
18
18
|
"@types/node": "^22.0.0",
|
|
19
19
|
"@vitest/coverage-v8": "^3.0.0",
|
|
20
20
|
"esbuild": "^0.25.0",
|
|
21
21
|
"express": "^4.17.1",
|
|
22
22
|
"glob": "^11.0.0",
|
|
23
|
-
"prettier": "3.5.
|
|
23
|
+
"prettier": "3.5.3",
|
|
24
24
|
"prettier-plugin-packagejson": "^2.2.9",
|
|
25
|
-
"
|
|
25
|
+
"tsx": "^4.19.3",
|
|
26
26
|
"typescript": "^5.0.0",
|
|
27
27
|
"vitest": "^3.0.0"
|
|
28
28
|
},
|