@xeplr/actions 1.4.1 → 1.4.2

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
@@ -207,10 +207,18 @@ email.
207
207
  formulas and workflow's conditions, with the same functions. `where` and a
208
208
  computed column are the same language.
209
209
 
210
- **What `today()` means comes from the run's context**, not from the action:
211
- `context.formula` carries `today` and `fiscalYearStart`, so a workspace that
210
+ **What "today" means comes from the run's context**, not from the action:
211
+ `system.formula` carries `today` and `fiscalYearStart`, so a workspace that
212
212
  reckons days elsewhere and a run replayed from history agree on what
213
- `yesterday()` filtered. The action never calls `new Date()`.
213
+ `ytd()` filtered. The action never calls `new Date()`.
214
+
215
+ > `today()` and `yesterday()` are **not yet functions of
216
+ > `@xeplr/expression-handler`**: a formula using them is refused, naming the
217
+ > function. The example above shows where they will go.
218
+
219
+ **It is called like every other action**: `execute({ input, system })`.
220
+ Before 1.4.2 it took `(input, context)`, so through `runAction` (and so in
221
+ every workflow step) `from` was undefined and the step returned no rows.
214
222
 
215
223
  **Only visible columns are rendered.** A column kept for the next step but
216
224
  marked `hidden` stays in `rows` and never reaches the table — an id the flow
@@ -109,7 +109,12 @@ module.exports = {
109
109
  { name: 'text', type: 'string', description: 'The same, as plain text, for a mail client that refuses HTML.' }
110
110
  ],
111
111
 
112
- execute: async function(input, context) {
112
+ // The same call every action gets from runAction: { input, system }. It
113
+ // once took (input, context) — the runner's object landed in `input`,
114
+ // `from` was undefined, and every workflow step returned no rows.
115
+ execute: async function(call) {
116
+ var input = (call && call.input) || {};
117
+ var system = (call && call.system) || {};
113
118
  var given = input.from;
114
119
  // A list, always — one object is a list of one, and nothing is an empty
115
120
  // list rather than an error. The step after this one should not have to
@@ -120,7 +125,7 @@ module.exports = {
120
125
 
121
126
  // The run's own context decides what today is — and therefore what
122
127
  // yesterday is. See the note at the top.
123
- var ctx = (context && context.formula) || {};
128
+ var ctx = system.formula || {};
124
129
 
125
130
  var keep = null;
126
131
  if (input.where && String(input.where).trim()) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xeplr/actions",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
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": [