@spotto/contract 1.0.70-alpha.40 → 1.0.70-alpha.42

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,7 +1,7 @@
1
1
  import { type Point } from 'geojson';
2
2
  import { IEmbeddedLabel } from '../../labels';
3
3
  import { LocationStatus, LocationType } from '../../locations/constants';
4
- import { IEntityMeta, IEmbeddedEntity, IReadiness } from '../../shared';
4
+ import { IEntityMeta, IEmbeddedEntity, IHeldRuleIssue, IReadiness } from '../../shared';
5
5
  import { IAssetTelemetry } from '../../telemetry';
6
6
  import { IFieldValue } from '../../types';
7
7
  export interface ILastLocation {
@@ -87,6 +87,12 @@ export interface GetAssetResponse {
87
87
  */
88
88
  context?: boolean;
89
89
  groupSatisfiesManifest?: 0 | 1 | 2;
90
+ /**
91
+ * The READINESS rule failures held from the latest check of each manifest
92
+ * on this asset. `readiness` already renders those of a manifest the asset
93
+ * can be checked against; this is the stored list behind them.
94
+ */
95
+ heldRuleIssues?: IHeldRuleIssue[];
90
96
  readiness?: IReadiness;
91
97
  timeSensitive?: boolean;
92
98
  }
@@ -2,6 +2,15 @@ import { DateCondition, ReadinessState, SearchableSortFields, SortOrders } from
2
2
  import { LocationStatus } from '../../locations/constants';
3
3
  import { ListScope } from '../../usergroups/access';
4
4
  export declare type AssetSearchField = 'name' | 'tagIds';
5
+ /**
6
+ * How the space-separated pieces of a search term combine: `any`, the
7
+ * default, matches an asset holding any one of them; `every` matches only an
8
+ * asset holding all of them, each piece found as it would be if searched for
9
+ * alone. One addition under `every` with `searchFuzzy: false`: a piece with
10
+ * punctuation in it must also be found as typed, which a search of that
11
+ * piece alone does not ask.
12
+ */
13
+ export declare type AssetSearchMatch = 'any' | 'every';
5
14
  export declare type AssetEmbedField = 'meta' | 'tagIds' | 'candidateLocations' | 'telemetry' | 'readers' | 'readiness';
6
15
  export declare type AssetSortField = SearchableSortFields | 'battery' | 'ready';
7
16
  export declare type AssetBatteryStatus = 'critical' | 'low' | 'ok';
@@ -48,6 +57,13 @@ export interface AssetFilters {
48
57
  battery?: AssetBatteryStatus;
49
58
  search?: string;
50
59
  searchFuzzy?: boolean;
60
+ /**
61
+ * `every` asks that every space-separated piece of `search` be found on
62
+ * the asset, in any order and in any of the places the search looks;
63
+ * absent or `any`, one piece is enough, as it always was. A term of one
64
+ * piece is the same search either way.
65
+ */
66
+ searchMatch?: AssetSearchMatch;
51
67
  searchFields?: Array<AssetSearchField>;
52
68
  typeIds?: string[];
53
69
  typePathBeginsWith?: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"query.js","sourceRoot":"","sources":["../../../src/assets/get/query.ts"],"names":[],"mappings":";;;AAoBA,wFAAwF;AAC3E,QAAA,eAAe,GAAG,MAAM,CAAA"}
1
+ {"version":3,"file":"query.js","sourceRoot":"","sources":["../../../src/assets/get/query.ts"],"names":[],"mappings":";;;AA6BA,wFAAwF;AAC3E,QAAA,eAAe,GAAG,MAAM,CAAA"}
@@ -23,7 +23,8 @@ export declare type ReadinessEventType = 'AssetReadinessChanged';
23
23
  * - `edit`: the asset itself was written — an edit, a form write-back, a
24
24
  * stocktake's manifest verdict on a kit.
25
25
  * - `rules`: its type's readiness rules or bindings changed and every asset
26
- * of the type was re-evaluated.
26
+ * of the type was re-evaluated; or the rules of a manifest it carries
27
+ * were edited, or a type-level value one of them reads.
27
28
  * - `members`: a kit re-rolled because a member changed, joined or left.
28
29
  * - `schedule`: the scheduled refresh noticed the date moved.
29
30
  */
@@ -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;AA8CY,QAAA,uBAAuB,GAA2B;IAC7D,MAAM;IACN,OAAO;IACP,SAAS;IACT,UAAU;CACX,CAAA;AA0BY,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,uBAAuB;IACvB,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;AAED;;;;;;;GAOG;AACU,QAAA,uBAAuB,GAClC,CAAC,GAAG,8BAAsB,EAAE,uBAAuB,CAAC,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;AA+CY,QAAA,uBAAuB,GAA2B;IAC7D,MAAM;IACN,OAAO;IACP,SAAS;IACT,UAAU;CACX,CAAA;AA0BY,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,uBAAuB;IACvB,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;AAED;;;;;;;GAOG;AACU,QAAA,uBAAuB,GAClC,CAAC,GAAG,8BAAsB,EAAE,uBAAuB,CAAC,CAAA"}
@@ -154,6 +154,8 @@ export interface IAssetReadinessChangedPayload {
154
154
  snapshotId?: string;
155
155
  /** The form submission whose write-back caused the change, when one did. */
156
156
  submissionId?: string;
157
+ /** `rules` — the manifest whose rules were edited, when a manifest's were. */
158
+ manifest?: IEmbeddedEntity;
157
159
  }
158
160
  export interface IAssetReadinessChangedEvent extends IBaseEvent {
159
161
  type: ReadinessEventType;
@@ -1,5 +1,7 @@
1
1
  import { IEntityMeta } from '../../shared';
2
2
  import { IFieldValue } from '../../types';
3
+ import { IManifestFormItem } from '../formItems';
4
+ import { IManifestRule } from '../rules';
3
5
  export interface IManifestType {
4
6
  typeId: string;
5
7
  typeName?: string;
@@ -29,6 +31,26 @@ export interface GetManifestResponse {
29
31
  assets?: IManifestAsset[];
30
32
  typesCount: number;
31
33
  assetsCount: number;
34
+ /**
35
+ * The manifest's form items, in author order: fields to answer, capture
36
+ * blocks and instructions, each placed in a section and optionally after
37
+ * one of its lines. Returned where the lines are (`embed=full` or
38
+ * `partial`). On the copy a snapshot embeds, they are the items the check
39
+ * was asked.
40
+ */
41
+ formItems?: IManifestFormItem[];
42
+ /** Number of entries in `formItems`. Absent when the manifest has none, so
43
+ * a manifest without form items reads exactly as it always has. */
44
+ formItemsCount?: number;
45
+ /**
46
+ * The manifest's rules, in the order they are evaluated: rules that judge
47
+ * what a check found, where the lines only count it. Returned where the
48
+ * lines are (`embed=full` or `partial`). On the copy a snapshot embeds,
49
+ * they are the rules the check was judged by.
50
+ */
51
+ rules?: IManifestRule[];
52
+ /** Number of entries in `rules`. Absent when the manifest has none. */
53
+ rulesCount?: number;
32
54
  meta?: IEntityMeta;
33
55
  test?: string;
34
56
  }
@@ -1 +1 @@
1
- {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/manifests/[id]/get.ts"],"names":[],"mappings":";;;AAsCA,QAAQ;AACK,QAAA,sBAAsB,GAAwB;IACzD,EAAE,EAAE,OAAO;IACX,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,CAAC;IAC7C,KAAK,EAAE;QACL;YACE,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,YAAY;YACtB,OAAO,EAAE,SAAS;SACnB;QACD;YACE,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,YAAY;YACtB,KAAK,EAAE,GAAG;YACV,OAAO,EAAE,WAAW;SACrB;QACD;YACE,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,YAAY;YACtB,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,EAAE;SACZ;QACD;YACE,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,YAAY;YACtB,QAAQ,EAAE,EAAE;YACZ,QAAQ,EAAE,EAAE;YACZ,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,KAAK;SACf;KACF;IACD,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,CAAC;CACf,CAAA"}
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/manifests/[id]/get.ts"],"names":[],"mappings":";;;AA4DA,QAAQ;AACK,QAAA,sBAAsB,GAAwB;IACzD,EAAE,EAAE,OAAO;IACX,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,CAAC;IAC7C,KAAK,EAAE;QACL;YACE,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,YAAY;YACtB,OAAO,EAAE,SAAS;SACnB;QACD;YACE,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,YAAY;YACtB,KAAK,EAAE,GAAG;YACV,OAAO,EAAE,WAAW;SACrB;QACD;YACE,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,YAAY;YACtB,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,EAAE;SACZ;QACD;YACE,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,YAAY;YACtB,QAAQ,EAAE,EAAE;YACZ,QAAQ,EAAE,EAAE;YACZ,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,KAAK;SACf;KACF;IACD,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,CAAC;CACf,CAAA"}
@@ -1,8 +1,15 @@
1
1
  import { IManifestTypePost, IManifestAssetPost } from '../../post/request';
2
+ import { IManifestFormItemInput } from '../../formItems';
3
+ import { IManifestRule } from '../../rules';
2
4
  export interface UpdateManifestRequest {
3
5
  name?: string;
4
6
  types?: IManifestTypePost[];
5
7
  assets?: IManifestAssetPost[];
6
8
  sections?: string[];
9
+ /** Replaces the stored form items whole when sent; left alone when absent.
10
+ * `[]` removes them all. */
11
+ formItems?: IManifestFormItemInput[];
12
+ /** Replaces the stored rules whole when sent; left alone when absent. */
13
+ rules?: IManifestRule[];
7
14
  }
8
15
  export declare const testUpdatetManifestRequest: UpdateManifestRequest;
@@ -1 +1 @@
1
- {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../src/manifests/[id]/patch/request.ts"],"names":[],"mappings":";;;AASA,QAAQ;AACK,QAAA,0BAA0B,GAA0B;IAC/D,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE;QACL;YACE,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAE;SACZ;QACD;YACE,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,GAAG;YACV,OAAO,EAAE,EAAE;SACZ;QACD;YACE,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,EAAE;SACZ;QACD;YACE,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,EAAE;YACZ,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,EAAE;SACZ;KACF;IACD,MAAM,EAAE;QACN;YACE,OAAO,EAAE,WAAW;YACpB,OAAO,EAAE,EAAE;SACZ;QACD;YACE,OAAO,EAAE,WAAW;YACpB,SAAS,EAAE,YAAY;YACvB,OAAO,EAAE,EAAE;SACZ;QACD;YACE,OAAO,EAAE,WAAW;YACpB,SAAS,EAAE,YAAY;YACvB,OAAO,EAAE,YAAY;SACtB;KACF;CACF,CAAA"}
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../src/manifests/[id]/patch/request.ts"],"names":[],"mappings":";;;AAgBA,QAAQ;AACK,QAAA,0BAA0B,GAA0B;IAC/D,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE;QACL;YACE,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAE;SACZ;QACD;YACE,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,GAAG;YACV,OAAO,EAAE,EAAE;SACZ;QACD;YACE,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,EAAE;SACZ;QACD;YACE,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,EAAE;YACZ,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,EAAE;SACZ;KACF;IACD,MAAM,EAAE;QACN;YACE,OAAO,EAAE,WAAW;YACpB,OAAO,EAAE,EAAE;SACZ;QACD;YACE,OAAO,EAAE,WAAW;YACpB,SAAS,EAAE,YAAY;YACvB,OAAO,EAAE,EAAE;SACZ;QACD;YACE,OAAO,EAAE,WAAW;YACpB,SAAS,EAAE,YAAY;YACvB,OAAO,EAAE,YAAY;SACtB;KACF;CACF,CAAA"}
@@ -0,0 +1,62 @@
1
+ import { FormCaptureItem, FormDividerItem, FormFieldItem, FormImageItem, FormLinkItem, FormTextItem, FormVideoItem } from '../forms/shared';
2
+ /**
3
+ * Where a manifest form item sits within its section: after one of the
4
+ * section's lines, named by the line's own key — a `types` line by its
5
+ * `typeId`, an `assets` line by its `assetId`. Exactly one of the two.
6
+ */
7
+ export interface IManifestFormItemAfter {
8
+ typeId?: string;
9
+ assetId?: string;
10
+ }
11
+ /** Where in its section a form item goes when it follows no line. */
12
+ export declare type ManifestFormItemAt = 'start' | 'end';
13
+ /**
14
+ * How the line a form item follows came out of the check: `satisfied` when
15
+ * the count the check attested meets the line's minimum (`countMin`, 1 when
16
+ * unset; an `assets` line when its asset was found), `short` otherwise.
17
+ */
18
+ export declare type ManifestWhenLine = 'satisfied' | 'short';
19
+ /**
20
+ * A field item of a manifest as it is read: a form's field item, with the id
21
+ * of the field definition it binds beside the name. A field's name never
22
+ * changes, so the two always agree.
23
+ */
24
+ export interface ManifestFieldItem extends FormFieldItem {
25
+ fieldId: string;
26
+ }
27
+ /**
28
+ * A field item of a manifest as it is written: `name` or `fieldId` binds the
29
+ * field definition, and the server fills in the other. Sending both is
30
+ * allowed when they name the same field.
31
+ */
32
+ export declare type ManifestFieldItemInput = Omit<FormFieldItem, 'name'> & {
33
+ name?: string;
34
+ fieldId?: string;
35
+ };
36
+ declare type ManifestContentItem = FormTextItem | FormImageItem | FormDividerItem | FormLinkItem | FormVideoItem | FormCaptureItem;
37
+ /**
38
+ * What a manifest form item holds: any form item but a `section` (the
39
+ * manifest's own sections are the sections).
40
+ */
41
+ export declare type ManifestItem = ManifestFieldItem | ManifestContentItem;
42
+ export declare type ManifestItemInput = ManifestFieldItemInput | ManifestContentItem;
43
+ interface IManifestFormItemPlacement {
44
+ /** The section the item is drawn in — one of the manifest's `sections`. */
45
+ section: string;
46
+ /** The line of that section the item follows. Not with `at`. */
47
+ after?: IManifestFormItemAfter;
48
+ /** `start` or `end` (the default) of the section. Not with `after`. */
49
+ at?: ManifestFormItemAt;
50
+ /** Show the item only when the line it follows came out this way. Only
51
+ * with `after`. */
52
+ whenLine?: ManifestWhenLine;
53
+ }
54
+ /** A form item of a manifest, with its placement, as read. */
55
+ export interface IManifestFormItem extends IManifestFormItemPlacement {
56
+ item: ManifestItem;
57
+ }
58
+ /** A form item of a manifest, with its placement, as written. */
59
+ export interface IManifestFormItemInput extends IManifestFormItemPlacement {
60
+ item: ManifestItemInput;
61
+ }
62
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=formItems.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formItems.js","sourceRoot":"","sources":["../../src/manifests/formItems.ts"],"names":[],"mappings":""}
@@ -2,3 +2,5 @@ export * from './[id]';
2
2
  export * from './get';
3
3
  export * from './post';
4
4
  export * from './suggestions';
5
+ export * from './formItems';
6
+ export * from './rules';
@@ -18,4 +18,6 @@ __exportStar(require("./[id]"), exports);
18
18
  __exportStar(require("./get"), exports);
19
19
  __exportStar(require("./post"), exports);
20
20
  __exportStar(require("./suggestions"), exports);
21
+ __exportStar(require("./formItems"), exports);
22
+ __exportStar(require("./rules"), exports);
21
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/manifests/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB;AACtB,wCAAqB;AACrB,yCAAsB;AACtB,gDAA6B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/manifests/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB;AACtB,wCAAqB;AACrB,yCAAsB;AACtB,gDAA6B;AAC7B,8CAA2B;AAC3B,0CAAuB"}
@@ -1,4 +1,6 @@
1
1
  import { IManifestType, IManifestAsset } from '../[id]/get';
2
+ import { IManifestFormItemInput } from '../formItems';
3
+ import { IManifestRule } from '../rules';
2
4
  export declare type IManifestTypePost = Omit<IManifestType, 'typePath' | 'manifest'> & {
3
5
  typePath?: string;
4
6
  };
@@ -11,6 +13,10 @@ export interface PostManifestRequest {
11
13
  types?: IManifestTypePost[];
12
14
  assets?: IManifestAssetPost[];
13
15
  sections?: string[];
16
+ /** Form items asked during a check of this manifest, in author order. */
17
+ formItems?: IManifestFormItemInput[];
18
+ /** Rules that judge what a check found, evaluated in array order. */
19
+ rules?: IManifestRule[];
14
20
  }
15
21
  export declare type PostManifestsRequest = PostManifestRequest[];
16
22
  export declare const testPostManifestRequest: PostManifestRequest;
@@ -1 +1 @@
1
- {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/manifests/post/request.ts"],"names":[],"mappings":";;;AAoBA,QAAQ;AACK,QAAA,uBAAuB,GAAwB;IAC1D,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE;QACL;YACE,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,OAAO;YACjB,OAAO,EAAE,EAAE;SACZ;QACD;YACE,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,GAAG;YACV,OAAO,EAAE,EAAE;SACZ;QACD;YACE,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,EAAE;SACZ;QACD;YACE,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,EAAE;SACZ;QACD;YACE,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,EAAE;YACZ,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,EAAE;SACZ;KACF;IACD,MAAM,EAAE;QACN;YACE,OAAO,EAAE,WAAW;YACpB,OAAO,EAAE,EAAE;SACZ;QACD;YACE,OAAO,EAAE,WAAW;YACpB,SAAS,EAAE,YAAY;YACvB,OAAO,EAAE,EAAE;SACZ;QACD;YACE,OAAO,EAAE,WAAW;YACpB,SAAS,EAAE,YAAY;YACvB,OAAO,EAAE,YAAY;SACtB;KACF;CACF,CAAA"}
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/manifests/post/request.ts"],"names":[],"mappings":";;;AA0BA,QAAQ;AACK,QAAA,uBAAuB,GAAwB;IAC1D,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE;QACL;YACE,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,OAAO;YACjB,OAAO,EAAE,EAAE;SACZ;QACD;YACE,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,GAAG;YACV,OAAO,EAAE,EAAE;SACZ;QACD;YACE,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,EAAE;SACZ;QACD;YACE,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,EAAE;SACZ;QACD;YACE,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,EAAE;YACZ,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,EAAE;SACZ;KACF;IACD,MAAM,EAAE;QACN;YACE,OAAO,EAAE,WAAW;YACpB,OAAO,EAAE,EAAE;SACZ;QACD;YACE,OAAO,EAAE,WAAW;YACpB,SAAS,EAAE,YAAY;YACvB,OAAO,EAAE,EAAE;SACZ;QACD;YACE,OAAO,EAAE,WAAW;YACpB,SAAS,EAAE,YAAY;YACvB,OAAO,EAAE,YAAY;SACtB;KACF;CACF,CAAA"}
@@ -0,0 +1,131 @@
1
+ /**
2
+ * Manifest rules (MANIFEST_RULES.md): rules in a manifest that judge what was
3
+ * found, where the lines only count it.
4
+ *
5
+ * - A RELATION rule says what each item found needs alongside it: every
6
+ * Makita drill needs a Makita battery.
7
+ * - A READINESS rule is a readiness rule over the check's answers.
8
+ * - A SUITABILITY rule says what this manifest needs of each item it holds.
9
+ *
10
+ * A failed rule never blocks a check. It is an issue on the kit's readiness,
11
+ * at the rule's level.
12
+ */
13
+ export declare type ManifestRuleKind = 'RELATION' | 'READINESS' | 'SUITABILITY';
14
+ /** `1` amber or `2` red, as on a readiness rule. */
15
+ export declare type ManifestRuleLevel = 1 | 2;
16
+ /**
17
+ * Which items a rule takes: the found items of `typeId` or of a type beneath
18
+ * it that pass `where`, an expression over each item's own values. An item
19
+ * with no value in a name the filter reads is left out.
20
+ */
21
+ export interface IManifestRuleSide {
22
+ typeId: string;
23
+ where?: string;
24
+ }
25
+ /** A RELATION rule's `from` side: for every `every` items here (default 1)… */
26
+ export interface IManifestRuleFrom extends IManifestRuleSide {
27
+ every?: number;
28
+ }
29
+ /** …`needs` items on the `to` side (default 1). */
30
+ export interface IManifestRuleTo extends IManifestRuleSide {
31
+ needs?: number;
32
+ }
33
+ interface IManifestRuleBase {
34
+ /** Unique among the manifest's rules. It keys the rule's result. */
35
+ name: string;
36
+ level: ManifestRuleLevel;
37
+ /** The issue's reason, with `{Field}` placeholders. */
38
+ message: string;
39
+ /** The section the rule reports in. Without one it is about the whole
40
+ * check. It never limits which items the rule reads. */
41
+ section?: string;
42
+ }
43
+ export interface IManifestRelationRule extends IManifestRuleBase {
44
+ kind: 'RELATION';
45
+ from: IManifestRuleFrom;
46
+ to: IManifestRuleTo;
47
+ /** Field names: a `to` item must hold the same value as its `from` item in
48
+ * each, compared as stored. */
49
+ match?: string[];
50
+ }
51
+ export interface IManifestReadinessRule extends IManifestRuleBase {
52
+ kind: 'READINESS';
53
+ /** Describes the problem: not ready when it is true. */
54
+ expression: string;
55
+ }
56
+ export interface IManifestSuitabilityRule extends IManifestRuleBase {
57
+ kind: 'SUITABILITY';
58
+ items: IManifestRuleSide;
59
+ /** Describes the problem: an item is not suitable when it is true. */
60
+ expression: string;
61
+ }
62
+ export declare type IManifestRule = IManifestRelationRule | IManifestReadinessRule | IManifestSuitabilityRule;
63
+ /** A value a rule read, kept as evidence: as stored, `null` when there was
64
+ * none. A multi-select is its ticked options. */
65
+ export declare type ManifestRuleValue = string | number | boolean | string[] | null;
66
+ /** One group of a RELATION rule's `from` items, by their `match` values. */
67
+ export interface IManifestRuleGroup {
68
+ /** The values the group matched on, as they were read. */
69
+ key: Record<string, ManifestRuleValue>;
70
+ /** The `from` items of the group, by asset id. */
71
+ from: string[];
72
+ /** How many `to` items the group needs. */
73
+ needed: number;
74
+ /** The `to` items it took, by asset id. */
75
+ taken: string[];
76
+ /** It took fewer than it needs. */
77
+ short?: true;
78
+ }
79
+ /** A `from` item a RELATION rule left without what it needs. */
80
+ export interface IManifestRuleUnmatched {
81
+ assetId: string;
82
+ assetName: string;
83
+ reason: string;
84
+ /** It has no value in a `match` field, so it could not be matched. */
85
+ blank?: true;
86
+ /** The index, in `groups`, of the short group it belongs to. */
87
+ group?: number;
88
+ }
89
+ /** An item a SUITABILITY rule found unsuitable. */
90
+ export interface IManifestRuleUnsuitable {
91
+ assetId: string;
92
+ assetName: string;
93
+ /** The values the expression read, as they were read. */
94
+ values: Record<string, ManifestRuleValue>;
95
+ reason: string;
96
+ /** Names the expression reads that the item has no value for. */
97
+ missingFields?: string[];
98
+ }
99
+ /** What one rule came to, on a check or over a kit's members. */
100
+ export interface IManifestRuleResult {
101
+ name: string;
102
+ kind: ManifestRuleKind;
103
+ section?: string;
104
+ /** `false` on a READINESS rule that was not evaluated: the check carried
105
+ * no answers. `triggered` and `passed` are then absent. */
106
+ evaluated?: false;
107
+ /**
108
+ * On a READINESS rule this check did not evaluate, while a failure of it
109
+ * from an earlier check still stands on the checked asset: that earlier
110
+ * check. `level` and `reason` are then that failure's. A level-2 failure
111
+ * carried this way counts against this check's verdict, since the check
112
+ * did nothing to clear it.
113
+ */
114
+ carriedFrom?: string;
115
+ /** A RELATION or SUITABILITY rule is triggered when it found items to
116
+ * judge; a READINESS rule when its expression held. */
117
+ triggered?: boolean;
118
+ passed?: boolean;
119
+ /** The rule's level, on a rule that failed. */
120
+ level?: ManifestRuleLevel;
121
+ /** Why a READINESS rule failed, or why a rule could not be applied. */
122
+ reason?: string;
123
+ missingFields?: string[];
124
+ /** RELATION. */
125
+ groups?: IManifestRuleGroup[];
126
+ unmatched?: IManifestRuleUnmatched[];
127
+ /** SUITABILITY: the items judged, by asset id. */
128
+ judged?: string[];
129
+ unsuitable?: IManifestRuleUnsuitable[];
130
+ }
131
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=rules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rules.js","sourceRoot":"","sources":["../../src/manifests/rules.ts"],"names":[],"mappings":""}
@@ -70,6 +70,48 @@ export interface IReadinessIssue {
70
70
  * action is still attached to the asset's type — so it can never dangle.
71
71
  */
72
72
  action?: IReadinessIssueAction;
73
+ /**
74
+ * A MANIFEST rule's issue (MANIFEST_RULES.md §5.2): the manifest and the
75
+ * rule that raised it. `typeId` is then the asset's own type, since a
76
+ * manifest's rule belongs to no type. Also on the built-in manifest-status
77
+ * issue, where it names the manifest the last check was taken against.
78
+ */
79
+ manifestId?: string;
80
+ ruleName?: string;
81
+ /**
82
+ * The check behind the issue. On a READINESS rule's issue: the check that
83
+ * raised it. It stands until the next check of that manifest, so this says
84
+ * what will clear it and how old it is. On the built-in manifest-status
85
+ * issue: the check that stamped the verdict.
86
+ */
87
+ snapshotId?: string;
88
+ /** The item a RELATION or SUITABILITY rule's issue is about. The issue is
89
+ * the kit's, so `assetId` is the kit. */
90
+ itemId?: string;
91
+ itemName?: string;
92
+ /**
93
+ * On the built-in "Kit manifest not satisfied" issue: what the check's
94
+ * verdict rests on beyond its lines, in words: the level-2 rules that were
95
+ * not met. `reason` stays one of the three fixed strings clients know.
96
+ */
97
+ summary?: string;
98
+ }
99
+ /**
100
+ * A READINESS rule's failure, held on the asset from the latest check of its
101
+ * manifest (MANIFEST_RULES.md §5.2). Written only by a check, and replaced
102
+ * by the next check of the same manifest. The asset's `readiness` renders
103
+ * each one as an issue while the asset can still be checked against that
104
+ * manifest; they are returned beside it so a client that predicts readiness
105
+ * builds it from what the server does.
106
+ */
107
+ export interface IHeldRuleIssue {
108
+ manifestId: string;
109
+ ruleName: string;
110
+ /** The check that raised it. */
111
+ snapshotId: string;
112
+ level: ReadinessLevel;
113
+ reason: string;
114
+ missingFields?: string[];
73
115
  }
74
116
  /** Stored/returned readiness for an asset. */
75
117
  export interface IReadiness {
@@ -1,8 +1,9 @@
1
1
  import { IEmbeddedEntity, IEntityMeta, IReadiness } from '../../shared';
2
- import { GetManifestResponse, IManifestAsset, IManifestType } from '../../manifests';
2
+ import { GetManifestResponse, IManifestAsset, IManifestRuleResult, IManifestType } from '../../manifests';
3
3
  import { Point } from 'geojson';
4
4
  import { GetTypeResponse, IFieldValue } from '../../types';
5
5
  import { SnapshotTypeEnum } from '../get';
6
+ import { ISubmissionAttachment, ISubmissionWriteBackAudit } from '../../submissions/shared';
6
7
  export interface IManifestTypeExtended extends IManifestType {
7
8
  c_detected?: number;
8
9
  c_sighted?: number;
@@ -106,6 +107,9 @@ export interface ISnapshotComputed {
106
107
  countTypes: number;
107
108
  countAssets: number;
108
109
  };
110
+ /** How many of the manifest copy's rules failed at this check, at either
111
+ * level. Present only on a check whose copy has rules. */
112
+ rulesFailed?: number;
109
113
  }
110
114
  export interface ISnapshotFields {
111
115
  notes?: string;
@@ -209,6 +213,41 @@ export interface GetSnapshotResponse {
209
213
  * stamped not satisfied (2). Frozen history: the asset's live status may
210
214
  * later change, this flag never does. Server-owned. */
211
215
  c_satisfiesManifest?: boolean;
216
+ /** The ULID the client sent with this snapshot, when it sent one — the key
217
+ * a repeat of the same `POST /snapshots` is recognised by. */
218
+ clientReference?: string;
219
+ /**
220
+ * The answers the check recorded to the form items of its manifest copy, in
221
+ * the items' order: what the checker entered, and the values the server
222
+ * injected (CONTEXT) or derived (COMPUTED), which carry `computed: true`.
223
+ * An item that was not shown has no entry, and neither has an unanswered
224
+ * optional one.
225
+ */
226
+ fieldValues?: IFieldValue[];
227
+ /** The files captured for the copy's signature and photo blocks. */
228
+ attachments?: ISubmissionAttachment[];
229
+ /**
230
+ * What the check wrote to the checked asset: one entry per `writeBack`
231
+ * item of the copy, applied with the value written and the value it
232
+ * replaced, or skipped with the reason.
233
+ */
234
+ writeBack?: ISnapshotWriteBackAudit[];
235
+ /**
236
+ * Present on a check whose manifest has form items. `true`: every required
237
+ * item that was shown has its answer. `false`: the check is recorded
238
+ * without them — it came from a client that predates form items, or lacked
239
+ * a required answer — and it wrote nothing to the asset.
240
+ */
241
+ answersComplete?: boolean;
242
+ /**
243
+ * What each rule of the manifest copy came to at this check, in the rules'
244
+ * order (MANIFEST_RULES.md §5.1). Worked out by the server from the items
245
+ * the check's lines counted and from its answers; a client's own results
246
+ * are never taken. The values each rule read are kept as evidence, so a
247
+ * recorded check still explains itself after a brand or a capacity is
248
+ * edited. Present only on a check whose copy has rules.
249
+ */
250
+ ruleResults?: IManifestRuleResult[];
212
251
  geolocation?: Point;
213
252
  timezone?: string;
214
253
  types?: Omit<GetTypeResponse & {
@@ -219,6 +258,11 @@ export interface GetSnapshotResponse {
219
258
  }, 'manifest'>[];
220
259
  type: SnapshotTypeEnum;
221
260
  }
261
+ /** A check's write-back audit: a submission's, with the id of the field the
262
+ * item binds. */
263
+ export interface ISnapshotWriteBackAudit extends ISubmissionWriteBackAudit {
264
+ fieldId?: string;
265
+ }
222
266
  export interface GetSnapshotsItem {
223
267
  id: string;
224
268
  /** Submitting user; `type` is the account kind (e.g. `INTERNAL`). */
@@ -248,6 +292,9 @@ export interface GetSnapshotsItem {
248
292
  * `GetSnapshotResponse['c_satisfiesManifest']`. Present on list rows so
249
293
  * the snapshot filters can ask it. */
250
294
  c_satisfiesManifest?: boolean;
295
+ /** See `GetSnapshotResponse['answersComplete']`. Present on list rows so a
296
+ * list can mark a check that was recorded without its answers. */
297
+ answersComplete?: boolean;
251
298
  geolocation?: Point;
252
299
  timezone?: string;
253
300
  type: SnapshotTypeEnum;
@@ -1 +1 @@
1
- {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/snapshots/[id]/get.ts"],"names":[],"mappings":";;;AA2RA,QAAQ;AACK,QAAA,sBAAsB,GAAwB;IACzD,EAAE,EAAE,OAAO;IACX,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE;QACR,EAAE,EAAE,YAAY;QAChB,IAAI,EAAE,cAAc;KACrB;IACD,QAAQ,EAAE;QACR,YAAY,EAAE,CAAC;QACf,cAAc,EAAE,CAAC;QACjB,YAAY,EAAE,CAAC;QACf,aAAa,EAAE;YACb,KAAK,EAAE,CAAC;YACR,iBAAiB,EAAE,CAAC;YACpB,YAAY,EAAE,CAAC;YACf,YAAY,EAAE,CAAC,EAAE,+EAA+E;YAChG,4GAA4G;SAC7G;QACD,cAAc,EAAE;YACd,KAAK,EAAE,CAAC;YACR,YAAY,EAAE,CAAC;YACf,YAAY,EAAE,CAAC,EAAE,+EAA+E;SACjG;QACD,UAAU,EAAE;YACV,UAAU,EAAE,CAAC;YACb,WAAW,EAAE,CAAC,EAAE,+DAA+D;SAChF;KACF;IACD,IAAI,EAAE,WAAW;CAClB,CAAA"}
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/snapshots/[id]/get.ts"],"names":[],"mappings":";;;AA+UA,QAAQ;AACK,QAAA,sBAAsB,GAAwB;IACzD,EAAE,EAAE,OAAO;IACX,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE;QACR,EAAE,EAAE,YAAY;QAChB,IAAI,EAAE,cAAc;KACrB;IACD,QAAQ,EAAE;QACR,YAAY,EAAE,CAAC;QACf,cAAc,EAAE,CAAC;QACjB,YAAY,EAAE,CAAC;QACf,aAAa,EAAE;YACb,KAAK,EAAE,CAAC;YACR,iBAAiB,EAAE,CAAC;YACpB,YAAY,EAAE,CAAC;YACf,YAAY,EAAE,CAAC,EAAE,+EAA+E;YAChG,4GAA4G;SAC7G;QACD,cAAc,EAAE;YACd,KAAK,EAAE,CAAC;YACR,YAAY,EAAE,CAAC;YACf,YAAY,EAAE,CAAC,EAAE,+EAA+E;SACjG;QACD,UAAU,EAAE;YACV,UAAU,EAAE,CAAC;YACb,WAAW,EAAE,CAAC,EAAE,+DAA+D;SAChF;KACF;IACD,IAAI,EAAE,WAAW;CAClB,CAAA"}
@@ -4,6 +4,16 @@ import { GetManifestResponse } from '../../manifests';
4
4
  import { IEmbeddedEntity } from '../../shared/embed';
5
5
  import { GetTypeResponse } from '../../types';
6
6
  import { SnapshotTypeEnum } from '../get';
7
+ import { ISubmissionAttachment, ISubmissionFieldValue } from '../../submissions/shared';
8
+ /**
9
+ * One answer of a manifest check: the name of the field item it answers and
10
+ * one value slot, as a form submission sends its values. `id`, the field's
11
+ * id, may be sent beside the name; it is tested against it, and the stored
12
+ * answer always carries both.
13
+ */
14
+ export declare type ISnapshotAnswer = Omit<ISubmissionFieldValue, 'id' | 'computed'> & {
15
+ id?: string;
16
+ };
7
17
  export interface PostSnapshotRequest {
8
18
  reader?: IEmbeddedEntity;
9
19
  location?: IEmbeddedEntity & {
@@ -47,6 +57,37 @@ export interface PostSnapshotRequest {
47
57
  * subtree travels with them. Audited in `membershipSync.severed`.
48
58
  */
49
59
  updateGroupMembership?: boolean;
60
+ /**
61
+ * A ULID the client mints for this snapshot, unique within the organisation.
62
+ * A request that repeats one writes nothing and returns the snapshot stored
63
+ * the first time, marked `replayed: true` — what makes it safe for an
64
+ * offline client to send a queued snapshot again. A reference that arrives
65
+ * with a different snapshot, or from a different user, is refused with a
66
+ * 409.
67
+ */
68
+ clientReference?: string;
69
+ /**
70
+ * The answers to the form items of the manifest copy this check embeds:
71
+ * one entry per answered INPUT field item, name-keyed, one value slot each
72
+ * (a CHECKBOXES field sends one entry per ticked option; an unanswered
73
+ * optional field sends none). Values for COMPUTED and CONTEXT items, and for
74
+ * names the copy does not ask, are ignored: the server derives the first
75
+ * two itself.
76
+ *
77
+ * A client that asks form items ALWAYS sends this key, as `[]` when nothing
78
+ * was answered. Leaving the key out is how a client that predates form
79
+ * items is told apart: its check is recorded without answers.
80
+ */
81
+ fieldValues?: ISnapshotAnswer[];
82
+ /** The files captured for the copy's signature and photo blocks, one per
83
+ * block, uploaded ahead of the request. */
84
+ attachments?: ISubmissionAttachment[];
85
+ /**
86
+ * Ignored. A client that evaluates the copy's rules for its own screen may
87
+ * send what it found; the server evaluates them itself and stores only its
88
+ * own results (`GetSnapshotResponse['ruleResults']`).
89
+ */
90
+ ruleResults?: unknown;
50
91
  }
51
92
  export declare type PostSnapshotsRequest = PostSnapshotRequest[];
52
93
  export declare const testPostSnapshotRequest1: PostSnapshotRequest;
@@ -1 +1 @@
1
- {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/snapshots/post/request.ts"],"names":[],"mappings":";;;AAyDA,SAAS;AACI,QAAA,wBAAwB,GAAwB;IAC3D,MAAM,EAAE,EAAE,EAAE,EAAE,0BAA0B,EAAE,IAAI,EAAE,UAAU,EAAE;IAC5D,QAAQ,EAAE,EAAE,EAAE,EAAE,0BAA0B,EAAE,IAAI,EAAE,YAAY,EAAE;IAChE,cAAc,EAAE;QACd;YACE,OAAO,EAAE,0BAA0B;YACnC,SAAS,EAAE,8BAA8B;YACzC,MAAM,EAAE,0BAA0B;YAClC,QAAQ,EAAE,uBAAuB;YACjC,QAAQ,EAAE,iBAAiB;SAC5B;QACD;YACE,OAAO,EAAE,0BAA0B;YACnC,SAAS,EAAE,eAAe;YAC1B,MAAM,EAAE,0BAA0B;YAClC,QAAQ,EAAE,QAAQ;YAClB,QAAQ,EAAE,iBAAiB;SAC5B;QACD;YACE,OAAO,EAAE,0BAA0B;YACnC,SAAS,EAAE,WAAW;YACtB,MAAM,EAAE,0BAA0B;YAClC,QAAQ,EAAE,WAAW;YACrB,QAAQ,EAAE,iBAAiB;SAC5B;QACD;YACE,OAAO,EAAE,2BAA2B;YACpC,SAAS,EAAE,WAAW;YACtB,MAAM,EAAE,0BAA0B;YAClC,QAAQ,EAAE,iBAAiB;SAC5B;KACF;IACD,MAAM,EAAE;QACN,KAAK,EAAE,EAAE;KACV;IACD,SAAS,EAAE,aAAa;CACzB,CAAA;AAEY,QAAA,wBAAwB,GAAwB;IAC3D,MAAM,EAAE,EAAE,EAAE,EAAE,0BAA0B,EAAE,IAAI,EAAE,UAAU,EAAE;IAC5D,QAAQ,EAAE,EAAE,EAAE,EAAE,0BAA0B,EAAE,IAAI,EAAE,YAAY,EAAE;IAChE,QAAQ,EAAE;QACR,EAAE,EAAE,0BAA0B;QAC9B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B,QAAQ,EAAE,YAAY;SACvB;KACF;IACD,aAAa,EAAE;QACb;YACE,OAAO,EAAE,0BAA0B;YACnC,SAAS,EAAE,WAAW;YACtB,MAAM,EAAE,0BAA0B;YAClC,QAAQ,EAAE,WAAW;YACrB,QAAQ,EAAE,YAAY;YACtB,OAAO,EAAE,gBAAgB;SAC1B;KACF;IACD,MAAM,EAAE;QACN,KAAK,EAAE,EAAE;KACV;IACD,SAAS,EAAE,aAAa;CACzB,CAAA"}
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/snapshots/post/request.ts"],"names":[],"mappings":";;;AAsGA,SAAS;AACI,QAAA,wBAAwB,GAAwB;IAC3D,MAAM,EAAE,EAAE,EAAE,EAAE,0BAA0B,EAAE,IAAI,EAAE,UAAU,EAAE;IAC5D,QAAQ,EAAE,EAAE,EAAE,EAAE,0BAA0B,EAAE,IAAI,EAAE,YAAY,EAAE;IAChE,cAAc,EAAE;QACd;YACE,OAAO,EAAE,0BAA0B;YACnC,SAAS,EAAE,8BAA8B;YACzC,MAAM,EAAE,0BAA0B;YAClC,QAAQ,EAAE,uBAAuB;YACjC,QAAQ,EAAE,iBAAiB;SAC5B;QACD;YACE,OAAO,EAAE,0BAA0B;YACnC,SAAS,EAAE,eAAe;YAC1B,MAAM,EAAE,0BAA0B;YAClC,QAAQ,EAAE,QAAQ;YAClB,QAAQ,EAAE,iBAAiB;SAC5B;QACD;YACE,OAAO,EAAE,0BAA0B;YACnC,SAAS,EAAE,WAAW;YACtB,MAAM,EAAE,0BAA0B;YAClC,QAAQ,EAAE,WAAW;YACrB,QAAQ,EAAE,iBAAiB;SAC5B;QACD;YACE,OAAO,EAAE,2BAA2B;YACpC,SAAS,EAAE,WAAW;YACtB,MAAM,EAAE,0BAA0B;YAClC,QAAQ,EAAE,iBAAiB;SAC5B;KACF;IACD,MAAM,EAAE;QACN,KAAK,EAAE,EAAE;KACV;IACD,SAAS,EAAE,aAAa;CACzB,CAAA;AAEY,QAAA,wBAA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MAAM,EAAE,0BAA0B;YAClC,QAAQ,EAAE,WAAW;YACrB,QAAQ,EAAE,YAAY;YACtB,OAAO,EAAE,gBAAgB;SAC1B;QACD;YACE,OAAO,EAAE,2BAA2B;YACpC,SAAS,EAAE,WAAW;YACtB,MAAM,EAAE,0BAA0B;YAClC,QAAQ,EAAE,WAAW;YACrB,QAAQ,EAAE,YAAY;SACvB;KACF;IACD,aAAa,EAAE;QACb;YACE,OAAO,EAAE,0BAA0B;YACnC,SAAS,EAAE,WAAW;YACtB,MAAM,EAAE,0BAA0B;YAClC,QAAQ,EAAE,WAAW;YACrB,QAAQ,EAAE,YAAY;YACtB,OAAO,EAAE,gBAAgB;SAC1B;KACF;IACD,MAAM,EAAE;QACN,KAAK,EAAE,EAAE;KACV;IACD,SAAS,EAAE,aAAa;CACzB,CAAA"}
@@ -1,5 +1,16 @@
1
1
  import { GetSnapshotResponse } from '../[id]/get';
2
+ export interface PostSnapshotsResponseItem extends GetSnapshotResponse {
3
+ /**
4
+ * Present, and true, when the request repeated a `clientReference` and this
5
+ * is the snapshot stored the first time. Nothing was written for it: the
6
+ * item is frozen as it was recorded, its `asset.c_readiness` and
7
+ * `c_satisfiesManifest` included, so read the asset again for its state
8
+ * now. Absent on a snapshot this request created.
9
+ */
10
+ replayed?: boolean;
11
+ }
2
12
  export interface PostSnapshotsResponse {
13
+ /** How many snapshots this request created — a replayed item is not counted. */
3
14
  inserted: number;
4
- items: GetSnapshotResponse[];
15
+ items: PostSnapshotsResponseItem[];
5
16
  }
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.40",
4
+ "version": "1.0.70-alpha.42",
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": "1f452814ffb186fd11d5740b2588523ef49503a1"
21
+ "gitHead": "ee16b0b496f6e6d0c4e6f7744ce8fad60096f047"
22
22
  }