@supercheck/cli 0.1.0-beta.1 → 0.1.0-beta.2
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/LICENSE +62 -0
- package/dist/bin/supercheck.js +7 -14
- package/dist/bin/supercheck.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +25 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
Supercheck Community License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Supercheck Contributors
|
|
4
|
+
|
|
5
|
+
GRANT OF RIGHTS
|
|
6
|
+
|
|
7
|
+
You are granted a non-exclusive, royalty-free license to use, modify, and distribute
|
|
8
|
+
this software and its source code, subject to the restrictions and conditions outlined below.
|
|
9
|
+
|
|
10
|
+
PERMITTED USE
|
|
11
|
+
|
|
12
|
+
1. Personal Use: You may use Supercheck for personal projects and development purposes.
|
|
13
|
+
|
|
14
|
+
2. Open Source Development: You may use Supercheck as a foundation for open-source projects
|
|
15
|
+
that advance the testing and monitoring community, provided such projects are also
|
|
16
|
+
made publicly available under compatible open-source terms.
|
|
17
|
+
|
|
18
|
+
3. Internal Deployment: You may deploy and operate Supercheck internally within your
|
|
19
|
+
organization for your own business operations and testing needs.
|
|
20
|
+
|
|
21
|
+
4. Contributing Back: You may submit improvements, bug fixes, and features back to the
|
|
22
|
+
official Supercheck project via pull requests.
|
|
23
|
+
|
|
24
|
+
RESTRICTIONS
|
|
25
|
+
|
|
26
|
+
You may NOT:
|
|
27
|
+
|
|
28
|
+
1. Whitelabel or resell Supercheck as your own product or service.
|
|
29
|
+
|
|
30
|
+
2. Launch a competitive SaaS (Software-as-a-Service) product, testing platform, or
|
|
31
|
+
monitoring service based on or derived from Supercheck without explicit written
|
|
32
|
+
permission from Supercheck Contributors.
|
|
33
|
+
|
|
34
|
+
3. Use Supercheck as the primary component in a commercial offering that competes
|
|
35
|
+
with the official Supercheck service.
|
|
36
|
+
|
|
37
|
+
4. Remove or obscure copyright notices, licenses, or attribution.
|
|
38
|
+
|
|
39
|
+
5. Use Supercheck's branding, trademarks, or logos in any way that implies endorsement
|
|
40
|
+
or affiliation without permission.
|
|
41
|
+
|
|
42
|
+
COMMERCIAL LICENSING
|
|
43
|
+
|
|
44
|
+
If you wish to use Supercheck for commercial purposes, competitive products, or
|
|
45
|
+
whitelabeling, please contact the Supercheck team to discuss a commercial license agreement.
|
|
46
|
+
|
|
47
|
+
DISCLAIMER
|
|
48
|
+
|
|
49
|
+
This software is provided "AS IS" without warranty of any kind, express or implied,
|
|
50
|
+
including but not limited to the warranties of merchantability, fitness for a particular
|
|
51
|
+
purpose, and non-infringement. In no event shall the authors or copyright holders be
|
|
52
|
+
liable for any claim, damages, or other liability arising from the use of this software.
|
|
53
|
+
|
|
54
|
+
TERMINATION
|
|
55
|
+
|
|
56
|
+
Violation of the restrictions above will result in immediate termination of your license
|
|
57
|
+
and rights granted hereunder. You must cease all use and distribution of Supercheck.
|
|
58
|
+
|
|
59
|
+
GOVERNING LAW
|
|
60
|
+
|
|
61
|
+
This license is governed by applicable law. Any disputes shall be resolved in the
|
|
62
|
+
appropriate courts of jurisdiction.
|
package/dist/bin/supercheck.js
CHANGED
|
@@ -210,7 +210,7 @@ function requireTriggerKey() {
|
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
// src/version.ts
|
|
213
|
-
var CLI_VERSION = true ? "0.1.0-beta.
|
|
213
|
+
var CLI_VERSION = true ? "0.1.0-beta.2" : "0.0.0-dev";
|
|
214
214
|
|
|
215
215
|
// src/api/client.ts
|
|
216
216
|
import { ProxyAgent } from "undici";
|
|
@@ -1713,7 +1713,7 @@ jobCommand.command("get <id>").description("Get job details").action(async (id)
|
|
|
1713
1713
|
const { data } = await client.get(`/api/jobs/${id}`);
|
|
1714
1714
|
outputDetail(data);
|
|
1715
1715
|
});
|
|
1716
|
-
jobCommand.command("create").description("Create a new job").requiredOption("--name <name>", "Job name").option("--description <description>", "Job description", "").option("--schedule <cron>", "Cron schedule expression").option("--timeout <seconds>", "Timeout in seconds", "300").option("--retries <count>", "Retry count on failure", "0").action(async (options) => {
|
|
1716
|
+
jobCommand.command("create").description("Create a new job").requiredOption("--name <name>", "Job name").option("--description <description>", "Job description", "").option("--type <type>", "Job type (playwright, k6)").option("--schedule <cron>", "Cron schedule expression").option("--timeout <seconds>", "Timeout in seconds", "300").option("--retries <count>", "Retry count on failure", "0").action(async (options) => {
|
|
1717
1717
|
const client = createAuthenticatedClient();
|
|
1718
1718
|
const body = {
|
|
1719
1719
|
name: options.name,
|
|
@@ -1723,6 +1723,7 @@ jobCommand.command("create").description("Create a new job").requiredOption("--n
|
|
|
1723
1723
|
config: {},
|
|
1724
1724
|
tests: []
|
|
1725
1725
|
};
|
|
1726
|
+
if (options.type) body.jobType = options.type;
|
|
1726
1727
|
if (options.schedule) body.cronSchedule = options.schedule;
|
|
1727
1728
|
const { data } = await client.post("/api/jobs", body);
|
|
1728
1729
|
logger.success(`Job "${options.name}" created (${data.id})`);
|
|
@@ -2379,11 +2380,7 @@ monitorCommand.command("status <id>").description("Get current monitor status").
|
|
|
2379
2380
|
});
|
|
2380
2381
|
monitorCommand.command("create").description("Create a new monitor").requiredOption("--name <name>", "Monitor name").requiredOption("--url <url>", "URL to monitor").option("--type <type>", "Monitor type (http_request, website, ping_host, port_check, synthetic_test)", "http_request").option("--interval <seconds>", "Check interval in seconds", "300").option("--timeout <seconds>", "Request timeout in seconds", "30").option("--method <method>", "HTTP method (GET, POST, HEAD)", "GET").action(async (options) => {
|
|
2381
2382
|
const client = createAuthenticatedClient();
|
|
2382
|
-
const intervalSeconds =
|
|
2383
|
-
if (!Number.isFinite(intervalSeconds) || intervalSeconds <= 0) {
|
|
2384
|
-
logger.error("Invalid --interval value: must be a positive number of seconds");
|
|
2385
|
-
return;
|
|
2386
|
-
}
|
|
2383
|
+
const intervalSeconds = parseIntStrict(options.interval, "--interval", { min: 1 });
|
|
2387
2384
|
const frequencyMinutes = Math.max(1, Math.ceil(intervalSeconds / 60));
|
|
2388
2385
|
const body = {
|
|
2389
2386
|
name: options.name,
|
|
@@ -2391,7 +2388,7 @@ monitorCommand.command("create").description("Create a new monitor").requiredOpt
|
|
|
2391
2388
|
type: options.type,
|
|
2392
2389
|
frequencyMinutes,
|
|
2393
2390
|
config: {
|
|
2394
|
-
timeout:
|
|
2391
|
+
timeout: parseIntStrict(options.timeout, "--timeout", { min: 1 }) * 1e3,
|
|
2395
2392
|
// API expects milliseconds
|
|
2396
2393
|
method: options.method
|
|
2397
2394
|
}
|
|
@@ -2406,16 +2403,12 @@ monitorCommand.command("update <id>").description("Update a monitor").option("--
|
|
|
2406
2403
|
if (options.name !== void 0) body.name = options.name;
|
|
2407
2404
|
if (options.url !== void 0) body.target = options.url;
|
|
2408
2405
|
if (options.interval !== void 0) {
|
|
2409
|
-
const intervalSeconds =
|
|
2410
|
-
if (!Number.isFinite(intervalSeconds) || intervalSeconds <= 0) {
|
|
2411
|
-
logger.error("Invalid --interval value: must be a positive number of seconds");
|
|
2412
|
-
return;
|
|
2413
|
-
}
|
|
2406
|
+
const intervalSeconds = parseIntStrict(options.interval, "--interval", { min: 1 });
|
|
2414
2407
|
body.frequencyMinutes = Math.max(1, Math.ceil(intervalSeconds / 60));
|
|
2415
2408
|
}
|
|
2416
2409
|
if (options.active !== void 0) body.enabled = options.active === "true";
|
|
2417
2410
|
const config = {};
|
|
2418
|
-
if (options.timeout !== void 0) config.timeout =
|
|
2411
|
+
if (options.timeout !== void 0) config.timeout = parseIntStrict(options.timeout, "--timeout", { min: 1 }) * 1e3;
|
|
2419
2412
|
if (options.method !== void 0) config.method = options.method;
|
|
2420
2413
|
if (Object.keys(config).length > 0) body.config = config;
|
|
2421
2414
|
if (Object.keys(body).length === 0) {
|