@spotto/contract 1.0.70-alpha.9 → 1.0.70-y.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.
Files changed (285) hide show
  1. package/README.md +33 -33
  2. package/dist/actions/[id]/index.d.ts +1 -0
  3. package/dist/actions/[id]/index.js +18 -0
  4. package/dist/actions/[id]/index.js.map +1 -0
  5. package/dist/actions/[id]/patch/index.d.ts +2 -0
  6. package/dist/actions/[id]/patch/index.js +19 -0
  7. package/dist/actions/[id]/patch/index.js.map +1 -0
  8. package/dist/actions/[id]/patch/request.d.ts +16 -0
  9. package/dist/actions/[id]/patch/request.js +3 -0
  10. package/dist/actions/[id]/patch/request.js.map +1 -0
  11. package/dist/actions/[id]/patch/response.d.ts +1 -0
  12. package/dist/actions/[id]/patch/response.js +3 -0
  13. package/dist/actions/[id]/patch/response.js.map +1 -0
  14. package/dist/actions/get/index.d.ts +2 -0
  15. package/dist/actions/get/index.js +19 -0
  16. package/dist/actions/get/index.js.map +1 -0
  17. package/dist/actions/get/query.d.ts +14 -0
  18. package/dist/actions/get/query.js +3 -0
  19. package/dist/actions/get/query.js.map +1 -0
  20. package/dist/actions/get/response.d.ts +29 -0
  21. package/dist/actions/get/response.js +3 -0
  22. package/dist/actions/get/response.js.map +1 -0
  23. package/dist/actions/index.d.ts +4 -0
  24. package/dist/actions/index.js +21 -0
  25. package/dist/actions/index.js.map +1 -0
  26. package/dist/actions/post/index.d.ts +2 -0
  27. package/dist/actions/post/index.js +19 -0
  28. package/dist/actions/post/index.js.map +1 -0
  29. package/dist/actions/post/request.d.ts +15 -0
  30. package/dist/actions/post/request.js +3 -0
  31. package/dist/actions/post/request.js.map +1 -0
  32. package/dist/actions/post/response.d.ts +1 -0
  33. package/dist/actions/post/response.js +3 -0
  34. package/dist/actions/post/response.js.map +1 -0
  35. package/dist/actions/shared.d.ts +51 -0
  36. package/dist/actions/shared.js +13 -0
  37. package/dist/actions/shared.js.map +1 -0
  38. package/dist/ai/chat/index.d.ts +2 -0
  39. package/dist/ai/chat/index.js +19 -0
  40. package/dist/ai/chat/index.js.map +1 -0
  41. package/dist/ai/chat/request.d.ts +42 -0
  42. package/dist/ai/chat/request.js +3 -0
  43. package/dist/ai/chat/request.js.map +1 -0
  44. package/dist/ai/chat/response.d.ts +74 -0
  45. package/dist/ai/chat/response.js +11 -0
  46. package/dist/ai/chat/response.js.map +1 -0
  47. package/dist/ai/expression/request.d.ts +3 -1
  48. package/dist/ai/index.d.ts +3 -0
  49. package/dist/ai/index.js +3 -0
  50. package/dist/ai/index.js.map +1 -1
  51. package/dist/ai/semantic-query/index.d.ts +2 -0
  52. package/dist/ai/semantic-query/index.js +19 -0
  53. package/dist/ai/semantic-query/index.js.map +1 -0
  54. package/dist/ai/semantic-query/request.d.ts +43 -0
  55. package/dist/ai/semantic-query/request.js +3 -0
  56. package/dist/ai/semantic-query/request.js.map +1 -0
  57. package/dist/ai/semantic-query/response.d.ts +40 -0
  58. package/dist/ai/semantic-query/response.js +3 -0
  59. package/dist/ai/semantic-query/response.js.map +1 -0
  60. package/dist/ai/shared.d.ts +22 -0
  61. package/dist/ai/shared.js +11 -0
  62. package/dist/ai/shared.js.map +1 -0
  63. package/dist/assets/[id]/get.d.ts +2 -1
  64. package/dist/assets/count/query.d.ts +16 -1
  65. package/dist/assets/download/query.d.ts +7 -0
  66. package/dist/assets/get/query.d.ts +11 -0
  67. package/dist/assets/location/request.d.ts +10 -1
  68. package/dist/events/constants.d.ts +16 -1
  69. package/dist/events/constants.js +21 -1
  70. package/dist/events/constants.js.map +1 -1
  71. package/dist/events/get/query.d.ts +25 -0
  72. package/dist/events/get/response.d.ts +17 -1
  73. package/dist/fields/[id]/get.d.ts +3 -0
  74. package/dist/fields/[id]/patch/request.d.ts +4 -0
  75. package/dist/forms/[id]/index.d.ts +1 -0
  76. package/dist/forms/[id]/index.js +18 -0
  77. package/dist/forms/[id]/index.js.map +1 -0
  78. package/dist/forms/[id]/patch/index.d.ts +2 -0
  79. package/dist/forms/[id]/patch/index.js +19 -0
  80. package/dist/forms/[id]/patch/index.js.map +1 -0
  81. package/dist/forms/[id]/patch/request.d.ts +14 -0
  82. package/dist/forms/[id]/patch/request.js +3 -0
  83. package/dist/forms/[id]/patch/request.js.map +1 -0
  84. package/dist/forms/[id]/patch/response.d.ts +1 -0
  85. package/dist/forms/[id]/patch/response.js +3 -0
  86. package/dist/forms/[id]/patch/response.js.map +1 -0
  87. package/dist/forms/constants.d.ts +19 -0
  88. package/dist/forms/constants.js +33 -0
  89. package/dist/forms/constants.js.map +1 -0
  90. package/dist/forms/get/index.d.ts +2 -0
  91. package/dist/forms/get/index.js +19 -0
  92. package/dist/forms/get/index.js.map +1 -0
  93. package/dist/forms/get/query.d.ts +18 -0
  94. package/dist/forms/get/query.js +3 -0
  95. package/dist/forms/get/query.js.map +1 -0
  96. package/dist/forms/get/response.d.ts +23 -0
  97. package/dist/forms/get/response.js +3 -0
  98. package/dist/forms/get/response.js.map +1 -0
  99. package/dist/forms/index.d.ts +6 -0
  100. package/dist/forms/index.js +23 -0
  101. package/dist/forms/index.js.map +1 -0
  102. package/dist/forms/post/index.d.ts +2 -0
  103. package/dist/forms/post/index.js +19 -0
  104. package/dist/forms/post/index.js.map +1 -0
  105. package/dist/forms/post/request.d.ts +9 -0
  106. package/dist/forms/post/request.js +3 -0
  107. package/dist/forms/post/request.js.map +1 -0
  108. package/dist/forms/post/response.d.ts +1 -0
  109. package/dist/forms/post/response.js +3 -0
  110. package/dist/forms/post/response.js.map +1 -0
  111. package/dist/forms/shared.d.ts +127 -0
  112. package/dist/forms/shared.js +3 -0
  113. package/dist/forms/shared.js.map +1 -0
  114. package/dist/forms/versions/index.d.ts +2 -0
  115. package/dist/forms/versions/index.js +19 -0
  116. package/dist/forms/versions/index.js.map +1 -0
  117. package/dist/forms/versions/path.d.ts +8 -0
  118. package/dist/forms/versions/path.js +3 -0
  119. package/dist/forms/versions/path.js.map +1 -0
  120. package/dist/forms/versions/response.d.ts +1 -0
  121. package/dist/forms/versions/response.js +3 -0
  122. package/dist/forms/versions/response.js.map +1 -0
  123. package/dist/index.d.ts +5 -0
  124. package/dist/index.js +5 -0
  125. package/dist/index.js.map +1 -1
  126. package/dist/locations/get/query.d.ts +14 -0
  127. package/dist/organisations/constants.d.ts +11 -0
  128. package/dist/organisations/sso/constants.d.ts +15 -0
  129. package/dist/organisations/sso/constants.js +16 -1
  130. package/dist/organisations/sso/constants.js.map +1 -1
  131. package/dist/organisations/sso/types.d.ts +48 -0
  132. package/dist/readers/get/query.d.ts +12 -0
  133. package/dist/semantic-queries/[id]/index.d.ts +1 -0
  134. package/dist/semantic-queries/[id]/index.js +18 -0
  135. package/dist/semantic-queries/[id]/index.js.map +1 -0
  136. package/dist/semantic-queries/[id]/patch/index.d.ts +2 -0
  137. package/dist/semantic-queries/[id]/patch/index.js +19 -0
  138. package/dist/semantic-queries/[id]/patch/index.js.map +1 -0
  139. package/dist/semantic-queries/[id]/patch/request.d.ts +20 -0
  140. package/dist/semantic-queries/[id]/patch/request.js +3 -0
  141. package/dist/semantic-queries/[id]/patch/request.js.map +1 -0
  142. package/dist/semantic-queries/[id]/patch/response.d.ts +1 -0
  143. package/dist/semantic-queries/[id]/patch/response.js +3 -0
  144. package/dist/semantic-queries/[id]/patch/response.js.map +1 -0
  145. package/dist/semantic-queries/get/index.d.ts +2 -0
  146. package/dist/semantic-queries/get/index.js +19 -0
  147. package/dist/semantic-queries/get/index.js.map +1 -0
  148. package/dist/semantic-queries/get/query.d.ts +18 -0
  149. package/dist/semantic-queries/get/query.js +3 -0
  150. package/dist/semantic-queries/get/query.js.map +1 -0
  151. package/dist/semantic-queries/get/response.d.ts +40 -0
  152. package/dist/semantic-queries/get/response.js +3 -0
  153. package/dist/semantic-queries/get/response.js.map +1 -0
  154. package/dist/semantic-queries/index.d.ts +4 -0
  155. package/dist/semantic-queries/index.js +21 -0
  156. package/dist/semantic-queries/index.js.map +1 -0
  157. package/dist/semantic-queries/post/index.d.ts +2 -0
  158. package/dist/semantic-queries/post/index.js +19 -0
  159. package/dist/semantic-queries/post/index.js.map +1 -0
  160. package/dist/semantic-queries/post/request.d.ts +56 -0
  161. package/dist/semantic-queries/post/request.js +3 -0
  162. package/dist/semantic-queries/post/request.js.map +1 -0
  163. package/dist/semantic-queries/post/response.d.ts +1 -0
  164. package/dist/semantic-queries/post/response.js +3 -0
  165. package/dist/semantic-queries/post/response.js.map +1 -0
  166. package/dist/semantic-queries/shared.d.ts +853 -0
  167. package/dist/semantic-queries/shared.js +318 -0
  168. package/dist/semantic-queries/shared.js.map +1 -0
  169. package/dist/shared/attachments.d.ts +29 -0
  170. package/dist/shared/attachments.js +11 -0
  171. package/dist/shared/attachments.js.map +1 -0
  172. package/dist/shared/embed.d.ts +14 -0
  173. package/dist/shared/index.d.ts +1 -0
  174. package/dist/shared/index.js +1 -0
  175. package/dist/shared/index.js.map +1 -1
  176. package/dist/shared/readiness.d.ts +23 -0
  177. package/dist/snapshots/[id]/get.d.ts +139 -11
  178. package/dist/snapshots/[id]/get.js.map +1 -1
  179. package/dist/snapshots/get/query.d.ts +39 -0
  180. package/dist/snapshots/get/query.js +23 -1
  181. package/dist/snapshots/get/query.js.map +1 -1
  182. package/dist/snapshots/post/request.d.ts +21 -0
  183. package/dist/snapshots/post/request.js.map +1 -1
  184. package/dist/sso/onboard/request.d.ts +12 -1
  185. package/dist/sso/sso-mappings/request.d.ts +10 -5
  186. package/dist/submissions/[id]/index.d.ts +1 -0
  187. package/dist/submissions/[id]/index.js +18 -0
  188. package/dist/submissions/[id]/index.js.map +1 -0
  189. package/dist/submissions/[id]/void/post.d.ts +6 -0
  190. package/dist/submissions/[id]/void/post.js +3 -0
  191. package/dist/submissions/[id]/void/post.js.map +1 -0
  192. package/dist/submissions/constants.d.ts +14 -0
  193. package/dist/submissions/constants.js +21 -0
  194. package/dist/submissions/constants.js.map +1 -0
  195. package/dist/submissions/get/index.d.ts +2 -0
  196. package/dist/submissions/get/index.js +19 -0
  197. package/dist/submissions/get/index.js.map +1 -0
  198. package/dist/submissions/get/query.d.ts +14 -0
  199. package/dist/submissions/get/query.js +3 -0
  200. package/dist/submissions/get/query.js.map +1 -0
  201. package/dist/submissions/get/response.d.ts +6 -0
  202. package/dist/submissions/get/response.js +3 -0
  203. package/dist/submissions/get/response.js.map +1 -0
  204. package/dist/submissions/index.d.ts +6 -0
  205. package/dist/submissions/index.js +23 -0
  206. package/dist/submissions/index.js.map +1 -0
  207. package/dist/submissions/post/index.d.ts +2 -0
  208. package/dist/submissions/post/index.js +19 -0
  209. package/dist/submissions/post/index.js.map +1 -0
  210. package/dist/submissions/post/request.d.ts +17 -0
  211. package/dist/submissions/post/request.js +3 -0
  212. package/dist/submissions/post/request.js.map +1 -0
  213. package/dist/submissions/post/response.d.ts +22 -0
  214. package/dist/submissions/post/response.js +3 -0
  215. package/dist/submissions/post/response.js.map +1 -0
  216. package/dist/submissions/shared.d.ts +133 -0
  217. package/dist/submissions/shared.js +3 -0
  218. package/dist/submissions/shared.js.map +1 -0
  219. package/dist/submissions/uploads/[fileId]/get.d.ts +11 -0
  220. package/dist/submissions/uploads/[fileId]/get.js +3 -0
  221. package/dist/submissions/uploads/[fileId]/get.js.map +1 -0
  222. package/dist/submissions/uploads/[fileId]/index.d.ts +1 -0
  223. package/dist/submissions/uploads/[fileId]/index.js +18 -0
  224. package/dist/submissions/uploads/[fileId]/index.js.map +1 -0
  225. package/dist/submissions/uploads/index.d.ts +2 -0
  226. package/dist/submissions/uploads/index.js +19 -0
  227. package/dist/submissions/uploads/index.js.map +1 -0
  228. package/dist/submissions/uploads/post/index.d.ts +2 -0
  229. package/dist/submissions/uploads/post/index.js +19 -0
  230. package/dist/submissions/uploads/post/index.js.map +1 -0
  231. package/dist/submissions/uploads/post/request.d.ts +9 -0
  232. package/dist/submissions/uploads/post/request.js +3 -0
  233. package/dist/submissions/uploads/post/request.js.map +1 -0
  234. package/dist/submissions/uploads/post/response.d.ts +18 -0
  235. package/dist/submissions/uploads/post/response.js +3 -0
  236. package/dist/submissions/uploads/post/response.js.map +1 -0
  237. package/dist/types/[id]/get.d.ts +3 -1
  238. package/dist/types/[id]/patch/request.d.ts +4 -1
  239. package/dist/types/post/request.d.ts +2 -1
  240. package/dist/types/post/request.js.map +1 -1
  241. package/dist/usergroups/[id]/index.d.ts +1 -0
  242. package/dist/usergroups/[id]/index.js +18 -0
  243. package/dist/usergroups/[id]/index.js.map +1 -0
  244. package/dist/usergroups/[id]/patch/index.d.ts +2 -0
  245. package/dist/usergroups/[id]/patch/index.js +19 -0
  246. package/dist/usergroups/[id]/patch/index.js.map +1 -0
  247. package/dist/usergroups/[id]/patch/request.d.ts +12 -0
  248. package/dist/usergroups/[id]/patch/request.js +3 -0
  249. package/dist/usergroups/[id]/patch/request.js.map +1 -0
  250. package/dist/usergroups/[id]/patch/response.d.ts +1 -0
  251. package/dist/usergroups/[id]/patch/response.js +3 -0
  252. package/dist/usergroups/[id]/patch/response.js.map +1 -0
  253. package/dist/usergroups/get/index.d.ts +2 -0
  254. package/dist/usergroups/get/index.js +19 -0
  255. package/dist/usergroups/get/index.js.map +1 -0
  256. package/dist/usergroups/get/query.d.ts +12 -0
  257. package/dist/usergroups/get/query.js +3 -0
  258. package/dist/usergroups/get/query.js.map +1 -0
  259. package/dist/usergroups/get/response.d.ts +35 -0
  260. package/dist/usergroups/get/response.js +3 -0
  261. package/dist/usergroups/get/response.js.map +1 -0
  262. package/dist/usergroups/index.d.ts +4 -0
  263. package/dist/usergroups/index.js +21 -0
  264. package/dist/usergroups/index.js.map +1 -0
  265. package/dist/usergroups/post/index.d.ts +2 -0
  266. package/dist/usergroups/post/index.js +19 -0
  267. package/dist/usergroups/post/index.js.map +1 -0
  268. package/dist/usergroups/post/request.d.ts +11 -0
  269. package/dist/usergroups/post/request.js +3 -0
  270. package/dist/usergroups/post/request.js.map +1 -0
  271. package/dist/usergroups/post/response.d.ts +1 -0
  272. package/dist/usergroups/post/response.js +3 -0
  273. package/dist/usergroups/post/response.js.map +1 -0
  274. package/dist/usergroups/shared.d.ts +25 -0
  275. package/dist/usergroups/shared.js +11 -0
  276. package/dist/usergroups/shared.js.map +1 -0
  277. package/dist/users/[id]/get/response.d.ts +0 -2
  278. package/dist/users/[id]/patch/request.d.ts +5 -1
  279. package/dist/users/current.d.ts +22 -4
  280. package/dist/users/get/query.d.ts +0 -2
  281. package/dist/users/home-layout/shared.d.ts +96 -21
  282. package/dist/users/home-layout/shared.js +11 -5
  283. package/dist/users/home-layout/shared.js.map +1 -1
  284. package/dist/users/post/request.d.ts +6 -1
  285. package/package.json +2 -2
