first commit

This commit is contained in:
2025-10-26 23:10:15 +08:00
commit 8f0345b7be
14961 changed files with 2356381 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
export type AlphabetUppercase = 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z';
export type AlphabetLowercase = 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z';

2
node_modules/@oclif/core/lib/interfaces/alphabet.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

22
node_modules/@oclif/core/lib/interfaces/args.d.ts generated vendored Normal file
View File

@@ -0,0 +1,22 @@
import { ArgInput } from './parser';
/**
* Infer the args that are returned by Command.parse. This is useful for when you want to assign the args as a class property.
*
* @example
* export type StatusArgs = Interfaces.InferredArgs<typeof Status.args>
*
* export default class Status {
* static args = {
* force: Args.boolean({char: 'f', description: 'a flag'}),
* }
*
* public args!: StatusArgs
*
* public async run(): Promise<StatusArgs> {
* const result = await this.parse(Status)
* this.args = result.args
* return result.args
* }
* }
*/
export type InferredArgs<T> = T extends ArgInput<infer F> ? F : unknown;

2
node_modules/@oclif/core/lib/interfaces/args.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

139
node_modules/@oclif/core/lib/interfaces/config.d.ts generated vendored Normal file
View File

@@ -0,0 +1,139 @@
import { Command } from '../command';
import { Hook, Hooks } from './hooks';
import { OclifConfiguration, PJSON, S3Templates } from './pjson';
import { Options, Plugin } from './plugin';
import { Theme } from './theme';
import { Topic } from './topic';
export type LoadOptions = Config | Options | string | undefined;
export type PlatformTypes = 'wsl' | NodeJS.Platform;
export type ArchTypes = 'arm' | 'arm64' | 'mips' | 'mipsel' | 'ppc' | 'ppc64' | 's390' | 's390x' | 'x32' | 'x64' | 'x86';
export type PluginVersionDetail = {
root: string;
type: string;
version: string;
};
export type VersionDetails = {
architecture: string;
cliVersion: string;
nodeVersion: string;
osVersion?: string;
pluginVersions?: Record<string, PluginVersionDetail>;
rootPath?: string;
shell?: string;
};
export interface Config {
/**
* process.arch
*/
readonly arch: ArchTypes;
/**
* bin name of CLI command
*/
readonly bin: string;
/**
* name of any bin aliases that will execute the cli
*/
readonly binAliases?: string[] | undefined;
readonly binPath?: string | undefined;
/**
* cache directory to use for CLI
*
* example ~/Library/Caches/mycli or ~/.cache/mycli
*/
readonly cacheDir: string;
readonly channel: string;
readonly commandIDs: string[];
readonly commands: Command.Loadable[];
/**
* config directory to use for CLI
*
* example: ~/.config/mycli
*/
readonly configDir: string;
/**
* data directory to use for CLI
*
* example: ~/.local/share/mycli
*/
readonly dataDir: string;
/**
* base dirname to use in cacheDir/configDir/dataDir
*/
readonly dirname: string;
findCommand(id: string, opts: {
must: true;
}): Command.Loadable;
findCommand(id: string, opts?: {
must: boolean;
}): Command.Loadable | undefined;
findMatches(id: string, argv: string[]): Command.Loadable[];
findTopic(id: string, opts: {
must: true;
}): Topic;
findTopic(id: string, opts?: {
must: boolean;
}): Topic | undefined;
readonly flexibleTaxonomy?: boolean;
getAllCommandIDs(): string[];
getAllCommands(): Command.Loadable[];
getPluginsList(): Plugin[];
/**
* path to home directory
*
* example: /home/myuser
*/
readonly home: string;
readonly isSingleCommandCLI: boolean;
readonly name: string;
/**
* npm registry to use for installing plugins
*/
readonly npmRegistry?: string | undefined;
readonly nsisCustomization?: string | undefined;
readonly pjson: PJSON;
/**
* process.platform
*/
readonly platform: PlatformTypes;
readonly plugins: Map<string, Plugin>;
readonly root: string;
runCommand<T = unknown>(id: string, argv?: string[], cachedCommand?: Command.Loadable): Promise<T>;
runHook<T extends keyof Hooks>(event: T, opts: Hooks[T]['options'], timeout?: number, captureErrors?: boolean): Promise<Hook.Result<Hooks[T]['return']>>;
s3Key(type: 'unversioned' | 'versioned', ext: '.tar.gz' | '.tar.xz', options?: Config.s3Key.Options): string;
s3Key(type: keyof S3Templates, options?: Config.s3Key.Options): string;
s3Url(key: string): string;
scopedEnvVar(key: string): string | undefined;
scopedEnvVarKey(key: string): string;
scopedEnvVarKeys(key: string): string[];
scopedEnvVarTrue(key: string): boolean;
/**
* active shell
*/
readonly shell: string;
readonly theme?: Theme | undefined;
readonly topics: Topic[];
topicSeparator: ' ' | ':';
readonly updateConfig: NonNullable<OclifConfiguration['update']>;
/**
* user agent to use for http calls
*
* example: mycli/1.2.3 (darwin-x64) node-9.0.0
*/
readonly userAgent: string;
readonly valid: boolean;
readonly version: string;
readonly versionDetails: VersionDetails;
/**
* if windows
*/
readonly windows: boolean;
}
export declare namespace Config {
namespace s3Key {
interface Options {
[key: string]: any;
arch?: ArchTypes;
platform?: PlatformTypes;
}
}
}

2
node_modules/@oclif/core/lib/interfaces/config.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

27
node_modules/@oclif/core/lib/interfaces/errors.d.ts generated vendored Normal file
View File

