@uptimerobot/cli 1.0.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 (41) hide show
  1. package/README.md +23 -2
  2. package/dist/commands/integrations/create/discord.js +10 -0
  3. package/dist/commands/integrations/create/google-chat.js +10 -0
  4. package/dist/commands/integrations/create/mattermost.js +10 -0
  5. package/dist/commands/integrations/create/msteams.js +10 -0
  6. package/dist/commands/integrations/create/pagerduty.js +10 -0
  7. package/dist/commands/integrations/create/push-bullet.js +10 -0
  8. package/dist/commands/integrations/create/pushover.js +10 -0
  9. package/dist/commands/integrations/create/slack.js +10 -0
  10. package/dist/commands/integrations/create/splunk.js +10 -0
  11. package/dist/commands/integrations/create/telegram.js +10 -0
  12. package/dist/commands/integrations/create/webhook.js +10 -0
  13. package/dist/commands/integrations/create/zapier.js +10 -0
  14. package/dist/commands/integrations/update/discord.js +10 -0
  15. package/dist/commands/integrations/update/google-chat.js +10 -0
  16. package/dist/commands/integrations/update/mattermost.js +10 -0
  17. package/dist/commands/integrations/update/msteams.js +10 -0
  18. package/dist/commands/integrations/update/pagerduty.js +10 -0
  19. package/dist/commands/integrations/update/push-bullet.js +10 -0
  20. package/dist/commands/integrations/update/pushover.js +10 -0
  21. package/dist/commands/integrations/update/slack.js +10 -0
  22. package/dist/commands/integrations/update/splunk.js +10 -0
  23. package/dist/commands/integrations/update/telegram.js +10 -0
  24. package/dist/commands/integrations/update/webhook.js +10 -0
  25. package/dist/commands/integrations/update/zapier.js +10 -0
  26. package/dist/commands/monitors/create/third-party-service.js +10 -0
  27. package/dist/commands/monitors/create.js +10 -0
  28. package/dist/commands/monitors/storm-protection/update.js +10 -0
  29. package/dist/commands/monitors/storm-protection.js +10 -0
  30. package/dist/commands/monitors/third-party-service/incidents/activity-log.js +10 -0
  31. package/dist/commands/monitors/third-party-service/incidents/get.js +10 -0
  32. package/dist/commands/monitors/third-party-service/incidents/list.js +10 -0
  33. package/dist/commands/monitors/third-party-service/status.js +10 -0
  34. package/dist/commands/status-pages/announcements/delete.js +10 -0
  35. package/dist/commands/third-party-providers/get.js +10 -0
  36. package/dist/commands/third-party-providers/list.js +10 -0
  37. package/dist/generated/operations.js +10509 -4625
  38. package/dist/lib/cli-errors.js +21 -3
  39. package/dist/output/columns.js +24 -0
  40. package/openapi/openapi.yaml +2908 -274
  41. package/package.json +15 -1
@@ -1,6 +1,7 @@
1
1
  import { outputFormatFromEnvironment, requestedFormatFromArgv } from '../output/resolve-format.js';
2
2
  import { agentEnvironmentDetected } from './invocation.js';
3
3
  import { isRecord } from './objects.js';
4
+ import { redactSecrets } from './redact-secrets.js';
4
5
  const handledErrors = new WeakSet();
5
6
  export class CliFailure extends Error {
6
7
  cliError;
@@ -11,9 +12,26 @@ export class CliFailure extends Error {
11
12
  this.oclif = { exit: exitCode };
12
13
  }
13
14
  }
