@overmap-ai/core 1.0.63-form-submission-fix.0 → 1.0.63-form-submission-fix.2
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/overmap-core.js +133 -103
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +133 -103
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/services/FormService.d.ts +15 -11
- package/dist/sdk/services/FormSubmissionService.d.ts +8 -4
- package/dist/typings/models/attachments.d.ts +5 -8
- package/dist/typings/models/forms.d.ts +3 -3
- package/package.json +1 -1
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import { Form, FormRevision, FormRevisionPayload, ISerializedField } from '../../typings/models/forms';
|
|
2
|
-
import {
|
|
3
|
-
import { Created, OvermapRootState, Submitted } from "../../typings";
|
|
4
|
-
import { BaseApiService } from "./BaseApiService";
|
|
1
|
+
import { Form, FormRevision, FormRevisionAttachment, FormRevisionPayload, ISerializedField } from '../../typings/models/forms';
|
|
2
|
+
import { Created, OvermapRootState, Stored } from "../../typings";
|
|
5
3
|
import type { BaseSDK } from "../base";
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import { BaseUploadService } from "./BaseUploadService";
|
|
5
|
+
export declare abstract class FormService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseUploadService<TState, TSDK> {
|
|
6
|
+
private bulkAddRevisionAttachments;
|
|
8
7
|
private add;
|
|
9
|
-
addForOrganization(organizationId: number, initialRevision: FormRevisionPayload): Promise<[
|
|
10
|
-
addForProject(projectId: number, initialRevision: FormRevisionPayload): Promise<[
|
|
11
|
-
addForIssueType(issueTypeId: string, initialRevision: FormRevisionPayload): Promise<[
|
|
12
|
-
addForAssetType(assetTypeId: string, initialRevision: FormRevisionPayload): Promise<[
|
|
13
|
-
createRevision(formId: string, revision: FormRevisionPayload): Promise<
|
|
8
|
+
addForOrganization(organizationId: number, initialRevision: FormRevisionPayload): Promise<[Stored<Form>, Stored<FormRevision<ISerializedField>>, Stored<FormRevisionAttachment>[], Promise<Created<FormRevision<ISerializedField>>>, Promise<Created<FormRevisionAttachment>[]>]>;
|
|
9
|
+
addForProject(projectId: number, initialRevision: FormRevisionPayload): Promise<[Stored<Form>, Stored<FormRevision<ISerializedField>>, Stored<FormRevisionAttachment>[], Promise<Created<FormRevision<ISerializedField>>>, Promise<Created<FormRevisionAttachment>[]>]>;
|
|
10
|
+
addForIssueType(issueTypeId: string, initialRevision: FormRevisionPayload): Promise<[Stored<Form>, Stored<FormRevision<ISerializedField>>, Stored<FormRevisionAttachment>[], Promise<Created<FormRevision<ISerializedField>>>, Promise<Created<FormRevisionAttachment>[]>]>;
|
|
11
|
+
addForAssetType(assetTypeId: string, initialRevision: FormRevisionPayload): Promise<[Stored<Form>, Stored<FormRevision<ISerializedField>>, Stored<FormRevisionAttachment>[], Promise<Created<FormRevision<ISerializedField>>>, Promise<Created<FormRevisionAttachment>[]>]>;
|
|
12
|
+
createRevision(formId: string, revision: FormRevisionPayload): Promise<[
|
|
13
|
+
Stored<FormRevision>,
|
|
14
|
+
Stored<FormRevisionAttachment>[],
|
|
15
|
+
Promise<Created<FormRevision>>,
|
|
16
|
+
Promise<Created<FormRevisionAttachment>[]>
|
|
17
|
+
]>;
|
|
14
18
|
favorite(formId: string): Promise<undefined>;
|
|
15
19
|
unfavorite(formId: string): Promise<undefined>;
|
|
16
20
|
delete(formId: string): Promise<undefined>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FieldValue, FormSubmission, FormSubmissionAttachment, FormSubmissionPayload } from '../../typings/models/forms';
|
|
2
|
-
import {
|
|
2
|
+
import { PresignedUrlsResponse } from "../typings";
|
|
3
3
|
import { Created, OvermapRootState, Stored } from "../../typings";
|
|
4
4
|
import type { BaseSDK } from "../base";
|
|
5
5
|
import { BaseUploadService } from "./BaseUploadService";
|
|
@@ -9,14 +9,18 @@ interface BulkAddRequestReturnValue {
|
|
|
9
9
|
presigned_urls: PresignedUrlsResponse;
|
|
10
10
|
}
|
|
11
11
|
export declare abstract class FormSubmissionService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseUploadService<TState, TSDK> {
|
|
12
|
-
private
|
|
13
|
-
add(payload: FormSubmissionPayload):
|
|
12
|
+
private bulkAddSubmissionAttachments;
|
|
13
|
+
add(payload: FormSubmissionPayload): Promise<[
|
|
14
|
+
Stored<FormSubmission>,
|
|
15
|
+
Stored<FormSubmissionAttachment>[],
|
|
16
|
+
Promise<Created<FormSubmission>>,
|
|
17
|
+
Promise<Created<FormSubmissionAttachment>[]>
|
|
18
|
+
]>;
|
|
14
19
|
bulkAdd(args: {
|
|
15
20
|
formRevision: string;
|
|
16
21
|
commonFieldValues: Record<string, FieldValue>;
|
|
17
22
|
fieldValuesByAsset: Record<string, Record<string, FieldValue>>;
|
|
18
23
|
}, batchSize: number): Promise<Promise<BulkAddRequestReturnValue>[]>;
|
|
19
|
-
update(submission: Stored<FormSubmission>): OptimisticModelResult<FormSubmission>;
|
|
20
24
|
delete(submissionId: string): Promise<undefined>;
|
|
21
25
|
refreshStore(projectId: number): Promise<void>;
|
|
22
26
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { CreatedByModel, OfflineModel } from "./base";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { Document } from "./documents";
|
|
5
|
-
export interface Attachment extends OfflineModel, FileWithNameModel, CreatedByModel {
|
|
1
|
+
import { CreatedByModel, OfflineModel, SubmittedAtModel } from "./base";
|
|
2
|
+
import { FileModel, FileWithNameModel, MaybeObjectURL } from "../files";
|
|
3
|
+
export interface Attachment extends OfflineModel, SubmittedAtModel, FileWithNameModel, CreatedByModel {
|
|
6
4
|
description?: string;
|
|
7
5
|
file_type: string;
|
|
8
|
-
submitted_at: string;
|
|
9
6
|
}
|
|
10
7
|
export interface IssueAttachment extends Attachment {
|
|
11
8
|
issue: string;
|
|
@@ -17,10 +14,10 @@ export interface AssetTypeAttachment extends Attachment {
|
|
|
17
14
|
asset_type: string;
|
|
18
15
|
}
|
|
19
16
|
export interface ProjectAttachment extends Attachment {
|
|
20
|
-
project:
|
|
17
|
+
project: number;
|
|
21
18
|
}
|
|
22
19
|
export interface DocumentAttachment extends Attachment {
|
|
23
|
-
document:
|
|
20
|
+
document: string;
|
|
24
21
|
}
|
|
25
22
|
export declare enum AttachmentModel {
|
|
26
23
|
Issue = "issue",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTMLInputTypeAttribute } from "react";
|
|
2
2
|
import { CreatedByModel, OfflineModel, Payload, SubmittedAtModel } from "./base";
|
|
3
|
-
import {
|
|
3
|
+
import { Attachment } from "./attachments";
|
|
4
4
|
export interface BaseSerializedField<TIdentifier extends FieldTypeIdentifier = FieldTypeIdentifier> extends BaseSerializedObject<TIdentifier> {
|
|
5
5
|
label: string;
|
|
6
6
|
required: boolean;
|
|
@@ -121,11 +121,11 @@ export interface FormSubmission extends OfflineModel, SubmittedAtModel, CreatedB
|
|
|
121
121
|
asset?: string;
|
|
122
122
|
asset_stage?: string;
|
|
123
123
|
}
|
|
124
|
-
export interface FormSubmissionAttachment extends
|
|
124
|
+
export interface FormSubmissionAttachment extends Attachment {
|
|
125
125
|
submission: string;
|
|
126
126
|
field_identifier: string;
|
|
127
127
|
}
|
|
128
|
-
export interface FormRevisionAttachment extends
|
|
128
|
+
export interface FormRevisionAttachment extends Attachment {
|
|
129
129
|
revision: string;
|
|
130
130
|
field_identifier: string;
|
|
131
131
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Core functionality for Overmap",
|
|
4
4
|
"author": "Wôrdn Inc.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
|
-
"version": "1.0.63-form-submission-fix.
|
|
6
|
+
"version": "1.0.63-form-submission-fix.2",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/overmap-core.umd.cjs",
|
|
9
9
|
"module": "dist/overmap-core.js",
|