Skip to content
Draft
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
32 changes: 25 additions & 7 deletions src/m365/commands/version.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,37 @@
import { Logger } from '../../cli/Logger.js';
import { app } from '../../utils/app.js';
import AnonymousCommand from '../base/AnonymousCommand.js';
import commands from './commands.js';
import commands from '../commands.js';

Check failure on line 1 in src/m365/commands/version.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest, 22)

Cannot find module '../commands.js' or its corresponding type declarations.

Check failure on line 1 in src/m365/commands/version.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 22)

Cannot find module '../commands.js' or its corresponding type declarations.
import { Logger } from '../../../cli/Logger.js';

Check failure on line 2 in src/m365/commands/version.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest, 22)

Cannot find module '../../../cli/Logger.js' or its corresponding type declarations.

Check failure on line 2 in src/m365/commands/version.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 22)

Cannot find module '../../../cli/Logger.js' or its corresponding type declarations.
import Command, { CommandArgs, CommandOutput } from '../../Command.js';

Check failure on line 3 in src/m365/commands/version.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest, 22)

Module '"../../Command.js"' has no exported member 'CommandOutput'. Did you mean to use 'import CommandOutput from "../../Command.js"' instead?

Check failure on line 3 in src/m365/commands/version.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 22)

Module '"../../Command.js"' has no exported member 'CommandOutput'. Did you mean to use 'import CommandOutput from "../../Command.js"' instead?
import { z } from 'zod';
import { globalOptionsZod } from '../../Command.js';
import app from '../../../utils/app.js';

Check failure on line 6 in src/m365/commands/version.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest, 22)

Cannot find module '../../../utils/app.js' or its corresponding type declarations.

Check failure on line 6 in src/m365/commands/version.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 22)

Cannot find module '../../../utils/app.js' or its corresponding type declarations.

class VersionCommand extends AnonymousCommand {
/**
* Zod schema for the version command options.
* No additional options, just global options.
*/
export const options = globalOptionsZod.strict();
type Options = z.infer<typeof options>;

interface VersionCommandArgs extends CommandArgs {
options: Options;
}

class VersionCommand extends Command {
public get name(): string {
return commands.VERSION;
}

public get description(): string {
return 'Shows CLI for Microsoft 365 version';
return 'Shows CLI version';
}

public get schema(): z.ZodTypeAny | undefined {
return options;
}

public async commandAction(logger: Logger): Promise<void> {
public async commandAction(logger: Logger, args: VersionCommandArgs): Promise<CommandOutput> {
await logger.log(`v${app.packageJson().version}`);
return;
}
}

Expand Down
Loading