@@ -4,43 +4,118 @@
4
4
  * returned on `GET /users/current`, and written via
5
5
  * `POST /users/current/home-layout`.
6
6
  *
7
- * The widget `type` is a closed union (below): adding a new widget kind is a
8
- * contract change + republish + client bump. Per-widget `config` is left opaque
9
- * — its shape is the client's concern, so a widget's behaviour can evolve
10
- * without a contract change. Sections are modelled now (single + untitled in
11
- * P1) so titled groups can land later without another contract change.
7
+ * A layout is a flat, ordered list of widgets, each pinned to a rect on a
8
+ * 4-column grid (`gridPos`). The widget `type` is a closed union (below): adding
9
+ * a new kind is a contract change + republish + client bump. Per-widget `config`
10
+ * carries widget *behaviour* only (a saved-view id, an action id, a heading's
11
+ * text) — never geometry. Since 2026-07-30 the API validates each kind's KNOWN
12
+ * config keys on write (the per-kind `*WidgetConfig` shapes below) while
13
+ * tolerating unknown keys, so the client can still add config keys without an
14
+ * API deploy ordering — only changing a known key's meaning needs one.
15
+ *
16
+ * `version` discriminates stored layouts so the client can detect and
17
+ * reset/migrate an older one on read.
12
18
  */
