@spotto/contract 1.0.70-alpha.8 → 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.
- package/README.md +33 -33
- package/dist/actions/[id]/index.d.ts +1 -0
- package/dist/actions/[id]/index.js +18 -0
- package/dist/actions/[id]/index.js.map +1 -0
- package/dist/actions/[id]/patch/index.d.ts +2 -0
- package/dist/actions/[id]/patch/index.js +19 -0
- package/dist/actions/[id]/patch/index.js.map +1 -0
- package/dist/actions/[id]/patch/request.d.ts +16 -0
- package/dist/actions/[id]/patch/request.js +3 -0
- package/dist/actions/[id]/patch/request.js.map +1 -0
- package/dist/actions/[id]/patch/response.d.ts +1 -0
- package/dist/actions/[id]/patch/response.js +3 -0
- package/dist/actions/[id]/patch/response.js.map +1 -0
- package/dist/actions/get/index.d.ts +2 -0
- package/dist/actions/get/index.js +19 -0
- package/dist/actions/get/index.js.map +1 -0
- package/dist/actions/get/query.d.ts +14 -0
- package/dist/actions/get/query.js +3 -0
- package/dist/actions/get/query.js.map +1 -0
- package/dist/actions/get/response.d.ts +29 -0
- package/dist/actions/get/response.js +3 -0
- package/dist/actions/get/response.js.map +1 -0
- package/dist/actions/index.d.ts +4 -0
- package/dist/actions/index.js +21 -0
- package/dist/actions/index.js.map +1 -0
- package/dist/actions/post/index.d.ts +2 -0
- package/dist/actions/post/index.js +19 -0
- package/dist/actions/post/index.js.map +1 -0
- package/dist/actions/post/request.d.ts +15 -0
- package/dist/actions/post/request.js +3 -0
- package/dist/actions/post/request.js.map +1 -0
- package/dist/actions/post/response.d.ts +1 -0
- package/dist/actions/post/response.js +3 -0
- package/dist/actions/post/response.js.map +1 -0
- package/dist/actions/shared.d.ts +51 -0
- package/dist/actions/shared.js +13 -0
- package/dist/actions/shared.js.map +1 -0
- package/dist/ai/chat/index.d.ts +2 -0
- package/dist/ai/chat/index.js +19 -0
- package/dist/ai/chat/index.js.map +1 -0
- package/dist/ai/chat/request.d.ts +42 -0
- package/dist/ai/chat/request.js +3 -0
- package/dist/ai/chat/request.js.map +1 -0
- package/dist/ai/chat/response.d.ts +74 -0
- package/dist/ai/chat/response.js +11 -0
- package/dist/ai/chat/response.js.map +1 -0
- package/dist/ai/expression/request.d.ts +3 -1
- package/dist/ai/index.d.ts +3 -0
- package/dist/ai/index.js +3 -0
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/semantic-query/index.d.ts +2 -0
- package/dist/ai/semantic-query/index.js +19 -0
- package/dist/ai/semantic-query/index.js.map +1 -0
- package/dist/ai/semantic-query/request.d.ts +43 -0
- package/dist/ai/semantic-query/request.js +3 -0
- package/dist/ai/semantic-query/request.js.map +1 -0
- package/dist/ai/semantic-query/response.d.ts +40 -0
- package/dist/ai/semantic-query/response.js +3 -0
- package/dist/ai/semantic-query/response.js.map +1 -0
- package/dist/ai/shared.d.ts +22 -0
- package/dist/ai/shared.js +11 -0
- package/dist/ai/shared.js.map +1 -0
- package/dist/assets/[id]/get.d.ts +2 -1
- package/dist/assets/count/query.d.ts +16 -1
- package/dist/assets/download/query.d.ts +7 -0
- package/dist/assets/get/query.d.ts +16 -1
- package/dist/assets/location/request.d.ts +10 -1
- package/dist/events/constants.d.ts +16 -1
- package/dist/events/constants.js +21 -1
- package/dist/events/constants.js.map +1 -1
- package/dist/events/get/query.d.ts +25 -0
- package/dist/events/get/response.d.ts +17 -1
- package/dist/fields/[id]/get.d.ts +3 -0
- package/dist/fields/[id]/patch/request.d.ts +4 -0
- package/dist/forms/[id]/index.d.ts +1 -0
- package/dist/forms/[id]/index.js +18 -0
- package/dist/forms/[id]/index.js.map +1 -0
- package/dist/forms/[id]/patch/index.d.ts +2 -0
- package/dist/forms/[id]/patch/index.js +19 -0
- package/dist/forms/[id]/patch/index.js.map +1 -0
- package/dist/forms/[id]/patch/request.d.ts +14 -0
- package/dist/forms/[id]/patch/request.js +3 -0
- package/dist/forms/[id]/patch/request.js.map +1 -0
- package/dist/forms/[id]/patch/response.d.ts +1 -0
- package/dist/forms/[id]/patch/response.js +3 -0
- package/dist/forms/[id]/patch/response.js.map +1 -0
- package/dist/forms/constants.d.ts +19 -0
- package/dist/forms/constants.js +33 -0
- package/dist/forms/constants.js.map +1 -0
- package/dist/forms/get/index.d.ts +2 -0
- package/dist/forms/get/index.js +19 -0
- package/dist/forms/get/index.js.map +1 -0
- package/dist/forms/get/query.d.ts +18 -0
- package/dist/forms/get/query.js +3 -0
- package/dist/forms/get/query.js.map +1 -0
- package/dist/forms/get/response.d.ts +23 -0
- package/dist/forms/get/response.js +3 -0
- package/dist/forms/get/response.js.map +1 -0
- package/dist/forms/index.d.ts +6 -0
- package/dist/forms/index.js +23 -0
- package/dist/forms/index.js.map +1 -0
- package/dist/forms/post/index.d.ts +2 -0
- package/dist/forms/post/index.js +19 -0
- package/dist/forms/post/index.js.map +1 -0
- package/dist/forms/post/request.d.ts +9 -0
- package/dist/forms/post/request.js +3 -0
- package/dist/forms/post/request.js.map +1 -0
- package/dist/forms/post/response.d.ts +1 -0
- package/dist/forms/post/response.js +3 -0
- package/dist/forms/post/response.js.map +1 -0
- package/dist/forms/shared.d.ts +127 -0
- package/dist/forms/shared.js +3 -0
- package/dist/forms/shared.js.map +1 -0
- package/dist/forms/versions/index.d.ts +2 -0
- package/dist/forms/versions/index.js +19 -0
- package/dist/forms/versions/index.js.map +1 -0
- package/dist/forms/versions/path.d.ts +8 -0
- package/dist/forms/versions/path.js +3 -0
- package/dist/forms/versions/path.js.map +1 -0
- package/dist/forms/versions/response.d.ts +1 -0
- package/dist/forms/versions/response.js +3 -0
- package/dist/forms/versions/response.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/locations/get/query.d.ts +14 -0
- package/dist/organisations/constants.d.ts +11 -0
- package/dist/organisations/sso/constants.d.ts +15 -0
- package/dist/organisations/sso/constants.js +16 -1
- package/dist/organisations/sso/constants.js.map +1 -1
- package/dist/organisations/sso/types.d.ts +48 -0
- package/dist/readers/get/query.d.ts +12 -0
- package/dist/semantic-queries/[id]/index.d.ts +1 -0
- package/dist/semantic-queries/[id]/index.js +18 -0
- package/dist/semantic-queries/[id]/index.js.map +1 -0
- package/dist/semantic-queries/[id]/patch/index.d.ts +2 -0
- package/dist/semantic-queries/[id]/patch/index.js +19 -0
- package/dist/semantic-queries/[id]/patch/index.js.map +1 -0
- package/dist/semantic-queries/[id]/patch/request.d.ts +20 -0
- package/dist/semantic-queries/[id]/patch/request.js +3 -0
- package/dist/semantic-queries/[id]/patch/request.js.map +1 -0
- package/dist/semantic-queries/[id]/patch/response.d.ts +1 -0
- package/dist/semantic-queries/[id]/patch/response.js +3 -0
- package/dist/semantic-queries/[id]/patch/response.js.map +1 -0
- package/dist/semantic-queries/get/index.d.ts +2 -0
- package/dist/semantic-queries/get/index.js +19 -0
- package/dist/semantic-queries/get/index.js.map +1 -0
- package/dist/semantic-queries/get/query.d.ts +18 -0
- package/dist/semantic-queries/get/query.js +3 -0
- package/dist/semantic-queries/get/query.js.map +1 -0
- package/dist/semantic-queries/get/response.d.ts +40 -0
- package/dist/semantic-queries/get/response.js +3 -0
- package/dist/semantic-queries/get/response.js.map +1 -0
- package/dist/semantic-queries/index.d.ts +4 -0
- package/dist/semantic-queries/index.js +21 -0
- package/dist/semantic-queries/index.js.map +1 -0
- package/dist/semantic-queries/post/index.d.ts +2 -0
- package/dist/semantic-queries/post/index.js +19 -0
- package/dist/semantic-queries/post/index.js.map +1 -0
- package/dist/semantic-queries/post/request.d.ts +56 -0
- package/dist/semantic-queries/post/request.js +3 -0
- package/dist/semantic-queries/post/request.js.map +1 -0
- package/dist/semantic-queries/post/response.d.ts +1 -0
- package/dist/semantic-queries/post/response.js +3 -0
- package/dist/semantic-queries/post/response.js.map +1 -0
- package/dist/semantic-queries/shared.d.ts +853 -0
- package/dist/semantic-queries/shared.js +318 -0
- package/dist/semantic-queries/shared.js.map +1 -0
- package/dist/shared/attachments.d.ts +29 -0
- package/dist/shared/attachments.js +11 -0
- package/dist/shared/attachments.js.map +1 -0
- package/dist/shared/embed.d.ts +14 -0
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.js +1 -0
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/readiness.d.ts +23 -0
- package/dist/snapshots/[id]/get.d.ts +139 -11
- package/dist/snapshots/[id]/get.js.map +1 -1
- package/dist/snapshots/get/query.d.ts +39 -0
- package/dist/snapshots/get/query.js +23 -1
- package/dist/snapshots/get/query.js.map +1 -1
- package/dist/snapshots/post/request.d.ts +21 -0
- package/dist/snapshots/post/request.js.map +1 -1
- package/dist/sso/onboard/request.d.ts +12 -1
- package/dist/sso/sso-mappings/request.d.ts +10 -5
- package/dist/submissions/[id]/index.d.ts +1 -0
- package/dist/submissions/[id]/index.js +18 -0
- package/dist/submissions/[id]/index.js.map +1 -0
- package/dist/submissions/[id]/void/post.d.ts +6 -0
- package/dist/submissions/[id]/void/post.js +3 -0
- package/dist/submissions/[id]/void/post.js.map +1 -0
- package/dist/submissions/constants.d.ts +14 -0
- package/dist/submissions/constants.js +21 -0
- package/dist/submissions/constants.js.map +1 -0
- package/dist/submissions/get/index.d.ts +2 -0
- package/dist/submissions/get/index.js +19 -0
- package/dist/submissions/get/index.js.map +1 -0
- package/dist/submissions/get/query.d.ts +14 -0
- package/dist/submissions/get/query.js +3 -0
- package/dist/submissions/get/query.js.map +1 -0
- package/dist/submissions/get/response.d.ts +6 -0
- package/dist/submissions/get/response.js +3 -0
- package/dist/submissions/get/response.js.map +1 -0
- package/dist/submissions/index.d.ts +6 -0
- package/dist/submissions/index.js +23 -0
- package/dist/submissions/index.js.map +1 -0
- package/dist/submissions/post/index.d.ts +2 -0
- package/dist/submissions/post/index.js +19 -0
- package/dist/submissions/post/index.js.map +1 -0
- package/dist/submissions/post/request.d.ts +17 -0
- package/dist/submissions/post/request.js +3 -0
- package/dist/submissions/post/request.js.map +1 -0
- package/dist/submissions/post/response.d.ts +22 -0
- package/dist/submissions/post/response.js +3 -0
- package/dist/submissions/post/response.js.map +1 -0
- package/dist/submissions/shared.d.ts +133 -0
- package/dist/submissions/shared.js +3 -0
- package/dist/submissions/shared.js.map +1 -0
- package/dist/submissions/uploads/[fileId]/get.d.ts +11 -0
- package/dist/submissions/uploads/[fileId]/get.js +3 -0
- package/dist/submissions/uploads/[fileId]/get.js.map +1 -0
- package/dist/submissions/uploads/[fileId]/index.d.ts +1 -0
- package/dist/submissions/uploads/[fileId]/index.js +18 -0
- package/dist/submissions/uploads/[fileId]/index.js.map +1 -0
- package/dist/submissions/uploads/index.d.ts +2 -0
- package/dist/submissions/uploads/index.js +19 -0
- package/dist/submissions/uploads/index.js.map +1 -0
- package/dist/submissions/uploads/post/index.d.ts +2 -0
- package/dist/submissions/uploads/post/index.js +19 -0
- package/dist/submissions/uploads/post/index.js.map +1 -0
- package/dist/submissions/uploads/post/request.d.ts +9 -0
- package/dist/submissions/uploads/post/request.js +3 -0
- package/dist/submissions/uploads/post/request.js.map +1 -0
- package/dist/submissions/uploads/post/response.d.ts +18 -0
- package/dist/submissions/uploads/post/response.js +3 -0
- package/dist/submissions/uploads/post/response.js.map +1 -0
- package/dist/types/[id]/get.d.ts +3 -1
- package/dist/types/[id]/patch/request.d.ts +4 -1
- package/dist/types/post/request.d.ts +2 -1
- package/dist/types/post/request.js.map +1 -1
- package/dist/usergroups/[id]/index.d.ts +1 -0
- package/dist/usergroups/[id]/index.js +18 -0
- package/dist/usergroups/[id]/index.js.map +1 -0
- package/dist/usergroups/[id]/patch/index.d.ts +2 -0
- package/dist/usergroups/[id]/patch/index.js +19 -0
- package/dist/usergroups/[id]/patch/index.js.map +1 -0
- package/dist/usergroups/[id]/patch/request.d.ts +12 -0
- package/dist/usergroups/[id]/patch/request.js +3 -0
- package/dist/usergroups/[id]/patch/request.js.map +1 -0
- package/dist/usergroups/[id]/patch/response.d.ts +1 -0
- package/dist/usergroups/[id]/patch/response.js +3 -0
- package/dist/usergroups/[id]/patch/response.js.map +1 -0
- package/dist/usergroups/get/index.d.ts +2 -0
- package/dist/usergroups/get/index.js +19 -0
- package/dist/usergroups/get/index.js.map +1 -0
- package/dist/usergroups/get/query.d.ts +12 -0
- package/dist/usergroups/get/query.js +3 -0
- package/dist/usergroups/get/query.js.map +1 -0
- package/dist/usergroups/get/response.d.ts +35 -0
- package/dist/usergroups/get/response.js +3 -0
- package/dist/usergroups/get/response.js.map +1 -0
- package/dist/usergroups/index.d.ts +4 -0
- package/dist/usergroups/index.js +21 -0
- package/dist/usergroups/index.js.map +1 -0
- package/dist/usergroups/post/index.d.ts +2 -0
- package/dist/usergroups/post/index.js +19 -0
- package/dist/usergroups/post/index.js.map +1 -0
- package/dist/usergroups/post/request.d.ts +11 -0
- package/dist/usergroups/post/request.js +3 -0
- package/dist/usergroups/post/request.js.map +1 -0
- package/dist/usergroups/post/response.d.ts +1 -0
- package/dist/usergroups/post/response.js +3 -0
- package/dist/usergroups/post/response.js.map +1 -0
- package/dist/usergroups/shared.d.ts +25 -0
- package/dist/usergroups/shared.js +11 -0
- package/dist/usergroups/shared.js.map +1 -0
- package/dist/users/[id]/get/response.d.ts +0 -2
- package/dist/users/[id]/patch/request.d.ts +5 -1
- package/dist/users/current.d.ts +22 -4
- package/dist/users/get/query.d.ts +0 -2
- package/dist/users/home-layout/shared.d.ts +96 -21
- package/dist/users/home-layout/shared.js +11 -5
- package/dist/users/home-layout/shared.js.map +1 -1
- package/dist/users/post/request.d.ts +6 -1
- package/package.json +2 -2
|
@@ -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 @@
|
|
|
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 @@
|
|
|
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"}
|
|
@@ -74,12 +74,13 @@ export interface GetAssetResponse {
|
|
|
74
74
|
homeLocationPath?: string;
|
|
75
75
|
readers?: IEmbeddedEntity[];
|
|
76
76
|
manifestIds?: string[];
|
|
77
|
+
hasManifest?: boolean;
|
|
77
78
|
typeKit?: boolean;
|
|
78
79
|
groupParentId?: string;
|
|
79
80
|
groupAncestors?: string[];
|
|
80
81
|
groupMember?: boolean;
|
|
81
82
|
groupChildCount?: number;
|
|
82
|
-
|
|
83
|
+
groupSatisfiesManifest?: 0 | 1 | 2;
|
|
83
84
|
readiness?: IReadiness;
|
|
84
85
|
timeSensitive?: boolean;
|
|
85
86
|
}
|
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
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
|
}
|
|
@@ -17,13 +17,17 @@ export declare type CustomFieldsAssetFilterNumberRange = _CustomFieldsAssetFilte
|
|
|
17
17
|
from: number;
|
|
18
18
|
to: number;
|
|
19
19
|
};
|
|
20
|
-
export declare type
|
|
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[];
|
|
@@ -56,6 +60,8 @@ export interface AssetFilters {
|
|
|
56
60
|
createdAt?: DateCondition[];
|
|
57
61
|
updatedAt?: DateCondition[];
|
|
58
62
|
lastSeen?: DateCondition[];
|
|
63
|
+
/** Offline-sync delta read: matches records whose `lastChanged` >= this ms-epoch. */
|
|
64
|
+
updatedAfter?: number;
|
|
59
65
|
}
|
|
60
66
|
export interface GetAssetsQuery extends AssetFilters {
|
|
61
67
|
page?: number;
|
|
@@ -64,5 +70,14 @@ export interface GetAssetsQuery extends AssetFilters {
|
|
|
64
70
|
sortOrder?: SortOrders;
|
|
65
71
|
embed?: Array<AssetEmbedField>;
|
|
66
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;
|
|
67
82
|
}
|
|
68
83
|
export {};
|
|
@@ -6,7 +6,16 @@ export interface UpdateAssetsLocationRequest {
|
|
|
6
6
|
lon?: number;
|
|
7
7
|
readerId?: string;
|
|
8
8
|
timestamp?: number;
|
|
9
|
-
|
|
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>;
|
|
@@ -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[];
|
package/dist/events/constants.js
CHANGED
|
@@ -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;
|
|
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
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './patch';
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./patch"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/forms/[id]/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB"}
|
|
@@ -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/forms/[id]/patch/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,6CAA0B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FormItem, FormSettings } from '../../shared';
|
|
2
|
+
/**
|
|
3
|
+
* Publishes a new version of the form. `{id}` is the version document the
|
|
4
|
+
* editor loaded — the server inserts exactly `that.version + 1` and returns
|
|
5
|
+
* 409 when the head has moved ("form changed — reload"). Version documents
|
|
6
|
+
* themselves are never mutated. Omitted fields carry over from the loaded
|
|
7
|
+
* version; `name` is immutable. A present `settings` replaces the loaded
|
|
8
|
+
* version's wholesale — publish `{}` to clear it.
|
|
9
|
+
*/
|
|
10
|
+
export interface UpdateFormRequest {
|
|
11
|
+
label?: string;
|
|
12
|
+
items?: FormItem[];
|
|
13
|
+
settings?: FormSettings;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../src/forms/[id]/patch/request.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GetFormResponse as UpdateFormResponse } from '../../get/response';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../../../src/forms/[id]/patch/response.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FieldDataType } from '../fields/constants';
|
|
2
|
+
/**
|
|
3
|
+
* Context names injected into every form-expression environment (entity-neutral
|
|
4
|
+
* — asset and location targets share them). Reserved: the fields service
|
|
5
|
+
* rejects creating a custom field with any of these names (case-insensitively,
|
|
6
|
+
* matching its name-uniqueness rule), because the injected context value would
|
|
7
|
+
* shadow the field in every form env. They can never collide with engine
|
|
8
|
+
* functions — call-vs-identifier is decided syntactically.
|
|
9
|
+
*/
|
|
10
|
+
export declare const RESERVED_CONTEXT_FIELD_NAMES: readonly ["entityId", "entityName", "entityTypeId", "currentUser", "now"];
|
|
11
|
+
export declare type ReservedContextFieldName = (typeof RESERVED_CONTEXT_FIELD_NAMES)[number];
|
|
12
|
+
/**
|
|
13
|
+
* The dataType each injected context value presents as inside a form env —
|
|
14
|
+
* what save-time expression checks and `from`→`to` compatibility resolve a
|
|
15
|
+
* context reference to. Ids are opaque strings; `now` is the submit timestamp.
|
|
16
|
+
*/
|
|
17
|
+
export declare const RESERVED_CONTEXT_FIELD_TYPES: Record<ReservedContextFieldName, FieldDataType>;
|
|
18
|
+
/** Signature/photo capture blocks allowed on a single form version. */
|
|
19
|
+
export declare const MAX_CAPTURE_BLOCKS_PER_FORM = 10;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MAX_CAPTURE_BLOCKS_PER_FORM = exports.RESERVED_CONTEXT_FIELD_TYPES = exports.RESERVED_CONTEXT_FIELD_NAMES = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Context names injected into every form-expression environment (entity-neutral
|
|
6
|
+
* — asset and location targets share them). Reserved: the fields service
|
|
7
|
+
* rejects creating a custom field with any of these names (case-insensitively,
|
|
8
|
+
* matching its name-uniqueness rule), because the injected context value would
|
|
9
|
+
* shadow the field in every form env. They can never collide with engine
|
|
10
|
+
* functions — call-vs-identifier is decided syntactically.
|
|
11
|
+
*/
|
|
12
|
+
exports.RESERVED_CONTEXT_FIELD_NAMES = [
|
|
13
|
+
'entityId',
|
|
14
|
+
'entityName',
|
|
15
|
+
'entityTypeId',
|
|
16
|
+
'currentUser',
|
|
17
|
+
'now',
|
|
18
|
+
];
|
|
19
|
+
/**
|
|
20
|
+
* The dataType each injected context value presents as inside a form env —
|
|
21
|
+
* what save-time expression checks and `from`→`to` compatibility resolve a
|
|
22
|
+
* context reference to. Ids are opaque strings; `now` is the submit timestamp.
|
|
23
|
+
*/
|
|
24
|
+
exports.RESERVED_CONTEXT_FIELD_TYPES = {
|
|
25
|
+
entityId: 'STRING',
|
|
26
|
+
entityName: 'STRING',
|
|
27
|
+
entityTypeId: 'STRING',
|
|
28
|
+
currentUser: 'STRING',
|
|
29
|
+
now: 'DATETIME',
|
|
30
|
+
};
|
|
31
|
+
/** Signature/photo capture blocks allowed on a single form version. */
|
|
32
|
+
exports.MAX_CAPTURE_BLOCKS_PER_FORM = 10;
|
|
33
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/forms/constants.ts"],"names":[],"mappings":";;;AAEA;;;;;;;GAOG;AACU,QAAA,4BAA4B,GAAG;IAC1C,UAAU;IACV,YAAY;IACZ,cAAc;IACd,aAAa;IACb,KAAK;CACG,CAAA;AAKV;;;;GAIG;AACU,QAAA,4BAA4B,GAGrC;IACF,QAAQ,EAAE,QAAQ;IAClB,UAAU,EAAE,QAAQ;IACpB,YAAY,EAAE,QAAQ;IACtB,WAAW,EAAE,QAAQ;IACrB,GAAG,EAAE,UAAU;CAChB,CAAA;AAED,uEAAuE;AAC1D,QAAA,2BAA2B,GAAG,EAAE,CAAA"}
|
|
@@ -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("./query"), exports);
|
|
18
|
+
__exportStar(require("./response"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/forms/get/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB;AACvB,6CAA0B"}
|