@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.
- 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/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 +10 -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/location/request.d.ts +10 -1
- package/dist/assets/post/request.d.ts +2 -0
- package/dist/assets/post/request.js.map +1 -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/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 +1 -1
- 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/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 +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/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 +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 +34 -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 +244 -0
- package/dist/users/home-layout/shared.js +30 -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
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IEntityMeta } from '../../shared';
|
|
2
|
+
import { GetUsergroupsQuery } from './query';
|
|
3
|
+
export interface GetUsergroupResponse {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
/** User ids. Membership's source of truth lives here, never on the user. */
|
|
7
|
+
members: string[];
|
|
8
|
+
/**
|
|
9
|
+
* Location-name path prefixes this group confines its members to. Absent
|
|
10
|
+
* or empty = the group abstains from location scope (it may exist purely
|
|
11
|
+
* for field/action grants).
|
|
12
|
+
*/
|
|
13
|
+
locationScope?: string[];
|
|
14
|
+
/**
|
|
15
|
+
* The explicit "entire organisation" sentinel — never expressed as the
|
|
16
|
+
* root location's path (the root's name is the empty string). Emitted
|
|
17
|
+
* only when true.
|
|
18
|
+
*/
|
|
19
|
+
allLocations?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* True when the group is referenced by the org's SSO `usergroupMappings` —
|
|
22
|
+
* i.e. membership is SSO-managed for federated users (manual membership
|
|
23
|
+
* edits for `authProvider: 'sso'` users are refused; sync adds AND removes
|
|
24
|
+
* within the mapped set). Emitted only when true. Lets group/user admin
|
|
25
|
+
* surfaces mark managed groups without needing `sso:admin` to read the
|
|
26
|
+
* org's SSO config.
|
|
27
|
+
*/
|
|
28
|
+
ssoManaged?: boolean;
|
|
29
|
+
meta?: IEntityMeta;
|
|
30
|
+
}
|
|
31
|
+
export interface GetUsergroupsResponse {
|
|
32
|
+
query: GetUsergroupsQuery | null;
|
|
33
|
+
total: number;
|
|
34
|
+
items: GetUsergroupResponse[];
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/usergroups/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/usergroups/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/usergroups/post/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,6CAA0B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface PostUsergroupRequest {
|
|
2
|
+
name: string;
|
|
3
|
+
/** User ids. The actor's own id is rejected — nobody edits their own
|
|
4
|
+
* memberships (the own-role-guard rule). */
|
|
5
|
+
members?: string[];
|
|
6
|
+
/** Non-empty location-name path prefixes; omitted/empty = the group
|
|
7
|
+
* abstains from location scope. Never the root path — "entire
|
|
8
|
+
* organisation" is `allLocations: true`. */
|
|
9
|
+
locationScope?: string[];
|
|
10
|
+
allLocations?: boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/usergroups/post/request.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GetUsergroupResponse as PostUsergroupResponse } from '../get/response';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/usergroups/post/response.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Effective access level a field grant confers. Most-permissive wins across
|
|
3
|
+
* a user's groups; a field with no grants at all is open (EDIT) to everyone.
|
|
4
|
+
* Actions reuse the grant shape with `level` ignored (binary: any grant ⇒
|
|
5
|
+
* members-only).
|
|
6
|
+
*/
|
|
7
|
+
export declare const PERMISSION_GRANT_LEVELS: readonly ["NONE", "VIEW", "EDIT"];
|
|
8
|
+
export declare type PermissionGrantLevel = (typeof PERMISSION_GRANT_LEVELS)[number];
|
|
9
|
+
/** One usergroup's grant on a field or action. */
|
|
10
|
+
export interface PermissionGrant {
|
|
11
|
+
/** Usergroup id — must exist in the organisation at write time. */
|
|
12
|
+
group: string;
|
|
13
|
+
level: PermissionGrantLevel;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A user's resolved location scope, derived from their usergroups: any
|
|
17
|
+
* `allLocations` group — or no location-defining group at all — resolves to
|
|
18
|
+
* unconfined; otherwise the union of the groups' `locationScope` prefixes.
|
|
19
|
+
* Emitted on GET /users/current so the client can detect scope changes.
|
|
20
|
+
*/
|
|
21
|
+
export declare type UsergroupsScope = {
|
|
22
|
+
unconfined: true;
|
|
23
|
+
} | {
|
|
24
|
+
paths: string[];
|
|
25
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PERMISSION_GRANT_LEVELS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Effective access level a field grant confers. Most-permissive wins across
|
|
6
|
+
* a user's groups; a field with no grants at all is open (EDIT) to everyone.
|
|
7
|
+
* Actions reuse the grant shape with `level` ignored (binary: any grant ⇒
|
|
8
|
+
* members-only).
|
|
9
|
+
*/
|
|
10
|
+
exports.PERMISSION_GRANT_LEVELS = ['NONE', 'VIEW', 'EDIT'];
|
|
11
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/usergroups/shared.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACU,QAAA,uBAAuB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAU,CAAA"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export interface UpdateUserRequest {
|
|
2
2
|
name?: string;
|
|
3
3
|
role?: string;
|
|
4
|
-
permissionLocationId?: string;
|
|
5
4
|
homeLocationId?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Complete usergroup membership for the target (group ids) — replaced
|
|
7
|
+
* wholesale; [] clears every membership. Never applied to yourself.
|
|
8
|
+
*/
|
|
9
|
+
usergroups?: string[];
|
|
6
10
|
}
|
package/dist/users/current.d.ts
CHANGED
|
@@ -2,6 +2,13 @@ import { IEntityMeta, IEmbeddedEntity } from '../shared';
|
|
|
2
2
|
import { Preferences } from '../organisations/constants';
|
|
3
3
|
import { Integrations } from '../integrations/constants';
|
|
4
4
|
import { System } from '../system';
|
|
5
|
+
import { StoredHomeLayout } from './home-layout';
|
|
6
|
+
import { PermissionGrantLevel, UsergroupsScope } from '../usergroups/shared';
|
|
7
|
+
/** One entry of the §1.7 field access list — every org field appears. */
|
|
8
|
+
export interface FieldAccessEntry {
|
|
9
|
+
id: string;
|
|
10
|
+
level: PermissionGrantLevel;
|
|
11
|
+
}
|
|
5
12
|
export interface EmbeddedRole extends IEmbeddedEntity {
|
|
6
13
|
permissions: string[];
|
|
7
14
|
}
|
|
@@ -15,8 +22,6 @@ export interface CurrentUserResponse {
|
|
|
15
22
|
name: string;
|
|
16
23
|
role: EmbeddedRole;
|
|
17
24
|
organisation: EmbeddedOrganisation;
|
|
18
|
-
permissionLocationId: string;
|
|
19
|
-
permissionLocationPath: string;
|
|
20
25
|
homeLocationId: string;
|
|
21
26
|
homeLocationPath: string;
|
|
22
27
|
meta?: IEntityMeta;
|
|
@@ -28,14 +33,39 @@ export interface CurrentUserResponse {
|
|
|
28
33
|
* - `undefined` — legacy native user (non-SSO org, or pre-SSO).
|
|
29
34
|
*/
|
|
30
35
|
authProvider?: 'sso' | 'native';
|
|
36
|
+
/**
|
|
37
|
+
* Personal Home-screen layouts (the user's named widget arrangements).
|
|
38
|
+
* Persisted on the user doc and written via
|
|
39
|
+
* `POST /users/current/home-layout`. `undefined` until the user customises —
|
|
40
|
+
* the client then renders its built-in default layout.
|
|
41
|
+
*
|
|
42
|
+
* Typed as STORED, not as the current shape: a document written by an earlier
|
|
43
|
+
* client still carries the pre-v5 single-layout form until that user next
|
|
44
|
+
* saves, and readers have to handle it rather than assume it away.
|
|
45
|
+
*/
|
|
46
|
+
homeLayout?: StoredHomeLayout;
|
|
47
|
+
/**
|
|
48
|
+
* UI-only visibility lists (usergroups feature) — COMPLETE: every org
|
|
49
|
+
* field appears with the caller's effective level (grant-less ⇒ EDIT;
|
|
50
|
+
* admin bypass ⇒ all EDIT), every usable action id appears. All three
|
|
51
|
+
* keys are omitted entirely when the org toggle is OFF — client rule:
|
|
52
|
+
* absent list (or absent id) ⇒ open.
|
|
53
|
+
*/
|
|
54
|
+
fieldAccess?: FieldAccessEntry[];
|
|
55
|
+
actionAccess?: string[];
|
|
56
|
+
/**
|
|
57
|
+
* The caller's resolved location scope, verbatim from the user-doc cache.
|
|
58
|
+
* The offline client treats a CHANGE in this value (including appearing/
|
|
59
|
+
* disappearing) as its delta-cursor + cache reset trigger — delta reads
|
|
60
|
+
* never re-deliver docs whose lastChanged predates the cursor.
|
|
61
|
+
*/
|
|
62
|
+
usergroupsScope?: UsergroupsScope;
|
|
31
63
|
}
|
|
32
64
|
export interface CurrentUserPublicResponse {
|
|
33
65
|
id: string;
|
|
34
66
|
name: string;
|
|
35
67
|
role: EmbeddedRole;
|
|
36
68
|
organisation: EmbeddedOrganisation;
|
|
37
|
-
permissionLocationId: string;
|
|
38
|
-
permissionLocationPath: string;
|
|
39
69
|
homeLocationId: string;
|
|
40
70
|
homeLocationPath: string;
|
|
41
71
|
meta?: IEntityMeta;
|
|
@@ -10,8 +10,6 @@ export interface GetUsersQuery {
|
|
|
10
10
|
sort?: StandardSortFields;
|
|
11
11
|
sortOrder?: SortOrders;
|
|
12
12
|
embed?: Array<UserEmbedField>;
|
|
13
|
-
permissionLocationId?: string;
|
|
14
|
-
permissionLocationPathBeginsWith?: string;
|
|
15
13
|
homeLocationId?: string;
|
|
16
14
|
homeLocationPathBeginsWith?: string;
|
|
17
15
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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("./request"), exports);
|
|
19
|
+
__exportStar(require("./response"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/users/home-layout/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,4CAAyB;AACzB,6CAA0B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/users/home-layout/request.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/users/home-layout/response.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-user Home screen layouts — a personal, server-persisted set of named
|
|
3
|
+
* arrangements of Home widgets. Stored directly on the user document (like
|
|
4
|
+
* `homeLocationId`), returned on `GET /users/current`, and written wholesale
|
|
5
|
+
* via `POST /users/current/home-layout`.
|
|
6
|
+
*
|
|
7
|
+
* Since v5 a user has SEVERAL named layouts and switches between them — the
|
|
8
|
+
* same want saved views answer for a list, applied to the Home. They exist
|
|
9
|
+
* because the thing that changes what a Home should show is the TASK (admin
|
|
10
|
+
* this morning, dispatch this afternoon), not the hardware; a layout that
|
|
11
|
+
* differs by device splits when the task doesn't and fails to split when it
|
|
12
|
+
* does. What device legitimately owns is per-widget (`showOn`).
|
|
13
|
+
*
|
|
14
|
+
* Each layout is a flat, ordered list of widgets, every one pinned to a rect on
|
|
15
|
+
* a 4-column grid (`gridPos`). The widget `type` is a closed union (below):
|
|
16
|
+
* adding a new kind is a contract change + republish + client bump. Per-widget
|
|
17
|
+
* `config` carries widget *behaviour* only (a saved-view id, an action id, a
|
|
18
|
+
* heading's text) — never geometry. Since 2026-07-30 the API validates each
|
|
19
|
+
* kind's KNOWN config keys on write (the per-kind `*WidgetConfig` shapes below)
|
|
20
|
+
* while tolerating unknown keys, so the client can still add config keys
|
|
21
|
+
* without an API deploy ordering — only changing a known key's meaning needs
|
|
22
|
+
* one.
|
|
23
|
+
*
|
|
24
|
+
* `version` discriminates stored layouts so the client can detect and
|
|
25
|
+
* reset/migrate an older one on read — including the pre-v5 single-layout
|
|
26
|
+
* shape, which is still readable as `LegacyHomeLayout`.
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* The kinds of Home widget. Closed set — adding one is a contract change.
|
|
30
|
+
* - `tile-link` — a link card (a saved view or a nav destination); may show a live count.
|
|
31
|
+
* - `summary-list` — top-N rows of a saved view's results.
|
|
32
|
+
* - `recent-activity` — the account's latest activity feed.
|
|
33
|
+
* - `recent-assets` / `recent-locations` — most-recently-updated entities.
|
|
34
|
+
* - `needs-attention` — assets flagged not-ready / partially-ready.
|
|
35
|
+
* - `kit-spotlight` — kit readiness summary.
|
|
36
|
+
* - `hero` — the fleet-readiness hero (overview + inline needs-attention legend),
|
|
37
|
+
* carrying its own mark and label so several can share a Home.
|
|
38
|
+
* - `heading` — a text heading to label a run of widgets (heading text lives in `config`).
|
|
39
|
+
*
|
|
40
|
+
* `heading` is a full-width structural widget: the client renders it spanning the
|
|
41
|
+
* whole row at every breakpoint. `hero` was one too until it learned to render at
|
|
42
|
+
* a quarter, a half or a full row; its width is now the user's, like any other
|
|
43
|
+
* widget's. As with all widgets, width is expressed through `gridPos.w`, not
|
|
44
|
+
* enforced by the API.
|
|
45
|
+
*/
|
|
46
|
+
export declare type HomeWidgetType = 'tile-link' | 'summary-list' | 'recent-activity' | 'recent-assets' | 'recent-locations' | 'needs-attention' | 'kit-spotlight' | 'hero' | 'heading';
|
|
47
|
+
/**
|
|
48
|
+
* Per-kind `config` shapes — the authoritative form of each configurable
|
|
49
|
+
* kind's KNOWN keys, which the API enforces on write (unknown keys pass, so
|
|
50
|
+
* these can grow client-first). The feed kinds define no config keys. `config`
|
|
51
|
+
* itself stays loosely typed on `HomeWidget`; the client parses defensively at
|
|
52
|
+
* the render boundary regardless (stored data may predate validation).
|
|
53
|
+
*/
|
|
54
|
+
/** A `tile-link`'s target: a registered app action or a saved view — never a
|
|
55
|
+
* free URL (the client resolves targets to internal routes by design). */
|
|
56
|
+
export declare type TileLinkWidgetConfig = {
|
|
57
|
+
source: 'action';
|
|
58
|
+
actionId: string;
|
|
59
|
+
} | {
|
|
60
|
+
source: 'view';
|
|
61
|
+
viewId: string;
|
|
62
|
+
};
|
|
63
|
+
/** A `summary-list` renders the top matches of one saved view. */
|
|
64
|
+
export interface SummaryListWidgetConfig {
|
|
65
|
+
viewId: string;
|
|
66
|
+
}
|
|
67
|
+
/** A `heading`'s user-editable label — empty while freshly added. */
|
|
68
|
+
export interface HeadingWidgetConfig {
|
|
69
|
+
text: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* How a hero card presents itself. Both keys are optional: with neither, the
|
|
73
|
+
* client renders its default mark and derives the label from the data source
|
|
74
|
+
* (the saved view's name, or the whole account). They exist because several
|
|
75
|
+
* heroes now share one Home — over different saved views, at different widths —
|
|
76
|
+
* and identical cards would be indistinguishable at a glance.
|
|
77
|
+
*/
|
|
78
|
+
export interface HeroWidgetPresentation {
|
|
79
|
+
/**
|
|
80
|
+
* Icon NAME from the client's curated set (kebab-case, e.g. `ambulance`) —
|
|
81
|
+
* never a URL or markup. The client resolves the name to a component and
|
|
82
|
+
* falls back to its default mark on one it doesn't recognise, which is why
|
|
83
|
+
* the API bounds the string rather than enumerating the set: adding an icon
|
|
84
|
+
* is then a client release, not an API deploy.
|
|
85
|
+
*/
|
|
86
|
+
icon?: string;
|
|
87
|
+
/** Label override. Empty or absent means the client derives it. */
|
|
88
|
+
title?: string;
|
|
89
|
+
}
|
|
90
|
+
/** The `hero`'s data source — the whole account's assets, or one saved view's
|
|
91
|
+
* matches — plus how the card presents itself. The source is always present on
|
|
92
|
+
* a stored hero (the kind shipped with it); the presentation keys are not. */
|
|
93
|
+
export declare type HeroWidgetConfig = HeroWidgetPresentation & ({
|
|
94
|
+
source: 'account';
|
|
95
|
+
} | {
|
|
96
|
+
source: 'view';
|
|
97
|
+
viewId: string;
|
|
98
|
+
});
|
|
99
|
+
/**
|
|
100
|
+
* A widget's cell on the Home grid: top-left position (`x`/`y`) and size
|
|
101
|
+
* (`w`/`h`), in grid units. The grid is 4 columns wide, so `x + w <= 4`, and
|
|
102
|
+
* `h` is a whole number of row-units. Below the desktop breakpoint the client
|
|
103
|
+
* collapses to a single column, so `x`/`w` only bind on wide viewports.
|
|
104
|
+
*/
|
|
105
|
+
export interface HomeWidgetGridPos {
|
|
106
|
+
/** Column of the top-left corner (0-based; `x + w <= 4`). */
|
|
107
|
+
x: number;
|
|
108
|
+
/** Row of the top-left corner (0-based), in row-units. */
|
|
109
|
+
y: number;
|
|
110
|
+
/** Width in columns (1–4). */
|
|
111
|
+
w: number;
|
|
112
|
+
/** Height in row-units (>= 1). */
|
|
113
|
+
h: number;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Which form factors a widget appears on. Absent means every width — the
|
|
117
|
+
* normal case, and the only shape stored layouts carried before 2026-08-18.
|
|
118
|
+
*
|
|
119
|
+
* `mobile` means every NARROW layout, tablets included: they share the same
|
|
120
|
+
* two-column grid, so there is no third thing to name. This exists because a
|
|
121
|
+
* device genuinely owns one question a layout cannot answer for it — whether a
|
|
122
|
+
* widget is usable at all in the room a phone gives it. It deliberately does
|
|
123
|
+
* NOT let a widget sit in a different PLACE per device; a layout that reorders
|
|
124
|
+
* itself by hardware is two layouts to keep in sync, which is what named
|
|
125
|
+
* layouts are for.
|
|
126
|
+
*/
|
|
127
|
+
export declare type HomeWidgetShowOn = 'desktop' | 'mobile';
|
|
128
|
+
export interface HomeWidget {
|
|
129
|
+
/** Stable client-generated id (ulid) — the reorder / remove key. */
|
|
130
|
+
id: string;
|
|
131
|
+
/** Widget kind (closed union). The client registry maps it to a renderer + config shape. */
|
|
132
|
+
type: HomeWidgetType;
|
|
133
|
+
/** Position + size on the 4-column grid. */
|
|
134
|
+
gridPos: HomeWidgetGridPos;
|
|
135
|
+
/** Restrict the widget to one form factor; absent means every width. */
|
|
136
|
+
showOn?: HomeWidgetShowOn;
|
|
137
|
+
/** Widget-specific *behaviour* config (e.g. a saved-view id, a heading's text) — never geometry. Known keys are validated per kind (see the `*WidgetConfig` shapes); unknown keys pass through. */
|
|
138
|
+
config?: Record<string, unknown>;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* One named layout — a user-authored arrangement they can switch to.
|
|
142
|
+
*
|
|
143
|
+
* Layouts are INDEPENDENT: each owns its widgets outright, the way a saved view
|
|
144
|
+
* owns its query. A widget placed in two layouts is two records, and diverging
|
|
145
|
+
* is the point — the alternative (one widget set with per-layout placement)
|
|
146
|
+
* buys "rename the hero once" at the price of splitting a widget's lifetime
|
|
147
|
+
* from its placement everywhere else in the system.
|
|
148
|
+
*/
|
|
149
|
+
export interface NamedHomeLayout {
|
|
150
|
+
/** Stable client-generated id (ulid). */
|
|
151
|
+
id: string;
|
|
152
|
+
/** User-authored name, shown in the Home's layout switcher. */
|
|
153
|
+
name: string;
|
|
154
|
+
/**
|
|
155
|
+
* Icon NAME from the client's curated set (kebab-case, e.g. `ambulance`) —
|
|
156
|
+
* never a URL or markup, exactly as `HeroWidgetPresentation.icon` works. The
|
|
157
|
+
* client resolves the name to a component and falls back to a default mark on
|
|
158
|
+
* one it doesn't recognise, which is why the API bounds the string rather
|
|
159
|
+
* than enumerating the set: adding an icon is then a client release, not an
|
|
160
|
+
* API deploy.
|
|
161
|
+
*
|
|
162
|
+
* A layout's mark is how it is recognised in the switcher, ahead of reading
|
|
163
|
+
* its name — a set of task layouts very often shares a shape (scan-shaped
|
|
164
|
+
* work looks like scan-shaped work), so what distinguishes them has to be
|
|
165
|
+
* chosen rather than derived. Absent on every layout stored before this
|
|
166
|
+
* shipped, so readers need a fallback.
|
|
167
|
+
*/
|
|
168
|
+
icon?: string;
|
|
169
|
+
/**
|
|
170
|
+
* Colour NAME from the client's curated set (e.g. `amber`), on the same terms
|
|
171
|
+
* as `icon`: a name resolved client-side against a known vocabulary, not a
|
|
172
|
+
* hex value. Bounding a name rather than accepting a colour keeps a user from
|
|
173
|
+
* choosing something illegible, keeps light and dark mode in the client's
|
|
174
|
+
* hands, and keeps adding a colour a client release.
|
|
175
|
+
*/
|
|
176
|
+
colour?: string;
|
|
177
|
+
/** Flat, ordered widget list; geometry lives on each widget's `gridPos`. */
|
|
178
|
+
widgets: HomeWidget[];
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* The size of screen a Home is being opened on.
|
|
182
|
+
*
|
|
183
|
+
* Three classes, where `showOn` has two, and the difference is deliberate: they
|
|
184
|
+
* answer different questions. Whether a widget is USABLE in the room it gets is
|
|
185
|
+
* a question about the grid, and a tablet's grid is a phone's (two columns) —
|
|
186
|
+
* hence `desktop | mobile` there. Which layout you want to LAND on is a
|
|
187
|
+
* question about what you are doing, and someone carrying a tablet round a yard
|
|
188
|
+
* is doing neither of the other two jobs.
|
|
189
|
+
*/
|
|
190
|
+
export declare type HomeDeviceClass = 'mobile' | 'tablet' | 'desktop';
|
|
191
|
+
/**
|
|
192
|
+
* Which layout each size of screen opens on — the user's own explicit "land me
|
|
193
|
+
* here" per device, keyed class → layout id.
|
|
194
|
+
*
|
|
195
|
+
* This is the ONE place device legitimately picks a layout, and it does so
|
|
196
|
+
* without splitting anything: the layouts themselves are still task-shaped and
|
|
197
|
+
* available on every device, and this only decides which one is in front of you
|
|
198
|
+
* when you arrive. A class with no entry falls back to whatever that device was
|
|
199
|
+
* last switched to, then to the first layout.
|
|
200
|
+
*
|
|
201
|
+
* A class maps to exactly one layout BY CONSTRUCTION (that is why this is a map
|
|
202
|
+
* and not a flag on each layout — two layouts claiming the phone is not a state
|
|
203
|
+
* worth being able to represent). An id naming a layout that has since been
|
|
204
|
+
* deleted is harmless and deliberately not rejected: the set is edited from
|
|
205
|
+
* several devices, and the client falls through as if the entry were absent.
|
|
206
|
+
*/
|
|
207
|
+
export interface HomeLayoutDeviceDefaults {
|
|
208
|
+
mobile?: string;
|
|
209
|
+
tablet?: string;
|
|
210
|
+
desktop?: string;
|
|
211
|
+
}
|
|
212
|
+
export interface HomeLayout {
|
|
213
|
+
/** Layout schema version, so the client can detect + migrate/reset older stored layouts. */
|
|
214
|
+
version: number;
|
|
215
|
+
/**
|
|
216
|
+
* The user's layouts, in their own order — at least one, never empty.
|
|
217
|
+
*
|
|
218
|
+
* WHICH one is showing is deliberately not stored here: it is remembered per
|
|
219
|
+
* device by the client, so switching to a scanning layout on a phone doesn't
|
|
220
|
+
* change what the same user's desk opens on. `deviceDefaults` is the one
|
|
221
|
+
* stored part of that answer, and it is a landing preference, not a state.
|
|
222
|
+
*/
|
|
223
|
+
layouts: NamedHomeLayout[];
|
|
224
|
+
/** Per-device landing preference. Absent means "no preference" — the client's
|
|
225
|
+
* per-device memory decides, as it did before this existed. */
|
|
226
|
+
deviceDefaults?: HomeLayoutDeviceDefaults;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* The pre-v5 shape: a single, unnamed layout.
|
|
230
|
+
*
|
|
231
|
+
* Read-only. A current client never writes it, but stored documents keep
|
|
232
|
+
* carrying it until each user's next save rewrites them, so anything that READS
|
|
233
|
+
* a persisted layout must still accept it. Delete once no stored document has
|
|
234
|
+
* it.
|
|
235
|
+
*/
|
|
236
|
+
export interface LegacyHomeLayout {
|
|
237
|
+
/** Layout schema version (< 5). */
|
|
238
|
+
version: number;
|
|
239
|
+
/** Flat, ordered widget list. */
|
|
240
|
+
widgets: HomeWidget[];
|
|
241
|
+
}
|
|
242
|
+
/** A layout as it may arrive FROM storage — current shape or legacy. Writes are
|
|
243
|
+
* always `HomeLayout`; the client migrates a legacy one on read. */
|
|
244
|
+
export declare type StoredHomeLayout = HomeLayout | LegacyHomeLayout;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Per-user Home screen layouts — a personal, server-persisted set of named
|
|
4
|
+
* arrangements of Home widgets. Stored directly on the user document (like
|
|
5
|
+
* `homeLocationId`), returned on `GET /users/current`, and written wholesale
|
|
6
|
+
* via `POST /users/current/home-layout`.
|
|
7
|
+
*
|
|
8
|
+
* Since v5 a user has SEVERAL named layouts and switches between them — the
|
|
9
|
+
* same want saved views answer for a list, applied to the Home. They exist
|
|
10
|
+
* because the thing that changes what a Home should show is the TASK (admin
|
|
11
|
+
* this morning, dispatch this afternoon), not the hardware; a layout that
|
|
12
|
+
* differs by device splits when the task doesn't and fails to split when it
|
|
13
|
+
* does. What device legitimately owns is per-widget (`showOn`).
|
|
14
|
+
*
|
|
15
|
+
* Each layout is a flat, ordered list of widgets, every one pinned to a rect on
|
|
16
|
+
* a 4-column grid (`gridPos`). The widget `type` is a closed union (below):
|
|
17
|
+
* adding a new kind is a contract change + republish + client bump. Per-widget
|
|
18
|
+
* `config` carries widget *behaviour* only (a saved-view id, an action id, a
|
|
19
|
+
* heading's text) — never geometry. Since 2026-07-30 the API validates each
|
|
20
|
+
* kind's KNOWN config keys on write (the per-kind `*WidgetConfig` shapes below)
|
|
21
|
+
* while tolerating unknown keys, so the client can still add config keys
|
|
22
|
+
* without an API deploy ordering — only changing a known key's meaning needs
|
|
23
|
+
* one.
|
|
24
|
+
*
|
|
25
|
+
* `version` discriminates stored layouts so the client can detect and
|
|
26
|
+
* reset/migrate an older one on read — including the pre-v5 single-layout
|
|
27
|
+
* shape, which is still readable as `LegacyHomeLayout`.
|
|
28
|
+
*/
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/users/home-layout/shared.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG"}
|
package/dist/users/index.d.ts
CHANGED
package/dist/users/index.js
CHANGED
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./constants"), exports);
|
|
18
18
|
__exportStar(require("./current"), exports);
|
|
19
|
+
__exportStar(require("./home-layout"), exports);
|
|
19
20
|
__exportStar(require("./post"), exports);
|
|
20
21
|
__exportStar(require("./get"), exports);
|
|
21
22
|
__exportStar(require("./[id]"), exports);
|
package/dist/users/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/users/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,4CAAyB;AACzB,yCAAsB;AACtB,wCAAqB;AACrB,yCAAsB;AACtB,4CAAyB;AACzB,mDAAgC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/users/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,4CAAyB;AACzB,gDAA6B;AAC7B,yCAAsB;AACtB,wCAAqB;AACrB,yCAAsB;AACtB,4CAAyB;AACzB,mDAAgC"}
|