@overmap-ai/core 1.0.60-forms-removal.9 → 1.0.60-geo-images.0
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 +381 -161
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +381 -161
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/services/BaseAttachmentService.d.ts +8 -4
- package/dist/sdk/services/BaseUploadService.d.ts +8 -0
- package/dist/sdk/services/GeoImageService.d.ts +14 -0
- package/dist/sdk/services/UserFormSubmissionService.d.ts +4 -5
- package/dist/sdk/services/index.d.ts +1 -0
- package/dist/sdk/typings.d.ts +2 -1
- package/dist/store/slices/geoImageSlice.d.ts +48 -0
- package/dist/store/slices/index.d.ts +1 -0
- package/dist/store/store.d.ts +2 -1
- package/dist/typings/models/geoImages.d.ts +11 -0
- package/dist/typings/models/index.d.ts +1 -0
- package/dist/typings/models/store.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { ActionCreatorWithPayload } from "@reduxjs/toolkit";
|
|
2
2
|
import { OptimisticMultipleModelResult } from "../typings";
|
|
3
3
|
import { Attachment, AttachmentModel, OvermapRootState, OvermapSelectorWithArgs, Stored, Submitted } from "../../typings";
|
|
4
|
-
import { BaseApiService } from "./BaseApiService";
|
|
5
4
|
import type { BaseSDK } from "../base";
|
|
5
|
+
import { BaseUploadService } from "./BaseUploadService";
|
|
6
|
+
export interface FilePayload {
|
|
7
|
+
sha1: Attachment["file_sha1"];
|
|
8
|
+
file_type: string;
|
|
9
|
+
extension: string;
|
|
10
|
+
size: number;
|
|
11
|
+
}
|
|
6
12
|
export interface BuildOfflineAttachmentData<TModelId> {
|
|
7
13
|
file: File;
|
|
8
14
|
sha1: string;
|
|
@@ -11,7 +17,7 @@ export interface BuildOfflineAttachmentData<TModelId> {
|
|
|
11
17
|
description?: string;
|
|
12
18
|
modelId: TModelId;
|
|
13
19
|
}
|
|
14
|
-
export declare abstract class BaseAttachmentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>, TModelId extends string | number, TAttachment extends Attachment> extends
|
|
20
|
+
export declare abstract class BaseAttachmentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>, TModelId extends string | number, TAttachment extends Attachment> extends BaseUploadService<TState, TSDK> {
|
|
15
21
|
abstract readonly attachmentModel: AttachmentModel;
|
|
16
22
|
abstract readonly initializeAttachments: ActionCreatorWithPayload<Submitted<TAttachment>[]>;
|
|
17
23
|
abstract readonly addAttachments: ActionCreatorWithPayload<Submitted<TAttachment>[]>;
|
|
@@ -20,8 +26,6 @@ export declare abstract class BaseAttachmentService<TState extends OvermapRootSt
|
|
|
20
26
|
abstract readonly setAttachment: ActionCreatorWithPayload<Stored<TAttachment>>;
|
|
21
27
|
abstract readonly removeAttachment: ActionCreatorWithPayload<string>;
|
|
22
28
|
abstract readonly selectAttachment: OvermapSelectorWithArgs<string, Stored<TAttachment>>;
|
|
23
|
-
private getNumberOfAttachmentsWithSha1;
|
|
24
|
-
private processPresignedUrls;
|
|
25
29
|
protected attachFiles(files: File[], modelId: TModelId, buildOfflineAttachment: (data: BuildOfflineAttachmentData<TModelId>) => Stored<TAttachment>): Promise<OptimisticMultipleModelResult<TAttachment>>;
|
|
26
30
|
protected deleteAttachment(attachmendId: string): Promise<void>;
|
|
27
31
|
refreshStore(projectId: number): Promise<void>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseApiService } from "./BaseApiService";
|
|
2
|
+
import { PresignedUrlsResponse } from "../typings";
|
|
3
|
+
import { OvermapRootState } from "../../typings";
|
|
4
|
+
import type { BaseSDK } from "../base";
|
|
5
|
+
export declare abstract class BaseUploadService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
|
|
6
|
+
protected getNumberOfAttachmentsWithSha1(sha1: string): number;
|
|
7
|
+
protected processPresignedUrls(presignedUrls: PresignedUrlsResponse): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GeoImage, GeoImagePayload, Offline, OvermapRootState } from "../../typings";
|
|
2
|
+
import { OptimisticModelResult, OptimisticMultipleModelResult } from "../typings";
|
|
3
|
+
import type { BaseSDK } from "../base";
|
|
4
|
+
import { BaseUploadService } from "./BaseUploadService";
|
|
5
|
+
export declare abstract class GeoImageService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseUploadService<TState, TSDK> {
|
|
6
|
+
add(payload: GeoImagePayload, file: File): Promise<OptimisticModelResult<GeoImage>>;
|
|
7
|
+
bulkAdd(payloadAndFiles: {
|
|
8
|
+
payload: GeoImagePayload;
|
|
9
|
+
file: File;
|
|
10
|
+
}[], projectId: number): Promise<OptimisticMultipleModelResult<GeoImage>>;
|
|
11
|
+
update(payload: Offline<Partial<Pick<GeoImagePayload, "title" | "description">>>): OptimisticModelResult<GeoImage>;
|
|
12
|
+
delete(geoImageId: string): Promise<void>;
|
|
13
|
+
refreshStore(projectId: number): Promise<void>;
|
|
14
|
+
}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { Offline } from '../../typings/models/base';
|
|
2
2
|
import { FieldValue, UserFormSubmission, UserFormSubmissionAttachment, UserFormSubmissionPayload } from '../../typings/models/forms';
|
|
3
|
-
import { OptimisticModelResult } from "../typings";
|
|
3
|
+
import { OptimisticModelResult, PresignedUrlsResponse } from "../typings";
|
|
4
4
|
import { Created, OvermapRootState, Stored } from "../../typings";
|
|
5
|
-
import { GetS3UrlSuccessResponse } from "./FileService";
|
|
6
|
-
import { BaseApiService } from "./BaseApiService";
|
|
7
5
|
import type { BaseSDK } from "../base";
|
|
6
|
+
import { BaseUploadService } from "./BaseUploadService";
|
|
8
7
|
interface BulkAddRequestReturnValue {
|
|
9
8
|
submissions: Created<UserFormSubmission>[];
|
|
10
9
|
attachments: Created<UserFormSubmissionAttachment>[];
|
|
11
|
-
presigned_urls:
|
|
10
|
+
presigned_urls: PresignedUrlsResponse;
|
|
12
11
|
}
|
|
13
|
-
export declare abstract class UserFormSubmissionService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends
|
|
12
|
+
export declare abstract class UserFormSubmissionService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseUploadService<TState, TSDK> {
|
|
14
13
|
private getAttachFilesPromises;
|
|
15
14
|
add(payload: Offline<UserFormSubmissionPayload>): OptimisticModelResult<UserFormSubmission>;
|
|
16
15
|
bulkAdd(args: {
|
package/dist/sdk/typings.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { ToolkitStore } from "@reduxjs/toolkit/dist/configureStore";
|
|
|
3
3
|
import { HttpMethod } from "../enums";
|
|
4
4
|
import { BaseState, Created, Model, Stored, Submitted } from "../typings";
|
|
5
5
|
import { DeferredPromise } from "../utils/async/DeferredPromise";
|
|
6
|
-
import { GetS3UrlResponse } from "./services";
|
|
6
|
+
import { GetS3UrlResponse, GetS3UrlSuccessResponse } from "./services";
|
|
7
7
|
import { BaseSDK } from "./base";
|
|
8
8
|
export type OvermapSDKConstructor<TState extends BaseState, TSDK extends BaseSDK<TState>> = new (store: ToolkitStore<TState>) => TSDK;
|
|
9
9
|
export interface TokenPair {
|
|
@@ -113,3 +113,4 @@ export interface OfflineMetaEffect {
|
|
|
113
113
|
BASE_URL: string;
|
|
114
114
|
serviceName: string;
|
|
115
115
|
}
|
|
116
|
+
export type PresignedUrlsResponse = Record<string, GetS3UrlSuccessResponse>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Reducer } from "@reduxjs/toolkit";
|
|
2
|
+
import { GeoImage, OvermapRootState, Stored } from "../../typings";
|
|
3
|
+
import { ModelState } from "../typings";
|
|
4
|
+
export type GeoImageSliceState = ModelState<Stored<GeoImage>>;
|
|
5
|
+
export declare const geoImageSlice: import("@reduxjs/toolkit").Slice<GeoImageSliceState, {
|
|
6
|
+
initializeGeoImages: <TState extends ModelState<GeoImage>>(state: TState, action: {
|
|
7
|
+
payload: GeoImage[];
|
|
8
|
+
type: string;
|
|
9
|
+
}) => void;
|
|
10
|
+
setGeoImage: <TState_1 extends ModelState<GeoImage>>(state: TState_1, action: {
|
|
11
|
+
payload: GeoImage;
|
|
12
|
+
type: string;
|
|
13
|
+
}) => void;
|
|
14
|
+
setGeoImages: <TState_2 extends ModelState<GeoImage>>(state: TState_2, action: {
|
|
15
|
+
payload: GeoImage[];
|
|
16
|
+
type: string;
|
|
17
|
+
}) => void;
|
|
18
|
+
addGeoImage: <TState_3 extends ModelState<GeoImage>>(state: TState_3, action: {
|
|
19
|
+
payload: GeoImage;
|
|
20
|
+
type: string;
|
|
21
|
+
}) => void;
|
|
22
|
+
addGeoImages: <TState_4 extends ModelState<GeoImage>>(state: TState_4, action: {
|
|
23
|
+
payload: GeoImage[];
|
|
24
|
+
type: string;
|
|
25
|
+
}) => void;
|
|
26
|
+
updateGeoImage: <TState_5 extends ModelState<GeoImage>>(state: TState_5, action: {
|
|
27
|
+
payload: GeoImage;
|
|
28
|
+
type: string;
|
|
29
|
+
}) => void;
|
|
30
|
+
updateGeoImages: <TState_6 extends ModelState<GeoImage>>(state: TState_6, action: {
|
|
31
|
+
payload: GeoImage[];
|
|
32
|
+
type: string;
|
|
33
|
+
}) => void;
|
|
34
|
+
deleteGeoImage: <TState_7 extends ModelState<GeoImage>>(state: TState_7, action: {
|
|
35
|
+
payload: string;
|
|
36
|
+
type: string;
|
|
37
|
+
}) => void;
|
|
38
|
+
deleteGeoImages: <TState_8 extends ModelState<GeoImage>>(state: TState_8, action: {
|
|
39
|
+
payload: string[];
|
|
40
|
+
type: string;
|
|
41
|
+
}) => void;
|
|
42
|
+
}, "geoImages">;
|
|
43
|
+
export declare const initializeGeoImages: import("@reduxjs/toolkit").ActionCreatorWithPayload<GeoImage[], "geoImages/initializeGeoImages">, setGeoImage: import("@reduxjs/toolkit").ActionCreatorWithPayload<GeoImage, "geoImages/setGeoImage">, setGeoImages: import("@reduxjs/toolkit").ActionCreatorWithPayload<GeoImage[], "geoImages/setGeoImages">, addGeoImage: import("@reduxjs/toolkit").ActionCreatorWithPayload<GeoImage, "geoImages/addGeoImage">, addGeoImages: import("@reduxjs/toolkit").ActionCreatorWithPayload<GeoImage[], "geoImages/addGeoImages">, updateGeoImage: import("@reduxjs/toolkit").ActionCreatorWithPayload<GeoImage, "geoImages/updateGeoImage">, updateGeoImages: import("@reduxjs/toolkit").ActionCreatorWithPayload<GeoImage[], "geoImages/updateGeoImages">, deleteGeoImage: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "geoImages/deleteGeoImage">, deleteGeoImages: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], "geoImages/deleteGeoImages">;
|
|
44
|
+
export declare const selectGeoImageMapping: (state: OvermapRootState) => Record<string, Stored<GeoImage>>;
|
|
45
|
+
export declare const selectGeoImages: (state: OvermapRootState) => Stored<GeoImage>[];
|
|
46
|
+
export declare const selectGeoImageById: (args: string) => (state: OvermapRootState) => Stored<GeoImage> | undefined;
|
|
47
|
+
export declare const selectGeoImagesOfProject: (args: number) => (state: OvermapRootState) => Stored<GeoImage>[];
|
|
48
|
+
export declare const geoImageReducer: Reducer<GeoImageSliceState>;
|
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, AssetTypeState, AuthState, CategoryState, DocumentAttachmentState, DocumentState, EmailDomainState, FileState, FormRevisionAttachmentState, FormRevisionState, FormState, FormSubmissionAttachmentState, FormSubmissionState, IssueAttachmentState, IssueCommentState, IssueState, IssueTypeState, IssueUpdateState, LicenseState, OrganizationAccessState, OrganizationState, OutboxState, ProjectAccessState, ProjectAttachmentState, ProjectFileState, ProjectState, RehydratedState, SettingState, TeamState, UserState, VersioningState, WorkspaceState } from "./slices";
|
|
6
|
+
import { AgentsState, AssetAttachmentState, AssetStageCompletionState, AssetStageState, AssetState, AssetTypeAttachmentState, AssetTypeState, AuthState, CategoryState, DocumentAttachmentState, DocumentState, EmailDomainState, FileState, FormRevisionAttachmentState, FormRevisionState, FormState, FormSubmissionAttachmentState, FormSubmissionState, GeoImageSliceState, IssueAttachmentState, IssueCommentState, IssueState, IssueTypeState, IssueUpdateState, LicenseState, OrganizationAccessState, OrganizationState, OutboxState, ProjectAccessState, ProjectAttachmentState, ProjectFileState, ProjectState, RehydratedState, SettingState, TeamState, UserState, VersioningState, WorkspaceState } from "./slices";
|
|
7
7
|
import { BaseState, OvermapRootState } from "../typings";
|
|
8
8
|
export declare const VERSION_REDUCER_KEY = "versioning";
|
|
9
9
|
export declare const overmapReducers: {
|
|
@@ -44,6 +44,7 @@ export declare const overmapReducers: {
|
|
|
44
44
|
issueCommentReducer: Reducer<IssueCommentState>;
|
|
45
45
|
issueUpdateReducer: Reducer<IssueUpdateState>;
|
|
46
46
|
issueAttachmentReducer: Reducer<IssueAttachmentState>;
|
|
47
|
+
geoImageReducer: Reducer<GeoImageSliceState>;
|
|
47
48
|
};
|
|
48
49
|
export declare const resetStore = "RESET";
|
|
49
50
|
export declare const overmapRootReducer: Reducer<OvermapRootState>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CreatedByModel, OfflineModel, SubmittedAtModel } from "./base";
|
|
2
|
+
import { CanvasMarkableModel, MarkableModel } from "./geo";
|
|
3
|
+
import { FileWithNameModel } from "../files";
|
|
4
|
+
export interface GeoImage extends OfflineModel, SubmittedAtModel, CreatedByModel, MarkableModel, CanvasMarkableModel, FileWithNameModel {
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
project: number;
|
|
8
|
+
direction?: number;
|
|
9
|
+
original_date?: string;
|
|
10
|
+
}
|
|
11
|
+
export type GeoImagePayload = Omit<GeoImage, "offline_id" | "submitted_at" | "created_by" | "file_name" | "file_sha1" | "file">;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="@redux-offline/redux-offline" />
|
|
2
2
|
import { OfflineState } from "@redux-offline/redux-offline/lib/types";
|
|
3
|
-
import { AgentsState, AssetAttachmentState, AssetStageCompletionState, AssetStageState, AssetState, AssetTypeAttachmentState, AssetTypeState, AuthState, CategoryState, DocumentAttachmentState, DocumentState, EmailDomainState, FileState, FormRevisionAttachmentState, FormRevisionState, FormState, FormSubmissionAttachmentState, FormSubmissionState, IssueAttachmentState, IssueCommentState, IssueState, IssueTypeState, IssueUpdateState, LicenseState, OrganizationAccessState, OrganizationState, OutboxState, ProjectAccessState, ProjectAttachmentState, ProjectFileState, ProjectState, RehydratedState, SettingState, TeamState, UserState, VERSION_REDUCER_KEY, WorkspaceState } from "../../store";
|
|
4
|
-
import { VersioningState } from "../../store/slices/versioningSlice";
|
|
3
|
+
import { AgentsState, AssetAttachmentState, AssetStageCompletionState, AssetStageState, AssetState, AssetTypeAttachmentState, AssetTypeState, AuthState, CategoryState, DocumentAttachmentState, DocumentState, EmailDomainState, FileState, FormRevisionAttachmentState, FormRevisionState, FormState, FormSubmissionAttachmentState, FormSubmissionState, GeoImageSliceState, IssueAttachmentState, IssueCommentState, IssueState, IssueTypeState, IssueUpdateState, LicenseState, OrganizationAccessState, OrganizationState, OutboxState, ProjectAccessState, ProjectAttachmentState, ProjectFileState, ProjectState, RehydratedState, SettingState, TeamState, UserState, VERSION_REDUCER_KEY, VersioningState, WorkspaceState } from "../../store";
|
|
5
4
|
export interface BaseState {
|
|
6
5
|
outboxReducer: OutboxState;
|
|
7
6
|
offline: OfflineState;
|
|
@@ -43,4 +42,5 @@ export interface OvermapRootState extends BaseState {
|
|
|
43
42
|
documentAttachmentReducer: DocumentAttachmentState;
|
|
44
43
|
teamReducer: TeamState;
|
|
45
44
|
agentsReducer: AgentsState;
|
|
45
|
+
geoImageReducer: GeoImageSliceState;
|
|
46
46
|
}
|
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.60-
|
|
6
|
+
"version": "1.0.60-geo-images.0",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/overmap-core.umd.cjs",
|
|
9
9
|
"module": "dist/overmap-core.js",
|