@colixsystems/widget-sdk 0.169.0 → 0.170.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
@@ -73,7 +73,20 @@ See the design reference for the full architecture: [`docs/architecture/widget-m
73
73
 
74
74
  ## Status
75
75
 
76
- `v0.169.0` — pre-publish. The package surface (types, function names, export paths) is the v1 contract; runtime behaviour for some hooks is stubbed (each hook documents what's wired and what isn't). It is **not yet published to npm**.
76
+ `v0.170.0` — pre-publish. The package surface (types, function names, export paths) is the v1 contract; runtime behaviour for some hooks is stubbed (each hook documents what's wired and what isn't). It is **not yet published to npm**.
77
+
78
+ ### What's new in 0.170.0 (contract 1.131.0)
79
+
80
+ **An action script receives the parameters a Run action event sent — `input` joins `CONTRACT.actionScriptGlobals` (sc-9031).** A button or widget event bound to "Run action" could start an Action but could not tell it anything, so authors wrote the value into a row and switched to a record trigger. The binding now carries `params`, and a widget event's payload is forwarded with them:
81
+
82
+ ```js
83
+ if (!input || typeof input.client_id !== "string") return;
84
+ await connectors.call("crm", { path: `/clients/${encodeURIComponent(input.client_id)}/sync`, method: "POST" });
85
+ ```
86
+
87
+ - **Deep-frozen, null elsewhere.** `input` is `null` on `schedule`, `record_*`, `manual` and `http_post` runs, so `if (input)` is the guard.
88
+ - **Untrusted.** It comes from the app user's device; validate it. The run still executes as the Action's bound integration identity.
89
+ - **Widget side unchanged.** A widget passes data with the emitter it already has: `useWidgetEvent("slotChosen")({ slot })`. The author binds that event to Run action.
77
90
 
78
91
  ### What's new in 0.169.0 (contract 1.130.0)
79
92
 
package/dist/contract.cjs CHANGED
@@ -2451,6 +2451,8 @@ const ACTION_SCRIPT_GLOBALS = [
2451
2451
  "triggerTableId",
2452
2452
  // sc-7885 — who initiated the run; null on `schedule` / `record_*`.
2453
2453
  "triggeredBy",
2454
+ // sc-9031 — a Run action event's parameters; null on every other trigger.
2455
+ "input",
2454
2456
  ];
2455
2457
  // Mirrors action.service.js SCRIPT_MAX_BYTES.
2456
2458
  const ACTION_SCRIPT_MAX_BYTES = 200 * 1024;
@@ -4607,7 +4609,11 @@ const CONTRACT = deepFreeze({
4607
4609
  // `useFilestoreCopy`. Widgets can now create Filestore folders and copy a
4608
4610
  // file into another folder or space (project / public / personal); the
4609
4611
  // filestore client gains `files.copy`.
4610
- version: "1.130.0",
4612
+ // 1.131.0: additive (sc-9031) — `input` joins `actionScriptGlobals`: the
4613
+ // parameters a Run action event sent (the binding's `params` merged over
4614
+ // the emitting widget's payload), deep-frozen, null on every non-`app`
4615
+ // trigger. Additive: a script that never reads it runs unchanged.
4616
+ version: "1.131.0",
4611
4617
  sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
4612
4618
  hooks: HOOKS,
4613
4619
  primitives: PRIMITIVES,
package/dist/contract.js CHANGED
@@ -2447,6 +2447,8 @@ const ACTION_SCRIPT_GLOBALS = [
2447
2447
  "triggerTableId",
2448
2448
  // sc-7885 — who initiated the run; null on `schedule` / `record_*`.
2449
2449
  "triggeredBy",
2450
+ // sc-9031 — a Run action event's parameters; null on every other trigger.
2451
+ "input",
2450
2452
  ];
2451
2453
  // Mirrors action.service.js SCRIPT_MAX_BYTES.
2452
2454
  const ACTION_SCRIPT_MAX_BYTES = 200 * 1024;
@@ -4603,7 +4605,11 @@ const CONTRACT = deepFreeze({
4603
4605
  // `useFilestoreCopy`. Widgets can now create Filestore folders and copy a
4604
4606
  // file into another folder or space (project / public / personal); the
4605
4607
  // filestore client gains `files.copy`.
4606
- version: "1.130.0",
4608
+ // 1.131.0: additive (sc-9031) — `input` joins `actionScriptGlobals`: the
4609
+ // parameters a Run action event sent (the binding's `params` merged over
4610
+ // the emitting widget's payload), deep-frozen, null on every non-`app`
4611
+ // trigger. Additive: a script that never reads it runs unchanged.
4612
+ version: "1.131.0",
4607
4613
  sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
4608
4614
  hooks: HOOKS,
4609
4615
  primitives: PRIMITIVES,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colixsystems/widget-sdk",
3
- "version": "0.169.0",
3
+ "version": "0.170.0",
4
4
  "description": "Common widget interface for AppStudio. Implements WidgetManifest, WidgetContext, property schema, and helper hooks.",
5
5
  "homepage": "https://github.com/Colix-AB/AppStudio",
6
6
  "type": "module",