@tenonhq/dovetail-dashboard 0.0.13
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 +116 -0
- package/package.json +26 -0
- package/public/app.js +1001 -0
- package/public/index.html +79 -0
- package/public/styles.css +819 -0
- package/server.js +785 -0
package/README.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# @tenonhq/dovetail-dashboard
|
|
2
|
+
|
|
3
|
+
Web-based UI for managing ServiceNow update sets across scopes, with optional ClickUp task integration.
|
|
4
|
+
|
|
5
|
+
## What It Does
|
|
6
|
+
|
|
7
|
+
- Displays all configured scopes from `dove.config.js`
|
|
8
|
+
- Lists in-progress update sets per scope
|
|
9
|
+
- Lets you select, create, close, and clear update sets per scope
|
|
10
|
+
- Persists selections to `.dove-update-sets.json` — **`dove push` and `dove watch` honor these selections** via the `pushWithUpdateSet` REST endpoint
|
|
11
|
+
- Optional ClickUp integration: select a task, auto-generate and activate update sets across all scopes
|
|
12
|
+
|
|
13
|
+
## Setup
|
|
14
|
+
|
|
15
|
+
### Prerequisites
|
|
16
|
+
|
|
17
|
+
- Node.js 20+
|
|
18
|
+
- A configured Dovetail project with `dove.config.js` and `.env`
|
|
19
|
+
|
|
20
|
+
### Environment Variables
|
|
21
|
+
|
|
22
|
+
Add these to your project's `.env`:
|
|
23
|
+
|
|
24
|
+
| Variable | Required | Default | Description |
|
|
25
|
+
|----------|----------|---------|-------------|
|
|
26
|
+
| `SN_INSTANCE` | Yes | — | ServiceNow instance name (e.g. `tenonworkstudio`) |
|
|
27
|
+
| `SN_USER` | Yes | — | ServiceNow username |
|
|
28
|
+
| `SN_PASSWORD` | Yes | — | ServiceNow password |
|
|
29
|
+
| `DASHBOARD_PORT` | No | `3456` | Local server port |
|
|
30
|
+
| `CLICKUP_API_TOKEN` | No | — | ClickUp personal API token (enables task sidebar) |
|
|
31
|
+
| `CLICKUP_TEAM_ID` | No | — | ClickUp team ID (auto-detected if omitted) |
|
|
32
|
+
|
|
33
|
+
### Running
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# From your Dovetail project directory
|
|
37
|
+
dove dashboard
|
|
38
|
+
|
|
39
|
+
# Custom port (useful for multiple sessions)
|
|
40
|
+
dove dashboard --port 3457
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
This starts an Express server and opens `http://localhost:3456` (or your custom port) in your browser.
|
|
44
|
+
|
|
45
|
+
Port precedence: `--port` flag > `DASHBOARD_PORT` env var > default `3456`.
|
|
46
|
+
|
|
47
|
+
## How It Integrates with Push
|
|
48
|
+
|
|
49
|
+
When you select an update set for a scope in the dashboard, it saves the mapping to `.dove-update-sets.json`:
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"x_cadso_core": {
|
|
54
|
+
"sys_id": "abc123def456",
|
|
55
|
+
"name": "CU-5029 — Feature Implementation"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The core Dovetail push logic (`appUtils.ts:pushRec`) reads this file on every push. If an update set is mapped for the record's scope, it routes the push through `/api/cadso/dovetail/pushWithUpdateSet` — ensuring the change lands in the correct update set. This works for both `dove push` and `dove watch`.
|
|
61
|
+
|
|
62
|
+
## ClickUp Integration
|
|
63
|
+
|
|
64
|
+
When `CLICKUP_API_TOKEN` is configured, a "Tasks" button appears in the header. Clicking it opens a sidebar where you can:
|
|
65
|
+
|
|
66
|
+
1. Filter tasks by status (default: "in progress")
|
|
67
|
+
2. Select a task as the active task
|
|
68
|
+
3. Auto-generate update set names in the format `CU-{taskId} — {task name}`
|
|
69
|
+
4. Auto-activate all configured scopes — finds existing update sets or creates new ones
|
|
70
|
+
|
|
71
|
+
Active task state is persisted to `.dove-active-task.json` and survives dashboard restarts.
|
|
72
|
+
|
|
73
|
+
## API Endpoints
|
|
74
|
+
|
|
75
|
+
### Update Set Management
|
|
76
|
+
|
|
77
|
+
| Method | Path | Description |
|
|
78
|
+
|--------|------|-------------|
|
|
79
|
+
| `GET` | `/api/scopes` | List configured scopes with display names and saved selections |
|
|
80
|
+
| `GET` | `/api/update-sets/:scope` | List in-progress update sets for a scope |
|
|
81
|
+
| `POST` | `/api/update-set` | Create a new update set |
|
|
82
|
+
| `PATCH` | `/api/update-set/:sysId/close` | Mark an update set as complete |
|
|
83
|
+
| `POST` | `/api/select-update-set` | Save scope-to-update-set mapping |
|
|
84
|
+
| `GET` | `/api/config` | Return saved config and instance name |
|
|
85
|
+
|
|
86
|
+
### ClickUp Integration
|
|
87
|
+
|
|
88
|
+
| Method | Path | Description |
|
|
89
|
+
|--------|------|-------------|
|
|
90
|
+
| `GET` | `/api/clickup/status` | Check ClickUp configuration and active task |
|
|
91
|
+
| `GET` | `/api/clickup/tasks` | Fetch tasks (query: `?statuses=in progress,review`) |
|
|
92
|
+
| `GET` | `/api/clickup/task/:taskId` | Fetch single task details |
|
|
93
|
+
| `POST` | `/api/clickup/select-task` | Set the active task |
|
|
94
|
+
| `POST` | `/api/clickup/activate-scope` | Find/create update set for one scope |
|
|
95
|
+
| `POST` | `/api/clickup/activate-all-scopes` | Find/create update sets for all scopes |
|
|
96
|
+
| `POST` | `/api/clickup/deselect-task` | Clear the active task |
|
|
97
|
+
|
|
98
|
+
## Persistence Files
|
|
99
|
+
|
|
100
|
+
| File | Purpose | Read By |
|
|
101
|
+
|------|---------|---------|
|
|
102
|
+
| `.dove-update-sets.json` | Scope-to-update-set mapping | Dashboard, `dove push`, `dove watch` |
|
|
103
|
+
| `.dove-active-task.json` | Currently selected ClickUp task | Dashboard only |
|
|
104
|
+
|
|
105
|
+
Both files are written to the project root (CWD). Add them to `.gitignore`.
|
|
106
|
+
|
|
107
|
+
## Rate Limiting
|
|
108
|
+
|
|
109
|
+
The dashboard respects ServiceNow's 20 requests-per-second limit. When bulk operations (like "activate all scopes") approach the limit, requests are queued with backpressure rather than rejected.
|
|
110
|
+
|
|
111
|
+
## ServiceNow Dependencies
|
|
112
|
+
|
|
113
|
+
The dashboard uses two ServiceNow APIs:
|
|
114
|
+
|
|
115
|
+
- **Table API** (`/api/now/table/`) — standard CRUD for update sets and scopes
|
|
116
|
+
- **Dovetail Scripted REST API** (`/api/cadso/dovetail/changeUpdateSet`) — switches the active update set on the instance after activation
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tenonhq/dovetail-dashboard",
|
|
3
|
+
"version": "0.0.13",
|
|
4
|
+
"description": "Update Set Dashboard for Dovetail",
|
|
5
|
+
"main": "server.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"start": "node server.js",
|
|
8
|
+
"version:bump": "node ./../../Scripts/bump-version.js ./package.json",
|
|
9
|
+
"postpublish": "npm run version:bump"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"express": "^4.18.2",
|
|
13
|
+
"axios": "^1.5.1",
|
|
14
|
+
"axios-cookiejar-support": "^4.0.7",
|
|
15
|
+
"dotenv": "^16.3.1",
|
|
16
|
+
"express-rate-limit": "^8.3.2",
|
|
17
|
+
"tough-cookie": "^4.1.3"
|
|
18
|
+
},
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=20"
|
|
21
|
+
},
|
|
22
|
+
"license": "ISC",
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
}
|
|
26
|
+
}
|