@@ -0,0 +1,27 @@
export type CommandError = Error & {
exitCode?: number;
};
export interface OclifError {
oclif: {
exit?: number | undefined;
};
}
export interface PrettyPrintableError {
/**
* a unique error code for this error class
*/
code?: string | undefined;
/**
* message to display related to the error
*/
message?: string | undefined;
/**
* a url to find out more information related to this error
* or fixing the error
*/
ref?: string | undefined;
/**
* a suggestion that may be useful or provide additional context
*/
suggestions?: string[] | undefined;
}

2
node_modules/@oclif/core/lib/interfaces/errors.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

34
node_modules/@oclif/core/lib/interfaces/flags.d.ts generated vendored Normal file
View File

@@ -0,0 +1,34 @@
import { FlagInput } from './parser';
/**
* Infer the flags that are returned by Command.parse. This is useful for when you want to assign the flags as a class property.
*
* @example
* export type StatusFlags = Interfaces.InferredFlags<typeof Status.flags && typeof Status.baseFlags>
*
* export abstract class BaseCommand extends Command {
* static enableJsonFlag = true
*
* static flags = {
* config: Flags.string({
* description: 'specify config file',
* }),
* }
* }
*
* export default class Status extends BaseCommand {
* static flags = {
* force: Flags.boolean({char: 'f', description: 'a flag'}),
* }
*
* public flags!: StatusFlags
*
* public async run(): Promise<StatusFlags> {
* const result = await this.parse(Status)
* this.flags = result.flags
* return result.flags
* }
* }
*/
export type InferredFlags<T> = T extends FlagInput<infer F> ? F & {
json: boolean | undefined;
} : unknown;

2
node_modules/@oclif/core/lib/interfaces/flags.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

58
node_modules/@oclif/core/lib/interfaces/help.d.ts generated vendored Normal file
View File

@@ -0,0 +1,58 @@
export interface HelpOptions {
all?: boolean;
/**
* Use docopts as the usage. Defaults to true.
*/
docopts?: boolean;
/**
* Order in which to sort flags in help output. Defaults to `alphabetical`.
*
* `alphabetical`: Sort flags alphabetically. All flags with short characters will come first.
* `none`: Do not sort flags. They will appear in the order in which they were defined on the command.
*/
flagSortOrder?: 'alphabetical' | 'none';
/**
* If true, hide command aliases from the root help output. Defaults to false.
*/
hideAliasesFromRoot?: boolean;
/**
* By default, the command summary is show at the top of the help and as the first line in
* the command description. Repeating the summary in the command description improves readability
* especially for long command help output. If there is no `command.summary`, the first line of
* the description is treated as the summary. Some CLIs, especially with very simple commands, may
* not want the duplication.
*/
hideCommandSummaryInDescription?: boolean;
maxWidth: number;
/**
* Respect the `noCacheDefault` property on flags. Defaults to false.
*/
respectNoCacheDefault?: boolean;
/**
* Only show the help for the specified sections. Defaults to all sections.
*/
sections?: string[];
/**
* By default, the help output is sent to stdout. If this is true, it will be sent to stderr.
*/
sendToStderr?: boolean;
/**
* By default, titles show flag values as `<value>`. Some CLI developers may prefer titles
* to show the flag name as the value. i.e. `--myflag=myflag` instead of `--myflag=<value>`.
* An individual flag can set this using `flag.helpValue=flag.name`.
*/
showFlagNameInTitle?: boolean;
/**
* By default, option values on flags are shown in the flag's description. This is because
* long options list ruin the formatting of help. If a CLI knows all commands will not
* do this, it can be turned off at a help level using this property. An individual flag
* can set this using `flag.helpValue=options.join('|')`.
*/
showFlagOptionsInTitle?: boolean;
stripAnsi?: boolean;
/**
* Use USAGE, but some may want to use USAGE as used in gnu man pages. See help recommendations at
* http://www.gnu.org/software/help2man/#--help-recommendations
*/
usageHeader?: string;
}

2
node_modules/@oclif/core/lib/interfaces/help.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

185
node_modules/@oclif/core/lib/interfaces/hooks.d.ts generated vendored Normal file
View File

