@xeplr/actions 1.1.24 → 1.3.0

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/README.md CHANGED
@@ -87,7 +87,7 @@ var moved = await actions.runAction(actions.builtins.dbMove, {
87
87
  |---|---|
88
88
  | `name` | Required. |
89
89
  | `description` | Text for pickers. |
90
- | `inputSchema` | `[{ name, type, required, default, description, order, ... }]`, validated by `@xeplr/schema-handler` `applySchema`. Built-ins also use `group`, `showWhen`, `system`, `options`, `optionsFrom`, `dependsOn` — hints for a form; validation treats every field the same. |
90
+ | `inputSchema` | `[{ name, type, required, default, description, order, ... }]`, validated by `@xeplr/schema-handler` `applySchema`. Built-ins also use `group`, `showWhen`, `system`, `options`, `optionsFrom`, `dependsOn`, `label`, `hidden` (left out of a form unless a value is already set), `suggestFrom` / `suggestWith` (a host option source that suggests values, asked with the named sibling inputs; `db-procedure`'s parameters ask `procedureParams` with the connection, database and procedure) and `control` (`'parameters'`: `[{ name, value }]` shown as rows, a value fixed or bound to the run's window: `{window.from}` / `{window.to}`, see `@xeplr/jobs`) — hints for a form; validation treats every field the same. |
91
91
  | `outputSchema` | Optional documentation of the return value. |
92
92
  | `requires` | Module names checked with `require.resolve` at `register()`. |
93
93
  | `execute({ input, system, metaStore })` | Returns (or resolves to) the output. |
@@ -159,7 +159,7 @@ For `mode: 'table'` the source's declared column types (`getTableSchema`) are pa
159
159
  | `mysql` | `CALL name(?, ?)` — positional; names are ignored (and logged as such) |
160
160
  | `postgres` | `SELECT * FROM fn(param => …)` when `returnsRows` (default `true`), `CALL proc(param => …)` when `false` |
161
161
 
162
- `params` is `[{ name, value }]` or bare values; values are always bound. `''` becomes `null`, integer- and decimal-looking strings become numbers, and an object value is an error naming the parameter. A schema-qualified name (`dbo.usp_x`) is quoted per part. `window: { from, to, fromParam, toParam }` appends the two bounds as parameters after `params` (null edges passed as `NULL`); a window without `fromParam`/`toParam` is refused. `maxRows` fails the run when more rows come back. If `system.log` is supplied it gets the statement, parameter count and window bounds — not the other parameter values.
162
+ `params` is `[{ name, value }]` or bare values; values are always bound. `''` becomes `null`, integer- and decimal-looking strings become numbers, and an object value is an error naming the parameter. A schema-qualified name (`dbo.usp_x`) is quoted per part. `window: { from, to, fromParam, toParam }` appends the two bounds as parameters after `params` (null edges passed as `NULL`); a window without `fromParam`/`toParam` is refused. From a job, the usual way to pass dates is as ordinary parameters bound to the run's window, `{ "name": "startDate", "value": "{window.from}" }` (`@xeplr/jobs` fills them in); `params` carries `control: 'parameters'` and `window` is `hidden`, so a form shows rows instead of JSON. `maxRows` fails the run when more rows come back. If `system.log` is supplied it gets the statement, parameter count and window bounds — not the other parameter values.
163
163
 
164
164
  ### Email
165
165
 
@@ -89,13 +89,24 @@ module.exports = {
89
89
  // Half-open, from <= x < to. The next run starts at exactly this run's
90
90
  // `to`, so a procedure treating `to` as inclusive double-counts the
91
91
  // boundary row every time.
92
- { name: 'window', type: 'object', order: 6, group: 'Incremental',
92
+ // `hidden`: a form leaves it out unless a job already holds one. A job's
93
+ // dates now reach a procedure as ordinary parameters bound to the run's
94
+ // window — see `params` — which needs no names typed into JSON here.
95
+ { name: 'window', type: 'object', order: 6, group: 'Incremental', hidden: true,
93
96
  description: '{ from, to, fromParam, toParam } — the period this run covers, passed as the ' +
94
97
  'named parameters fromParam/toParam. Filled automatically for a job with ' +
95
98
  'incrementalMode "period"; name the two parameters and leave from/to empty. ' +
96
99
  'A window without fromParam/toParam is refused rather than silently dropped.' },
97
100
 
98
- { name: 'params', type: 'array', order: 7,
101
+ // `control: 'parameters'`: a form shows these as rows — a name and where
102
+ // its value comes from (a fixed value, or the start / end of the run's
103
+ // window, which a job binds as "{window.from}" / "{window.to}").
104
+ // `suggestFrom`: where a form finds the procedure's own parameter names
105
+ // (a host option source), asked with the values of `suggestWith` — the
106
+ // connection, database and procedure chosen above.
107
+ { name: 'params', type: 'array', order: 7, control: 'parameters', label: 'Parameters',
108
+ suggestFrom: 'procedureParams',
109
+ suggestWith: { connectionId: 'connectionInfoId', dbInfoId: 'dbInfoId', procedure: 'procedure' },
99
110
  description: 'Parameters, as [{ name, value }] or bare values. Named entries are matched by ' +
100
111
  'name on postgres and mssql; MySQL has no named-argument syntax, so there they ' +
101
112
  'are positional and must be in the order the procedure declares them.' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xeplr/actions",
3
- "version": "1.1.24",
3
+ "version": "1.3.0",
4
4
  "description": "Named-action registry with typed inputs and safe invocation — plus built-in actions for HTTP, DB, files, email, spawn",
5
5
  "main": "index.js",
6
6
  "files": [