@spotto/contract 1.0.70-alpha.7 → 1.0.70-alpha.9

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.
@@ -17,13 +17,17 @@ export declare type CustomFieldsAssetFilterNumberRange = _CustomFieldsAssetFilte
17
17
  from: number;
18
18
  to: number;
19
19
  };
20
- export declare type CustomFieldsAssetFilter = CustomFieldsAssetFilterValue | CustomFieldsAssetFilterDateCondition | CustomFieldsAssetFilterNumberRange;
20
+ export declare type CustomFieldsAssetFilterBoolean = _CustomFieldsAssetFilterBase & {
21
+ value: boolean;
22
+ };
23
+ export declare type CustomFieldsAssetFilter = CustomFieldsAssetFilterValue | CustomFieldsAssetFilterDateCondition | CustomFieldsAssetFilterNumberRange | CustomFieldsAssetFilterBoolean;
21
24
  export declare type CustomFieldValues = {
22
25
  values?: Array<CustomFieldsAssetFilterValue>;
23
26
  integerRanges?: Array<CustomFieldsAssetFilterNumberRange>;
24
27
  decimalRanges?: Array<CustomFieldsAssetFilterNumberRange>;
25
28
  dateConditions?: Array<CustomFieldsAssetFilterDateCondition>;
26
29
  dateTimeConditions?: Array<CustomFieldsAssetFilterDateCondition>;
30
+ booleanValues?: Array<CustomFieldsAssetFilterBoolean>;
27
31
  };
28
32
  export interface AssetFilters {
29
33
  labels?: string[];
@@ -2,6 +2,7 @@ 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 { HomeLayout } from './home-layout';
5
6
  export interface EmbeddedRole extends IEmbeddedEntity {
6
7
  permissions: string[];
7
8
  }
@@ -28,6 +29,12 @@ export interface CurrentUserResponse {
28
29
  * - `undefined` — legacy native user (non-SSO org, or pre-SSO).
29
30
  */
30
31
  authProvider?: 'sso' | 'native';
32
+ /**
33
+ * Personal Home-screen layout (widget arrangement). Persisted on the user doc
34
+ * and written via `POST /users/current/home-layout`. `undefined` until the
35
+ * user customises — the client then renders its built-in default layout.
36
+ */
37
+ homeLayout?: HomeLayout;
31
38
  }
32
39
  export interface CurrentUserPublicResponse {
33
40
  id: string;
@@ -0,0 +1,3 @@
1
+ export * from './shared';
2
+ export * from './request';
3
+ export * from './response';
@@ -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,5 @@
1
+ import { HomeLayout } from './shared';
2
+ /** Body for `POST /users/current/home-layout` — replaces the caller's home layout. */
3
+ export interface UpdateHomeLayoutRequest {
4
+ homeLayout: HomeLayout;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/users/home-layout/request.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import { HomeLayout } from './shared';
2
+ /** Response for `POST /users/current/home-layout` — echoes the saved layout. */
3
+ export interface UpdateHomeLayoutResponse {
4
+ homeLayout: HomeLayout;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/users/home-layout/response.ts"],"names":[],"mappings":""}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Per-user Home screen layout — a personal, server-persisted arrangement of
3
+ * Home widgets. Stored directly on the user document (like `homeLocationId`),
4
+ * returned on `GET /users/current`, and written via
5
+ * `POST /users/current/home-layout`.
6
+ *
7
+ * The widget `type` is a closed union (below): adding a new widget kind is a
8
+ * contract change + republish + client bump. Per-widget `config` is left opaque
9
+ * — its shape is the client's concern, so a widget's behaviour can evolve
10
+ * without a contract change. Sections are modelled now (single + untitled in
11
+ * P1) so titled groups can land later without another contract change.
12
+ */
13
+ /** Width a widget occupies in its section grid. `'full'` spans the row at every breakpoint. */
14
+ export declare type HomeWidgetSpan = 1 | 2 | 'full';
15
+ /**
16
+ * The kinds of Home widget. Closed set — adding one is a contract change.
17
+ * - `tile-link` — a link card (a saved view, a nav destination, or a URL); may show a live count.
18
+ * - `summary-list` — top-N rows of a saved view's results.
19
+ * - `recent-activity` — the account's latest activity feed.
20
+ * - `recent-assets` / `recent-locations` — most-recently-updated entities.
21
+ * - `needs-attention` — assets flagged not-ready / partially-ready.
22
+ * - `kit-spotlight` — kit readiness summary.
23
+ */
24
+ export declare type HomeWidgetType = 'tile-link' | 'summary-list' | 'recent-activity' | 'recent-assets' | 'recent-locations' | 'needs-attention' | 'kit-spotlight';
25
+ export interface HomeWidget {
26
+ /** Stable client-generated id (ulid) — the reorder / remove key. */
27
+ id: string;
28
+ /** Widget kind (closed union). The client registry maps it to a renderer + config shape. */
29
+ type: HomeWidgetType;
30
+ /** Width preset; falls back to the widget's registry default when omitted. */
31
+ span?: HomeWidgetSpan;
32
+ /** Widget-specific configuration (e.g. a saved-view id, a title, a row limit). Opaque to the API. */
33
+ config?: Record<string, unknown>;
34
+ }
35
+ export interface HomeLayoutSection {
36
+ /** Stable client-generated id (ulid). */
37
+ id: string;
38
+ /** Optional section heading. Sections are single + untitled in P1; titled groups arrive in P2. */
39
+ title?: string;
40
+ widgets: HomeWidget[];
41
+ }
42
+ export interface HomeLayout {
43
+ /** Layout schema version, for forward-migrating stored layouts. */
44
+ version: number;
45
+ sections: HomeLayoutSection[];
46
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ /**
3
+ * Per-user Home screen layout — a personal, server-persisted arrangement of
4
+ * Home widgets. Stored directly on the user document (like `homeLocationId`),
5
+ * returned on `GET /users/current`, and written via
6
+ * `POST /users/current/home-layout`.
7
+ *
8
+ * The widget `type` is a closed union (below): adding a new widget kind is a
9
+ * contract change + republish + client bump. Per-widget `config` is left opaque
10
+ * — its shape is the client's concern, so a widget's behaviour can evolve
11
+ * without a contract change. Sections are modelled now (single + untitled in
12
+ * P1) so titled groups can land later without another contract change.
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/users/home-layout/shared.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG"}
@@ -1,5 +1,6 @@
1
1
  export * from './constants';
2
2
  export * from './current';
3
+ export * from './home-layout';
3
4
  export * from './post';
4
5
  export * from './get';
5
6
  export * from './[id]';
@@ -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);
@@ -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"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spotto/contract",
3
3
  "license": "ISC",
4
- "version": "1.0.70-alpha.7",
4
+ "version": "1.0.70-alpha.9",
5
5
  "description": "Spotto's API Contract type definitions",
6
6
  "main": "./dist/index.js",
7
7
  "files": [
@@ -18,5 +18,5 @@
18
18
  "@types/geojson": "^7946.0.11",
19
19
  "shx": "^0.3.4"
20
20
  },
21
- "gitHead": "0aea12e3fb0ac4b03042419430b59629caeb272a"
21
+ "gitHead": "68f245bdb4cfc1ed34b7274ddbc324ad1fb2de5e"
22
22
  }