onlineornot 1.0.0 โ†’ 1.0.1

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 CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  `onlineornot` is a CLI for monitoring your uptime checks on [OnlineOrNot](https://onlineornot.com/).
4
4
 
5
+ **Table of Contents**
6
+
7
+ - [Quick Start](#quick-start)
8
+ - [Commands](#commands)
9
+ - [Docs](#docs)
10
+
5
11
  ## Quick Start
6
12
 
7
13
  ```
@@ -11,6 +17,27 @@ export ONLINEORNOT_API_TOKEN=api-token-goes-here
11
17
  onlineornot checks list
12
18
  ```
13
19
 
20
+ ## Commands
21
+
22
+ ```bash
23
+ onlineornot
24
+
25
+ Commands:
26
+ onlineornot docs ๐Ÿ“š Open OnlineOrNot's docs in your browser
27
+ onlineornot checks โœ… Manage your uptime checks
28
+ onlineornot checks list List uptime checks
29
+ onlineornot checks view <id> View a specific uptime check
30
+ onlineornot checks create <name> <url> Create a new uptime check
31
+ onlineornot checks delete <id> Delete a specific uptime check
32
+ onlineornot billing ๐Ÿงพ Open OnlineOrNot's billing in your browser
33
+ onlineornot login ๐Ÿ”“ Open OnlineOrNot's Developer Portal in your browser
34
+ onlineornot whoami ๐Ÿ•ต๏ธ Retrieve your user info and test your auth config
35
+
36
+ Flags:
37
+ -h, --help Show help [boolean]
38
+ -v, --version Show version number [boolean]
39
+ ```
40
+
14
41
  ## Docs
15
42
 
16
43
  There are docs for:
@@ -24390,7 +24390,7 @@ var Yargs = YargsFactory(esm_default);
24390
24390
  var yargs_default = Yargs;
24391
24391
 
24392
24392
  // package.json
24393
- var version = "1.0.0";
24393
+ var version = "1.0.1";
24394
24394
  var package_default = {
24395
24395
  name: "onlineornot",
24396
24396
  version,
@@ -25447,6 +25447,9 @@ function options(yargs) {
25447
25447
  }
25448
25448
  async function handler(args) {
25449
25449
  await verifyToken();
25450
+ if (!args.json) {
25451
+ await printBanner();
25452
+ }
25450
25453
  let result;
25451
25454
  try {
25452
25455
  result = await fetchResult(`/checks/`, {
@@ -25460,6 +25463,10 @@ async function handler(args) {
25460
25463
  return logger.error(
25461
25464
  "You have reached the maximum number of checks for your account. Please upgrade to a paid plan to add more checks."
25462
25465
  );
25466
+ } else if (errorWithCode.code === 10003) {
25467
+ return logger.error(
25468
+ "Your API token isn't allowed to create checks.\nPlease check your token with `onlineornot whoami` and try again."
25469
+ );
25463
25470
  } else if (errorWithCode.code === 1e4) {
25464
25471
  return logger.error(
25465
25472
  "Validation error: " + errorWithCode?.notes?.[0].text
@@ -25471,7 +25478,6 @@ async function handler(args) {
25471
25478
  if (args.json) {
25472
25479
  logger.log(JSON.stringify(result, null, " "));
25473
25480
  } else {
25474
- await printBanner();
25475
25481
  logger.log("Successfully created new check:");
25476
25482
  logger.table([
25477
25483
  {
@@ -25516,11 +25522,13 @@ function options3(yargs) {
25516
25522
  }
25517
25523
  async function handler3(args) {
25518
25524
  await verifyToken();
25525
+ if (!args.json) {
25526
+ await printBanner();
25527
+ }
25519
25528
  const result = await fetchResult(`/checks/${args.id}`);
25520
25529
  if (args.json) {
25521
25530
  logger.log(JSON.stringify(result, null, " "));
25522
25531
  } else {
25523
- await printBanner();
25524
25532
  logger.table([
25525
25533
  {
25526
25534
  "Check ID": result.id,
@@ -25543,11 +25551,13 @@ function options4(yargs) {
25543
25551
  }
25544
25552
  async function handler4(args) {
25545
25553
  await verifyToken();
25554
+ if (!args.json) {
25555
+ await printBanner();
25556
+ }
25546
25557
  const results = await fetchPagedResult("/checks");
25547
25558
  if (args.json) {
25548
25559
  logger.log(JSON.stringify(results, null, " "));
25549
25560
  } else {
25550
- await printBanner();
25551
25561
  logger.table(
25552
25562
  results.map((result) => ({
25553
25563
  "Check ID": result.id,
@@ -25717,7 +25727,7 @@ function createCLIParser(argv) {
25717
25727
  );
25718
25728
  onlineornot.command(
25719
25729
  "login",
25720
- "\u{1F513} Opens your browser to OnlineOrNot's Developer settings",
25730
+ "\u{1F513} Open OnlineOrNot's Developer Portal in your browser",
25721
25731
  loginOptions,
25722
25732
  loginHandler
25723
25733
  );
@@ -25761,7 +25771,7 @@ async function main(argv) {
25761
25771
  logger.error(e instanceof Error ? e.message : e);
25762
25772
  logger.log(
25763
25773
  `${fgGreenColor}%s${resetColor}`,
25764
- "If you think this is a bug then please create an issue at https://github.com/onlineornot/onlineornot/issues/new"
25774
+ "If you think this is a bug then please create an issue at https://github.com/OnlineOrNot/onlineornot/issues/new/choose/new"
25765
25775
  );
25766
25776
  }
25767
25777
  throw e;