@overmap-ai/core 1.0.71-fields.9 → 1.0.71-mapbox.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 +1038 -2009
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +1038 -2009
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/services/AssetAttachmentService.d.ts +8 -32
- package/dist/sdk/services/AssetTypeAttachmentService.d.ts +9 -32
- package/dist/sdk/services/BaseAttachmentService.d.ts +20 -18
- package/dist/sdk/services/BaseUploadService.d.ts +1 -2
- package/dist/sdk/services/DocumentAttachmentService.d.ts +8 -30
- package/dist/sdk/services/FormService.d.ts +14 -11
- package/dist/sdk/services/FormSubmissionService.d.ts +28 -8
- package/dist/sdk/services/IssueAssociationService.d.ts +2 -2
- package/dist/sdk/services/IssueAttachmentService.d.ts +8 -31
- package/dist/sdk/services/IssueService.d.ts +3 -0
- package/dist/sdk/services/ProjectAttachmentService.d.ts +8 -31
- package/dist/sdk/services/index.d.ts +0 -11
- package/dist/store/slices/formRevisionSlice.d.ts +2 -1
- package/dist/store/slices/formSlice.d.ts +5 -1
- package/dist/store/slices/formSubmissionSlice.d.ts +6 -0
- package/dist/store/slices/index.d.ts +0 -8
- package/dist/store/store.d.ts +1 -9
- package/dist/typings/files.d.ts +4 -8
- package/dist/typings/models/assets.d.ts +0 -15
- package/dist/typings/models/attachments.d.ts +6 -1
- package/dist/typings/models/forms.d.ts +27 -12
- package/dist/typings/models/geo.d.ts +3 -3
- package/dist/typings/models/index.d.ts +0 -1
- package/dist/typings/models/issues.d.ts +0 -15
- package/dist/typings/models/store.d.ts +1 -9
- package/dist/utils/coordinates.d.ts +4 -18
- package/dist/utils/file.d.ts +2 -2
- package/dist/utils/utils.d.ts +1 -7
- package/package.json +2 -8
- package/dist/sdk/services/AssetTypeFieldValuesAttachmentService.d.ts +0 -12
- package/dist/sdk/services/AssetTypeFieldValuesService.d.ts +0 -20
- package/dist/sdk/services/AssetTypeFieldsAttachmentService.d.ts +0 -12
- package/dist/sdk/services/AssetTypeFieldsService.d.ts +0 -8
- package/dist/sdk/services/FormRevisionAttachmentService.d.ts +0 -12
- package/dist/sdk/services/FormRevisionService.d.ts +0 -8
- package/dist/sdk/services/FormSubmissionAttachmentService.d.ts +0 -13
- package/dist/sdk/services/IssueTypeFieldValuesAttachmentService.d.ts +0 -13
- package/dist/sdk/services/IssueTypeFieldValuesService.d.ts +0 -10
- package/dist/sdk/services/IssueTypeFieldsAttachmentService.d.ts +0 -12
- package/dist/sdk/services/IssueTypeFieldsService.d.ts +0 -8
- package/dist/store/slices/assetTypeFieldValuesAttachmentSlice.d.ts +0 -52
- package/dist/store/slices/assetTypeFieldValuesSlice.d.ts +0 -53
- package/dist/store/slices/assetTypeFieldsAttachmentSlice.d.ts +0 -52
- package/dist/store/slices/assetTypeFieldsSlice.d.ts +0 -53
- package/dist/store/slices/issueTypeFieldValuesAttachmentSlice.d.ts +0 -52
- package/dist/store/slices/issueTypeFieldValuesSlice.d.ts +0 -52
- package/dist/store/slices/issueTypeFieldsAttachmentSlice.d.ts +0 -52
- package/dist/store/slices/issueTypeFieldsSlice.d.ts +0 -54
- package/dist/typings/models/fields.d.ts +0 -16
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { AssetAttachment,
|
|
1
|
+
import { BaseAttachmentService } from "./BaseAttachmentService";
|
|
2
|
+
import type { AssetAttachment, Stored, OvermapRootState } from "../../typings";
|
|
3
3
|
import type { OptimisticMultipleModelResult } from "../typings";
|
|
4
4
|
import type { BaseSDK } from "../base";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
name: string;
|
|
9
|
-
url: string;
|
|
5
|
+
import { AttachmentModel } from "../../enums";
|
|
6
|
+
export declare abstract class AssetAttachmentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseAttachmentService<TState, TSDK, string, AssetAttachment> {
|
|
7
|
+
attachmentModel: AttachmentModel;
|
|
10
8
|
initializeAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<AssetAttachment>[], "assetAttachments/initializeAssetAttachments">;
|
|
11
9
|
addAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<AssetAttachment>[], "assetAttachments/addAssetAttachments">;
|
|
12
10
|
updateAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<AssetAttachment>[], "assetAttachments/updateAssetAttachments">;
|
|
@@ -14,29 +12,7 @@ export declare abstract class AssetAttachmentService<TState extends OvermapRootS
|
|
|
14
12
|
removeAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "assetAttachments/deleteAssetAttachment">;
|
|
15
13
|
setAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<AssetAttachment>, "assetAttachments/setAssetAttachment">;
|
|
16
14
|
selectAttachment: import('../../typings/store').OvermapSelectorWithArgs<string, Stored<AssetAttachment> | undefined>;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
created_by: number | undefined;
|
|
21
|
-
file_name: string;
|
|
22
|
-
file_type: string;
|
|
23
|
-
submitted_at: string;
|
|
24
|
-
description: string | undefined;
|
|
25
|
-
asset: string;
|
|
26
|
-
}>;
|
|
27
|
-
protected buildAttachmentPayload(data: BuildAttachmentPayloadData<string>): {
|
|
28
|
-
asset: string;
|
|
29
|
-
modelId: string;
|
|
30
|
-
offline_id: string;
|
|
31
|
-
description: string | undefined;
|
|
32
|
-
file_sha1: string;
|
|
33
|
-
file_name: string;
|
|
34
|
-
file_extension: string;
|
|
35
|
-
};
|
|
36
|
-
bulkAdd(payloads: {
|
|
37
|
-
assetId: string;
|
|
38
|
-
file: File;
|
|
39
|
-
}[]): Promise<OptimisticMultipleModelResult<AssetAttachment>>;
|
|
40
|
-
delete(id: string): Promise<void>;
|
|
41
|
-
refreshStore(projectId: number): Promise<void>;
|
|
15
|
+
private buildOfflineAttachment;
|
|
16
|
+
attachFilesToAsset(files: File[], assetId: string): Promise<OptimisticMultipleModelResult<AssetAttachment>>;
|
|
17
|
+
deleteAssetAttachment(attachmentId: string): Promise<void>;
|
|
42
18
|
}
|
|
@@ -1,41 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { AssetTypeAttachment,
|
|
1
|
+
import { BaseAttachmentService } from "./BaseAttachmentService";
|
|
2
|
+
import type { AssetTypeAttachment, Stored, OvermapRootState } from "../../typings";
|
|
3
3
|
import type { OptimisticMultipleModelResult } from "../typings";
|
|
4
4
|
import type { BaseSDK } from "../base";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
url: string;
|
|
5
|
+
import { AttachmentModel } from "../../enums";
|
|
6
|
+
export declare abstract class AssetTypeAttachmentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseAttachmentService<TState, TSDK, string, AssetTypeAttachment> {
|
|
7
|
+
attachmentModel: AttachmentModel;
|
|
8
|
+
initializeAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<AssetTypeAttachment>[], "assetTypeAttachments/initializeAssetTypeAttachments">;
|
|
10
9
|
addAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<AssetTypeAttachment>[], "assetTypeAttachments/addAssetTypeAttachments">;
|
|
11
10
|
updateAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<AssetTypeAttachment>[], "assetTypeAttachments/updateAssetTypeAttachments">;
|
|
12
11
|
removeAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], "assetTypeAttachments/deleteAssetTypeAttachments">;
|
|
13
12
|
removeAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "assetTypeAttachments/deleteAssetTypeAttachment">;
|
|
14
13
|
setAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<AssetTypeAttachment>, "assetTypeAttachments/setAssetTypeAttachment">;
|
|
15
14
|
selectAttachment: import('../../typings/store').OvermapSelectorWithArgs<string, Stored<AssetTypeAttachment> | undefined>;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
created_by: number | undefined;
|
|
20
|
-
file_name: string;
|
|
21
|
-
file_type: string;
|
|
22
|
-
submitted_at: string;
|
|
23
|
-
description: string | undefined;
|
|
24
|
-
asset_type: string;
|
|
25
|
-
}>;
|
|
26
|
-
protected buildAttachmentPayload(data: BuildAttachmentPayloadData<string>): {
|
|
27
|
-
asset_type: string;
|
|
28
|
-
modelId: string;
|
|
29
|
-
offline_id: string;
|
|
30
|
-
description: string | undefined;
|
|
31
|
-
file_sha1: string;
|
|
32
|
-
file_name: string;
|
|
33
|
-
file_extension: string;
|
|
34
|
-
};
|
|
35
|
-
bulkAdd(payloads: {
|
|
36
|
-
assetTypeId: string;
|
|
37
|
-
file: File;
|
|
38
|
-
}[]): Promise<OptimisticMultipleModelResult<AssetTypeAttachment>>;
|
|
39
|
-
delete(attachmentId: string): Promise<void>;
|
|
40
|
-
refreshStore(projectId: number): Promise<void>;
|
|
15
|
+
private buildOfflineAttachment;
|
|
16
|
+
attachFilesToAssetType(files: File[], assetTypeId: string): Promise<OptimisticMultipleModelResult<AssetTypeAttachment>>;
|
|
17
|
+
deleteAssetTypeAttachment(attachmentId: string): Promise<void>;
|
|
41
18
|
}
|
|
@@ -1,37 +1,39 @@
|
|
|
1
1
|
import { ActionCreatorWithPayload } from "@reduxjs/toolkit";
|
|
2
2
|
import type { OptimisticMultipleModelResult } from "../typings";
|
|
3
|
-
import
|
|
3
|
+
import { AttachmentModel } from "../../enums";
|
|
4
|
+
import type { Attachment, OfflineModel, OvermapRootState, OvermapSelectorWithArgs, Stored, Submitted } from "../../typings";
|
|
4
5
|
import type { BaseSDK } from "../base";
|
|
5
6
|
import { BaseUploadService } from "./BaseUploadService";
|
|
6
|
-
export interface AttachmentPayload
|
|
7
|
+
export interface AttachmentPayload {
|
|
7
8
|
offline_id: OfflineModel["offline_id"];
|
|
9
|
+
name: Attachment["file_name"];
|
|
10
|
+
sha1: Attachment["file_sha1"];
|
|
8
11
|
description: Attachment["description"];
|
|
9
12
|
}
|
|
13
|
+
export interface FilePayload {
|
|
14
|
+
sha1: Attachment["file_sha1"];
|
|
15
|
+
file_type: string;
|
|
16
|
+
extension: string;
|
|
17
|
+
size: number;
|
|
18
|
+
}
|
|
10
19
|
export interface BuildOfflineAttachmentData<TModelId> {
|
|
11
20
|
file: File;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
21
|
+
sha1: string;
|
|
22
|
+
submittedAt: string;
|
|
23
|
+
createdBy?: number;
|
|
15
24
|
description?: string;
|
|
16
25
|
modelId: TModelId;
|
|
17
26
|
}
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export declare abstract class BaseAttachmentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>, TModelId extends string | number, TAttachment extends Attachment, TAttachmentPayload extends AttachmentPayload> extends BaseUploadService<TState, TSDK> {
|
|
22
|
-
abstract readonly name: string;
|
|
23
|
-
abstract readonly url: string;
|
|
27
|
+
export declare abstract class BaseAttachmentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>, TModelId extends string | number, TAttachment extends Attachment> extends BaseUploadService<TState, TSDK> {
|
|
28
|
+
abstract readonly attachmentModel: AttachmentModel;
|
|
29
|
+
abstract readonly initializeAttachments: ActionCreatorWithPayload<Submitted<TAttachment>[]>;
|
|
24
30
|
abstract readonly addAttachments: ActionCreatorWithPayload<Submitted<TAttachment>[]>;
|
|
25
31
|
abstract readonly updateAttachments: ActionCreatorWithPayload<Submitted<TAttachment>[]>;
|
|
26
32
|
abstract readonly removeAttachments: ActionCreatorWithPayload<string[]>;
|
|
27
33
|
abstract readonly setAttachment: ActionCreatorWithPayload<Stored<TAttachment>>;
|
|
28
34
|
abstract readonly removeAttachment: ActionCreatorWithPayload<string>;
|
|
29
35
|
abstract readonly selectAttachment: OvermapSelectorWithArgs<string, Stored<TAttachment> | undefined>;
|
|
30
|
-
protected
|
|
31
|
-
protected
|
|
32
|
-
|
|
33
|
-
modelId: TModelId;
|
|
34
|
-
file: File;
|
|
35
|
-
}[]): Promise<OptimisticMultipleModelResult<TAttachment>>;
|
|
36
|
-
_delete(attachmendId: string): Promise<void>;
|
|
36
|
+
protected attachFiles(files: File[], modelId: TModelId, buildOfflineAttachment: (data: BuildOfflineAttachmentData<TModelId>) => Stored<TAttachment>): Promise<OptimisticMultipleModelResult<TAttachment>>;
|
|
37
|
+
protected deleteAttachment(attachmendId: string): Promise<void>;
|
|
38
|
+
refreshStore(projectId: number, _organizationId?: number): Promise<void>;
|
|
37
39
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { BaseApiService } from "./BaseApiService";
|
|
2
2
|
import type { PresignedUrlsResponse } from "../typings";
|
|
3
|
-
import type {
|
|
3
|
+
import type { OvermapRootState } from "../../typings";
|
|
4
4
|
import type { BaseSDK } from "../base";
|
|
5
5
|
export declare abstract class BaseUploadService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
|
|
6
6
|
protected getNumberOfAttachmentsWithSha1(sha1: string): number;
|
|
7
7
|
protected processPresignedUrls(presignedUrls: PresignedUrlsResponse): Record<string, Promise<undefined>>;
|
|
8
|
-
protected getFilePayload(file: File): Promise<FilePayload>;
|
|
9
8
|
}
|
|
@@ -1,42 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseAttachmentService } from "./BaseAttachmentService";
|
|
2
2
|
import type { DocumentAttachment, OvermapRootState, Stored } from "../../typings";
|
|
3
3
|
import type { OptimisticMultipleModelResult } from "../typings";
|
|
4
4
|
import type { BaseSDK } from "../base";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
url: string;
|
|
5
|
+
import { AttachmentModel } from "../../enums";
|
|
6
|
+
export declare abstract class DocumentAttachmentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseAttachmentService<TState, TSDK, string, DocumentAttachment> {
|
|
7
|
+
attachmentModel: AttachmentModel;
|
|
8
|
+
initializeAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<DocumentAttachment>[], "documentAttachments/initializeDocumentAttachments">;
|
|
10
9
|
addAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<DocumentAttachment>[], "documentAttachments/addDocumentAttachments">;
|
|
11
10
|
updateAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<DocumentAttachment>[], "documentAttachments/updateDocumentAttachments">;
|
|
12
11
|
removeAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], "documentAttachments/deleteDocumentAttachments">;
|
|
13
12
|
removeAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "documentAttachments/deleteDocumentAttachment">;
|
|
14
13
|
setAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<DocumentAttachment>, "documentAttachments/setDocumentAttachment">;
|
|
15
14
|
selectAttachment: import('../../typings/store').OvermapSelectorWithArgs<string, Stored<DocumentAttachment> | undefined>;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
created_by: number | undefined;
|
|
20
|
-
file_name: string;
|
|
21
|
-
file_type: string;
|
|
22
|
-
submitted_at: string;
|
|
23
|
-
description: string | undefined;
|
|
24
|
-
document: string;
|
|
25
|
-
}>;
|
|
26
|
-
protected buildAttachmentPayload(data: BuildAttachmentPayloadData<string>): {
|
|
27
|
-
document: string;
|
|
28
|
-
modelId: string;
|
|
29
|
-
offline_id: string;
|
|
30
|
-
description: string | undefined;
|
|
31
|
-
file_sha1: string;
|
|
32
|
-
file_name: string;
|
|
33
|
-
file_extension: string;
|
|
34
|
-
};
|
|
35
|
-
bulkAdd(payloads: {
|
|
36
|
-
documentId: string;
|
|
37
|
-
file: File;
|
|
38
|
-
}[]): Promise<OptimisticMultipleModelResult<DocumentAttachment>>;
|
|
39
|
-
delete(id: string): Promise<void>;
|
|
15
|
+
private buildOfflineAttachment;
|
|
16
|
+
attachFilesToDocument(files: File[], documentId: string): Promise<OptimisticMultipleModelResult<DocumentAttachment>>;
|
|
17
|
+
deleteDocumentAttachment(attachmentId: string): Promise<void>;
|
|
40
18
|
private makeReadable;
|
|
41
19
|
refreshStore(projectId: number, organizationId: number): Promise<void>;
|
|
42
20
|
}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Form, FormRevision, FormRevisionAttachment, FormRevisionPayload, OvermapRootState, Stored, Created } from "../../typings";
|
|
2
2
|
import type { BaseSDK } from "../base";
|
|
3
3
|
import { BaseUploadService } from "./BaseUploadService";
|
|
4
4
|
import { ISerializedField } from "@overmap-ai/forms";
|
|
5
|
-
/**
|
|
6
|
-
* Finds and separates image files from form revision fields. The image attribute is deleted from the field objects and
|
|
7
|
-
* is returned separately from the image files as they are stored in a different table.
|
|
8
|
-
*/
|
|
9
|
-
export declare const separateImageFromFields: (fields: ISerializedField[]) => Promise<{
|
|
10
|
-
fields: ISerializedField[];
|
|
11
|
-
images: Record<string, File>;
|
|
12
|
-
}>;
|
|
13
5
|
export declare abstract class FormService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseUploadService<TState, TSDK> {
|
|
14
|
-
|
|
6
|
+
private bulkAddRevisionAttachments;
|
|
7
|
+
private add;
|
|
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
|
+
]>;
|
|
15
18
|
delete(id: string): Promise<undefined>;
|
|
16
|
-
refreshStore(projectId: number
|
|
19
|
+
refreshStore(projectId: number): Promise<void>;
|
|
17
20
|
}
|
|
@@ -1,15 +1,35 @@
|
|
|
1
|
-
import type { FormSubmission, Offline, OvermapRootState, Payload } from "../../typings";
|
|
2
|
-
import type {
|
|
1
|
+
import type { Created, FormSubmission, FormSubmissionAttachment, Offline, OvermapRootState, Payload, Stored } from "../../typings";
|
|
2
|
+
import type { PresignedUrlsResponse } from "../typings";
|
|
3
3
|
import type { BaseSDK } from "../base";
|
|
4
4
|
import { BaseUploadService } from "./BaseUploadService";
|
|
5
5
|
import { FieldValue } from "@overmap-ai/forms";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
interface BulkAddRequestReturnValue {
|
|
7
|
+
submissions: Created<FormSubmission>[];
|
|
8
|
+
attachments: Created<FormSubmissionAttachment>[];
|
|
9
|
+
presigned_urls: PresignedUrlsResponse;
|
|
10
|
+
}
|
|
10
11
|
export declare abstract class FormSubmissionService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseUploadService<TState, TSDK> {
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
private bulkAddSubmissionAttachments;
|
|
13
|
+
private bulkDeleteSubmissionAttachments;
|
|
14
|
+
add(payload: Payload<FormSubmission>): Promise<[
|
|
15
|
+
Stored<FormSubmission>,
|
|
16
|
+
Stored<FormSubmissionAttachment>[],
|
|
17
|
+
Promise<Created<FormSubmission>>,
|
|
18
|
+
Promise<Created<FormSubmissionAttachment>[]>
|
|
19
|
+
]>;
|
|
20
|
+
bulkAdd(args: {
|
|
21
|
+
formRevision: string;
|
|
22
|
+
commonFieldValues: Record<string, FieldValue>;
|
|
23
|
+
fieldValuesByAsset: Record<string, Record<string, FieldValue>>;
|
|
24
|
+
}, batchSize: number): Promise<Promise<BulkAddRequestReturnValue>[]>;
|
|
25
|
+
update(payload: Offline<Partial<Payload<FormSubmission>>>): Promise<[
|
|
26
|
+
Stored<FormSubmission>,
|
|
27
|
+
Stored<FormSubmissionAttachment>[],
|
|
28
|
+
Promise<Created<FormSubmission>>,
|
|
29
|
+
Promise<Created<FormSubmissionAttachment>[]>,
|
|
30
|
+
Promise<void>
|
|
31
|
+
]>;
|
|
13
32
|
delete(id: string): Promise<undefined>;
|
|
14
33
|
refreshStore(projectId: number): Promise<void>;
|
|
15
34
|
}
|
|
35
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { IssueAssociation, OvermapRootState, Payload } from "../../typings";
|
|
2
2
|
import type { OptimisticModelResult } from "../typings";
|
|
3
3
|
import type { BaseSDK } from "../base";
|
|
4
|
-
import {
|
|
5
|
-
export declare abstract class IssueAssociationService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends
|
|
4
|
+
import { BaseUploadService } from "./BaseUploadService";
|
|
5
|
+
export declare abstract class IssueAssociationService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseUploadService<TState, TSDK> {
|
|
6
6
|
add(payload: Payload<IssueAssociation>): OptimisticModelResult<IssueAssociation>;
|
|
7
7
|
delete(id: string): Promise<void>;
|
|
8
8
|
refreshStore(projectId: number): Promise<void>;
|
|
@@ -1,41 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseAttachmentService } from "./BaseAttachmentService";
|
|
2
2
|
import type { OptimisticMultipleModelResult } from "../typings";
|
|
3
3
|
import type { IssueAttachment, OvermapRootState, Stored } from "../../typings";
|
|
4
4
|
import type { BaseSDK } from "../base";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
url: string;
|
|
5
|
+
import { AttachmentModel } from "../../enums";
|
|
6
|
+
export declare abstract class IssueAttachmentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseAttachmentService<TState, TSDK, string, IssueAttachment> {
|
|
7
|
+
attachmentModel: AttachmentModel;
|
|
8
|
+
initializeAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<IssueAttachment>[], "issueAttachments/initializeIssueAttachments">;
|
|
10
9
|
addAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<IssueAttachment>[], "issueAttachments/addIssueAttachments">;
|
|
11
10
|
updateAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<IssueAttachment>[], "issueAttachments/updateIssueAttachments">;
|
|
12
11
|
removeAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], "issueAttachments/deleteIssueAttachments">;
|
|
13
12
|
removeAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "issueAttachments/deleteIssueAttachment">;
|
|
14
13
|
setAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<IssueAttachment>, "issueAttachments/setIssueAttachment">;
|
|
15
14
|
selectAttachment: import('../../typings/store').OvermapSelectorWithArgs<string, Stored<IssueAttachment> | undefined>;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
created_by: number | undefined;
|
|
20
|
-
file_name: string;
|
|
21
|
-
file_type: string;
|
|
22
|
-
submitted_at: string;
|
|
23
|
-
description: string | undefined;
|
|
24
|
-
issue: string;
|
|
25
|
-
}>;
|
|
26
|
-
protected buildAttachmentPayload(data: BuildAttachmentPayloadData<string>): {
|
|
27
|
-
issue: string;
|
|
28
|
-
modelId: string;
|
|
29
|
-
offline_id: string;
|
|
30
|
-
description: string | undefined;
|
|
31
|
-
file_sha1: string;
|
|
32
|
-
file_name: string;
|
|
33
|
-
file_extension: string;
|
|
34
|
-
};
|
|
35
|
-
bulkAdd(payloads: {
|
|
36
|
-
issueId: string;
|
|
37
|
-
file: File;
|
|
38
|
-
}[]): Promise<OptimisticMultipleModelResult<IssueAttachment>>;
|
|
39
|
-
delete(id: string): Promise<void>;
|
|
40
|
-
refreshStore(projectId: number): Promise<void>;
|
|
15
|
+
private buildOfflineAttachment;
|
|
16
|
+
attachFilesToIssue(files: File[], issueId: string): Promise<OptimisticMultipleModelResult<IssueAttachment>>;
|
|
17
|
+
deleteIssueAttachment(attachmentId: string): Promise<void>;
|
|
41
18
|
}
|
|
@@ -2,6 +2,9 @@ import type { OptimisticModelResult } from "../typings";
|
|
|
2
2
|
import type { Issue, Offline, OvermapRootState, Payload } from "../../typings";
|
|
3
3
|
import { BaseApiService } from "./BaseApiService";
|
|
4
4
|
import type { BaseSDK } from "../base";
|
|
5
|
+
/**
|
|
6
|
+
* Handles CRUD operations on issues
|
|
7
|
+
*/
|
|
5
8
|
export declare abstract class IssueService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
|
|
6
9
|
add(payload: Payload<Issue>): OptimisticModelResult<Issue>;
|
|
7
10
|
update(payload: Offline<Partial<Payload<Issue>>>): OptimisticModelResult<Issue>;
|
|
@@ -1,41 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseAttachmentService } from "./BaseAttachmentService";
|
|
2
2
|
import type { OvermapRootState, ProjectAttachment, Stored } from "../../typings";
|
|
3
3
|
import type { OptimisticMultipleModelResult } from "../typings";
|
|
4
4
|
import type { BaseSDK } from "../base";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
url: string;
|
|
5
|
+
import { AttachmentModel } from "../../enums";
|
|
6
|
+
export declare abstract class ProjectAttachmentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseAttachmentService<TState, TSDK, number, ProjectAttachment> {
|
|
7
|
+
attachmentModel: AttachmentModel;
|
|
8
|
+
initializeAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<ProjectAttachment>[], "projectAttachments/initializeProjectAttachments">;
|
|
10
9
|
addAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<ProjectAttachment>[], "projectAttachments/addProjectAttachments">;
|
|
11
10
|
updateAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<ProjectAttachment>[], "projectAttachments/updateProjectAttachments">;
|
|
12
11
|
removeAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], "projectAttachments/deleteProjectAttachments">;
|
|
13
12
|
removeAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "projectAttachments/deleteProjectAttachment">;
|
|
14
13
|
setAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<ProjectAttachment>, "projectAttachments/setProjectAttachment">;
|
|
15
14
|
selectAttachment: import('../../typings/store').OvermapSelectorWithArgs<string, ProjectAttachment | undefined>;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
created_by: number | undefined;
|
|
20
|
-
file_name: string;
|
|
21
|
-
file_type: string;
|
|
22
|
-
submitted_at: string;
|
|
23
|
-
description: string | undefined;
|
|
24
|
-
project: number;
|
|
25
|
-
}>;
|
|
26
|
-
protected buildAttachmentPayload(data: BuildAttachmentPayloadData<number>): {
|
|
27
|
-
project: number;
|
|
28
|
-
modelId: number;
|
|
29
|
-
offline_id: string;
|
|
30
|
-
description: string | undefined;
|
|
31
|
-
file_sha1: string;
|
|
32
|
-
file_name: string;
|
|
33
|
-
file_extension: string;
|
|
34
|
-
};
|
|
35
|
-
bulkAdd(payloads: {
|
|
36
|
-
projectId: number;
|
|
37
|
-
file: File;
|
|
38
|
-
}[]): Promise<OptimisticMultipleModelResult<ProjectAttachment>>;
|
|
39
|
-
delete(attachmentId: string): Promise<void>;
|
|
40
|
-
refreshStore(projectId: number): Promise<void>;
|
|
15
|
+
private buildOfflineAttachment;
|
|
16
|
+
attachFilesToProject(files: File[], projectId: number): Promise<OptimisticMultipleModelResult<ProjectAttachment>>;
|
|
17
|
+
deleteProjectAttachment(attachmentId: string): Promise<void>;
|
|
41
18
|
}
|
|
@@ -32,14 +32,3 @@ export * from "./TeamService";
|
|
|
32
32
|
export * from "./UserService";
|
|
33
33
|
export * from "./GeoImageService";
|
|
34
34
|
export * from "./IssueAssociationService";
|
|
35
|
-
export * from "./FormRevisionAttachmentService";
|
|
36
|
-
export * from "./FormSubmissionAttachmentService";
|
|
37
|
-
export * from "./FormRevisionService";
|
|
38
|
-
export * from "./AssetTypeFieldsAttachmentService";
|
|
39
|
-
export * from "./AssetTypeFieldsService";
|
|
40
|
-
export * from "./AssetTypeFieldValuesService";
|
|
41
|
-
export * from "./AssetTypeFieldValuesAttachmentService";
|
|
42
|
-
export * from "./IssueTypeFieldsAttachmentService";
|
|
43
|
-
export * from "./IssueTypeFieldsService";
|
|
44
|
-
export * from "./IssueTypeFieldValuesAttachmentService";
|
|
45
|
-
export * from "./IssueTypeFieldValuesService";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Reducer } from "@reduxjs/toolkit";
|
|
2
|
-
import type { FormRevision, OvermapRootState, OvermapSelectorWithArgs, Stored } from "../../typings";
|
|
2
|
+
import type { Form, FormRevision, OvermapRootState, OvermapSelector, OvermapSelectorWithArgs, Stored } from "../../typings";
|
|
3
3
|
import type { ModelState } from "../typings";
|
|
4
4
|
export type FormRevisionState = ModelState<Stored<FormRevision>>;
|
|
5
5
|
export declare const formRevisionsSlice: import("@reduxjs/toolkit").Slice<FormRevisionState, {
|
|
@@ -39,4 +39,5 @@ export declare const selectFormRevisionById: OvermapSelectorWithArgs<string, Sto
|
|
|
39
39
|
export declare const _selectLatestFormRevision: (formRevisions: FormRevisionState["instances"], formId: string) => Stored<FormRevision>;
|
|
40
40
|
export declare const selectLatestFormRevisionOfForm: OvermapSelectorWithArgs<string, Stored<FormRevision> | undefined>;
|
|
41
41
|
export declare const selectFormRevisionsOfForm: OvermapSelectorWithArgs<string, Stored<FormRevision>[]>;
|
|
42
|
+
export declare const selectLatestFormRevisionByForm: OvermapSelector<Record<Stored<Form>["offline_id"], Stored<FormRevision>>>;
|
|
42
43
|
export declare const formRevisionReducer: Reducer<FormRevisionState>;
|
|
@@ -43,5 +43,9 @@ export declare const selectForms: ((state: OvermapRootState) => Stored<Form>[])
|
|
|
43
43
|
}> & {
|
|
44
44
|
clearCache: () => void;
|
|
45
45
|
};
|
|
46
|
-
export declare const selectFormById: OvermapSelectorWithArgs<string, Stored<Form> | undefined>;
|
|
47
46
|
export declare const selectFilteredForms: OvermapSelectorWithArgs<FormSearchArgs, Stored<Form>[]>;
|
|
47
|
+
export declare const selectFormById: OvermapSelectorWithArgs<string, Stored<Form> | undefined>;
|
|
48
|
+
export declare const selectFormOfAssetType: OvermapSelectorWithArgs<string, Stored<Form> | undefined>;
|
|
49
|
+
export declare const selectFormOfIssueType: OvermapSelectorWithArgs<string, Stored<Form> | undefined>;
|
|
50
|
+
export declare const selectFormsCount: OvermapSelector<number>;
|
|
51
|
+
export declare const selectGeneralFormCount: OvermapSelector<number>;
|
|
@@ -45,6 +45,12 @@ export declare const selectFormSubmissionsMapping: OvermapSelector<FormSubmissio
|
|
|
45
45
|
export declare const selectFormSubmissions: OvermapSelector<Stored<FormSubmission>[]>;
|
|
46
46
|
export declare const selectFormSubmissionById: OvermapSelectorWithArgs<string, Stored<FormSubmission> | undefined>;
|
|
47
47
|
export declare const selectFormSubmissionsOfForm: OvermapSelectorWithArgs<string, Stored<FormSubmission>[]>;
|
|
48
|
+
export declare const selectFormSubmissionsByFormRevisions: OvermapSelector<Record<string, Stored<FormSubmission>[]>>;
|
|
49
|
+
export declare const selectSortedFormSubmissionsOfForm: OvermapSelectorWithArgs<string, Stored<FormSubmission>[]>;
|
|
48
50
|
export declare const selectFormSubmissionsOfIssue: (args: string) => (state: OvermapRootState) => Stored<FormSubmission>[];
|
|
51
|
+
export declare const selectAttachedFormSubmissionsOfIssue: (args: string) => (state: OvermapRootState) => Stored<FormSubmission>[];
|
|
52
|
+
export declare const selectFormSubmissionsByIssues: OvermapSelectorWithArgs<string[], Record<string, Stored<FormSubmission>[]>>;
|
|
49
53
|
export declare const selectFormSubmissionsOfAsset: (args: string) => (state: OvermapRootState) => Stored<FormSubmission>[];
|
|
54
|
+
export declare const selectAttachedFormSubmissionsOfAsset: (args: string) => (state: OvermapRootState) => Stored<FormSubmission>[];
|
|
55
|
+
export declare const selectFormSubmissionsByAssets: OvermapSelector<Record<string, Stored<FormSubmission>[]>>;
|
|
50
56
|
export declare const formSubmissionReducer: Reducer<FormSubmissionState>;
|
|
@@ -36,11 +36,3 @@ export * from "./issueAttachmentSlice";
|
|
|
36
36
|
export * from "./versioningSlice";
|
|
37
37
|
export * from "./geoImageSlice";
|
|
38
38
|
export * from "./issueAssociationSlice";
|
|
39
|
-
export * from "./issueTypeFieldsSlice";
|
|
40
|
-
export * from "./issueTypeFieldValuesSlice";
|
|
41
|
-
export * from "./issueTypeFieldsAttachmentSlice";
|
|
42
|
-
export * from "./issueTypeFieldValuesAttachmentSlice";
|
|
43
|
-
export * from "./assetTypeFieldsSlice";
|
|
44
|
-
export * from "./assetTypeFieldValuesSlice";
|
|
45
|
-
export * from "./assetTypeFieldsAttachmentSlice";
|
|
46
|
-
export * from "./assetTypeFieldValuesAttachmentSlice";
|
package/dist/store/store.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { Reducer } from "redux";
|
|
|
3
3
|
import { Config, OfflineAction, OfflineMetadata } from "@redux-offline/redux-offline/lib/types";
|
|
4
4
|
import request from "superagent";
|
|
5
5
|
import { type BaseSDK, type OfflineMetaEffect, OutboxCoordinator, RequestDetails } from "../sdk";
|
|
6
|
-
import { AgentsState, AssetAttachmentState, AssetStageCompletionState, AssetStageState, AssetState, AssetTypeAttachmentState,
|
|
6
|
+
import { AgentsState, AssetAttachmentState, AssetStageCompletionState, AssetStageState, AssetState, AssetTypeAttachmentState, AssetTypeState, AuthState, CategoryState, DocumentAttachmentState, DocumentState, EmailDomainState, FileState, FormRevisionAttachmentState, FormRevisionState, FormState, FormSubmissionAttachmentState, FormSubmissionState, GeoImageSliceState, IssueAssociationSliceState, IssueAttachmentState, IssueCommentState, IssueState, IssueTypeState, IssueUpdateState, LicenseState, OrganizationAccessState, OrganizationState, OutboxState, ProjectAccessState, ProjectAttachmentState, ProjectFileState, ProjectState, RehydratedState, TeamState, UserState, VersioningState, WorkspaceState } from "./slices";
|
|
7
7
|
import type { BaseState, OvermapRootState } from "../typings";
|
|
8
8
|
export declare const VERSION_REDUCER_KEY = "versioning";
|
|
9
9
|
export declare const overmapReducers: {
|
|
@@ -45,14 +45,6 @@ export declare const overmapReducers: {
|
|
|
45
45
|
issueAttachmentReducer: Reducer<IssueAttachmentState>;
|
|
46
46
|
geoImageReducer: Reducer<GeoImageSliceState>;
|
|
47
47
|
issueAssociationReducer: Reducer<IssueAssociationSliceState>;
|
|
48
|
-
issueTypeFieldsReducer: Reducer<IssueTypeFieldsState>;
|
|
49
|
-
issueTypeFieldValuesReducer: Reducer<IssueTypeFieldValuesState>;
|
|
50
|
-
issueTypeFieldsAttachmentReducer: Reducer<IssueTypeFieldsAttachmentState>;
|
|
51
|
-
issueTypeFieldValuesAttachmentReducer: Reducer<IssueTypeFieldValuesAttachmentState>;
|
|
52
|
-
assetTypeFieldsReducer: Reducer<AssetTypeFieldsState>;
|
|
53
|
-
assetTypeFieldValuesReducer: Reducer<AssetTypeFieldValuesState>;
|
|
54
|
-
assetTypeFieldsAttachmentReducer: Reducer<AssetTypeFieldsAttachmentState>;
|
|
55
|
-
assetTypeFieldValuesAttachmentReducer: Reducer<AssetTypeFieldValuesAttachmentState>;
|
|
56
48
|
};
|
|
57
49
|
export declare const resetStore = "RESET";
|
|
58
50
|
export declare const overmapRootReducer: Reducer<OvermapRootState>;
|
package/dist/typings/files.d.ts
CHANGED
|
@@ -12,14 +12,10 @@ export type FileModel = MaybeObjectURL<{
|
|
|
12
12
|
export interface FileWithNameModel extends FileModel {
|
|
13
13
|
file_name: string;
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
/** the attributes needed to generate a presigned url for a file that is being attempted to be uploaded */
|
|
16
|
+
export interface FileUploadPayload {
|
|
17
|
+
sha1: string;
|
|
18
18
|
extension: string;
|
|
19
|
+
file_type: string;
|
|
19
20
|
size: number;
|
|
20
21
|
}
|
|
21
|
-
export interface FileModelPayload {
|
|
22
|
-
file_sha1: FileWithNameModel["file_sha1"];
|
|
23
|
-
file_name: FileWithNameModel["file_name"];
|
|
24
|
-
file_extension: string;
|
|
25
|
-
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import type { BaseSerializedObject, ISerializedField } from "@overmap-ai/forms";
|
|
2
1
|
import type { ColorModel, CreatedByModel, IconModel, OfflineModel, SubmittedAtModel, TimestampedModel } from "./base";
|
|
3
2
|
import type { CanvasMarkableModel, MarkableModel } from "./geo";
|
|
4
|
-
import type { FieldsAttachmentModel, FieldsModel, FieldValuesModel } from "./fields";
|
|
5
3
|
export interface Asset extends OfflineModel, TimestampedModel, SubmittedAtModel, CreatedByModel, MarkableModel, CanvasMarkableModel {
|
|
6
4
|
asset_type: string;
|
|
7
5
|
created_at?: string;
|
|
@@ -25,16 +23,3 @@ export interface AssetStageCompletion extends OfflineModel, TimestampedModel, Su
|
|
|
25
23
|
stage: string;
|
|
26
24
|
}
|
|
27
25
|
export type CompletedStagesMapping = Record<string, Record<string, string>>;
|
|
28
|
-
export interface AssetTypeFields<TFields extends BaseSerializedObject = ISerializedField> extends OfflineModel, SubmittedAtModel, TimestampedModel, CreatedByModel, FieldsModel<TFields> {
|
|
29
|
-
asset_type: string;
|
|
30
|
-
}
|
|
31
|
-
export interface AssetTypeFieldsAttachment extends OfflineModel, SubmittedAtModel, TimestampedModel, CreatedByModel, FieldsAttachmentModel {
|
|
32
|
-
fields_revision: string;
|
|
33
|
-
}
|
|
34
|
-
export interface AssetTypeFieldValues extends OfflineModel, SubmittedAtModel, TimestampedModel, CreatedByModel, FieldValuesModel {
|
|
35
|
-
fields_revision: string;
|
|
36
|
-
asset: string;
|
|
37
|
-
}
|
|
38
|
-
export interface AssetTypeFieldValuesAttachment extends OfflineModel, SubmittedAtModel, TimestampedModel, CreatedByModel, FieldsAttachmentModel {
|
|
39
|
-
field_values: string;
|
|
40
|
-
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CreatedByModel, OfflineModel, SubmittedAtModel } from "./base";
|
|
2
|
-
import type { FileModel, FileWithNameModel } from "../files";
|
|
2
|
+
import type { FileModel, FileWithNameModel, MaybeObjectURL } from "../files";
|
|
3
3
|
export interface Attachment extends OfflineModel, SubmittedAtModel, FileWithNameModel, CreatedByModel {
|
|
4
4
|
description?: string;
|
|
5
5
|
file_type: string;
|
|
@@ -19,4 +19,9 @@ export interface ProjectAttachment extends Attachment {
|
|
|
19
19
|
export interface DocumentAttachment extends Attachment {
|
|
20
20
|
document: string;
|
|
21
21
|
}
|
|
22
|
+
/** to get an AttachmentPayload for a specific type, pass in the given AttachmentType
|
|
23
|
+
* ex. AttachmentPayload<IssueAttachment> */
|
|
24
|
+
export type AttachmentPayload<TAttachment> = Omit<TAttachment, "file" | "submitted_at" | "created_by"> & {
|
|
25
|
+
file: MaybeObjectURL<File>;
|
|
26
|
+
};
|
|
22
27
|
export type ProfilePic = FileModel;
|