@griffin-app/griffin-cli 1.0.38 → 1.0.39

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 (53) hide show
  1. package/dist/cli.js +0 -0
  2. package/dist/commands/hub/runs.js +3 -2
  3. package/dist/commands/validate.js +2 -2
  4. package/dist/monitor-runner.js +9 -1
  5. package/package.json +3 -3
  6. package/dist/commands/apply.d.ts +0 -9
  7. package/dist/commands/apply.js +0 -76
  8. package/dist/commands/config.d.ts +0 -36
  9. package/dist/commands/config.js +0 -144
  10. package/dist/commands/configure-runner-host.d.ts +0 -2
  11. package/dist/commands/configure-runner-host.js +0 -41
  12. package/dist/commands/deploy.d.ts +0 -1
  13. package/dist/commands/deploy.js +0 -36
  14. package/dist/commands/execute-remote.d.ts +0 -1
  15. package/dist/commands/execute-remote.js +0 -33
  16. package/dist/commands/hub/config.d.ts +0 -27
  17. package/dist/commands/hub/config.js +0 -102
  18. package/dist/commands/hub/plan.d.ts +0 -8
  19. package/dist/commands/hub/plan.js +0 -75
  20. package/dist/commands/local/config.d.ts +0 -28
  21. package/dist/commands/local/config.js +0 -82
  22. package/dist/commands/logs.d.ts +0 -1
  23. package/dist/commands/logs.js +0 -20
  24. package/dist/commands/plan.d.ts +0 -8
  25. package/dist/commands/plan.js +0 -58
  26. package/dist/commands/run-remote.d.ts +0 -11
  27. package/dist/commands/run-remote.js +0 -98
  28. package/dist/commands/run.d.ts +0 -4
  29. package/dist/commands/run.js +0 -86
  30. package/dist/commands/runner.d.ts +0 -12
  31. package/dist/commands/runner.js +0 -53
  32. package/dist/commands/status.d.ts +0 -8
  33. package/dist/commands/status.js +0 -75
  34. package/dist/core/plan-diff.d.ts +0 -41
  35. package/dist/core/plan-diff.js +0 -257
  36. package/dist/output/context.d.ts +0 -18
  37. package/dist/output/context.js +0 -22
  38. package/dist/output/index.d.ts +0 -3
  39. package/dist/output/index.js +0 -2
  40. package/dist/output/renderer.d.ts +0 -6
  41. package/dist/output/renderer.js +0 -348
  42. package/dist/output/types.d.ts +0 -153
  43. package/dist/output/types.js +0 -1
  44. package/dist/providers/registry.d.ts +0 -24
  45. package/dist/providers/registry.js +0 -109
  46. package/dist/schemas/payload.d.ts +0 -6
  47. package/dist/schemas/payload.js +0 -8
  48. package/dist/test-discovery.d.ts +0 -4
  49. package/dist/test-discovery.js +0 -25
  50. package/dist/test-runner.d.ts +0 -6
  51. package/dist/test-runner.js +0 -56
  52. package/dist/utils/console.d.ts +0 -5
  53. package/dist/utils/console.js +0 -5
package/dist/cli.js CHANGED
File without changes
@@ -42,15 +42,16 @@ export const executeRuns = createCommandHandler("runs", async (options, output)
42
42
  });
43
43
  output.blank();
44
44
  const table = output.table({
45
- head: ["Status", "Monitor", "Duration", "Started"],
45
+ head: ["Status", "Monitor", "Duration", "Location", "Started"],
46
46
  });
47
47
  for (const run of runsData.data) {
48
48
  const statusIcon = getStatusIcon(run.status, run.success);
49
49
  const duration = run.duration_ms
50
50
  ? `${(run.duration_ms / 1000).toFixed(2)}s`
51
51
  : "-";
52
+ const location = run.location ?? "-";
52
53
  const started = new Date(run.startedAt).toLocaleString();
53
- table.push([statusIcon, run.monitor?.name ?? "-", duration, started]);
54
+ table.push([statusIcon, run.monitor?.name ?? "-", duration, location, started]);
54
55
  }
