@spotto/contract 1.0.70-alpha.33 → 1.0.70-alpha.35

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.
@@ -36,6 +36,10 @@ export interface AssetFilters {
36
36
  hasTags?: boolean;
37
37
  hasReported?: boolean;
38
38
  hasGeolocationState?: boolean;
39
+ /** At a named location (true) or not at any (false) — tested on the stored location path. */
40
+ hasLocation?: boolean;
41
+ /** Seen (a status other than never-seen) and not at any named location — the location view's "Seen, without a location" row. */
42
+ seenWithoutLocation?: boolean;
39
43
  locationStatus?: Array<LocationStatus>;
40
44
  visiting?: boolean;
41
45
  battery?: AssetBatteryStatus;
@@ -4,10 +4,18 @@ export declare type AssetCrudEventType = 'AssetCreated' | 'AssetUpdated' | 'Asse
4
4
  export declare type LocationCrudEventType = 'LocationCreated' | 'LocationUpdated' | 'LocationDeleted';
5
5
  export declare type ReaderCrudEventType = 'ReaderCreated' | 'ReaderUpdated' | 'ReaderDeleted';
6
6
  export declare type SnapshotCrudEventType = 'SnapshotCreated' | 'SnapshotDeleted';
7
+ /**
8
+ * Asset-type CRUD events (option rules §8, R2). Stored only — never published
9
+ * to Slate. A `TypeUpdated` is also written for every OTHER type whose
10
+ * authored option list a propagation rewrote (`payload.propagation`).
11
+ */
12
+ export declare type TypeCrudEventType = 'TypeCreated' | 'TypeUpdated' | 'TypeDeleted';
7
13
  export declare type FormEventType = 'FormSubmitted' | 'FormSubmissionVoided';
8
14
  export declare type SlateEventType = 'ReaderArrived' | 'ReaderExited' | 'Arrived' | 'Moved' | 'Exited' | 'ReaderOnline' | 'ReaderOffline' | 'AssetDispatch';
9
- export declare type EventType = SlateEventType | AssetCrudEventType | LocationCrudEventType | ReaderCrudEventType | SnapshotCrudEventType | FormEventType | 'UserSearch' | 'WorkflowActionExecuted';
15
+ export declare type EventType = SlateEventType | AssetCrudEventType | LocationCrudEventType | ReaderCrudEventType | SnapshotCrudEventType | TypeCrudEventType | FormEventType | 'UserSearch' | 'WorkflowActionExecuted';
10
16
  export declare const EVENT_TYPES: EventType[];
17
+ /** The asset-type CRUD events as a value, for the surfaces that list them. */
18
+ export declare const TYPE_CRUD_EVENT_TYPES: TypeCrudEventType[];
11
19
  /**
12
20
  * The asset CRUD events as a VALUE — the only events whose `thing` is a full
13
21
  * asset document (`IAssetCrudSchema`) rather than a bare reference.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ASSET_CRUD_EVENT_TYPES = exports.EVENT_TYPES = exports.EVENT_COUNT_BREAKDOWN = void 0;
3
+ exports.ASSET_CRUD_EVENT_TYPES = exports.TYPE_CRUD_EVENT_TYPES = exports.EVENT_TYPES = exports.EVENT_COUNT_BREAKDOWN = void 0;
4
4
  exports.EVENT_COUNT_BREAKDOWN = [
5
5
  'year',
6
6
  'week',
@@ -28,11 +28,20 @@ exports.EVENT_TYPES = [
28
28
  'ReaderDeleted',
29
29
  'SnapshotCreated',
30
30
  'SnapshotDeleted',
31
+ 'TypeCreated',
32
+ 'TypeUpdated',
33
+ 'TypeDeleted',
31
34
  'FormSubmitted',
32
35
  'FormSubmissionVoided',
33
36
  'UserSearch',
34
37
  'WorkflowActionExecuted',
35
38
  ];
39
+ /** The asset-type CRUD events as a value, for the surfaces that list them. */
40
+ exports.TYPE_CRUD_EVENT_TYPES = [
41
+ 'TypeCreated',
42
+ 'TypeUpdated',
43
+ 'TypeDeleted',
44
+ ];
36
45
  /**
37
46
  * The asset CRUD events as a VALUE — the only events whose `thing` is a full
38
47
  * asset document (`IAssetCrudSchema`) rather than a bare reference.
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/events/constants.ts"],"names":[],"mappings":";;;AACa,QAAA,qBAAqB,GAA0B;IAC1D,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;IACL,MAAM;CACP,CAAA;AAyCY,QAAA,WAAW,GAAgB;IACtC,eAAe;IACf,cAAc;IACd,SAAS;IACT,OAAO;IACP,QAAQ;IACR,cAAc;IACd,eAAe;IACf,eAAe;IACf,cAAc;IACd,cAAc;IACd,cAAc;IACd,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,eAAe;IACf,eAAe;IACf,eAAe;IACf,iBAAiB;IACjB,iBAAiB;IACjB,eAAe;IACf,sBAAsB;IACtB,YAAY;IACZ,wBAAwB;CACzB,CAAA;AAED;;;;;;;;;;;;GAYG;AACU,QAAA,sBAAsB,GAAyB;IAC1D,cAAc;IACd,cAAc;IACd,cAAc;CACf,CAAA"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/events/constants.ts"],"names":[],"mappings":";;;AACa,QAAA,qBAAqB,GAA0B;IAC1D,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;IACL,MAAM;CACP,CAAA;AAiDY,QAAA,WAAW,GAAgB;IACtC,eAAe;IACf,cAAc;IACd,SAAS;IACT,OAAO;IACP,QAAQ;IACR,cAAc;IACd,eAAe;IACf,eAAe;IACf,cAAc;IACd,cAAc;IACd,cAAc;IACd,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,eAAe;IACf,eAAe;IACf,eAAe;IACf,iBAAiB;IACjB,iBAAiB;IACjB,aAAa;IACb,aAAa;IACb,aAAa;IACb,eAAe;IACf,sBAAsB;IACtB,YAAY;IACZ,wBAAwB;CACzB,CAAA;AAED,8EAA8E;AACjE,QAAA,qBAAqB,GAAwB;IACxD,aAAa;IACb,aAAa;IACb,aAAa;CACd,CAAA;AAED;;;;;;;;;;;;GAYG;AACU,QAAA,sBAAsB,GAAyB;IAC1D,cAAc;IACd,cAAc;IACd,cAAc;CACf,CAAA"}
@@ -1,11 +1,12 @@
1
1
  import { IEmbeddedEntity } from '../../shared';
2
- import { AssetCrudEventType, EventType, LocationCrudEventType, ReaderCrudEventType, SnapshotCrudEventType } from '../constants';
2
+ import { AssetCrudEventType, EventType, LocationCrudEventType, ReaderCrudEventType, SnapshotCrudEventType, TypeCrudEventType } from '../constants';
3
3
  import { GetEventsQuery } from './query';
4
4
  import { DeviceType, ReaderType } from '../../readers/constants';
5
5
  import { LocationType } from '../../locations/constants';
6
6
  import { GetSnapshotResponse } from '../../snapshots';
7
7
  import { ExecutedWorkflow } from '../../workflows';
8
8
  import { GetAssetResponse } from '../../assets';
9
+ import { GetTypeResponse } from '../../types/[id]/get';
9
10
  import { ISubmissionAssetEmbed, ISubmissionPayload, ISubmissionVoidPayload } from '../../submissions';
10
11
  export interface EventLocation {
11
12
  id?: string;
@@ -76,6 +77,40 @@ export interface ISnapshotCrudEvent extends IBaseEvent {
76
77
  user: IEmbeddedEntity;
77
78
  payload: ISnapshotEventPayload;
78
79
  }
80
+ /** The asset type an event is about (`type` being the event's own kind). */
81
+ export interface IEventAssetType extends IEmbeddedEntity {
82
+ /** Pipe-delimited path of the type at the time. */
83
+ path?: string;
84
+ /** Display name of the type at the time. */
85
+ fullName?: string;
86
+ }
87
+ /**
88
+ * One option-list rewrite made BY propagation (option rules §4.2, §4.4): a
89
+ * value added at `origin` reached this type's authored list on the way up or
90
+ * down the tree, or a value removed at `origin` was pulled from it.
91
+ */
92
+ export interface ITypeEventPropagation {
93
+ field: IEmbeddedEntity;
94
+ added: string[];
95
+ removed: string[];
96
+ origin: IEmbeddedEntity;
97
+ }
98
+ export interface ITypeEventPayload {
99
+ /** Top-level keys the request set on the type; empty on a propagated write. */
100
+ changed: string[];
101
+ /** Present only on a write made by propagation from another type's edit. */
102
+ propagation?: ITypeEventPropagation;
103
+ /** Values the edit appended to a field's master list (R1), on the origin's event. */
104
+ masterAdded?: string[];
105
+ }
106
+ export interface ITypeCrudEvent extends IBaseEvent {
107
+ type: TypeCrudEventType;
108
+ assetType: IEventAssetType;
109
+ user: IEmbeddedEntity;
110
+ payload: ITypeEventPayload;
111
+ /** `TypeUpdated` — the type's authored keys before the write (no resolved `*All` caches). */
112
+ previousTypeState?: GetTypeResponse;
113
+ }
79
114
  export interface IUserSearchEvent extends IBaseEvent {
80
115
  type: 'UserSearch';
81
116
  entity: string;
@@ -153,7 +188,7 @@ export interface IAssetDispatchEvent extends IBaseEvent {
153
188
  location?: AssetEventLocation;
154
189
  dispatchExpires: number;
155
190
  }
156
- export declare type GetEventResponse = IAssetCrudEvent | ILocationCrudEvent | IReaderCrudEvent | ISnapshotCrudEvent | IUserSearchEvent | IReaderArrivedEvent | IReaderExitedEvent | IArrivedEvent | IMovedEvent | IExitedEvent | IReaderOnlineEvent | IReaderOfflineEvent | IAssetDispatchEvent | IWorkflowActionExecutedEvent | IFormSubmittedEvent | IFormSubmissionVoidedEvent;
191
+ export declare type GetEventResponse = IAssetCrudEvent | ILocationCrudEvent | IReaderCrudEvent | ISnapshotCrudEvent | ITypeCrudEvent | IUserSearchEvent | IReaderArrivedEvent | IReaderExitedEvent | IArrivedEvent | IMovedEvent | IExitedEvent | IReaderOnlineEvent | IReaderOfflineEvent | IAssetDispatchEvent | IWorkflowActionExecutedEvent | IFormSubmittedEvent | IFormSubmissionVoidedEvent;
157
192
  export interface GetEventsResponse {
158
193
  query: GetEventsQuery | null;
159
194
  items: GetEventResponse[];
@@ -11,6 +11,12 @@ export interface GetFieldResponse {
11
11
  rememberLast?: boolean;
12
12
  regex?: string;
13
13
  options?: string[];
14
+ /**
15
+ * Options no longer offered for new values. Every value is in `options`;
16
+ * subtracted from every type's projection at read, never from stored
17
+ * values. Absent = none.
18
+ */
19
+ discontinued?: string[];
14
20
  integerMin?: number;
15
21
  integerMax?: number;
16
22
  decimalMin?: number;
@@ -2,6 +2,11 @@ import { FieldInputType } from '../../constants';
2
2
  import { PermissionGrant } from '../../../usergroups/shared';
3
3
  export interface UpdateFieldRequestOption {
4
4
  value: string;
5
+ /**
6
+ * The option's current name, to rename it to `value` (surrounding
7
+ * whitespace is ignored, as on `value`); one that names no current option
8
+ * makes `value` a plain new option.
9
+ */
5
10
  previousValue?: string;
6
11
  }
7
12
  export interface UpdateFieldRequest {
@@ -12,6 +17,14 @@ export interface UpdateFieldRequest {
12
17
  rememberLast?: boolean | null;
13
18
  regex?: string | null;
14
19
  options?: UpdateFieldRequestOption[];
20
+ /**
21
+ * Options no longer offered for new values — replaced wholesale; `[]`
22
+ * clears it; omit to leave it untouched. Each value must be an option as
23
+ * they stand after this request; an entry naming a value as it stood
24
+ * before follows the request's rename of it, and is left out by its
25
+ * removal or merge — so a stored list may be sent back unchanged.
26
+ */
27
+ discontinued?: string[];
15
28
  integerMin?: number | null;
16
29
  integerMax?: number | null;
17
30
  decimalMin?: number | null;
@@ -23,10 +23,50 @@ export declare const AGGREGATE_FUNCTIONS: AggregateFunction[];
23
23
  * - `visibleWhen` — conditional visibility (client-render only).
24
24
  * - `function` — AGGREGATED (M2 — kits): the same field is reduced across
25
25
  * a kit's direct members.
26
+ * - `label` / `required` / `rememberLast` — per-type presentation overrides
27
+ * of the global field's values; nearest authored type wins, an omitted key
28
+ * inherits (option rules §2.2).
29
+ * - `options` — a whitelist of the field's options for this type and its
30
+ * descendants, in the order to offer them (option rules §2.2, §4.2). The
31
+ * nearest authored list wins; an omitted key inherits the parent's. Kept
32
+ * inside the parent's list by PROPAGATION: a value added here is appended
33
+ * to every ancestor's authored list that lacks it (and to the field's
34
+ * master, under `fields:update`), a value removed here is pulled from every
35
+ * descendant's authored list. Never authored empty; may become `[]` through
36
+ * a removal above.
37
+ * - `detach` — unbind an INHERITED field from this type down (LOG-2292);
38
+ * a detach row carries no other configuration. Stored values are kept.
26
39
  */
27
40
  export interface IFieldBindingDelta {
28
41
  source?: FieldSource;
29
42
  expression?: string;
30
43
  visibleWhen?: string;
31
44
  function?: AggregateFunction;
45
+ label?: string;
46
+ required?: boolean;
47
+ rememberLast?: boolean;
48
+ options?: string[];
49
+ optionRules?: OptionRule[];
50
+ detach?: boolean;
32
51
  }
52
+ /**
53
+ * A conditional option rule (option rules §2.2, §3.5): while `expression`
54
+ * holds over the record's values, the offered list is narrowed to `options`
55
+ * (intersected, order kept). Authored on a type's field rows — where it
56
+ * applies to records of exactly that type, never inherited (U2) — and on
57
+ * form items. `options` may name only values on the authoring type's list
58
+ * (U3; a form item's, the field's master). `expression` is required: an
59
+ * unconditional narrowing is a type's `options` or the field's
60
+ * `discontinued`.
61
+ */
62
+ export interface OptionRule {
63
+ expression: string;
64
+ options: string[];
65
+ }
66
+ /**
67
+ * The delta keys a type-level field row (`typeFields[]`) may carry: the
68
+ * presentation overrides, the option whitelist, the option rules and
69
+ * `detach`, never a value source (a type field's value lives on the type,
70
+ * not on an asset) and never `rememberLast`.
71
+ */
72
+ export declare type ITypeFieldBindingDelta = Pick<IFieldBindingDelta, 'label' | 'required' | 'options' | 'optionRules' | 'detach'>;
@@ -12,6 +12,8 @@ export interface PostFieldRequest {
12
12
  rememberLast?: boolean;
13
13
  regex?: string;
14
14
  options?: string[];
15
+ /** Options no longer offered for new values — each must be in `options`. */
16
+ discontinued?: string[];
15
17
  integerMin?: number;
16
18
  integerMax?: number;
17
19
  decimalMin?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/fields/post/request.ts"],"names":[],"mappings":";;;AA2BA,QAAQ;AACK,QAAA,oBAAoB,GAAqB;IACpD,IAAI,EAAE,eAAe;IACrB,QAAQ,EAAE,QAAQ;CACnB,CAAA"}
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/fields/post/request.ts"],"names":[],"mappings":";;;AA6BA,QAAQ;AACK,QAAA,oBAAoB,GAAqB;IACpD,IAAI,EAAE,eAAe;IACrB,QAAQ,EAAE,QAAQ;CACnB,CAAA"}
@@ -1,4 +1,5 @@
1
1
  import { ReservedContextFieldName } from './constants';
2
+ import { OptionRule } from '../fields/constants';
2
3
  /**
3
4
  * How a form field item's value is produced. `INPUT` (default) is entered by
4
5
  * the user, `COMPUTED` derives from an expression over the merged env, and
@@ -49,6 +50,14 @@ export interface FormFieldItem {
49
50
  /** The activity gate: a failing item is not shown, not required, and not
50
51
  * written back. */
51
52
  visibleWhen?: string;
53
+ /**
54
+ * Conditional narrowing of a choice item's offered options (option rules
55
+ * §2.4, §6): while a rule's expression holds over the form's values, the
56
+ * list is narrowed to its `options`. References resolve against the
57
+ * form's own field items; `options` ⊆ the bound field's master. Client
58
+ * side only — the write-back applies whatever was captured.
59
+ */
60
+ optionRules?: OptionRule[];
52
61
  /** Per-form display overrides; identity still comes from the definition. */
53
62
  label?: string;
54
63
  help?: string;
@@ -2,3 +2,12 @@ export declare type LocationType = 'MOVING' | 'FIXED';
2
2
  export declare const LOCATION_TYPES: LocationType[];
3
3
  export declare type LocationStatus = 'NEVERSEEN' | 'UNKNOWN' | 'HOME' | 'AWAY' | 'ROAMING' | 'MAP' | 'DISPATCH' | 'WITH';
4
4
  export declare const LOCATION_STATUS: LocationStatus[];
5
+ /**
6
+ * Every status that means the location system has placed the asset at least
7
+ * once: the enum minus NEVERSEEN. "Seen" is read off the status, never off
8
+ * the state object — a state can exist without the asset ever having been
9
+ * located (a kit gains `supportsWith` when its first member attaches). One
10
+ * definition, shared by the flat filter, the query language and the client,
11
+ * so a status added to the enum is seen everywhere at once.
12
+ */
13
+ export declare const SEEN_LOCATION_STATUSES: LocationStatus[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LOCATION_STATUS = exports.LOCATION_TYPES = void 0;
3
+ exports.SEEN_LOCATION_STATUSES = exports.LOCATION_STATUS = exports.LOCATION_TYPES = void 0;
4
4
  exports.LOCATION_TYPES = ['MOVING', 'FIXED'];
5
5
  exports.LOCATION_STATUS = [
6
6
  'NEVERSEEN',
@@ -12,4 +12,13 @@ exports.LOCATION_STATUS = [
12
12
  'DISPATCH',
13
13
  'WITH',
14
14
  ];
15
+ /**
16
+ * Every status that means the location system has placed the asset at least
17
+ * once: the enum minus NEVERSEEN. "Seen" is read off the status, never off
18
+ * the state object — a state can exist without the asset ever having been
19
+ * located (a kit gains `supportsWith` when its first member attaches). One
20
+ * definition, shared by the flat filter, the query language and the client,
21
+ * so a status added to the enum is seen everywhere at once.
22
+ */
23
+ exports.SEEN_LOCATION_STATUSES = exports.LOCATION_STATUS.filter((status) => status !== 'NEVERSEEN');
15
24
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/locations/constants.ts"],"names":[],"mappings":";;;AACa,QAAA,cAAc,GAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;AAWpD,QAAA,eAAe,GAAqB;IAC/C,WAAW;IACX,SAAS;IACT,MAAM;IACN,MAAM;IACN,SAAS;IACT,KAAK;IACL,UAAU;IACV,MAAM;CACP,CAAA"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/locations/constants.ts"],"names":[],"mappings":";;;AACa,QAAA,cAAc,GAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;AAWpD,QAAA,eAAe,GAAqB;IAC/C,WAAW;IACX,SAAS;IACT,MAAM;IACN,MAAM;IACN,SAAS;IACT,KAAK;IACL,UAAU;IACV,MAAM;CACP,CAAA;AAED;;;;;;;GAOG;AACU,QAAA,sBAAsB,GAAqB,uBAAe,CAAC,MAAM,CAC5E,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,KAAK,WAAW,CACnC,CAAA"}
@@ -120,12 +120,22 @@ export interface SemanticAssetTypeCondition {
120
120
  * Matches a location subtree by pipe-delimited path. `location` is where the
121
121
  * asset currently IS; `homeLocation` is where it BELONGS — a fixed, often
122
122
  * high-level node. Conflating them fails silently, so they are distinct types.
123
+ *
124
+ * Exactly one of `path` and `hasAny` (the validator enforces it), the same
125
+ * shape as `withAsset`: a specific location, or any / none. `hasAny` is for
126
+ * `location` only — every asset has a home location — and is the word the
127
+ * Assets-by-location view's "Map" row drills on: not at any named location,
128
+ * combined with the seen statuses (`locationStatus`). It reads the stored
129
+ * location PATH, the field that view groups on and that its index holds; the
130
+ * path and the location id have always come together.
123
131
  */
124
132
  export interface SemanticAssetLocationCondition {
125
133
  type: 'location' | 'homeLocation';
126
- path: string;
134
+ path?: string;
127
135
  /** Default true. */
128
136
  includeSublocations?: boolean;
137
+ /** At any named location at all (or at none, when false). `location` only. */
138
+ hasAny?: boolean;
129
139
  }
130
140
  /**
131
141
  * Assets currently travelling with another asset — the defibrillator in the
@@ -283,7 +293,7 @@ export declare const semanticGroupConditionTypes: readonly ["and", "or"];
283
293
  * `readiness`, `kit`, `withAsset`, `telemetry`, `locationStatus` mean nothing
284
294
  * for a reader or a snapshot.
285
295
  */
286
- export declare const semanticAssetConditionTypes: readonly ["and", "or", "assetType", "location", "homeLocation", "withAsset", "customField", "createdDate", "lastUpdated", "lastChanged", "lastSeen", "firstSeen", "geolocation", "tags", "telemetry", "readiness", "kit", "locationStatus"];
296
+ export declare const semanticAssetConditionTypes: readonly ["and", "or", "assetType", "location", "homeLocation", "withAsset", "customField", "createdDate", "lastUpdated", "lastChanged", "lastSeen", "firstSeen", "geolocation", "tags", "telemetry", "readiness", "kit", "locationStatus", "seenWithoutLocation"];
287
297
  /**
288
298
  * A location subtree, by pipe-delimited path.
289
299
  *
@@ -713,7 +723,7 @@ export declare const semanticConditionTypesByEntity: Record<SemanticQueryEntityT
713
723
  * validator, which knows the entity and can say "'readiness' is an asset
714
724
  * condition" instead of "not allowed".
715
725
  */
716
- export declare const semanticConditionTypes: readonly ("telemetry" | "readiness" | "path" | "asset" | "location" | "reader" | "manifest" | "and" | "or" | "assetType" | "homeLocation" | "withAsset" | "customField" | "createdDate" | "lastUpdated" | "lastChanged" | "lastSeen" | "firstSeen" | "geolocation" | "tags" | "kit" | "locationStatus" | "locationType" | "hasReaders" | "geofence" | "occurred" | "eventType" | "user" | "action" | "snapshotType" | "deviceType" | "readerType" | "attachedAsset" | "online" | "hasReported" | "hasGeolocation")[];
726
+ export declare const semanticConditionTypes: readonly ("telemetry" | "readiness" | "path" | "asset" | "location" | "reader" | "manifest" | "and" | "or" | "assetType" | "homeLocation" | "withAsset" | "customField" | "createdDate" | "lastUpdated" | "lastChanged" | "lastSeen" | "firstSeen" | "geolocation" | "tags" | "kit" | "locationStatus" | "seenWithoutLocation" | "locationType" | "hasReaders" | "geofence" | "occurred" | "eventType" | "user" | "action" | "snapshotType" | "deviceType" | "readerType" | "attachedAsset" | "online" | "hasReported" | "hasGeolocation")[];
717
727
  export declare type SemanticConditionType = (typeof semanticConditionTypes)[number];
718
728
  /**
719
729
  * Query size bounds, shared by the boundary schema (which refuses an oversized
@@ -732,7 +742,20 @@ export declare const SEMANTIC_QUERY_LIMITS: {
732
742
  * handled is a COMPILE error rather than a runtime fall-through. The prototype
733
743
  * kept its vocabularies as `string[]` allowlists and lost exactly that.
734
744
  */
735
- export declare type SemanticAssetCondition = SemanticAndCondition | SemanticOrCondition | SemanticAssetTypeCondition | SemanticAssetLocationCondition | SemanticWithAssetCondition | SemanticCustomFieldCondition | SemanticTimestampCondition | SemanticGeolocationCondition | SemanticTagsCondition | SemanticTelemetryCondition | SemanticReadinessCondition | SemanticKitCondition | SemanticLocationStatusCondition;
745
+ /**
746
+ * Seen — a status other than never-seen — and not at any named location: the
747
+ * Assets-by-location view's "Seen, without a location" row (legacy admin's
748
+ * "Map"). One word rather than `location.hasAny: false` plus a status list, so
749
+ * the server owns the definition (`SEEN_LOCATION_STATUSES`, the enum minus
750
+ * NEVERSEEN) and a status added tomorrow is seen everywhere at once — callers,
751
+ * saved views and the AI carry the name, not the list. `false` is the
752
+ * complement: never seen, or at a named location.
753
+ */
754
+ export interface SemanticSeenWithoutLocationCondition {
755
+ type: 'seenWithoutLocation';
756
+ value: boolean;
757
+ }
758
+ export declare type SemanticAssetCondition = SemanticAndCondition | SemanticOrCondition | SemanticAssetTypeCondition | SemanticAssetLocationCondition | SemanticWithAssetCondition | SemanticCustomFieldCondition | SemanticTimestampCondition | SemanticGeolocationCondition | SemanticTagsCondition | SemanticTelemetryCondition | SemanticReadinessCondition | SemanticKitCondition | SemanticLocationStatusCondition | SemanticSeenWithoutLocationCondition;
736
759
  /**
737
760
  * Any condition, whatever the entity. Widens as entities are added; the
738
761
  * envelope and everything generic over it stay unchanged when they are.
@@ -116,6 +116,7 @@ exports.semanticAssetConditionTypes = [
116
116
  'readiness',
117
117
  'kit',
118
118
  'locationStatus',
119
+ 'seenWithoutLocation',
119
120
  ];
120
121
  /**
121
122
  * The LOCATION vocabulary.
@@ -1 +1 @@
1
- {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/semantic-queries/shared.ts"],"names":[],"mappings":";;;AASA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,6EAA6E;AAE7E;;;;GAIG;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,GAAG;IACvC,KAAK;IACL,MAAM;IACN,OAAO;IACP,SAAS;IACT,MAAM;CACE,CAAA;AAGG,QAAA,6BAA6B,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAU,CAAA;AAwC9E,6EAA6E;AAEhE,QAAA,sBAAsB,GAAG;IACpC,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,KAAK;IACL,UAAU;IACV,QAAQ;IACR,WAAW;CACH,CAAA;AAGG,QAAA,0BAA0B,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAU,CAAA;AAIhE,QAAA,2BAA2B,GAAG;IACzC,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,KAAK;CACG,CAAA;AAIG,QAAA,oBAAoB,GAAG,CAAC,KAAK,EAAE,KAAK,CAAU,CAAA;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;GAMG;AACU,QAAA,qBAAqB,GAAG;IACnC,aAAa,EAAE,EAAE;IACjB,QAAQ,EAAE,CAAC;CACH,CAAA;AAiDV,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;AAyCvE;;;;;;;;;GASG;AACH,MAAM,6BAA6B,GAAyC;IAC1E,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,IAAI;IACb,SAAS,EAAE,IAAI;IACf,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,IAAI;IACX,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,IAAI;CAChB,CAAA;AACY,QAAA,uBAAuB,GAAG,MAAM,CAAC,IAAI,CAChD,6BAA6B,CACF,CAAA"}
@@ -1,6 +1,15 @@
1
1
  import { GetFieldResponse } from '../../fields/[id]/get';
2
- import { IFieldBindingDelta } from '../../fields';
2
+ import { IFieldBindingDelta, ITypeFieldBindingDelta, OptionRule } from '../../fields';
3
3
  import { IActionAttachment, IActionAttachmentAll, IEmbeddedEntity, IReadinessRule, IReadinessRuleAll } from '../../shared';
4
+ /**
5
+ * An authored field binding as read back (option rules §2.2, D11): the
6
+ * `{id, name}` stub plus exactly the delta keys the row carries — a bare
7
+ * binding reads back as the stub it always was. Resolved state stays in
8
+ * `fieldsAll`.
9
+ */
10
+ export declare type IFieldBindingRow = IEmbeddedEntity & IFieldBindingDelta;
11
+ /** An authored type-field row as read back — `{id, name}` plus its delta. */
12
+ export declare type ITypeFieldBindingRow = IEmbeddedEntity & ITypeFieldBindingDelta;
4
13
  export interface IFieldValue {
5
14
  id: string;
6
15
  name: string;
@@ -15,12 +24,18 @@ export interface IFieldValue {
15
24
  }
16
25
  /**
17
26
  * A resolved field on a type (own + inherited), carrying its authoring
18
- * `typePath` and any binding delta (`source`/`expression`/`visibleWhen`). The
19
- * server-computed metadata (`referencedFields`/`timeSensitive`) is internal and
20
- * not surfaced here.
27
+ * `typePath` and any binding delta (`source`/`expression`/`visibleWhen`,
28
+ * `label`/`required`/`rememberLast`). `options` is the type's PROJECTION —
29
+ * the master minus the field's `discontinued` values (option rules §2.3);
30
+ * `discontinued` itself is read from the field, never from the entry, and a
31
+ * detached field simply has no entry. `optionRules` are THIS type's own only
32
+ * (option rules U2): absent on every descendant's entry unless it authors its
33
+ * own. The server-computed metadata (`referencedFields`/`timeSensitive`) is
34
+ * internal and not surfaced here.
21
35
  */
22
- export interface IFieldDefinitionAll extends GetFieldResponse, IFieldBindingDelta {
36
+ export interface IFieldDefinitionAll extends Omit<GetFieldResponse, 'discontinued'>, Omit<IFieldBindingDelta, 'detach'> {
23
37
  typePath: string;
38
+ optionRules?: OptionRule[];
24
39
  }
25
40
  export interface IFieldValueAll extends IFieldValue {
26
41
  typePath: string;
@@ -33,9 +48,9 @@ export interface GetTypeResponse {
33
48
  fullNameTemplate?: string;
34
49
  description?: string;
35
50
  path?: string;
36
- fields?: IEmbeddedEntity[];
51
+ fields?: IFieldBindingRow[];
37
52
  fieldsAll?: IFieldDefinitionAll[];
38
- typeFields?: IEmbeddedEntity[];
53
+ typeFields?: ITypeFieldBindingRow[];
39
54
  typeFieldsAll?: IFieldDefinitionAll[];
40
55
  typeFieldValues?: IFieldValue[];
41
56
  typeFieldValuesAll?: IFieldValueAll[];
@@ -1,4 +1,4 @@
1
- import { IEmbeddedEntityWithIdOrName, IFieldBinding, IFieldValueWithConstraints } from '../../post';
1
+ import { IFieldBinding, IFieldValueWithConstraints, ITypeFieldBinding } from '../../post';
2
2
  import { IActionAttachment, IActionAttachmentAll, IReadinessRule, IReadinessRuleAll } from '../../../shared';
3
3
  export interface UpdateTypeRequest {
4
4
  name?: string;
@@ -13,7 +13,7 @@ export interface UpdateTypeRequest {
13
13
  description?: string;
14
14
  path?: string;
15
15
  fields?: IFieldBinding[];
16
- typeFields?: IEmbeddedEntityWithIdOrName[];
16
+ typeFields?: ITypeFieldBinding[];
17
17
  typeFieldValues?: IFieldValueWithConstraints[];
18
18
  manifestIds?: string[];
19
19
  supportsStocktake?: boolean;
@@ -1,5 +1,5 @@
1
1
  import { IActionAttachment, IReadinessRule } from '../../shared';
2
- import { IFieldBindingDelta } from '../../fields';
2
+ import { IFieldBindingDelta, ITypeFieldBindingDelta } from '../../fields';
3
3
  export declare type IEmbeddedEntityWithIdOrName = {
4
4
  id: string;
5
5
  name?: never;
@@ -12,10 +12,18 @@ export declare type IEmbeddedEntityWithIdOrName = {
12
12
  };
13
13
  /**
14
14
  * A type's authored field binding: the field reference (`id`/`name`) plus an
15
- * optional source/visibility delta (§5 / §1.4). A bare `{ id }` is an INPUT
16
- * binding, exactly as before.
15
+ * optional source/visibility/presentation delta (§5 / §1.4, option rules
16
+ * §2.2). A bare `{ id }` is an INPUT binding, exactly as before; `{ id,
17
+ * detach: true }` unbinds an inherited field from this type down.
17
18
  */
18
19
  export declare type IFieldBinding = IEmbeddedEntityWithIdOrName & IFieldBindingDelta;
20
+ /**
21
+ * A type-level field row: the field reference plus the presentation delta a
22
+ * type field may carry (`label` / `required`) or `detach`. Resolved onto
23
+ * `typeFieldsAll` exactly like `fields` onto `fieldsAll` — an inherited id is
24
+ * an override, a new id a first attach.
25
+ */
26
+ export declare type ITypeFieldBinding = IEmbeddedEntityWithIdOrName & ITypeFieldBindingDelta;
19
27
  declare type ValueStringOnly = {
20
28
  valueString: string;
21
29
  valueInteger?: never;
@@ -88,7 +96,7 @@ export interface PostTypeRequest {
88
96
  description?: string;
89
97
  path?: string;
90
98
  fields?: IFieldBinding[];
91
- typeFields?: IEmbeddedEntityWithIdOrName[];
99
+ typeFields?: ITypeFieldBinding[];
92
100
  typeFieldValues?: IFieldValueWithConstraints[];
93
101
  manifestIds?: string[];
94
102
  supportsStocktake?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/types/post/request.ts"],"names":[],"mappings":";;;AA8GA,QAAQ;AACK,QAAA,mBAAmB,GAAoB;IAClD,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,MAAM;IACZ,gBAAgB,EAAE,OAAO;IACzB,MAAM,EAAE;QACN;YACE,EAAE,EAAE,QAAQ;YACZ,IAAI,EAAE,QAAQ;SACf;KACF;IACD,eAAe,EAAE;QACf;YACE,gBAAgB;YAChB,IAAI,EAAE,QAAQ;YACd,YAAY,EAAE,IAAI;YAClB,oBAAoB;SACrB;KACF;IACD,iBAAiB,EAAE,IAAI;CACxB,CAAA"}
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/types/post/request.ts"],"names":[],"mappings":";;;AAwHA,QAAQ;AACK,QAAA,mBAAmB,GAAoB;IAClD,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,MAAM;IACZ,gBAAgB,EAAE,OAAO;IACzB,MAAM,EAAE;QACN;YACE,EAAE,EAAE,QAAQ;YACZ,IAAI,EAAE,QAAQ;SACf;KACF;IACD,eAAe,EAAE;QACf;YACE,gBAAgB;YAChB,IAAI,EAAE,QAAQ;YACd,YAAY,EAAE,IAAI;YAClB,oBAAoB;SACrB;KACF;IACD,iBAAiB,EAAE,IAAI;CACxB,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.33",
4
+ "version": "1.0.70-alpha.35",
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": "05ca7d68246bef56748c1cf9c8826a1d0ebcc1ee"
21
+ "gitHead": "7534d6b7699136610bfd65f75b50407e80d404f5"
22
22
  }