@verdaccio/hooks 8.0.0-next-8.38 → 8.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/README.md +39 -0
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -15,6 +15,45 @@
|
|
|
15
15
|
[](https://hub.docker.com/r/verdaccio/verdaccio)
|
|
16
16
|
[](https://github.com/verdaccio/verdaccio/stargazers)
|
|
17
17
|
|
|
18
|
+
> **Note:** This package is mostly for internal use by Verdaccio and is only intended to be used with Verdaccio 6.x.
|
|
19
|
+
|
|
20
|
+
## Overview
|
|
21
|
+
|
|
22
|
+
The `@verdaccio/hooks` package provides webhook notification capabilities for Verdaccio. It sends HTTP notifications to configured endpoints when packages are published, using Handlebars templates for message formatting.
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install @verdaccio/hooks
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
import { notify } from '@verdaccio/hooks';
|
|
34
|
+
|
|
35
|
+
// Send notifications for a package publish event
|
|
36
|
+
await notify(packageMetadata, config, remoteUser, publishedPackage);
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### API
|
|
40
|
+
|
|
41
|
+
- **`notify(metadata, config, remoteUser, publishedPackage)`** - Sends notifications to all configured endpoints for a package event
|
|
42
|
+
- **`sendNotification(metadata, notify, remoteUser, publishedPackage)`** - Sends a single notification to a specific endpoint
|
|
43
|
+
- **`handleNotify(metadata, notifyEntry, remoteUser, publishedPackage)`** - Core handler that processes notification patterns, compiles Handlebars templates, and sends HTTP requests
|
|
44
|
+
|
|
45
|
+
### Configuration
|
|
46
|
+
|
|
47
|
+
Notifications are configured in the Verdaccio `config.yaml`:
|
|
48
|
+
|
|
49
|
+
```yaml
|
|
50
|
+
notify:
|
|
51
|
+
method: POST
|
|
52
|
+
headers: [{ 'Content-Type': 'application/json' }]
|
|
53
|
+
endpoint: https://hooks.example.com/webhook
|
|
54
|
+
content: '{"name": "{{name}}", "versions": "{{versions}}"}'
|
|
55
|
+
```
|
|
56
|
+
|
|
18
57
|
## Donations
|
|
19
58
|
|
|
20
59
|
Verdaccio is run by **volunteers**; nobody is working full-time on it. If you find this project to be useful and would like to support its development, consider making a donation - **your logo might end up in this readme.** 😉
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verdaccio/hooks",
|
|
3
|
-
"version": "8.0.0
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "Verdaccio Hooks",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -33,18 +33,18 @@
|
|
|
33
33
|
"node": ">=18"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@verdaccio/core": "8.0.0
|
|
37
|
-
"@verdaccio/logger": "8.0.0
|
|
36
|
+
"@verdaccio/core": "8.0.0",
|
|
37
|
+
"@verdaccio/logger": "8.0.0",
|
|
38
38
|
"debug": "4.4.3",
|
|
39
39
|
"got-cjs": "12.5.4",
|
|
40
40
|
"handlebars": "4.7.9"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@verdaccio/config": "8.0.0
|
|
44
|
-
"@verdaccio/types": "13.0.0
|
|
43
|
+
"@verdaccio/config": "8.0.0",
|
|
44
|
+
"@verdaccio/types": "13.0.0",
|
|
45
45
|
"nock": "13.5.6",
|
|
46
46
|
"vitest": "3.2.4",
|
|
47
|
-
"@verdaccio/test-helper": "4.0.0
|
|
47
|
+
"@verdaccio/test-helper": "4.0.0"
|
|
48
48
|
},
|
|
49
49
|
"funding": {
|
|
50
50
|
"type": "opencollective",
|