@uptimerobot/cli 0.3.0 → 1.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.
Files changed (50) hide show
  1. package/README.md +68 -2
  2. package/bin/run.js +24 -2
  3. package/dist/api/errors.js +20 -1
  4. package/dist/commands/integrations/create/discord.js +10 -0
  5. package/dist/commands/integrations/create/google-chat.js +10 -0
  6. package/dist/commands/integrations/create/mattermost.js +10 -0
  7. package/dist/commands/integrations/create/msteams.js +10 -0
  8. package/dist/commands/integrations/create/pagerduty.js +10 -0
  9. package/dist/commands/integrations/create/push-bullet.js +10 -0
  10. package/dist/commands/integrations/create/pushover.js +10 -0
  11. package/dist/commands/integrations/create/slack.js +10 -0
  12. package/dist/commands/integrations/create/splunk.js +10 -0
  13. package/dist/commands/integrations/create/telegram.js +10 -0
  14. package/dist/commands/integrations/create/webhook.js +10 -0
  15. package/dist/commands/integrations/create/zapier.js +10 -0
  16. package/dist/commands/integrations/update/discord.js +10 -0
  17. package/dist/commands/integrations/update/google-chat.js +10 -0
  18. package/dist/commands/integrations/update/mattermost.js +10 -0
  19. package/dist/commands/integrations/update/msteams.js +10 -0
  20. package/dist/commands/integrations/update/pagerduty.js +10 -0
  21. package/dist/commands/integrations/update/push-bullet.js +10 -0
  22. package/dist/commands/integrations/update/pushover.js +10 -0
  23. package/dist/commands/integrations/update/slack.js +10 -0
  24. package/dist/commands/integrations/update/splunk.js +10 -0
  25. package/dist/commands/integrations/update/telegram.js +10 -0
  26. package/dist/commands/integrations/update/webhook.js +10 -0
  27. package/dist/commands/integrations/update/zapier.js +10 -0
  28. package/dist/commands/monitors/create/third-party-service.js +10 -0
  29. package/dist/commands/monitors/create.js +10 -0
  30. package/dist/commands/monitors/storm-protection/update.js +10 -0
  31. package/dist/commands/monitors/storm-protection.js +10 -0
  32. package/dist/commands/monitors/third-party-service/incidents/activity-log.js +10 -0
  33. package/dist/commands/monitors/third-party-service/incidents/get.js +10 -0
  34. package/dist/commands/monitors/third-party-service/incidents/list.js +10 -0
  35. package/dist/commands/monitors/third-party-service/status.js +10 -0
  36. package/dist/commands/status-pages/announcements/delete.js +10 -0
  37. package/dist/commands/third-party-providers/get.js +10 -0
  38. package/dist/commands/third-party-providers/list.js +10 -0
  39. package/dist/commands/version.js +44 -0
  40. package/dist/generated/operations.js +10524 -4622
  41. package/dist/lib/cli-errors.js +21 -3
  42. package/dist/lib/command-suggestions.js +1 -0
  43. package/dist/lib/help-curation.js +25 -0
  44. package/dist/lib/operation-command.js +7 -3
  45. package/dist/lib/redact-secrets.js +16 -1
  46. package/dist/lib/request.js +41 -5
  47. package/dist/lib/response-curation.js +43 -0
  48. package/dist/output/columns.js +24 -0
  49. package/openapi/openapi.yaml +2924 -274
  50. package/package.json +16 -2
@@ -0,0 +1,44 @@
1
+ import { Flags } from '@oclif/core';
2
+ import { BaseCommand } from '../lib/base-command.js';
3
+ import { detectInvocationMode } from '../lib/invocation.js';
4
+ import { formatOutput } from '../output/renderer.js';
5
+ import { resolveFormat } from '../output/resolve-format.js';
6
+ export default class Version extends BaseCommand {
7
+ // The bare --version flag is handled by oclif core before any command runs,
8
+ // so it always prints one human sentence. This command reports the same
9
+ // facts as separate fields, which is what a version assertion in CI needs.
10
+ static description = 'Report the CLI version, the platform it runs on, and the Node.js runtime executing it. Unlike the --version flag, this command honours the output flags, so a caller can read the version as a field instead of parsing a sentence.';
11
+ static examples = ['<%= config.bin %> version --json'];
12
+ static flags = {
13
+ format: Flags.string({
14
+ description: 'Output format; json is normalized and jsonl emits one resource per line',
15
+ options: ['json', 'jsonl', 'table', 'plain'],
16
+ }),
17
+ json: Flags.boolean({
18
+ description: 'Shorthand for --format json; emit normalized structured JSON',
19
+ }),
20
+ };
21
+ static summary = 'Show the CLI version';
22
+ async run() {
23
+ const { flags } = await this.parse(Version);
24
+ if (flags.json === true && flags.format !== undefined) {
25
+ return this.fail({ code: 'INVALID_INPUT', message: '--json cannot be combined with --format.' }, 2);
26
+ }
27
+ const info = {
28
+ version: this.config.version,
29
+ platform: `${this.config.platform}-${this.config.arch}`,
30
+ node: process.versions.node,
31
+ };
32
+ const format = resolveFormat(flags, detectInvocationMode(false));
33
+ if (format === 'json' || format === 'jsonl') {
34
+ this.log(JSON.stringify(info));
35
+ return;
36
+ }
37
+ // A single record has no collection to render, so it is passed as a
38
+ // one-row collection to get the table headings and the tab-separated
39
+ // plain row every other command produces.
40
+ const output = formatOutput(format, [info]);
41
+ if (output !== undefined)
42
+ this.log(output);
43
+ }
44
+ }