13
- /** Width a widget occupies in its section grid. `'full'` spans the row at every breakpoint. */
14
- export declare type HomeWidgetSpan = 1 | 2 | 'full';
15
19
  /**
16
20
  * The kinds of Home widget. Closed set — adding one is a contract change.
17
- * - `tile-link` — a link card (a saved view, a nav destination, or a URL); may show a live count.
21
+ * - `tile-link` — a link card (a saved view or a nav destination); may show a live count.
18
22
  * - `summary-list` — top-N rows of a saved view's results.
19
23
  * - `recent-activity` — the account's latest activity feed.
20
24
  * - `recent-assets` / `recent-locations` — most-recently-updated entities.
21
25
  * - `needs-attention` — assets flagged not-ready / partially-ready.
22
26
  * - `kit-spotlight` — kit readiness summary.
27
+ * - `hero` — the fleet-readiness hero (overview + inline needs-attention legend),
28
+ * carrying its own mark and label so several can share a Home.
29
+ * - `heading` — a text heading to label a run of widgets (heading text lives in `config`).
30
+ *
31
+ * `heading` is a full-width structural widget: the client renders it spanning the
32
+ * whole row at every breakpoint. `hero` was one too until it learned to render at
33
+ * a quarter, a half or a full row; its width is now the user's, like any other
34
+ * widget's. As with all widgets, width is expressed through `gridPos.w`, not
35
+ * enforced by the API.
36
+ */
37
+ export declare type HomeWidgetType = 'tile-link' | 'summary-list' | 'recent-activity' | 'recent-assets' | 'recent-locations' | 'needs-attention' | 'kit-spotlight' | 'hero' | 'heading';
38
+ /**
39
+ * Per-kind `config` shapes — the authoritative form of each configurable
40
+ * kind's KNOWN keys, which the API enforces on write (unknown keys pass, so
41
+ * these can grow client-first). The feed kinds define no config keys. `config`
42
+ * itself stays loosely typed on `HomeWidget`; the client parses defensively at
43
+ * the render boundary regardless (stored data may predate validation).
44
+ */
45
+ /** A `tile-link`'s target: a registered app action or a saved view — never a
46
+ * free URL (the client resolves targets to internal routes by design). */
47
+ export declare type TileLinkWidgetConfig = {
48
+ source: 'action';
49
+ actionId: string;
50
+ } | {
51
+ source: 'view';
52
+ viewId: string;
53
+ };
54
+ /** A `summary-list` renders the top matches of one saved view. */
55
+ export interface SummaryListWidgetConfig {
56
+ viewId: string;
57
+ }
58
+ /** A `heading`'s user-editable label — empty while freshly added. */
59
+ export interface HeadingWidgetConfig {
60
+ text: string;
61
+ }
62
+ /**
63
+ * How a hero card presents itself. Both keys are optional: with neither, the
64
+ * client renders its default mark and derives the label from the data source
65
+ * (the saved view's name, or the whole account). They exist because several
66
+ * heroes now share one Home — over different saved views, at different widths —
67
+ * and identical cards would be indistinguishable at a glance.
68
+ */
69
+ export interface HeroWidgetPresentation {
70
+ /**
71
+ * Icon NAME from the client's curated set (kebab-case, e.g. `ambulance`) —
72
+ * never a URL or markup. The client resolves the name to a component and
73
+ * falls back to its default mark on one it doesn't recognise, which is why
74
+ * the API bounds the string rather than enumerating the set: adding an icon
75
+ * is then a client release, not an API deploy.
76
+ */
77
+ icon?: string;
78
+ /** Label override. Empty or absent means the client derives it. */
79
+ title?: string;
80
+ }
81
+ /** The `hero`'s data source — the whole account's assets, or one saved view's
82
+ * matches — plus how the card presents itself. The source is always present on
83
+ * a stored hero (the kind shipped with it); the presentation keys are not. */
84
+ export declare type HeroWidgetConfig = HeroWidgetPresentation & ({
85
+ source: 'account';
86
+ } | {
87
+ source: 'view';
88
+ viewId: string;
89
+ });
90
+ /**
91
+ * A widget's cell on the Home grid: top-left position (`x`/`y`) and size
92
+ * (`w`/`h`), in grid units. The grid is 4 columns wide, so `x + w <= 4`, and
93
+ * `h` is a whole number of row-units. Below the desktop breakpoint the client
94
+ * collapses to a single column, so `x`/`w` only bind on wide viewports.
23
95
  */