@@ -0,0 +1,185 @@
import { Command } from '../command';
import { Config } from './config';
import { Input, OutputFlags } from './parser';
import { Plugin } from './plugin';
interface HookMeta {
options: Record<string, unknown>;
return: any;
}
type Context = {
debug(...args: any[]): void;
error(message: Error | string, options?: {
code?: string;
exit?: number;
}): void;
exit(code?: number): void;
log(message?: any, ...args: any[]): void;
warn(message: string): void;
};
export interface Hooks {
[event: string]: HookMeta;
command_incomplete: {
options: {
argv: string[];
id: string;
matches: Command.Loadable[];
};
return: unknown;
};
command_not_found: {
options: {
argv?: string[];
id: string;
};
return: unknown;
};
finally: {
options: {
argv: string[];
id: string;
Command: Command.Loadable | undefined;
error: Error | undefined;
};
return: void;
};
init: {
options: {
argv: string[];
id: string | undefined;
};
return: void;
};
jit_plugin_not_installed: {
options: {
argv: string[];
command: Command.Loadable;
id: string;
pluginName: string;
pluginVersion: string;
};
return: unknown;
};
'plugins:preinstall': {
options: {
plugin: {
name: string;
tag: string;
type: 'npm';
} | {
type: 'repo';
url: string;
};
};
return: void;
};
postrun: {
options: {
Command: Command.Class;
argv: string[];
result?: any;
};
return: void;
};
preparse: {
options: {
argv: string[];
options: Input<OutputFlags<any>, OutputFlags<any>, OutputFlags<any>>;
};
return: string[];
};
prerun: {
options: {
Command: Command.Class;
argv: string[];
};
return: void;
};
preupdate: {
options: {
channel: string;
version: string;
};
return: void;
};
update: {
options: {
channel: string;
version: string;
};
return: void;
};
}
export type Hook<T extends keyof P, P extends Hooks = Hooks> = (this: Hook.Context, options: P[T]['options'] & {
config: Config;
context: Context;
}) => Promise<P[T]['return']>;
export declare namespace Hook {
/**
* Runs at the end of the CLI lifecycle - regardless of success or failure.
*/
type Finally = Hook<'finally'>;
/**
* Runs when the CLI is initialized before a command is executed.
*/
type Init = Hook<'init'>;
/**
* Runs before the `plugins install` command from @oclif/plugin-plugins is run.
*/
type PluginsPreinstall = Hook<'plugins:preinstall'>;
/**
* Runs after the `init` hook, after a command is found but before it is executed.
*/
type Prerun = Hook<'prerun'>;
/**
* Runs after a command is successfully executed. Does not run if the command fails.
*/
type Postrun = Hook<'postrun'>;
/**
* Runs before the CLI is updated by `update` command from @oclif/plugin-update.
*/
type Preupdate = Hook<'preupdate'>;
/**
* Runs before a command's flags and args are parsed. Useful for modifying the command line arguments before they are parsed.
*
* The return value is a string[] of the modified arguments.
*/
type Preparse = Hook<'preparse'>;
/**
* Runs once the `update` command from @oclif/plugin-update is run.
*/
type Update = Hook<'update'>;
/**
* Runs when a command is not found.
*/
type CommandNotFound = Hook<'command_not_found'>;
/**
* Runs when a partial command is entered and no matching command is found.
*/
type CommandIncomplete = Hook<'command_incomplete'>;
/**
* Runs when a command from an uninstalled JIT plugins is run.
*/
type JitPluginNotInstalled = Hook<'jit_plugin_not_installed'>;
interface Context {
config: Config;
debug(...args: any[]): void;
error(message: Error | string, options?: {
code?: string;
exit?: number;
}): void;
exit(code?: number): void;
log(message?: any, ...args: any[]): void;
warn(message: string): void;
}
interface Result<T> {
failures: Array<{
error: Error;
plugin: Plugin;
}>;
successes: Array<{
plugin: Plugin;
result: T;
}>;
}
}
export {};

2
node_modules/@oclif/core/lib/interfaces/hooks.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

16
node_modules/@oclif/core/lib/interfaces/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,16 @@
export type { AlphabetLowercase, AlphabetUppercase } from './alphabet';
export type { InferredArgs } from './args';
export type { ArchTypes, Config, LoadOptions, PlatformTypes, PluginVersionDetail, VersionDetails } from './config';
export type { CommandError, OclifError, PrettyPrintableError } from './errors';
export type { InferredFlags } from './flags';
export type { HelpOptions } from './help';
export type { Hook, Hooks } from './hooks';
export type { Logger } from './logger';
export type { Manifest } from './manifest';
export type { Arg, ArgDefinition, ArgInput, BooleanFlag, CustomOptions, Deprecation, Flag, FlagDefinition, FlagInput, Input, OptionFlag, OutputArgs, OutputFlags, ParserOutput, } from './parser';
export type { LinkedPlugin, OclifConfiguration, PJSON, S3, S3Templates, UserPJSON, UserPlugin } from './pjson';
export type { Options, Plugin, PluginOptions } from './plugin';
export type { S3Manifest } from './s3-manifest';
export type { Theme } from './theme';
export type { Topic } from './topic';
export type { TSConfig } from './ts-config';

2
node_modules/@oclif/core/lib/interfaces/index.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

9
node_modules/@oclif/core/lib/interfaces/logger.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
export type Logger = {
debug: (formatter: unknown, ...args: unknown[]) => void;
error: (formatter: unknown, ...args: unknown[]) => void;
info: (formatter: unknown, ...args: unknown[]) => void;
trace: (formatter: unknown, ...args: unknown[]) => void;
warn: (formatter: unknown, ...args: unknown[]) => void;
child: (namespace: string) => Logger;
namespace: string;
};

2
node_modules/@oclif/core/lib/interfaces/logger.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@@ -0,0 +1,7 @@
import { Command } from '../command';
export type Manifest = {
commands: {
[id: string]: Command.Cached;
};
version: string;
};

2
node_modules/@oclif/core/lib/interfaces/manifest.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

467
node_modules/@oclif/core/lib/interfaces/parser.d.ts generated vendored Normal file
View File

