@spotto/contract 1.0.70-alpha.3 → 1.0.70-alpha.30

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 (315) 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/index.d.ts +2 -0
  48. package/dist/ai/expression/index.js +19 -0
  49. package/dist/ai/expression/index.js.map +1 -0
  50. package/dist/ai/expression/request.d.ts +29 -0
  51. package/dist/ai/expression/request.js +3 -0
  52. package/dist/ai/expression/request.js.map +1 -0
  53. package/dist/ai/expression/response.d.ts +23 -0
  54. package/dist/ai/expression/response.js +3 -0
  55. package/dist/ai/expression/response.js.map +1 -0
  56. package/dist/ai/index.d.ts +4 -0
  57. package/dist/ai/index.js +21 -0
  58. package/dist/ai/index.js.map +1 -0
  59. package/dist/ai/semantic-query/index.d.ts +2 -0
  60. package/dist/ai/semantic-query/index.js +19 -0
  61. package/dist/ai/semantic-query/index.js.map +1 -0
  62. package/dist/ai/semantic-query/request.d.ts +43 -0
  63. package/dist/ai/semantic-query/request.js +3 -0
  64. package/dist/ai/semantic-query/request.js.map +1 -0
  65. package/dist/ai/semantic-query/response.d.ts +40 -0
  66. package/dist/ai/semantic-query/response.js +3 -0
  67. package/dist/ai/semantic-query/response.js.map +1 -0
  68. package/dist/ai/shared.d.ts +22 -0
  69. package/dist/ai/shared.js +11 -0
  70. package/dist/ai/shared.js.map +1 -0
  71. package/dist/assets/[id]/get.d.ts +10 -1
  72. package/dist/assets/[id]/patch/request.d.ts +5 -0
  73. package/dist/assets/count/query.d.ts +16 -1
  74. package/dist/assets/download/query.d.ts +7 -0
  75. package/dist/assets/get/query.d.ts +22 -4
  76. package/dist/assets/location/request.d.ts +10 -1
  77. package/dist/assets/post/request.d.ts +2 -0
  78. package/dist/assets/post/request.js.map +1 -1
  79. package/dist/events/constants.d.ts +16 -1
  80. package/dist/events/constants.js +21 -1
  81. package/dist/events/constants.js.map +1 -1
  82. package/dist/events/get/query.d.ts +25 -0
  83. package/dist/events/get/response.d.ts +17 -1
  84. package/dist/fields/[id]/get.d.ts +3 -0
  85. package/dist/fields/[id]/patch/request.d.ts +4 -0
  86. package/dist/fields/constants.d.ts +19 -0
  87. package/dist/fields/constants.js +15 -1
  88. package/dist/fields/constants.js.map +1 -1
  89. package/dist/forms/[id]/index.d.ts +1 -0
  90. package/dist/forms/[id]/index.js +18 -0
  91. package/dist/forms/[id]/index.js.map +1 -0
  92. package/dist/forms/[id]/patch/index.d.ts +2 -0
  93. package/dist/forms/[id]/patch/index.js +19 -0
  94. package/dist/forms/[id]/patch/index.js.map +1 -0
  95. package/dist/forms/[id]/patch/request.d.ts +14 -0
  96. package/dist/forms/[id]/patch/request.js +3 -0
  97. package/dist/forms/[id]/patch/request.js.map +1 -0
  98. package/dist/forms/[id]/patch/response.d.ts +1 -0
  99. package/dist/forms/[id]/patch/response.js +3 -0
  100. package/dist/forms/[id]/patch/response.js.map +1 -0
  101. package/dist/forms/constants.d.ts +19 -0
  102. package/dist/forms/constants.js +33 -0
  103. package/dist/forms/constants.js.map +1 -0
  104. package/dist/forms/get/index.d.ts +2 -0
  105. package/dist/forms/get/index.js +19 -0
  106. package/dist/forms/get/index.js.map +1 -0
  107. package/dist/forms/get/query.d.ts +18 -0
  108. package/dist/forms/get/query.js +3 -0
  109. package/dist/forms/get/query.js.map +1 -0
  110. package/dist/forms/get/response.d.ts +23 -0
  111. package/dist/forms/get/response.js +3 -0
  112. package/dist/forms/get/response.js.map +1 -0
  113. package/dist/forms/index.d.ts +6 -0
  114. package/dist/forms/index.js +23 -0
  115. package/dist/forms/index.js.map +1 -0
  116. package/dist/forms/post/index.d.ts +2 -0
  117. package/dist/forms/post/index.js +19 -0
  118. package/dist/forms/post/index.js.map +1 -0
  119. package/dist/forms/post/request.d.ts +9 -0
  120. package/dist/forms/post/request.js +3 -0
  121. package/dist/forms/post/request.js.map +1 -0
  122. package/dist/forms/post/response.d.ts +1 -0
  123. package/dist/forms/post/response.js +3 -0
  124. package/dist/forms/post/response.js.map +1 -0
  125. package/dist/forms/shared.d.ts +127 -0
  126. package/dist/forms/shared.js +3 -0
  127. package/dist/forms/shared.js.map +1 -0
  128. package/dist/forms/versions/index.d.ts +2 -0
  129. package/dist/forms/versions/index.js +19 -0
  130. package/dist/forms/versions/index.js.map +1 -0
  131. package/dist/forms/versions/path.d.ts +8 -0
  132. package/dist/forms/versions/path.js +3 -0
  133. package/dist/forms/versions/path.js.map +1 -0
  134. package/dist/forms/versions/response.d.ts +1 -0
  135. package/dist/forms/versions/response.js +3 -0
  136. package/dist/forms/versions/response.js.map +1 -0
  137. package/dist/index.d.ts +6 -0
  138. package/dist/index.js +6 -0
  139. package/dist/index.js.map +1 -1
  140. package/dist/integrations/oneblink/patch/request.d.ts +1 -1
  141. package/dist/integrations/oneblink/token.d.ts +2 -0
  142. package/dist/locations/get/query.d.ts +14 -0
  143. package/dist/organisations/constants.d.ts +11 -0
  144. package/dist/organisations/sso/constants.d.ts +15 -0
  145. package/dist/organisations/sso/constants.js +16 -1
  146. package/dist/organisations/sso/constants.js.map +1 -1
  147. package/dist/organisations/sso/types.d.ts +48 -0
  148. package/dist/readers/get/query.d.ts +12 -0
  149. package/dist/semantic-queries/[id]/index.d.ts +1 -0
  150. package/dist/semantic-queries/[id]/index.js +18 -0
  151. package/dist/semantic-queries/[id]/index.js.map +1 -0
  152. package/dist/semantic-queries/[id]/patch/index.d.ts +2 -0
  153. package/dist/semantic-queries/[id]/patch/index.js +19 -0
  154. package/dist/semantic-queries/[id]/patch/index.js.map +1 -0
  155. package/dist/semantic-queries/[id]/patch/request.d.ts +20 -0
  156. package/dist/semantic-queries/[id]/patch/request.js +3 -0
  157. package/dist/semantic-queries/[id]/patch/request.js.map +1 -0
  158. package/dist/semantic-queries/[id]/patch/response.d.ts +1 -0
  159. package/dist/semantic-queries/[id]/patch/response.js +3 -0
  160. package/dist/semantic-queries/[id]/patch/response.js.map +1 -0
  161. package/dist/semantic-queries/get/index.d.ts +2 -0
  162. package/dist/semantic-queries/get/index.js +19 -0
  163. package/dist/semantic-queries/get/index.js.map +1 -0
  164. package/dist/semantic-queries/get/query.d.ts +18 -0
  165. package/dist/semantic-queries/get/query.js +3 -0
  166. package/dist/semantic-queries/get/query.js.map +1 -0
  167. package/dist/semantic-queries/get/response.d.ts +40 -0
  168. package/dist/semantic-queries/get/response.js +3 -0
  169. package/dist/semantic-queries/get/response.js.map +1 -0
  170. package/dist/semantic-queries/index.d.ts +4 -0
  171. package/dist/semantic-queries/index.js +21 -0
  172. package/dist/semantic-queries/index.js.map +1 -0
  173. package/dist/semantic-queries/post/index.d.ts +2 -0
  174. package/dist/semantic-queries/post/index.js +19 -0
  175. package/dist/semantic-queries/post/index.js.map +1 -0
  176. package/dist/semantic-queries/post/request.d.ts +56 -0
  177. package/dist/semantic-queries/post/request.js +3 -0
  178. package/dist/semantic-queries/post/request.js.map +1 -0
  179. package/dist/semantic-queries/post/response.d.ts +1 -0
  180. package/dist/semantic-queries/post/response.js +3 -0
  181. package/dist/semantic-queries/post/response.js.map +1 -0
  182. package/dist/semantic-queries/shared.d.ts +853 -0
  183. package/dist/semantic-queries/shared.js +318 -0
  184. package/dist/semantic-queries/shared.js.map +1 -0
  185. package/dist/shared/attachments.d.ts +29 -0
  186. package/dist/shared/attachments.js +11 -0
  187. package/dist/shared/attachments.js.map +1 -0
  188. package/dist/shared/embed.d.ts +14 -0
  189. package/dist/shared/index.d.ts +2 -0
  190. package/dist/shared/index.js +2 -0
  191. package/dist/shared/index.js.map +1 -1
  192. package/dist/shared/readiness.d.ts +81 -0
  193. package/dist/shared/readiness.js +11 -0
  194. package/dist/shared/readiness.js.map +1 -0
  195. package/dist/snapshots/[id]/get.d.ts +139 -11
  196. package/dist/snapshots/[id]/get.js.map +1 -1
  197. package/dist/snapshots/get/query.d.ts +39 -0
  198. package/dist/snapshots/get/query.js +23 -1
  199. package/dist/snapshots/get/query.js.map +1 -1
  200. package/dist/snapshots/post/request.d.ts +21 -0
  201. package/dist/snapshots/post/request.js.map +1 -1
  202. package/dist/sso/onboard/request.d.ts +12 -1
  203. package/dist/sso/sso-mappings/request.d.ts +10 -5
  204. package/dist/submissions/[id]/index.d.ts +1 -0
  205. package/dist/submissions/[id]/index.js +18 -0
  206. package/dist/submissions/[id]/index.js.map +1 -0
  207. package/dist/submissions/[id]/void/post.d.ts +6 -0
  208. package/dist/submissions/[id]/void/post.js +3 -0
  209. package/dist/submissions/[id]/void/post.js.map +1 -0
  210. package/dist/submissions/constants.d.ts +14 -0
  211. package/dist/submissions/constants.js +21 -0
  212. package/dist/submissions/constants.js.map +1 -0
  213. package/dist/submissions/get/index.d.ts +2 -0
  214. package/dist/submissions/get/index.js +19 -0
  215. package/dist/submissions/get/index.js.map +1 -0
  216. package/dist/submissions/get/query.d.ts +14 -0
  217. package/dist/submissions/get/query.js +3 -0
  218. package/dist/submissions/get/query.js.map +1 -0
  219. package/dist/submissions/get/response.d.ts +6 -0
  220. package/dist/submissions/get/response.js +3 -0
  221. package/dist/submissions/get/response.js.map +1 -0
  222. package/dist/submissions/index.d.ts +6 -0
  223. package/dist/submissions/index.js +23 -0
  224. package/dist/submissions/index.js.map +1 -0
  225. package/dist/submissions/post/index.d.ts +2 -0
  226. package/dist/submissions/post/index.js +19 -0
  227. package/dist/submissions/post/index.js.map +1 -0
  228. package/dist/submissions/post/request.d.ts +17 -0
  229. package/dist/submissions/post/request.js +3 -0
  230. package/dist/submissions/post/request.js.map +1 -0
  231. package/dist/submissions/post/response.d.ts +22 -0
  232. package/dist/submissions/post/response.js +3 -0
  233. package/dist/submissions/post/response.js.map +1 -0
  234. package/dist/submissions/shared.d.ts +133 -0
  235. package/dist/submissions/shared.js +3 -0
  236. package/dist/submissions/shared.js.map +1 -0
  237. package/dist/submissions/uploads/[fileId]/get.d.ts +11 -0
  238. package/dist/submissions/uploads/[fileId]/get.js +3 -0
  239. package/dist/submissions/uploads/[fileId]/get.js.map +1 -0
  240. package/dist/submissions/uploads/[fileId]/index.d.ts +1 -0
  241. package/dist/submissions/uploads/[fileId]/index.js +18 -0
  242. package/dist/submissions/uploads/[fileId]/index.js.map +1 -0
  243. package/dist/submissions/uploads/index.d.ts +2 -0
  244. package/dist/submissions/uploads/index.js +19 -0
  245. package/dist/submissions/uploads/index.js.map +1 -0
  246. package/dist/submissions/uploads/post/index.d.ts +2 -0
  247. package/dist/submissions/uploads/post/index.js +19 -0
  248. package/dist/submissions/uploads/post/index.js.map +1 -0
  249. package/dist/submissions/uploads/post/request.d.ts +9 -0
  250. package/dist/submissions/uploads/post/request.js +3 -0
  251. package/dist/submissions/uploads/post/request.js.map +1 -0
  252. package/dist/submissions/uploads/post/response.d.ts +18 -0
  253. package/dist/submissions/uploads/post/response.js +3 -0
  254. package/dist/submissions/uploads/post/response.js.map +1 -0
  255. package/dist/types/[id]/get.d.ts +17 -2
  256. package/dist/types/[id]/patch/request.d.ts +16 -2
  257. package/dist/types/post/request.d.ts +16 -2
  258. package/dist/types/post/request.js.map +1 -1
  259. package/dist/usergroups/[id]/index.d.ts +1 -0
  260. package/dist/usergroups/[id]/index.js +18 -0
  261. package/dist/usergroups/[id]/index.js.map +1 -0
  262. package/dist/usergroups/[id]/patch/index.d.ts +2 -0
  263. package/dist/usergroups/[id]/patch/index.js +19 -0
  264. package/dist/usergroups/[id]/patch/index.js.map +1 -0
  265. package/dist/usergroups/[id]/patch/request.d.ts +12 -0
  266. package/dist/usergroups/[id]/patch/request.js +3 -0
  267. package/dist/usergroups/[id]/patch/request.js.map +1 -0
  268. package/dist/usergroups/[id]/patch/response.d.ts +1 -0
  269. package/dist/usergroups/[id]/patch/response.js +3 -0
  270. package/dist/usergroups/[id]/patch/response.js.map +1 -0
  271. package/dist/usergroups/get/index.d.ts +2 -0
  272. package/dist/usergroups/get/index.js +19 -0
  273. package/dist/usergroups/get/index.js.map +1 -0
  274. package/dist/usergroups/get/query.d.ts +12 -0
  275. package/dist/usergroups/get/query.js +3 -0
  276. package/dist/usergroups/get/query.js.map +1 -0
  277. package/dist/usergroups/get/response.d.ts +35 -0
  278. package/dist/usergroups/get/response.js +3 -0
  279. package/dist/usergroups/get/response.js.map +1 -0
  280. package/dist/usergroups/index.d.ts +4 -0
  281. package/dist/usergroups/index.js +21 -0
  282. package/dist/usergroups/index.js.map +1 -0
  283. package/dist/usergroups/post/index.d.ts +2 -0
  284. package/dist/usergroups/post/index.js +19 -0
  285. package/dist/usergroups/post/index.js.map +1 -0
  286. package/dist/usergroups/post/request.d.ts +11 -0
  287. package/dist/usergroups/post/request.js +3 -0
  288. package/dist/usergroups/post/request.js.map +1 -0
  289. package/dist/usergroups/post/response.d.ts +1 -0
  290. package/dist/usergroups/post/response.js +3 -0
  291. package/dist/usergroups/post/response.js.map +1 -0
  292. package/dist/usergroups/shared.d.ts +25 -0
  293. package/dist/usergroups/shared.js +11 -0
  294. package/dist/usergroups/shared.js.map +1 -0
  295. package/dist/users/[id]/get/response.d.ts +0 -2
  296. package/dist/users/[id]/patch/request.d.ts +5 -1
  297. package/dist/users/current.d.ts +34 -4
  298. package/dist/users/get/query.d.ts +0 -2
  299. package/dist/users/home-layout/index.d.ts +3 -0
  300. package/dist/users/home-layout/index.js +20 -0
  301. package/dist/users/home-layout/index.js.map +1 -0
  302. package/dist/users/home-layout/request.d.ts +5 -0
  303. package/dist/users/home-layout/request.js +3 -0
  304. package/dist/users/home-layout/request.js.map +1 -0
  305. package/dist/users/home-layout/response.d.ts +5 -0
  306. package/dist/users/home-layout/response.js +3 -0
  307. package/dist/users/home-layout/response.js.map +1 -0
  308. package/dist/users/home-layout/shared.d.ts +244 -0
  309. package/dist/users/home-layout/shared.js +30 -0
  310. package/dist/users/home-layout/shared.js.map +1 -0
  311. package/dist/users/index.d.ts +1 -0
  312. package/dist/users/index.js +1 -0
  313. package/dist/users/index.js.map +1 -1
  314. package/dist/users/post/request.d.ts +6 -1
  315. package/package.json +2 -2