24
- export declare type HomeWidgetType = 'tile-link' | 'summary-list' | 'recent-activity' | 'recent-assets' | 'recent-locations' | 'needs-attention' | 'kit-spotlight';
96
+ export interface HomeWidgetGridPos {
97
+ /** Column of the top-left corner (0-based; `x + w <= 4`). */
98
+ x: number;
99
+ /** Row of the top-left corner (0-based), in row-units. */
100
+ y: number;
101
+ /** Width in columns (1–4). */
102
+ w: number;
103
+ /** Height in row-units (>= 1). */
104
+ h: number;
105
+ }
25
106
  export interface HomeWidget {
26
107
  /** Stable client-generated id (ulid) — the reorder / remove key. */
27
108
  id: string;
28
109
  /** Widget kind (closed union). The client registry maps it to a renderer + config shape. */
29
110
  type: HomeWidgetType;
30
- /** Width preset; falls back to the widget's registry default when omitted. */
31
- span?: HomeWidgetSpan;
32
- /** Widget-specific configuration (e.g. a saved-view id, a title, a row limit). Opaque to the API. */
111
+ /** Position + size on the 4-column grid. */
112
+ gridPos: HomeWidgetGridPos;
113
+ /** Widget-specific *behaviour* config (e.g. a saved-view id, a heading's text) — never geometry. Known keys are validated per kind (see the `*WidgetConfig` shapes); unknown keys pass through. */
33
114
  config?: Record<string, unknown>;
34
115
  }
