@acomo/cli 1.0.16 → 1.0.18
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/dist/index.js +568 -107
- package/dist/index.js.map +4 -4
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -1842,27 +1842,27 @@ var CommandInstance = class {
|
|
|
1842
1842
|
};
|
|
1843
1843
|
this.shim.requireDirectory({ require: req, filename: callerFile }, dir, opts);
|
|
1844
1844
|
}
|
|
1845
|
-
addHandler(cmd, description,
|
|
1845
|
+
addHandler(cmd, description, builder5, handler5, commandMiddleware, deprecated) {
|
|
1846
1846
|
let aliases = [];
|
|
1847
1847
|
const middlewares = commandMiddlewareFactory(commandMiddleware);
|
|
1848
|
-
|
|
1848
|
+
handler5 = handler5 || (() => {
|
|
1849
1849
|
});
|
|
1850
1850
|
if (Array.isArray(cmd)) {
|
|
1851
1851
|
if (isCommandAndAliases(cmd)) {
|
|
1852
1852
|
[cmd, ...aliases] = cmd;
|
|
1853
1853
|
} else {
|
|
1854
|
-
for (const
|
|
1855
|
-
this.addHandler(
|
|
1854
|
+
for (const command6 of cmd) {
|
|
1855
|
+
this.addHandler(command6);
|
|
1856
1856
|
}
|
|
1857
1857
|
}
|
|
1858
1858
|
} else if (isCommandHandlerDefinition(cmd)) {
|
|
1859
|
-
let
|
|
1859
|
+
let command6 = Array.isArray(cmd.command) || typeof cmd.command === "string" ? cmd.command : this.moduleName(cmd);
|
|
1860
1860
|
if (cmd.aliases)
|
|
1861
|
-
|
|
1862
|
-
this.addHandler(
|
|
1861
|
+
command6 = [].concat(command6).concat(cmd.aliases);
|
|
1862
|
+
this.addHandler(command6, this.extractDesc(cmd), cmd.builder, cmd.handler, cmd.middlewares, cmd.deprecated);
|
|
1863
1863
|
return;
|
|
1864
|
-
} else if (isCommandBuilderDefinition(
|
|
1865
|
-
this.addHandler([cmd].concat(aliases), description,
|
|
1864
|
+
} else if (isCommandBuilderDefinition(builder5)) {
|
|
1865
|
+
this.addHandler([cmd].concat(aliases), description, builder5.builder, builder5.handler, builder5.middlewares, builder5.deprecated);
|
|
1866
1866
|
return;
|
|
1867
1867
|
}
|
|
1868
1868
|
if (typeof cmd === "string") {
|
|
@@ -1892,8 +1892,8 @@ var CommandInstance = class {
|
|
|
1892
1892
|
this.handlers[parsedCommand.cmd] = {
|
|
1893
1893
|
original: cmd,
|
|
1894
1894
|
description,
|
|
1895
|
-
handler:
|
|
1896
|
-
builder:
|
|
1895
|
+
handler: handler5,
|
|
1896
|
+
builder: builder5 || {},
|
|
1897
1897
|
middlewares,
|
|
1898
1898
|
deprecated,
|
|
1899
1899
|
demanded: parsedCommand.demanded,
|
|
@@ -1912,35 +1912,35 @@ var CommandInstance = class {
|
|
|
1912
1912
|
hasDefaultCommand() {
|
|
1913
1913
|
return !!this.defaultCommand;
|
|
1914
1914
|
}
|
|
1915
|
-
runCommand(
|
|
1916
|
-
const commandHandler = this.handlers[
|
|
1915
|
+
runCommand(command6, yargs, parsed, commandIndex, helpOnly, helpOrVersionSet) {
|
|
1916
|
+
const commandHandler = this.handlers[command6] || this.handlers[this.aliasMap[command6]] || this.defaultCommand;
|
|
1917
1917
|
const currentContext = yargs.getInternalMethods().getContext();
|
|
1918
1918
|
const parentCommands = currentContext.commands.slice();
|
|
1919
|
-
const isDefaultCommand = !
|
|
1920
|
-
if (
|
|
1921
|
-
currentContext.commands.push(
|
|
1919
|
+
const isDefaultCommand = !command6;
|
|
1920
|
+
if (command6) {
|
|
1921
|
+
currentContext.commands.push(command6);
|
|
1922
1922
|
currentContext.fullCommands.push(commandHandler.original);
|
|
1923
1923
|
}
|
|
1924
1924
|
const builderResult = this.applyBuilderUpdateUsageAndParse(isDefaultCommand, commandHandler, yargs, parsed.aliases, parentCommands, commandIndex, helpOnly, helpOrVersionSet);
|
|
1925
1925
|
return isPromise(builderResult) ? builderResult.then((result) => this.applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, result.innerArgv, currentContext, helpOnly, result.aliases, yargs)) : this.applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, builderResult.innerArgv, currentContext, helpOnly, builderResult.aliases, yargs);
|
|
1926
1926
|
}
|
|
1927
1927
|
applyBuilderUpdateUsageAndParse(isDefaultCommand, commandHandler, yargs, aliases, parentCommands, commandIndex, helpOnly, helpOrVersionSet) {
|
|
1928
|
-
const
|
|
1928
|
+
const builder5 = commandHandler.builder;
|
|
1929
1929
|
let innerYargs = yargs;
|
|
1930
|
-
if (isCommandBuilderCallback(
|
|
1930
|
+
if (isCommandBuilderCallback(builder5)) {
|
|
1931
1931
|
yargs.getInternalMethods().getUsageInstance().freeze();
|
|
1932
|
-
const builderOutput =
|
|
1932
|
+
const builderOutput = builder5(yargs.getInternalMethods().reset(aliases), helpOrVersionSet);
|
|
1933
1933
|
if (isPromise(builderOutput)) {
|
|
1934
1934
|
return builderOutput.then((output) => {
|
|
1935
1935
|
innerYargs = isYargsInstance(output) ? output : yargs;
|
|
1936
1936
|
return this.parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly);
|
|
1937
1937
|
});
|
|
1938
1938
|
}
|
|
1939
|
-
} else if (isCommandBuilderOptionDefinitions(
|
|
1939
|
+
} else if (isCommandBuilderOptionDefinitions(builder5)) {
|
|
1940
1940
|
yargs.getInternalMethods().getUsageInstance().freeze();
|
|
1941
1941
|
innerYargs = yargs.getInternalMethods().reset(aliases);
|
|
1942
1942
|
Object.keys(commandHandler.builder).forEach((key) => {
|
|
1943
|
-
innerYargs.option(key,
|
|
1943
|
+
innerYargs.option(key, builder5[key]);
|
|
1944
1944
|
});
|
|
1945
1945
|
}
|
|
1946
1946
|
return this.parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly);
|
|
@@ -2131,12 +2131,12 @@ var CommandInstance = class {
|
|
|
2131
2131
|
const commandString = DEFAULT_MARKER.test(this.defaultCommand.original) ? this.defaultCommand.original : this.defaultCommand.original.replace(/^[^[\]<>]*/, "$0 ");
|
|
2132
2132
|
yargs.getInternalMethods().getUsageInstance().usage(commandString, this.defaultCommand.description);
|
|
2133
2133
|
}
|
|
2134
|
-
const
|
|
2135
|
-
if (isCommandBuilderCallback(
|
|
2136
|
-
return
|
|
2137
|
-
} else if (!isCommandBuilderDefinition(
|
|
2138
|
-
Object.keys(
|
|
2139
|
-
yargs.option(key,
|
|
2134
|
+
const builder5 = this.defaultCommand.builder;
|
|
2135
|
+
if (isCommandBuilderCallback(builder5)) {
|
|
2136
|
+
return builder5(yargs, true);
|
|
2137
|
+
} else if (!isCommandBuilderDefinition(builder5)) {
|
|
2138
|
+
Object.keys(builder5).forEach((key) => {
|
|
2139
|
+
yargs.option(key, builder5[key]);
|
|
2140
2140
|
});
|
|
2141
2141
|
}
|
|
2142
2142
|
return void 0;
|
|
@@ -2150,8 +2150,8 @@ var CommandInstance = class {
|
|
|
2150
2150
|
commandFromFilename(filename) {
|
|
2151
2151
|
return this.shim.path.basename(filename, this.shim.path.extname(filename));
|
|
2152
2152
|
}
|
|
2153
|
-
extractDesc({ describe:
|
|
2154
|
-
for (const test of [
|
|
2153
|
+
extractDesc({ describe: describe5, description, desc }) {
|
|
2154
|
+
for (const test of [describe5, description, desc]) {
|
|
2155
2155
|
if (typeof test === "string" || test === false)
|
|
2156
2156
|
return test;
|
|
2157
2157
|
assertNotStrictEqual(test, true, this.shim);
|
|
@@ -2185,17 +2185,17 @@ var CommandInstance = class {
|
|
|
2185
2185
|
function command(usage2, validation2, globalMiddleware, shim3) {
|
|
2186
2186
|
return new CommandInstance(usage2, validation2, globalMiddleware, shim3);
|
|
2187
2187
|
}
|
|
2188
|
-
function isCommandBuilderDefinition(
|
|
2189
|
-
return typeof
|
|
2188
|
+
function isCommandBuilderDefinition(builder5) {
|
|
2189
|
+
return typeof builder5 === "object" && !!builder5.builder && typeof builder5.handler === "function";
|
|
2190
2190
|
}
|
|
2191
2191
|
function isCommandAndAliases(cmd) {
|
|
2192
2192
|
return cmd.every((c) => typeof c === "string");
|
|
2193
2193
|
}
|
|
2194
|
-
function isCommandBuilderCallback(
|
|
2195
|
-
return typeof
|
|
2194
|
+
function isCommandBuilderCallback(builder5) {
|
|
2195
|
+
return typeof builder5 === "function";
|
|
2196
2196
|
}
|
|
2197
|
-
function isCommandBuilderOptionDefinitions(
|
|
2198
|
-
return typeof
|
|
2197
|
+
function isCommandBuilderOptionDefinitions(builder5) {
|
|
2198
|
+
return typeof builder5 === "object";
|
|
2199
2199
|
}
|
|
2200
2200
|
function isCommandHandlerDefinition(cmd) {
|
|
2201
2201
|
return typeof cmd === "object" && !Array.isArray(cmd);
|
|
@@ -2316,7 +2316,7 @@ function usage(yargs, shim3) {
|
|
|
2316
2316
|
examples.push([cmd, description || ""]);
|
|
2317
2317
|
};
|
|
2318
2318
|
let commands = [];
|
|
2319
|
-
self.command = function
|
|
2319
|
+
self.command = function command6(cmd, description, isDefault, aliases, deprecated = false) {
|
|
2320
2320
|
if (isDefault) {
|
|
2321
2321
|
commands = commands.map((cmdArray) => {
|
|
2322
2322
|
cmdArray[2] = false;
|
|
@@ -2327,7 +2327,7 @@ function usage(yargs, shim3) {
|
|
|
2327
2327
|
};
|
|
2328
2328
|
self.getCommands = () => commands;
|
|
2329
2329
|
let descriptions = {};
|
|
2330
|
-
self.describe = function
|
|
2330
|
+
self.describe = function describe5(keyOrKeys, desc) {
|
|
2331
2331
|
if (Array.isArray(keyOrKeys)) {
|
|
2332
2332
|
keyOrKeys.forEach((k) => {
|
|
2333
2333
|
self.describe(k, desc);
|
|
@@ -2418,22 +2418,22 @@ function usage(yargs, shim3) {
|
|
|
2418
2418
|
commands = commands.sort((a, b) => a[0].localeCompare(b[0]));
|
|
2419
2419
|
}
|
|
2420
2420
|
const prefix = base$0 ? `${base$0} ` : "";
|
|
2421
|
-
commands.forEach((
|
|
2422
|
-
const commandString = `${prefix}${parentCommands}${
|
|
2421
|
+
commands.forEach((command6) => {
|
|
2422
|
+
const commandString = `${prefix}${parentCommands}${command6[0].replace(/^\$0 ?/, "")}`;
|
|
2423
2423
|
ui2.span({
|
|
2424
2424
|
text: commandString,
|
|
2425
2425
|
padding: [0, 2, 0, 2],
|
|
2426
2426
|
width: maxWidth(commands, theWrap, `${base$0}${parentCommands}`) + 4
|
|
2427
|
-
}, { text:
|
|
2427
|
+
}, { text: command6[1] });
|
|
2428
2428
|
const hints = [];
|
|
2429
|
-
if (
|
|
2429
|
+
if (command6[2])
|
|
2430
2430
|
hints.push(`[${__("default")}]`);
|
|
2431
|
-
if (
|
|
2432
|
-
hints.push(`[${__("aliases:")} ${
|
|
2431
|
+
if (command6[3] && command6[3].length) {
|
|
2432
|
+
hints.push(`[${__("aliases:")} ${command6[3].join(", ")}]`);
|
|
2433
2433
|
}
|
|
2434
|
-
if (
|
|
2435
|
-
if (typeof
|
|
2436
|
-
hints.push(`[${__("deprecated: %s",
|
|
2434
|
+
if (command6[4]) {
|
|
2435
|
+
if (typeof command6[4] === "string") {
|
|
2436
|
+
hints.push(`[${__("deprecated: %s", command6[4])}]`);
|
|
2437
2437
|
} else {
|
|
2438
2438
|
hints.push(`[${__("deprecated")}]`);
|
|
2439
2439
|
}
|
|
@@ -2803,11 +2803,11 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
|
2803
2803
|
|
|
2804
2804
|
// ../node_modules/yargs/build/lib/completion.js
|
|
2805
2805
|
var Completion = class {
|
|
2806
|
-
constructor(yargs, usage2,
|
|
2806
|
+
constructor(yargs, usage2, command6, shim3) {
|
|
2807
2807
|
var _a2, _b2, _c2;
|
|
2808
2808
|
this.yargs = yargs;
|
|
2809
2809
|
this.usage = usage2;
|
|
2810
|
-
this.command =
|
|
2810
|
+
this.command = command6;
|
|
2811
2811
|
this.shim = shim3;
|
|
2812
2812
|
this.completionKey = "get-yargs-completions";
|
|
2813
2813
|
this.aliases = null;
|
|
@@ -2819,11 +2819,11 @@ var Completion = class {
|
|
|
2819
2819
|
const handlers = this.command.getCommandHandlers();
|
|
2820
2820
|
for (let i = 0, ii = args.length; i < ii; ++i) {
|
|
2821
2821
|
if (handlers[args[i]] && handlers[args[i]].builder) {
|
|
2822
|
-
const
|
|
2823
|
-
if (isCommandBuilderCallback(
|
|
2822
|
+
const builder5 = handlers[args[i]].builder;
|
|
2823
|
+
if (isCommandBuilderCallback(builder5)) {
|
|
2824
2824
|
this.indexAfterLastReset = i + 1;
|
|
2825
2825
|
const y = this.yargs.getInternalMethods().reset();
|
|
2826
|
-
|
|
2826
|
+
builder5(y, true);
|
|
2827
2827
|
return y.argv;
|
|
2828
2828
|
}
|
|
2829
2829
|
}
|
|
@@ -3004,8 +3004,8 @@ var Completion = class {
|
|
|
3004
3004
|
this.aliases = parsed.aliases;
|
|
3005
3005
|
}
|
|
3006
3006
|
};
|
|
3007
|
-
function completion(yargs, usage2,
|
|
3008
|
-
return new Completion(yargs, usage2,
|
|
3007
|
+
function completion(yargs, usage2, command6, shim3) {
|
|
3008
|
+
return new Completion(yargs, usage2, command6, shim3);
|
|
3009
3009
|
}
|
|
3010
3010
|
function isSyncCompletionFunction(completionFunction) {
|
|
3011
3011
|
return completionFunction.length < 3;
|
|
@@ -3669,13 +3669,13 @@ var YargsInstance = class {
|
|
|
3669
3669
|
__classPrivateFieldGet(this, _YargsInstance_completion, "f").registerFunction(fn);
|
|
3670
3670
|
return this;
|
|
3671
3671
|
}
|
|
3672
|
-
command(cmd, description,
|
|
3673
|
-
argsert("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]", [cmd, description,
|
|
3674
|
-
__classPrivateFieldGet(this, _YargsInstance_command, "f").addHandler(cmd, description,
|
|
3672
|
+
command(cmd, description, builder5, handler5, middlewares, deprecated) {
|
|
3673
|
+
argsert("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]", [cmd, description, builder5, handler5, middlewares, deprecated], arguments.length);
|
|
3674
|
+
__classPrivateFieldGet(this, _YargsInstance_command, "f").addHandler(cmd, description, builder5, handler5, middlewares, deprecated);
|
|
3675
3675
|
return this;
|
|
3676
3676
|
}
|
|
3677
|
-
commands(cmd, description,
|
|
3678
|
-
return this.command(cmd, description,
|
|
3677
|
+
commands(cmd, description, builder5, handler5, middlewares, deprecated) {
|
|
3678
|
+
return this.command(cmd, description, builder5, handler5, middlewares, deprecated);
|
|
3679
3679
|
}
|
|
3680
3680
|
commandDir(dir, opts) {
|
|
3681
3681
|
argsert("<string> [object]", [dir, opts], arguments.length);
|
|
@@ -4277,12 +4277,12 @@ var YargsInstance = class {
|
|
|
4277
4277
|
__classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.updateLocale(obj);
|
|
4278
4278
|
return this;
|
|
4279
4279
|
}
|
|
4280
|
-
usage(msg, description,
|
|
4281
|
-
argsert("<string|null|undefined> [string|boolean] [function|object] [function]", [msg, description,
|
|
4280
|
+
usage(msg, description, builder5, handler5) {
|
|
4281
|
+
argsert("<string|null|undefined> [string|boolean] [function|object] [function]", [msg, description, builder5, handler5], arguments.length);
|
|
4282
4282
|
if (description !== void 0) {
|
|
4283
4283
|
assertNotStrictEqual(msg, null, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
|
|
4284
4284
|
if ((msg || "").match(/^\$0( |$)/)) {
|
|
4285
|
-
return this.command(msg, description,
|
|
4285
|
+
return this.command(msg, description, builder5, handler5);
|
|
4286
4286
|
} else {
|
|
4287
4287
|
throw new YError(".usage() description must start with $0 if being used as alias for .command()");
|
|
4288
4288
|
}
|
|
@@ -4474,24 +4474,24 @@ var YargsInstance = class {
|
|
|
4474
4474
|
__classPrivateFieldGet(this, _YargsInstance_options, "f")[type].push(key);
|
|
4475
4475
|
});
|
|
4476
4476
|
}
|
|
4477
|
-
[kPopulateParserHintSingleValueDictionary](
|
|
4478
|
-
this[kPopulateParserHintDictionary](
|
|
4477
|
+
[kPopulateParserHintSingleValueDictionary](builder5, type, key, value) {
|
|
4478
|
+
this[kPopulateParserHintDictionary](builder5, type, key, value, (type2, key2, value2) => {
|
|
4479
4479
|
__classPrivateFieldGet(this, _YargsInstance_options, "f")[type2][key2] = value2;
|
|
4480
4480
|
});
|
|
4481
4481
|
}
|
|
4482
|
-
[kPopulateParserHintArrayDictionary](
|
|
4483
|
-
this[kPopulateParserHintDictionary](
|
|
4482
|
+
[kPopulateParserHintArrayDictionary](builder5, type, key, value) {
|
|
4483
|
+
this[kPopulateParserHintDictionary](builder5, type, key, value, (type2, key2, value2) => {
|
|
4484
4484
|
__classPrivateFieldGet(this, _YargsInstance_options, "f")[type2][key2] = (__classPrivateFieldGet(this, _YargsInstance_options, "f")[type2][key2] || []).concat(value2);
|
|
4485
4485
|
});
|
|
4486
4486
|
}
|
|
4487
|
-
[kPopulateParserHintDictionary](
|
|
4487
|
+
[kPopulateParserHintDictionary](builder5, type, key, value, singleKeyHandler) {
|
|
4488
4488
|
if (Array.isArray(key)) {
|
|
4489
4489
|
key.forEach((k) => {
|
|
4490
|
-
|
|
4490
|
+
builder5(k, value);
|
|
4491
4491
|
});
|
|
4492
4492
|
} else if (/* @__PURE__ */ ((key2) => typeof key2 === "object")(key)) {
|
|
4493
4493
|
for (const k of objectKeys(key)) {
|
|
4494
|
-
|
|
4494
|
+
builder5(k, key[k]);
|
|
4495
4495
|
}
|
|
4496
4496
|
} else {
|
|
4497
4497
|
singleKeyHandler(type, this[kSanitizeKey](key), value);
|
|
@@ -4965,6 +4965,7 @@ __export(src_exports, {
|
|
|
4965
4965
|
GenerateClientAccessTokenResponseEntityFromJSONTyped: () => GenerateClientAccessTokenResponseEntityFromJSONTyped,
|
|
4966
4966
|
GenerateClientAccessTokenResponseEntityToJSON: () => GenerateClientAccessTokenResponseEntityToJSON,
|
|
4967
4967
|
GenerateClientAccessTokenResponseEntityToJSONTyped: () => GenerateClientAccessTokenResponseEntityToJSONTyped,
|
|
4968
|
+
GetWorkflowModelSchemasTypeEnum: () => GetWorkflowModelSchemasTypeEnum,
|
|
4968
4969
|
GroupApi: () => GroupApi,
|
|
4969
4970
|
GroupEntityFromJSON: () => GroupEntityFromJSON,
|
|
4970
4971
|
GroupEntityFromJSONTyped: () => GroupEntityFromJSONTyped,
|
|
@@ -5055,6 +5056,7 @@ __export(src_exports, {
|
|
|
5055
5056
|
RoleEntityFromJSONTyped: () => RoleEntityFromJSONTyped,
|
|
5056
5057
|
RoleEntityToJSON: () => RoleEntityToJSON,
|
|
5057
5058
|
RoleEntityToJSONTyped: () => RoleEntityToJSONTyped,
|
|
5059
|
+
SchemaApi: () => SchemaApi,
|
|
5058
5060
|
SessionEntityFromJSON: () => SessionEntityFromJSON,
|
|
5059
5061
|
SessionEntityFromJSONTyped: () => SessionEntityFromJSONTyped,
|
|
5060
5062
|
SessionEntityToJSON: () => SessionEntityToJSON,
|
|
@@ -11581,6 +11583,33 @@ var RoleApi = class extends BaseAPI {
|
|
|
11581
11583
|
}
|
|
11582
11584
|
};
|
|
11583
11585
|
|
|
11586
|
+
// ../acomo-client/dist/src/client/apis/SchemaApi.js
|
|
11587
|
+
var SchemaApi = class extends BaseAPI {
|
|
11588
|
+
async getWorkflowModelSchemasRaw(requestParameters, initOverrides) {
|
|
11589
|
+
const queryParameters = {};
|
|
11590
|
+
if (requestParameters["type"] != null) {
|
|
11591
|
+
queryParameters["type"] = requestParameters["type"];
|
|
11592
|
+
}
|
|
11593
|
+
const headerParameters = {};
|
|
11594
|
+
const response = await this.request({
|
|
11595
|
+
path: `/api/v1/schemas/model`,
|
|
11596
|
+
method: "GET",
|
|
11597
|
+
headers: headerParameters,
|
|
11598
|
+
query: queryParameters
|
|
11599
|
+
}, initOverrides);
|
|
11600
|
+
return new JSONApiResponse(response);
|
|
11601
|
+
}
|
|
11602
|
+
async getWorkflowModelSchemas(requestParameters = {}, initOverrides) {
|
|
11603
|
+
const response = await this.getWorkflowModelSchemasRaw(requestParameters, initOverrides);
|
|
11604
|
+
return await response.value();
|
|
11605
|
+
}
|
|
11606
|
+
};
|
|
11607
|
+
var GetWorkflowModelSchemasTypeEnum = {
|
|
11608
|
+
Definition: "definition",
|
|
11609
|
+
DataSchema: "dataSchema",
|
|
11610
|
+
DataAccessPolicy: "dataAccessPolicy"
|
|
11611
|
+
};
|
|
11612
|
+
|
|
11584
11613
|
// ../acomo-client/dist/src/client/apis/SettingApi.js
|
|
11585
11614
|
var SettingApi = class extends BaseAPI {
|
|
11586
11615
|
async createSettingRaw(initOverrides) {
|
|
@@ -12420,6 +12449,360 @@ async function setHandler(argv) {
|
|
|
12420
12449
|
}
|
|
12421
12450
|
}
|
|
12422
12451
|
|
|
12452
|
+
// src/schemas/model-schemas.json
|
|
12453
|
+
var model_schemas_default = {
|
|
12454
|
+
definition: {
|
|
12455
|
+
$defs: {
|
|
12456
|
+
operators: {
|
|
12457
|
+
type: "string",
|
|
12458
|
+
enum: [">", ">=", "<", "<=", "==", "!=", "has", "hasAncestorsOf", "hasDescendantsOf", "hasParentsOf", "hasChildrenOf", "and", "or", "+", "-", "*", "/", "**", "%"]
|
|
12459
|
+
},
|
|
12460
|
+
binaryExpression: {
|
|
12461
|
+
type: "object",
|
|
12462
|
+
properties: {
|
|
12463
|
+
operator: { $ref: "#/$defs/operators" },
|
|
12464
|
+
expression1: {
|
|
12465
|
+
oneOf: [
|
|
12466
|
+
{ type: "string" },
|
|
12467
|
+
{ type: "number" },
|
|
12468
|
+
{ $ref: "#/$defs/binaryExpression" }
|
|
12469
|
+
]
|
|
12470
|
+
},
|
|
12471
|
+
expression2: {
|
|
12472
|
+
oneOf: [
|
|
12473
|
+
{ type: "string" },
|
|
12474
|
+
{ type: "number" },
|
|
12475
|
+
{ $ref: "#/$defs/binaryExpression" }
|
|
12476
|
+
]
|
|
12477
|
+
}
|
|
12478
|
+
},
|
|
12479
|
+
required: ["operator", "expression1", "expression2"],
|
|
12480
|
+
additionalProperties: false
|
|
12481
|
+
},
|
|
12482
|
+
nodeActionType: {
|
|
12483
|
+
type: "string",
|
|
12484
|
+
enum: ["manage", "read", "approve", "reject", "submit", "revert", "start", "update"]
|
|
12485
|
+
},
|
|
12486
|
+
actionPolicy: {
|
|
12487
|
+
type: "object",
|
|
12488
|
+
properties: {
|
|
12489
|
+
type: { $ref: "#/$defs/nodeActionType" },
|
|
12490
|
+
allow: { $ref: "#/$defs/binaryExpression" },
|
|
12491
|
+
description: { type: "string" }
|
|
12492
|
+
},
|
|
12493
|
+
required: ["type", "allow"],
|
|
12494
|
+
additionalProperties: false
|
|
12495
|
+
},
|
|
12496
|
+
flowType: {
|
|
12497
|
+
type: "string",
|
|
12498
|
+
enum: ["normal", "approve", "reject", "submit"]
|
|
12499
|
+
},
|
|
12500
|
+
position: {
|
|
12501
|
+
type: "object",
|
|
12502
|
+
properties: {
|
|
12503
|
+
x: { type: "number" },
|
|
12504
|
+
y: { type: "number" }
|
|
12505
|
+
},
|
|
12506
|
+
required: ["x", "y"]
|
|
12507
|
+
},
|
|
12508
|
+
condition: {
|
|
12509
|
+
type: "object",
|
|
12510
|
+
properties: {
|
|
12511
|
+
type: { $ref: "#/$defs/flowType" },
|
|
12512
|
+
expression: { $ref: "#/$defs/binaryExpression" },
|
|
12513
|
+
destination: { type: "string" }
|
|
12514
|
+
},
|
|
12515
|
+
required: ["expression", "destination"],
|
|
12516
|
+
additionalProperties: false
|
|
12517
|
+
}
|
|
12518
|
+
},
|
|
12519
|
+
type: "object",
|
|
12520
|
+
properties: {
|
|
12521
|
+
edges: {
|
|
12522
|
+
type: "array",
|
|
12523
|
+
items: {
|
|
12524
|
+
type: "object",
|
|
12525
|
+
properties: {
|
|
12526
|
+
to: { type: "string" },
|
|
12527
|
+
from: { type: "string" },
|
|
12528
|
+
type: {
|
|
12529
|
+
type: "array",
|
|
12530
|
+
minItems: 1,
|
|
12531
|
+
items: { type: "string" }
|
|
12532
|
+
}
|
|
12533
|
+
},
|
|
12534
|
+
required: ["to", "from", "type"],
|
|
12535
|
+
additionalProperties: false
|
|
12536
|
+
}
|
|
12537
|
+
},
|
|
12538
|
+
nodes: {
|
|
12539
|
+
type: "array",
|
|
12540
|
+
items: {
|
|
12541
|
+
oneOf: [
|
|
12542
|
+
{
|
|
12543
|
+
type: "object",
|
|
12544
|
+
properties: {
|
|
12545
|
+
id: { type: "string" },
|
|
12546
|
+
name: { type: "string" },
|
|
12547
|
+
type: { const: "event" },
|
|
12548
|
+
eventType: { type: "string", enum: ["start", "end"] },
|
|
12549
|
+
position: { $ref: "#/$defs/position" },
|
|
12550
|
+
actionPolicies: {
|
|
12551
|
+
type: "array",
|
|
12552
|
+
items: { $ref: "#/$defs/actionPolicy" }
|
|
12553
|
+
}
|
|
12554
|
+
},
|
|
12555
|
+
required: ["id", "name", "type", "eventType"]
|
|
12556
|
+
},
|
|
12557
|
+
{
|
|
12558
|
+
type: "object",
|
|
12559
|
+
properties: {
|
|
12560
|
+
id: { type: "string" },
|
|
12561
|
+
name: { type: "string" },
|
|
12562
|
+
type: { const: "task" },
|
|
12563
|
+
position: { $ref: "#/$defs/position" },
|
|
12564
|
+
canRevert: { type: "boolean" },
|
|
12565
|
+
actionPolicies: {
|
|
12566
|
+
type: "array",
|
|
12567
|
+
items: { $ref: "#/$defs/actionPolicy" }
|
|
12568
|
+
}
|
|
12569
|
+
},
|
|
12570
|
+
required: ["id", "name", "type"],
|
|
12571
|
+
additionalProperties: false
|
|
12572
|
+
},
|
|
12573
|
+
{
|
|
12574
|
+
type: "object",
|
|
12575
|
+
properties: {
|
|
12576
|
+
id: { type: "string" },
|
|
12577
|
+
name: { type: "string" },
|
|
12578
|
+
type: { const: "exclusiveFork" },
|
|
12579
|
+
position: { $ref: "#/$defs/position" },
|
|
12580
|
+
conditions: {
|
|
12581
|
+
type: "array",
|
|
12582
|
+
items: { $ref: "#/$defs/condition" }
|
|
12583
|
+
}
|
|
12584
|
+
},
|
|
12585
|
+
required: ["id", "name", "type"],
|
|
12586
|
+
additionalProperties: false
|
|
12587
|
+
},
|
|
12588
|
+
{
|
|
12589
|
+
type: "object",
|
|
12590
|
+
properties: {
|
|
12591
|
+
id: { type: "string" },
|
|
12592
|
+
name: { type: "string" },
|
|
12593
|
+
type: { const: "parallelFork" },
|
|
12594
|
+
position: { $ref: "#/$defs/position" },
|
|
12595
|
+
keys: {
|
|
12596
|
+
type: "object",
|
|
12597
|
+
properties: {
|
|
12598
|
+
name: { type: "string" },
|
|
12599
|
+
enum: { type: "string" }
|
|
12600
|
+
},
|
|
12601
|
+
required: ["name", "enum"],
|
|
12602
|
+
additionalProperties: false
|
|
12603
|
+
}
|
|
12604
|
+
},
|
|
12605
|
+
required: ["id", "name", "type"],
|
|
12606
|
+
additionalProperties: false
|
|
12607
|
+
},
|
|
12608
|
+
{
|
|
12609
|
+
type: "object",
|
|
12610
|
+
properties: {
|
|
12611
|
+
id: { type: "string" },
|
|
12612
|
+
name: { type: "string" },
|
|
12613
|
+
type: { const: "parallelJoin" },
|
|
12614
|
+
position: { $ref: "#/$defs/position" },
|
|
12615
|
+
conditions: {
|
|
12616
|
+
type: "array",
|
|
12617
|
+
items: { $ref: "#/$defs/condition" }
|
|
12618
|
+
}
|
|
12619
|
+
},
|
|
12620
|
+
required: ["id", "name", "type"],
|
|
12621
|
+
additionalProperties: false
|
|
12622
|
+
}
|
|
12623
|
+
]
|
|
12624
|
+
}
|
|
12625
|
+
}
|
|
12626
|
+
},
|
|
12627
|
+
additionalProperties: false
|
|
12628
|
+
},
|
|
12629
|
+
dataSchema: {
|
|
12630
|
+
type: "object",
|
|
12631
|
+
properties: {
|
|
12632
|
+
type: { const: "object" },
|
|
12633
|
+
additionalProperties: { const: false },
|
|
12634
|
+
properties: {
|
|
12635
|
+
type: "object",
|
|
12636
|
+
additionalProperties: {
|
|
12637
|
+
oneOf: [
|
|
12638
|
+
{
|
|
12639
|
+
type: "object",
|
|
12640
|
+
properties: {
|
|
12641
|
+
type: { const: "string" },
|
|
12642
|
+
title: { type: "string" },
|
|
12643
|
+
_order: { type: "number" },
|
|
12644
|
+
_acomoType: { const: "string" },
|
|
12645
|
+
description: { type: "string" }
|
|
12646
|
+
},
|
|
12647
|
+
required: ["type", "_order", "_acomoType"],
|
|
12648
|
+
additionalProperties: false
|
|
12649
|
+
},
|
|
12650
|
+
{
|
|
12651
|
+
type: "object",
|
|
12652
|
+
properties: {
|
|
12653
|
+
type: { const: "string" },
|
|
12654
|
+
title: { type: "string" },
|
|
12655
|
+
_order: { type: "number" },
|
|
12656
|
+
format: { const: "date" },
|
|
12657
|
+
_acomoType: { const: "date" },
|
|
12658
|
+
description: { type: "string" }
|
|
12659
|
+
},
|
|
12660
|
+
required: ["type", "_order", "_acomoType", "format"],
|
|
12661
|
+
additionalProperties: false
|
|
12662
|
+
},
|
|
12663
|
+
{
|
|
12664
|
+
type: "object",
|
|
12665
|
+
properties: {
|
|
12666
|
+
type: { const: "number" },
|
|
12667
|
+
title: { type: "string" },
|
|
12668
|
+
_order: { type: "number" },
|
|
12669
|
+
_acomoType: { const: "number" },
|
|
12670
|
+
description: { type: "string" }
|
|
12671
|
+
},
|
|
12672
|
+
required: ["type", "_order", "_acomoType"],
|
|
12673
|
+
additionalProperties: false
|
|
12674
|
+
},
|
|
12675
|
+
{
|
|
12676
|
+
type: "object",
|
|
12677
|
+
properties: {
|
|
12678
|
+
type: { const: "string" },
|
|
12679
|
+
title: { type: "string" },
|
|
12680
|
+
_order: { type: "number" },
|
|
12681
|
+
enum: {
|
|
12682
|
+
type: "array",
|
|
12683
|
+
items: { type: "string" }
|
|
12684
|
+
},
|
|
12685
|
+
_acomoType: { const: "enum" },
|
|
12686
|
+
description: { type: "string" }
|
|
12687
|
+
},
|
|
12688
|
+
required: ["type", "_order", "_acomoType", "enum"],
|
|
12689
|
+
additionalProperties: false
|
|
12690
|
+
},
|
|
12691
|
+
{
|
|
12692
|
+
type: "object",
|
|
12693
|
+
properties: {
|
|
12694
|
+
type: { const: "array" },
|
|
12695
|
+
items: {
|
|
12696
|
+
type: "object",
|
|
12697
|
+
properties: {
|
|
12698
|
+
type: { const: "string" },
|
|
12699
|
+
pattern: { const: "[^/]+" }
|
|
12700
|
+
},
|
|
12701
|
+
required: ["type", "pattern"],
|
|
12702
|
+
additionalProperties: false
|
|
12703
|
+
},
|
|
12704
|
+
title: { type: "string" },
|
|
12705
|
+
_order: { type: "number" },
|
|
12706
|
+
_acomoType: { const: "file" },
|
|
12707
|
+
description: { type: "string" }
|
|
12708
|
+
},
|
|
12709
|
+
required: ["type", "_order", "_acomoType", "items"],
|
|
12710
|
+
additionalProperties: false
|
|
12711
|
+
},
|
|
12712
|
+
{
|
|
12713
|
+
type: "object",
|
|
12714
|
+
properties: {
|
|
12715
|
+
type: { const: "array" },
|
|
12716
|
+
items: {
|
|
12717
|
+
type: "object",
|
|
12718
|
+
properties: {
|
|
12719
|
+
type: { type: "string", enum: ["string", "number"] },
|
|
12720
|
+
format: { const: "date" }
|
|
12721
|
+
},
|
|
12722
|
+
required: ["type"],
|
|
12723
|
+
additionalProperties: false
|
|
12724
|
+
},
|
|
12725
|
+
title: { type: "string" },
|
|
12726
|
+
_order: { type: "number" },
|
|
12727
|
+
_acomoType: { const: "array" },
|
|
12728
|
+
description: { type: "string" }
|
|
12729
|
+
},
|
|
12730
|
+
required: ["type", "_order", "_acomoType", "items"],
|
|
12731
|
+
additionalProperties: false
|
|
12732
|
+
},
|
|
12733
|
+
{
|
|
12734
|
+
type: "object",
|
|
12735
|
+
properties: {
|
|
12736
|
+
type: { const: "object" },
|
|
12737
|
+
title: { type: "string" },
|
|
12738
|
+
_order: { type: "number" },
|
|
12739
|
+
_acomoType: { const: "record" },
|
|
12740
|
+
_recordKey: {
|
|
12741
|
+
type: "string",
|
|
12742
|
+
not: { const: "" }
|
|
12743
|
+
},
|
|
12744
|
+
description: { type: "string" },
|
|
12745
|
+
additionalProperties: {
|
|
12746
|
+
type: "object",
|
|
12747
|
+
properties: {
|
|
12748
|
+
type: { type: "string", enum: ["string", "number"] }
|
|
12749
|
+
},
|
|
12750
|
+
required: ["type"],
|
|
12751
|
+
additionalProperties: false
|
|
12752
|
+
}
|
|
12753
|
+
},
|
|
12754
|
+
required: ["type", "_order", "_acomoType", "_recordKey", "additionalProperties"],
|
|
12755
|
+
additionalProperties: false
|
|
12756
|
+
}
|
|
12757
|
+
]
|
|
12758
|
+
}
|
|
12759
|
+
}
|
|
12760
|
+
},
|
|
12761
|
+
additionalProperties: false,
|
|
12762
|
+
required: ["type"]
|
|
12763
|
+
},
|
|
12764
|
+
dataAccessPolicy: {
|
|
12765
|
+
type: "object",
|
|
12766
|
+
additionalProperties: {
|
|
12767
|
+
type: "object",
|
|
12768
|
+
additionalProperties: { type: "string", enum: ["read", "write"] }
|
|
12769
|
+
}
|
|
12770
|
+
}
|
|
12771
|
+
};
|
|
12772
|
+
|
|
12773
|
+
// src/commands/schema.ts
|
|
12774
|
+
function command5() {
|
|
12775
|
+
return "schema <subcommand>";
|
|
12776
|
+
}
|
|
12777
|
+
function describe4() {
|
|
12778
|
+
return "\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u30E2\u30C7\u30EB\u306E JSON Schema \u30D0\u30EA\u30C7\u30FC\u30B7\u30E7\u30F3\u5B9A\u7FA9\u3092\u8868\u793A\u3059\u308B\u3002";
|
|
12779
|
+
}
|
|
12780
|
+
var helpPositionals2 = [
|
|
12781
|
+
{ name: "subcommand", type: "string", required: true, description: "show" }
|
|
12782
|
+
];
|
|
12783
|
+
var helpOptions4 = [
|
|
12784
|
+
{ name: "type", type: "string", description: "definition | dataSchema | dataAccessPolicy\uFF08\u7701\u7565\u6642\u306F\u5168\u30B9\u30AD\u30FC\u30DE\u3092\u8FD4\u3059\uFF09" }
|
|
12785
|
+
];
|
|
12786
|
+
var SCHEMA_TYPES = ["definition", "dataSchema", "dataAccessPolicy"];
|
|
12787
|
+
function builder4(yargs) {
|
|
12788
|
+
return yargs.command(
|
|
12789
|
+
"show",
|
|
12790
|
+
"\u5168\u30B9\u30AD\u30FC\u30DE\u3092\u8868\u793A\u3002--type definition|dataSchema|dataAccessPolicy \u3067\u7D5E\u308A\u8FBC\u307F\u53EF\u3002",
|
|
12791
|
+
(y) => y.option("type", {
|
|
12792
|
+
type: "string",
|
|
12793
|
+
description: "\u53D6\u5F97\u3059\u308B\u30B9\u30AD\u30FC\u30DE\u306E\u7A2E\u985E\uFF08\u7701\u7565\u6642\u306F\u5168\u30B9\u30AD\u30FC\u30DE\u3092\u8FD4\u3059\uFF09",
|
|
12794
|
+
choices: SCHEMA_TYPES
|
|
12795
|
+
}),
|
|
12796
|
+
async (argv) => {
|
|
12797
|
+
const type = argv.type;
|
|
12798
|
+
const result = type ? model_schemas_default[type] : model_schemas_default;
|
|
12799
|
+
process.stdout.write(JSON.stringify(result, null, 2) + "\n");
|
|
12800
|
+
}
|
|
12801
|
+
).demandCommand(1, "\u5229\u7528\u53EF\u80FD\u306A\u30B5\u30D6\u30B3\u30DE\u30F3\u30C9: show");
|
|
12802
|
+
}
|
|
12803
|
+
async function handler4(_argv) {
|
|
12804
|
+
}
|
|
12805
|
+
|
|
12423
12806
|
// src/generated/operation-descriptions.ts
|
|
12424
12807
|
var operationDescriptions = {
|
|
12425
12808
|
"approveWorkflowProcess": "\u6307\u5B9A\u3057\u305F\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u30D7\u30ED\u30BB\u30B9\u306B\u5BFE\u3057\u3001\u627F\u8A8D\u306E\u30A2\u30AF\u30B7\u30E7\u30F3\u3092\u5B9F\u884C\u3059\u308B\u3002",
|
|
@@ -12487,6 +12870,7 @@ var operationDescriptions = {
|
|
|
12487
12870
|
"getUser": "\u30E6\u30FC\u30B6\u30FC\u30921\u4EF6\u53D6\u5F97\u3059\u308B\u3002",
|
|
12488
12871
|
"getUserAuthInfo": "\u30E6\u30FC\u30B6\u30FC\u8A8D\u8A3C\u60C5\u5831\u30921\u4EF6\u53D6\u5F97\u3059\u308B\u3002",
|
|
12489
12872
|
"getWorkflowModel": "\u516C\u958B\u4E2D\u306E\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u30E2\u30C7\u30EB\u30921\u4EF6\u53D6\u5F97\u3059\u308B\u3002\u516C\u958B\u4E2D\u306E\u30E2\u30C7\u30EB\u304C\u306A\u3044\u5834\u5408\u306F\u3001\u30E2\u30C7\u30EB\u5B9A\u7FA9\u306F\u7A7A\u306B\u306A\u308B\u3002",
|
|
12873
|
+
"getWorkflowModelSchemas": "\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u30E2\u30C7\u30EB\u306EJSON Schema\u3092\u8FD4\u3059\u3002type\u3092\u6307\u5B9A\u3059\u308B\u3068\u90E8\u5206\u53D6\u5F97\u3067\u304D\u308B\u3002",
|
|
12490
12874
|
"getWorkflowModelWithLatestModelHistory": "\u7DE8\u96C6\u4E2D\u306E\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u30E2\u30C7\u30EB\u30921\u4EF6\u53D6\u5F97\u3059\u308B\u3002",
|
|
12491
12875
|
"getWorkflowProcess": "\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u30D7\u30ED\u30BB\u30B9\u30921\u4EF6\u53D6\u5F97\u3059\u308B\u3002",
|
|
12492
12876
|
"hasAccessToken": "Slack\u30A2\u30AF\u30BB\u30B9\u30C8\u30FC\u30AF\u30F3\u306E\u4FDD\u5B58\u6709\u7121\u3092\u30C1\u30A7\u30C3\u30AF\u3059\u308B",
|
|
@@ -13078,6 +13462,13 @@ var operationParams = {
|
|
|
13078
13462
|
{ name: "modelId", in: "path", required: true, type: "string", description: "", example: "1" }
|
|
13079
13463
|
]
|
|
13080
13464
|
},
|
|
13465
|
+
"getWorkflowModelSchemas": {
|
|
13466
|
+
httpMethod: "GET",
|
|
13467
|
+
path: "/api/v1/schemas/model",
|
|
13468
|
+
params: [
|
|
13469
|
+
{ name: "type", in: "query", required: false, type: "string", description: "\u7701\u7565\u6642\u306F\u5168\u30B9\u30AD\u30FC\u30DE\u3092\u8FD4\u3059\u3002" }
|
|
13470
|
+
]
|
|
13471
|
+
},
|
|
13081
13472
|
"getWorkflowModelWithLatestModelHistory": {
|
|
13082
13473
|
httpMethod: "GET",
|
|
13083
13474
|
path: "/api/v1/models/{modelId}/edit",
|
|
@@ -13618,7 +14009,7 @@ var OPTIONS_WITH_VALUE = /* @__PURE__ */ new Set([
|
|
|
13618
14009
|
function getHelpRequestedCommand(argv) {
|
|
13619
14010
|
const args = argv.slice(2);
|
|
13620
14011
|
let helpRequested = false;
|
|
13621
|
-
let
|
|
14012
|
+
let command6 = null;
|
|
13622
14013
|
let i = 0;
|
|
13623
14014
|
while (i < args.length) {
|
|
13624
14015
|
const a = args[i];
|
|
@@ -13632,10 +14023,10 @@ function getHelpRequestedCommand(argv) {
|
|
|
13632
14023
|
i += 1;
|
|
13633
14024
|
continue;
|
|
13634
14025
|
}
|
|
13635
|
-
if (
|
|
14026
|
+
if (command6 === null) command6 = a;
|
|
13636
14027
|
i += 1;
|
|
13637
14028
|
}
|
|
13638
|
-
return { help: helpRequested, command: helpRequested ?
|
|
14029
|
+
return { help: helpRequested, command: helpRequested ? command6 : null };
|
|
13639
14030
|
}
|
|
13640
14031
|
function getOperationRequestSchema(operationId) {
|
|
13641
14032
|
return operationParams[operationId];
|
|
@@ -13646,7 +14037,7 @@ var EXIT_CODES = {
|
|
|
13646
14037
|
VALIDATION: 3,
|
|
13647
14038
|
NOT_FOUND: 4
|
|
13648
14039
|
};
|
|
13649
|
-
async function
|
|
14040
|
+
async function resolveBody(positional) {
|
|
13650
14041
|
if (positional) {
|
|
13651
14042
|
try {
|
|
13652
14043
|
return JSON.parse(positional);
|
|
@@ -13656,6 +14047,12 @@ async function resolveParams(positional) {
|
|
|
13656
14047
|
}
|
|
13657
14048
|
return void 0;
|
|
13658
14049
|
}
|
|
14050
|
+
function buildClientParams(operationId, namedParams, body) {
|
|
14051
|
+
const paramInfo = getOperationRequestSchema(operationId);
|
|
14052
|
+
if (!paramInfo?.requestBody) return namedParams;
|
|
14053
|
+
const { dtoName } = paramInfo.requestBody;
|
|
14054
|
+
return { ...namedParams, [dtoName]: body ?? {} };
|
|
14055
|
+
}
|
|
13659
14056
|
function placeholderForType(type) {
|
|
13660
14057
|
if (type === "string") return "";
|
|
13661
14058
|
if (type === "number" || type === "integer") return 0;
|
|
@@ -13665,13 +14062,6 @@ function placeholderForType(type) {
|
|
|
13665
14062
|
return {};
|
|
13666
14063
|
return "";
|
|
13667
14064
|
}
|
|
13668
|
-
function buildExampleParams(params) {
|
|
13669
|
-
const out = {};
|
|
13670
|
-
for (const p of params) {
|
|
13671
|
-
if (p.required) out[p.name] = placeholderForType(p.type);
|
|
13672
|
-
}
|
|
13673
|
-
return out;
|
|
13674
|
-
}
|
|
13675
14065
|
function buildExampleBody(properties) {
|
|
13676
14066
|
const out = {};
|
|
13677
14067
|
for (const p of properties) {
|
|
@@ -13698,6 +14088,11 @@ function buildRootHelpDescriptor() {
|
|
|
13698
14088
|
name: "config",
|
|
13699
14089
|
kind: "builtin-command",
|
|
13700
14090
|
summary: describe3()
|
|
14091
|
+
},
|
|
14092
|
+
{
|
|
14093
|
+
name: "schema",
|
|
14094
|
+
kind: "builtin-command",
|
|
14095
|
+
summary: describe4()
|
|
13701
14096
|
}
|
|
13702
14097
|
];
|
|
13703
14098
|
const config = resolveConfig();
|
|
@@ -13733,6 +14128,11 @@ function buildBuiltinHelpDescriptor(cmd) {
|
|
|
13733
14128
|
positionals = [...helpPositionals];
|
|
13734
14129
|
options = [...helpOptions3, ...GLOBAL_OPTIONS2];
|
|
13735
14130
|
exampleCommand = "acomo config show";
|
|
14131
|
+
} else if (cmd === "schema") {
|
|
14132
|
+
summary = describe4();
|
|
14133
|
+
positionals = [...helpPositionals2];
|
|
14134
|
+
options = [...helpOptions4, ...GLOBAL_OPTIONS2];
|
|
14135
|
+
exampleCommand = "acomo schema show";
|
|
13736
14136
|
} else {
|
|
13737
14137
|
return null;
|
|
13738
14138
|
}
|
|
@@ -13765,7 +14165,6 @@ function buildApiCommandHelpDescriptor(operationId) {
|
|
|
13765
14165
|
const pathParams = paramInfo.params.filter((p) => p.in === "path").map(toParamEntry);
|
|
13766
14166
|
const queryParams = paramInfo.params.filter((p) => p.in === "query").map(toParamEntry);
|
|
13767
14167
|
const requestBody = paramInfo.requestBody ? {
|
|
13768
|
-
dtoName: paramInfo.requestBody.dtoName,
|
|
13769
14168
|
properties: paramInfo.requestBody.properties.map((p) => {
|
|
13770
14169
|
const entry = {
|
|
13771
14170
|
name: p.name,
|
|
@@ -13777,29 +14176,38 @@ function buildApiCommandHelpDescriptor(operationId) {
|
|
|
13777
14176
|
return entry;
|
|
13778
14177
|
})
|
|
13779
14178
|
} : null;
|
|
13780
|
-
const
|
|
13781
|
-
|
|
13782
|
-
|
|
13783
|
-
|
|
13784
|
-
|
|
13785
|
-
|
|
13786
|
-
|
|
13787
|
-
const
|
|
13788
|
-
|
|
14179
|
+
const paramOptions = paramInfo.params.map((p) => ({
|
|
14180
|
+
name: p.name,
|
|
14181
|
+
type: p.type === "number" || p.type === "integer" ? "number" : p.type === "boolean" ? "boolean" : "string",
|
|
14182
|
+
description: normalizeDescription(p.description || ""),
|
|
14183
|
+
required: p.required
|
|
14184
|
+
}));
|
|
14185
|
+
const minimalArgs = paramInfo.requestBody ? buildExampleBody(paramInfo.requestBody.properties) : null;
|
|
14186
|
+
const optionsPart = paramInfo.params.filter((p) => p.required).map(
|
|
14187
|
+
(p) => `--${p.name} ${p.example !== void 0 ? String(p.example) : `<${p.type}>`}`
|
|
14188
|
+
).join(" ");
|
|
14189
|
+
const bodyPart = minimalArgs && Object.keys(minimalArgs).length > 0 ? ` '${JSON.stringify(minimalArgs)}'` : "";
|
|
14190
|
+
const exampleCommand = `acomo ${operationId}${optionsPart ? " " + optionsPart : ""}${bodyPart}`;
|
|
14191
|
+
const hasBody = !!paramInfo.requestBody;
|
|
14192
|
+
const hasParams = paramInfo.params.length > 0;
|
|
14193
|
+
const usageParts = [`acomo ${operationId}`];
|
|
14194
|
+
if (hasParams) usageParts.push("[--option value...]");
|
|
14195
|
+
if (hasBody) usageParts.push("[body]");
|
|
14196
|
+
const positionals = hasBody ? [
|
|
13789
14197
|
{
|
|
13790
|
-
name: "
|
|
14198
|
+
name: "body",
|
|
13791
14199
|
type: "object",
|
|
13792
14200
|
required: false,
|
|
13793
|
-
description: "
|
|
14201
|
+
description: "\u30EA\u30AF\u30A8\u30B9\u30C8\u30DC\u30C7\u30A3 JSON"
|
|
13794
14202
|
}
|
|
13795
|
-
];
|
|
14203
|
+
] : [];
|
|
13796
14204
|
return buildCommandHelp({
|
|
13797
14205
|
command: operationId,
|
|
13798
14206
|
kind: "api-command",
|
|
13799
14207
|
summary,
|
|
13800
|
-
usage:
|
|
14208
|
+
usage: usageParts.join(" "),
|
|
13801
14209
|
positionals,
|
|
13802
|
-
options: GLOBAL_OPTIONS2,
|
|
14210
|
+
options: [...paramOptions, ...GLOBAL_OPTIONS2],
|
|
13803
14211
|
inputSchema: {
|
|
13804
14212
|
pathParams,
|
|
13805
14213
|
queryParams,
|
|
@@ -13906,17 +14314,17 @@ async function handleError(error) {
|
|
|
13906
14314
|
process.exit(EXIT_CODES.GENERAL);
|
|
13907
14315
|
}
|
|
13908
14316
|
async function main() {
|
|
13909
|
-
const { help, command:
|
|
14317
|
+
const { help, command: command6 } = getHelpRequestedCommand(process.argv);
|
|
13910
14318
|
if (help) {
|
|
13911
14319
|
let descriptor;
|
|
13912
|
-
if (!
|
|
14320
|
+
if (!command6) {
|
|
13913
14321
|
descriptor = buildRootHelpDescriptor();
|
|
13914
14322
|
} else {
|
|
13915
|
-
const builtin = buildBuiltinHelpDescriptor(
|
|
14323
|
+
const builtin = buildBuiltinHelpDescriptor(command6);
|
|
13916
14324
|
if (builtin) {
|
|
13917
14325
|
descriptor = builtin;
|
|
13918
14326
|
} else {
|
|
13919
|
-
const api = buildApiCommandHelpDescriptor(
|
|
14327
|
+
const api = buildApiCommandHelpDescriptor(command6);
|
|
13920
14328
|
if (api) descriptor = api;
|
|
13921
14329
|
else descriptor = buildRootHelpDescriptor();
|
|
13922
14330
|
}
|
|
@@ -13927,7 +14335,29 @@ async function main() {
|
|
|
13927
14335
|
const pkg = JSON.parse(
|
|
13928
14336
|
readFileSync4(resolve5(scriptDir, "../package.json"), "utf-8")
|
|
13929
14337
|
);
|
|
13930
|
-
const argv = yargs_default(hideBin(process.argv)).scriptName("acomo").usage("Usage: $0 <command> [options]").help().alias("h", "help").version(pkg.version).alias("v", "version")
|
|
14338
|
+
const argv = yargs_default(hideBin(process.argv)).scriptName("acomo").usage("Usage: $0 <command> [options]").help().alias("h", "help").version(pkg.version).alias("v", "version").fail((msg, _err, yargs) => {
|
|
14339
|
+
if (msg === "\u30B3\u30DE\u30F3\u30C9\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002") {
|
|
14340
|
+
yargs.showHelp();
|
|
14341
|
+
process.exit(0);
|
|
14342
|
+
}
|
|
14343
|
+
const jsonMode = !process.stdout.isTTY;
|
|
14344
|
+
if (jsonMode) {
|
|
14345
|
+
console.error(
|
|
14346
|
+
JSON.stringify({
|
|
14347
|
+
error: true,
|
|
14348
|
+
code: "VALIDATION_ERROR",
|
|
14349
|
+
message: msg,
|
|
14350
|
+
suggestion: "\u5FC5\u9808\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`acomo <command> --help` \u3067\u30D1\u30E9\u30E1\u30FC\u30BF\u60C5\u5831\u3092\u78BA\u8A8D\u3067\u304D\u307E\u3059\u3002"
|
|
14351
|
+
})
|
|
14352
|
+
);
|
|
14353
|
+
} else {
|
|
14354
|
+
console.error(`\u5FC5\u9808\u30D1\u30E9\u30E1\u30FC\u30BF\u304C\u4E0D\u8DB3\u3057\u3066\u3044\u307E\u3059: ${msg}`);
|
|
14355
|
+
console.error(
|
|
14356
|
+
"`acomo <command> --help` \u3067\u30D1\u30E9\u30E1\u30FC\u30BF\u60C5\u5831\u3092\u78BA\u8A8D\u3067\u304D\u307E\u3059\u3002"
|
|
14357
|
+
);
|
|
14358
|
+
}
|
|
14359
|
+
process.exit(EXIT_CODES.VALIDATION);
|
|
14360
|
+
});
|
|
13931
14361
|
argv.command(
|
|
13932
14362
|
command2(),
|
|
13933
14363
|
describe(),
|
|
@@ -13946,6 +14376,12 @@ async function main() {
|
|
|
13946
14376
|
builder3,
|
|
13947
14377
|
handler3
|
|
13948
14378
|
);
|
|
14379
|
+
argv.command(
|
|
14380
|
+
command5(),
|
|
14381
|
+
describe4(),
|
|
14382
|
+
builder4,
|
|
14383
|
+
handler4
|
|
14384
|
+
);
|
|
13949
14385
|
const config = resolveConfig();
|
|
13950
14386
|
if (config) {
|
|
13951
14387
|
try {
|
|
@@ -13953,20 +14389,45 @@ async function main() {
|
|
|
13953
14389
|
const registry = buildOperationRegistry(configuration);
|
|
13954
14390
|
for (const [operationId] of registry) {
|
|
13955
14391
|
const paramInfo = getOperationRequestSchema(operationId);
|
|
14392
|
+
const hasBody = !!paramInfo?.requestBody;
|
|
13956
14393
|
argv.command(
|
|
13957
|
-
`${operationId} [
|
|
14394
|
+
hasBody ? `${operationId} [body]` : operationId,
|
|
13958
14395
|
operationDescriptions[operationId] ?? operationId,
|
|
13959
14396
|
(y) => {
|
|
13960
|
-
|
|
13961
|
-
|
|
13962
|
-
|
|
13963
|
-
|
|
14397
|
+
if (paramInfo) {
|
|
14398
|
+
for (const p of paramInfo.params) {
|
|
14399
|
+
const yargsType = p.type === "number" || p.type === "integer" ? "number" : p.type === "boolean" ? "boolean" : "string";
|
|
14400
|
+
y.option(p.name, {
|
|
14401
|
+
type: yargsType,
|
|
14402
|
+
description: p.description,
|
|
14403
|
+
demandOption: p.required
|
|
14404
|
+
});
|
|
14405
|
+
}
|
|
14406
|
+
}
|
|
14407
|
+
if (hasBody) {
|
|
14408
|
+
y.positional("body", {
|
|
14409
|
+
type: "string",
|
|
14410
|
+
description: "\u30EA\u30AF\u30A8\u30B9\u30C8\u30DC\u30C7\u30A3 JSON"
|
|
14411
|
+
});
|
|
14412
|
+
}
|
|
13964
14413
|
return y;
|
|
13965
14414
|
},
|
|
13966
14415
|
async (cmdArgv) => {
|
|
13967
14416
|
try {
|
|
13968
|
-
const
|
|
13969
|
-
cmdArgv.
|
|
14417
|
+
const body = await resolveBody(
|
|
14418
|
+
cmdArgv.body
|
|
14419
|
+
);
|
|
14420
|
+
const namedParams = {};
|
|
14421
|
+
if (paramInfo) {
|
|
14422
|
+
for (const p of paramInfo.params) {
|
|
14423
|
+
const val = cmdArgv[p.name];
|
|
14424
|
+
if (val !== void 0) namedParams[p.name] = val;
|
|
14425
|
+
}
|
|
14426
|
+
}
|
|
14427
|
+
const clientParams = buildClientParams(
|
|
14428
|
+
operationId,
|
|
14429
|
+
namedParams,
|
|
14430
|
+
body
|
|
13970
14431
|
);
|
|
13971
14432
|
const entry = registry.get(operationId);
|
|
13972
14433
|
const apiConfig = createConfiguration();
|
|
@@ -13974,7 +14435,7 @@ async function main() {
|
|
|
13974
14435
|
apiConfig
|
|
13975
14436
|
);
|
|
13976
14437
|
const rawResponse = await instance[entry.method + "Raw"](
|
|
13977
|
-
|
|
14438
|
+
clientParams
|
|
13978
14439
|
);
|
|
13979
14440
|
if (!rawResponse.raw.ok) {
|
|
13980
14441
|
throw new ResponseError(
|