@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.
- package/LICENSE +201 -0
- package/README.md +179 -0
- package/bin/run.js +43 -0
- package/dist/api/client.js +95 -0
- package/dist/api/errors.js +26 -0
- package/dist/commands/alert-contacts/create.js +10 -0
- package/dist/commands/alert-contacts/delete.js +10 -0
- package/dist/commands/alert-contacts/get.js +10 -0
- package/dist/commands/alert-contacts/list.js +10 -0
- package/dist/commands/alert-contacts/update.js +10 -0
- package/dist/commands/auth/login.js +51 -0
- package/dist/commands/auth/logout.js +33 -0
- package/dist/commands/auth/status.js +38 -0
- package/dist/commands/auth/whoami.js +6 -0
- package/dist/commands/incidents/activity-log.js +10 -0
- package/dist/commands/incidents/alerts.js +10 -0
- package/dist/commands/incidents/comments/create.js +10 -0
- package/dist/commands/incidents/comments/delete.js +10 -0
- package/dist/commands/incidents/comments/list.js +10 -0
- package/dist/commands/incidents/comments/update.js +10 -0
- package/dist/commands/incidents/get.js +10 -0
- package/dist/commands/incidents/list.js +10 -0
- package/dist/commands/integrations/create.js +10 -0
- package/dist/commands/integrations/delete.js +10 -0
- package/dist/commands/integrations/get.js +10 -0
- package/dist/commands/integrations/list.js +10 -0
- package/dist/commands/integrations/update.js +10 -0
- package/dist/commands/maintenance-windows/create.js +10 -0
- package/dist/commands/maintenance-windows/delete.js +10 -0
- package/dist/commands/maintenance-windows/get.js +10 -0
- package/dist/commands/maintenance-windows/list.js +10 -0
- package/dist/commands/maintenance-windows/update.js +10 -0
- package/dist/commands/monitor-groups/create.js +10 -0
- package/dist/commands/monitor-groups/delete.js +10 -0
- package/dist/commands/monitor-groups/get.js +10 -0
- package/dist/commands/monitor-groups/list.js +10 -0
- package/dist/commands/monitor-groups/update.js +10 -0
- package/dist/commands/monitors/bulk/pause.js +10 -0
- package/dist/commands/monitors/bulk/start.js +10 -0
- package/dist/commands/monitors/bulk/update.js +10 -0
- package/dist/commands/monitors/create/api.js +10 -0
- package/dist/commands/monitors/create/dns.js +10 -0
- package/dist/commands/monitors/create/heartbeat.js +10 -0
- package/dist/commands/monitors/create/http.js +10 -0
- package/dist/commands/monitors/create/keyword.js +10 -0
- package/dist/commands/monitors/create/ping.js +10 -0
- package/dist/commands/monitors/create/port.js +10 -0
- package/dist/commands/monitors/create/udp.js +10 -0
- package/dist/commands/monitors/create/visual-comparison.js +10 -0
- package/dist/commands/monitors/delete.js +10 -0
- package/dist/commands/monitors/get.js +10 -0
- package/dist/commands/monitors/list.js +10 -0
- package/dist/commands/monitors/pause.js +10 -0
- package/dist/commands/monitors/reset.js +10 -0
- package/dist/commands/monitors/schema.js +57 -0
- package/dist/commands/monitors/start.js +10 -0
- package/dist/commands/monitors/stats/response-time/all.js +10 -0
- package/dist/commands/monitors/stats/response-time.js +10 -0
- package/dist/commands/monitors/stats/uptime.js +10 -0
- package/dist/commands/monitors/update.js +10 -0
- package/dist/commands/monitors/uptime-stats.js +10 -0
- package/dist/commands/status-pages/announcements/create.js +10 -0
- package/dist/commands/status-pages/announcements/get.js +10 -0
- package/dist/commands/status-pages/announcements/list.js +10 -0
- package/dist/commands/status-pages/announcements/pin.js +10 -0
- package/dist/commands/status-pages/announcements/unpin.js +10 -0
- package/dist/commands/status-pages/announcements/update.js +10 -0
- package/dist/commands/status-pages/create.js +10 -0
- package/dist/commands/status-pages/delete.js +10 -0
- package/dist/commands/status-pages/get.js +10 -0
- package/dist/commands/status-pages/list.js +10 -0
- package/dist/commands/status-pages/update.js +10 -0
- package/dist/commands/tags/delete.js +10 -0
- package/dist/commands/tags/list.js +10 -0
- package/dist/commands/user/alert-contacts.js +10 -0
- package/dist/commands/user/all-alert-contacts.js +10 -0
- package/dist/commands/user/get.js +5 -0
- package/dist/commands/user/me.js +10 -0
- package/dist/generated/operations.js +7631 -0
- package/dist/lib/auth.js +60 -0
- package/dist/lib/base-command.js +21 -0
- package/dist/lib/cli-errors.js +80 -0
- package/dist/lib/command-suggestions.js +44 -0
- package/dist/lib/credential-store.js +152 -0
- package/dist/lib/flag-name.js +11 -0
- package/dist/lib/invocation.js +74 -0
- package/dist/lib/objects.js +34 -0
- package/dist/lib/operation-command.js +486 -0
- package/dist/lib/operation-parser-error.js +28 -0
- package/dist/lib/request-curation.js +76 -0
- package/dist/lib/request-example.js +82 -0
- package/dist/lib/request-preview.js +25 -0
- package/dist/lib/request.js +301 -0
- package/dist/lib/sensitive-fields.js +19 -0
- package/dist/lib/types.js +1 -0
- package/dist/output/columns.js +221 -0
- package/dist/output/display-width.js +34 -0
- package/dist/output/normalize-result.js +28 -0
- package/dist/output/pagination-notice.js +27 -0
- package/dist/output/renderer.js +145 -0
- package/dist/output/request-progress.js +15 -0
- package/dist/output/resolve-format.js +32 -0
- package/dist/output/style.js +57 -0
- package/dist/runtime/parse-input.js +35 -0
- package/dist/runtime/types.js +1 -0
- package/dist/runtime/validate-input.js +63 -0
- package/openapi/openapi.yaml +9034 -0
- 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,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']);
|