openxiangda 1.0.110 → 1.0.111
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/lib/cli.js
CHANGED
|
@@ -132,7 +132,7 @@ Usage:
|
|
|
132
132
|
openxiangda menu update|sort [--json-file file] [--write-manifest]
|
|
133
133
|
openxiangda menu bind <menuCode> --menu-id <id>
|
|
134
134
|
openxiangda workflow compile <workflow.ts> [--check] [--stdout] [--out-definition file] [--out-preview file]
|
|
135
|
-
openxiangda workflow list [--profile name] [--form-code code] [--json]
|
|
135
|
+
openxiangda workflow list [--profile name] [--form-code code] [--json] [--all]
|
|
136
136
|
openxiangda workflow create <workflowCode> --form-code <formCode> --definition-json <file>
|
|
137
137
|
openxiangda workflow bind <workflowCode> --workflow-id <id>
|
|
138
138
|
openxiangda workflow publish <workflowCode|workflowId>
|
|
@@ -171,6 +171,7 @@ JS_CODE V2 使用 trusted_node;AI 源码必须写在 src/js-code-nodes/<script
|
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
const SUBCOMMAND_BOOLEAN_FLAGS = new Set([
|
|
174
|
+
'--all',
|
|
174
175
|
'--dry-run',
|
|
175
176
|
'--enabled',
|
|
176
177
|
'--force',
|
|
@@ -1377,7 +1378,7 @@ async function workspace(args) {
|
|
|
1377
1378
|
const [subcommand, ...rest] = args;
|
|
1378
1379
|
const { flags, positional } = parseArgs(rest);
|
|
1379
1380
|
if (wantsSubcommandHelp(subcommand, flags)) {
|
|
1380
|
-
|
|
1381
|
+
printWorkspaceHelp();
|
|
1381
1382
|
return;
|
|
1382
1383
|
}
|
|
1383
1384
|
const config = loadConfig();
|
|
@@ -1527,6 +1528,34 @@ async function workspace(args) {
|
|
|
1527
1528
|
fail('用法: openxiangda workspace init|bind|publish [--changed [--since ref]|--form code|--page code|--only list] [--dry-run] [--force] [--resources|--skip-resources]');
|
|
1528
1529
|
}
|
|
1529
1530
|
|
|
1531
|
+
function printWorkspaceHelp() {
|
|
1532
|
+
print(`OpenXiangda workspace
|
|
1533
|
+
|
|
1534
|
+
Usage:
|
|
1535
|
+
openxiangda workspace init [dir] [--name package-name] [--runtime legacy|react-spa] [--install] [--force]
|
|
1536
|
+
openxiangda workspace init [dir] --profile <name> --app-name <app-name> [--runtime legacy|react-spa] [--description text] [--install] [--force]
|
|
1537
|
+
openxiangda workspace init [dir] --profile <name> --app-type <APP_XXX> [--runtime legacy|react-spa] [--install] [--force]
|
|
1538
|
+
openxiangda workspace bind --profile <name> --app-type <APP_XXX>
|
|
1539
|
+
openxiangda workspace publish --profile <name> [--changed [--since ref]|--form code|--page code|--only list] [--dry-run] [--force] [--resources|--skip-resources] [--prune]
|
|
1540
|
+
|
|
1541
|
+
React SPA:
|
|
1542
|
+
openxiangda workspace publish --profile <name> --form <formCode> # sync form schema only
|
|
1543
|
+
openxiangda resource publish --profile <name>
|
|
1544
|
+
openxiangda runtime deploy --profile <name>
|
|
1545
|
+
|
|
1546
|
+
Options:
|
|
1547
|
+
--runtime legacy|react-spa Workspace template/runtime mode.
|
|
1548
|
+
--app-name <name> Create and bind a new platform app.
|
|
1549
|
+
--app-type <APP_XXX> Bind an existing platform app.
|
|
1550
|
+
--form <code> Publish one form schema/page.
|
|
1551
|
+
--page <code> Publish one classic page.
|
|
1552
|
+
--only pages/a,forms/b Publish selected classic resources.
|
|
1553
|
+
--changed [--since ref] Publish changed classic resources.
|
|
1554
|
+
--dry-run Show planned work without writing.
|
|
1555
|
+
--resources / --skip-resources Include or skip src/resources publish.
|
|
1556
|
+
--legacy-form-bundle Force legacy workspace publish in React SPA workspaces.`);
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1530
1559
|
async function app(args) {
|
|
1531
1560
|
const [subcommand, ...rest] = args;
|
|
1532
1561
|
const { flags, positional } = parseArgs(rest);
|
|
@@ -1980,7 +2009,7 @@ async function workflow(args) {
|
|
|
1980
2009
|
const { subcommand, rest } = parseSubcommandArgs(args);
|
|
1981
2010
|
const { flags, positional } = parseArgs(rest);
|
|
1982
2011
|
if (wantsSubcommandHelp(subcommand, flags)) {
|
|
1983
|
-
|
|
2012
|
+
printWorkflowHelp();
|
|
1984
2013
|
return;
|
|
1985
2014
|
}
|
|
1986
2015
|
const config = loadConfig();
|
|
@@ -2041,8 +2070,9 @@ async function workflow(args) {
|
|
|
2041
2070
|
}
|
|
2042
2071
|
)
|
|
2043
2072
|
);
|
|
2044
|
-
|
|
2045
|
-
|
|
2073
|
+
const output = flags.all ? data : filterManifestBackedWorkflows(data);
|
|
2074
|
+
if (flags.json) return writeJson(output);
|
|
2075
|
+
print(JSON.stringify(output, null, 2));
|
|
2046
2076
|
return;
|
|
2047
2077
|
}
|
|
2048
2078
|
|
|
@@ -2084,8 +2114,8 @@ async function workflow(args) {
|
|
|
2084
2114
|
body: {
|
|
2085
2115
|
formUuid,
|
|
2086
2116
|
definitionJson,
|
|
2087
|
-
...(flags['view-json']
|
|
2088
|
-
? { viewJson: readJsonArg(flags['view-json'], '
|
|
2117
|
+
...(flags['preview-json'] || flags['view-json']
|
|
2118
|
+
? { viewJson: readJsonArg(flags['preview-json'] || flags['view-json'], 'preview-json') }
|
|
2089
2119
|
: {}),
|
|
2090
2120
|
},
|
|
2091
2121
|
}
|
|
@@ -2192,6 +2222,49 @@ async function workflow(args) {
|
|
|
2192
2222
|
fail('用法: openxiangda workflow compile|list|create|bind|pull|publish|delete|validate');
|
|
2193
2223
|
}
|
|
2194
2224
|
|
|
2225
|
+
function printWorkflowHelp() {
|
|
2226
|
+
print(`OpenXiangda workflow
|
|
2227
|
+
|
|
2228
|
+
Usage:
|
|
2229
|
+
openxiangda workflow compile <workflow.ts> [--check] [--stdout|--json] [--out-definition file] [--out-preview file]
|
|
2230
|
+
openxiangda workflow list [--profile name] [--form-code code|--form-uuid FORM_XXX] [--published true|false] [--page n] [--page-size n] [--json] [--all]
|
|
2231
|
+
openxiangda workflow create <workflowCode> --form-code <formCode> --definition-json <file> [--preview-json file] [--publish]
|
|
2232
|
+
openxiangda workflow bind <workflowCode> --workflow-id <id> [--form-code code|--form-uuid FORM_XXX]
|
|
2233
|
+
openxiangda workflow pull <workflowCode|workflowId> [--out file] [--json]
|
|
2234
|
+
openxiangda workflow publish <workflowCode|workflowId> [--profile name]
|
|
2235
|
+
openxiangda workflow delete <workflowCode|workflowId> [--yes]
|
|
2236
|
+
openxiangda workflow validate --definition-json <file> [--strict] [--publish]
|
|
2237
|
+
|
|
2238
|
+
Notes:
|
|
2239
|
+
- Prefer semantic DSL: src/workflows/<code>/workflow.ts + defineWorkflow().
|
|
2240
|
+
- Run workspace publish --form <formCode> before publishing workflow resources for React SPA process forms.
|
|
2241
|
+
- workflow list hides platform shell workflows with empty resourceCode by default; pass --all to inspect raw platform rows.`);
|
|
2242
|
+
}
|
|
2243
|
+
|
|
2244
|
+
function filterManifestBackedWorkflows(data) {
|
|
2245
|
+
const shouldKeep = item => item && String(item.resourceCode || '').trim();
|
|
2246
|
+
if (Array.isArray(data)) {
|
|
2247
|
+
return data.filter(shouldKeep);
|
|
2248
|
+
}
|
|
2249
|
+
if (!data || typeof data !== 'object') return data;
|
|
2250
|
+
for (const key of ['data', 'items', 'list', 'records']) {
|
|
2251
|
+
if (Array.isArray(data[key])) {
|
|
2252
|
+
const filtered = data[key].filter(shouldKeep);
|
|
2253
|
+
return {
|
|
2254
|
+
...data,
|
|
2255
|
+
[key]: filtered,
|
|
2256
|
+
totalCount: Object.prototype.hasOwnProperty.call(data, 'totalCount')
|
|
2257
|
+
? filtered.length
|
|
2258
|
+
: data.totalCount,
|
|
2259
|
+
total: Object.prototype.hasOwnProperty.call(data, 'total')
|
|
2260
|
+
? filtered.length
|
|
2261
|
+
: data.total,
|
|
2262
|
+
};
|
|
2263
|
+
}
|
|
2264
|
+
}
|
|
2265
|
+
return data;
|
|
2266
|
+
}
|
|
2267
|
+
|
|
2195
2268
|
async function automation(args) {
|
|
2196
2269
|
const { subcommand, rest } = parseSubcommandArgs(args);
|
|
2197
2270
|
const { flags, positional } = parseArgs(rest);
|
|
@@ -163,7 +163,7 @@ When the user provides a root domain such as `https://yida.wisejob.cn/`, use it
|
|
|
163
163
|
- For workflow/automation JS_CODE nodes, prefer V2 `runtimeMode: "trusted_node"`. AI-authored source must be TypeScript under `src/js-code-nodes/<scriptCode>/index.ts`, `src/automations/<resourceCode>/index.ts`, or `src/functions/<functionCode>/index.ts`. `pnpm build-js-code --script <scriptCode>` runs TypeScript validation before bundling, and `sourceFile.localPath` should point to the TS source; the CLI builds, uploads, and replaces it with snapshot metadata during validate/create.
|
|
164
164
|
- Form permission group resources must have stable local codes. Use unique `code` values such as `ticket_reporter_view` and `ticket_repairer_view`; do not rely on the form code when one form has multiple groups.
|
|
165
165
|
- Workflow resources should prefer `workflowFile` + `defineWorkflow` semantic DSL over hand-written raw JSON. For workflows bound by `formCode`, run `openxiangda workspace publish --form <formCode>` first so the process form schema/table is initialized, then run `openxiangda workflow compile <workflow.ts> --check` and `openxiangda resource publish --dry-run --profile <name>` before publish; use `sdk.process.resolveCapabilities(...)` or `ProcessActionBar` / `ProcessTimeline` from `openxiangda/runtime/react` for runtime buttons and timelines instead of hard-coded operation lists.
|
|
166
|
-
- Workflow resources can be created as drafts. After resource publish, verify `openxiangda workflow list --profile <name> --json` and run `openxiangda workflow publish <workflowCode> --profile <name>` until `isPublished: true` is visible.
|
|
166
|
+
- Workflow resources can be created as drafts. After resource publish, verify `openxiangda workflow list --profile <name> --json` and run `openxiangda workflow publish <workflowCode> --profile <name>` until `isPublished: true` is visible. `workflow list` hides platform shell workflows with empty `resourceCode` by default; pass `--all` only when diagnosing raw platform rows.
|
|
167
167
|
|
|
168
168
|
## Subskills
|
|
169
169
|
|
|
@@ -93,7 +93,7 @@ openxiangda form bind customer --form-uuid FORM_XXX --profile dev
|
|
|
93
93
|
openxiangda workflow list --profile dev --json
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
Use `workflow pull` to inspect the live definition. Use `workflow list --json` after publishing and confirm the target shows `isPublished: true`; resource publish can create/update a draft without activating it. Use logical workflow codes locally; never copy a workflow ID from one profile to another.
|
|
96
|
+
Use `workflow pull` to inspect the live definition. Use `workflow list --json` after publishing and confirm the target shows `isPublished: true`; resource publish can create/update a draft without activating it. `workflow list` hides platform shell workflows with empty `resourceCode` by default; use `--all` only for raw platform diagnostics. Use logical workflow codes locally; never copy a workflow ID from one profile to another.
|
|
97
97
|
|
|
98
98
|
## JS_CODE V2
|
|
99
99
|
|