@overmap-ai/core 1.0.63-form-submission-fix.4 → 1.0.63-org-projs-only.1
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 +117 -169
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +117 -169
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/services/FormService.d.ts +11 -15
- package/dist/sdk/services/FormSubmissionService.d.ts +5 -8
- package/dist/typings/models/attachments.d.ts +8 -5
- package/dist/typings/models/base.d.ts +1 -2
- package/dist/typings/models/forms.d.ts +3 -3
- package/dist/typings/models/license.d.ts +2 -2
- package/dist/typings/models/projects.d.ts +2 -4
- package/package.json +1 -1
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
import { Form, FormRevision,
|
|
2
|
-
import {
|
|
1
|
+
import { Form, FormRevision, FormRevisionPayload, ISerializedField } from '../../typings/models/forms';
|
|
2
|
+
import { OptimisticModelResult } from "../typings";
|
|
3
|
+
import { Created, OvermapRootState, Submitted } from "../../typings";
|
|
4
|
+
import { BaseApiService } from "./BaseApiService";
|
|
3
5
|
import type { BaseSDK } from "../base";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
private bulkAddRevisionAttachments;
|
|
6
|
+
export declare abstract class FormService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
|
|
7
|
+
private getAttachImagePromises;
|
|
7
8
|
private add;
|
|
8
|
-
addForOrganization(organizationId: number, initialRevision: FormRevisionPayload): Promise<[
|
|
9
|
-
addForProject(projectId: number, initialRevision: FormRevisionPayload): Promise<[
|
|
10
|
-
addForIssueType(issueTypeId: string, initialRevision: FormRevisionPayload): Promise<[
|
|
11
|
-
addForAssetType(assetTypeId: string, initialRevision: FormRevisionPayload): Promise<[
|
|
12
|
-
createRevision(formId: string, revision: FormRevisionPayload): Promise<
|
|
13
|
-
Stored<FormRevision>,
|
|
14
|
-
Stored<FormRevisionAttachment>[],
|
|
15
|
-
Promise<Created<FormRevision>>,
|
|
16
|
-
Promise<Created<FormRevisionAttachment>[]>
|
|
17
|
-
]>;
|
|
9
|
+
addForOrganization(organizationId: number, initialRevision: FormRevisionPayload): Promise<[Submitted<Form>, Submitted<FormRevision<ISerializedField>>, Promise<Created<FormRevision<ISerializedField>>>, Promise<Created<FormRevision<ISerializedField>>>]>;
|
|
10
|
+
addForProject(projectId: number, initialRevision: FormRevisionPayload): Promise<[Submitted<Form>, Submitted<FormRevision<ISerializedField>>, Promise<Created<FormRevision<ISerializedField>>>, Promise<Created<FormRevision<ISerializedField>>>]>;
|
|
11
|
+
addForIssueType(issueTypeId: string, initialRevision: FormRevisionPayload): Promise<[Submitted<Form>, Submitted<FormRevision<ISerializedField>>, Promise<Created<FormRevision<ISerializedField>>>, Promise<Created<FormRevision<ISerializedField>>>]>;
|
|
12
|
+
addForAssetType(assetTypeId: string, initialRevision: FormRevisionPayload): Promise<[Submitted<Form>, Submitted<FormRevision<ISerializedField>>, Promise<Created<FormRevision<ISerializedField>>>, Promise<Created<FormRevision<ISerializedField>>>]>;
|
|
13
|
+
createRevision(formId: string, revision: FormRevisionPayload): Promise<OptimisticModelResult<FormRevision>>;
|
|
18
14
|
favorite(formId: string): Promise<undefined>;
|
|
19
15
|
unfavorite(formId: string): Promise<undefined>;
|
|
20
16
|
delete(formId: string): Promise<undefined>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { Offline } from '../../typings/models/base';
|
|
1
2
|
import { FieldValue, FormSubmission, FormSubmissionAttachment, FormSubmissionPayload } from '../../typings/models/forms';
|
|
2
|
-
import { PresignedUrlsResponse } from "../typings";
|
|
3
|
+
import { OptimisticModelResult, PresignedUrlsResponse } from "../typings";
|
|
3
4
|
import { Created, OvermapRootState, Stored } from "../../typings";
|
|
4
5
|
import type { BaseSDK } from "../base";
|
|
5
6
|
import { BaseUploadService } from "./BaseUploadService";
|
|
@@ -9,18 +10,14 @@ interface BulkAddRequestReturnValue {
|
|
|
9
10
|
presigned_urls: PresignedUrlsResponse;
|
|
10
11
|
}
|
|
11
12
|
export declare abstract class FormSubmissionService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseUploadService<TState, TSDK> {
|
|
12
|
-
private
|
|
13
|
-
add(payload: FormSubmissionPayload):
|
|
14
|
-
Stored<FormSubmission>,
|
|
15
|
-
Stored<FormSubmissionAttachment>[],
|
|
16
|
-
Promise<Created<FormSubmission>>,
|
|
17
|
-
Promise<Created<FormSubmissionAttachment>[]>
|
|
18
|
-
]>;
|
|
13
|
+
private getAttachFilesPromises;
|
|
14
|
+
add(payload: Offline<FormSubmissionPayload>): OptimisticModelResult<FormSubmission>;
|
|
19
15
|
bulkAdd(args: {
|
|
20
16
|
formRevision: string;
|
|
21
17
|
commonFieldValues: Record<string, FieldValue>;
|
|
22
18
|
fieldValuesByAsset: Record<string, Record<string, FieldValue>>;
|
|
23
19
|
}, batchSize: number): Promise<Promise<BulkAddRequestReturnValue>[]>;
|
|
20
|
+
update(submission: Stored<FormSubmission>): OptimisticModelResult<FormSubmission>;
|
|
24
21
|
delete(submissionId: string): Promise<undefined>;
|
|
25
22
|
refreshStore(projectId: number): Promise<void>;
|
|
26
23
|
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { CreatedByModel, OfflineModel
|
|
2
|
-
import { FileModel, FileWithNameModel
|
|
3
|
-
|
|
1
|
+
import { CreatedByModel, OfflineModel } from "./base";
|
|
2
|
+
import { MaybeObjectURL, FileModel, FileWithNameModel } from "../files";
|
|
3
|
+
import { Project } from "./projects";
|
|
4
|
+
import { Document } from "./documents";
|
|
5
|
+
export interface Attachment extends OfflineModel, FileWithNameModel, CreatedByModel {
|
|
4
6
|
description?: string;
|
|
5
7
|
file_type: string;
|
|
8
|
+
submitted_at: string;
|
|
6
9
|
}
|
|
7
10
|
export interface IssueAttachment extends Attachment {
|
|
8
11
|
issue: string;
|
|
@@ -14,10 +17,10 @@ export interface AssetTypeAttachment extends Attachment {
|
|
|
14
17
|
asset_type: string;
|
|
15
18
|
}
|
|
16
19
|
export interface ProjectAttachment extends Attachment {
|
|
17
|
-
project:
|
|
20
|
+
project: Project["id"];
|
|
18
21
|
}
|
|
19
22
|
export interface DocumentAttachment extends Attachment {
|
|
20
|
-
document:
|
|
23
|
+
document: Document["offline_id"];
|
|
21
24
|
}
|
|
22
25
|
export declare enum AttachmentModel {
|
|
23
26
|
Issue = "issue",
|
|
@@ -30,8 +30,7 @@ export interface OptionalFileModel {
|
|
|
30
30
|
file?: string | null;
|
|
31
31
|
objectURL?: string;
|
|
32
32
|
}
|
|
33
|
-
export interface
|
|
34
|
-
user_owner: number;
|
|
33
|
+
export interface OwnedByOrganization {
|
|
35
34
|
organization_owner: number;
|
|
36
35
|
}
|
|
37
36
|
export interface SubmittedAtModel {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTMLInputTypeAttribute } from "react";
|
|
2
2
|
import { CreatedByModel, OfflineModel, Payload, SubmittedAtModel } from "./base";
|
|
3
|
-
import {
|
|
3
|
+
import { FileWithNameModel } from '../files';
|
|
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 OfflineModel, FileWithNameModel {
|
|
125
125
|
submission: string;
|
|
126
126
|
field_identifier: string;
|
|
127
127
|
}
|
|
128
|
-
export interface FormRevisionAttachment extends
|
|
128
|
+
export interface FormRevisionAttachment extends OfflineModel, FileWithNameModel {
|
|
129
129
|
revision: string;
|
|
130
130
|
field_identifier: string;
|
|
131
131
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OfflineModel,
|
|
1
|
+
import { OfflineModel, OwnedByOrganization } from "./base";
|
|
2
2
|
export declare enum PaddleCheckoutEvent {
|
|
3
3
|
COMPLETED = "checkout.completed",
|
|
4
4
|
CLOSED = "checkout.closed"
|
|
@@ -16,7 +16,7 @@ export declare enum LicenseStatus {
|
|
|
16
16
|
export interface Transaction {
|
|
17
17
|
id: string;
|
|
18
18
|
}
|
|
19
|
-
export interface License extends OfflineModel,
|
|
19
|
+
export interface License extends OfflineModel, OwnedByOrganization {
|
|
20
20
|
project: number | null;
|
|
21
21
|
level: LicenseLevel;
|
|
22
22
|
status: LicenseStatus;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { Model, OfflineModel } from "./base";
|
|
1
|
+
import { Model, OfflineModel, OwnedByOrganization } from "./base";
|
|
2
2
|
import { FileWithNameModel } from "../files";
|
|
3
3
|
import { BoundableModel, CanvasBoundableModel } from "./geo";
|
|
4
|
-
export interface Project extends Model, BoundableModel, CanvasBoundableModel {
|
|
4
|
+
export interface Project extends Model, BoundableModel, CanvasBoundableModel, OwnedByOrganization {
|
|
5
5
|
id: number;
|
|
6
6
|
name: string;
|
|
7
|
-
organization_owner: number | null;
|
|
8
|
-
user_owner: number | null;
|
|
9
7
|
invited?: boolean;
|
|
10
8
|
issues_count?: number;
|
|
11
9
|
form_submissions_count?: number;
|
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-
|
|
6
|
+
"version": "1.0.63-org-projs-only.1",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/overmap-core.umd.cjs",
|
|
9
9
|
"module": "dist/overmap-core.js",
|