Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/commands/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function registerConfigCommands(program: Command): void {
);
}

function getNestedValue(obj: Record<string, unknown>, path: string): unknown {
function getNestedValue(obj: object, path: string): unknown {
const keys = path.split(".");
let current: unknown = obj;
for (const key of keys) {
Expand All @@ -75,9 +75,9 @@ function getNestedValue(obj: Record<string, unknown>, path: string): unknown {
return current;
}

function setNestedValue(obj: Record<string, unknown>, path: string, value: string): void {
function setNestedValue(obj: object, path: string, value: string): void {
const keys = path.split(".");
let current: Record<string, unknown> = obj;
let current: Record<string, unknown> = obj as Record<string, unknown>;
for (let i = 0; i < keys.length - 1; i++) {
const key = keys[i];
if (typeof current[key] !== "object" || current[key] === null) {
Expand Down
30 changes: 30 additions & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
export interface DeviceAuthResponse {
device_code: string;
user_code: string;
verification_uri: string;
verification_uri_complete?: string;
expires_in: number;
interval: number;
}

export interface TokenResponse {
access_token: string;
token_type?: string;
expires_in?: number;
refresh_token?: string;
}

export interface WaveConfig {
version: string;
currentProject: string;
projects: Record<string, {
organizationId: string;
organizationName: string;
baseUrl?: string;
region?: string;
}>;
defaults: { outputFormat: OutputFormat; protocol?: string; color: "auto" | "on" | "off" };
telemetry: { enabled: boolean; errorReporting: boolean };
}

export type OutputFormat = "table" | "json" | "yaml";
Loading