@@ -0,0 +1,467 @@
import { Command } from '../command';
import { AlphabetLowercase, AlphabetUppercase } from './alphabet';
export type FlagOutput = {
[name: string]: any;
};
export type ArgOutput = {
[name: string]: any;
};
export type CLIParseErrorOptions = {
parse: {
input?: ParserInput | undefined;
output?: ParserOutput | undefined;
};
exit?: number | undefined;
};
export type OutputArgs<T extends ParserInput['args']> = {
[P in keyof T]: any;
};
export type OutputFlags<T extends ParserInput['flags']> = {
[P in keyof T]: any;
};
export type ParserOutput<TFlags extends OutputFlags<any> = any, BFlags extends OutputFlags<any> = any, TArgs extends OutputFlags<any> = any> = {
flags: TFlags & BFlags & {
json: boolean | undefined;
};
args: TArgs;
argv: unknown[];
raw: ParsingToken[];
metadata: Metadata;
nonExistentFlags: string[];
};
export type ArgToken = {
type: 'arg';
arg: string;
input: string;
};
export type FlagToken = {
type: 'flag';
flag: string;
input: string;
};
export type ParsingToken = ArgToken | FlagToken;
export type FlagUsageOptions = {
displayRequired?: boolean;
};
export type Metadata = {
flags: {
[key: string]: MetadataFlag;
};
};
export type MetadataFlag = {
setFromDefault?: boolean;
defaultHelp?: unknown;
};
export type ListItem = [string, string | undefined];
export type List = ListItem[];
export type CustomOptions = Record<string, unknown>;
export type DefaultContext<T> = {
options: T;
flags: Record<string, string>;
};
/**
* Type to define a default value for a flag.
* @param context The context of the flag.
*/
export type FlagDefault<T, P = CustomOptions> = T | ((context: DefaultContext<P & OptionFlag<T, P>>) => Promise<T>);
/**
* Type to define a defaultHelp value for a flag.
* The defaultHelp value is used in the help output for the flag and when writing a manifest.
* It is also can be used to provide a value for the flag when issuing certain error messages.
*
* @param context The context of the flag.
*/
export type FlagDefaultHelp<T, P = CustomOptions> = T | ((context: DefaultContext<P & OptionFlag<T, P>>) => Promise<string | undefined>);
/**
* Type to define a default value for an arg.
* @param context The context of the arg.
*/
export type ArgDefault<T, P = CustomOptions> = T | ((context: DefaultContext<Arg<T, P>>) => Promise<T>);
/**
* Type to define a defaultHelp value for an arg.
* @param context The context of the arg.
*/
export type ArgDefaultHelp<T, P = CustomOptions> = T | ((context: DefaultContext<Arg<T, P>>) => Promise<string | undefined>);
export type FlagRelationship = string | {
name: string;
when: (flags: Record<string, unknown>) => Promise<boolean>;
};
export type Relationship = {
type: 'all' | 'some' | 'none' | 'only';
flags: FlagRelationship[];
};
export type Deprecation = {
to?: string;
message?: string;
version?: string | number;
};
export type FlagProps = {
name: string;
char?: AlphabetLowercase | AlphabetUppercase;
/**
* A short summary of flag usage to show in the flag list.
* If not provided, description will be used.
*/
summary?: string;
/**
* A description of flag usage. If summary is provided, the description
* is assumed to be a longer description and will be shown in a separate
* section within help.
*/
description?: string;
/**
* The flag label to show in help. Defaults to "[-<char>] --<name>" where -<char> is
* only displayed if the char is defined.
*/
helpLabel?: string;
/**
* Shows this flag in a separate list in the help.
*/
helpGroup?: string;
/**
* Accept an environment variable as input
*/
env?: string;
/**
* If true, the flag will not be shown in the help.
*/
hidden?: boolean;
/**
* If true, the flag will be required.
*/
required?: boolean;
/**
* List of flags that this flag depends on.
*/
dependsOn?: string[];
/**
* List of flags that cannot be used with this flag.
*/
exclusive?: string[];
/**
* List of the only flags that can be used with this flag.
*/
combinable?: string[];
/**
* Exactly one of these flags must be provided.
*/
exactlyOne?: string[];
/**
* Define complex relationships between flags.
*/
relationships?: Relationship[];
/**
* Make the flag as deprecated.
*/
deprecated?: true | Deprecation;
/**
* Alternate names that can be used for this flag.
*/
aliases?: string[];
/**
* Alternate short chars that can be used for this flag.
*/
charAliases?: (AlphabetLowercase | AlphabetUppercase)[];
/**
* Emit deprecation warning when a flag alias is provided
*/
deprecateAliases?: boolean;
/**
* If true, the value returned by defaultHelp will not be cached in the oclif.manifest.json.
* This is helpful if the default value contains sensitive data that shouldn't be published to npm.
*/
noCacheDefault?: boolean;
/**
* At least one of these flags must be provided.
*/
atLeastOne?: string[];
};
export type ArgProps = {
name: string;
/**
* A description of flag usage. If summary is provided, the description
* is assumed to be a longer description and will be shown in a separate
* section within help.
*/
description?: string;
/**
* If true, the flag will not be shown in the help.
*/
hidden?: boolean;
/**
* If true, the flag will be required.
*/
required?: boolean;
options?: string[];
ignoreStdin?: boolean;
/**
* If true, the value returned by defaultHelp will not be cached in the oclif.manifest.json.
* This is helpful if the default value contains sensitive data that shouldn't be published to npm.
*/
noCacheDefault?: boolean;
};
export type BooleanFlagProps = FlagProps & {
type: 'boolean';
allowNo: boolean;
};
export type OptionFlagProps = FlagProps & {
type: 'option';
helpValue?: string | string[];
options?: readonly string[];
multiple?: boolean;
/**
* Parse one value per flag; allow `-m val1 -m val2`, disallow `-m val1 val2`.
* Set to true to use "multiple: true" flags together with args.
* Only respected if multiple is set to true.
*/
multipleNonGreedy?: boolean;
/**
* Delimiter to separate the values for a multiple value flag.
* Only respected if multiple is set to true. Default behavior is to
* separate on spaces.
*/
delimiter?: ',';
/**
* Allow input value to be read from stdin if the provided value is `-`.
* If set to `only`, the flag will only accept input from stdin.
* Should only be used on one flag at a time.
*/
allowStdin?: boolean | 'only';
};
export type FlagParserContext = Command & {
token: FlagToken;
};
type NonNullableElementOf<T> = [NonNullable<T>] extends [Array<infer U>] ? U : T;
export type FlagParser<T, I extends string | boolean, P = CustomOptions> = (input: I, context: FlagParserContext, opts: P & OptionFlag<T, P>) => Promise<NonNullableElementOf<T> | undefined>;
export type ArgParserContext = Command & {
token: ArgToken;
};
export type ArgParser<T, P = CustomOptions> = (input: string, context: ArgParserContext, opts: P & Arg<T, P>) => Promise<T>;
export type Arg<T, P = CustomOptions> = ArgProps & {
options?: T[];
defaultHelp?: ArgDefaultHelp<T>;
input: string[];
default?: ArgDefault<T | undefined>;
parse: ArgParser<T, P>;
};
export type ArgDefinition<T, P = CustomOptions> = {
(options: P & ({
required: true;
} | {
default: ArgDefault<T>;
}) & Partial<Arg<T, P>>): Arg<T, P>;
(options?: P & Partial<Arg<T, P>>): Arg<T | undefined, P>;
};
export type BooleanFlag<T> = FlagProps & BooleanFlagProps & {
/**
* specifying a default of false is the same as not specifying a default
*/
default?: FlagDefault<boolean>;
parse: (input: boolean, context: FlagParserContext, opts: FlagProps & BooleanFlagProps) => Promise<T>;
};
export type OptionFlag<T, P = CustomOptions> = FlagProps & OptionFlagProps & {
parse: FlagParser<T | undefined, string, P>;
defaultHelp?: FlagDefaultHelp<T, P>;
input: string[];
default?: FlagDefault<T | undefined, P>;
};
type ReturnTypeSwitches = {
multiple: boolean;
requiredOrDefaulted: boolean;
};
/**
* The logic here is as follows:
* - If requiredOrDefaulted is true && multiple is true, then the return type is T[]
* - It's possible that T extends an Array, if so we want to return T so that the return isn't T[][]
* - If requiredOrDefaulted is true && multiple is false, then the return type is T
* - If requiredOrDefaulted is false && multiple is true, then the return type is T[] | undefined
* - It's possible that T extends an Array, if so we want to return T so that the return isn't T[][]
* - If requiredOrDefaulted is false && multiple is false, then the return type is T | undefined
*/
type FlagReturnType<T, R extends ReturnTypeSwitches> = R['requiredOrDefaulted'] extends true ? R['multiple'] extends true ? [T] extends [Array<unknown>] ? T : T[] : T : R['multiple'] extends true ? [T] extends [Array<unknown>] ? T | undefined : T[] | undefined : T | undefined;
/**
* FlagDefinition types a function that takes `options` and returns an OptionFlag<T>.
*
* This is returned by `Flags.custom()` and `Flags.option()`, which each take a `defaults` object
* that mirrors the OptionFlag interface.
*
* The `T` in the `OptionFlag<T>` return type is determined by a combination of the provided defaults for
* `multiple`, `required`, and `default` and the provided options for those same properties. If these properties
* are provided in the options, they override the defaults.
*
* no options or defaults -> T | undefined
* `required` -> T
* `default` -> T
* `multiple` -> T[] | undefined
* `required` + `multiple` -> T[]
* `default` + `multiple` -> T[]
*/
export type FlagDefinition<T, P = CustomOptions, R extends ReturnTypeSwitches = {
multiple: false;
requiredOrDefaulted: false;
}> = {
(options: P & {
multiple: false;
required: true;
} & Partial<OptionFlag<FlagReturnType<T, {
multiple: false;
requiredOrDefaulted: true;
}>, P>>): OptionFlag<FlagReturnType<T, {
multiple: false;
requiredOrDefaulted: true;
}>>;
(options: P & {
multiple: true;
required: false;
} & Partial<OptionFlag<FlagReturnType<T, {
multiple: true;
requiredOrDefaulted: false;
}>, P>>): OptionFlag<FlagReturnType<T, {
multiple: true;
requiredOrDefaulted: false;
}>>;
(options: P & {
multiple: false;
required: false;
} & Partial<OptionFlag<FlagReturnType<T, {
multiple: false;
requiredOrDefaulted: false;
}>, P>>): OptionFlag<FlagReturnType<T, {
multiple: false;
requiredOrDefaulted: false;
}>>;
(options: R['multiple'] extends true ? // `multiple` is defaulted to true and either `required=true` or `default` are provided in options
P & ({
required: true;
} | {
default: OptionFlag<FlagReturnType<T, {
multiple: R['multiple'];
requiredOrDefaulted: true;
}>, P>['default'];
}) & Partial<OptionFlag<FlagReturnType<T, {
multiple: R['multiple'];
requiredOrDefaulted: true;
}>, P>> : // `multiple` is NOT defaulted to true and either `required=true` or `default` are provided in options
P & {
multiple?: false | undefined;
} & ({
required: true;
} | {
default: OptionFlag<FlagReturnType<T, {
multiple: R['multiple'];
requiredOrDefaulted: true;
}>, P>['default'];
}) & Partial<OptionFlag<FlagReturnType<T, {
multiple: R['multiple'];
requiredOrDefaulted: true;
}>, P>>): OptionFlag<FlagReturnType<T, {
multiple: R['multiple'];
requiredOrDefaulted: true;
}>>;
(options: R['multiple'] extends true ? // `multiple` is defaulted to true and either `required=true` or `default` are provided in options
P & ({
required: true;
} | {
default: OptionFlag<FlagReturnType<T, {
multiple: true;
requiredOrDefaulted: true;
}>, P>['default'];
}) & Partial<OptionFlag<FlagReturnType<T, {
multiple: true;
requiredOrDefaulted: true;
}>, P>> : // `multiple` is NOT defaulted to true but `multiple=true` and either `required=true` or `default` are provided in options
P & {
multiple: true;
} & ({
required: true;
} | {
default: OptionFlag<FlagReturnType<T, {
multiple: true;
requiredOrDefaulted: true;
}>, P>['default'];
}) & Partial<OptionFlag<FlagReturnType<T, {
multiple: true;
requiredOrDefaulted: true;
}>, P>>): OptionFlag<FlagReturnType<T, {
multiple: true;
requiredOrDefaulted: true;
}>>;
(options: P & {
multiple?: false | undefined;
} & ({
required: true;
} | {
default: OptionFlag<FlagReturnType<T, {
multiple: R['multiple'];
requiredOrDefaulted: true;
}>, P>['default'];
}) & Partial<OptionFlag<FlagReturnType<T, {
multiple: R['multiple'];
requiredOrDefaulted: true;
}>, P>>): OptionFlag<FlagReturnType<T, {
multiple: R['multiple'];
requiredOrDefaulted: true;
}>>;
(options: P & {
required: false;
} & Partial<OptionFlag<FlagReturnType<T, {
multiple: R['multiple'];
requiredOrDefaulted: false;
}>, P>>): OptionFlag<FlagReturnType<T, {
multiple: R['multiple'];
requiredOrDefaulted: false;
}>>;
(options: P & {
multiple: false;
} & Partial<OptionFlag<FlagReturnType<T, {
multiple: false;
requiredOrDefaulted: R['requiredOrDefaulted'];
}>, P>>): OptionFlag<FlagReturnType<T, {
multiple: false;
requiredOrDefaulted: R['requiredOrDefaulted'];
}>>;
(options?: P & {
multiple?: false | undefined;
} & Partial<OptionFlag<FlagReturnType<T, R>, P>>): OptionFlag<FlagReturnType<T, R>>;
(options: P & {
multiple: true;
} & Partial<OptionFlag<FlagReturnType<T, {
multiple: true;
requiredOrDefaulted: R['requiredOrDefaulted'];
}>, P>>): OptionFlag<FlagReturnType<T, {
multiple: true;
requiredOrDefaulted: R['requiredOrDefaulted'];
}>>;
};
export type Flag<T> = BooleanFlag<T> | OptionFlag<T>;
export type Input<TFlags extends FlagOutput, BFlags extends FlagOutput, AFlags extends ArgOutput> = {
flags?: FlagInput<TFlags>;
baseFlags?: FlagInput<BFlags>;
enableJsonFlag?: true | false;
args?: ArgInput<AFlags>;
strict?: boolean | undefined;
context?: ParserContext;
'--'?: boolean;
};
export type ParserInput = {
argv: string[];
flags: FlagInput<any>;
args: ArgInput<any>;
strict: boolean;
context: ParserContext | undefined;
'--'?: boolean | undefined;
};
export type ParserContext = Command & {
token?: FlagToken | ArgToken | undefined;
};
export type FlagInput<T extends FlagOutput = {
[flag: string]: any;
}> = {
[P in keyof T]: Flag<T[P]>;
};
export type ArgInput<T extends ArgOutput = {
[arg: string]: any;
}> = {
[P in keyof T]: Arg<T[P]>;
};
export {};

