@colixsystems/widget-sdk 0.307.0 → 0.308.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
@@ -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.307.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**.
93
+ `v0.308.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**.
94
+
95
+ ### What's new in 0.308.0 (contract 1.252.0)
96
+
97
+ **A filter can ask "is any of".** The records filter gains the `in` operator. In the array form, pass the values as an array: `filter: [{ column: "status", operator: "in", value: ["Open", "Waiting"] }]` keeps the rows whose status is either, in one request. On a list column (`STRING_ARRAY`, `INT_ARRAY`) it keeps the rows whose list holds any of the values, so a chip row with several picks needs one read, not one per pick or a fetched batch narrowed in JavaScript. It works on relation columns and `id`; it is refused on `created_at` / `updated_at`, on encrypted columns and with a `currentUser` / `currentUserGroup` value mode. At most 100 values, each valid for the column, or the read fails with `INVALID_FILTER`. An empty array throws a `ValidationError` instead of reading every row: leave the condition out when there is nothing to pick. A `filterList` property's conditions can use it too: the Studio's filter editor offers "is any of" and stores the values as an array. An array `value` with any other operator now throws a `ValidationError` instead of being sent as one joined value. Needs `@colixsystems/datastore-client` 0.27.0 in the host.
94
98
 
95
99
  ### What's new in 0.307.0 (contract 1.251.0)
96
100
 
@@ -3810,7 +3814,7 @@ export default function OpenTasks({ tableId, titleField, statusField }) {
3810
3814
  | `offset` | Rows to skip, for the next page. |
3811
3815
  | `includeCapabilities` | `true` stamps each row with `_capabilities`, what the signed-in user may do to it. |
3812
3816
 
3813
- The filter operators are `eq`, `neq`, `gt`, `gte`, `lt`, `lte`, `contains` (a case-insensitive substring), `empty` and `nempty` (no value). On a list column (`STRING_ARRAY`, `INT_ARRAY`), `eq` keeps the rows whose list holds the value exactly, `empty` / `nempty` test whether it holds any, and every other operator is refused. In the array form a condition may carry `valueMode`: `"currentUser"` or `"currentUserGroup"` with `eq` or `neq` matches the signed-in user (or their groups) on a USER or USER_GROUP column, and `"relativeDate"` with an ordering operator reads `value` as "that many days ago".
3817
+ The filter operators are `eq`, `neq`, `gt`, `gte`, `lt`, `lte`, `contains` (a case-insensitive substring), `in` (is any of), `empty` and `nempty` (no value). `in` takes an array `value` in the array form (`{ column, operator: "in", value: ["Open", "Waiting"] }`), at most 100 values; an empty array is refused (leave the condition out instead). On a list column (`STRING_ARRAY`, `INT_ARRAY`), `eq` keeps the rows whose list holds the value exactly, `in` the rows whose list holds any of the values, `empty` / `nempty` test whether it holds any, and every other operator is refused. In the array form a condition may carry `valueMode`: `"currentUser"` or `"currentUserGroup"` with `eq` or `neq` matches the signed-in user (or their groups) on a USER or USER_GROUP column, and `"relativeDate"` with an ordering operator reads `value` as "that many days ago".
3814
3818
 
3815
3819
  The result's `total` is how many rows match in all, not just this page. **A list that grows reads its rows with `usePagedDatastoreQuery(tableId, { pageSize, ...query })`**, which takes the same options bar `limit` / `offset`, sets those itself, and appends the next page on `loadMore()`. Declare `pageSize: PAGE_SIZE_PROPERTY` in the `propertySchema` so the maker sets the rows per page. For a count, a sum or an average, use `useDatastoreFigure(tableId, { aggregate, column, filter })` instead of reading rows.
3816
3820
 
package/dist/contract.cjs CHANGED
@@ -1994,7 +1994,9 @@ const HOOKS = [
1994
1994
  "a write; the re-read is the same permission-checked read, and keeps the " +
1995
1995
  "rows on screen with loading false). Use it for lists other people " +
1996
1996
  "change: queues, bookings, chat, dashboards. Never poll with setInterval " +
1997
- "or wire useDatastoreSubscription for that.",
1997
+ "or wire useDatastoreSubscription for that. A `filter` condition " +
1998
+ "`{ column, operator: \"in\", value: [a, b] }` keeps rows whose value " +
1999
+ "is any of the list (a list column: holding any of it), at most 100 values.",
1998
2000
  returnShape: {
1999
2001
  data: "Record[]",
2000
2002
  total: "number | null",
@@ -2200,7 +2202,8 @@ const HOOKS = [
2200
2202
  },
2201
2203
  {
2202
2204
  name: "useAgent",
2203
- signature: "useAgent(agentRef, options?)",
2205
+ signature: "useAgent(agentRef, options)",
2206
+ optionalArgs: ["options"],
2204
2207
  description:
2205
2208
  "sc-7991 — hold a conversation with one of the WORKSPACE's own AI " +
2206
2209
  "agents (an author-written name + system prompt). IMPERATIVE: call " +
@@ -4083,6 +4086,8 @@ const ACTION_SCRIPT_GLOBALS = [
4083
4086
  "input",
4084
4087
  // sc-13843 — hands the app run its one JSON result.
4085
4088
  "respond",
4089
+ // sc-16548 — one turn of a workspace AI agent.
4090
+ "agents",
4086
4091
  ];
4087
4092
  // Mirrors action.service.js SCRIPT_MAX_BYTES.
4088
4093
  const ACTION_SCRIPT_MAX_BYTES = 200 * 1024;
@@ -6936,7 +6941,11 @@ const CONTRACT = deepFreeze({
6936
6941
  // 1.251.0: additive (sc-16546) — `useAgent(agentRef, { files: true })`
6937
6942
  // reports `acceptsFiles` / `fileLimits`, `send(text, { files })` sends
6938
6943
  // images and PDFs, and the `agents` client gains `capabilities()`.
6939
- version: "1.251.0",
6944
+ // 1.252.0: additive — the records filter gains `in` ("is any of"). A
6945
+ // `filterList` condition and a query's array-form `filter` take
6946
+ // `{ operator: "in", value: [a, b] }`; on a list column it matches a row
6947
+ // holding any of the values. At most 100; no `valueMode` applies.
6948
+ version: "1.252.0",
6940
6949
  sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
6941
6950
  hooks: HOOKS,
6942
6951
  primitives: PRIMITIVES,
package/dist/contract.js CHANGED
@@ -1989,7 +1989,9 @@ const HOOKS = [
1989
1989
  "a write; the re-read is the same permission-checked read, and keeps the " +
1990
1990
  "rows on screen with loading false). Use it for lists other people " +
1991
1991
  "change: queues, bookings, chat, dashboards. Never poll with setInterval " +
1992
- "or wire useDatastoreSubscription for that.",
1992
+ "or wire useDatastoreSubscription for that. A `filter` condition " +
1993
+ "`{ column, operator: \"in\", value: [a, b] }` keeps rows whose value " +
1994
+ "is any of the list (a list column: holding any of it), at most 100 values.",
1993
1995
  returnShape: {
1994
1996
  data: "Record[]",
1995
1997
  total: "number | null",
@@ -2195,7 +2197,8 @@ const HOOKS = [
2195
2197
  },
2196
2198
  {
2197
2199
  name: "useAgent",
2198
- signature: "useAgent(agentRef, options?)",
2200
+ signature: "useAgent(agentRef, options)",
2201
+ optionalArgs: ["options"],
2199
2202
  description:
2200
2203
  "sc-7991 — hold a conversation with one of the WORKSPACE's own AI " +
2201
2204
  "agents (an author-written name + system prompt). IMPERATIVE: call " +
@@ -4078,6 +4081,8 @@ const ACTION_SCRIPT_GLOBALS = [
4078
4081
  "input",
4079
4082
  // sc-13843 — hands the app run its one JSON result.
4080
4083
  "respond",
4084
+ // sc-16548 — one turn of a workspace AI agent.
4085
+ "agents",
4081
4086
  ];
4082
4087
  // Mirrors action.service.js SCRIPT_MAX_BYTES.
4083
4088
  const ACTION_SCRIPT_MAX_BYTES = 200 * 1024;
@@ -6931,7 +6936,11 @@ const CONTRACT = deepFreeze({
6931
6936
  // 1.251.0: additive (sc-16546) — `useAgent(agentRef, { files: true })`
6932
6937
  // reports `acceptsFiles` / `fileLimits`, `send(text, { files })` sends
6933
6938
  // images and PDFs, and the `agents` client gains `capabilities()`.
6934
- version: "1.251.0",
6939
+ // 1.252.0: additive — the records filter gains `in` ("is any of"). A
6940
+ // `filterList` condition and a query's array-form `filter` take
6941
+ // `{ operator: "in", value: [a, b] }`; on a list column it matches a row
6942
+ // holding any of the values. At most 100; no `valueMode` applies.
6943
+ version: "1.252.0",
6935
6944
  sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
6936
6945
  hooks: HOOKS,
6937
6946
  primitives: PRIMITIVES,
package/dist/index.d.ts CHANGED
@@ -72,7 +72,8 @@ export type WidgetPropertyType =
72
72
  // (ordering operators on a DATE column — `value` is "N days ago"), or the
73
73
  // sc-6282 actor-scoped pair `currentUser` (USER column) / `currentUserGroup`
74
74
  // (USER_GROUP column), which drop `value` and let the SERVER scope the
75
- // condition to the signed-in app-user.
75
+ // condition to the signed-in app-user. The `in` operator ("is any of") takes
76
+ // an array `value` of at most 100 members and no `valueMode`.
76
77
  | "filterList";
77
78
 
78
79
  export interface WidgetPropertyDef {
@@ -1129,7 +1130,11 @@ export function hasCornerRadius(
1129
1130
 
1130
1131
  /** A record query the datastore applies on the server; see the README's "Querying records". */
1131
1132
  export interface Query {
1132
- /** `{ column: "op:value" }` (an array of expressions for a range), or `[{ column, operator, value, valueMode }]`. */
1133
+ /**
1134
+ * `{ column: "op:value" }` (an array of expressions for a range), or
1135
+ * `[{ column, operator, value, valueMode }]`. Operator `"in"` takes an array
1136
+ * `value` (at most 100) and keeps rows whose value is any of it.
1137
+ */
1133
1138
  filter?:
1134
1139
  | Record<string, string | string[]>
1135
1140
  | Array<{ column: string; operator?: string; value?: unknown; valueMode?: string }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colixsystems/widget-sdk",
3
- "version": "0.307.0",
3
+ "version": "0.308.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",
package/src/contract.js CHANGED
@@ -1989,7 +1989,9 @@ const HOOKS = [
1989
1989
  "a write; the re-read is the same permission-checked read, and keeps the " +
1990
1990
  "rows on screen with loading false). Use it for lists other people " +
1991
1991
  "change: queues, bookings, chat, dashboards. Never poll with setInterval " +
1992
- "or wire useDatastoreSubscription for that.",
1992
+ "or wire useDatastoreSubscription for that. A `filter` condition " +
1993
+ "`{ column, operator: \"in\", value: [a, b] }` keeps rows whose value " +
1994
+ "is any of the list (a list column: holding any of it), at most 100 values.",
1993
1995
  returnShape: {
1994
1996
  data: "Record[]",
1995
1997
  total: "number | null",
@@ -2195,7 +2197,8 @@ const HOOKS = [
2195
2197
  },
2196
2198
  {
2197
2199
  name: "useAgent",
2198
- signature: "useAgent(agentRef, options?)",
2200
+ signature: "useAgent(agentRef, options)",
2201
+ optionalArgs: ["options"],
2199
2202
  description:
2200
2203
  "sc-7991 — hold a conversation with one of the WORKSPACE's own AI " +
2201
2204
  "agents (an author-written name + system prompt). IMPERATIVE: call " +
@@ -4078,6 +4081,8 @@ const ACTION_SCRIPT_GLOBALS = [
4078
4081
  "input",
4079
4082
  // sc-13843 — hands the app run its one JSON result.
4080
4083
  "respond",
4084
+ // sc-16548 — one turn of a workspace AI agent.
4085
+ "agents",
4081
4086
  ];
4082
4087
  // Mirrors action.service.js SCRIPT_MAX_BYTES.
4083
4088
  const ACTION_SCRIPT_MAX_BYTES = 200 * 1024;
@@ -6931,7 +6936,11 @@ const CONTRACT = deepFreeze({
6931
6936
  // 1.251.0: additive (sc-16546) — `useAgent(agentRef, { files: true })`
6932
6937
  // reports `acceptsFiles` / `fileLimits`, `send(text, { files })` sends
6933
6938
  // images and PDFs, and the `agents` client gains `capabilities()`.
6934
- version: "1.251.0",
6939
+ // 1.252.0: additive — the records filter gains `in` ("is any of"). A
6940
+ // `filterList` condition and a query's array-form `filter` take
6941
+ // `{ operator: "in", value: [a, b] }`; on a list column it matches a row
6942
+ // holding any of the values. At most 100; no `valueMode` applies.
6943
+ version: "1.252.0",
6935
6944
  sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
6936
6945
  hooks: HOOKS,
6937
6946
  primitives: PRIMITIVES,