@dereekb/dbx-cli 13.11.1 → 13.11.3
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/firebase-api-manifest/main.js +142 -25
- package/firebase-api-manifest/package.json +1 -1
- package/index.cjs.js +202 -26
- package/index.esm.js +201 -27
- package/manifest-extract/LICENSE +21 -0
- package/manifest-extract/index.cjs.default.js +1 -0
- package/manifest-extract/index.cjs.js +459 -0
- package/manifest-extract/index.cjs.mjs +2 -0
- package/manifest-extract/index.d.ts +1 -0
- package/manifest-extract/index.esm.js +457 -0
- package/manifest-extract/package.json +20 -0
- package/manifest-extract/src/index.d.ts +2 -0
- package/manifest-extract/src/lib/extract-crud.d.ts +36 -0
- package/manifest-extract/src/lib/types.d.ts +86 -0
- package/package.json +10 -4
- package/src/lib/api/call-model.command.factory.d.ts +1 -0
- package/src/lib/auth/auth.command.factory.d.ts +1 -0
- package/src/lib/auth/oidc.flow.d.ts +1 -0
- package/src/lib/config/env.d.ts +1 -1
- package/src/lib/config/paths.d.ts +1 -0
- package/src/lib/config/token.cache.d.ts +1 -0
- package/src/lib/context/cli.context.d.ts +1 -0
- package/src/lib/doctor/doctor.command.factory.d.ts +1 -0
- package/src/lib/env/env.command.factory.d.ts +1 -0
- package/src/lib/manifest/build-manifest-commands.d.ts +39 -0
- package/src/lib/manifest/types.d.ts +20 -0
- package/src/lib/middleware/auth.middleware.d.ts +1 -0
- package/src/lib/middleware/output.middleware.d.ts +1 -0
- package/src/lib/output/output.command.factory.d.ts +1 -0
- package/src/lib/runner/run.d.ts +1 -0
- package/src/lib/util/context.slot.d.ts +1 -0
- package/src/lib/util/output.d.ts +2 -0
package/index.esm.js
CHANGED
|
@@ -272,6 +272,7 @@ var _errorMapper;
|
|
|
272
272
|
* @param extension - File extension to append (`json` for full responses, `ndjson` for streaming dumps).
|
|
273
273
|
* @param suffix - Optional suffix appended to the filename before the extension.
|
|
274
274
|
* @returns The absolute file path, or `undefined` when `dumpDir` is not configured.
|
|
275
|
+
* @__NO_SIDE_EFFECTS__
|
|
275
276
|
*/ function buildDumpFilePath(extension, suffix) {
|
|
276
277
|
var dumpDir = _outputOptions.dumpDir, commandPath = _outputOptions.commandPath;
|
|
277
278
|
if (!dumpDir) {
|
|
@@ -408,6 +409,7 @@ function pickFromObject(obj, fields) {
|
|
|
408
409
|
*
|
|
409
410
|
* @param error - The thrown value to convert.
|
|
410
411
|
* @returns The structured {@link CliErrorOutput}.
|
|
412
|
+
* @__NO_SIDE_EFFECTS__
|
|
411
413
|
*/ function buildErrorOutput(error) {
|
|
412
414
|
if (_errorMapper) {
|
|
413
415
|
var mapped = _errorMapper(error);
|
|
@@ -669,6 +671,7 @@ function trimSlash$1(url) {
|
|
|
669
671
|
* @param input - Optional slot configuration.
|
|
670
672
|
* @param input.notInitializedMessage - Custom error message thrown by `require()` when the slot is unset.
|
|
671
673
|
* @returns A new {@link ContextSlot} for type `T`.
|
|
674
|
+
* @__NO_SIDE_EFFECTS__
|
|
672
675
|
*/ function createContextSlot(input) {
|
|
673
676
|
var _ref;
|
|
674
677
|
var _value;
|
|
@@ -713,6 +716,7 @@ var getCliContext = _cliContextSlot.get;
|
|
|
713
716
|
* @param input.env - The resolved {@link CliEnvConfig} for the active env.
|
|
714
717
|
* @param input.accessToken - The Bearer access token to include on outgoing API calls.
|
|
715
718
|
* @returns The constructed {@link CliContext}.
|
|
719
|
+
* @__NO_SIDE_EFFECTS__
|
|
716
720
|
*/ function createCliContext(input) {
|
|
717
721
|
return {
|
|
718
722
|
cliName: input.cliName,
|
|
@@ -912,6 +916,7 @@ function _ts_generator$e(thisArg, body) {
|
|
|
912
916
|
*
|
|
913
917
|
* @param spec - The command spec describing the yargs command surface plus how to map argv into the typed call params and the result.
|
|
914
918
|
* @returns A yargs `CommandModule` whose handler runs the spec against the active CLI context.
|
|
919
|
+
* @__NO_SIDE_EFFECTS__
|
|
915
920
|
*/ function createCallModelCommand(spec) {
|
|
916
921
|
return {
|
|
917
922
|
command: spec.command,
|
|
@@ -1658,7 +1663,7 @@ function mergeOutputCommandsConfig(existing, updates) {
|
|
|
1658
1663
|
* The `model.*` write scopes filtered out by {@link filterReadOnlyModelScopes}.
|
|
1659
1664
|
*
|
|
1660
1665
|
* Mirrors the write half of the dbx-components callModel CRUD scope set
|
|
1661
|
-
* (`CALL_MODEL_OIDC_SCOPES` in `@dereekb/firebase
|
|
1666
|
+
* (`CALL_MODEL_OIDC_SCOPES` in `@dereekb/firebase`) — duplicated here so the
|
|
1662
1667
|
* CLI doesn't take a server-side dependency just to know the names.
|
|
1663
1668
|
*/ var MODEL_WRITE_OIDC_SCOPES = [
|
|
1664
1669
|
'model.create',
|
|
@@ -1786,6 +1791,7 @@ function nonEmpty(value) {
|
|
|
1786
1791
|
* @param config.cliName - The CLI's binary name; the default config dir is `~/.<cliName>`.
|
|
1787
1792
|
* @param config.configDirOverride - Optional override that replaces the default config directory verbatim (used by tests).
|
|
1788
1793
|
* @returns The {@link CliPaths} pointing at `configDir`, the config file, and the token cache file.
|
|
1794
|
+
* @__NO_SIDE_EFFECTS__
|
|
1789
1795
|
*/ function buildCliPaths(config) {
|
|
1790
1796
|
var _config_configDirOverride;
|
|
1791
1797
|
var configDir = (_config_configDirOverride = config.configDirOverride) !== null && _config_configDirOverride !== void 0 ? _config_configDirOverride : join(homedir(), ".".concat(config.cliName));
|
|
@@ -1805,6 +1811,7 @@ function nonEmpty(value) {
|
|
|
1805
1811
|
* @param input - The cache store inputs.
|
|
1806
1812
|
* @param input.tokenCachePath - Absolute path to the JSON file backing the cache.
|
|
1807
1813
|
* @returns A {@link CliTokenCacheStore} keyed by env name.
|
|
1814
|
+
* @__NO_SIDE_EFFECTS__
|
|
1808
1815
|
*/ function createCliTokenCacheStore(input) {
|
|
1809
1816
|
return createMemoizedJsonFileAsyncKeyedValueCache({
|
|
1810
1817
|
filePath: input.tokenCachePath
|
|
@@ -2532,6 +2539,7 @@ function _ts_generator$a(thisArg, body) {
|
|
|
2532
2539
|
* @param input.state - The opaque OAuth state token used for CSRF protection.
|
|
2533
2540
|
* @param input.codeChallenge - The PKCE code challenge derived from the verifier.
|
|
2534
2541
|
* @returns The full authorization URL with all OAuth params merged in.
|
|
2542
|
+
* @__NO_SIDE_EFFECTS__
|
|
2535
2543
|
*/ function buildAuthorizationUrl(input) {
|
|
2536
2544
|
var _input_scopes;
|
|
2537
2545
|
var authParams = {
|
|
@@ -3064,6 +3072,7 @@ function maskEnv$1(env) {
|
|
|
3064
3072
|
* @param input.envVarName - Override for the env-name env var. Defaults to `<CLINAME>_ENV` (e.g. `DEMO_CLI_ENV`).
|
|
3065
3073
|
* @param input.defaultEnvs - Built-in env presets merged underneath the user's stored env when names match.
|
|
3066
3074
|
* @returns A yargs `CommandModule` exposing the full `auth` subcommand surface.
|
|
3075
|
+
* @__NO_SIDE_EFFECTS__
|
|
3067
3076
|
*/ function createAuthCommand(input) {
|
|
3068
3077
|
var _input_envVarName;
|
|
3069
3078
|
var cliName = input.cliName;
|
|
@@ -4411,6 +4420,7 @@ function _ts_generator$8(thisArg, body) {
|
|
|
4411
4420
|
* @param input.checks - Additional checks to append after the default check list.
|
|
4412
4421
|
* @param input.defaultEnvs - Built-in env presets merged underneath the user's stored env when names match.
|
|
4413
4422
|
* @returns A yargs `CommandModule` exposing the `doctor` command.
|
|
4423
|
+
* @__NO_SIDE_EFFECTS__
|
|
4414
4424
|
*/ function createDoctorCommand(input) {
|
|
4415
4425
|
var _input_checks;
|
|
4416
4426
|
var cliName = input.cliName;
|
|
@@ -4849,6 +4859,7 @@ function resolveEnvWithDefault(input) {
|
|
|
4849
4859
|
* @param input.cliName - The CLI's binary name.
|
|
4850
4860
|
* @param input.defaultEnvs - Built-in env presets merged underneath the user's stored env when names match.
|
|
4851
4861
|
* @returns A yargs `CommandModule` exposing the full `env` subcommand surface.
|
|
4862
|
+
* @__NO_SIDE_EFFECTS__
|
|
4852
4863
|
*/ function createEnvCommand(input) {
|
|
4853
4864
|
var paths = buildCliPaths({
|
|
4854
4865
|
cliName: input.cliName
|
|
@@ -5464,6 +5475,7 @@ function _ts_generator$6(thisArg, body) {
|
|
|
5464
5475
|
* @param input.skipCommands - Top-level command names that bypass authentication entirely.
|
|
5465
5476
|
* @param input.defaultEnvs - Built-in env presets merged underneath the user's stored env when names match.
|
|
5466
5477
|
* @returns A yargs middleware function suitable for `.middleware([..., true])`.
|
|
5478
|
+
* @__NO_SIDE_EFFECTS__
|
|
5467
5479
|
*/ function createAuthMiddleware(input) {
|
|
5468
5480
|
var paths = buildCliPaths({
|
|
5469
5481
|
cliName: input.cliName
|
|
@@ -5782,6 +5794,7 @@ function _ts_generator$5(thisArg, body) {
|
|
|
5782
5794
|
* @param input.loadOutputConfig - Optional override for how the output config is read.
|
|
5783
5795
|
* @param input.saveCommandOutputConfig - Optional override for how a per-command output config is persisted.
|
|
5784
5796
|
* @returns A yargs middleware function suitable for `.middleware([..., true])`.
|
|
5797
|
+
* @__NO_SIDE_EFFECTS__
|
|
5785
5798
|
*/ function createOutputMiddleware(input) {
|
|
5786
5799
|
var _input_loadOutputConfig, _input_saveCommandOutputConfig;
|
|
5787
5800
|
var paths = buildCliPaths({
|
|
@@ -6341,6 +6354,7 @@ function resolveCallbacks(input) {
|
|
|
6341
6354
|
* @param input.mergeOutputConfig - Optional override for persisting partial output-config updates.
|
|
6342
6355
|
* @param input.clearOutputConfig - Optional override for clearing the persisted output config entirely.
|
|
6343
6356
|
* @returns A yargs `CommandModule` exposing the full `output` subcommand surface.
|
|
6357
|
+
* @__NO_SIDE_EFFECTS__
|
|
6344
6358
|
*/ function createOutputCommand(input) {
|
|
6345
6359
|
var callbacks = resolveCallbacks(input);
|
|
6346
6360
|
var setCommand = {
|
|
@@ -6702,6 +6716,7 @@ function _ts_generator$2(thisArg, body) {
|
|
|
6702
6716
|
* @param input.argv - Argv to parse. Defaults to `hideBin(process.argv)`.
|
|
6703
6717
|
* @param input.disableCallPassthrough - When `true`, omits the built-in `call` passthrough.
|
|
6704
6718
|
* @returns The configured yargs `Argv` ready to be `.parse()`-d.
|
|
6719
|
+
* @__NO_SIDE_EFFECTS__
|
|
6705
6720
|
*/ function createCli(input) {
|
|
6706
6721
|
var _input_configCommands, _input_apiCommands, _input_argv;
|
|
6707
6722
|
var cliName = input.cliName;
|
|
@@ -7091,6 +7106,15 @@ var SKIPPED_VERBS = new Set([
|
|
|
7091
7106
|
'standalone'
|
|
7092
7107
|
]);
|
|
7093
7108
|
var ALL_HELP_FLAG = '--all-help';
|
|
7109
|
+
var HELP_MODE_FLAG = '--help-mode';
|
|
7110
|
+
/**
|
|
7111
|
+
* Default help mode when no override is supplied.
|
|
7112
|
+
*/ var DEFAULT_MANIFEST_HELP_MODE = 'both';
|
|
7113
|
+
var MANIFEST_HELP_MODES = new Set([
|
|
7114
|
+
'action',
|
|
7115
|
+
'params',
|
|
7116
|
+
'both'
|
|
7117
|
+
]);
|
|
7094
7118
|
/**
|
|
7095
7119
|
* Default schema format when no override is supplied.
|
|
7096
7120
|
*/ var DEFAULT_MANIFEST_HELP_DATA_FORMAT = 'jsonschema';
|
|
@@ -7122,8 +7146,9 @@ var DATA_HELP_FLAG = '--data-help';
|
|
|
7122
7146
|
* @param options - Optional overrides; see {@link BuildManifestCommandsOptions}.
|
|
7123
7147
|
* @returns The yargs `CommandModule[]` ready to be passed to `runCli({ apiCommands })`. Empty
|
|
7124
7148
|
* when the manifest has no callable entries.
|
|
7149
|
+
* @__NO_SIDE_EFFECTS__
|
|
7125
7150
|
*/ function buildManifestCommands(manifest, options) {
|
|
7126
|
-
var _ref, _ref1, _ref2, _ref3, _ref4;
|
|
7151
|
+
var _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
|
|
7127
7152
|
var callable = manifest.filter(function(e) {
|
|
7128
7153
|
return !SKIPPED_VERBS.has(e.verb);
|
|
7129
7154
|
});
|
|
@@ -7160,15 +7185,17 @@ var DATA_HELP_FLAG = '--data-help';
|
|
|
7160
7185
|
}
|
|
7161
7186
|
var argv = (_ref = options === null || options === void 0 ? void 0 : options.argv) !== null && _ref !== void 0 ? _ref : process.argv;
|
|
7162
7187
|
var dataHelpFormat = (_ref1 = options === null || options === void 0 ? void 0 : options.dataHelpFormat) !== null && _ref1 !== void 0 ? _ref1 : detectDataHelpFormat(argv);
|
|
7163
|
-
var
|
|
7164
|
-
var
|
|
7165
|
-
var
|
|
7188
|
+
var helpMode = (_ref2 = options === null || options === void 0 ? void 0 : options.helpMode) !== null && _ref2 !== void 0 ? _ref2 : detectHelpMode(argv);
|
|
7189
|
+
var focusHelp = ((_ref3 = options === null || options === void 0 ? void 0 : options.focusHelpOnDataHelp) !== null && _ref3 !== void 0 ? _ref3 : true) && hasDataHelpFlag(argv) && !hasAllHelpFlag(argv);
|
|
7190
|
+
var hideOnFocus = focusHelp ? (_ref4 = options === null || options === void 0 ? void 0 : options.hiddenWhenFocused) !== null && _ref4 !== void 0 ? _ref4 : STANDARD_GLOBAL_OPTION_NAMES : [];
|
|
7191
|
+
var modelCommandName = (_ref5 = options === null || options === void 0 ? void 0 : options.modelCommandName) !== null && _ref5 !== void 0 ? _ref5 : DEFAULT_MANIFEST_MODEL_COMMAND_NAME;
|
|
7166
7192
|
var sortedModels = _to_consumable_array(byModel.entries()).sort(function(param, param1) {
|
|
7167
7193
|
var _param = _sliced_to_array(param, 1), a = _param[0], _param1 = _sliced_to_array(param1, 1), b = _param1[0];
|
|
7168
7194
|
return a.localeCompare(b);
|
|
7169
7195
|
});
|
|
7170
7196
|
var context = {
|
|
7171
7197
|
dataHelpFormat: dataHelpFormat,
|
|
7198
|
+
helpMode: helpMode,
|
|
7172
7199
|
hideOnFocus: hideOnFocus
|
|
7173
7200
|
};
|
|
7174
7201
|
return [
|
|
@@ -7261,6 +7288,38 @@ var DATA_HELP_FLAG = '--data-help';
|
|
|
7261
7288
|
function parseDataHelpFormat(value) {
|
|
7262
7289
|
return MANIFEST_HELP_DATA_FORMATS.has(value) ? value : undefined;
|
|
7263
7290
|
}
|
|
7291
|
+
/**
|
|
7292
|
+
* Inspects an argv array for `--help-mode=<mode>` or `--help-mode <mode>` and
|
|
7293
|
+
* returns the requested {@link ManifestHelpMode}. Unrecognized values fall
|
|
7294
|
+
* back to {@link DEFAULT_MANIFEST_HELP_MODE}.
|
|
7295
|
+
*
|
|
7296
|
+
* Implemented as a raw argv scan (rather than going through yargs) because the
|
|
7297
|
+
* value is needed when each command's builder runs — which is before yargs
|
|
7298
|
+
* parses argv.
|
|
7299
|
+
*
|
|
7300
|
+
* @param argv - argv to inspect (defaults to `process.argv`).
|
|
7301
|
+
* @returns The detected mode, or {@link DEFAULT_MANIFEST_HELP_MODE}.
|
|
7302
|
+
*/ function detectHelpMode() {
|
|
7303
|
+
var argv = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : process.argv;
|
|
7304
|
+
var result = DEFAULT_MANIFEST_HELP_MODE;
|
|
7305
|
+
for(var i = 0; i < argv.length; i++){
|
|
7306
|
+
var arg = argv[i];
|
|
7307
|
+
if (arg.startsWith("".concat(HELP_MODE_FLAG, "="))) {
|
|
7308
|
+
var _parseHelpMode;
|
|
7309
|
+
result = (_parseHelpMode = parseHelpMode(arg.slice(HELP_MODE_FLAG.length + 1))) !== null && _parseHelpMode !== void 0 ? _parseHelpMode : result;
|
|
7310
|
+
break;
|
|
7311
|
+
}
|
|
7312
|
+
if (arg === HELP_MODE_FLAG && i + 1 < argv.length) {
|
|
7313
|
+
var _parseHelpMode1;
|
|
7314
|
+
result = (_parseHelpMode1 = parseHelpMode(argv[i + 1])) !== null && _parseHelpMode1 !== void 0 ? _parseHelpMode1 : result;
|
|
7315
|
+
break;
|
|
7316
|
+
}
|
|
7317
|
+
}
|
|
7318
|
+
return result;
|
|
7319
|
+
}
|
|
7320
|
+
function parseHelpMode(value) {
|
|
7321
|
+
return MANIFEST_HELP_MODES.has(value) ? value : undefined;
|
|
7322
|
+
}
|
|
7264
7323
|
function buildModelCommand(model, entries, context) {
|
|
7265
7324
|
return {
|
|
7266
7325
|
command: "".concat(model, " <action>"),
|
|
@@ -7295,14 +7354,15 @@ function buildModelCommand(model, entries, context) {
|
|
|
7295
7354
|
};
|
|
7296
7355
|
}
|
|
7297
7356
|
function buildEntryCommand(entry, context) {
|
|
7298
|
-
var
|
|
7357
|
+
var _oneLineDescription;
|
|
7299
7358
|
var action = entry.specifier && entry.specifier !== '_' ? "".concat(entry.verb, "-").concat(entry.specifier) : entry.verb;
|
|
7300
7359
|
var specPart = entry.specifier && entry.specifier !== '_' ? ' ' + entry.specifier : '';
|
|
7301
|
-
var
|
|
7302
|
-
var
|
|
7360
|
+
var fallbackDescribe = "".concat(entry.verb).concat(specPart, " on ").concat(entry.model);
|
|
7361
|
+
var describeOneLine = (_oneLineDescription = oneLineDescription(entry.description)) !== null && _oneLineDescription !== void 0 ? _oneLineDescription : fallbackDescribe;
|
|
7362
|
+
var epilogue = buildEntryEpilogue(entry, context);
|
|
7303
7363
|
return {
|
|
7304
7364
|
command: action,
|
|
7305
|
-
describe:
|
|
7365
|
+
describe: describeOneLine,
|
|
7306
7366
|
builder: function builder(yargs) {
|
|
7307
7367
|
var y = yargs.option('data', {
|
|
7308
7368
|
type: 'string',
|
|
@@ -7351,6 +7411,12 @@ function buildEntryCommand(entry, context) {
|
|
|
7351
7411
|
}
|
|
7352
7412
|
};
|
|
7353
7413
|
}
|
|
7414
|
+
function oneLineDescription(description) {
|
|
7415
|
+
var _description_split_;
|
|
7416
|
+
if (!description) return undefined;
|
|
7417
|
+
var firstLine = (_description_split_ = description.split('\n', 1)[0]) === null || _description_split_ === void 0 ? void 0 : _description_split_.trim();
|
|
7418
|
+
return firstLine && firstLine.length > 0 ? firstLine : undefined;
|
|
7419
|
+
}
|
|
7354
7420
|
function hideGlobalOptions(yargs, names) {
|
|
7355
7421
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
7356
7422
|
try {
|
|
@@ -7374,37 +7440,145 @@ function hideGlobalOptions(yargs, names) {
|
|
|
7374
7440
|
}
|
|
7375
7441
|
}
|
|
7376
7442
|
/**
|
|
7377
|
-
* Builds the help epilogue for a manifest-driven command. Surfaces the
|
|
7378
|
-
*
|
|
7379
|
-
*
|
|
7380
|
-
* the source `.api.ts`
|
|
7381
|
-
*
|
|
7382
|
-
* `--
|
|
7443
|
+
* Builds the help epilogue for a manifest-driven command. Surfaces the action
|
|
7444
|
+
* description JSDoc, the params interface description and per-field
|
|
7445
|
+
* descriptions, the params arktype validator (as JSON Schema and/or arktype
|
|
7446
|
+
* expression — see {@link ManifestHelpDataFormat}), and the source `.api.ts`
|
|
7447
|
+
* path for traceability. Designed to give both humans and LLM agents enough
|
|
7448
|
+
* information from `--help` alone to understand a command and construct a
|
|
7449
|
+
* valid `--data` payload.
|
|
7383
7450
|
*
|
|
7384
7451
|
* @param entry - Manifest entry whose metadata becomes the help epilogue.
|
|
7385
|
-
* @param
|
|
7452
|
+
* @param context - Builder context controlling schema format and which sections
|
|
7453
|
+
* to render (see {@link ManifestHelpMode}).
|
|
7386
7454
|
* @returns Multi-section epilogue string, or `undefined` when the entry has no
|
|
7387
7455
|
* metadata worth surfacing.
|
|
7388
|
-
*/ function buildEntryEpilogue(entry,
|
|
7389
|
-
var
|
|
7456
|
+
*/ function buildEntryEpilogue(entry, context) {
|
|
7457
|
+
var dataHelpFormat = context.dataHelpFormat, helpMode = context.helpMode;
|
|
7458
|
+
var showAction = helpMode === 'action' || helpMode === 'both';
|
|
7459
|
+
var showParams = helpMode === 'params' || helpMode === 'both';
|
|
7390
7460
|
var sections = [];
|
|
7391
|
-
if (
|
|
7392
|
-
|
|
7393
|
-
|
|
7394
|
-
|
|
7395
|
-
|
|
7396
|
-
if (
|
|
7397
|
-
|
|
7461
|
+
if (showAction) {
|
|
7462
|
+
var actionSection = buildActionSection(entry);
|
|
7463
|
+
if (actionSection) sections.push(actionSection);
|
|
7464
|
+
}
|
|
7465
|
+
var schemaSections = [];
|
|
7466
|
+
if (showParams) {
|
|
7467
|
+
var _sections;
|
|
7468
|
+
var paramsSection = buildParamsSection(entry);
|
|
7469
|
+
if (paramsSection) sections.push(paramsSection);
|
|
7470
|
+
schemaSections = renderParamsSchemaSections(entry, dataHelpFormat);
|
|
7471
|
+
(_sections = sections).push.apply(_sections, _to_consumable_array(schemaSections));
|
|
7472
|
+
var resultSection = buildResultSection(entry);
|
|
7473
|
+
if (resultSection) {
|
|
7474
|
+
sections.push(resultSection);
|
|
7475
|
+
} else if (entry.resultTypeName) {
|
|
7476
|
+
sections.push("Result: ".concat(entry.resultTypeName));
|
|
7477
|
+
}
|
|
7398
7478
|
}
|
|
7399
7479
|
if (entry.sourceFile) {
|
|
7400
7480
|
sections.push("Source: ".concat(entry.sourceFile));
|
|
7401
7481
|
}
|
|
7402
|
-
if (schemaSections.length > 0 && dataHelpFormat !== 'both') {
|
|
7482
|
+
if (showParams && schemaSections.length > 0 && dataHelpFormat !== 'both') {
|
|
7403
7483
|
var other = dataHelpFormat === 'jsonschema' ? 'arktype' : 'jsonschema';
|
|
7404
7484
|
sections.push("(Pass --data-help=".concat(other, " or --data-help=both to switch the schema format above.)"));
|
|
7405
7485
|
}
|
|
7486
|
+
if (helpMode === 'both' && (entry.description || entry.paramsTypeDescription || entry.paramsFields && entry.paramsFields.length > 0)) {
|
|
7487
|
+
sections.push("(Pass --help-mode=action or --help-mode=params to focus this help on a single section.)");
|
|
7488
|
+
}
|
|
7406
7489
|
return sections.length > 0 ? sections.join('\n\n') : undefined;
|
|
7407
7490
|
}
|
|
7491
|
+
function buildActionSection(entry) {
|
|
7492
|
+
if (!entry.description) return undefined;
|
|
7493
|
+
return "About:\n".concat(indentLines(entry.description, ' '));
|
|
7494
|
+
}
|
|
7495
|
+
function buildParamsSection(entry) {
|
|
7496
|
+
if (!entry.paramsTypeName && !entry.paramsTypeDescription && !(entry.paramsFields && entry.paramsFields.length > 0)) {
|
|
7497
|
+
return undefined;
|
|
7498
|
+
}
|
|
7499
|
+
var lines = [];
|
|
7500
|
+
if (entry.paramsTypeName) {
|
|
7501
|
+
lines.push("Params: ".concat(entry.paramsTypeName));
|
|
7502
|
+
}
|
|
7503
|
+
if (entry.paramsTypeDescription) {
|
|
7504
|
+
lines.push(indentLines(entry.paramsTypeDescription, ' '));
|
|
7505
|
+
}
|
|
7506
|
+
if (entry.paramsFields && entry.paramsFields.length > 0) {
|
|
7507
|
+
lines.push('');
|
|
7508
|
+
lines.push('Fields:');
|
|
7509
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
7510
|
+
try {
|
|
7511
|
+
for(var _iterator = entry.paramsFields[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
7512
|
+
var field = _step.value;
|
|
7513
|
+
var header = " - ".concat(field.name, ": ").concat(field.typeText);
|
|
7514
|
+
lines.push(header);
|
|
7515
|
+
if (field.description) {
|
|
7516
|
+
lines.push(indentLines(field.description, ' '));
|
|
7517
|
+
}
|
|
7518
|
+
}
|
|
7519
|
+
} catch (err) {
|
|
7520
|
+
_didIteratorError = true;
|
|
7521
|
+
_iteratorError = err;
|
|
7522
|
+
} finally{
|
|
7523
|
+
try {
|
|
7524
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
7525
|
+
_iterator.return();
|
|
7526
|
+
}
|
|
7527
|
+
} finally{
|
|
7528
|
+
if (_didIteratorError) {
|
|
7529
|
+
throw _iteratorError;
|
|
7530
|
+
}
|
|
7531
|
+
}
|
|
7532
|
+
}
|
|
7533
|
+
}
|
|
7534
|
+
return lines.join('\n');
|
|
7535
|
+
}
|
|
7536
|
+
function buildResultSection(entry) {
|
|
7537
|
+
if (!entry.resultTypeDescription && !(entry.resultFields && entry.resultFields.length > 0)) {
|
|
7538
|
+
return undefined;
|
|
7539
|
+
}
|
|
7540
|
+
var lines = [];
|
|
7541
|
+
if (entry.resultTypeName) {
|
|
7542
|
+
lines.push("Result: ".concat(entry.resultTypeName));
|
|
7543
|
+
}
|
|
7544
|
+
if (entry.resultTypeDescription) {
|
|
7545
|
+
lines.push(indentLines(entry.resultTypeDescription, ' '));
|
|
7546
|
+
}
|
|
7547
|
+
if (entry.resultFields && entry.resultFields.length > 0) {
|
|
7548
|
+
lines.push('');
|
|
7549
|
+
lines.push('Fields:');
|
|
7550
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
7551
|
+
try {
|
|
7552
|
+
for(var _iterator = entry.resultFields[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
7553
|
+
var field = _step.value;
|
|
7554
|
+
var header = " - ".concat(field.name, ": ").concat(field.typeText);
|
|
7555
|
+
lines.push(header);
|
|
7556
|
+
if (field.description) {
|
|
7557
|
+
lines.push(indentLines(field.description, ' '));
|
|
7558
|
+
}
|
|
7559
|
+
}
|
|
7560
|
+
} catch (err) {
|
|
7561
|
+
_didIteratorError = true;
|
|
7562
|
+
_iteratorError = err;
|
|
7563
|
+
} finally{
|
|
7564
|
+
try {
|
|
7565
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
7566
|
+
_iterator.return();
|
|
7567
|
+
}
|
|
7568
|
+
} finally{
|
|
7569
|
+
if (_didIteratorError) {
|
|
7570
|
+
throw _iteratorError;
|
|
7571
|
+
}
|
|
7572
|
+
}
|
|
7573
|
+
}
|
|
7574
|
+
}
|
|
7575
|
+
return lines.join('\n');
|
|
7576
|
+
}
|
|
7577
|
+
function indentLines(text, indent) {
|
|
7578
|
+
return text.split('\n').map(function(line) {
|
|
7579
|
+
return "".concat(indent).concat(line);
|
|
7580
|
+
}).join('\n');
|
|
7581
|
+
}
|
|
7408
7582
|
function renderParamsSchemaSections(entry, dataHelpFormat) {
|
|
7409
7583
|
var sections = [];
|
|
7410
7584
|
if (!entry.paramsValidator) {
|
|
@@ -8108,4 +8282,4 @@ function printPaginatedOutput(input) {
|
|
|
8108
8282
|
})();
|
|
8109
8283
|
}
|
|
8110
8284
|
|
|
8111
|
-
export { CALL_MODEL_API_PATH, CliError, DEFAULT_CLI_OIDC_SCOPES, DEFAULT_CLI_SECRET_PATTERNS, DEFAULT_MANIFEST_HELP_DATA_FORMAT, DEFAULT_MANIFEST_MODEL_COMMAND_NAME, DUMP_MERGE_MODES, DUMP_OUTPUT_MODES, MODEL_WRITE_OIDC_SCOPES, MULTIPLE_PAGES_OUTPUT_MODES, PROMPT_CANCELLED_ERROR_CODE, STANDARD_GLOBAL_OPTION_NAMES, applyEnvVarOverrides, buildAuthorizationUrl, buildCliPaths, buildDumpFilePath, buildErrorOutput, buildManifestCommands, callModelOverHttp, callPassthroughCommand, configureCliErrorMapper, configureCliSecretPatterns, configureOutputOptions, createAuthCommand, createAuthMiddleware, createCallModelCommand, createCli, createCliContext, createCliTokenCacheStore, createContextSlot, createDoctorCommand, createEnvCommand, createOutputCommand, createOutputMiddleware, defaultDoctorChecks, detectDataHelpFormat, discoverOidcMetadata, dumpTimestamp, exchangeAuthorizationCode, fetchUserInfo, filterReadOnlyModelScopes, findCliEnvDefault, generateOAuthState, generatePkceMaterial, getCliContext, getOutputOptions, isCliEnvConfigComplete, isTokenExpired, loadCliConfig, maskSecret, mergeCliConfig, mergeCliEnvWithDefault, mergeOutputConfig, openStreamingDump, outputError, outputResult, parsePastedRedirect, pickFields, promptLine, refreshAccessToken, requireCliContext, resolveActiveEnvName, resolveOutputConfig, revokeToken, runCli, runPaginatedList, sanitizeString, saveCliConfig, setCliContext, withCallModelArgs, withEnv, withMultiplePages, withOutput, wrapCommandHandler };
|
|
8285
|
+
export { CALL_MODEL_API_PATH, CliError, DEFAULT_CLI_OIDC_SCOPES, DEFAULT_CLI_SECRET_PATTERNS, DEFAULT_MANIFEST_HELP_DATA_FORMAT, DEFAULT_MANIFEST_HELP_MODE, DEFAULT_MANIFEST_MODEL_COMMAND_NAME, DUMP_MERGE_MODES, DUMP_OUTPUT_MODES, MODEL_WRITE_OIDC_SCOPES, MULTIPLE_PAGES_OUTPUT_MODES, PROMPT_CANCELLED_ERROR_CODE, STANDARD_GLOBAL_OPTION_NAMES, applyEnvVarOverrides, buildAuthorizationUrl, buildCliPaths, buildDumpFilePath, buildErrorOutput, buildManifestCommands, callModelOverHttp, callPassthroughCommand, configureCliErrorMapper, configureCliSecretPatterns, configureOutputOptions, createAuthCommand, createAuthMiddleware, createCallModelCommand, createCli, createCliContext, createCliTokenCacheStore, createContextSlot, createDoctorCommand, createEnvCommand, createOutputCommand, createOutputMiddleware, defaultDoctorChecks, detectDataHelpFormat, detectHelpMode, discoverOidcMetadata, dumpTimestamp, exchangeAuthorizationCode, fetchUserInfo, filterReadOnlyModelScopes, findCliEnvDefault, generateOAuthState, generatePkceMaterial, getCliContext, getOutputOptions, isCliEnvConfigComplete, isTokenExpired, loadCliConfig, maskSecret, mergeCliConfig, mergeCliEnvWithDefault, mergeOutputConfig, openStreamingDump, outputError, outputResult, parsePastedRedirect, pickFields, promptLine, refreshAccessToken, requireCliContext, resolveActiveEnvName, resolveOutputConfig, revokeToken, runCli, runPaginatedList, sanitizeString, saveCliConfig, setCliContext, withCallModelArgs, withEnv, withMultiplePages, withOutput, wrapCommandHandler };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Hapier Creative LLC.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
exports._default = require('./index.cjs.js').default;
|