2
node_modules/@oclif/core/lib/interfaces/parser.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

313
node_modules/@oclif/core/lib/interfaces/pjson.d.ts generated vendored Normal file
View File

@@ -0,0 +1,313 @@
import { HelpOptions } from './help';
import { Theme } from './theme';
export type CommandDiscovery = {
/**
* The strategy to use for loading commands.
*
* - `pattern` will use glob patterns to find command files in the specified `target`.
* - `explicit` will use `import` (or `require` for CJS) to load the commands from the
* specified `target`.
* - `single` will use the `target` which should export a command class. This is for CLIs that
* only have a single command.
*
* In both cases, the `oclif.manifest.json` file will be used to find the commands if it exists.
*/
strategy: 'pattern' | 'explicit' | 'single';
/**
* If the `strategy` is `pattern`, this is the **directory** to use to find command files.
*
* If the `strategy` is `explicit`, this is the **file** that exports the commands.
* - This export must be an object with keys that are the command names and values that are the command classes.
* - Unless `identifier` is specified, the default export will be used.
*
* @example
* ```typescript
* // in src/commands.ts
* import {Command} from '@oclif/core'
* import Hello from './commands/hello/index.js'
* import HelloWorld from './commands/hello/world.js'
*
* export default {
* hello: Hello,
* 'hello:world': HelloWorld,
* } satisfies Record<string, Command.Class>
* ```
*/
target: string;
/**
* The glob patterns to use to find command files when no `oclif.manifest.json` is present.
* This is only used when `strategy` is `pattern`.
*/
globPatterns?: string[];
/**
* The name of the export to used when loading the command object from the `target` file. Only
* used when `strategy` is `explicit`. Defaults to `default`.
*
* @example
* ```typescript
* // in src/commands.ts
* import {Command} from '@oclif/core'
* import Hello from './commands/hello/index.js'
* import HelloWorld from './commands/hello/world.js'
*
* export const MY_COMMANDS = {
* hello: Hello,
* 'hello:world': HelloWorld,
* } satisfies Record<string, Command.Class>
* ```
*
* In the package.json:
* ```json
* {
* "oclif": {
* "commands": {
* "strategy": "explicit",
* "target": "./dist/index.js",
* "identifier": "MY_COMMANDS"
* }
* }
* ```
*/
identifier?: string;
};
export type HookOptions = {
/**
* The file path containing hook.
*/
target: string;
/**
* The name of the export to use when loading the hook function from the `target` file. Defaults to `default`.
*/
identifier: string;
};
export type HelpLocationOptions = {
/**
* The file path containing help class.
*/
target: string;
/**
* The name of the export to use when loading the help class from the `target` file. Defaults to `default`.
*/
identifier: string;
};
export type S3Templates = {
baseDir?: string;
manifest?: string;
unversioned?: string;
versioned?: string;
};
export type S3 = {
acl?: string | undefined;
bucket?: string | undefined;
folder?: string | undefined;
gz?: boolean | undefined;
host?: string | undefined;
indexVersionLimit?: number | undefined;
templates?: {
target: S3Templates;
vanilla: S3Templates;
} | undefined;
xz?: boolean | undefined;
};
export type OclifConfiguration = {
/**
* Flags in addition to --help that should trigger help output.
*/
additionalHelpFlags?: string[];
/**
* Flags in addition to --version that should trigger version output.
*/
additionalVersionFlags?: string[];
/**
* Plugin aliases.
*/
aliases?: {
[name: string]: null | string;
};
/**
* The name of the executable.
*/
bin?: string;
/**
* Aliases for the executable.
*/
binAliases?: string[];
commands?: string | CommandDiscovery;
/**
* Your CLI's description. Overrides the description in the package.json.
*/
description?: string | undefined;
/**
* Plugins to load when in development mode.
*/
devPlugins?: string[];
/**
* The directory name to use when determining the cache, config, and data directories.
*/
dirname?: string;
/**
* Example plugin to use in @oclif/plugin-plugin's help output.
*/
examplePlugin?: string;
/**
* Customize the exit codes for the CLI.
*/
exitCodes?: {
default?: number;
failedFlagParsing?: number;
failedFlagValidation?: number;
invalidArgsSpec?: number;
nonExistentFlag?: number;
requiredArgs?: number;
unexpectedArgs?: number;
};
/**
* Enable flexible taxonomy for commands.
*/
flexibleTaxonomy?: boolean;
/**
* The location of your custom help class.
*/
helpClass?: string | HelpLocationOptions;
/**
* Options for the help output.
*/
helpOptions?: HelpOptions;
/**
* Register hooks to run at various points in the CLI lifecycle.
*/
hooks?: {
[name: string]: string | string[] | HookOptions | HookOptions[] | (string | HookOptions)[];
};
/**
* Plugins that can be installed just-in-time.
*/
jitPlugins?: Record<string, string>;
macos?: {
identifier?: string;
sign?: string;
};
/**
* Use a private or alternate npm registry.
*/
npmRegistry?: string;
/**
* Script to run during postinstall on windows.
*/
nsisCustomization?: string;
/**
* Plugin prefix to use when working with plugins with @oclif/plugin-plugins.
*
* Defaults to `plugin-`.
*/
pluginPrefix?: string;
/**
* Plugins to load.
*/
plugins?: string[];
/**
* Template string used to build links to source code in CLI's README (when using `oclif readme`).
*/
repositoryPrefix?: string;
schema?: number;
/**
* The namespace to be used for plugins of your CLI, e.g. `@salesforce`.
*/
scope?: string;
/**
* State of your CLI
*
* - `beta` - will show message to user that command or CLI is in beta
* - `deprecated` - will show message to user that command or CLI is deprecated
*/
state?: 'beta' | 'deprecated' | string;
/**
* The theme to ship with the CLI.
*
* Can be a path to a JSON file or a Theme object.
*/
theme?: string | Theme;
/**
* Separator to use for your CLI. Can be `:` or ` `.
*/
topicSeparator?: ' ' | ':';
/**
* Customize the topics in the CLI.
*/
topics?: {
[k: string]: {
description?: string;
hidden?: boolean;
subtopics?: OclifConfiguration['topics'];
};
};
/**
* Tar flags configuration for different platforms.
*
* {
* "tarFlags": {
* "win32": "--force-local",
* "darwin": "--no-xattrs"
* }
* }
*
*/
tarFlags?: {
[platform: string]: string;
};
update?: {
autoupdate?: {
debounce?: number;
rollout?: number;
};
disableNpmLookup?: boolean;
node?: {
targets?: string[];
version?: string;
options?: string | string[];
};
s3?: S3;
};
'warn-if-update-available'?: {
authorization?: string;
message?: string;
registry?: string;
timeoutInDays?: number;
frequency?: number;
frequencyUnit?: 'days' | 'hours' | 'minutes' | 'seconds' | 'milliseconds';
};
windows?: {
homepage?: string;
keypath?: string;
name?: string;
};
};
export type UserPlugin = {
name: string;
tag?: string;
type: 'user';
url?: string;
};
export type LinkedPlugin = {
name: string;
root: string;
type: 'link';
};
export type UserPJSON = {
oclif: {
plugins?: (UserPlugin | LinkedPlugin)[];
};
private?: boolean;
};
export type PJSON = {
[k: string]: any;
dependencies?: {
[name: string]: string;
};
devDependencies?: {
[name: string]: string;
};
name: string;
oclif: OclifConfiguration;
version: string;
};

