@jacebenson/jsn 4.3.8-dev.50 → 4.3.8-dev.52
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 +22 -1
- package/src/commands/flows.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' },
|
|
@@ -55,7 +56,7 @@ export const actionsCmd = wrap => {
|
|
|
55
56
|
describe: 'Flow Designer actions: create, edit full definitions, and test with outputs',
|
|
56
57
|
builder: y => base.builder(y)
|
|
57
58
|
.command({
|
|
58
|
-
command: 'create', describe:
|
|
59
|
+
command: 'create', describe: `Create parent and executable Process Flow action; verify persistence. --data/--data-file requires a full definition with inputs, outputs, and steps arrays. Variables have name and type; each step requires cid, step_type, and inputs, outputs, extended_inputs, extended_outputs arrays. Use step_types for valid step_type schema. Example (structure only):\n{"name":"Example action","inputs":[{"name":"record_id","type":"string"}],"outputs":[],"steps":[{"cid":"step-1","step_type":"<stepTypeFromSchema>","inputs":[],"outputs":[],"extended_inputs":[],"extended_outputs":[]}]}`,
|
|
59
60
|
builder: yy => dataOptions(yy).option('scope', { type: 'string', describe: 'Exact target scope sys_id, or global' }),
|
|
60
61
|
handler: run(async (argv, app) => {
|
|
61
62
|
const guided = !hasDefinitionData(argv) ? await guidedActionCreate(argv, app) : undefined;
|
|
@@ -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/flows.js
CHANGED
|
@@ -294,7 +294,7 @@ export function flowsCmd(wrap) {
|
|
|
294
294
|
})
|
|
295
295
|
.command({
|
|
296
296
|
command: 'create',
|
|
297
|
-
describe:
|
|
297
|
+
describe: `Create a draft flow. JSON manifest fields: name (required), scope (required), optional description, trigger { type (required), optional table, condition, inputs }, actions (required array of { type, optional inputs }). Trigger type must be supported; trigger inputs and action inputs are objects. Flow Logic, subflows, variables, and errorHandling are unsupported. Example:\n{"name":"Approval flow","scope":"global","trigger":{"type":"record_create_or_update","table":"incident"},"actions":[{"type":"<actionTypeSysId>","inputs":{"message":"Created"}}]}`,
|
|
298
298
|
builder: (y) => y
|
|
299
299
|
.option('data', { type: 'string', describe: 'Flow manifest as inline JSON' })
|
|
300
300
|
.option('data-file', { type: 'string', describe: 'Read the flow manifest from a JSON file' })
|
|
@@ -322,7 +322,7 @@ export function flowsCmd(wrap) {
|
|
|
322
322
|
.command({
|
|
323
323
|
command: 'update [identifier]',
|
|
324
324
|
aliases: ['edit'],
|
|
325
|
-
describe:
|
|
325
|
+
describe: `Safely update an inactive Draft flow. JSON may contain scope, trigger { optional type: "record_create_or_update", table and/or condition }, and/or actions [{ order (positive integer), type, inputs (non-empty object of changed values) }]. Only existing trigger and action inputs are updated; omitted values are preserved. Example:\n{"trigger":{"table":"incident","condition":"active=true"},"actions":[{"order":1,"type":"<existingActionTypeSysId>","inputs":{"message":"Updated"}}]}`,
|
|
326
326
|
builder: (y) => y
|
|
327
327
|
.option('data', { type: 'string', describe: 'Update manifest as inline JSON' })
|
|
328
328
|
.option('data-file', { type: 'string', describe: 'Read the update manifest from a JSON file' })
|