@overmap-ai/core 1.0.78-gcs.3 → 1.0.78-gcs.4
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 +6607 -6519
- package/dist/overmap-core.umd.cjs +7 -8
- package/dist/sdk/constants.d.ts +1 -1
- package/dist/sdk/services/AssetAttachmentService.d.ts +8 -17
- package/dist/sdk/services/AssetProcedureStepFieldValuesAttachmentService.d.ts +9 -11
- package/dist/sdk/services/AssetProcedureStepFieldsAttachmentService.d.ts +18 -18
- package/dist/sdk/services/AssetProcedureTypeAttachmentService.d.ts +8 -17
- package/dist/sdk/services/AssetProcedureTypeFieldValuesAttachmentService.d.ts +9 -11
- package/dist/sdk/services/AssetProcedureTypeFieldsAttachmentService.d.ts +18 -18
- package/dist/sdk/services/AssetTypeAttachmentService.d.ts +8 -17
- package/dist/sdk/services/AssetTypeFieldValuesAttachmentService.d.ts +9 -8
- package/dist/sdk/services/AssetTypeFieldsAttachmentService.d.ts +9 -9
- package/dist/sdk/services/AssetTypeIdentifierValueService.d.ts +2 -1
- package/dist/sdk/services/BaseOfflineFileModelApiService.d.ts +17 -0
- package/dist/sdk/services/BaseService.d.ts +2 -1
- package/dist/sdk/services/DocumentAttachmentService.d.ts +10 -17
- package/dist/sdk/services/FileService.d.ts +6 -28
- package/dist/sdk/services/FormRevisionAttachmentService.d.ts +18 -18
- package/dist/sdk/services/FormService.d.ts +4 -2
- package/dist/sdk/services/FormSubmissionAttachmentService.d.ts +18 -18
- package/dist/sdk/services/GeoImageService.d.ts +10 -7
- package/dist/sdk/services/IssueAssociationService.d.ts +2 -1
- package/dist/sdk/services/IssueAttachmentService.d.ts +8 -17
- package/dist/sdk/services/IssueCommentAttachmentService.d.ts +8 -17
- package/dist/sdk/services/IssueService.d.ts +1 -0
- package/dist/sdk/services/IssueTypeAttachmentService.d.ts +8 -17
- package/dist/sdk/services/IssueTypeFieldValuesAttachmentService.d.ts +18 -18
- package/dist/sdk/services/IssueTypeFieldsAttachmentService.d.ts +18 -18
- package/dist/sdk/services/ProjectAttachmentService.d.ts +8 -17
- package/dist/sdk/services/ProjectFileService.d.ts +20 -16
- package/dist/sdk/services/index.d.ts +1 -1
- package/dist/sdk/typings.d.ts +12 -4
- package/dist/store/adapters/selectionAdapter.d.ts +9 -10
- package/dist/store/adapters/typings.d.ts +1 -3
- package/dist/store/slices/fileSlice.d.ts +0 -3
- package/dist/store/slices/issueAssociationSlice.d.ts +3 -0
- package/dist/store/slices/projectFileSlice.d.ts +2 -16
- package/dist/typings/files.d.ts +27 -14
- package/dist/typings/models/assets.d.ts +4 -4
- package/dist/typings/models/documents.d.ts +2 -2
- package/dist/typings/models/fields.d.ts +3 -3
- package/dist/typings/models/forms.d.ts +3 -2
- package/dist/typings/models/geoImages.d.ts +3 -3
- package/dist/typings/models/issues.d.ts +4 -4
- package/dist/typings/models/projects.d.ts +3 -3
- package/dist/typings/models/users.d.ts +0 -4
- package/dist/utils/file.d.ts +7 -11
- package/package.json +3 -3
- package/dist/sdk/services/BaseOfflineAttachmentModelService.d.ts +0 -23
package/dist/typings/files.d.ts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { Model } from './models';
|
|
2
|
+
export interface OptionalFileModel extends Model {
|
|
3
|
+
file_url: string | null;
|
|
3
4
|
file_sha1: string | null;
|
|
4
|
-
|
|
5
|
-
export interface OptionalFileWithNameModel extends OptionalFileModel {
|
|
5
|
+
file_extension: string | null;
|
|
6
6
|
file_name: string | null;
|
|
7
7
|
}
|
|
8
|
-
export interface RequiredFileModel {
|
|
9
|
-
|
|
10
|
-
file_sha1:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
file_name: string;
|
|
8
|
+
export interface RequiredFileModel extends Model {
|
|
9
|
+
file_url: NonNullable<OptionalFileModel["file_url"]>;
|
|
10
|
+
file_sha1: NonNullable<OptionalFileModel["file_sha1"]>;
|
|
11
|
+
file_extension: NonNullable<OptionalFileModel["file_extension"]>;
|
|
12
|
+
file_name: NonNullable<OptionalFileModel["file_name"]>;
|
|
14
13
|
file_type: string | null;
|
|
15
14
|
}
|
|
16
15
|
export interface FilePayload {
|
|
@@ -19,8 +18,22 @@ export interface FilePayload {
|
|
|
19
18
|
extension: string;
|
|
20
19
|
size: number;
|
|
21
20
|
}
|
|
22
|
-
export interface
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
export interface GetS3UrlSuccessResponse {
|
|
22
|
+
url: string;
|
|
23
|
+
fields: Record<string, string>;
|
|
24
|
+
}
|
|
25
|
+
export interface GetS3UrlWarningResponse {
|
|
26
|
+
warning: string;
|
|
26
27
|
}
|
|
28
|
+
export type GetS3UrlResponse = GetS3UrlSuccessResponse | GetS3UrlWarningResponse;
|
|
29
|
+
export type PresignedUrlsResponse = Record<string, GetS3UrlSuccessResponse>;
|
|
30
|
+
export type FileAnnotated<T> = T extends {
|
|
31
|
+
file: unknown;
|
|
32
|
+
} ? never : T & {
|
|
33
|
+
file: File;
|
|
34
|
+
};
|
|
35
|
+
export type FilePayloadAnnotated<T> = T extends {
|
|
36
|
+
file: unknown;
|
|
37
|
+
} ? never : T & {
|
|
38
|
+
file: FilePayload;
|
|
39
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SerializedCondition } from '@overmap-ai/forms';
|
|
2
|
-
import {
|
|
2
|
+
import { RequiredFileModel } from '../files';
|
|
3
3
|
import { AbbreviationModel, ColorModel, CreatedByModel, GeometryModel, IconModel, IdentifierModel, IdentifierValueModel, IndexedModel, SubmittedAtModel, TimestampedModel, TreeModel, UUIDModel } from './base';
|
|
4
4
|
import { FieldsAttachmentModel, FieldsModel, FieldValuesModel } from './fields';
|
|
5
5
|
import { Organization } from './organizations';
|
|
@@ -97,13 +97,13 @@ export interface AssetTypeIdentifierValue extends UUIDModel, SubmittedAtModel, T
|
|
|
97
97
|
asset: Asset["uuid"];
|
|
98
98
|
asset_type_identifier: AssetTypeIdentifier["uuid"];
|
|
99
99
|
}
|
|
100
|
-
export interface AssetAttachment extends UUIDModel, TimestampedModel, SubmittedAtModel,
|
|
100
|
+
export interface AssetAttachment extends UUIDModel, TimestampedModel, SubmittedAtModel, RequiredFileModel, CreatedByModel {
|
|
101
101
|
asset: Asset["uuid"];
|
|
102
102
|
}
|
|
103
|
-
export interface AssetTypeAttachment extends UUIDModel, TimestampedModel, SubmittedAtModel,
|
|
103
|
+
export interface AssetTypeAttachment extends UUIDModel, TimestampedModel, SubmittedAtModel, RequiredFileModel, CreatedByModel {
|
|
104
104
|
asset_type: AssetType["uuid"];
|
|
105
105
|
}
|
|
106
|
-
export interface AssetProcedureTypeAttachment extends UUIDModel, TimestampedModel, SubmittedAtModel,
|
|
106
|
+
export interface AssetProcedureTypeAttachment extends UUIDModel, TimestampedModel, SubmittedAtModel, RequiredFileModel, CreatedByModel {
|
|
107
107
|
asset_procedure_type: AssetProcedureType["uuid"];
|
|
108
108
|
}
|
|
109
109
|
export interface AssetTypeStatus extends UUIDModel, SubmittedAtModel, TimestampedModel, ColorModel, CreatedByModel {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RequiredFileModel } from '../files';
|
|
2
2
|
import { ColorModel, CreatedByModel, IconModel, SubmittedAtModel, TimestampedModel, UUIDModel } from './base';
|
|
3
3
|
import { Organization } from './organizations';
|
|
4
4
|
import { Project } from './projects';
|
|
@@ -10,7 +10,7 @@ export interface Document extends UUIDModel, SubmittedAtModel, CreatedByModel, T
|
|
|
10
10
|
project: Project["uuid"] | null;
|
|
11
11
|
organization: Organization["uuid"] | null;
|
|
12
12
|
}
|
|
13
|
-
export interface DocumentAttachment extends UUIDModel, TimestampedModel, SubmittedAtModel,
|
|
13
|
+
export interface DocumentAttachment extends UUIDModel, TimestampedModel, SubmittedAtModel, RequiredFileModel, CreatedByModel {
|
|
14
14
|
document: Document["uuid"];
|
|
15
15
|
}
|
|
16
16
|
export type MovePosition = "left" | "right" | "left-child" | "right-child";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SerializedField, SerializedFieldSection, SerializedFieldValues } from '@overmap-ai/forms';
|
|
2
|
-
import {
|
|
2
|
+
import { RequiredFileModel } from '../files';
|
|
3
3
|
export interface FieldsModel {
|
|
4
4
|
fields: SerializedFieldSection[];
|
|
5
5
|
revision: number;
|
|
@@ -8,9 +8,9 @@ export interface FieldValuesModel {
|
|
|
8
8
|
published_at: string | null;
|
|
9
9
|
values: SerializedFieldValues;
|
|
10
10
|
}
|
|
11
|
-
export interface FieldsAttachmentModel extends
|
|
11
|
+
export interface FieldsAttachmentModel extends RequiredFileModel {
|
|
12
12
|
field_identifier: SerializedField["identifier"];
|
|
13
13
|
}
|
|
14
|
-
export interface FieldValuesAttachmentModel extends
|
|
14
|
+
export interface FieldValuesAttachmentModel extends RequiredFileModel {
|
|
15
15
|
field_identifier: SerializedField["identifier"];
|
|
16
16
|
}
|
|
@@ -3,15 +3,16 @@ import { FieldsAttachmentModel, FieldsModel, FieldValuesAttachmentModel, FieldVa
|
|
|
3
3
|
import { Organization } from './organizations';
|
|
4
4
|
export interface Form extends UUIDModel, TimestampedModel, SubmittedAtModel, CreatedByModel {
|
|
5
5
|
organization: Organization["uuid"];
|
|
6
|
+
name: string;
|
|
7
|
+
description: string | null;
|
|
6
8
|
}
|
|
7
9
|
export interface FormRevision extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel, FieldsModel {
|
|
8
10
|
form: Form["uuid"];
|
|
9
|
-
title: string;
|
|
10
|
-
description: string | null;
|
|
11
11
|
}
|
|
12
12
|
export type FormRevisionPayload = Omit<Payload<FormRevision>, "revision">;
|
|
13
13
|
export interface FormSubmission extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel, FieldValuesModel, IndexedModel {
|
|
14
14
|
form_revision: FormRevision["uuid"];
|
|
15
|
+
form: Form["uuid"];
|
|
15
16
|
}
|
|
16
17
|
export interface FormSubmissionAttachment extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel, FieldValuesAttachmentModel {
|
|
17
18
|
form_submission: FormSubmission["uuid"];
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RequiredFileModel } from '../files';
|
|
2
2
|
import { CanvasMarkableModel, CreatedByModel, IndexedModel, MarkableModel, Payload, SubmittedAtModel, TimestampedModel, UUIDModel } from './base';
|
|
3
3
|
import { Project } from './projects';
|
|
4
|
-
export interface GeoImage extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel, MarkableModel, CanvasMarkableModel,
|
|
4
|
+
export interface GeoImage extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel, MarkableModel, CanvasMarkableModel, RequiredFileModel, IndexedModel {
|
|
5
5
|
title: string | null;
|
|
6
6
|
description: string | null;
|
|
7
7
|
project: Project["uuid"];
|
|
8
8
|
direction: number | null;
|
|
9
9
|
original_date: string | null;
|
|
10
10
|
}
|
|
11
|
-
export type GeoImagePayload = Omit<Payload<GeoImage>, "file_name" | "file_sha1" | "
|
|
11
|
+
export type GeoImagePayload = Omit<Payload<GeoImage>, "file_name" | "file_sha1" | "file_url" | "file_type" | "file_extension"> & {
|
|
12
12
|
file: File;
|
|
13
13
|
};
|
|
14
14
|
export type BulkGeoImagePayload = Omit<GeoImagePayload, "project">;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RequiredFileModel } from '../files';
|
|
2
2
|
import { Asset } from './assets';
|
|
3
3
|
import { AbbreviationModel, CanvasMarkableModel, ColorModel, CreatedByModel, IconModel, IdentifierModel, IdentifierValueModel, IndexedModel, MarkableModel, SubmittedAtModel, TimestampedModel, UUIDModel } from './base';
|
|
4
4
|
import { FieldsAttachmentModel, FieldsModel, FieldValuesModel } from './fields';
|
|
@@ -71,13 +71,13 @@ export interface IssueTypeIdentifierValue extends UUIDModel, SubmittedAtModel, T
|
|
|
71
71
|
issue: Issue["uuid"];
|
|
72
72
|
issue_type_identifier: IssueTypeIdentifier["uuid"];
|
|
73
73
|
}
|
|
74
|
-
export interface IssueAttachment extends UUIDModel, TimestampedModel, SubmittedAtModel,
|
|
74
|
+
export interface IssueAttachment extends UUIDModel, TimestampedModel, SubmittedAtModel, RequiredFileModel, CreatedByModel {
|
|
75
75
|
issue: Issue["uuid"];
|
|
76
76
|
}
|
|
77
|
-
export interface IssueTypeAttachment extends UUIDModel, TimestampedModel, SubmittedAtModel,
|
|
77
|
+
export interface IssueTypeAttachment extends UUIDModel, TimestampedModel, SubmittedAtModel, RequiredFileModel, CreatedByModel {
|
|
78
78
|
issue_type: IssueType["uuid"];
|
|
79
79
|
}
|
|
80
|
-
export interface IssueCommentAttachment extends UUIDModel, TimestampedModel, SubmittedAtModel,
|
|
80
|
+
export interface IssueCommentAttachment extends UUIDModel, TimestampedModel, SubmittedAtModel, RequiredFileModel, CreatedByModel {
|
|
81
81
|
issue_comment: IssueComment["uuid"];
|
|
82
82
|
}
|
|
83
83
|
export interface IssueTypeStatus extends UUIDModel, SubmittedAtModel, TimestampedModel, ColorModel, CreatedByModel {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RequiredFileModel } from '../files';
|
|
2
2
|
import { BoundableModel, CanvasBoundableModel, CreatedByModel, PolygonBoundedModel, SubmittedAtModel, TimestampedModel, UUIDModel } from './base';
|
|
3
3
|
import { Organization, OrganizationAccess } from './organizations';
|
|
4
4
|
import { User } from './users';
|
|
@@ -6,7 +6,7 @@ export interface Project extends UUIDModel, TimestampedModel, PolygonBoundedMode
|
|
|
6
6
|
name: string;
|
|
7
7
|
organization: Organization["uuid"];
|
|
8
8
|
}
|
|
9
|
-
export interface ProjectFile extends UUIDModel, SubmittedAtModel, TimestampedModel,
|
|
9
|
+
export interface ProjectFile extends UUIDModel, SubmittedAtModel, TimestampedModel, RequiredFileModel, BoundableModel, CanvasBoundableModel, CreatedByModel {
|
|
10
10
|
z_index: number;
|
|
11
11
|
project: Project["uuid"];
|
|
12
12
|
}
|
|
@@ -15,6 +15,6 @@ export interface ProjectAccess extends UUIDModel, CreatedByModel, TimestampedMod
|
|
|
15
15
|
project: Project["uuid"];
|
|
16
16
|
organization_access: OrganizationAccess["uuid"];
|
|
17
17
|
}
|
|
18
|
-
export interface ProjectAttachment extends UUIDModel, TimestampedModel, SubmittedAtModel,
|
|
18
|
+
export interface ProjectAttachment extends UUIDModel, TimestampedModel, SubmittedAtModel, RequiredFileModel, CreatedByModel {
|
|
19
19
|
project: Project["uuid"];
|
|
20
20
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { OptionalFileModel } from '../files';
|
|
2
1
|
import { UUIDModel } from './base';
|
|
3
2
|
import { Organization } from './organizations';
|
|
4
3
|
export interface User extends UUIDModel {
|
|
@@ -10,9 +9,6 @@ export interface User extends UUIDModel {
|
|
|
10
9
|
is_active: boolean;
|
|
11
10
|
date_joined: string;
|
|
12
11
|
}
|
|
13
|
-
export interface Profile extends OptionalFileModel {
|
|
14
|
-
tour_step: number;
|
|
15
|
-
}
|
|
16
12
|
export interface RegistrationPayload {
|
|
17
13
|
username: string;
|
|
18
14
|
password: string;
|
package/dist/utils/file.d.ts
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import { FilePayload } from '../typings';
|
|
2
|
-
export declare const getFileS3Key: (file: File, hash?: string) => Promise<string>;
|
|
3
1
|
export declare function hashFile(file: Blob): Promise<string>;
|
|
4
|
-
export declare
|
|
5
|
-
export declare function getRenamedFile(file: File, newName: string): File
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export declare
|
|
9
|
-
export declare const constructUploadedFilePayloads: (files: File[]) => Promise<FilePayload[]>;
|
|
10
|
-
export declare const fileToBlob: (dataUrl: string) => Promise<Blob>;
|
|
11
|
-
export declare const blobToBase64: (blob: Blob) => Promise<string>;
|
|
12
|
-
/** Converts a profile `file` and `fileSha1` into an img src that can be rendered. This relies on an API request. */
|
|
2
|
+
export declare const getS3FileKey: (sha1: string, extension: string) => string;
|
|
3
|
+
export declare function getRenamedFile(file: File, newName: string): File;
|
|
4
|
+
export declare function getFileExtension(file: File): string;
|
|
5
|
+
export declare const fetchBlobFromObjectUrl: (objectUrl: string) => Promise<Blob>;
|
|
6
|
+
export declare const fetchFileFromObjectUrl: (objectUrl: string, name: string) => Promise<File>;
|
|
13
7
|
export declare function downloadFile(file: File): void;
|
|
8
|
+
export declare function isObjectUrl(value: unknown): value is `blob:${string}`;
|
|
9
|
+
export declare function isImageFile(file: File): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@overmap-ai/core",
|
|
3
|
-
"version": "1.0.78-gcs.
|
|
3
|
+
"version": "1.0.78-gcs.4",
|
|
4
4
|
"description": "Core functionality for Overmap",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"components",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@overmap-ai/forms": "^1.0.34",
|
|
58
|
-
"@tiptap/core": "
|
|
58
|
+
"@tiptap/core": "3.10.4",
|
|
59
59
|
"@types/file-saver": "^2.0.7",
|
|
60
60
|
"@types/geojson": "^7946.0.16",
|
|
61
61
|
"@types/jwt-decode": "^3.1.0",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
83
|
"@overmap-ai/forms": "^1.0.34",
|
|
84
|
-
"@tiptap/core": "
|
|
84
|
+
"@tiptap/core": "3.10.4",
|
|
85
85
|
"react": ">=18.2.0 <20.0.0",
|
|
86
86
|
"react-dom": ">=18.2.0 <20.0.0"
|
|
87
87
|
},
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { OvermapRootState } from '../../store';
|
|
2
|
-
import { FileModelPayload, FilePayload, RequiredFileWithNameModel, Stored, Submitted, User, UUIDModel } from '../../typings';
|
|
3
|
-
import { BaseSDK } from '../base';
|
|
4
|
-
import { OptimisticMultipleModelResult } from '../typings';
|
|
5
|
-
import { BaseOfflineModelApiService } from './BaseOfflineModelApiService';
|
|
6
|
-
export interface BuildModelData {
|
|
7
|
-
file: File;
|
|
8
|
-
file_sha1: string;
|
|
9
|
-
submitted_at: string;
|
|
10
|
-
created_by: User["uuid"] | null;
|
|
11
|
-
modelUuid: UUIDModel["uuid"];
|
|
12
|
-
}
|
|
13
|
-
export declare abstract class BaseOfflineAttachmentModelService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>, TModelId extends string, TModel extends RequiredFileWithNameModel> extends BaseOfflineModelApiService<TModelId, TModel, TState, TSDK> {
|
|
14
|
-
protected pageSize: number;
|
|
15
|
-
protected abstract getId(model: Stored<TModel>): TModelId;
|
|
16
|
-
protected abstract buildModel(data: BuildModelData): Submitted<TModel>;
|
|
17
|
-
protected abstract buildPayload(model: Submitted<TModel>, filePayload: FilePayload): FileModelPayload;
|
|
18
|
-
_bulkAdd(payloads: {
|
|
19
|
-
modelUuid: UUIDModel["uuid"];
|
|
20
|
-
file: File;
|
|
21
|
-
}[]): Promise<OptimisticMultipleModelResult<TModel>>;
|
|
22
|
-
_delete(uuid: TModelId): Promise<void>;
|
|
23
|
-
}
|