2
node_modules/@oclif/core/lib/interfaces/pjson.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

104
node_modules/@oclif/core/lib/interfaces/plugin.d.ts generated vendored Normal file
View File

@@ -0,0 +1,104 @@
import { Command } from '../command';
import { Logger } from './logger';
import { HookOptions, PJSON } from './pjson';
import { Topic } from './topic';
export interface PluginOptions {
children?: Plugin[] | undefined;
errorOnManifestCreate?: boolean | undefined;
flexibleTaxonomy?: boolean | undefined;
ignoreManifest?: boolean | undefined;
isRoot?: boolean | undefined;
name?: string | undefined;
parent?: Plugin | undefined;
pjson?: PJSON | undefined;
respectNoCacheDefault?: boolean | undefined;
root: string;
tag?: string | undefined;
type?: string | undefined;
url?: string | undefined;
}
export interface Options extends PluginOptions {
channel?: string | undefined;
devPlugins?: boolean | undefined;
enablePerf?: boolean | undefined;
jitPlugins?: boolean | undefined;
logger?: Logger | undefined;
pjson?: PJSON | undefined;
pluginAdditions?: {
core?: string[];
dev?: string[];
path?: string;
} | undefined;
plugins?: Map<string, Plugin> | undefined;
userPlugins?: boolean | undefined;
version?: string | undefined;
}
export interface Plugin {
/**
* ../config version
*/
_base: string;
/**
* aliases from package.json dependencies
*/
alias: string;
readonly commandIDs: string[];
commands: Command.Loadable[];
readonly commandsDir: string | undefined;
findCommand(id: string, opts: {
must: true;
}): Promise<Command.Class>;
findCommand(id: string, opts?: {
must: boolean;
}): Promise<Command.Class> | undefined;
readonly hasManifest: boolean;
hooks: {
[key: string]: HookOptions[];
};
/**
* True if the plugin is the root plugin.
*/
isRoot: boolean;
load(): Promise<void>;
/**
* Plugin is written in ESM or CommonJS
*/
moduleType: 'commonjs' | 'module';
/**
* name from package.json
*/
name: string;
readonly options: Options;
parent?: Plugin | undefined;
/**
* full package.json
*
* parsed with read-pkg
*/
pjson: PJSON;
/**
* base path of plugin
*/
root: string;
/**
* npm dist-tag of plugin
* only used for user plugins
*/
tag?: string | undefined;
readonly topics: Topic[];
/**
* used to tell the user how the plugin was installed
* examples: core, link, user, dev
*/
type: string;
/**
* if it appears to be an npm package but does not look like it's really a CLI plugin, this is set to false
*/
valid: boolean;
/**
* version from package.json
*
* example: 1.2.3
*/
version: string;
}