35
- export interface HomeLayoutSection {
36
- /** Stable client-generated id (ulid). */
37
- id: string;
38
- /** Optional section heading. Sections are single + untitled in P1; titled groups arrive in P2. */
39
- title?: string;
40
- widgets: HomeWidget[];
41
- }
42
116
  export interface HomeLayout {
43
- /** Layout schema version, for forward-migrating stored layouts. */
117
+ /** Layout schema version, so the client can detect + migrate/reset older stored layouts. */
44
118
  version: number;
45
- sections: HomeLayoutSection[];
119
+ /** Flat, ordered widget list; geometry lives on each widget's `gridPos`. */
120
+ widgets: HomeWidget[];
46
121
  }
@@ -5,11 +5,17 @@
5
5
  * returned on `GET /users/current`, and written via
6
6
  * `POST /users/current/home-layout`.
7
7
  *
8
- * The widget `type` is a closed union (below): adding a new widget kind is a
9
- * contract change + republish + client bump. Per-widget `config` is left opaque
10
- * — its shape is the client's concern, so a widget's behaviour can evolve
11
- * without a contract change. Sections are modelled now (single + untitled in
12
- * P1) so titled groups can land later without another contract change.
8
+ * A layout is a flat, ordered list of widgets, each pinned to a rect on a
9
+ * 4-column grid (`gridPos`). The widget `type` is a closed union (below): adding
10
+ * a new kind is a contract change + republish + client bump. Per-widget `config`
11
+ * carries widget *behaviour* only (a saved-view id, an action id, a heading's
12
+ * text) — never geometry. Since 2026-07-30 the API validates each kind's KNOWN
13
+ * config keys on write (the per-kind `*WidgetConfig` shapes below) while
14
+ * tolerating unknown keys, so the client can still add config keys without an
15
+ * API deploy ordering — only changing a known key's meaning needs one.
16
+ *
17
+ * `version` discriminates stored layouts so the client can detect and
18
+ * reset/migrate an older one on read.
13
19
  */
