@molecule/app-status-dashboard-http 1.0.3 → 1.0.4
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 +7 -7
- package/dist/provider.js +3 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-
|
|
6
|
+
Generated: 2026-11-28T04:53:45.544Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-status-dashboard-http
|
|
@@ -37,7 +37,7 @@ setProvider(createProvider({ baseUrl: '/api' }))
|
|
|
37
37
|
## Installation
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
|
-
npm install @molecule/app-status-dashboard-http @molecule/app-i18n
|
|
40
|
+
npm install @molecule/app-status-dashboard-http @molecule/app-i18n
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
## API
|
|
@@ -109,8 +109,8 @@ class HttpStatusDashboardProvider implements StatusDashboardProvider {
|
|
|
109
109
|
options?: { status?: IncidentStatus; limit?: number },
|
|
110
110
|
): Promise<StatusIncident[]> {
|
|
111
111
|
const params = new URLSearchParams()
|
|
112
|
-
if (options?.status) params.
|
|
113
|
-
if (options?.limit) params.
|
|
112
|
+
if (options?.status) params.append('status', options.status)
|
|
113
|
+
if (options?.limit) params.append('limit', String(options.limit))
|
|
114
114
|
const qs = params.toString()
|
|
115
115
|
const url = `${config.apiBaseUrl ?? this.config.baseUrl ?? ''}/status/incidents${qs ? `?${qs}` : ''}`
|
|
116
116
|
const response = await fetch(url, { headers: { ...this.config.headers, ...config.headers } })
|
|
@@ -127,7 +127,7 @@ class HttpStatusDashboardProvider implements StatusDashboardProvider {
|
|
|
127
127
|
*/
|
|
128
128
|
async fetchUptime(config: StatusDashboardConfig, serviceId?: string): Promise<ServiceUptime[]> {
|
|
129
129
|
const params = new URLSearchParams()
|
|
130
|
-
if (serviceId) params.
|
|
130
|
+
if (serviceId) params.append('serviceId', serviceId)
|
|
131
131
|
const qs = params.toString()
|
|
132
132
|
const url = `${config.apiBaseUrl ?? this.config.baseUrl ?? ''}/status/uptime${qs ? `?${qs}` : ''}`
|
|
133
133
|
const response = await fetch(url, { headers: { ...this.config.headers, ...config.headers } })
|
|
@@ -228,13 +228,13 @@ export function setupStatusDashboardHttp(): void {
|
|
|
228
228
|
|
|
229
229
|
Peer dependencies:
|
|
230
230
|
|
|
231
|
-
- `@molecule/app-status-dashboard` ^1.0.1
|
|
231
|
+
- `@molecule/app-status-dashboard` ^1.0.1 _(optional)_
|
|
232
232
|
- `@molecule/app-i18n` ^1.0.1
|
|
233
233
|
|
|
234
234
|
### Runtime Dependencies
|
|
235
235
|
|
|
236
236
|
- `@molecule/app-i18n`
|
|
237
|
-
- `@molecule/app-status-dashboard`
|
|
237
|
+
- `@molecule/app-status-dashboard` _(optional)_
|
|
238
238
|
|
|
239
239
|
- **The backend must serve the three endpoints** (`/status`,
|
|
240
240
|
`/status/incidents`, `/status/uptime`) relative to `baseUrl` — responses are
|
package/dist/provider.js
CHANGED
|
@@ -44,9 +44,9 @@ export class HttpStatusDashboardProvider {
|
|
|
44
44
|
async fetchIncidents(config, options) {
|
|
45
45
|
const params = new URLSearchParams();
|
|
46
46
|
if (options?.status)
|
|
47
|
-
params.
|
|
47
|
+
params.append('status', options.status);
|
|
48
48
|
if (options?.limit)
|
|
49
|
-
params.
|
|
49
|
+
params.append('limit', String(options.limit));
|
|
50
50
|
const qs = params.toString();
|
|
51
51
|
const url = `${config.apiBaseUrl ?? this.config.baseUrl ?? ''}/status/incidents${qs ? `?${qs}` : ''}`;
|
|
52
52
|
const response = await fetch(url, { headers: { ...this.config.headers, ...config.headers } });
|
|
@@ -64,7 +64,7 @@ export class HttpStatusDashboardProvider {
|
|
|
64
64
|
async fetchUptime(config, serviceId) {
|
|
65
65
|
const params = new URLSearchParams();
|
|
66
66
|
if (serviceId)
|
|
67
|
-
params.
|
|
67
|
+
params.append('serviceId', serviceId);
|
|
68
68
|
const qs = params.toString();
|
|
69
69
|
const url = `${config.apiBaseUrl ?? this.config.baseUrl ?? ''}/status/uptime${qs ? `?${qs}` : ''}`;
|
|
70
70
|
const response = await fetch(url, { headers: { ...this.config.headers, ...config.headers } });
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-status-dashboard-http",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "HTTP status dashboard provider
|
|
3
|
+
"version": "1.0.4",
|
|
4
|
+
"description": "HTTP status dashboard provider",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"license": "Apache-2.0",
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@molecule/app-status-dashboard": "1.0.3",
|
|
32
|
-
"@molecule/app-i18n": "1.0
|
|
32
|
+
"@molecule/app-i18n": "1.4.0",
|
|
33
33
|
"@types/node": "26.6.5",
|
|
34
34
|
"typescript": "6.0.3",
|
|
35
35
|
"vitest": "4.1.12"
|