2
node_modules/@oclif/core/lib/interfaces/plugin.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@@ -0,0 +1,14 @@
export interface S3Manifest {
baseDir: string;
gz: string;
node: {
compatible: string;
recommended: string;
};
rollout?: number;
sha: string;
sha256gz: string;
sha256xz?: string;
version: string;
xz?: string;
}

View File

@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

32
node_modules/@oclif/core/lib/interfaces/theme.d.ts generated vendored Normal file
View File

@@ -0,0 +1,32 @@
export declare const STANDARD_ANSI: readonly ["white", "black", "blue", "yellow", "green", "red", "magenta", "cyan", "gray", "blackBright", "redBright", "greenBright", "yellowBright", "blueBright", "magentaBright", "cyanBright", "whiteBright", "bgBlack", "bgRed", "bgGreen", "bgYellow", "bgBlue", "bgMagenta", "bgCyan", "bgWhite", "bgGray", "bgBlackBright", "bgRedBright", "bgGreenBright", "bgYellowBright", "bgBlueBright", "bgMagentaBright", "bgCyanBright", "bgWhiteBright", "bold", "underline", "dim", "italic", "strikethrough"];
export type StandardAnsi = (typeof STANDARD_ANSI)[number];
export type JsonTheme = {
brace?: string | StandardAnsi;
bracket?: string | StandardAnsi;
colon?: string | StandardAnsi;
comma?: string | StandardAnsi;
key?: string | StandardAnsi;
string?: string | StandardAnsi;
number?: string | StandardAnsi;
boolean?: string | StandardAnsi;
null?: string | StandardAnsi;
};
export type Theme = {
[key: string]: string | StandardAnsi | Theme | undefined;
alias?: string | StandardAnsi;
bin?: string | StandardAnsi;
command?: string | StandardAnsi;
commandSummary?: string | StandardAnsi;
dollarSign?: string | StandardAnsi;
flag?: string | StandardAnsi;
flagDefaultValue?: string | StandardAnsi;
flagOptions?: string | StandardAnsi;
flagRequired?: string | StandardAnsi;
flagSeparator?: string | StandardAnsi;
json?: JsonTheme;
sectionDescription?: string | StandardAnsi;
sectionHeader?: string | StandardAnsi;
spinner?: string | StandardAnsi;
topic?: string | StandardAnsi;
version?: string | StandardAnsi;
};