@@ -0,0 +1,29 @@
1
+ import { FieldDataType, FieldInputType, FieldSource } from '../../fields';
2
+ import { AiProvider } from '../shared';
3
+ export declare type AiExpressionMode = 'readinessRule' | 'computedField';
4
+ /** Kept under its original name; the general union now lives in ai/shared.ts. */
5
+ export declare type AiExpressionProvider = AiProvider;
6
+ /**
7
+ * A field the AI may reference, supplied inline by the client (which already
8
+ * holds the type's resolved fields). A trimmed view of `GetFieldResponse` — the
9
+ * server builds the preamble + validates against this, so the client never has
10
+ * to round-trip the schema.
11
+ */
12
+ export interface AiExpressionField {
13
+ name: string;
14
+ dataType: FieldDataType;
15
+ inputType?: FieldInputType;
16
+ options?: string[];
17
+ label?: string;
18
+ source?: FieldSource;
19
+ }
20
+ export interface PostAiExpressionRequest {
21
+ /** Plain-language description of the rule / calculation. */
22
+ prompt: string;
23
+ /** Which kind of expression to produce. */
24
+ mode: AiExpressionMode;
25
+ /** The fields the expression may reference (the type's resolved fields). */
26
+ fields: AiExpressionField[];
27
+ /** Required for `computedField`: the field being computed (excluded from refs). */
28
+ fieldName?: string;
29
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/ai/expression/request.ts"],"names":[],"mappings":""}
@@ -0,0 +1,23 @@
1
+ export interface PostAiExpressionResponse {
2
+ /** true when a usable expression was produced (and validated, for readiness). */
3
+ ok: boolean;
4
+ /** The generated excelexp expression, or null when declined / unbuildable. */
5
+ expression: string | null;
6
+ /**
7
+ * readinessRule: the display text shown when the rule fires — house-style, with
8
+ * `{FieldName}` placeholders. null for computedField, and null on a decline.
9
+ */
10
+ message: string | null;
11
+ /**
12
+ * readinessRule severity, set ONLY from explicit severity words in the prompt:
13
+ * 1 = amber, 2 = red. null when the prompt stated no severity (the author picks)
14
+ * or for computedField.
15
+ */
16
+ level: 1 | 2 | null;
17
+ /** Author-facing explanation/caveat: why it declined, or a one-line caveat. */
18
+ note: string | null;
19
+ /** Server-side compiler findings (empty when the expression compiles cleanly). */
20
+ warnings: string[];
21
+ /** The model that answered. */
22
+ model: string;
23
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/ai/expression/response.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export * from './shared';
2
+ export * from './expression';
3
+ export * from './semantic-query';
4
+ export * from './chat';
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./shared"), exports);
18
+ __exportStar(require("./expression"), exports);
19
+ __exportStar(require("./semantic-query"), exports);
20
+ __exportStar(require("./chat"), exports);
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ai/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,+CAA4B;AAC5B,mDAAgC;AAChC,yCAAsB"}
@@ -0,0 +1,2 @@
1
+ export * from './request';
2
+ export * from './response';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./request"), exports);
18
+ __exportStar(require("./response"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ai/semantic-query/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,6CAA0B"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Natural language → semantic query (POST /ai/semantic-query).
3
+ *
4
+ * The compiler is the gate: nothing is returned or stored unless it compiles
5
+ * against the org's real vocabulary. Refinement is IR-as-state — `baseQueryId`
6
+ * points at the stored record being refined; there is no transcript, so
7
+ * refining a query made seconds ago, one saved last month, or one built by
8
+ * clicking filter pills are all the identical call.
9
+ */
10
+ import { SemanticQueryEntityType } from '../../semantic-queries/shared';
11
+ export interface PostAiSemanticQueryRequest {
12
+ /**
13
+ * What the user asked for, in natural language — a fresh query ("blood
14
+ * analysers that aren't ready") or a refinement instruction ("just the
15
+ * Brisbane ones") when `baseQueryId` is set.
16
+ */
17
+ prompt: string;
18
+ /**
19
+ * Id of the stored semantic query being refined. The stored record IS the
20
+ * conversation state: generation returns a NEW draft whose `derivedFrom`
21
+ * points here, and undo walks that chain with no AI call. Only same-entity
22
+ * `query`-kind records refine; anything else starts fresh.
23
+ */
24
+ baseQueryId?: string;
25
+ /**
26
+ * WHICH list to build a query for — which vocabulary the model is shown and
27
+ * the compiler gates against. Defaults to `asset`, what this endpoint has
28
+ * always meant.
29
+ *
30
+ * Only entities the language actually speaks are accepted, and the refusal
31
+ * is loud. Falling back to assets for an entity with no preamble would
32
+ * generate a valid ASSET query from a location question: it compiles, it
33
+ * runs, and it returns a plausible list of the wrong kind of record — the
34
+ * silent-wrong-rows failure this whole surface is built to prevent.
35
+ */
36
+ entityType?: SemanticQueryEntityType;
37
+ /**
38
+ * IANA timezone for "today" in the prompt and for the draft's relative-date
39
+ * resolution — recorded on the registered record exactly as a hand-built
40
+ * registration would.
41
+ */
42
+ timezone?: string;
43
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/ai/semantic-query/request.ts"],"names":[],"mappings":""}
@@ -0,0 +1,40 @@
1
+ import { GetSemanticQueryResponse } from '../../semantic-queries';
2
+ import { AiTokenUsage } from '../shared';
3
+ /**
4
+ * One thing the generation could not do, written to be shown to a user.
5
+ * Two sources, one shape: the MODEL declining honestly ("no such field —
6
+ * did you mean X?") and the COMPILER rejecting what the model produced after
7
+ * its one repair attempt. An honest issue always beats a plausible query —
8
+ * every failure class this feature guards against runs successfully and
9
+ * returns the wrong rows.
10
+ */
11
+ export interface AiSemanticQueryIssue {
12
+ /** Machine code (`MODEL_DECLINED`, or a compiler code like `UNKNOWN_FIELD`). */
13
+ code: string;
14
+ /** Human-readable explanation, shown to the user unchanged. */
15
+ message: string;
16
+ /** Where in the generated query the problem sits, when known (compiler issues). */
17
+ path?: string;
18
+ /** Nearest real vocabulary ("Did you mean 'SerialNumber'?"), when one exists. */
19
+ suggestion?: string;
20
+ }
21
+ /**
22
+ * `ok: true` → the query compiled and was registered as a draft; `record` is
23
+ * the stored record, identical in shape to `GET /semantic-queries/{id}` (the
24
+ * caller reads/refines/promotes it by `record.id` from here on).
25
+ * `ok: false` → nothing was stored; `issues` say why.
26
+ */
27
+ export interface PostAiSemanticQueryResponse {
28
+ /** Whether a validated draft was registered. */
29
+ ok: boolean;
30
+ /** The registered draft (null when `ok` is false). */
31
+ record: GetSemanticQueryResponse | null;
32
+ /** Why generation declined or failed (empty when `ok` is true). */
33
+ issues: AiSemanticQueryIssue[];
34
+ /** True when the first attempt failed validation and the model's repair passed. */
35
+ repaired: boolean;
36
+ /** The generation model that answered (server-side config). */
37
+ model: string;
38
+ /** Token usage across all generation calls this turn (repair included). */
39
+ tokens: AiTokenUsage;
40
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/ai/semantic-query/response.ts"],"names":[],"mappings":""}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Shared shapes for the AI endpoints (expression helper, semantic-query
3
+ * generation, chat). Provider and model are always SERVER-SIDE config — no
4
+ * request shape may carry them, because the caller must never choose which
5
+ * vendor or model spends Spotto's key.
6
+ */
7
+ export declare const aiProviders: readonly ["openai", "anthropic"];
8
+ /** An LLM vendor Spotto can call. */
9
+ export declare type AiProvider = (typeof aiProviders)[number];
10
+ /**
11
+ * Token usage for one AI turn, for observability and offline costing. No
12
+ * dollar figure on the wire — unit prices drift, so cost is derived from
13
+ * model + tokens where the prices are maintained, not baked into responses.
14
+ */
15
+ export interface AiTokenUsage {
16
+ /** Prompt-side tokens, cached included. */
17
+ in: number;
18
+ /** Completion-side tokens. */
19
+ out: number;
20
+ /** The part of `in` served from the provider's prompt cache. */
21
+ cached: number;
22
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ /**
3
+ * Shared shapes for the AI endpoints (expression helper, semantic-query
4
+ * generation, chat). Provider and model are always SERVER-SIDE config — no
5
+ * request shape may carry them, because the caller must never choose which
6
+ * vendor or model spends Spotto's key.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.aiProviders = void 0;
10
+ exports.aiProviders = ['openai', 'anthropic'];
11
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/ai/shared.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,WAAW,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAU,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import { type Point } from 'geojson';
2
2
  import { IEmbeddedLabel } from '../../labels';
3
3
  import { LocationStatus, LocationType } from '../../locations/constants';
4
- import { IEntityMeta, IEmbeddedEntity } from '../../shared';
4
+ import { IEntityMeta, IEmbeddedEntity, IReadiness } from '../../shared';
5
5
  import { IAssetTelemetry } from '../../telemetry';
6
6
  import { IFieldValue } from '../../types';
7
7
  export interface ILastLocation {
@@ -74,4 +74,13 @@ export interface GetAssetResponse {
74
74
  homeLocationPath?: string;
75
75
  readers?: IEmbeddedEntity[];
76
76
  manifestIds?: string[];
77
+ hasManifest?: boolean;
78
+ typeKit?: boolean;
79
+ groupParentId?: string;
80
+ groupAncestors?: string[];
81
+ groupMember?: boolean;
82
+ groupChildCount?: number;
83
+ groupSatisfiesManifest?: 0 | 1 | 2;
84
+ readiness?: IReadiness;
85
+ timeSensitive?: boolean;
77
86
  }
@@ -8,4 +8,9 @@ export interface UpdateAssetRequest {
8
8
  fieldValues?: IFieldValueWithConstraints[];
9
9
  homeLocationId?: string;
10
10
  manifestIds?: string[];
11
+ /**
12
+ * Kit membership (G2G M2): a kit id joins/moves the asset under that kit,
13
+ * `null` leaves its current kit, omitted leaves membership unchanged.
14
+ */
15
+ groupParentId?: string | null;
11
16
  }
@@ -1 +1,16 @@
1
- export { AssetFilters as CountAssetsQuery } from '../get/query';
1
+ import { AssetFilters } from '../get/query';
2
+ export interface CountAssetsQuery extends AssetFilters {
3
+ /**
4
+ * Count a stored semantic query by reference instead of the flat filters.
5
+ * Must NOT be combined with any filter member — the combination is
6
+ * rejected, never merged. An expired or unknown id returns a distinct
7
+ * "gone" error, never a zero count.
8
+ */
9
+ semanticQueryId?: string;
10
+ /**
11
+ * IANA timezone for resolving relative date conditions. The list endpoint
12
+ * has always accepted this; count needs it too, or the same query counted
13
+ * and listed can resolve "today" in two different zones and disagree.
14
+ */
15
+ timezone?: string;
16
+ }
@@ -7,4 +7,11 @@ export interface DownloadAssetsQuery extends AssetFilters {
7
7
  timestampFormat?: TimestampFormat;
8
8
  timezone?: string;
9
9
  withEntityLinks?: boolean;
10
+ /**
11
+ * Export column curation: keep only the custom-field columns for these
12
+ * field ids. Omitted ⇒ every field column (existing API callers
13
+ * unchanged). Ids that resolve to no field are dropped silently — this
14
+ * is UI curation, not access control.
15
+ */
16
+ fieldIds?: string[];
10
17
  }
@@ -1,8 +1,8 @@
1
- import { DateCondition, SearchableSortFields, SortOrders } from '../../shared';
1
+ import { DateCondition, ReadinessState, SearchableSortFields, SortOrders } from '../../shared';
2
2
  import { LocationStatus } from '../../locations/constants';
3
3
  export declare type AssetSearchField = 'name' | 'tagIds';
4
- export declare type AssetEmbedField = 'meta' | 'tagIds' | 'candidateLocations' | 'telemetry' | 'readers';
5
- export declare type AssetSortField = SearchableSortFields | 'battery';
4
+ export declare type AssetEmbedField = 'meta' | 'tagIds' | 'candidateLocations' | 'telemetry' | 'readers' | 'readiness';
5
+ export declare type AssetSortField = SearchableSortFields | 'battery' | 'ready';
6
6
  export declare type AssetBatteryStatus = 'critical' | 'low' | 'ok';
7
7
  declare type _CustomFieldsAssetFilterBase = {
8
8
  id: string;
@@ -17,13 +17,17 @@ export declare type CustomFieldsAssetFilterNumberRange = _CustomFieldsAssetFilte
17
17
  from: number;
18
18
  to: number;
19
19
  };
20
- export declare type CustomFieldsAssetFilter = CustomFieldsAssetFilterValue | CustomFieldsAssetFilterDateCondition | CustomFieldsAssetFilterNumberRange;
20
+ export declare type CustomFieldsAssetFilterBoolean = _CustomFieldsAssetFilterBase & {
21
+ value: boolean;
22
+ };
23
+ export declare type CustomFieldsAssetFilter = CustomFieldsAssetFilterValue | CustomFieldsAssetFilterDateCondition | CustomFieldsAssetFilterNumberRange | CustomFieldsAssetFilterBoolean;
21
24
  export declare type CustomFieldValues = {
22
25
  values?: Array<CustomFieldsAssetFilterValue>;
23
26
  integerRanges?: Array<CustomFieldsAssetFilterNumberRange>;
24
27
  decimalRanges?: Array<CustomFieldsAssetFilterNumberRange>;
25
28
  dateConditions?: Array<CustomFieldsAssetFilterDateCondition>;
26
29
  dateTimeConditions?: Array<CustomFieldsAssetFilterDateCondition>;
30
+ booleanValues?: Array<CustomFieldsAssetFilterBoolean>;
27
31
  };
28
32
  export interface AssetFilters {
29
33
  labels?: string[];
@@ -50,9 +54,14 @@ export interface AssetFilters {
50
54
  supportsWith?: boolean;
51
55
  withAsset?: boolean;
52
56
  dispatched?: boolean;
57
+ timeSensitive?: boolean;
58
+ ready?: ReadinessState[];
59
+ hasReadyIssues?: boolean;
53
60
  createdAt?: DateCondition[];
54
61
  updatedAt?: DateCondition[];
55
62
  lastSeen?: DateCondition[];
63
+ /** Offline-sync delta read: matches records whose `lastChanged` >= this ms-epoch. */
64
+ updatedAfter?: number;
56
65
  }
57
66
  export interface GetAssetsQuery extends AssetFilters {
58
67
  page?: number;
@@ -61,5 +70,14 @@ export interface GetAssetsQuery extends AssetFilters {
61
70
  sortOrder?: SortOrders;
62
71
  embed?: Array<AssetEmbedField>;
63
72
  timezone?: string;
73
+ /**
74
+ * Execute a stored semantic query by reference — the new-client read path.
75
+ * Must NOT be combined with any of the `AssetFilters` members above: the
76
+ * stored query is the whole filter, and the controller rejects the
77
+ * combination rather than silently merging two filter systems. Pagination,
78
+ * sort, embed and timezone still apply. An expired or unknown id returns a
79
+ * distinct "gone" error, never an empty page.
80
+ */
81
+ semanticQueryId?: string;
64
82
  }
65
83
  export {};
@@ -6,7 +6,16 @@ export interface UpdateAssetsLocationRequest {
6
6
  lon?: number;
7
7
  readerId?: string;
8
8
  timestamp?: number;
9
- withAssetId?: string;
9
+ /** The asset these assets are now "with" (the durable carrier pointer).
10
+ * An explicit `null` clears an existing with-link — sent when an asset
11
+ * leaves its group (regrouping plan §5 layer 1); advisory until Slate
12
+ * honours the clear. */
13
+ withAssetId?: string | null;
14
+ /** Subset of `ids` that were located by inference (kit-subtree expansion)
15
+ * rather than physically read — these should be located WITHOUT bumping
16
+ * `lastSeen` (regrouping plan §5 layer 2). Advisory until Slate honours
17
+ * the distinction. */
18
+ inferredAssetIds?: string[];
10
19
  dispatchLocationId?: string;
11
20
  dispatchWithAssetId?: string;
12
21
  dispatchData?: Record<string, unknown>;
@@ -8,6 +8,8 @@ export interface PostAssetRequest {
8
8
  fieldValues?: IFieldValueWithConstraints[];
9
9
  homeLocationId?: string;
10
10
  manifestIds?: string[];
11
+ /** Join a kit at creation — the direct parent kit's id (G2G M2). */
12
+ groupParentId?: string;
11
13
  }
12
14
  export declare type PostAssetsRequest = PostAssetRequest[];
13
15
  export declare const testPostAssetRequest: PostAssetRequest;
@@ -1 +1 @@
1
- {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/assets/post/request.ts"],"names":[],"mappings":";;;AAeA,QAAQ;AACK,QAAA,oBAAoB,GAAqB;IACpD,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,MAAM;IAClB,MAAM,EAAE,OAAO;CAChB,CAAA"}
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/assets/post/request.ts"],"names":[],"mappings":";;;AAiBA,QAAQ;AACK,QAAA,oBAAoB,GAAqB;IACpD,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,MAAM;IAClB,MAAM,EAAE,OAAO;CAChB,CAAA"}
@@ -4,6 +4,21 @@ export declare type AssetCrudEventType = 'AssetCreated' | 'AssetUpdated' | 'Asse
4
4
  export declare type LocationCrudEventType = 'LocationCreated' | 'LocationUpdated' | 'LocationDeleted';
5
5
  export declare type ReaderCrudEventType = 'ReaderCreated' | 'ReaderUpdated' | 'ReaderDeleted';
6
6
  export declare type SnapshotCrudEventType = 'SnapshotCreated' | 'SnapshotDeleted';
7
+ export declare type FormEventType = 'FormSubmitted' | 'FormSubmissionVoided';
7
8
  export declare type SlateEventType = 'ReaderArrived' | 'ReaderExited' | 'Arrived' | 'Moved' | 'Exited' | 'ReaderOnline' | 'ReaderOffline' | 'AssetDispatch';
8
- export declare type EventType = SlateEventType | AssetCrudEventType | LocationCrudEventType | ReaderCrudEventType | SnapshotCrudEventType | 'UserSearch' | 'WorkflowActionExecuted';
9
+ export declare type EventType = SlateEventType | AssetCrudEventType | LocationCrudEventType | ReaderCrudEventType | SnapshotCrudEventType | FormEventType | 'UserSearch' | 'WorkflowActionExecuted';
9
10
  export declare const EVENT_TYPES: EventType[];
11
+ /**
12
+ * The asset CRUD events as a VALUE — the only events whose `thing` is a full
13
+ * asset document (`IAssetCrudSchema`) rather than a bare reference.
14
+ *
15
+ * Exported because the semantic layer scopes `assetType` on activity to exactly
16
+ * these: every movement event embeds a reduced `thing` with no `typePath`, so
17
+ * "movements of forklifts" would match nothing while "forklifts created"
18
+ * worked — right half the time and silent about which half. Compiler,
19
+ * evaluator, AI preamble and the client's chip all read THIS list; four hand
20
+ * written copies would drift the day a fourth asset CRUD event exists.
21
+ *
22
+ * Typed as `AssetCrudEventType[]` so the list cannot diverge from the union.
23
+ */
24
+ export declare const ASSET_CRUD_EVENT_TYPES: AssetCrudEventType[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EVENT_TYPES = exports.EVENT_COUNT_BREAKDOWN = void 0;
3
+ exports.ASSET_CRUD_EVENT_TYPES = exports.EVENT_TYPES = exports.EVENT_COUNT_BREAKDOWN = void 0;
4
4
  exports.EVENT_COUNT_BREAKDOWN = [
5
5
  'year',
6
6
  'week',
@@ -28,7 +28,27 @@ exports.EVENT_TYPES = [
28
28
  'ReaderDeleted',
29
29
  'SnapshotCreated',
30
30
  'SnapshotDeleted',
31
+ 'FormSubmitted',
32
+ 'FormSubmissionVoided',
31
33
  'UserSearch',
32
34
  'WorkflowActionExecuted',
33
35
  ];
36
+ /**
37
+ * The asset CRUD events as a VALUE — the only events whose `thing` is a full
38
+ * asset document (`IAssetCrudSchema`) rather than a bare reference.
39
+ *
40
+ * Exported because the semantic layer scopes `assetType` on activity to exactly
41
+ * these: every movement event embeds a reduced `thing` with no `typePath`, so
42
+ * "movements of forklifts" would match nothing while "forklifts created"
43
+ * worked — right half the time and silent about which half. Compiler,
44
+ * evaluator, AI preamble and the client's chip all read THIS list; four hand
45
+ * written copies would drift the day a fourth asset CRUD event exists.
46
+ *
47
+ * Typed as `AssetCrudEventType[]` so the list cannot diverge from the union.
48
+ */
49
+ exports.ASSET_CRUD_EVENT_TYPES = [
50
+ 'AssetCreated',
51
+ 'AssetUpdated',
52
+ 'AssetDeleted',
53
+ ];
34
54
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/events/constants.ts"],"names":[],"mappings":";;;AACa,QAAA,qBAAqB,GAA0B;IAC1D,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;IACL,MAAM;CACP,CAAA;AAsCY,QAAA,WAAW,GAAgB;IACtC,eAAe;IACf,cAAc;IACd,SAAS;IACT,OAAO;IACP,QAAQ;IACR,cAAc;IACd,eAAe;IACf,eAAe;IACf,cAAc;IACd,cAAc;IACd,cAAc;IACd,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,eAAe;IACf,eAAe;IACf,eAAe;IACf,iBAAiB;IACjB,iBAAiB;IACjB,YAAY;IACZ,wBAAwB;CACzB,CAAA"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/events/constants.ts"],"names":[],"mappings":";;;AACa,QAAA,qBAAqB,GAA0B;IAC1D,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;IACL,MAAM;CACP,CAAA;AAyCY,QAAA,WAAW,GAAgB;IACtC,eAAe;IACf,cAAc;IACd,SAAS;IACT,OAAO;IACP,QAAQ;IACR,cAAc;IACd,eAAe;IACf,eAAe;IACf,cAAc;IACd,cAAc;IACd,cAAc;IACd,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,eAAe;IACf,eAAe;IACf,eAAe;IACf,iBAAiB;IACjB,iBAAiB;IACjB,eAAe;IACf,sBAAsB;IACtB,YAAY;IACZ,wBAAwB;CACzB,CAAA;AAED;;;;;;;;;;;;GAYG;AACU,QAAA,sBAAsB,GAAyB;IAC1D,cAAc;IACd,cAAc;IACd,cAAc;CACf,CAAA"}
@@ -12,4 +12,29 @@ export interface GetEventsQuery extends EventFilters {
12
12
  page?: number;
13
13
  limit?: number;
14
14
  sortOrder?: SortOrders;
15
+ /**
16
+ * Run a stored semantic query instead of the filters above. The stored query
17
+ * REPLACES them — it is not merged, because two filter systems combined
18
+ * produce rows nobody asked for.
19
+ *
20
+ * Deliberately on the QUERY and not on `EventFilters`: download and count
21
+ * extend that interface, and inheriting an id they do not execute would mean
22
+ * accepting it and silently ignoring it.
23
+ */
24
+ semanticQueryId?: string;
25
+ /**
26
+ * A semantic query serialised as JSON, run WITHOUT being stored.
27
+ *
28
+ * Activity is the one entity with no offline corpus, so unlike assets and
29
+ * locations its filters must reach the server. Sending the conditions rather
30
+ * than a reference is what lets an AI answer and a hand-built picker be the
31
+ * same thing: a chip removal edits the query in the URL and re-runs it, with
32
+ * no draft minted per interaction and no link that expires when a 24h draft
33
+ * does.
34
+ *
35
+ * Mutually exclusive with `semanticQueryId` — two queries is not a question.
36
+ */
37
+ semanticQuery?: string;
38
+ /** IANA zone for the query's relative dates; the record's own wins if set. */
39
+ timezone?: string;
15
40
  }
@@ -6,6 +6,7 @@ import { LocationType } from '../../locations/constants';
6
6
  import { GetSnapshotResponse } from '../../snapshots';
7
7
  import { ExecutedWorkflow } from '../../workflows';
8
8
  import { GetAssetResponse } from '../../assets';
9
+ import { ISubmissionAssetEmbed, ISubmissionPayload, ISubmissionVoidPayload } from '../../submissions';
9
10
  export interface EventLocation {
10
11
  id?: string;
11
12
  name?: string;
@@ -85,6 +86,21 @@ export interface IWorkflowActionExecutedEvent extends IBaseEvent {
85
86
  type: 'WorkflowActionExecuted';
86
87
  workflow: ExecutedWorkflow;
87
88
  }
89
+ /** Exactly one of `asset`/`location` is present — the run's target (§4.4). */
90
+ export interface IFormSubmittedEvent extends IBaseEvent {
91
+ type: 'FormSubmitted';
92
+ asset?: ISubmissionAssetEmbed;
93
+ location?: IEmbeddedEntity;
94
+ user: IEmbeddedEntity;
95
+ submission: ISubmissionPayload;
96
+ }
97
+ export interface IFormSubmissionVoidedEvent extends IBaseEvent {
98
+ type: 'FormSubmissionVoided';
99
+ asset?: ISubmissionAssetEmbed;
100
+ location?: IEmbeddedEntity;
101
+ user: IEmbeddedEntity;
102
+ submission: ISubmissionVoidPayload;
103
+ }
88
104
  export interface IArrivedEventAsset extends IEmbeddedEntity {
89
105
  dispatch?: boolean;
90
106
  userId?: string;
@@ -137,7 +153,7 @@ export interface IAssetDispatchEvent extends IBaseEvent {
137
153
  location?: AssetEventLocation;
138
154
  dispatchExpires: number;
139
155
  }
140
- export declare type GetEventResponse = IAssetCrudEvent | ILocationCrudEvent | IReaderCrudEvent | ISnapshotCrudEvent | IUserSearchEvent | IReaderArrivedEvent | IReaderExitedEvent | IArrivedEvent | IMovedEvent | IExitedEvent | IReaderOnlineEvent | IReaderOfflineEvent | IAssetDispatchEvent | IWorkflowActionExecutedEvent;
156
+ export declare type GetEventResponse = IAssetCrudEvent | ILocationCrudEvent | IReaderCrudEvent | ISnapshotCrudEvent | IUserSearchEvent | IReaderArrivedEvent | IReaderExitedEvent | IArrivedEvent | IMovedEvent | IExitedEvent | IReaderOnlineEvent | IReaderOfflineEvent | IAssetDispatchEvent | IWorkflowActionExecutedEvent | IFormSubmittedEvent | IFormSubmissionVoidedEvent;
141
157
  export interface GetEventsResponse {
142
158
  query: GetEventsQuery | null;
143
159
  items: GetEventResponse[];
@@ -1,4 +1,5 @@
1
1
  import { FieldDataType, FieldInputType } from '../constants';
2
+ import { PermissionGrant } from '../../usergroups/shared';
2
3
  export interface GetFieldResponse {
3
4
  id: string;
4
5
  name: string;
@@ -14,6 +15,8 @@ export interface GetFieldResponse {
14
15
  decimalMin?: number;
15
16
  decimalMax?: number;
16
17
  decimalPlaces?: number;
18
+ /** UI-only visibility grants (usergroups); absent/empty = open. */
19
+ permissions?: PermissionGrant[];
17
20
  meta?: {
18
21
  created: number;
19
22
  updated?: number;
@@ -1,4 +1,5 @@
1
1
  import { FieldInputType } from '../../constants';
2
+ import { PermissionGrant } from '../../../usergroups/shared';
2
3
  export interface UpdateFieldRequestOption {
3
4
  value: string;
4
5
  previousValue?: string;
@@ -15,4 +16,7 @@ export interface UpdateFieldRequest {
15
16
  decimalMin?: number | null;
16
17
  decimalMax?: number | null;
17
18
  decimalPlaces?: number | null;
19
+ /** UI-only visibility grants — replaced wholesale; [] clears them (open).
20
+ * Every group id must exist in the org. */
21
+ permissions?: PermissionGrant[];
18
22
  }
@@ -2,3 +2,22 @@ export declare type FieldDataType = 'STRING' | 'INTEGER' | 'DECIMAL' | 'BOOLEAN'
2
2
  export declare const FIELD_DATA_TYPES: FieldDataType[];
3
3
  export declare type FieldInputType = 'SINGLELINE' | 'MULTILINE' | 'LINK' | 'RICHTEXT' | 'DROPDOWN' | 'RADIO' | 'CHECKBOXES' | 'DATE' | 'DATETIME' | 'INTEGER' | 'DECIMAL' | 'SWITCH';
4
4
  export declare const FIELD_INPUT_TYPES: FieldInputType[];
5
+ export declare type FieldSource = 'INPUT' | 'COMPUTED' | 'AGGREGATED';
6
+ export declare const FIELD_SOURCES: FieldSource[];
7
+ export declare type AggregateFunction = 'SUM' | 'AVG' | 'MIN' | 'MAX' | 'COUNT';
8
+ export declare const AGGREGATE_FUNCTIONS: AggregateFunction[];
9
+ /**
10
+ * A per-type field-binding delta, layered onto the inherited field identity
11
+ * (`fieldsAll = parent.fieldsAll ⊕ fields`). Omitted `source` on an override =
12
+ * inherit; explicit `INPUT` = reset to user-entered.
13
+ * - `expression` — COMPUTED: excelexp over the asset's other fields.
14
+ * - `visibleWhen` — conditional visibility (client-render only).
15
+ * - `function` — AGGREGATED (M2 — kits): the same field is reduced across
16
+ * a kit's direct members.
17
+ */
18
+ export interface IFieldBindingDelta {
19
+ source?: FieldSource;
20
+ expression?: string;
21
+ visibleWhen?: string;
22
+ function?: AggregateFunction;
23
+ }