@hasna/uptime 0.1.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/CHANGELOG.md ADDED
@@ -0,0 +1,21 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@hasna/uptime` are documented here. The format is
4
+ based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this
5
+ project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ### Added
10
+
11
+ - Initial local-first uptime and downtime monitoring service.
12
+ - HTTP/HTTPS and TCP monitors with interval, timeout, retry, pause, and resume
13
+ settings.
14
+ - SQLite persistence under `~/.hasna/uptime/`, with `HASNA_UPTIME_HOME` and
15
+ `HASNA_UPTIME_DB` overrides.
16
+ - Incident open/close lifecycle, recent result history, check-count uptime
17
+ summaries, and latency summaries.
18
+ - CLI, SDK, MCP server, local API, and dashboard surfaces.
19
+ - Local API same-origin mutation guard and JSON content-type enforcement.
20
+ - Apache-2.0 OSS baseline files: license, notice, security policy,
21
+ contribution guide, and code of conduct.
@@ -0,0 +1,36 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to a positive environment:
15
+
16
+ - Using welcoming and inclusive language
17
+ - Being respectful of differing viewpoints and experiences
18
+ - Gracefully accepting constructive criticism
19
+ - Focusing on what is best for the community
20
+
21
+ Examples of unacceptable behavior:
22
+
23
+ - Trolling, insulting/derogatory comments, and personal or political attacks
24
+ - Public or private harassment
25
+ - Publishing others' private information without explicit permission
26
+
27
+ ## Enforcement
28
+
29
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
30
+ reported to the project maintainers. All complaints will be reviewed and
31
+ investigated promptly and fairly.
32
+
33
+ ## Attribution
34
+
35
+ This Code of Conduct is adapted from the
36
+ [Contributor Covenant](https://www.contributor-covenant.org/), version 2.1.
@@ -0,0 +1,24 @@
1
+ # Contributing
2
+
3
+ Open Uptime is a Bun and TypeScript project.
4
+
5
+ ## Local Setup
6
+
7
+ ```bash
8
+ bun install
9
+ bun run build
10
+ bun run typecheck
11
+ bun test
12
+ ```
13
+
14
+ Use `HASNA_UPTIME_HOME` or `HASNA_UPTIME_DB` when testing against disposable
15
+ state.
16
+
17
+ ## Pull Requests
18
+
19
+ - Keep changes scoped and covered by tests.
20
+ - Do not commit secrets, local databases, `.hasna`, `.codewith`, `.takumi`, or
21
+ logs.
22
+ - Preserve the public CLI, MCP, and SDK surfaces unless the change is explicitly
23
+ a breaking release.
24
+ - Run `bun run build`, `bun run typecheck`, and `bun test` before submitting.
package/LICENSE ADDED
@@ -0,0 +1,191 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to the Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by the Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding any notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ Copyright 2026 Hasna, Inc.
180
+
181
+ Licensed under the Apache License, Version 2.0 (the "License");
182
+ you may not use this file except in compliance with the License.
183
+ You may obtain a copy of the License at
184
+
185
+ http://www.apache.org/licenses/LICENSE-2.0
186
+
187
+ Unless required by applicable law or agreed to in writing, software
188
+ distributed under the License is distributed on an "AS IS" BASIS,
189
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
+ See the License for the specific language governing permissions and
191
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,8 @@
1
+ Open Uptime
2
+ Copyright 2026 Hasna
3
+
4
+ This product includes software developed by Hasna and distributed under the
5
+ Apache License, Version 2.0.
6
+
7
+ Third-party notices for bundled or runtime dependencies are provided in
8
+ THIRD_PARTY_NOTICES.md.
package/README.md ADDED
@@ -0,0 +1,123 @@
1
+ # Open Uptime
2
+
3
+ Local-first uptime and downtime monitoring for internal systems. It is closer to
4
+ Pingdom than Sentry: define HTTP or TCP monitors, run checks, track incidents,
5
+ summarize uptime, and expose the same data through a CLI, SDK, MCP server, and
6
+ local dashboard.
7
+
8
+ ## Install
9
+
10
+ ```bash
11
+ bun install -g @hasna/uptime
12
+ ```
13
+
14
+ Local data is stored in `~/.hasna/uptime/uptime.db`. Set
15
+ `HASNA_UPTIME_HOME` or `HASNA_UPTIME_DB` to isolate data for tests or another
16
+ profile.
17
+
18
+ ## CLI
19
+
20
+ ```bash
21
+ uptime init
22
+ uptime add api --url https://example.com/health --interval 60 --timeout 5000
23
+ uptime add postgres --tcp db.internal --port 5432
24
+ uptime list
25
+ uptime check --all
26
+ uptime summary
27
+ uptime incidents
28
+ uptime serve --port 3899 --check
29
+ ```
30
+
31
+ The local dashboard and API bind to `127.0.0.1` by default:
32
+
33
+ ```bash
34
+ open http://127.0.0.1:3899
35
+ ```
36
+
37
+ State-changing API requests reject cross-origin browser requests. Endpoints that
38
+ accept request bodies require `content-type: application/json`.
39
+
40
+ ## Uptime Semantics
41
+
42
+ The first release reports `uptimePercent` as the percentage of stored check
43
+ results that are up for a monitor across the local SQLite history. It is a
44
+ check-count availability metric, not elapsed-time SLA accounting. Incident rows
45
+ capture downtime windows separately and are the basis for future time-window
46
+ availability reports.
47
+
48
+ Monitor settings are bounded to keep local checks predictable:
49
+
50
+ - interval: 1 to 86,400 seconds
51
+ - timeout: 1 to 60,000 milliseconds
52
+ - retries: 0 to 10 per check
53
+
54
+ ## MCP
55
+
56
+ ```bash
57
+ uptime-mcp
58
+ ```
59
+
60
+ Example Claude Code registration:
61
+
62
+ ```bash
63
+ claude mcp add --scope user uptime -- uptime-mcp
64
+ ```
65
+
66
+ The MCP server exposes monitor CRUD, check execution, summary, incident, and
67
+ result tools.
68
+
69
+ ## SDK
70
+
71
+ ```ts
72
+ import { createUptimeClient } from "@hasna/uptime";
73
+
74
+ const uptime = createUptimeClient();
75
+ await uptime.createMonitor({
76
+ name: "api",
77
+ kind: "http",
78
+ url: "https://example.com/health",
79
+ intervalSeconds: 60,
80
+ });
81
+
82
+ await uptime.checkAll();
83
+ console.log(await uptime.summary());
84
+ ```
85
+
86
+ ## API
87
+
88
+ Run `uptime serve` and use:
89
+
90
+ - `GET /health`
91
+ - `GET /api/summary`
92
+ - `GET /api/monitors`
93
+ - `POST /api/monitors`
94
+ - `GET /api/monitors/:id`
95
+ - `PATCH /api/monitors/:id`
96
+ - `POST /api/monitors/:id/check`
97
+ - `GET /api/incidents`
98
+ - `GET /api/results?monitorId=<id>&limit=100`
99
+
100
+ ## Scope
101
+
102
+ First release:
103
+
104
+ - HTTP/HTTPS checks with expected status handling
105
+ - TCP checks
106
+ - interval, timeout, retry, and enable/disable settings
107
+ - SQLite persistence
108
+ - incident open/close lifecycle
109
+ - uptime percentage and latency summaries
110
+ - local dashboard/API
111
+ - CLI, MCP, SDK, and tests
112
+
113
+ Non-goals for this first release:
114
+
115
+ - Sentry-style exception tracing
116
+ - hosted multi-tenant SaaS billing
117
+ - synthetic browser journeys
118
+ - public incident pages
119
+ - external notification providers beyond extension points
120
+
121
+ ## License
122
+
123
+ Apache-2.0. See [LICENSE](LICENSE).
package/SECURITY.md ADDED
@@ -0,0 +1,13 @@
1
+ # Security Policy
2
+
3
+ Report security issues privately to the maintainers before opening a public
4
+ issue. Do not include secrets, private endpoints, or internal network details in
5
+ public reports.
6
+
7
+ ## Defaults
8
+
9
+ - The API/dashboard binds to `127.0.0.1` by default.
10
+ - Local state is stored under `~/.hasna/uptime/`.
11
+ - Monitor URLs and hostnames can reveal internal infrastructure. Treat exported
12
+ data and logs as sensitive.
13
+ - The CLI and MCP server do not execute arbitrary shell commands.
@@ -0,0 +1,113 @@
1
+ # Third-Party Notices
2
+
3
+ Open Uptime bundles or depends on the following third-party packages.
4
+
5
+ ## @modelcontextprotocol/sdk
6
+
7
+ - Version: 1.29.0
8
+ - License: MIT
9
+ - Source: https://github.com/modelcontextprotocol/typescript-sdk
10
+
11
+ MIT License
12
+
13
+ Copyright (c) 2024 Anthropic, PBC
14
+
15
+ Permission is hereby granted, free of charge, to any person obtaining a copy
16
+ of this software and associated documentation files (the "Software"), to deal
17
+ in the Software without restriction, including without limitation the rights
18
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19
+ copies of the Software, and to permit persons to whom the Software is
20
+ furnished to do so, subject to the following conditions:
21
+
22
+ The above copyright notice and this permission notice shall be included in all
23
+ copies or substantial portions of the Software.
24
+
25
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31
+ SOFTWARE.
32
+
33
+ ## chalk
34
+
35
+ - Version: 5.6.2
36
+ - License: MIT
37
+ - Source: https://github.com/chalk/chalk
38
+
39
+ MIT License
40
+
41
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
42
+
43
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
44
+ this software and associated documentation files (the "Software"), to deal in
45
+ the Software without restriction, including without limitation the rights to
46
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
47
+ the Software, and to permit persons to whom the Software is furnished to do so,
48
+ subject to the following conditions:
49
+
50
+ The above copyright notice and this permission notice shall be included in all
51
+ copies or substantial portions of the Software.
52
+
53
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
54
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
55
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
56
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
57
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
58
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
59
+
60
+ ## commander
61
+
62
+ - Version: 13.1.0
63
+ - License: MIT
64
+ - Source: https://github.com/tj/commander.js
65
+
66
+ (The MIT License)
67
+
68
+ Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>
69
+
70
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
71
+ this software and associated documentation files (the 'Software'), to deal in
72
+ the Software without restriction, including without limitation the rights to
73
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
74
+ the Software, and to permit persons to whom the Software is furnished to do so,
75
+ subject to the following conditions:
76
+
77
+ The above copyright notice and this permission notice shall be included in all
78
+ copies or substantial portions of the Software.
79
+
80
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
81
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
82
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
83
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
84
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
85
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
86
+
87
+ ## zod
88
+
89
+ - Version: 4.4.3
90
+ - License: MIT
91
+ - Source: https://github.com/colinhacks/zod
92
+
93
+ MIT License
94
+
95
+ Copyright (c) 2025 Colin McDonnell
96
+
97
+ Permission is hereby granted, free of charge, to any person obtaining a copy
98
+ of this software and associated documentation files (the "Software"), to deal
99
+ in the Software without restriction, including without limitation the rights
100
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
101
+ copies of the Software, and to permit persons to whom the Software is
102
+ furnished to do so, subject to the following conditions:
103
+
104
+ The above copyright notice and this permission notice shall be included in all
105
+ copies or substantial portions of the Software.
106
+
107
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
108
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
109
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
110
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
111
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
112
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
113
+ SOFTWARE.
package/dist/api.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ import { UptimeService, type UptimeServiceOptions } from "./service.js";
2
+ import type { SchedulerHandle } from "./types.js";
3
+ export interface ServeOptions extends UptimeServiceOptions {
4
+ host?: string;
5
+ port?: number;
6
+ check?: boolean;
7
+ service?: UptimeService;
8
+ }
9
+ export declare function createApiHandler(service: UptimeService): (request: Request) => Promise<Response>;
10
+ export declare function serveUptime(options?: ServeOptions): {
11
+ server: ReturnType<typeof Bun.serve>;
12
+ service: UptimeService;
13
+ scheduler?: SchedulerHandle;
14
+ };
15
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,WAAW,YAAa,SAAQ,oBAAoB;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,aAAa,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CA8DhG;AAED,wBAAgB,WAAW,CAAC,OAAO,GAAE,YAAiB,GAAG;IAAE,MAAM,EAAE,UAAU,CAAC,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC;IAAC,OAAO,EAAE,aAAa,CAAC;IAAC,SAAS,CAAC,EAAE,eAAe,CAAA;CAAE,CASrJ"}