@spotto/contract 1.0.70-alpha.1 → 1.0.70-alpha.11
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/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 +12 -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 +25 -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/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 +27 -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 +1 -0
- package/dist/ai/index.js +18 -0
- package/dist/ai/index.js.map +1 -0
- package/dist/assets/[id]/get.d.ts +9 -1
- package/dist/assets/[id]/patch/request.d.ts +5 -0
- package/dist/assets/get/query.d.ts +11 -4
- package/dist/assets/post/request.d.ts +2 -0
- package/dist/assets/post/request.js.map +1 -1
- package/dist/events/constants.d.ts +2 -1
- package/dist/events/constants.js +2 -0
- package/dist/events/constants.js.map +1 -1
- package/dist/events/get/response.d.ts +17 -1
- 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 +24 -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 +10 -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 +86 -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 +4 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/integrations/constants.d.ts +1 -0
- package/dist/integrations/oneblink/patch/request.d.ts +3 -2
- package/dist/integrations/oneblink/token.d.ts +2 -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/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/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/users/current.d.ts +7 -0
- 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 +64 -0
- package/dist/users/home-layout/shared.js +19 -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/package.json +2 -2
|
@@ -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("./post"), exports);
|
|
18
|
+
__exportStar(require("./[fileId]"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/submissions/uploads/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB;AACtB,6CAA0B"}
|
|
@@ -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/submissions/uploads/post/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,6CAA0B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SubmissionMediaContentType } from '../../constants';
|
|
2
|
+
/** One file to upload — the declared type is pinned into the POST policy. */
|
|
3
|
+
export interface PostSubmissionUploadsRequestFile {
|
|
4
|
+
contentType: SubmissionMediaContentType;
|
|
5
|
+
}
|
|
6
|
+
/** POST /submissions/uploads — mint presigned upload POSTs (§4.3). */
|
|
7
|
+
export interface PostSubmissionUploadsRequest {
|
|
8
|
+
files: PostSubmissionUploadsRequestFile[];
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../src/submissions/uploads/post/request.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A ready-to-send presigned POST: multipart-form the `fields` verbatim (file
|
|
3
|
+
* last) at `url`. The policy enforces the declared content-type and the size
|
|
4
|
+
* cap, so a disallowed file bounces at upload time.
|
|
5
|
+
*/
|
|
6
|
+
export interface ISubmissionUploadPost {
|
|
7
|
+
url: string;
|
|
8
|
+
fields: Record<string, string>;
|
|
9
|
+
}
|
|
10
|
+
export interface PostSubmissionUploadsResponseFile {
|
|
11
|
+
/** Server-minted ULID — becomes the attachment's fileId at submit. */
|
|
12
|
+
fileId: string;
|
|
13
|
+
post: ISubmissionUploadPost;
|
|
14
|
+
}
|
|
15
|
+
export interface PostSubmissionUploadsResponse {
|
|
16
|
+
/** Same order as the request's files. */
|
|
17
|
+
files: PostSubmissionUploadsResponseFile[];
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../../../src/submissions/uploads/post/response.ts"],"names":[],"mappings":""}
|
package/dist/types/[id]/get.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GetFieldResponse } from '../../fields/[id]/get';
|
|
2
|
-
import {
|
|
2
|
+
import { IFieldBindingDelta } from '../../fields';
|
|
3
|
+
import { IActionAttachment, IActionAttachmentAll, IEmbeddedEntity, IReadinessRule, IReadinessRuleAll } from '../../shared';
|
|
3
4
|
export interface IFieldValue {
|
|
4
5
|
id: string;
|
|
5
6
|
name: string;
|
|
@@ -9,8 +10,16 @@ export interface IFieldValue {
|
|
|
9
10
|
valueBoolean?: boolean;
|
|
10
11
|
valueDate?: string;
|
|
11
12
|
valueDateTime?: Date;
|
|
13
|
+
/** True when the value was derived by a COMPUTED/AGGREGATED binding (read-only). */
|
|
14
|
+
computed?: boolean;
|
|
12
15
|
}
|
|
13
|
-
|
|
16
|
+
/**
|
|
17
|
+
* 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.
|
|
21
|
+
*/
|
|
22
|
+
export interface IFieldDefinitionAll extends GetFieldResponse, IFieldBindingDelta {
|
|
14
23
|
typePath: string;
|
|
15
24
|
}
|
|
16
25
|
export interface IFieldValueAll extends IFieldValue {
|
|
@@ -36,4 +45,10 @@ export interface GetTypeResponse {
|
|
|
36
45
|
manifestId?: string;
|
|
37
46
|
manifestIds?: string[];
|
|
38
47
|
supportsStocktake?: boolean;
|
|
48
|
+
/** Assets of this type are kits (containers) — G2G M2. */
|
|
49
|
+
typeKit?: boolean;
|
|
50
|
+
readinessRules?: IReadinessRule[];
|
|
51
|
+
readinessRulesAll?: IReadinessRuleAll[];
|
|
52
|
+
actions?: IActionAttachment[];
|
|
53
|
+
actionsAll?: IActionAttachmentAll[];
|
|
39
54
|
}
|
|
@@ -1,13 +1,27 @@
|
|
|
1
|
-
import { IEmbeddedEntityWithIdOrName, IFieldValueWithConstraints } from '../../post';
|
|
1
|
+
import { IEmbeddedEntityWithIdOrName, IFieldBinding, IFieldValueWithConstraints } from '../../post';
|
|
2
|
+
import { IActionAttachment, IActionAttachmentAll, IReadinessRule, IReadinessRuleAll } from '../../../shared';
|
|
2
3
|
export interface UpdateTypeRequest {
|
|
3
4
|
name?: string;
|
|
4
5
|
parent?: string;
|
|
5
6
|
fullNameTemplate?: string | null;
|
|
6
7
|
description?: string;
|
|
7
8
|
path?: string;
|
|
8
|
-
fields?:
|
|
9
|
+
fields?: IFieldBinding[];
|
|
9
10
|
typeFields?: IEmbeddedEntityWithIdOrName[];
|
|
10
11
|
typeFieldValues?: IFieldValueWithConstraints[];
|
|
11
12
|
manifestIds?: string[];
|
|
12
13
|
supportsStocktake?: boolean;
|
|
14
|
+
/** Assets of this type are kits (containers) — G2G M2. */
|
|
15
|
+
typeKit?: boolean;
|
|
16
|
+
readinessRules?: IReadinessRule[];
|
|
17
|
+
/**
|
|
18
|
+
* Server-derived, read-only projection (own + inherited rules) returned by
|
|
19
|
+
* GET. Tolerated on input only so a GET → edit → PATCH round-trip of the whole
|
|
20
|
+
* type doesn't 400; the server strips it and re-derives it from stored state +
|
|
21
|
+
* parent (prepareUpdate), so it never affects what is stored.
|
|
22
|
+
*/
|
|
23
|
+
readinessRulesAll?: IReadinessRuleAll[];
|
|
24
|
+
actions?: IActionAttachment[];
|
|
25
|
+
/** Server-derived like `readinessRulesAll`: tolerated on input, stripped. */
|
|
26
|
+
actionsAll?: IActionAttachmentAll[];
|
|
13
27
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { IActionAttachment, IReadinessRule } from '../../shared';
|
|
2
|
+
import { IFieldBindingDelta } from '../../fields';
|
|
1
3
|
export declare type IEmbeddedEntityWithIdOrName = {
|
|
2
4
|
id: string;
|
|
3
5
|
name?: never;
|
|
@@ -8,6 +10,12 @@ export declare type IEmbeddedEntityWithIdOrName = {
|
|
|
8
10
|
id: string;
|
|
9
11
|
name: string;
|
|
10
12
|
};
|
|
13
|
+
/**
|
|
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.
|
|
17
|
+
*/
|
|
18
|
+
export declare type IFieldBinding = IEmbeddedEntityWithIdOrName & IFieldBindingDelta;
|
|
11
19
|
declare type ValueStringOnly = {
|
|
12
20
|
valueString: string;
|
|
13
21
|
valueInteger?: never;
|
|
@@ -66,18 +74,24 @@ declare type IdOrName = {
|
|
|
66
74
|
id: string;
|
|
67
75
|
name: string;
|
|
68
76
|
};
|
|
69
|
-
export declare type IFieldValueWithConstraints = IdOrName &
|
|
77
|
+
export declare type IFieldValueWithConstraints = IdOrName & {
|
|
78
|
+
computed?: boolean;
|
|
79
|
+
} & (ValueStringOnly | ValueIntegerOnly | ValueDecimalOnly | ValueBooleanOnly | ValueDateOnly | ValueDateTimeOnly);
|
|
70
80
|
export interface PostTypeRequest {
|
|
71
81
|
name: string;
|
|
72
82
|
parent?: string;
|
|
73
83
|
fullNameTemplate?: string | null;
|
|
74
84
|
description?: string;
|
|
75
85
|
path?: string;
|
|
76
|
-
fields?:
|
|
86
|
+
fields?: IFieldBinding[];
|
|
77
87
|
typeFields?: IEmbeddedEntityWithIdOrName[];
|
|
78
88
|
typeFieldValues?: IFieldValueWithConstraints[];
|
|
79
89
|
manifestIds?: string[];
|
|
80
90
|
supportsStocktake?: boolean;
|
|
91
|
+
/** Assets of this type are kits (containers) — G2G M2. */
|
|
92
|
+
typeKit?: boolean;
|
|
93
|
+
readinessRules?: IReadinessRule[];
|
|
94
|
+
actions?: IActionAttachment[];
|
|
81
95
|
}
|
|
82
96
|
export declare type PostTypesRequest = PostTypeRequest[];
|
|
83
97
|
export declare const testPostTypeRequest: PostTypeRequest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/types/post/request.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/types/post/request.ts"],"names":[],"mappings":";;;AA0GA,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/dist/users/current.d.ts
CHANGED
|
@@ -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,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,64 @@
|
|
|
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
|
+
* A layout is a flat, ordered list of widgets, each pinned to a rect on a
|
|
8
|
+
* 4-column grid (`gridPos`). The widget `type` is a closed union (below): adding
|
|
9
|
+
* a new kind is a contract change + republish + client bump. Per-widget `config`
|
|
10
|
+
* is left opaque and carries widget *behaviour* only (a saved-view id, an action
|
|
11
|
+
* id, a heading's text) — never geometry — so a widget can evolve without a
|
|
12
|
+
* contract change while the API still validates the structural parts.
|
|
13
|
+
*
|
|
14
|
+
* `version` discriminates stored layouts so the client can detect and
|
|
15
|
+
* reset/migrate an older one on read.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* The kinds of Home widget. Closed set — adding one is a contract change.
|
|
19
|
+
* - `tile-link` — a link card (a saved view or a nav destination); may show a live count.
|
|
20
|
+
* - `summary-list` — top-N rows of a saved view's results.
|
|
21
|
+
* - `recent-activity` — the account's latest activity feed.
|
|
22
|
+
* - `recent-assets` / `recent-locations` — most-recently-updated entities.
|
|
23
|
+
* - `needs-attention` — assets flagged not-ready / partially-ready.
|
|
24
|
+
* - `kit-spotlight` — kit readiness summary.
|
|
25
|
+
* - `hero` — the fleet-readiness hero (overview + inline needs-attention legend).
|
|
26
|
+
* - `heading` — a text heading to label a run of widgets (heading text lives in `config`).
|
|
27
|
+
*
|
|
28
|
+
* `hero` and `heading` are full-width structural widgets: the client renders them
|
|
29
|
+
* spanning the whole row at every breakpoint. As with all widgets, width is
|
|
30
|
+
* expressed through `gridPos.w`, not enforced by the API.
|
|
31
|
+
*/
|
|
32
|
+
export declare type HomeWidgetType = 'tile-link' | 'summary-list' | 'recent-activity' | 'recent-assets' | 'recent-locations' | 'needs-attention' | 'kit-spotlight' | 'hero' | 'heading';
|
|
33
|
+
/**
|
|
34
|
+
* A widget's cell on the Home grid: top-left position (`x`/`y`) and size
|
|
35
|
+
* (`w`/`h`), in grid units. The grid is 4 columns wide, so `x + w <= 4`, and
|
|
36
|
+
* `h` is a whole number of row-units. Below the desktop breakpoint the client
|
|
37
|
+
* collapses to a single column, so `x`/`w` only bind on wide viewports.
|
|
38
|
+
*/
|
|
39
|
+
export interface HomeWidgetGridPos {
|
|
40
|
+
/** Column of the top-left corner (0-based; `x + w <= 4`). */
|
|
41
|
+
x: number;
|
|
42
|
+
/** Row of the top-left corner (0-based), in row-units. */
|
|
43
|
+
y: number;
|
|
44
|
+
/** Width in columns (1–4). */
|
|
45
|
+
w: number;
|
|
46
|
+
/** Height in row-units (>= 1). */
|
|
47
|
+
h: number;
|
|
48
|
+
}
|
|
49
|
+
export interface HomeWidget {
|
|
50
|
+
/** Stable client-generated id (ulid) — the reorder / remove key. */
|
|
51
|
+
id: string;
|
|
52
|
+
/** Widget kind (closed union). The client registry maps it to a renderer + config shape. */
|
|
53
|
+
type: HomeWidgetType;
|
|
54
|
+
/** Position + size on the 4-column grid. */
|
|
55
|
+
gridPos: HomeWidgetGridPos;
|
|
56
|
+
/** Widget-specific *behaviour* config (e.g. a saved-view id, a heading's text). Opaque to the API; never geometry. */
|
|
57
|
+
config?: Record<string, unknown>;
|
|
58
|
+
}
|
|
59
|
+
export interface HomeLayout {
|
|
60
|
+
/** Layout schema version, so the client can detect + migrate/reset older stored layouts. */
|
|
61
|
+
version: number;
|
|
62
|
+
/** Flat, ordered widget list; geometry lives on each widget's `gridPos`. */
|
|
63
|
+
widgets: HomeWidget[];
|
|
64
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
* A layout is a flat, ordered list of widgets, each pinned to a rect on a
|
|
9
|
+
* 4-column grid (`gridPos`). The widget `type` is a closed union (below): adding
|
|
10
|
+
* a new kind is a contract change + republish + client bump. Per-widget `config`
|
|
11
|
+
* is left opaque and carries widget *behaviour* only (a saved-view id, an action
|
|
12
|
+
* id, a heading's text) — never geometry — so a widget can evolve without a
|
|
13
|
+
* contract change while the API still validates the structural parts.
|
|
14
|
+
*
|
|
15
|
+
* `version` discriminates stored layouts so the client can detect and
|
|
16
|
+
* reset/migrate an older one on read.
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/users/home-layout/shared.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG"}
|
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"}
|
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.
|
|
4
|
+
"version": "1.0.70-alpha.11",
|
|
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": "
|
|
21
|
+
"gitHead": "3bfd5e720157f73503fd29486b6111952e44de5a"
|
|
22
22
|
}
|