14
20
  Object.defineProperty(exports, "__esModule", { value: true });
15
21
  //# sourceMappingURL=shared.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/users/home-layout/shared.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG"}
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/users/home-layout/shared.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG"}
@@ -1,8 +1,13 @@
1
1
  export interface BasePostUserRequest {
2
2
  name: string;
3
3
  role: string;
4
- permissionLocationId?: string;
5
4
  homeLocationId?: string;
5
+ /**
6
+ * Complete usergroup membership for the new user (group ids). Enforced
7
+ * per the closure invariant when the org toggle is ON; omitted = no
8
+ * groups (resolves unconfined).
9
+ */
10
+ usergroups?: string[];
6
11
  }
7
12
  export interface PostExternalUserRequest extends BasePostUserRequest {
8
13
  type: 'EXTERNAL';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spotto/contract",
3
3
  "license": "ISC",
4
- "version": "1.0.70-alpha.9",
4
+ "version": "1.0.70-y.0",
5
5
  "description": "Spotto's API Contract type definitions",
6
6
  "main": "./dist/index.js",
7
7
  "files": [
@@ -18,5 +18,5 @@
18
18
  "@types/geojson": "^7946.0.11",
19
19
  "shx": "^0.3.4"
20
20
  },
21
- "gitHead": "68f245bdb4cfc1ed34b7274ddbc324ad1fb2de5e"
21
+ "gitHead": "6085c86b6042d119b876e446b4c730d1ab39448f"
22
22
  }