@spotto/contract 1.0.70-alpha.10 → 1.0.70-alpha.12
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/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/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 +16 -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 +25 -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 +11 -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 +128 -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 +3 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- 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 +1 -0
- package/dist/shared/index.js +1 -0
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/readiness.d.ts +23 -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 +3 -1
- package/dist/types/[id]/patch/request.d.ts +4 -1
- package/dist/types/post/request.d.ts +2 -1
- package/dist/types/post/request.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,23 @@
|
|
|
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("./constants"), exports);
|
|
18
|
+
__exportStar(require("./shared"), exports);
|
|
19
|
+
__exportStar(require("./get"), exports);
|
|
20
|
+
__exportStar(require("./post"), exports);
|
|
21
|
+
__exportStar(require("./[id]"), exports);
|
|
22
|
+
__exportStar(require("./uploads"), exports);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/submissions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,2CAAwB;AACxB,wCAAqB;AACrB,yCAAsB;AACtB,yCAAsB;AACtB,4CAAyB"}
|
|
@@ -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/post/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,6CAA0B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ActionTargetEntity } from '../../actions/shared';
|
|
2
|
+
import { ISubmissionAttachment, ISubmissionFieldValue } from '../shared';
|
|
3
|
+
export interface PostSubmissionRequest {
|
|
4
|
+
/** Client-minted idempotency key (ULID) — one per capture, reused on retry. */
|
|
5
|
+
clientReference: string;
|
|
6
|
+
actionName: string;
|
|
7
|
+
/** The form version pinned when the run opened. */
|
|
8
|
+
formName: string;
|
|
9
|
+
formVersion: number;
|
|
10
|
+
/** The run's target: a location run captures without write-back (§4.4). */
|
|
11
|
+
entity: ActionTargetEntity;
|
|
12
|
+
entityId: string;
|
|
13
|
+
/** Client fill time (ISO). */
|
|
14
|
+
capturedAt: string;
|
|
15
|
+
fieldValues?: ISubmissionFieldValue[];
|
|
16
|
+
attachments?: ISubmissionAttachment[];
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/submissions/post/request.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { GetAssetResponse } from '../../assets';
|
|
2
|
+
import { GetSubmissionResponse, ISubmissionEffect } from '../shared';
|
|
3
|
+
/**
|
|
4
|
+
* Delivery status of one effect on a fresh submit (§4.2): a raiseAlert entry
|
|
5
|
+
* is 'raised' by being returned; sendMessage is 'sent' or 'failed' (the
|
|
6
|
+
* capture is committed either way — effects never roll it back). Replays
|
|
7
|
+
* carry the stored effects without statuses: effects are at-most-once and
|
|
8
|
+
* ran (if ever) on the original request.
|
|
9
|
+
*/
|
|
10
|
+
export declare type SubmissionEffectStatus = 'raised' | 'sent' | 'failed' | 'skipped';
|
|
11
|
+
export interface PostSubmissionResponseEffect extends ISubmissionEffect {
|
|
12
|
+
status?: SubmissionEffectStatus;
|
|
13
|
+
/** The send failure detail when status is 'failed'. */
|
|
14
|
+
error?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface PostSubmissionResponse extends GetSubmissionResponse {
|
|
17
|
+
/** True when this request replayed an already-recorded capture (§3.3 dedupe). */
|
|
18
|
+
replayed: boolean;
|
|
19
|
+
/** Fresh target readiness after recompute; absent when the target has gone. */
|
|
20
|
+
readiness?: GetAssetResponse['readiness'];
|
|
21
|
+
effects?: PostSubmissionResponseEffect[];
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/submissions/post/response.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { ActionAlertLevel, ActionEffectType, ActionTargetEntity } from '../actions/shared';
|
|
2
|
+
import { IEmbeddedEntity } from '../shared';
|
|
3
|
+
import { IFieldValue } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* A value captured for one form field item, as transmitted at submit.
|
|
6
|
+
* Name-keyed (form items name global field definitions); exactly one value
|
|
7
|
+
* slot per entry — a multi-select (CHECKBOXES) sends one entry per selected
|
|
8
|
+
* option, and an unanswered field sends no entry at all.
|
|
9
|
+
*/
|
|
10
|
+
export interface ISubmissionFieldValue {
|
|
11
|
+
name: string;
|
|
12
|
+
valueString?: string;
|
|
13
|
+
valueInteger?: number;
|
|
14
|
+
valueDecimal?: number;
|
|
15
|
+
valueBoolean?: boolean;
|
|
16
|
+
/** DATE wire format: YYYY-MM-DD. */
|
|
17
|
+
valueDate?: string;
|
|
18
|
+
valueDateTime?: Date | string;
|
|
19
|
+
/** Tolerated on input for round-trips; stripped — identity resolves by name. */
|
|
20
|
+
id?: string;
|
|
21
|
+
/** Tolerated on input for round-trips; stripped — re-derived server-side. */
|
|
22
|
+
computed?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/** A captured signature/photo reference (uploaded via B4's presigned POST). */
|
|
25
|
+
export interface ISubmissionAttachment {
|
|
26
|
+
/** Names a capture block of the pinned form version — distinct per row. */
|
|
27
|
+
blockName: string;
|
|
28
|
+
fileId: string;
|
|
29
|
+
contentType: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A write-back audit value in stored format: DATE as a YYYYMMDD integer,
|
|
33
|
+
* DATETIME as a Date, CHECKBOXES as the full option array.
|
|
34
|
+
*/
|
|
35
|
+
export declare type SubmissionWriteBackValue = string | number | boolean | string[];
|
|
36
|
+
/** One write-back row's outcome — applied with values, or skipped with why. */
|
|
37
|
+
export interface ISubmissionWriteBackAudit {
|
|
38
|
+
to: string;
|
|
39
|
+
appliedValue?: SubmissionWriteBackValue;
|
|
40
|
+
/** The asset-level value the write replaced; absent when the field had none. */
|
|
41
|
+
previousValue?: SubmissionWriteBackValue;
|
|
42
|
+
/** Present on expression rows — the formula that produced the value. */
|
|
43
|
+
expression?: string;
|
|
44
|
+
skipped?: true;
|
|
45
|
+
reason?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* One effect outcome as stored on the event (§4.2): resolved content for an
|
|
49
|
+
* effect that ran — messages interpolated over the submit env — or a skip
|
|
50
|
+
* audit when the action's write authority was gone (§3.2). Delivery status
|
|
51
|
+
* never persists: the event commits before effects run (see the POST
|
|
52
|
+
* response's status overlay).
|
|
53
|
+
*/
|
|
54
|
+
export interface ISubmissionEffect {
|
|
55
|
+
type: ActionEffectType;
|
|
56
|
+
/** raiseAlert severity. */
|
|
57
|
+
level?: ActionAlertLevel;
|
|
58
|
+
/** Resolved message (missing references render as "(not set)"). */
|
|
59
|
+
message?: string;
|
|
60
|
+
/** sendMessage recipients. */
|
|
61
|
+
to?: string[];
|
|
62
|
+
/** sendMessage resolved subject. */
|
|
63
|
+
subject?: string;
|
|
64
|
+
skipped?: true;
|
|
65
|
+
reason?: string;
|
|
66
|
+
}
|
|
67
|
+
export interface ISubmissionContext {
|
|
68
|
+
entity: ActionTargetEntity;
|
|
69
|
+
entityId: string;
|
|
70
|
+
/** The asset's type at submit — never present on location runs (§4.4). */
|
|
71
|
+
typeId?: string;
|
|
72
|
+
/** The asset's type path at submit — never present on location runs (§4.4). */
|
|
73
|
+
typePath?: string;
|
|
74
|
+
}
|
|
75
|
+
/** The asset a submission ran against — identity plus its type path, both
|
|
76
|
+
* frozen at submit (later type renames never rewrite event history). */
|
|
77
|
+
export interface ISubmissionAssetEmbed extends IEmbeddedEntity {
|
|
78
|
+
typePath?: string;
|
|
79
|
+
}
|
|
80
|
+
/** Overlay from an appended FormSubmissionVoided event. */
|
|
81
|
+
export interface ISubmissionVoided {
|
|
82
|
+
eventId: string;
|
|
83
|
+
timestamp: number;
|
|
84
|
+
user: IEmbeddedEntity;
|
|
85
|
+
reason?: string;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The submission payload as stored on the FormSubmitted event — everything
|
|
89
|
+
* below the event envelope. Shared by the submission resource and the
|
|
90
|
+
* events-feed member.
|
|
91
|
+
*/
|
|
92
|
+
export interface ISubmissionPayload {
|
|
93
|
+
/** Client-minted idempotency key (ULID). */
|
|
94
|
+
clientReference: string;
|
|
95
|
+
/** Server-computed canonical hash of the capture (excludes attachment fileIds). */
|
|
96
|
+
fingerprint: string;
|
|
97
|
+
/** Absent when the action had been deleted by the time the capture drained. */
|
|
98
|
+
actionId?: string;
|
|
99
|
+
actionName: string;
|
|
100
|
+
actionLabel?: string;
|
|
101
|
+
formId: string;
|
|
102
|
+
formName: string;
|
|
103
|
+
formVersion: number;
|
|
104
|
+
/** Display label from the action's `event` config. */
|
|
105
|
+
eventLabel?: string;
|
|
106
|
+
context: ISubmissionContext;
|
|
107
|
+
/** Client fill time (ISO) — differs from the event timestamp under offline drain. */
|
|
108
|
+
capturedAt: string;
|
|
109
|
+
fieldValues: IFieldValue[];
|
|
110
|
+
attachments?: ISubmissionAttachment[];
|
|
111
|
+
writeBack?: ISubmissionWriteBackAudit[];
|
|
112
|
+
effects?: ISubmissionEffect[];
|
|
113
|
+
}
|
|
114
|
+
/** The payload of a FormSubmissionVoided event. */
|
|
115
|
+
export interface ISubmissionVoidPayload {
|
|
116
|
+
/** The FormSubmitted event id this void applies to. */
|
|
117
|
+
original: string;
|
|
118
|
+
actionName: string;
|
|
119
|
+
actionLabel?: string;
|
|
120
|
+
formName: string;
|
|
121
|
+
formVersion: number;
|
|
122
|
+
reason?: string;
|
|
123
|
+
}
|
|
124
|
+
/** The submission resource — a parsed FormSubmitted event. Exactly one of
|
|
125
|
+
* `asset`/`location` is present, matching the run's target entity. */
|
|
126
|
+
export interface GetSubmissionResponse extends ISubmissionPayload {
|
|
127
|
+
id: string;
|
|
128
|
+
timestamp: number;
|
|
129
|
+
asset?: ISubmissionAssetEmbed;
|
|
130
|
+
location?: IEmbeddedEntity;
|
|
131
|
+
user: IEmbeddedEntity;
|
|
132
|
+
voided?: ISubmissionVoided;
|
|
133
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/submissions/shared.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** GET /submissions/uploads/{fileId} — path parameters. */
|
|
2
|
+
export interface SubmissionUploadPath {
|
|
3
|
+
fileId: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* A short-lived presigned download for a committed object under the caller's
|
|
7
|
+
* own org — the key derives from the authenticated org, never from input.
|
|
8
|
+
*/
|
|
9
|
+
export interface GetSubmissionUploadResponse {
|
|
10
|
+
url: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../src/submissions/uploads/[fileId]/get.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './get';
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./get"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/submissions/uploads/[fileId]/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAqB"}
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
import { GetFieldResponse } from '../../fields/[id]/get';
|
|
2
2
|
import { IFieldBindingDelta } from '../../fields';
|
|
3
|
-
import { IEmbeddedEntity, IReadinessRule, IReadinessRuleAll } from '../../shared';
|
|
3
|
+
import { IActionAttachment, IActionAttachmentAll, IEmbeddedEntity, IReadinessRule, IReadinessRuleAll } from '../../shared';
|
|
4
4
|
export interface IFieldValue {
|
|
5
5
|
id: string;
|
|
6
6
|
name: string;
|
|
@@ -49,4 +49,6 @@ export interface GetTypeResponse {
|
|
|
49
49
|
typeKit?: boolean;
|
|
50
50
|
readinessRules?: IReadinessRule[];
|
|
51
51
|
readinessRulesAll?: IReadinessRuleAll[];
|
|
52
|
+
actions?: IActionAttachment[];
|
|
53
|
+
actionsAll?: IActionAttachmentAll[];
|
|
52
54
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IEmbeddedEntityWithIdOrName, IFieldBinding, IFieldValueWithConstraints } from '../../post';
|
|
2
|
-
import { IReadinessRule, IReadinessRuleAll } from '../../../shared';
|
|
2
|
+
import { IActionAttachment, IActionAttachmentAll, IReadinessRule, IReadinessRuleAll } from '../../../shared';
|
|
3
3
|
export interface UpdateTypeRequest {
|
|
4
4
|
name?: string;
|
|
5
5
|
parent?: string;
|
|
@@ -21,4 +21,7 @@ export interface UpdateTypeRequest {
|
|
|
21
21
|
* parent (prepareUpdate), so it never affects what is stored.
|
|
22
22
|
*/
|
|
23
23
|
readinessRulesAll?: IReadinessRuleAll[];
|
|
24
|
+
actions?: IActionAttachment[];
|
|
25
|
+
/** Server-derived like `readinessRulesAll`: tolerated on input, stripped. */
|
|
26
|
+
actionsAll?: IActionAttachmentAll[];
|
|
24
27
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IReadinessRule } from '../../shared';
|
|
1
|
+
import { IActionAttachment, IReadinessRule } from '../../shared';
|
|
2
2
|
import { IFieldBindingDelta } from '../../fields';
|
|
3
3
|
export declare type IEmbeddedEntityWithIdOrName = {
|
|
4
4
|
id: string;
|
|
@@ -91,6 +91,7 @@ export interface PostTypeRequest {
|
|
|
91
91
|
/** Assets of this type are kits (containers) — G2G M2. */
|
|
92
92
|
typeKit?: boolean;
|
|
93
93
|
readinessRules?: IReadinessRule[];
|
|
94
|
+
actions?: IActionAttachment[];
|
|
94
95
|
}
|
|
95
96
|
export declare type PostTypesRequest = PostTypeRequest[];
|
|
96
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/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.12",
|
|
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": "609333e7153afaa63e907e108dfa0fd08df49246"
|
|
22
22
|
}
|