@colixsystems/widget-sdk 0.315.2 → 0.315.3

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
@@ -90,7 +90,11 @@ See the design reference for the full architecture: [`docs/architecture/widget-m
90
90
 
91
91
  ## Status
92
92
 
93
- `v0.315.2` — 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**.
93
+ `v0.315.3` — 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**.
94
+
95
+ ### What's new in 0.315.3 (contract 1.255.1)
96
+
97
+ **`useAction()` is no longer refused with `ACTION_PAUSED`.** No plan caps how many Actions a workspace runs, so an Action is never paused: a switched-on Action runs, and `enqueue` is refused only when the Action is switched off (`ACTION_DISABLED`) or the workspace already has 10 queued runs (`RATE_LIMITED`). Code that still handles `ACTION_PAUSED` keeps working; it is simply never reached.
94
98
 
95
99
  ### What's new in 0.315.2 (contract 1.255.0)
96
100
 
@@ -174,7 +178,7 @@ See the design reference for the full architecture: [`docs/architecture/widget-m
174
178
 
175
179
  ### What's new in 0.299.0 (contract 1.246.0)
176
180
 
177
- **`useAction()` can queue a run instead of waiting for it.** The hook now returns `enqueue(input)` beside `run(input)`. `run` still waits for the Action and hands back its `respond()` value, and must finish within 500 ms of the press. `enqueue` resolves as soon as the server has queued the run, with the same refusals as `run` (`ACTION_NOT_APP_INVOKABLE`, `ACTION_NOT_FOUND`, `INVALID_ACTION_INPUT`, `RATE_LIMITED`, a signed-out caller). The Action then runs away from the request with its normal time limits, the way a scheduled run does, and a pod restart does not lose it. Nothing comes back: `running`, `result` and `error` stay as they were. Use it to start work the widget needs no answer from (a batch, a sync, a long send), and tell the user it has started, not that it is done. It is also refused, rather than queued, when the Action is switched off (`ACTION_DISABLED`) or paused (`ACTION_PAUSED`), and with `RATE_LIMITED` when the workspace already has 10 queued runs waiting or running. It can run twice: a scheduler restarted mid-run starts it again, so write the Action to be safe to repeat. On a host whose actions client cannot queue, `enqueue` rejects `UNAVAILABLE`. The injected client is `@colixsystems/actions-client` 0.4.0.
181
+ **`useAction()` can queue a run instead of waiting for it.** The hook now returns `enqueue(input)` beside `run(input)`. `run` still waits for the Action and hands back its `respond()` value, and must finish within 500 ms of the press. `enqueue` resolves as soon as the server has queued the run, with the same refusals as `run` (`ACTION_NOT_APP_INVOKABLE`, `ACTION_NOT_FOUND`, `INVALID_ACTION_INPUT`, `RATE_LIMITED`, a signed-out caller). The Action then runs away from the request with its normal time limits, the way a scheduled run does, and a pod restart does not lose it. Nothing comes back: `running`, `result` and `error` stay as they were. Use it to start work the widget needs no answer from (a batch, a sync, a long send), and tell the user it has started, not that it is done. It is also refused, rather than queued, when the Action is switched off (`ACTION_DISABLED`), and with `RATE_LIMITED` when the workspace already has 10 queued runs waiting or running. It can run twice: a scheduler restarted mid-run starts it again, so write the Action to be safe to repeat. On a host whose actions client cannot queue, `enqueue` rejects `UNAVAILABLE`. The injected client is `@colixsystems/actions-client` 0.4.0.
178
182
 
179
183
  ```jsx
180
184
  const { available, enqueue } = useAction(props.actionId);
@@ -357,7 +361,7 @@ const fresh = seen ? data.length - shown.length : 0;
357
361
 
358
362
  ### What's new in 0.268.0 (contract 1.218.0)
359
363
 
360
- **`useAction().available` tells the truth about the Action.** It used to be true whenever an Action was bound, so a widget offered a run that could never happen. It now turns false once the server says a run would not reach the script: the Action is switched off or paused, not allowed from the app, gone, or the viewer is not a signed-in app user (signed-out visitors and anonymous accounts can't run Actions). It is asked again when the binding or the signed-in user changes, and stays true while no answer has come. The actions client (`@colixsystems/actions-client` 0.2.0) gains `status(actionId)` for it.
364
+ **`useAction().available` tells the truth about the Action.** It used to be true whenever an Action was bound, so a widget offered a run that could never happen. It now turns false once the server says a run would not reach the script: the Action is switched off, not allowed from the app, gone, or the viewer is not a signed-in app user (signed-out visitors and anonymous accounts can't run Actions). It is asked again when the binding or the signed-in user changes, and stays true while no answer has come. The actions client (`@colixsystems/actions-client` 0.2.0) gains `status(actionId)` for it.
361
365
 
362
366
  ### What's new in 0.267.1 (contract 1.217.0)
363
367
 
package/dist/contract.cjs CHANGED
@@ -2299,7 +2299,7 @@ const HOOKS = [
2299
2299
  "`available` is false and run() rejects UNAVAILABLE; render a visible " +
2300
2300
  "'pick an action' state, NEVER a blank box. sc-14224: `available` also " +
2301
2301
  "turns false once the server says a run would not reach the script — " +
2302
- "the Action is switched off or paused, not allowed from the app, gone, " +
2302
+ "the Action is switched off, not allowed from the app, gone, " +
2303
2303
  "or the viewer is not a signed-in app user (signed-out visitors and " +
2304
2304
  "anonymous accounts can't run Actions) — so render an 'isn't available' " +
2305
2305
  "state then too. It stays true while no answer has come. A changed binding clears " +
@@ -2324,15 +2324,15 @@ const HOOKS = [
2324
2324
  "respond() value, and running/result/error are untouched — so use it to " +
2325
2325
  "start work the widget needs no answer from (a batch, a sync, a long " +
2326
2326
  "send) and tell the user it has started, never that it is done. " +
2327
- "It is also refused when the Action is switched off (ACTION_DISABLED) " +
2328
- "or paused (ACTION_PAUSED), and with RATE_LIMITED when the workspace " +
2327
+ "It is also refused when the Action is switched off (ACTION_DISABLED), " +
2328
+ "and with RATE_LIMITED when the workspace " +
2329
2329
  "already has 10 queued runs waiting. A queued run can run twice (a " +
2330
2330
  "restart mid-run starts it again), so its Action must be safe to repeat. " +
2331
2331
  "Reads ctx.actions.",
2332
2332
  returnShape: {
2333
2333
  available: "boolean // false when no Action is bound, the host brokers none, or the server says a run would not reach the script",
2334
2334
  run: "(input) => Promise<unknown> // input is optional; resolves with the Action's respond() value, or null; rejects with ActionError",
2335
- enqueue: "(input) => Promise<void> // input is optional; resolves once the run is queued, returns nothing; rejects with ActionError (run's codes plus ACTION_DISABLED, ACTION_PAUSED)",
2335
+ enqueue: "(input) => Promise<void> // input is optional; resolves once the run is queued, returns nothing; rejects with ActionError (run's codes plus ACTION_DISABLED)",
2336
2336
  running: "boolean // true while any run is in flight",
2337
2337
  result: "unknown // the last successful run's result; null before the first run",
2338
2338
  error: "ActionError | null",
@@ -6965,7 +6965,9 @@ const CONTRACT = deepFreeze({
6965
6965
  // 1.255.0: fix (sc-16654) — `minFontPx` (12) publishes the smallest page text
6966
6966
  // the render check accepts. The theme's six text tiers and its Buttons and
6967
6967
  // Text component sizes now clamp up to it instead of to 8.
6968
- version: "1.255.0",
6968
+ // 1.255.1: fix (sc-16882) — `ACTION_PAUSED` is gone from useAction's
6969
+ // refusals: no plan caps how many Actions run, so none is paused.
6970
+ version: "1.255.1",
6969
6971
  sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
6970
6972
  hooks: HOOKS,
6971
6973
  primitives: PRIMITIVES,
package/dist/contract.js CHANGED
@@ -2294,7 +2294,7 @@ const HOOKS = [
2294
2294
  "`available` is false and run() rejects UNAVAILABLE; render a visible " +
2295
2295
  "'pick an action' state, NEVER a blank box. sc-14224: `available` also " +
2296
2296
  "turns false once the server says a run would not reach the script — " +
2297
- "the Action is switched off or paused, not allowed from the app, gone, " +
2297
+ "the Action is switched off, not allowed from the app, gone, " +
2298
2298
  "or the viewer is not a signed-in app user (signed-out visitors and " +
2299
2299
  "anonymous accounts can't run Actions) — so render an 'isn't available' " +
2300
2300
  "state then too. It stays true while no answer has come. A changed binding clears " +
@@ -2319,15 +2319,15 @@ const HOOKS = [
2319
2319
  "respond() value, and running/result/error are untouched — so use it to " +
2320
2320
  "start work the widget needs no answer from (a batch, a sync, a long " +
2321
2321
  "send) and tell the user it has started, never that it is done. " +
2322
- "It is also refused when the Action is switched off (ACTION_DISABLED) " +
2323
- "or paused (ACTION_PAUSED), and with RATE_LIMITED when the workspace " +
2322
+ "It is also refused when the Action is switched off (ACTION_DISABLED), " +
2323
+ "and with RATE_LIMITED when the workspace " +
2324
2324
  "already has 10 queued runs waiting. A queued run can run twice (a " +
2325
2325
  "restart mid-run starts it again), so its Action must be safe to repeat. " +
2326
2326
  "Reads ctx.actions.",
2327
2327
  returnShape: {
2328
2328
  available: "boolean // false when no Action is bound, the host brokers none, or the server says a run would not reach the script",
2329
2329
  run: "(input) => Promise<unknown> // input is optional; resolves with the Action's respond() value, or null; rejects with ActionError",
2330
- enqueue: "(input) => Promise<void> // input is optional; resolves once the run is queued, returns nothing; rejects with ActionError (run's codes plus ACTION_DISABLED, ACTION_PAUSED)",
2330
+ enqueue: "(input) => Promise<void> // input is optional; resolves once the run is queued, returns nothing; rejects with ActionError (run's codes plus ACTION_DISABLED)",
2331
2331
  running: "boolean // true while any run is in flight",
2332
2332
  result: "unknown // the last successful run's result; null before the first run",
2333
2333
  error: "ActionError | null",
@@ -6960,7 +6960,9 @@ const CONTRACT = deepFreeze({
6960
6960
  // 1.255.0: fix (sc-16654) — `minFontPx` (12) publishes the smallest page text
6961
6961
  // the render check accepts. The theme's six text tiers and its Buttons and
6962
6962
  // Text component sizes now clamp up to it instead of to 8.
6963
- version: "1.255.0",
6963
+ // 1.255.1: fix (sc-16882) — `ACTION_PAUSED` is gone from useAction's
6964
+ // refusals: no plan caps how many Actions run, so none is paused.
6965
+ version: "1.255.1",
6964
6966
  sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
6965
6967
  hooks: HOOKS,
6966
6968
  primitives: PRIMITIVES,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colixsystems/widget-sdk",
3
- "version": "0.315.2",
3
+ "version": "0.315.3",
4
4
  "description": "Common widget interface for AppStudio. Implements WidgetManifest, WidgetContext, property schema, and helper hooks.",
5
5
  "repository": {
6
6
  "type": "git",
package/src/contract.js CHANGED
@@ -2294,7 +2294,7 @@ const HOOKS = [
2294
2294
  "`available` is false and run() rejects UNAVAILABLE; render a visible " +
2295
2295
  "'pick an action' state, NEVER a blank box. sc-14224: `available` also " +
2296
2296
  "turns false once the server says a run would not reach the script — " +
2297
- "the Action is switched off or paused, not allowed from the app, gone, " +
2297
+ "the Action is switched off, not allowed from the app, gone, " +
2298
2298
  "or the viewer is not a signed-in app user (signed-out visitors and " +
2299
2299
  "anonymous accounts can't run Actions) — so render an 'isn't available' " +
2300
2300
  "state then too. It stays true while no answer has come. A changed binding clears " +
@@ -2319,15 +2319,15 @@ const HOOKS = [
2319
2319
  "respond() value, and running/result/error are untouched — so use it to " +
2320
2320
  "start work the widget needs no answer from (a batch, a sync, a long " +
2321
2321
  "send) and tell the user it has started, never that it is done. " +
2322
- "It is also refused when the Action is switched off (ACTION_DISABLED) " +
2323
- "or paused (ACTION_PAUSED), and with RATE_LIMITED when the workspace " +
2322
+ "It is also refused when the Action is switched off (ACTION_DISABLED), " +
2323
+ "and with RATE_LIMITED when the workspace " +
2324
2324
  "already has 10 queued runs waiting. A queued run can run twice (a " +
2325
2325
  "restart mid-run starts it again), so its Action must be safe to repeat. " +
2326
2326
  "Reads ctx.actions.",
2327
2327
  returnShape: {
2328
2328
  available: "boolean // false when no Action is bound, the host brokers none, or the server says a run would not reach the script",
2329
2329
  run: "(input) => Promise<unknown> // input is optional; resolves with the Action's respond() value, or null; rejects with ActionError",
2330
- enqueue: "(input) => Promise<void> // input is optional; resolves once the run is queued, returns nothing; rejects with ActionError (run's codes plus ACTION_DISABLED, ACTION_PAUSED)",
2330
+ enqueue: "(input) => Promise<void> // input is optional; resolves once the run is queued, returns nothing; rejects with ActionError (run's codes plus ACTION_DISABLED)",
2331
2331
  running: "boolean // true while any run is in flight",
2332
2332
  result: "unknown // the last successful run's result; null before the first run",
2333
2333
  error: "ActionError | null",
@@ -6960,7 +6960,9 @@ const CONTRACT = deepFreeze({
6960
6960
  // 1.255.0: fix (sc-16654) — `minFontPx` (12) publishes the smallest page text
6961
6961
  // the render check accepts. The theme's six text tiers and its Buttons and
6962
6962
  // Text component sizes now clamp up to it instead of to 8.
6963
- version: "1.255.0",
6963
+ // 1.255.1: fix (sc-16882) — `ACTION_PAUSED` is gone from useAction's
6964
+ // refusals: no plan caps how many Actions run, so none is paused.
6965
+ version: "1.255.1",
6964
6966
  sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
6965
6967
  hooks: HOOKS,
6966
6968
  primitives: PRIMITIVES,