@spotto/contract 1.0.70-alpha.18 → 1.0.70-alpha.19

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.
@@ -1,13 +1,21 @@
1
- import { SemanticQuery, SemanticQueryEntityType, SemanticQueryKind, SemanticOperationPayload } from '../shared';
1
+ import { SemanticQuery, SemanticQueryEntityType, SemanticQueryKind, SemanticQueryVisibility, SemanticQueryDisplay, SemanticOperationPayload } from '../shared';
2
2
  /**
3
3
  * Register a semantic query — the ONLY way a query enters the system. Reads
4
4
  * execute by reference (`semanticQueryId`), never by inline query JSON, so
5
5
  * nothing can run without having been validated here first.
6
6
  *
7
- * Registration is not persistence: a new record is a DRAFT with a sliding
8
- * ~24 h expiry, so the client may register freely on every filter interaction
9
- * without accumulating garbage. Saving is a separate, later act (PATCH sets a
10
- * name — the same record is promoted in place and its id never changes).
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.
11
19
  */
12
20
  export interface PostSemanticQueryRequest {
13
21
  entityType: SemanticQueryEntityType;
@@ -16,6 +24,18 @@ export interface PostSemanticQueryRequest {
16
24
  kind?: SemanticQueryKind;
17
25
  /** Required when kind is `operation`; forbidden otherwise. */
18
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;
19
39
  /** Human-readable restatement of the query, shown in the UI. */
20
40
  description?: string;
21
41
  /** The natural-language prompt this query was generated from, as provenance. */
@@ -344,13 +344,30 @@ export interface SemanticOperationPayload {
344
344
  /** Human-readable restatement, shown on the confirmation card. */
345
345
  description: string;
346
346
  }
347
+ /** Which rendering of the asset list a saved query opens in. */
348
+ export declare const semanticQueryViewTypes: readonly ["table", "map", "tree"];
349
+ export declare type SemanticQueryViewType = (typeof semanticQueryViewTypes)[number];
347
350
  /**
348
- * How a saved query's list displays — columns and sort. Populated on
349
- * promotion (save); absent on drafts.
351
+ * Everything a saved list REMEMBERS that is not the query itself — columns,
352
+ * sort, and which rendering it opens in. Populated on save; absent on drafts.
353
+ *
354
+ * This is the home for every property the superseded saved VIEW carried
355
+ * outside its `filters` (contract views/shared.ts): each of `columnVisibility`,
356
+ * `columnOrder`, `sort` and `sortOrder` is here under its own name, so a view
357
+ * converts without losing anything it displayed.
358
+ *
359
+ * Free-text search is deliberately absent, from here and from the conditions
360
+ * alike (ruling, 2026-08-05). It is not a filter over a property and the closed
361
+ * vocabulary has no term for it; it is a live narrowing of whatever is already
362
+ * on screen, and it belongs to the session rather than to the saved query. The
363
+ * legacy view persisted it on `filters.search` — the one member of that object
364
+ * that was never really a filter — and that is the behaviour being dropped.
350
365
  */
351
366
  export interface SemanticQueryDisplay {
352
367
  columnVisibility?: Record<string, boolean>;
353
368
  columnOrder?: string[];
354
369
  sort?: AssetSortField;
355
370
  sortOrder?: SortOrders;
371
+ /** Absent means the client's default rendering. */
372
+ viewType?: SemanticQueryViewType;
356
373
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SEMANTIC_QUERY_VERSION = exports.SEMANTIC_QUERY_LIMITS = exports.semanticConditionTypes = exports.semanticReadinessLevels = exports.semanticTelemetryFields = exports.semanticSetOperators = exports.semanticComparisonOperators = exports.semanticTimestampOperators = exports.semanticFieldOperators = exports.semanticRelativeDatePositions = exports.semanticRelativeDateBases = exports.semanticQueryVisibilities = exports.semanticQueryKinds = exports.semanticQueryEntityTypes = void 0;
3
+ exports.semanticQueryViewTypes = exports.SEMANTIC_QUERY_VERSION = exports.SEMANTIC_QUERY_LIMITS = exports.semanticConditionTypes = exports.semanticReadinessLevels = exports.semanticTelemetryFields = exports.semanticSetOperators = exports.semanticComparisonOperators = exports.semanticTimestampOperators = exports.semanticFieldOperators = exports.semanticRelativeDatePositions = exports.semanticRelativeDateBases = exports.semanticQueryVisibilities = exports.semanticQueryKinds = exports.semanticQueryEntityTypes = void 0;
4
4
  /**
5
5
  * SEMANTIC QUERIES — the portable query language.
6
6
  *
@@ -130,4 +130,7 @@ exports.SEMANTIC_QUERY_LIMITS = {
130
130
  // --- The envelope ---------------------------------------------------------
131
131
  /** Current wire version of the condition vocabulary. */
132
132
  exports.SEMANTIC_QUERY_VERSION = 2;
133
+ // --- Stored-record display config -----------------------------------------
134
+ /** Which rendering of the asset list a saved query opens in. */
135
+ exports.semanticQueryViewTypes = ['table', 'map', 'tree'];
133
136
  //# sourceMappingURL=shared.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/semantic-queries/shared.ts"],"names":[],"mappings":";;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,6EAA6E;AAE7E;;;GAGG;AACU,QAAA,wBAAwB,GAAG;IACtC,OAAO;IACP,UAAU;IACV,OAAO;IACP,QAAQ;IACR,UAAU;IACV,UAAU;CACF,CAAA;AAGV;;;;;;GAMG;AACU,QAAA,kBAAkB,GAAG,CAAC,OAAO,EAAE,WAAW,CAAU,CAAA;AAGpD,QAAA,yBAAyB,GAAG,CAAC,SAAS,EAAE,cAAc,CAAU,CAAA;AAG7E,6EAA6E;AAEhE,QAAA,yBAAyB,GA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,aAAa;IACb,aAAa;IACb,UAAU;IACV,WAAW;IACX,aAAa;IACb,MAAM;IACN,WAAW;IACX,WAAW;IACX,KAAK;IACL,gBAAgB;CACR,CAAA;AAGV;;;;;;GAMG;AACU,QAAA,qBAAqB,GAAG;IACnC,aAAa,EAAE,EAAE;IACjB,QAAQ,EAAE,CAAC;CACH,CAAA;AAiBV,6EAA6E;AAE7E,wDAAwD;AAC3C,QAAA,sBAAsB,GAAG,CAAC,CAAA;AAyDvC,6EAA6E;AAE7E,gEAAgE;AACnD,QAAA,sBAAsB,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAU,CAAA"}
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.18",
4
+ "version": "1.0.70-alpha.19",
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": "efd838e345380e064fc8963773d2a72e4fc0f293"
21
+ "gitHead": "cfb9f549eb52adffc8f1b95e8bd2b3cc4d3bcf44"
22
22
  }