@hasna/uptime 0.1.23 → 0.1.25
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/CHANGELOG.md +24 -0
- package/Dockerfile.package +2 -2
- package/NOTICE +1 -1
- package/README.md +9 -3
- package/THIRD_PARTY_NOTICES.md +4 -1
- package/bun.lock +221 -0
- package/dist/api.js +111 -33
- package/dist/cli/index.js +169 -43
- package/dist/cloud-plan.d.ts +14 -1
- package/dist/cloud-plan.d.ts.map +1 -1
- package/dist/cloud-plan.js +27 -7
- package/dist/index.js +138 -40
- package/dist/mcp/index.js +111 -33
- package/dist/service.d.ts +19 -0
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +111 -33
- package/docs/aws-deployment-runbook.md +40 -14
- package/docs/aws-runtime-security.md +25 -10
- package/docs/cloud-source-of-truth.md +10 -7
- package/docs/deployment-metadata.example.json +4 -2
- package/infra/aws/README.md +26 -11
- package/infra/aws/main.tf +116 -34
- package/infra/aws/outputs.tf +8 -0
- package/infra/aws/terraform.tfvars.example +4 -1
- package/infra/aws/variables.tf +54 -5
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,30 @@ project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.1.25] - 2026-06-29
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Added an opt-in CloudFront HTTPS-origin path for the AWS module. Operators can
|
|
14
|
+
set `cloudfront_origin_protocol_policy = "https-only"` with a dedicated
|
|
15
|
+
origin hostname and matching ACM certificate before token-bearing live
|
|
16
|
+
traffic, while the default zero-count bridge remains unchanged.
|
|
17
|
+
- Added AWS ECS service tag propagation and managed tags so service-launched
|
|
18
|
+
tasks keep cost allocation tags.
|
|
19
|
+
- Added optional `runtime_package_integrity` verification for the CodeBuild
|
|
20
|
+
image builder and included the published `bun.lock` in package images so
|
|
21
|
+
production dependency installs can use `--frozen-lockfile`.
|
|
22
|
+
|
|
23
|
+
## [0.1.24] - 2026-06-29
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- Added a workspace-scoped `cloud public-checks run-due` CLI path and SDK
|
|
28
|
+
service methods for bounded hosted HTTP/TCP check execution with hosted target
|
|
29
|
+
policy enforcement. This is a one-off smoke/runtime primitive; the EFS SQLite
|
|
30
|
+
bridge still keeps scheduler, public-probe, reporter, and migration services
|
|
31
|
+
scaled to zero until cloud leases and worker loops are implemented.
|
|
32
|
+
|
|
9
33
|
## [0.1.23] - 2026-06-28
|
|
10
34
|
|
|
11
35
|
### Fixed
|
package/Dockerfile.package
CHANGED
|
@@ -16,10 +16,10 @@ RUN apk add --no-cache ca-certificates libgcc libstdc++ \
|
|
|
16
16
|
COPY --from=bun /usr/local/bin/bun /usr/local/bin/bun
|
|
17
17
|
COPY --from=bun /usr/local/lib/node_modules/bun /usr/local/lib/node_modules/bun
|
|
18
18
|
|
|
19
|
-
COPY package.json ./
|
|
19
|
+
COPY package.json bun.lock ./
|
|
20
20
|
COPY dist ./dist
|
|
21
21
|
|
|
22
|
-
RUN bun install --production \
|
|
22
|
+
RUN bun install --production --frozen-lockfile \
|
|
23
23
|
&& chown -R uptime:uptime /app
|
|
24
24
|
|
|
25
25
|
USER uptime
|
package/NOTICE
CHANGED
package/README.md
CHANGED
|
@@ -32,7 +32,8 @@ uptime report-schedules run-due
|
|
|
32
32
|
uptime report-schedules runs
|
|
33
33
|
uptime audit
|
|
34
34
|
uptime cloud plan --json
|
|
35
|
-
uptime cloud private-probe-config --probe-id prb_private_01 --machine-id private-probe-01 --
|
|
35
|
+
uptime cloud private-probe-config --probe-id prb_private_01 --machine-id private-probe-01 --json
|
|
36
|
+
uptime cloud private-probe-config --probe-id prb_private_01 --machine-id private-probe-01 --env --allow-blocked-env
|
|
36
37
|
uptime incidents
|
|
37
38
|
uptime serve --port 3899 --check
|
|
38
39
|
```
|
|
@@ -40,6 +41,8 @@ uptime serve --port 3899 --check
|
|
|
40
41
|
Scheduled reports persist endpoint and recipient configuration, but not send
|
|
41
42
|
keys or API tokens. Configure `MAILERY_SEND_KEY`, `HASNA_MAILERY_SEND_KEY`,
|
|
42
43
|
`HASNA_LOGS_API_TOKEN`, or the matching service env vars before scheduled runs.
|
|
44
|
+
Private probe env output is blocked by default while hosted probe routes remain
|
|
45
|
+
fail-closed; `--allow-blocked-env` is for review artifacts only, not startup.
|
|
43
46
|
|
|
44
47
|
The `uptime cloud ...` commands generate dry-run AWS/private-probe planning artifacts
|
|
45
48
|
only. They do not call AWS, write secrets, or produce an approved deploy script;
|
|
@@ -52,8 +55,11 @@ format/init/validate/plan commands with `applyAllowed: false`. The first
|
|
|
52
55
|
protected access path uses the CloudFront default HTTPS domain with ALB origin
|
|
53
56
|
ingress restricted to CloudFront. The hosted web task must set
|
|
54
57
|
`HASNA_UPTIME_ALLOWED_ORIGINS` to the public HTTPS edge origin so same-origin
|
|
55
|
-
browser mutations still pass
|
|
56
|
-
|
|
58
|
+
browser mutations still pass through the selected ALB origin path. The default
|
|
59
|
+
zero-count bridge keeps `cloudfront_origin_protocol_policy = "http-only"`;
|
|
60
|
+
token-bearing live traffic needs `https-only` with an origin hostname that
|
|
61
|
+
resolves to the ALB and matches `certificate_arn`, or an explicit risk
|
|
62
|
+
acceptance. Hosted AWS runtime state currently uses explicit EFS-backed SQLite via
|
|
57
63
|
`HASNA_UPTIME_HOSTED_SQLITE_DB=/data/uptime/uptime.db` for one protected web
|
|
58
64
|
task maximum; do not set `HASNA_UPTIME_DATABASE_URL` until the async Postgres
|
|
59
65
|
adapter is implemented.
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# Third-Party Notices
|
|
2
2
|
|
|
3
|
-
Open Uptime bundles or depends on the following third-party packages.
|
|
3
|
+
Open Uptime bundles or depends on the following third-party packages. The
|
|
4
|
+
versions listed here reflect the checked-in lockfile and release build used for
|
|
5
|
+
the published package; package managers may resolve newer compatible versions
|
|
6
|
+
when installing from semver ranges.
|
|
4
7
|
|
|
5
8
|
## @modelcontextprotocol/sdk
|
|
6
9
|
|
package/bun.lock
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
{
|
|
2
|
+
"lockfileVersion": 1,
|
|
3
|
+
"configVersion": 1,
|
|
4
|
+
"workspaces": {
|
|
5
|
+
"": {
|
|
6
|
+
"name": "@hasna/uptime",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
9
|
+
"chalk": "^5.6.2",
|
|
10
|
+
"commander": "^13.1.0",
|
|
11
|
+
"zod": "^4.3.6",
|
|
12
|
+
},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@types/bun": "^1.3.14",
|
|
15
|
+
"@types/node": "^20.14.0",
|
|
16
|
+
"typescript": "^5.9.3",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
"packages": {
|
|
21
|
+
"@hono/node-server": ["@hono/node-server@1.19.14", "", { "peerDependencies": { "hono": "^4" } }, "sha512-GwtvgtXxnWsucXvbQXkRgqksiH2Qed37H9xHZocE5sA3N8O8O8/8FA3uclQXxXVzc9XBZuEOMK7+r02FmSpHtw=="],
|
|
22
|
+
|
|
23
|
+
"@modelcontextprotocol/sdk": ["@modelcontextprotocol/sdk@1.29.0", "", { "dependencies": { "@hono/node-server": "^1.19.9", "ajv": "^8.17.1", "ajv-formats": "^3.0.1", "content-type": "^1.0.5", "cors": "^2.8.5", "cross-spawn": "^7.0.5", "eventsource": "^3.0.2", "eventsource-parser": "^3.0.0", "express": "^5.2.1", "express-rate-limit": "^8.2.1", "hono": "^4.11.4", "jose": "^6.1.3", "json-schema-typed": "^8.0.2", "pkce-challenge": "^5.0.0", "raw-body": "^3.0.0", "zod": "^3.25 || ^4.0", "zod-to-json-schema": "^3.25.1" }, "peerDependencies": { "@cfworker/json-schema": "^4.1.1" }, "optionalPeers": ["@cfworker/json-schema"] }, "sha512-zo37mZA9hJWpULgkRpowewez1y6ML5GsXJPY8FI0tBBCd77HEvza4jDqRKOXgHNn867PVGCyTdzqpz0izu5ZjQ=="],
|
|
24
|
+
|
|
25
|
+
"@types/bun": ["@types/bun@1.3.14", "", { "dependencies": { "bun-types": "1.3.14" } }, "sha512-h1hFqFVcvAvD9j9K7ZW7vd82aSA+rTdznZa+5bwvCwqSB1jmmfLcbIWhOLx1/+boy/xmjgCs/OMUL8hRJSmnPw=="],
|
|
26
|
+
|
|
27
|
+
"@types/node": ["@types/node@20.19.43", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA=="],
|
|
28
|
+
|
|
29
|
+
"accepts": ["accepts@2.0.0", "", { "dependencies": { "mime-types": "^3.0.0", "negotiator": "^1.0.0" } }, "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng=="],
|
|
30
|
+
|
|
31
|
+
"ajv": ["ajv@8.20.0", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2" } }, "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA=="],
|
|
32
|
+
|
|
33
|
+
"ajv-formats": ["ajv-formats@3.0.1", "", { "dependencies": { "ajv": "^8.0.0" } }, "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ=="],
|
|
34
|
+
|
|
35
|
+
"body-parser": ["body-parser@2.3.0", "", { "dependencies": { "bytes": "^3.1.2", "content-type": "^2.0.0", "debug": "^4.4.3", "http-errors": "^2.0.1", "iconv-lite": "^0.7.2", "on-finished": "^2.4.1", "qs": "^6.15.2", "raw-body": "^3.0.2", "type-is": "^2.1.0" } }, "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw=="],
|
|
36
|
+
|
|
37
|
+
"bun-types": ["bun-types@1.3.14", "", { "dependencies": { "@types/node": "*" } }, "sha512-4N0ig0fEomHt5R0KCFWjovxow98rIoRwKolrYdCcknNwMekCXRnWEUvgu5soYV8QXtVsrUD8B95MBOZGPvr6KQ=="],
|
|
38
|
+
|
|
39
|
+
"bytes": ["bytes@3.1.2", "", {}, "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg=="],
|
|
40
|
+
|
|
41
|
+
"call-bind-apply-helpers": ["call-bind-apply-helpers@1.0.2", "", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" } }, "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ=="],
|
|
42
|
+
|
|
43
|
+
"call-bound": ["call-bound@1.0.4", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "get-intrinsic": "^1.3.0" } }, "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg=="],
|
|
44
|
+
|
|
45
|
+
"chalk": ["chalk@5.6.2", "", {}, "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA=="],
|
|
46
|
+
|
|
47
|
+
"commander": ["commander@13.1.0", "", {}, "sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw=="],
|
|
48
|
+
|
|
49
|
+
"content-disposition": ["content-disposition@1.1.0", "", {}, "sha512-5jRCH9Z/+DRP7rkvY83B+yGIGX96OYdJmzngqnw2SBSxqCFPd0w2km3s5iawpGX8krnwSGmF0FW5Nhr0Hfai3g=="],
|
|
50
|
+
|
|
51
|
+
"content-type": ["content-type@1.0.5", "", {}, "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA=="],
|
|
52
|
+
|
|
53
|
+
"cookie": ["cookie@0.7.2", "", {}, "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w=="],
|
|
54
|
+
|
|
55
|
+
"cookie-signature": ["cookie-signature@1.2.2", "", {}, "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg=="],
|
|
56
|
+
|
|
57
|
+
"cors": ["cors@2.8.6", "", { "dependencies": { "object-assign": "^4", "vary": "^1" } }, "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw=="],
|
|
58
|
+
|
|
59
|
+
"cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="],
|
|
60
|
+
|
|
61
|
+
"debug": ["debug@4.4.3", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="],
|
|
62
|
+
|
|
63
|
+
"depd": ["depd@2.0.0", "", {}, "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw=="],
|
|
64
|
+
|
|
65
|
+
"dunder-proto": ["dunder-proto@1.0.1", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", "gopd": "^1.2.0" } }, "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A=="],
|
|
66
|
+
|
|
67
|
+
"ee-first": ["ee-first@1.1.1", "", {}, "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="],
|
|
68
|
+
|
|
69
|
+
"encodeurl": ["encodeurl@2.0.0", "", {}, "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg=="],
|
|
70
|
+
|
|
71
|
+
"es-define-property": ["es-define-property@1.0.1", "", {}, "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g=="],
|
|
72
|
+
|
|
73
|
+
"es-errors": ["es-errors@1.3.0", "", {}, "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="],
|
|
74
|
+
|
|
75
|
+
"es-object-atoms": ["es-object-atoms@1.1.2", "", { "dependencies": { "es-errors": "^1.3.0" } }, "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw=="],
|
|
76
|
+
|
|
77
|
+
"escape-html": ["escape-html@1.0.3", "", {}, "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="],
|
|
78
|
+
|
|
79
|
+
"etag": ["etag@1.8.1", "", {}, "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg=="],
|
|
80
|
+
|
|
81
|
+
"eventsource": ["eventsource@3.0.7", "", { "dependencies": { "eventsource-parser": "^3.0.1" } }, "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA=="],
|
|
82
|
+
|
|
83
|
+
"eventsource-parser": ["eventsource-parser@3.1.0", "", {}, "sha512-kJezFj9YFAMLeORyi7aCLxLbD5/qWMQnoMVlVPyHIll7lgRJCc3JVln9Vgl9nwQi0YkMnhdGTMNn7CkRRAptMg=="],
|
|
84
|
+
|
|
85
|
+
"express": ["express@5.2.1", "", { "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.1", "content-disposition": "^1.0.0", "content-type": "^1.0.5", "cookie": "^0.7.1", "cookie-signature": "^1.2.1", "debug": "^4.4.0", "depd": "^2.0.0", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "finalhandler": "^2.1.0", "fresh": "^2.0.0", "http-errors": "^2.0.0", "merge-descriptors": "^2.0.0", "mime-types": "^3.0.0", "on-finished": "^2.4.1", "once": "^1.4.0", "parseurl": "^1.3.3", "proxy-addr": "^2.0.7", "qs": "^6.14.0", "range-parser": "^1.2.1", "router": "^2.2.0", "send": "^1.1.0", "serve-static": "^2.2.0", "statuses": "^2.0.1", "type-is": "^2.0.1", "vary": "^1.1.2" } }, "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw=="],
|
|
86
|
+
|
|
87
|
+
"express-rate-limit": ["express-rate-limit@8.5.2", "", { "dependencies": { "ip-address": "^10.2.0" }, "peerDependencies": { "express": ">= 4.11" } }, "sha512-5Kb34ipNX694DH48vN9irak1Qx30nb0PLYHXfJgw4YEjiC3ZEmZJhwOp+VfiCYwFzvFTdB9QkArYS5kXa2cx2A=="],
|
|
88
|
+
|
|
89
|
+
"fast-deep-equal": ["fast-deep-equal@3.1.3", "", {}, "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="],
|
|
90
|
+
|
|
91
|
+
"fast-uri": ["fast-uri@3.1.2", "", {}, "sha512-rVjf7ArG3LTk+FS6Yw81V1DLuZl1bRbNrev6Tmd/9RaroeeRRJhAt7jg/6YFxbvAQXUCavSoZhPPj6oOx+5KjQ=="],
|
|
92
|
+
|
|
93
|
+
"finalhandler": ["finalhandler@2.1.1", "", { "dependencies": { "debug": "^4.4.0", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "on-finished": "^2.4.1", "parseurl": "^1.3.3", "statuses": "^2.0.1" } }, "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA=="],
|
|
94
|
+
|
|
95
|
+
"forwarded": ["forwarded@0.2.0", "", {}, "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow=="],
|
|
96
|
+
|
|
97
|
+
"fresh": ["fresh@2.0.0", "", {}, "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A=="],
|
|
98
|
+
|
|
99
|
+
"function-bind": ["function-bind@1.1.2", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="],
|
|
100
|
+
|
|
101
|
+
"get-intrinsic": ["get-intrinsic@1.3.0", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="],
|
|
102
|
+
|
|
103
|
+
"get-proto": ["get-proto@1.0.1", "", { "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" } }, "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g=="],
|
|
104
|
+
|
|
105
|
+
"gopd": ["gopd@1.2.0", "", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="],
|
|
106
|
+
|
|
107
|
+
"has-symbols": ["has-symbols@1.1.0", "", {}, "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="],
|
|
108
|
+
|
|
109
|
+
"hasown": ["hasown@2.0.4", "", { "dependencies": { "function-bind": "^1.1.2" } }, "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A=="],
|
|
110
|
+
|
|
111
|
+
"hono": ["hono@4.12.26", "", {}, "sha512-uyZtpnYxM9CmQ7QsQknM4zN8EftNqhON1qYeIKM0Se67CCEe2c44xyGURwB0axX2fBDu1dqHrHAc1hmNT8ITkw=="],
|
|
112
|
+
|
|
113
|
+
"http-errors": ["http-errors@2.0.1", "", { "dependencies": { "depd": "~2.0.0", "inherits": "~2.0.4", "setprototypeof": "~1.2.0", "statuses": "~2.0.2", "toidentifier": "~1.0.1" } }, "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ=="],
|
|
114
|
+
|
|
115
|
+
"iconv-lite": ["iconv-lite@0.7.2", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw=="],
|
|
116
|
+
|
|
117
|
+
"inherits": ["inherits@2.0.4", "", {}, "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="],
|
|
118
|
+
|
|
119
|
+
"ip-address": ["ip-address@10.2.0", "", {}, "sha512-/+S6j4E9AHvW9SWMSEY9Xfy66O5PWvVEJ08O0y5JGyEKQpojb0K0GKpz/v5HJ/G0vi3D2sjGK78119oXZeE0qA=="],
|
|
120
|
+
|
|
121
|
+
"ipaddr.js": ["ipaddr.js@1.9.1", "", {}, "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="],
|
|
122
|
+
|
|
123
|
+
"is-promise": ["is-promise@4.0.0", "", {}, "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ=="],
|
|
124
|
+
|
|
125
|
+
"isexe": ["isexe@2.0.0", "", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="],
|
|
126
|
+
|
|
127
|
+
"jose": ["jose@6.2.3", "", {}, "sha512-YYVDInQKFJfR/xa3ojUTl8c2KoTwiL1R5Wg9YCydwH0x0B9grbzlg5HC7mMjCtUJjbQ/YnGEZIhI5tCgfTb4Hw=="],
|
|
128
|
+
|
|
129
|
+
"json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="],
|
|
130
|
+
|
|
131
|
+
"json-schema-typed": ["json-schema-typed@8.0.2", "", {}, "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA=="],
|
|
132
|
+
|
|
133
|
+
"math-intrinsics": ["math-intrinsics@1.1.0", "", {}, "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="],
|
|
134
|
+
|
|
135
|
+
"media-typer": ["media-typer@1.1.0", "", {}, "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw=="],
|
|
136
|
+
|
|
137
|
+
"merge-descriptors": ["merge-descriptors@2.0.0", "", {}, "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g=="],
|
|
138
|
+
|
|
139
|
+
"mime-db": ["mime-db@1.54.0", "", {}, "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ=="],
|
|
140
|
+
|
|
141
|
+
"mime-types": ["mime-types@3.0.2", "", { "dependencies": { "mime-db": "^1.54.0" } }, "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A=="],
|
|
142
|
+
|
|
143
|
+
"ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="],
|
|
144
|
+
|
|
145
|
+
"negotiator": ["negotiator@1.0.0", "", {}, "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg=="],
|
|
146
|
+
|
|
147
|
+
"object-assign": ["object-assign@4.1.1", "", {}, "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="],
|
|
148
|
+
|
|
149
|
+
"object-inspect": ["object-inspect@1.13.4", "", {}, "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew=="],
|
|
150
|
+
|
|
151
|
+
"on-finished": ["on-finished@2.4.1", "", { "dependencies": { "ee-first": "1.1.1" } }, "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg=="],
|
|
152
|
+
|
|
153
|
+
"once": ["once@1.4.0", "", { "dependencies": { "wrappy": "1" } }, "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w=="],
|
|
154
|
+
|
|
155
|
+
"parseurl": ["parseurl@1.3.3", "", {}, "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="],
|
|
156
|
+
|
|
157
|
+
"path-key": ["path-key@3.1.1", "", {}, "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="],
|
|
158
|
+
|
|
159
|
+
"path-to-regexp": ["path-to-regexp@8.4.2", "", {}, "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA=="],
|
|
160
|
+
|
|
161
|
+
"pkce-challenge": ["pkce-challenge@5.0.1", "", {}, "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ=="],
|
|
162
|
+
|
|
163
|
+
"proxy-addr": ["proxy-addr@2.0.7", "", { "dependencies": { "forwarded": "0.2.0", "ipaddr.js": "1.9.1" } }, "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg=="],
|
|
164
|
+
|
|
165
|
+
"qs": ["qs@6.15.2", "", { "dependencies": { "side-channel": "^1.1.0" } }, "sha512-Rzq0KEyX/w/tEybncDgdkZrJgVUsUMk3xjh3t5bv3S1HTAtg+uOYt72+ZfwiQwKdysThkTBdL/rTi6HDmX9Ddw=="],
|
|
166
|
+
|
|
167
|
+
"range-parser": ["range-parser@1.2.1", "", {}, "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="],
|
|
168
|
+
|
|
169
|
+
"raw-body": ["raw-body@3.0.2", "", { "dependencies": { "bytes": "~3.1.2", "http-errors": "~2.0.1", "iconv-lite": "~0.7.0", "unpipe": "~1.0.0" } }, "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA=="],
|
|
170
|
+
|
|
171
|
+
"require-from-string": ["require-from-string@2.0.2", "", {}, "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw=="],
|
|
172
|
+
|
|
173
|
+
"router": ["router@2.2.0", "", { "dependencies": { "debug": "^4.4.0", "depd": "^2.0.0", "is-promise": "^4.0.0", "parseurl": "^1.3.3", "path-to-regexp": "^8.0.0" } }, "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ=="],
|
|
174
|
+
|
|
175
|
+
"safer-buffer": ["safer-buffer@2.1.2", "", {}, "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="],
|
|
176
|
+
|
|
177
|
+
"send": ["send@1.2.1", "", { "dependencies": { "debug": "^4.4.3", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "fresh": "^2.0.0", "http-errors": "^2.0.1", "mime-types": "^3.0.2", "ms": "^2.1.3", "on-finished": "^2.4.1", "range-parser": "^1.2.1", "statuses": "^2.0.2" } }, "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ=="],
|
|
178
|
+
|
|
179
|
+
"serve-static": ["serve-static@2.2.1", "", { "dependencies": { "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "parseurl": "^1.3.3", "send": "^1.2.0" } }, "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw=="],
|
|
180
|
+
|
|
181
|
+
"setprototypeof": ["setprototypeof@1.2.0", "", {}, "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="],
|
|
182
|
+
|
|
183
|
+
"shebang-command": ["shebang-command@2.0.0", "", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="],
|
|
184
|
+
|
|
185
|
+
"shebang-regex": ["shebang-regex@3.0.0", "", {}, "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="],
|
|
186
|
+
|
|
187
|
+
"side-channel": ["side-channel@1.1.1", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.4", "side-channel-list": "^1.0.1", "side-channel-map": "^1.0.1", "side-channel-weakmap": "^1.0.2" } }, "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ=="],
|
|
188
|
+
|
|
189
|
+
"side-channel-list": ["side-channel-list@1.0.1", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.4" } }, "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w=="],
|
|
190
|
+
|
|
191
|
+
"side-channel-map": ["side-channel-map@1.0.1", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3" } }, "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA=="],
|
|
192
|
+
|
|
193
|
+
"side-channel-weakmap": ["side-channel-weakmap@1.0.2", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3", "side-channel-map": "^1.0.1" } }, "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A=="],
|
|
194
|
+
|
|
195
|
+
"statuses": ["statuses@2.0.2", "", {}, "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw=="],
|
|
196
|
+
|
|
197
|
+
"toidentifier": ["toidentifier@1.0.1", "", {}, "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="],
|
|
198
|
+
|
|
199
|
+
"type-is": ["type-is@2.1.0", "", { "dependencies": { "content-type": "^2.0.0", "media-typer": "^1.1.0", "mime-types": "^3.0.0" } }, "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA=="],
|
|
200
|
+
|
|
201
|
+
"typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],
|
|
202
|
+
|
|
203
|
+
"undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="],
|
|
204
|
+
|
|
205
|
+
"unpipe": ["unpipe@1.0.0", "", {}, "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ=="],
|
|
206
|
+
|
|
207
|
+
"vary": ["vary@1.1.2", "", {}, "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg=="],
|
|
208
|
+
|
|
209
|
+
"which": ["which@2.0.2", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "./bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="],
|
|
210
|
+
|
|
211
|
+
"wrappy": ["wrappy@1.0.2", "", {}, "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="],
|
|
212
|
+
|
|
213
|
+
"zod": ["zod@4.4.3", "", {}, "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ=="],
|
|
214
|
+
|
|
215
|
+
"zod-to-json-schema": ["zod-to-json-schema@3.25.2", "", { "peerDependencies": { "zod": "^3.25.28 || ^4" } }, "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA=="],
|
|
216
|
+
|
|
217
|
+
"body-parser/content-type": ["content-type@2.0.0", "", {}, "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ=="],
|
|
218
|
+
|
|
219
|
+
"type-is/content-type": ["content-type@2.0.0", "", {}, "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ=="],
|
|
220
|
+
}
|
|
221
|
+
}
|
package/dist/api.js
CHANGED
|
@@ -3150,12 +3150,18 @@ var MAX_PROBE_RESULT_FUTURE_MS = 5 * 60000;
|
|
|
3150
3150
|
class UptimeService {
|
|
3151
3151
|
store;
|
|
3152
3152
|
checkRunner;
|
|
3153
|
+
hostedResolveHost;
|
|
3154
|
+
hostedHttpRequest;
|
|
3155
|
+
hostedMaxRedirects;
|
|
3153
3156
|
leaseOwner = `svc_${randomUUID3().replace(/-/g, "").slice(0, 18)}`;
|
|
3154
3157
|
inFlightChecks = new Set;
|
|
3155
3158
|
inFlightReportSchedules = new Set;
|
|
3156
3159
|
constructor(options = {}) {
|
|
3157
3160
|
this.store = options.store ?? new UptimeStore({ mode: "local", ...options });
|
|
3158
3161
|
this.checkRunner = options.checkRunner ?? runMonitorCheck;
|
|
3162
|
+
this.hostedResolveHost = options.hostedResolveHost;
|
|
3163
|
+
this.hostedHttpRequest = options.hostedHttpRequest;
|
|
3164
|
+
this.hostedMaxRedirects = options.hostedMaxRedirects;
|
|
3159
3165
|
}
|
|
3160
3166
|
close() {
|
|
3161
3167
|
this.store.close();
|
|
@@ -3362,39 +3368,7 @@ class UptimeService {
|
|
|
3362
3368
|
const monitor = this.store.getMonitor(idOrName);
|
|
3363
3369
|
if (!monitor)
|
|
3364
3370
|
throw new Error(`Monitor not found: ${idOrName}`);
|
|
3365
|
-
|
|
3366
|
-
throw new Error(`Monitor is disabled: ${monitor.name}`);
|
|
3367
|
-
if (this.inFlightChecks.has(monitor.id))
|
|
3368
|
-
throw new Error(`Monitor check already in progress: ${monitor.name}`);
|
|
3369
|
-
const leaseTtlMs = Math.max(60000, (monitor.retryCount + 1) * monitor.timeoutMs + 1e4);
|
|
3370
|
-
if (!this.store.acquireCheckLease(monitor.id, this.leaseOwner, leaseTtlMs)) {
|
|
3371
|
-
throw new MonitorCheckBusyError(`Monitor check already in progress: ${monitor.name}`);
|
|
3372
|
-
}
|
|
3373
|
-
this.inFlightChecks.add(monitor.id);
|
|
3374
|
-
try {
|
|
3375
|
-
let attemptCount = 0;
|
|
3376
|
-
let last = null;
|
|
3377
|
-
const maxAttempts = Math.max(1, monitor.retryCount + 1);
|
|
3378
|
-
while (attemptCount < maxAttempts) {
|
|
3379
|
-
attemptCount += 1;
|
|
3380
|
-
last = await this.checkRunner(monitor);
|
|
3381
|
-
if (last.status === "up")
|
|
3382
|
-
break;
|
|
3383
|
-
}
|
|
3384
|
-
return this.store.recordCheckResult({
|
|
3385
|
-
monitorId: monitor.id,
|
|
3386
|
-
status: last.status,
|
|
3387
|
-
latencyMs: last.latencyMs,
|
|
3388
|
-
statusCode: last.statusCode ?? null,
|
|
3389
|
-
error: last.error ?? null,
|
|
3390
|
-
evidence: last.evidence ?? null,
|
|
3391
|
-
attemptCount,
|
|
3392
|
-
expectedMonitorRevision: monitor.revision
|
|
3393
|
-
});
|
|
3394
|
-
} finally {
|
|
3395
|
-
this.inFlightChecks.delete(monitor.id);
|
|
3396
|
-
this.store.releaseCheckLease(monitor.id, this.leaseOwner);
|
|
3397
|
-
}
|
|
3371
|
+
return this.recordMonitorCheck(monitor, { hostedTargetPolicy: false });
|
|
3398
3372
|
}
|
|
3399
3373
|
async checkAll() {
|
|
3400
3374
|
if (this.store.mode === "hosted")
|
|
@@ -3406,6 +3380,49 @@ class UptimeService {
|
|
|
3406
3380
|
}
|
|
3407
3381
|
return results;
|
|
3408
3382
|
}
|
|
3383
|
+
async checkHostedPublicMonitor(idOrName, options = {}) {
|
|
3384
|
+
this.assertHostedPublicChecksEnabled();
|
|
3385
|
+
const workspaceId = this.requireHostedWorkerWorkspaceId(options.workspaceId);
|
|
3386
|
+
const monitor = this.store.getMonitor(idOrName, { workspaceId });
|
|
3387
|
+
if (!monitor)
|
|
3388
|
+
throw new Error(`Monitor not found: ${idOrName}`);
|
|
3389
|
+
this.assertHostedPublicMonitor(monitor);
|
|
3390
|
+
const result = await this.recordMonitorCheck(monitor, { hostedTargetPolicy: true });
|
|
3391
|
+
this.auditStore().recordAuditEvent({
|
|
3392
|
+
workspaceId,
|
|
3393
|
+
action: "hosted_public_check.run",
|
|
3394
|
+
resourceType: "monitor",
|
|
3395
|
+
resourceId: monitor.id,
|
|
3396
|
+
message: `Ran hosted public check for ${monitor.name}`,
|
|
3397
|
+
metadata: {
|
|
3398
|
+
checkResultId: result.id,
|
|
3399
|
+
status: result.status,
|
|
3400
|
+
monitorKind: monitor.kind,
|
|
3401
|
+
operatorPath: "hosted_public_check"
|
|
3402
|
+
},
|
|
3403
|
+
actor: "hosted-public-check-worker"
|
|
3404
|
+
});
|
|
3405
|
+
return result;
|
|
3406
|
+
}
|
|
3407
|
+
async runDueHostedPublicChecks(now = new Date, options = {}) {
|
|
3408
|
+
this.assertHostedPublicChecksEnabled();
|
|
3409
|
+
const workspaceId = this.requireHostedWorkerWorkspaceId(options.workspaceId);
|
|
3410
|
+
const due = this.store.listMonitors({ workspaceId }).filter((monitor) => this.isHostedPublicMonitor(monitor) && this.isDue(monitor, now));
|
|
3411
|
+
const results = [];
|
|
3412
|
+
for (const monitor of due) {
|
|
3413
|
+
const current = this.store.getMonitor(monitor.id, { workspaceId });
|
|
3414
|
+
if (!current || !this.isHostedPublicMonitor(current) || !this.isDue(current, now))
|
|
3415
|
+
continue;
|
|
3416
|
+
try {
|
|
3417
|
+
results.push(await this.checkHostedPublicMonitor(current.id, { workspaceId }));
|
|
3418
|
+
} catch (error) {
|
|
3419
|
+
if (error instanceof MonitorCheckBusyError || error instanceof StaleCheckResultError)
|
|
3420
|
+
continue;
|
|
3421
|
+
throw error;
|
|
3422
|
+
}
|
|
3423
|
+
}
|
|
3424
|
+
return results;
|
|
3425
|
+
}
|
|
3409
3426
|
startScheduler(options = {}) {
|
|
3410
3427
|
if (this.store.mode === "hosted")
|
|
3411
3428
|
throw new Error("hosted scheduler requires check_jobs and probes");
|
|
@@ -3451,6 +3468,67 @@ class UptimeService {
|
|
|
3451
3468
|
const last = new Date(monitor.lastCheckedAt).getTime();
|
|
3452
3469
|
return now.getTime() - last >= monitor.intervalSeconds * 1000;
|
|
3453
3470
|
}
|
|
3471
|
+
async recordMonitorCheck(monitor, options) {
|
|
3472
|
+
if (!monitor.enabled)
|
|
3473
|
+
throw new Error(`Monitor is disabled: ${monitor.name}`);
|
|
3474
|
+
if (this.inFlightChecks.has(monitor.id))
|
|
3475
|
+
throw new Error(`Monitor check already in progress: ${monitor.name}`);
|
|
3476
|
+
const leaseTtlMs = Math.max(60000, (monitor.retryCount + 1) * monitor.timeoutMs + 1e4);
|
|
3477
|
+
if (!this.store.acquireCheckLease(monitor.id, this.leaseOwner, leaseTtlMs)) {
|
|
3478
|
+
throw new MonitorCheckBusyError(`Monitor check already in progress: ${monitor.name}`);
|
|
3479
|
+
}
|
|
3480
|
+
this.inFlightChecks.add(monitor.id);
|
|
3481
|
+
try {
|
|
3482
|
+
let attemptCount = 0;
|
|
3483
|
+
let last = null;
|
|
3484
|
+
const maxAttempts = Math.max(1, monitor.retryCount + 1);
|
|
3485
|
+
while (attemptCount < maxAttempts) {
|
|
3486
|
+
attemptCount += 1;
|
|
3487
|
+
last = options.hostedTargetPolicy ? await this.runHostedPublicCheckAttempt(monitor) : await this.checkRunner(monitor);
|
|
3488
|
+
if (last.status === "up")
|
|
3489
|
+
break;
|
|
3490
|
+
}
|
|
3491
|
+
return this.store.recordCheckResult({
|
|
3492
|
+
monitorId: monitor.id,
|
|
3493
|
+
status: last.status,
|
|
3494
|
+
latencyMs: last.latencyMs,
|
|
3495
|
+
statusCode: last.statusCode ?? null,
|
|
3496
|
+
error: last.error ?? null,
|
|
3497
|
+
evidence: last.evidence ?? null,
|
|
3498
|
+
attemptCount,
|
|
3499
|
+
expectedMonitorRevision: monitor.revision
|
|
3500
|
+
});
|
|
3501
|
+
} finally {
|
|
3502
|
+
this.inFlightChecks.delete(monitor.id);
|
|
3503
|
+
this.store.releaseCheckLease(monitor.id, this.leaseOwner);
|
|
3504
|
+
}
|
|
3505
|
+
}
|
|
3506
|
+
runHostedPublicCheckAttempt(monitor) {
|
|
3507
|
+
return runMonitorCheck(monitor, {
|
|
3508
|
+
hostedTargetPolicy: true,
|
|
3509
|
+
resolveHost: this.hostedResolveHost,
|
|
3510
|
+
hostedHttpRequest: this.hostedHttpRequest,
|
|
3511
|
+
maxRedirects: this.hostedMaxRedirects
|
|
3512
|
+
});
|
|
3513
|
+
}
|
|
3514
|
+
assertHostedPublicChecksEnabled() {
|
|
3515
|
+
if (this.store.mode !== "hosted")
|
|
3516
|
+
throw new Error("hosted public checks require hosted mode");
|
|
3517
|
+
}
|
|
3518
|
+
requireHostedWorkerWorkspaceId(workspaceId) {
|
|
3519
|
+
const value = workspaceId?.trim() || process.env.HASNA_UPTIME_WORKSPACE_ID?.trim();
|
|
3520
|
+
if (!value)
|
|
3521
|
+
throw new Error("hosted public checks require a workspace id");
|
|
3522
|
+
return value;
|
|
3523
|
+
}
|
|
3524
|
+
assertHostedPublicMonitor(monitor) {
|
|
3525
|
+
if (!this.isHostedPublicMonitor(monitor)) {
|
|
3526
|
+
throw new Error("hosted public checks support only HTTP and TCP monitors");
|
|
3527
|
+
}
|
|
3528
|
+
}
|
|
3529
|
+
isHostedPublicMonitor(monitor) {
|
|
3530
|
+
return monitor.kind === "http" || monitor.kind === "tcp";
|
|
3531
|
+
}
|
|
3454
3532
|
probeStore() {
|
|
3455
3533
|
if (this.store.mode === "hosted") {
|
|
3456
3534
|
throw new Error("hosted probe APIs require cloud check_jobs, workspace stores, and audit logging");
|