55
56
  output.log(table.toString());
56
57
  const runsWithErrors = runsData.data.filter((run) => Array.isArray(run.errors) && run.errors.length > 0);
@@ -1,4 +1,4 @@
1
- import { loadState } from "../core/state.js";
1
+ import { loadState, stateExists } from "../core/state.js";
2
2
  import { createCommandHandler } from "../utils/command-wrapper.js";
3
3
  import { OutputError } from "../utils/output.js";
4
4
  import { discoverLocalMonitors, filterDiscoveredByName, monitorNotFoundData, } from "../core/monitor-helpers.js";
@@ -6,7 +6,7 @@ import { discoverLocalMonitors, filterDiscoveredByName, monitorNotFoundData, } f
6
6
  * Validate test monitor files without syncing
7
7
  */
8
8
  export const executeValidate = createCommandHandler("validate", async (options, output) => {
9
- const state = await loadState();
9
+ const state = (await stateExists()) ? await loadState() : undefined;
10
10
  const { monitors } = await discoverLocalMonitors(state);
11
11
  let toValidate = monitors;
12
12
  if (options.monitor) {
@@ -52,7 +52,15 @@ export async function runTestFile(filePath, envName) {
52
52
  }
53
53
  let rawMonitor;
54
54
  try {
55
- rawMonitor = validateDsl(defaultExport.default);
55
+ // Handle potential double-wrapping from ESM/CJS interop
56
+ let monitor = defaultExport.default;
57
+ if (typeof monitor === "object" &&
58
+ monitor !== null &&
59
+ "default" in monitor &&
60
+ typeof monitor.default === "object") {
61
+ monitor = monitor.default;
62
+ }
63
+ rawMonitor = validateDsl(monitor);
56
64
  }
57
65
  catch (cause) {
58
66
  throw new MonitorRunnerError("validate", messageFromCause(cause), cause);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@griffin-app/griffin-cli",
3
- "version": "1.0.38",
3
+ "version": "1.0.39",
4
4
  "description": "CLI tool for running and managing griffin API tests",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -24,8 +24,8 @@
24
24
  "author": "",
25
25
  "license": "MIT",
26
26
  "dependencies": {
27
- "@griffin-app/griffin-core": "0.3.4",
28
- "@griffin-app/griffin-executor": "0.2.2",
27
+ "@griffin-app/griffin-core": "0.3.1",
28
+ "@griffin-app/griffin-executor": "0.2.1",
29
29
  "@griffin-app/griffin-hub-sdk": "1.0.31",
30
30
  "better-auth": "^1.4.17",
31
31
  "cli-table3": "^0.6.5",
@@ -1,9 +0,0 @@
1
- export interface ApplyOptions {
2
- autoApprove?: boolean;
3
- dryRun?: boolean;
4
- env?: string;
5
- }
6
- /**
7
- * Apply changes to the runner
8
- */
9
- export declare function executeApply(options: ApplyOptions): Promise<void>;
@@ -1,76 +0,0 @@
1
- import { loadState, resolveEnvironment } from "../core/state.js";
2
- import { discoverMonitors, formatDiscoveryErrors } from "../core/discovery.js";
3
- import { computeDiff, formatDiff } from "../core/diff.js";
4
- import { applyDiff, formatApplyResult } from "../core/apply.js";
5
- import { createSdkClients } from "../core/sdk.js";
6
- /**
7
- * Apply changes to the runner
8
- */
9
- export async function executeApply(options) {
10
- try {
11
- // Load state
12
- const state = await loadState();
13
- // Resolve environment
14
- const envName = await resolveEnvironment(options.env);
15
- // Check if runner is configured
16
- if (!state.runner?.baseUrl) {
17
- console.error("Error: Runner URL not configured.");
18
- console.log("Configure with:");
19
- console.log(" griffin runner set --base-url <url> --api-token <token>");
20
- process.exit(1);
21
- }
22
- console.log(`Applying to '${envName}' environment`);
23
- console.log("");
24
- // Create SDK clients
25
- const { planApi } = createSdkClients({
26
- baseUrl: state.runner.baseUrl,
27
- apiToken: state.runner.apiToken || undefined,
28
- });
29
- // Discover local monitors
30
- const discoveryPattern = state.discovery?.pattern || "**/__griffin__/*.{ts,js}";
31
- const discoveryIgnore = state.discovery?.ignore || [
32
- "node_modules/**",
33
- "dist/**",
34
- ];
35
- const { monitors, errors } = await discoverMonitors(discoveryPattern, discoveryIgnore);
36
- if (errors.length > 0) {
37
- console.error(formatDiscoveryErrors(errors));
38
- process.exit(1);
39
- }
40
- // Fetch remote monitors for this project
41
- const response = await planApi.planGet(state.projectId);
42
- const remoteMonitors = response.data.data.map((p) => p);
43
- // Compute diff for this environment
44
- const diff = computeDiff(monitors.map((p) => p.monitor), state, remoteMonitors, envName);
45
- // Show monitor
46
- console.log(formatDiff(diff));
47
- console.log("");
48
- // Check if there are changes
49
- if (diff.summary.creates + diff.summary.updates + diff.summary.deletes ===
50
- 0) {
51
- console.log("No changes to apply.");
52
- return;
53
- }
54
- // Ask for confirmation unless auto-approved
55
- if (!options.autoApprove && !options.dryRun) {
56
- console.log("Do you want to perform these actions? (yes/no)");
57
- // For now, just proceed - in a real implementation, we'd use readline
58
- // to get user input
59
- console.log("Note: Use --auto-approve flag to skip confirmation");
60
- console.log("");
61
- }
62
- // Apply changes
63
- const result = await applyDiff(diff, state, planApi, envName, {
64
- dryRun: options.dryRun,
65
- });
66
- console.log("");
67
- console.log(formatApplyResult(result));
68
- if (!result.success) {
69
- process.exit(1);
70
- }
71
- }
72
- catch (error) {
73
- console.error(`Error: ${error.message}`);
74
- process.exit(1);
75
- }
76
- }
@@ -1,36 +0,0 @@
1
- export interface ConfigSetOptions {
2
- organizationId: string;
3
- environment: string;
4
- targetKey: string;
5
- baseUrl: string;
6
- }
7
- /**
8
- * Set a target for an organization and environment
9
- */
10
- export declare function executeConfigSet(options: ConfigSetOptions): Promise<void>;
11
- export interface ConfigGetOptions {
12
- organizationId: string;
13
- environment: string;
14
- targetKey: string;
15
- }
16
- /**
17
- * Get a target for an organization and environment
18
- */
19
- export declare function executeConfigGet(options: ConfigGetOptions): Promise<void>;
20
- export interface ConfigListOptions {
21
- organizationId?: string;
22
- environment?: string;
23
- }
24
- /**
25
- * List all runner configs
26
- */
27
- export declare function executeConfigList(options: ConfigListOptions): Promise<void>;
28
- export interface ConfigDeleteOptions {
29
- organizationId: string;
30
- environment: string;
31
- targetKey: string;
32
- }
33
- /**
34
- * Delete a target from an organization and environment
35
- */
36
- export declare function executeConfigDelete(options: ConfigDeleteOptions): Promise<void>;
@@ -1,144 +0,0 @@
1
- import { loadState } from "../core/state.js";
2
- import { createSdkClients } from "../core/sdk.js";
3
- /**
4
- * Set a target for an organization and environment
5
- */
6
- export async function executeConfigSet(options) {
7
- try {
8
- const state = await loadState();
9
- if (!state.runner?.baseUrl) {
10
- console.error("Error: Runner URL not configured.");
11
- console.log("Configure with:");
12
- console.log(" griffin runner set --base-url <url> --api-token <token>");
13
- process.exit(1);
14
- }
15
- const { configApi } = createSdkClients({
16
- baseUrl: state.runner.baseUrl,
17
- apiToken: state.runner.apiToken,
18
- });
19
- const result = await configApi.configOrganizationIdEnvironmentTargetsTargetKeyPut(options.organizationId, options.environment, options.targetKey, {
20
- baseUrl: options.baseUrl,
21
- });
22
- //.setTarget(options.organizationId, options.environment, options.targetKey, options.baseUrl);
23
- //const result = await runnerRequest<{ data: RunnerConfig }>(
24
- // state.runner.baseUrl,
25
- // state.runner.apiToken,
26
- // path,
27
- // {
28
- // method: "PUT",
29
- // body: JSON.stringify({ baseUrl: options.baseUrl }),
30
- // },
31
- //);
32
- console.log(`✓ Target "${options.targetKey}" set to ${options.baseUrl}`);
33
- console.log(` Organization: ${options.organizationId}`);
34
- console.log(` Environment: ${options.environment}`);
35
- console.log(` Updated at: ${new Date(result.data.data.updatedAt).toLocaleString()}`);
36
- }
37
- catch (error) {
38
- console.error(`Error: ${error.message}`);
39
- process.exit(1);
40
- }
41
- }
42
- /**
43
- * Get a target for an organization and environment
44
- */
45
- export async function executeConfigGet(options) {
46
- try {
47
- const state = await loadState();
48
- if (!state.runner?.baseUrl) {
49
- console.error("Error: Runner URL not configured.");
50
- console.log("Configure with:");
51
- console.log(" griffin runner set --base-url <url> --api-token <token>");
52
- process.exit(1);
53
- }
54
- const { configApi } = createSdkClients({
55
- baseUrl: state.runner.baseUrl,
56
- apiToken: state.runner.apiToken,
57
- });
58
- const result = await configApi.configOrganizationIdEnvironmentTargetsTargetKeyGet(options.organizationId, options.environment, options.targetKey);
59
- console.log(`Target: ${options.targetKey}`);
60
- console.log(`Base URL: ${result.data.data.baseUrl}`);
61
- console.log(`Organization: ${options.organizationId}`);
62
- console.log(`Environment: ${options.environment}`);
63
- }
64
- catch (error) {
65
- console.error(`Error: ${error.message}`);
66
- process.exit(1);
67
- }
68
- }
69
- /**
70
- * List all runner configs
71
- */
72
- export async function executeConfigList(options) {
73
- try {
74
- const state = await loadState();
75
- if (!state.runner?.baseUrl) {
76
- console.error("Error: Runner URL not configured.");
77
- console.log("Configure with:");
78
- console.log(" griffin runner set --base-url <url> --api-token <token>");
79
- process.exit(1);
80
- }
81
- const params = new URLSearchParams();
82
- if (options.organizationId)
83
- params.append("organizationId", options.organizationId);
84
- if (options.environment)
85
- params.append("environment", options.environment);
86
- const { configApi } = createSdkClients({
87
- baseUrl: state.runner.baseUrl,
88
- apiToken: state.runner.apiToken,
89
- });
90
- const result = await configApi.configGet(options.organizationId, options.environment);
91
- if (result.data.data.length === 0 || !result.data.data) {
92
- console.log("No runner configs found.");
93
- return;
94
- }
95
- console.log(`Found ${result.data.data.length} runner config(s):`);
96
- console.log("");
97
- for (const config of result.data.data) {
98
- console.log(`Organization: ${config.organizationId}`);
99
- console.log(`Environment: ${config.environment}`);
100
- console.log(`Targets:`);
101
- const targetCount = Object.keys(config.targets).length;
102
- if (targetCount === 0) {
103
- console.log(" (none)");
104
- }
105
- else {
106
- for (const [key, baseUrl] of Object.entries(config.targets)) {
107
- console.log(` ${key}: ${baseUrl}`);
108
- }
109
- }
110
- console.log(`Updated: ${new Date(config.updatedAt).toLocaleString()}`);
111
- console.log("");
112
- }
113
- }
114
- catch (error) {
115
- console.error(`Error: ${error.message}`);
116
- process.exit(1);
117
- }
118
- }
119
- /**
120
- * Delete a target from an organization and environment
121
- */
122
- export async function executeConfigDelete(options) {
123
- try {
124
- const state = await loadState();
125
- if (!state.runner?.baseUrl) {
126
- console.error("Error: Runner URL not configured.");
127
- console.log("Configure with:");
128
- console.log(" griffin runner set --base-url <url> --api-token <token>");
129
- process.exit(1);
130
- }
131
- const { configApi } = createSdkClients({
132
- baseUrl: state.runner.baseUrl,
133
- apiToken: state.runner.apiToken,
134
- });
135
- await configApi.configOrganizationIdEnvironmentTargetsTargetKeyDelete(options.organizationId, options.environment, options.targetKey);
136
- console.log(`✓ Target "${options.targetKey}" deleted`);
137
- console.log(` Organization: ${options.organizationId}`);
138
- console.log(` Environment: ${options.environment}`);
139
- }
140
- catch (error) {
141
- console.error(`Error: ${error.message}`);
142
- process.exit(1);
143
- }
144
- }
@@ -1,2 +0,0 @@
1
- export declare function executeConfigureRunnerHost(host: string): Promise<void>;
2
- export declare function getRunnerHost(): string | null;
@@ -1,41 +0,0 @@
1
- import * as fs from "fs";
2
- import * as path from "path";
3
- import * as os from "os";
4
- const CONFIG_DIR = path.join(os.homedir(), ".griffin");
5
- const CONFIG_FILE = path.join(CONFIG_DIR, "config.json");
6
- export async function executeConfigureRunnerHost(host) {
7
- console.log(`Configuring runner host: ${host}`);
8
- // Ensure config directory exists
9
- if (!fs.existsSync(CONFIG_DIR)) {
10
- fs.mkdirSync(CONFIG_DIR, { recursive: true });
11
- }
12
- // Read existing config or create new one
13
- let config = {};
14
- if (fs.existsSync(CONFIG_FILE)) {
15
- try {
16
- const configData = fs.readFileSync(CONFIG_FILE, "utf-8");
17
- config = JSON.parse(configData);
18
- }
19
- catch (error) {
20
- console.warn("Warning: Could not read existing config, creating new one");
21
- }
22
- }
23
- // Update runner host
24
- config.runnerHost = host;
25
- // Write config
26
- fs.writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2));
27
- console.log(`Configuration saved to ${CONFIG_FILE}`);
28
- }
29
- export function getRunnerHost() {
30
- if (!fs.existsSync(CONFIG_FILE)) {
31
- return null;
32
- }
33
- try {
34
- const configData = fs.readFileSync(CONFIG_FILE, "utf-8");
35
- const config = JSON.parse(configData);
36
- return config.runnerHost || null;
37
- }
38
- catch {
39
- return null;
40
- }
41
- }
@@ -1 +0,0 @@
1
- export declare function executeDeploy(): Promise<void>;
@@ -1,36 +0,0 @@
1
- import { findTestFiles } from "../test-discovery";
2
- import { getRunnerHost } from "./configure-runner-host";
3
- import * as path from "path";
4
- import * as fs from "fs";
5
- export async function executeDeploy() {
6
- const runnerHost = getRunnerHost();
7
- if (!runnerHost) {
8
- console.error("ERROR: No runner host configured. Run: griffin configure-runner-host <host>");
9
- process.exit(1);
10
- }
11
- console.log("Deploying tests to runner...");
12
- const testFiles = findTestFiles();
13
- const workspaceRoot = findWorkspaceRoot();
14
- const testSystemPath = path.join(workspaceRoot, "griffin-ts", "dist");
15
- if (!fs.existsSync(testSystemPath)) {
16
- throw new Error("Test system not built. Please run: cd griffin-ts && npm install && npm run build");
17
- }
18
- // TODO: Implement deployment logic
19
- // - Read each test file
20
- // - Execute it to get JSON monitor
21
- // - Send to runner API
22
- // - Handle responses
23
- console.log("Deployed.");
24
- }
25
- function findWorkspaceRoot() {
26
- let current = process.cwd();
27
- while (current !== path.dirname(current)) {
28
- const griffinCliPath = path.join(current, "griffin-cli");
29
- const testSystemPath = path.join(current, "griffin-ts");
30
- if (fs.existsSync(griffinCliPath) && fs.existsSync(testSystemPath)) {
31
- return current;
32
- }
33
- current = path.dirname(current);
34
- }
35
- return process.cwd();
36
- }
@@ -1 +0,0 @@
1
- export declare function executeExecuteRemote(checkName: string): Promise<void>;
@@ -1,33 +0,0 @@
1
- import { getRunnerHost } from "./configure-runner-host";
2
- const axios = require("axios");
3
- import * as readline from "readline";
4
- export async function executeExecuteRemote(checkName) {
5
- const runnerHost = getRunnerHost();
6
- if (!runnerHost) {
7
- console.error("ERROR: No runner host configured. Run: griffin configure-runner-host <host>");
8
- process.exit(1);
9
- }
10
- console.log("WARNING: Your local checks will be deployed and executed remotely.");
11
- console.log("Do you want to continue? (y/n)");
12
- const rl = readline.createInterface({
13
- input: process.stdin,
14
- output: process.stdout,
15
- });
16
- rl.question("", async (answer) => {
17
- rl.close();
18
- if (answer.toLowerCase() !== "y" && answer.toLowerCase() !== "yes") {
19
- console.log("Cancelled.");
20
- process.exit(0);
21
- }
22
- try {
23
- // TODO: Implement remote execution
24
- const response = await axios.post(`${runnerHost}/api/tests/${checkName}/execute`);
25
- console.log(JSON.stringify(response.data, null, 2));
26
- }
27
- catch (error) {
28
- console.error("ERROR: Failed to execute remotely");
29
- console.error(error.message || String(error));
30
- process.exit(1);
31
- }
32
- });
33
- }
@@ -1,27 +0,0 @@
1
- export interface ConfigAddTargetOptions {
2
- org: string;
3
- env: string;
4
- key: string;
5
- url: string;
6
- }
7
- export interface ConfigRemoveTargetOptions {
8
- org: string;
9
- env: string;
10
- key: string;
11
- }
12
- export interface ConfigListOptions {
13
- org?: string;
14
- env?: string;
15
- }
16
- /**
17
- * Add a target to hub configuration
18
- */
19
- export declare function executeConfigAddTarget(options: ConfigAddTargetOptions): Promise<void>;
20
- /**
21
- * Remove a target from hub configuration
22
- */
23
- export declare function executeConfigRemoveTarget(options: ConfigRemoveTargetOptions): Promise<void>;
24
- /**
25
- * List all hub configurations
26
- */
27
- export declare function executeConfigList(options: ConfigListOptions): Promise<void>;
@@ -1,102 +0,0 @@
1
- import { loadState } from "../../core/state.js";
2
- import { createSdkClients } from "../../core/sdk.js";
3
- /**
4
- * Add a target to hub configuration
5
- */
6
- export async function executeConfigAddTarget(options) {
7
- try {
8
- const state = await loadState();
9
- if (!state.runner?.baseUrl) {
10
- console.error("Error: Hub connection not configured.");
11
- console.log("Connect with:");
12
- console.log(" griffin hub connect --url <url> --token <token>");
13
- process.exit(1);
14
- }
15
- const { configApi } = createSdkClients({
16
- baseUrl: state.runner.baseUrl,
17
- apiToken: state.runner.apiToken,
18
- });
19
- const result = await configApi.configOrganizationIdEnvironmentTargetsTargetKeyPut(options.org, options.env, options.key, {
20
- baseUrl: options.url,
21
- });
22
- console.log(`✓ Target "${options.key}" set to ${options.url}`);
23
- console.log(` Organization: ${options.org}`);
24
- console.log(` Environment: ${options.env}`);
25
- console.log(` Updated at: ${new Date(result.data.data.updatedAt).toLocaleString()}`);
26
- }
27
- catch (error) {
28
- console.error(`Error: ${error.message}`);
29
- process.exit(1);
30
- }
31
- }
32
- /**
33
- * Remove a target from hub configuration
34
- */
35
- export async function executeConfigRemoveTarget(options) {
36
- try {
37
- const state = await loadState();
38
- if (!state.runner?.baseUrl) {
39
- console.error("Error: Hub connection not configured.");
40
- console.log("Connect with:");
41
- console.log(" griffin hub connect --url <url> --token <token>");
42
- process.exit(1);
43
- }
44
- const { configApi } = createSdkClients({
45
- baseUrl: state.runner.baseUrl,
46
- apiToken: state.runner.apiToken,
47
- });
48
- await configApi.configOrganizationIdEnvironmentTargetsTargetKeyDelete(options.org, options.env, options.key);
49
- console.log(`✓ Target "${options.key}" deleted`);
50
- console.log(` Organization: ${options.org}`);
51
- console.log(` Environment: ${options.env}`);
52
- }
53
- catch (error) {
54
- console.error(`Error: ${error.message}`);
55
- process.exit(1);
56
- }
57
- }
58
- /**
59
- * List all hub configurations
60
- */
61
- export async function executeConfigList(options) {
62
- try {
63
- const state = await loadState();
64
- if (!state.runner?.baseUrl) {
65
- console.error("Error: Hub connection not configured.");
66
- console.log("Connect with:");
67
- console.log(" griffin hub connect --url <url> --token <token>");
68
- process.exit(1);
69
- }
70
- const { configApi } = createSdkClients({
71
- baseUrl: state.runner.baseUrl,
72
- apiToken: state.runner.apiToken,
73
- });
74
- const result = await configApi.configGet(options.org, options.env);
75
- if (result.data.data.length === 0 || !result.data.data) {
76
- console.log("No hub configurations found.");
77
- return;
78
- }
79
- console.log(`Found ${result.data.data.length} configuration(s):`);
80
- console.log("");
81
- for (const config of result.data.data) {
82
- console.log(`Organization: ${config.organizationId}`);
83
- console.log(`Environment: ${config.environment}`);
84
- console.log(`Targets:`);
85
- const targetCount = Object.keys(config.targets).length;
86
- if (targetCount === 0) {
87
- console.log(" (none)");
88
- }
89
- else {
90
- for (const [key, baseUrl] of Object.entries(config.targets)) {
91
- console.log(` ${key}: ${baseUrl}`);
92
- }
93
- }
94
- console.log(`Updated: ${new Date(config.updatedAt).toLocaleString()}`);
95
- console.log("");
96
- }
97
- }
98
- catch (error) {
99
- console.error(`Error: ${error.message}`);
100
- process.exit(1);
101
- }
102
- }
@@ -1,8 +0,0 @@
1
- export interface MonitorOptions {
2
- json?: boolean;
3
- env?: string;
4
- }
5
- /**
6
- * Show what changes would be applied
7
- */
8
- export declare function executeMonitor(options: MonitorOptions): Promise<void>;