15
+ /**
16
+ * Redacts the envelope rather than each error's source, because this is the one
17
+ * place a failure becomes output: it covers the API's `details` passthrough,
18
+ * the CLI's own bulk failures, and any error shape added later. The cast holds
19
+ * because only values are replaced and no CliError key is credential-like, so
20
+ * every key survives with its type.
21
+ *
22
+ * Unlike the success path this ignores --reveal-secrets. errorEnvelope also
23
+ * serves failures raised before flags are parsed, and failure output is what
24
+ * gets pasted into bug reports, CI logs, and agent transcripts.
25
+ *
26
+ * Redaction is key-based, so a secret interpolated into a free-text `message`
27
+ * is not covered; only structured content is.
28
+ */
29
+ function redactError(error) {
30
+ return redactSecrets(error).value;
31
+ }
14
32
  export function errorEnvelope(error) {
15
33
  if (error instanceof CliFailure)
16
- return { error: error.cliError };
34
+ return { error: redactError(error.cliError) };
17
35
  const metadata = isRecord(error) ? error : {};
18
36
  const exitCode = exitCodeForError(error);
19
37
  const code = typeof metadata.code === 'string' && metadata.code !== 'EEXIT'
@@ -27,7 +45,7 @@ export function errorEnvelope(error) {
27
45
  ? error
28
46
  : 'The command failed.';
29
47
  return {
30
- error: {
48
+ error: redactError({
31
49
  code,
32
50
  ...(metadata.details !== undefined ? { details: metadata.details } : {}),
33
51
  ...(typeof metadata.expected === 'string' ? { expected: metadata.expected } : {}),
@@ -38,7 +56,7 @@ export function errorEnvelope(error) {
38
56
  metadata.suggestions.every((suggestion) => typeof suggestion === 'string')
39
57
  ? { suggestions: metadata.suggestions }
40
58
  : {}),
41
- },
59
+ }),
42
60
  };
43
61
  }
44
62
  export function exitCodeForError(error) {
@@ -9,9 +9,12 @@ export const COLLECTION_COMMAND_IDS = [
9
9
  'maintenance-windows:list',
10
10
  'monitor-groups:list',
11
11
  'monitors:list',
12
+ 'monitors:third-party-service:incidents:activity-log',
13
+ 'monitors:third-party-service:incidents:list',
12
14
  'status-pages:announcements:list',
13
15
  'status-pages:list',
14
16
  'tags:list',
17
+ 'third-party-providers:list',
15
18
  'user:alert-contacts',
16
19
  'user:all-alert-contacts',
17
20
  ];
@@ -87,6 +90,20 @@ export const COMMAND_COLUMNS = {
87
90
  { format: stateAge, header: 'IN STATE', key: 'currentStateDuration' },
88
91
  { format: joinNames, key: 'tags', maxWidth: 32 },
89
92
  ],
93
+ 'monitors:third-party-service:incidents:activity-log': [
94
+ { key: 'timestamp' },
95
+ { key: 'status' },
96
+ { header: 'RECIPIENT', key: 'alertContactName', maxWidth: 28 },
97
+ { header: 'CONTACT', key: 'channelIdentifier', maxWidth: 36 },
98
+ { key: 'channel' },
99
+ ],
100
+ 'monitors:third-party-service:incidents:list': [
101
+ { key: 'id' },
102
+ { key: 'severity' },
103
+ { key: 'title', maxWidth: 48 },
104
+ { header: 'STARTED', key: 'startedAt' },
105
+ { header: 'RESOLVED', key: 'resolvedAt' },
106
+ ],
90
107
  'status-pages:announcements:list': [
91
108
  { key: 'id' },
92
109
  { key: 'title', maxWidth: 40 },
@@ -106,6 +123,13 @@ export const COMMAND_COLUMNS = {
106
123
  { format: accessLevel, header: 'ACCESS', key: 'isPasswordSet' },
107
124
  ],
108
125
  'tags:list': [{ key: 'id' }, { key: 'name', maxWidth: 28 }],
126
+ 'third-party-providers:list': [
127
+ { key: 'id' },
128
+ { key: 'name', maxWidth: 28 },
129
+ { key: 'state' },
130
+ { header: 'TRACKED', key: 'isTracked' },
131
+ { header: 'STATUS PAGE', key: 'statusPageUrl', maxWidth: 40 },
132
+ ],
109
133
  'user:alert-contacts': ALERT_CONTACT_COLUMNS,
110
134
  'user:all-alert-contacts': [
111
135
  { header: 'USER ID', key: 'user.id' },