@jacebenson/jsn 4.3.8-dev.51 → 4.3.8-dev.53
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/package.json +1 -1
- package/src/commands/actions.js +21 -0
- package/src/commands/catalog.js +2 -2
package/package.json
CHANGED
package/src/commands/actions.js
CHANGED
|
@@ -9,6 +9,7 @@ import { cancelled, pickDesignerRecord, designerScope, guidedActionCreate, guide
|
|
|
9
9
|
const ACTION_COMMANDS = [
|
|
10
10
|
{ name: 'list', description: 'List actions' },
|
|
11
11
|
{ name: 'show [identifier]', description: 'Show an action by name or sys_id' },
|
|
12
|
+
{ name: 'help [identifier]', description: 'Show action input requirements and live usage examples' },
|
|
12
13
|
{ name: 'definition [identifier]', description: 'Read the full JSON definition including executable step_instances' },
|
|
13
14
|
{ name: 'step-types', description: 'Read step schema templates for a target scope' },
|
|
14
15
|
{ name: 'create', description: 'Create an action: guided in a terminal, full JSON definition in scripts' },
|
|
@@ -65,6 +66,26 @@ export const actionsCmd = wrap => {
|
|
|
65
66
|
app.ok(result, { summary: `Created and verified action ${result.sys_id}` });
|
|
66
67
|
}),
|
|
67
68
|
})
|
|
69
|
+
.command({
|
|
70
|
+
command: 'help [identifier]', describe: 'Show action input requirements and examples from flows on this instance',
|
|
71
|
+
builder: scopeOption,
|
|
72
|
+
handler: run(async (argv, app) => {
|
|
73
|
+
const id = await actionID(argv, app);
|
|
74
|
+
if (id === undefined) return;
|
|
75
|
+
const scope = await actionScope(app.sdk, id, argv.scope);
|
|
76
|
+
const definition = await app.sdk.getProcessFlowAction(id, scope);
|
|
77
|
+
const inputs = (definition.inputs || []).map(input => ({
|
|
78
|
+
name: input.name,
|
|
79
|
+
type: input.type || input.parameter?.type || input.parameter?.inputType || input.valueType || 'unknown',
|
|
80
|
+
mandatory: input.mandatory ?? input.required ?? input.parameter?.mandatory ?? input.parameter?.required ?? false,
|
|
81
|
+
default: input.defaultValue ?? input.default ?? input.parameter?.defaultValue ?? '',
|
|
82
|
+
description: input.description || input.label || input.parameter?.label || '',
|
|
83
|
+
}));
|
|
84
|
+
app.ok({ action: { id, name: definition.name, scope }, inputs, examples: [], examples_status: 'unverified',
|
|
85
|
+
examples_note: 'Live examples are not shown yet because this instance’s action-instance to snapshot relationship has not been verified.' },
|
|
86
|
+
{ summary: `Input help for action ${definition.name || id}` });
|
|
87
|
+
}),
|
|
88
|
+
})
|
|
68
89
|
.command({
|
|
69
90
|
command: 'definition [identifier]', describe: 'Read full JSON definition including executable step_instances',
|
|
70
91
|
builder: scopeOption,
|
package/src/commands/catalog.js
CHANGED
|
@@ -63,8 +63,8 @@ export function catalogCmd(wrap) {
|
|
|
63
63
|
for (const v of argv.variable) {
|
|
64
64
|
const parts = String(v).split(':');
|
|
65
65
|
if (parts.length >= 2) {
|
|
66
|
-
const typeName = parts
|
|
67
|
-
const label = parts.length >= 3 ? parts
|
|
66
|
+
const typeName = parts[1];
|
|
67
|
+
const label = parts.length >= 3 ? parts.slice(2).join(':') : parts[0];
|
|
68
68
|
const sysName = parts[0].replace(/[^a-zA-Z0-9_]/g, '_').toLowerCase();
|
|
69
69
|
try {
|
|
70
70
|
await app.sdk.create('item_option_new', {
|