@spotto/contract 1.0.70-alpha.2 → 1.0.70-alpha.21
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 +27 -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 +57 -0
- package/dist/ai/chat/response.js +11 -0
- package/dist/ai/chat/response.js.map +1 -0
- package/dist/ai/expression/index.d.ts +2 -0
- package/dist/ai/expression/index.js +19 -0
- package/dist/ai/expression/index.js.map +1 -0
- package/dist/ai/expression/request.d.ts +29 -0
- package/dist/ai/expression/request.js +3 -0
- package/dist/ai/expression/request.js.map +1 -0
- package/dist/ai/expression/response.d.ts +23 -0
- package/dist/ai/expression/response.js +3 -0
- package/dist/ai/expression/response.js.map +1 -0
- package/dist/ai/index.d.ts +4 -0
- package/dist/ai/index.js +21 -0
- package/dist/ai/index.js.map +1 -0
- 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 +9 -1
- package/dist/assets/[id]/patch/request.d.ts +5 -0
- 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 +22 -4
- package/dist/assets/post/request.d.ts +2 -0
- package/dist/assets/post/request.js.map +1 -1
- package/dist/events/constants.d.ts +2 -1
- package/dist/events/constants.js +2 -0
- package/dist/events/constants.js.map +1 -1
- 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/fields/constants.d.ts +19 -0
- package/dist/fields/constants.js +15 -1
- package/dist/fields/constants.js.map +1 -1
- 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 +6 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/integrations/oneblink/patch/request.d.ts +2 -2
- package/dist/integrations/oneblink/token.d.ts +2 -0
- 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/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 +496 -0
- package/dist/semantic-queries/shared.js +224 -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 +2 -0
- package/dist/shared/index.js +2 -0
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/readiness.d.ts +81 -0
- package/dist/shared/readiness.js +11 -0
- package/dist/shared/readiness.js.map +1 -0
- 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 +17 -2
- package/dist/types/[id]/patch/request.d.ts +16 -2
- package/dist/types/post/request.d.ts +16 -2
- 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 +29 -4
- package/dist/users/get/query.d.ts +0 -2
- package/dist/users/home-layout/index.d.ts +3 -0
- package/dist/users/home-layout/index.js +20 -0
- package/dist/users/home-layout/index.js.map +1 -0
- package/dist/users/home-layout/request.d.ts +5 -0
- package/dist/users/home-layout/request.js +3 -0
- package/dist/users/home-layout/request.js.map +1 -0
- package/dist/users/home-layout/response.d.ts +5 -0
- package/dist/users/home-layout/response.js +3 -0
- package/dist/users/home-layout/response.js.map +1 -0
- package/dist/users/home-layout/shared.d.ts +98 -0
- package/dist/users/home-layout/shared.js +21 -0
- package/dist/users/home-layout/shared.js.map +1 -0
- package/dist/users/index.d.ts +1 -0
- package/dist/users/index.js +1 -0
- package/dist/users/index.js.map +1 -1
- package/dist/users/post/request.d.ts +6 -1
- package/package.json +2 -2
|
@@ -42,6 +42,40 @@ export interface RoleMappingInput {
|
|
|
42
42
|
propertyValue: string;
|
|
43
43
|
roleId: string;
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* One row in the org's usergroup-mapping list. At sign-in the IdP-emitted
|
|
47
|
+
* group claim (captured into `custom:g2g_groups` via the per-org Cognito IdP
|
|
48
|
+
* `AttributeMapping`) is normalised to `string[]` and matched against this
|
|
49
|
+
* list; unlike `RoleMapping` (first match wins, order significant) the
|
|
50
|
+
* semantics are **union** — the user joins every group whose `propertyValue`
|
|
51
|
+
* appears in the normalised values, and order is irrelevant.
|
|
52
|
+
*
|
|
53
|
+
* A group referenced here is *SSO-managed* for federated users: membership
|
|
54
|
+
* within the mapped set is reconciled (added AND removed) on every sync, and
|
|
55
|
+
* manual membership edits for `authProvider: 'sso'` users are refused at both
|
|
56
|
+
* write doors. Groups NOT referenced here are untouched by sync.
|
|
57
|
+
*
|
|
58
|
+
* Generic over the identifier type so the same shape covers both the wire
|
|
59
|
+
* layer (string IDs) and the Mongo storage layer (ObjectId).
|
|
60
|
+
*/
|
|
61
|
+
export interface UsergroupMapping<TId = string> {
|
|
62
|
+
_id: TId;
|
|
63
|
+
/**
|
|
64
|
+
* Value to look for in the IdP-emitted claim. Compared with `===` against
|
|
65
|
+
* each entry of the normalised `string[]` — case-sensitive, exact match.
|
|
66
|
+
*/
|
|
67
|
+
propertyValue: string;
|
|
68
|
+
/** Spotto user group the matching user joins. */
|
|
69
|
+
usergroupId: TId;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Wire shape for creating / replacing usergroup mappings. `_id` is
|
|
73
|
+
* server-assigned on each write, so it's not part of the input.
|
|
74
|
+
*/
|
|
75
|
+
export interface UsergroupMappingInput {
|
|
76
|
+
propertyValue: string;
|
|
77
|
+
usergroupId: string;
|
|
78
|
+
}
|
|
45
79
|
export interface SsoEnabledBase<TRoleId = string> {
|
|
46
80
|
enabled: true;
|
|
47
81
|
/** Email domains owned by this org. One domain → one org (enforced at write time). */
|
|
@@ -66,6 +100,20 @@ export interface SsoEnabledBase<TRoleId = string> {
|
|
|
66
100
|
* through to `unknownRoleAction`. See `RoleMapping`.
|
|
67
101
|
*/
|
|
68
102
|
roleMappings: RoleMapping<TRoleId>[];
|
|
103
|
+
/**
|
|
104
|
+
* IdP-side claim name that feeds the Cognito `custom:g2g_groups` attribute.
|
|
105
|
+
* Absent ⇒ group sync is off for this org (the pre-feature state; also the
|
|
106
|
+
* default — group mapping is opt-in per org). May name the same IdP claim
|
|
107
|
+
* as `idpRoleClaim`: two `AttributeMapping` entries can read one claim.
|
|
108
|
+
*/
|
|
109
|
+
idpGroupClaim?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Org-scoped usergroup-mapping list, union semantics. Absent/empty ⇒ no
|
|
112
|
+
* groups are SSO-managed and sync is a no-op. Unlike the role claim there
|
|
113
|
+
* is no unknown-value fallback — zero matches is a legitimate outcome
|
|
114
|
+
* (`unknownRoleAction` remains the only login gate). See `UsergroupMapping`.
|
|
115
|
+
*/
|
|
116
|
+
usergroupMappings?: UsergroupMapping<TRoleId>[];
|
|
69
117
|
/**
|
|
70
118
|
* Mixed-mode opt-in: when `true`, the org accepts both SSO-managed users
|
|
71
119
|
* (via federation) AND password-auth users created through `POST /users`.
|
|
@@ -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/semantic-queries/[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/semantic-queries/[id]/patch/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,6CAA0B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SemanticQuery, SemanticQueryVisibility, SemanticQueryDisplay } from '../../shared';
|
|
2
|
+
/**
|
|
3
|
+
* Update a stored record. Setting `name` on a draft PROMOTES it: the expiry is
|
|
4
|
+
* cleared and the same record — same id — becomes a saved query. There is no
|
|
5
|
+
* copy and no second store; save is a lifecycle change, not a relocation.
|
|
6
|
+
*
|
|
7
|
+
* On an already-saved record this is the rename/update path: `semanticQuery`
|
|
8
|
+
* replaces the stored query (the save-back after editing via a linked draft),
|
|
9
|
+
* `display` the table config, and so on. Fields omitted are left unchanged.
|
|
10
|
+
*/
|
|
11
|
+
export interface PatchSemanticQueryRequest {
|
|
12
|
+
name?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
/** `organisation` requires the share permission. */
|
|
15
|
+
visibility?: SemanticQueryVisibility;
|
|
16
|
+
semanticQuery?: SemanticQuery;
|
|
17
|
+
display?: SemanticQueryDisplay;
|
|
18
|
+
/** IANA timezone the query's relative dates resolve against. */
|
|
19
|
+
timezone?: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../src/semantic-queries/[id]/patch/request.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GetSemanticQueryResponse as PatchSemanticQueryResponse } from '../../get/response';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../../../src/semantic-queries/[id]/patch/response.ts"],"names":[],"mappings":""}
|
|
@@ -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/semantic-queries/get/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB;AACvB,6CAA0B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { StandardSortFields, SortOrders } from '../../shared';
|
|
2
|
+
import { SemanticQueryEntityType, SemanticQueryKind } from '../shared';
|
|
3
|
+
export declare type SemanticQueryEmbedField = 'meta';
|
|
4
|
+
/**
|
|
5
|
+
* Lists SAVED records only — drafts are session state, addressed by id, and
|
|
6
|
+
* never appear in listings.
|
|
7
|
+
*/
|
|
8
|
+
export interface GetSemanticQueriesQuery {
|
|
9
|
+
page?: number;
|
|
10
|
+
limit?: number;
|
|
11
|
+
ids?: string[];
|
|
12
|
+
sort?: StandardSortFields;
|
|
13
|
+
sortOrder?: SortOrders;
|
|
14
|
+
embed?: Array<SemanticQueryEmbedField>;
|
|
15
|
+
entityType?: SemanticQueryEntityType;
|
|
16
|
+
/** `query` (saved views) or `operation` (saved commands). Both when absent. */
|
|
17
|
+
kind?: SemanticQueryKind;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../../src/semantic-queries/get/query.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { IEntityMeta } from '../../shared';
|
|
2
|
+
import { SemanticQuery, SemanticQueryEntityType, SemanticQueryKind, SemanticQueryVisibility, SemanticQueryDisplay, SemanticOperationPayload } from '../shared';
|
|
3
|
+
import { GetSemanticQueriesQuery } from './query';
|
|
4
|
+
/**
|
|
5
|
+
* A stored semantic query — draft or saved, one record either way.
|
|
6
|
+
*
|
|
7
|
+
* `expiresAt` tells the lifecycle stage: a millisecond timestamp on drafts
|
|
8
|
+
* (sliding — each use pushes it out, so expiry genuinely means abandonment),
|
|
9
|
+
* `null` once saved. `name` is present exactly when saved.
|
|
10
|
+
*/
|
|
11
|
+
export interface GetSemanticQueryResponse {
|
|
12
|
+
id: string;
|
|
13
|
+
kind: SemanticQueryKind;
|
|
14
|
+
entityType: SemanticQueryEntityType;
|
|
15
|
+
semanticQuery: SemanticQuery;
|
|
16
|
+
/** Present only when kind is `operation`. */
|
|
17
|
+
operation?: SemanticOperationPayload;
|
|
18
|
+
/** Present exactly when the record is saved. */
|
|
19
|
+
name?: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
/** The natural-language prompt this query was generated from, if any. */
|
|
22
|
+
prompt?: string;
|
|
23
|
+
/** Id of the record this one refined — the undo chain. Drafts only. */
|
|
24
|
+
derivedFrom?: string;
|
|
25
|
+
createdBy: string;
|
|
26
|
+
/** `private` (creator only) or `organisation` (shared org-wide). */
|
|
27
|
+
visibility: SemanticQueryVisibility;
|
|
28
|
+
/** Table display config. Populated on save; absent on drafts. */
|
|
29
|
+
display?: SemanticQueryDisplay;
|
|
30
|
+
/** IANA timezone the query's relative dates resolve against. */
|
|
31
|
+
timezone?: string;
|
|
32
|
+
/** Draft expiry (ms since epoch), or null once saved. */
|
|
33
|
+
expiresAt: number | null;
|
|
34
|
+
meta?: IEntityMeta;
|
|
35
|
+
}
|
|
36
|
+
export interface GetSemanticQueriesResponse {
|
|
37
|
+
query: GetSemanticQueriesQuery | null;
|
|
38
|
+
total: number;
|
|
39
|
+
items: GetSemanticQueryResponse[];
|
|
40
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/semantic-queries/get/response.ts"],"names":[],"mappings":""}
|
|
@@ -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("./get"), exports);
|
|
19
|
+
__exportStar(require("./post"), exports);
|
|
20
|
+
__exportStar(require("./[id]"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/semantic-queries/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,wCAAqB;AACrB,yCAAsB;AACtB,yCAAsB"}
|
|
@@ -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/semantic-queries/post/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,6CAA0B"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { SemanticQuery, SemanticQueryEntityType, SemanticQueryKind, SemanticQueryVisibility, SemanticQueryDisplay, SemanticOperationPayload } from '../shared';
|
|
2
|
+
/**
|
|
3
|
+
* Register a semantic query — the ONLY way a query enters the system. Reads
|
|
4
|
+
* execute by reference (`semanticQueryId`), never by inline query JSON, so
|
|
5
|
+
* nothing can run without having been validated here first.
|
|
6
|
+
*
|
|
7
|
+
* TWO WAYS IN, decided by `name`:
|
|
8
|
+
*
|
|
9
|
+
* - WITHOUT a name the record is a DRAFT with a sliding ~24 h expiry, so a
|
|
10
|
+
* caller may register freely — on every AI turn, on every refinement —
|
|
11
|
+
* without accumulating garbage. Saving it later is a PATCH that sets a name,
|
|
12
|
+
* promoting the same record in place; its id never changes.
|
|
13
|
+
* - WITH a name the record is created SAVED outright. This exists because
|
|
14
|
+
* filtering is offline-first and makes no network call at all, so when
|
|
15
|
+
* someone saves a query they built there is no draft to promote — the save
|
|
16
|
+
* IS the query's first contact with the server. Forcing register-then-name
|
|
17
|
+
* would spend two round trips on one action and strand a nameless draft
|
|
18
|
+
* whenever the second failed.
|
|
19
|
+
*/
|
|
20
|
+
export interface PostSemanticQueryRequest {
|
|
21
|
+
entityType: SemanticQueryEntityType;
|
|
22
|
+
semanticQuery: SemanticQuery;
|
|
23
|
+
/** Defaults to `query`. `operation` records also carry `operation`. */
|
|
24
|
+
kind?: SemanticQueryKind;
|
|
25
|
+
/** Required when kind is `operation`; forbidden otherwise. */
|
|
26
|
+
operation?: SemanticOperationPayload;
|
|
27
|
+
/**
|
|
28
|
+
* Naming the record on creation makes it SAVED rather than a draft — no
|
|
29
|
+
* expiry, listed, and promotion has already happened.
|
|
30
|
+
*/
|
|
31
|
+
name?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Saved records only (a draft is private by definition). `organisation`
|
|
34
|
+
* requires the share permission, exactly as it does on PATCH.
|
|
35
|
+
*/
|
|
36
|
+
visibility?: SemanticQueryVisibility;
|
|
37
|
+
/** Columns, sort and rendering. Saved records only. */
|
|
38
|
+
display?: SemanticQueryDisplay;
|
|
39
|
+
/** Human-readable restatement of the query, shown in the UI. */
|
|
40
|
+
description?: string;
|
|
41
|
+
/** The natural-language prompt this query was generated from, as provenance. */
|
|
42
|
+
prompt?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Id of the record this one refines. The chain of `derivedFrom` links is the
|
|
45
|
+
* conversation state for query building — refinement passes the current
|
|
46
|
+
* record id, never a transcript, and undo walks the chain with no AI call.
|
|
47
|
+
*/
|
|
48
|
+
derivedFrom?: string;
|
|
49
|
+
/**
|
|
50
|
+
* IANA timezone the query's relative dates resolve against, recorded from
|
|
51
|
+
* registration so a draft means the same thing on every execution — without
|
|
52
|
+
* it, "today" depends on whichever caller runs it (and a widget with no
|
|
53
|
+
* timezone parameter would silently resolve in UTC).
|
|
54
|
+
*/
|
|
55
|
+
timezone?: string;
|
|
56
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/semantic-queries/post/request.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GetSemanticQueryResponse as PostSemanticQueryResponse } from '../get/response';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/semantic-queries/post/response.ts"],"names":[],"mappings":""}
|