44
node_modules/@oclif/core/lib/interfaces/theme.js generated vendored Normal file
View File

@@ -0,0 +1,44 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.STANDARD_ANSI = void 0;
exports.STANDARD_ANSI = [
'white',
'black',
'blue',
'yellow',
'green',
'red',
'magenta',
'cyan',
'gray',
'blackBright',
'redBright',
'greenBright',
'yellowBright',
'blueBright',
'magentaBright',
'cyanBright',
'whiteBright',
'bgBlack',
'bgRed',
'bgGreen',
'bgYellow',
'bgBlue',
'bgMagenta',
'bgCyan',
'bgWhite',
'bgGray',
'bgBlackBright',
'bgRedBright',
'bgGreenBright',
'bgYellowBright',
'bgBlueBright',
'bgMagentaBright',
'bgCyanBright',
'bgWhiteBright',
'bold',
'underline',
'dim',
'italic',
'strikethrough',
];

5
node_modules/@oclif/core/lib/interfaces/topic.d.ts generated vendored Normal file
View File

@@ -0,0 +1,5 @@
export interface Topic {
description?: string | undefined;
hidden?: boolean | undefined;
name: string;
}

2
node_modules/@oclif/core/lib/interfaces/topic.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

23
node_modules/@oclif/core/lib/interfaces/ts-config.d.ts generated vendored Normal file
View File

@@ -0,0 +1,23 @@
export interface TSConfig {
compilerOptions: {
baseUrl?: string;
emitDecoratorMetadata?: boolean;
esModuleInterop?: boolean;
experimentalDecorators?: boolean;
jsx?: boolean;
module?: string;
moduleResolution?: string;
outDir?: string;
rootDir?: string;
rootDirs?: string[];
sourceMap?: boolean;
target?: string;
};
extends?: string;
'ts-node'?: {
esm?: boolean;
experimentalSpecifierResolution?: 'explicit' | 'node';
scope?: boolean;
swc?: boolean;
};
}

2
node_modules/@oclif/core/lib/interfaces/ts-config.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });