@uptimerobot/cli 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.
Files changed (108) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +179 -0
  3. package/bin/run.js +43 -0
  4. package/dist/api/client.js +95 -0
  5. package/dist/api/errors.js +26 -0
  6. package/dist/commands/alert-contacts/create.js +10 -0
  7. package/dist/commands/alert-contacts/delete.js +10 -0
  8. package/dist/commands/alert-contacts/get.js +10 -0
  9. package/dist/commands/alert-contacts/list.js +10 -0
  10. package/dist/commands/alert-contacts/update.js +10 -0
  11. package/dist/commands/auth/login.js +51 -0
  12. package/dist/commands/auth/logout.js +33 -0
  13. package/dist/commands/auth/status.js +38 -0
  14. package/dist/commands/auth/whoami.js +6 -0
  15. package/dist/commands/incidents/activity-log.js +10 -0
  16. package/dist/commands/incidents/alerts.js +10 -0
  17. package/dist/commands/incidents/comments/create.js +10 -0
  18. package/dist/commands/incidents/comments/delete.js +10 -0
  19. package/dist/commands/incidents/comments/list.js +10 -0
  20. package/dist/commands/incidents/comments/update.js +10 -0
  21. package/dist/commands/incidents/get.js +10 -0
  22. package/dist/commands/incidents/list.js +10 -0
  23. package/dist/commands/integrations/create.js +10 -0
  24. package/dist/commands/integrations/delete.js +10 -0
  25. package/dist/commands/integrations/get.js +10 -0
  26. package/dist/commands/integrations/list.js +10 -0
  27. package/dist/commands/integrations/update.js +10 -0
  28. package/dist/commands/maintenance-windows/create.js +10 -0
  29. package/dist/commands/maintenance-windows/delete.js +10 -0
  30. package/dist/commands/maintenance-windows/get.js +10 -0
  31. package/dist/commands/maintenance-windows/list.js +10 -0
  32. package/dist/commands/maintenance-windows/update.js +10 -0
  33. package/dist/commands/monitor-groups/create.js +10 -0
  34. package/dist/commands/monitor-groups/delete.js +10 -0
  35. package/dist/commands/monitor-groups/get.js +10 -0
  36. package/dist/commands/monitor-groups/list.js +10 -0
  37. package/dist/commands/monitor-groups/update.js +10 -0
  38. package/dist/commands/monitors/bulk/pause.js +10 -0
  39. package/dist/commands/monitors/bulk/start.js +10 -0
  40. package/dist/commands/monitors/bulk/update.js +10 -0
  41. package/dist/commands/monitors/create/api.js +10 -0
  42. package/dist/commands/monitors/create/dns.js +10 -0
  43. package/dist/commands/monitors/create/heartbeat.js +10 -0
  44. package/dist/commands/monitors/create/http.js +10 -0
  45. package/dist/commands/monitors/create/keyword.js +10 -0
  46. package/dist/commands/monitors/create/ping.js +10 -0
  47. package/dist/commands/monitors/create/port.js +10 -0
  48. package/dist/commands/monitors/create/udp.js +10 -0
  49. package/dist/commands/monitors/create/visual-comparison.js +10 -0
  50. package/dist/commands/monitors/delete.js +10 -0
  51. package/dist/commands/monitors/get.js +10 -0
  52. package/dist/commands/monitors/list.js +10 -0
  53. package/dist/commands/monitors/pause.js +10 -0
  54. package/dist/commands/monitors/reset.js +10 -0
  55. package/dist/commands/monitors/schema.js +57 -0
  56. package/dist/commands/monitors/start.js +10 -0
  57. package/dist/commands/monitors/stats/response-time/all.js +10 -0
  58. package/dist/commands/monitors/stats/response-time.js +10 -0
  59. package/dist/commands/monitors/stats/uptime.js +10 -0
  60. package/dist/commands/monitors/update.js +10 -0
  61. package/dist/commands/monitors/uptime-stats.js +10 -0
  62. package/dist/commands/status-pages/announcements/create.js +10 -0
  63. package/dist/commands/status-pages/announcements/get.js +10 -0
  64. package/dist/commands/status-pages/announcements/list.js +10 -0
  65. package/dist/commands/status-pages/announcements/pin.js +10 -0
  66. package/dist/commands/status-pages/announcements/unpin.js +10 -0
  67. package/dist/commands/status-pages/announcements/update.js +10 -0
  68. package/dist/commands/status-pages/create.js +10 -0
  69. package/dist/commands/status-pages/delete.js +10 -0
  70. package/dist/commands/status-pages/get.js +10 -0
  71. package/dist/commands/status-pages/list.js +10 -0
  72. package/dist/commands/status-pages/update.js +10 -0
  73. package/dist/commands/tags/delete.js +10 -0
  74. package/dist/commands/tags/list.js +10 -0
  75. package/dist/commands/user/alert-contacts.js +10 -0
  76. package/dist/commands/user/all-alert-contacts.js +10 -0
  77. package/dist/commands/user/get.js +5 -0
  78. package/dist/commands/user/me.js +10 -0
  79. package/dist/generated/operations.js +7631 -0
  80. package/dist/lib/auth.js +60 -0
  81. package/dist/lib/base-command.js +21 -0
  82. package/dist/lib/cli-errors.js +80 -0
  83. package/dist/lib/command-suggestions.js +44 -0
  84. package/dist/lib/credential-store.js +152 -0
  85. package/dist/lib/flag-name.js +11 -0
  86. package/dist/lib/invocation.js +74 -0
  87. package/dist/lib/objects.js +34 -0
  88. package/dist/lib/operation-command.js +486 -0
  89. package/dist/lib/operation-parser-error.js +28 -0
  90. package/dist/lib/request-curation.js +76 -0
  91. package/dist/lib/request-example.js +82 -0
  92. package/dist/lib/request-preview.js +25 -0
  93. package/dist/lib/request.js +301 -0
  94. package/dist/lib/sensitive-fields.js +19 -0
  95. package/dist/lib/types.js +1 -0
  96. package/dist/output/columns.js +221 -0
  97. package/dist/output/display-width.js +34 -0
  98. package/dist/output/normalize-result.js +28 -0
  99. package/dist/output/pagination-notice.js +27 -0
  100. package/dist/output/renderer.js +145 -0
  101. package/dist/output/request-progress.js +15 -0
  102. package/dist/output/resolve-format.js +32 -0
  103. package/dist/output/style.js +57 -0
  104. package/dist/runtime/parse-input.js +35 -0
  105. package/dist/runtime/types.js +1 -0
  106. package/dist/runtime/validate-input.js +63 -0
  107. package/openapi/openapi.yaml +9034 -0
  108. package/package.json +135 -0
@@ -0,0 +1,33 @@
1
+ import { Flags } from '@oclif/core';
2
+ import { BaseCommand } from '../../lib/base-command.js';
3
+ import { credentialStore } from '../../lib/credential-store.js';
4
+ import { detectInvocationMode } from '../../lib/invocation.js';
5
+ import { resolveFormat } from '../../output/resolve-format.js';
6
+ export default class AuthLogout extends BaseCommand {
7
+ static description = 'Remove the API key saved in the OS credential store or config file';
8
+ static flags = {
9
+ json: Flags.boolean({ description: 'Emit structured JSON output' }),
10
+ };
11
+ static summary = 'Log out of the stored API-key session';
12
+ async run() {
13
+ const { flags } = await this.parse(AuthLogout);
14
+ let removed;
15
+ try {
16
+ removed = await credentialStore.deleteApiKey();
17
+ }
18
+ catch {
19
+ this.error('Credential storage is unavailable.', {
20
+ code: 'AUTH_STORAGE_UNAVAILABLE',
21
+ exit: 1,
22
+ });
23
+ }
24
+ const format = resolveFormat(flags, detectInvocationMode(false));
25
+ if (format === 'json' || format === 'jsonl')
26
+ this.log(JSON.stringify({ removed }));
27
+ else
28
+ this.log(removed ? 'Stored API key removed.' : 'No stored API key was found.');
29
+ if (process.env.UPTIMEROBOT_API_KEY) {
30
+ this.warn('UPTIMEROBOT_API_KEY is still set and will continue to authenticate commands.');
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,38 @@
1
+ import { Flags } from '@oclif/core';
2
+ import { BaseCommand } from '../../lib/base-command.js';
3
+ import { credentialStore } from '../../lib/credential-store.js';
4
+ import { detectInvocationMode } from '../../lib/invocation.js';
5
+ import { resolveFormat } from '../../output/resolve-format.js';
6
+ export default class AuthStatus extends BaseCommand {
7
+ static description = 'Show whether an API key is saved in the OS credential store or config file';
8
+ static flags = {
9
+ json: Flags.boolean({ description: 'Emit structured JSON output' }),
10
+ };
11
+ static summary = 'Show authentication status';
12
+ async run() {
13
+ const { flags } = await this.parse(AuthStatus);
14
+ let stored;
15
+ try {
16
+ stored = await credentialStore.getApiKey();
17
+ }
18
+ catch {
19
+ this.error('Credential storage is unavailable.', {
20
+ code: 'AUTH_STORAGE_UNAVAILABLE',
21
+ exit: 1,
22
+ });
23
+ }
24
+ const status = stored
25
+ ? { authenticated: true, source: stored.backend, type: 'api-key' }
26
+ : { authenticated: false, source: null, type: null };
27
+ const format = resolveFormat(flags, detectInvocationMode(false));
28
+ if (format === 'json' || format === 'jsonl')
29
+ this.log(JSON.stringify(status));
30
+ else if (!stored)
31
+ this.log('No stored authentication found.');
32
+ else if (stored.backend === 'keyring')
33
+ this.log('Authenticated with an API key stored in the OS credential store.');
34
+ else
35
+ this.log('Authenticated with an API key stored in the config file.');
36
+ return status;
37
+ }
38
+ }
@@ -0,0 +1,6 @@
1
+ import AuthStatus from './status.js';
2
+ export default class AuthWhoami extends AuthStatus {
3
+ static description = `${AuthStatus.description}
4
+
5
+ Canonical command: uptimerobot auth status`;
6
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../lib/operation-command.js';
9
+ import { operations } from '../../generated/operations.js';
10
+ export default createOperationCommand(operations['incidents:activity-log']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../lib/operation-command.js';
9
+ import { operations } from '../../generated/operations.js';
10
+ export default createOperationCommand(operations['incidents:alerts']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../../lib/operation-command.js';
9
+ import { operations } from '../../../generated/operations.js';
10
+ export default createOperationCommand(operations['incidents:comments:create']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../../lib/operation-command.js';
9
+ import { operations } from '../../../generated/operations.js';
10
+ export default createOperationCommand(operations['incidents:comments:delete']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../../lib/operation-command.js';
9
+ import { operations } from '../../../generated/operations.js';
10
+ export default createOperationCommand(operations['incidents:comments:list']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../../lib/operation-command.js';
9
+ import { operations } from '../../../generated/operations.js';
10
+ export default createOperationCommand(operations['incidents:comments:update']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../lib/operation-command.js';
9
+ import { operations } from '../../generated/operations.js';
10
+ export default createOperationCommand(operations['incidents:get']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../lib/operation-command.js';
9
+ import { operations } from '../../generated/operations.js';
10
+ export default createOperationCommand(operations['incidents:list']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../lib/operation-command.js';
9
+ import { operations } from '../../generated/operations.js';
10
+ export default createOperationCommand(operations['integrations:create']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../lib/operation-command.js';
9
+ import { operations } from '../../generated/operations.js';
10
+ export default createOperationCommand(operations['integrations:delete']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../lib/operation-command.js';
9
+ import { operations } from '../../generated/operations.js';
10
+ export default createOperationCommand(operations['integrations:get']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../lib/operation-command.js';
9
+ import { operations } from '../../generated/operations.js';
10
+ export default createOperationCommand(operations['integrations:list']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../lib/operation-command.js';
9
+ import { operations } from '../../generated/operations.js';
10
+ export default createOperationCommand(operations['integrations:update']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../lib/operation-command.js';
9
+ import { operations } from '../../generated/operations.js';
10
+ export default createOperationCommand(operations['maintenance-windows:create']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../lib/operation-command.js';
9
+ import { operations } from '../../generated/operations.js';
10
+ export default createOperationCommand(operations['maintenance-windows:delete']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../lib/operation-command.js';
9
+ import { operations } from '../../generated/operations.js';
10
+ export default createOperationCommand(operations['maintenance-windows:get']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../lib/operation-command.js';
9
+ import { operations } from '../../generated/operations.js';
10
+ export default createOperationCommand(operations['maintenance-windows:list']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../lib/operation-command.js';
9
+ import { operations } from '../../generated/operations.js';
10
+ export default createOperationCommand(operations['maintenance-windows:update']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../lib/operation-command.js';
9
+ import { operations } from '../../generated/operations.js';
10
+ export default createOperationCommand(operations['monitor-groups:create']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../lib/operation-command.js';
9
+ import { operations } from '../../generated/operations.js';
10
+ export default createOperationCommand(operations['monitor-groups:delete']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../lib/operation-command.js';
9
+ import { operations } from '../../generated/operations.js';
10
+ export default createOperationCommand(operations['monitor-groups:get']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../lib/operation-command.js';
9
+ import { operations } from '../../generated/operations.js';
10
+ export default createOperationCommand(operations['monitor-groups:list']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../lib/operation-command.js';
9
+ import { operations } from '../../generated/operations.js';
10
+ export default createOperationCommand(operations['monitor-groups:update']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../../lib/operation-command.js';
9
+ import { operations } from '../../../generated/operations.js';
10
+ export default createOperationCommand(operations['monitors:bulk:pause']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../../lib/operation-command.js';
9
+ import { operations } from '../../../generated/operations.js';
10
+ export default createOperationCommand(operations['monitors:bulk:start']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../../lib/operation-command.js';
9
+ import { operations } from '../../../generated/operations.js';
10
+ export default createOperationCommand(operations['monitors:bulk:update']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../../lib/operation-command.js';
9
+ import { operations } from '../../../generated/operations.js';
10
+ export default createOperationCommand(operations['monitors:create:api']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../../lib/operation-command.js';
9
+ import { operations } from '../../../generated/operations.js';
10
+ export default createOperationCommand(operations['monitors:create:dns']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../../lib/operation-command.js';
9
+ import { operations } from '../../../generated/operations.js';
10
+ export default createOperationCommand(operations['monitors:create:heartbeat']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../../lib/operation-command.js';
9
+ import { operations } from '../../../generated/operations.js';
10
+ export default createOperationCommand(operations['monitors:create:http']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../../lib/operation-command.js';
9
+ import { operations } from '../../../generated/operations.js';
10
+ export default createOperationCommand(operations['monitors:create:keyword']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../../lib/operation-command.js';
9
+ import { operations } from '../../../generated/operations.js';
10
+ export default createOperationCommand(operations['monitors:create:ping']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../../lib/operation-command.js';
9
+ import { operations } from '../../../generated/operations.js';
10
+ export default createOperationCommand(operations['monitors:create:port']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../../lib/operation-command.js';
9
+ import { operations } from '../../../generated/operations.js';
10
+ export default createOperationCommand(operations['monitors:create:udp']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../../lib/operation-command.js';
9
+ import { operations } from '../../../generated/operations.js';
10
+ export default createOperationCommand(operations['monitors:create:visual-comparison']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../lib/operation-command.js';
9
+ import { operations } from '../../generated/operations.js';
10
+ export default createOperationCommand(operations['monitors:delete']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../lib/operation-command.js';
9
+ import { operations } from '../../generated/operations.js';
10
+ export default createOperationCommand(operations['monitors:get']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../lib/operation-command.js';
9
+ import { operations } from '../../generated/operations.js';
10
+ export default createOperationCommand(operations['monitors:list']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../lib/operation-command.js';
9
+ import { operations } from '../../generated/operations.js';
10
+ export default createOperationCommand(operations['monitors:pause']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../lib/operation-command.js';
9
+ import { operations } from '../../generated/operations.js';
10
+ export default createOperationCommand(operations['monitors:reset']);
@@ -0,0 +1,57 @@
1
+ import { Args, Flags } from '@oclif/core';
2
+ import { operations } from '../../generated/operations.js';
3
+ import { BaseCommand } from '../../lib/base-command.js';
4
+ import { cliRequestDefaults, curatedRequestBodyFields, curatedRequestExamples, } from '../../lib/request-curation.js';
5
+ import { buildRequestBody } from '../../lib/request.js';
6
+ const PREFIX = 'monitors:create:';
7
+ const monitorCreateOperations = Object.fromEntries(Object.entries(operations).filter(([commandId]) => commandId.startsWith(PREFIX)));
8
+ const monitorTypes = Object.keys(monitorCreateOperations)
9
+ .map((commandId) => commandId.slice(PREFIX.length))
10
+ .sort();
11
+ export default class MonitorsSchema extends BaseCommand {
12
+ static args = {
13
+ type: Args.string({
14
+ description: 'Monitor type',
15
+ options: monitorTypes,
16
+ required: true,
17
+ }),
18
+ };
19
+ static description = 'Print the CLI request schema for a monitor type without authentication or networking';
20
+ static flags = {
21
+ example: Flags.boolean({ description: 'Print one locally validated example body' }),
22
+ };
23
+ async run() {
24
+ const { args, flags } = await this.parse(MonitorsSchema);
25
+ const commandId = `${PREFIX}${args.type}`;
26
+ const operation = monitorCreateOperations[commandId];
27
+ if (!operation) {
28
+ return this.fail({
29
+ code: 'INVALID_INPUT',
30
+ expected: monitorTypes.join(', '),
31
+ message: `Unknown monitor type: ${args.type}`,
32
+ path: 'type',
33
+ }, 2);
34
+ }
35
+ if (flags.example) {
36
+ const example = curatedRequestExamples(operation)[0];
37
+ if (!example) {
38
+ return this.fail({
39
+ code: 'EXAMPLE_UNAVAILABLE',
40
+ message: `No authored request example is available for ${commandId.replaceAll(':', ' ')}.`,
41
+ }, 2);
42
+ }
43
+ const body = await buildRequestBody(operation, { body: JSON.stringify(example.body) }, new Headers());
44
+ this.log(String(body));
45
+ return;
46
+ }
47
+ this.log(JSON.stringify({
48
+ cliDefaults: cliRequestDefaults(operation),
49
+ command: commandId.replaceAll(':', ' '),
50
+ examples: curatedRequestExamples(operation),
51
+ fields: curatedRequestBodyFields(operation),
52
+ fixedValues: operation.requestBodyDefaults ?? {},
53
+ method: operation.method,
54
+ path: operation.path,
55
+ }, null, 2));
56
+ }
57
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../lib/operation-command.js';
9
+ import { operations } from '../../generated/operations.js';
10
+ export default createOperationCommand(operations['monitors:start']);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Code generated by scripts/generate-openapi.ts
3
+ * from openapi/openapi.yaml.
4
+ *
5
+ * DO NOT EDIT — changes will be overwritten.
6
+ * Run `pnpm openapi:generate` to regenerate.
7
+ */
8
+ import { createOperationCommand } from '../../../../lib/operation-command.js';
9
+ import { operations } from '../../../../generated/operations.js';
10
+ export default createOperationCommand(operations['monitors:stats:response-time:all']);