@overmap-ai/core 1.0.78-attachment-model-improvements.1 → 1.0.78-attachment-model-improvements.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 +6717 -7153
- package/dist/overmap-core.umd.cjs +8 -8
- package/dist/sdk/constants.d.ts +1 -1
- package/dist/sdk/services/AssetAttachmentService.d.ts +6 -11
- package/dist/sdk/services/AssetProcedureStepFieldValuesAttachmentService.d.ts +7 -11
- package/dist/sdk/services/AssetProcedureStepFieldsAttachmentService.d.ts +16 -18
- package/dist/sdk/services/AssetProcedureTypeAttachmentService.d.ts +5 -11
- package/dist/sdk/services/AssetProcedureTypeFieldValuesAttachmentService.d.ts +7 -11
- package/dist/sdk/services/AssetProcedureTypeFieldsAttachmentService.d.ts +16 -18
- package/dist/sdk/services/AssetTypeAttachmentService.d.ts +5 -11
- package/dist/sdk/services/AssetTypeFieldValuesAttachmentService.d.ts +7 -8
- package/dist/sdk/services/AssetTypeFieldsAttachmentService.d.ts +7 -9
- package/dist/sdk/services/BaseOfflineFileModelApiService.d.ts +15 -0
- package/dist/sdk/services/DocumentAttachmentService.d.ts +8 -11
- package/dist/sdk/services/FileService.d.ts +7 -18
- package/dist/sdk/services/FormRevisionAttachmentService.d.ts +16 -18
- package/dist/sdk/services/FormSubmissionAttachmentService.d.ts +16 -18
- package/dist/sdk/services/GeoImageService.d.ts +8 -7
- package/dist/sdk/services/IssueAttachmentService.d.ts +5 -11
- package/dist/sdk/services/IssueCommentAttachmentService.d.ts +5 -11
- package/dist/sdk/services/IssueTypeAttachmentService.d.ts +5 -11
- package/dist/sdk/services/IssueTypeFieldValuesAttachmentService.d.ts +16 -19
- package/dist/sdk/services/IssueTypeFieldsAttachmentService.d.ts +16 -18
- package/dist/sdk/services/ProjectAttachmentService.d.ts +5 -11
- package/dist/sdk/services/ProjectFileService.d.ts +18 -16
- package/dist/sdk/services/index.d.ts +1 -1
- package/dist/sdk/typings.d.ts +12 -4
- package/dist/store/slices/fileSlice.d.ts +0 -3
- package/dist/typings/files.d.ts +20 -5
- package/dist/utils/file.d.ts +5 -12
- package/package.json +1 -1
- package/dist/sdk/services/BaseOfflineAttachmentModelService.d.ts +0 -23
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IssueAttachment, Payload, Project, Stored, Submitted } from '../../typings';
|
|
2
2
|
import { BaseSDK } from '../base';
|
|
3
|
-
import { OptimisticMultipleModelResult } from '../typings';
|
|
4
3
|
import { OvermapRootState } from '../../store';
|
|
5
|
-
import {
|
|
6
|
-
export declare abstract class IssueAttachmentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends
|
|
4
|
+
import { BaseOfflineFileModelApiService } from './BaseOfflineFileModelApiService';
|
|
5
|
+
export declare abstract class IssueAttachmentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseOfflineFileModelApiService<IssueAttachment["uuid"], IssueAttachment, TState, TSDK> {
|
|
7
6
|
name: string;
|
|
8
7
|
url: string;
|
|
9
8
|
actions: {
|
|
@@ -22,18 +21,13 @@ export declare abstract class IssueAttachmentService<TState extends OvermapRootS
|
|
|
22
21
|
selectByIds: (uuids: string[]) => (state: any) => Stored<IssueAttachment>[];
|
|
23
22
|
};
|
|
24
23
|
protected getId(model: Stored<IssueAttachment>): IssueAttachment["uuid"];
|
|
25
|
-
protected buildModel(data:
|
|
26
|
-
protected buildPayload(model: Submitted<IssueAttachment
|
|
24
|
+
protected buildModel(data: Payload<IssueAttachment>): Submitted<IssueAttachment>;
|
|
25
|
+
protected buildPayload(model: Submitted<IssueAttachment>): {
|
|
27
26
|
uuid: string;
|
|
28
27
|
file_name: string;
|
|
29
28
|
file_sha1: string;
|
|
30
29
|
file_extension: string;
|
|
31
30
|
issue: string;
|
|
32
31
|
};
|
|
33
|
-
bulkAdd(payloads: {
|
|
34
|
-
issueUuid: Issue["uuid"];
|
|
35
|
-
file: File;
|
|
36
|
-
}[]): Promise<OptimisticMultipleModelResult<IssueAttachment>>;
|
|
37
|
-
delete(uuid: IssueAttachment["uuid"]): Promise<void>;
|
|
38
32
|
refreshStore(projectUuid: Project["uuid"], signal?: AbortSignal): Promise<IssueAttachment[]>;
|
|
39
33
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IssueCommentAttachment, Payload, Project, Stored, Submitted } from '../../typings';
|
|
2
2
|
import { BaseSDK } from '../base';
|
|
3
|
-
import { OptimisticMultipleModelResult } from '../typings';
|
|
4
3
|
import { OvermapRootState } from '../../store';
|
|
5
|
-
import {
|
|
6
|
-
export declare abstract class IssueCommentAttachmentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends
|
|
4
|
+
import { BaseOfflineFileModelApiService } from './BaseOfflineFileModelApiService';
|
|
5
|
+
export declare abstract class IssueCommentAttachmentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseOfflineFileModelApiService<IssueCommentAttachment["uuid"], IssueCommentAttachment, TState, TSDK> {
|
|
7
6
|
name: string;
|
|
8
7
|
url: string;
|
|
9
8
|
actions: {
|
|
@@ -22,18 +21,13 @@ export declare abstract class IssueCommentAttachmentService<TState extends Overm
|
|
|
22
21
|
selectByIds: (uuids: string[]) => (state: any) => Stored<IssueCommentAttachment>[];
|
|
23
22
|
};
|
|
24
23
|
protected getId(model: Stored<IssueCommentAttachment>): IssueCommentAttachment["uuid"];
|
|
25
|
-
protected buildModel(data:
|
|
26
|
-
protected buildPayload(model: Submitted<IssueCommentAttachment
|
|
24
|
+
protected buildModel(data: Payload<IssueCommentAttachment>): Submitted<IssueCommentAttachment>;
|
|
25
|
+
protected buildPayload(model: Submitted<IssueCommentAttachment>): {
|
|
27
26
|
uuid: string;
|
|
28
27
|
file_name: string;
|
|
29
28
|
file_sha1: string;
|
|
30
29
|
file_extension: string;
|
|
31
30
|
issue_comment: string;
|
|
32
31
|
};
|
|
33
|
-
bulkAdd(payloads: {
|
|
34
|
-
issueCommentUuid: IssueComment["uuid"];
|
|
35
|
-
file: File;
|
|
36
|
-
}[]): Promise<OptimisticMultipleModelResult<IssueCommentAttachment>>;
|
|
37
|
-
delete(uuid: IssueCommentAttachment["uuid"]): Promise<void>;
|
|
38
32
|
refreshStore(projectUuid: Project["uuid"], signal?: AbortSignal): Promise<IssueCommentAttachment[]>;
|
|
39
33
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IssueTypeAttachment, Organization, Payload, Stored, Submitted } from '../../typings';
|
|
2
2
|
import { BaseSDK } from '../base';
|
|
3
|
-
import { OptimisticMultipleModelResult } from '../typings';
|
|
4
3
|
import { OvermapRootState } from '../../store';
|
|
5
|
-
import {
|
|
6
|
-
export declare abstract class IssueTypeAttachmentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends
|
|
4
|
+
import { BaseOfflineFileModelApiService } from './BaseOfflineFileModelApiService';
|
|
5
|
+
export declare abstract class IssueTypeAttachmentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseOfflineFileModelApiService<IssueTypeAttachment["uuid"], IssueTypeAttachment, TState, TSDK> {
|
|
7
6
|
name: string;
|
|
8
7
|
url: string;
|
|
9
8
|
actions: {
|
|
@@ -22,18 +21,13 @@ export declare abstract class IssueTypeAttachmentService<TState extends OvermapR
|
|
|
22
21
|
selectByIds: (uuids: string[]) => (state: any) => Stored<IssueTypeAttachment>[];
|
|
23
22
|
};
|
|
24
23
|
protected getId(model: Stored<IssueTypeAttachment>): IssueTypeAttachment["uuid"];
|
|
25
|
-
protected buildModel(data:
|
|
26
|
-
protected buildPayload(model: Submitted<IssueTypeAttachment
|
|
24
|
+
protected buildModel(data: Payload<IssueTypeAttachment>): Submitted<IssueTypeAttachment>;
|
|
25
|
+
protected buildPayload(model: Submitted<IssueTypeAttachment>): {
|
|
27
26
|
uuid: string;
|
|
28
27
|
file_name: string;
|
|
29
28
|
file_sha1: string;
|
|
30
29
|
file_extension: string;
|
|
31
30
|
issue_type: string;
|
|
32
31
|
};
|
|
33
|
-
bulkAdd(payloads: {
|
|
34
|
-
issueTypeUuid: IssueType["uuid"];
|
|
35
|
-
file: File;
|
|
36
|
-
}[]): Promise<OptimisticMultipleModelResult<IssueTypeAttachment>>;
|
|
37
|
-
delete(uuid: IssueTypeAttachment["uuid"]): Promise<void>;
|
|
38
32
|
refreshStore(organizationUuid: Organization["uuid"], signal?: AbortSignal): Promise<IssueTypeAttachment[]>;
|
|
39
33
|
}
|
|
@@ -1,31 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IssueTypeFieldValuesAttachment, Payload, Project, Stored, Submitted, UUID } from '../../typings';
|
|
2
2
|
import { BaseSDK } from '../base';
|
|
3
|
-
import { OptimisticMultipleModelResult } from '../typings';
|
|
4
3
|
import { OvermapRootState } from '../../store';
|
|
5
|
-
import {
|
|
6
|
-
export declare abstract class IssueTypeFieldValuesAttachmentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends
|
|
4
|
+
import { BaseOfflineFileModelApiService } from './BaseOfflineFileModelApiService';
|
|
5
|
+
export declare abstract class IssueTypeFieldValuesAttachmentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseOfflineFileModelApiService<IssueTypeFieldValuesAttachment["uuid"], IssueTypeFieldValuesAttachment, TState, TSDK> {
|
|
7
6
|
name: string;
|
|
8
7
|
url: string;
|
|
9
8
|
actions: {
|
|
10
|
-
addOne: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
11
|
-
addMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
12
|
-
setOne: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
13
|
-
setMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
14
|
-
updateOne: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
15
|
-
updateMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
9
|
+
addOne: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<IssueTypeFieldValuesAttachment>, "issueTypeFieldValuesAttachments/addIssueTypeFieldValuesAttachment">;
|
|
10
|
+
addMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<IssueTypeFieldValuesAttachment>[], "issueTypeFieldValuesAttachments/addIssueTypeFieldValuesAttachments">;
|
|
11
|
+
setOne: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<IssueTypeFieldValuesAttachment>, "issueTypeFieldValuesAttachments/setIssueTypeFieldValuesAttachment">;
|
|
12
|
+
setMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<IssueTypeFieldValuesAttachment>[], "issueTypeFieldValuesAttachments/setIssueTypeFieldValuesAttachments">;
|
|
13
|
+
updateOne: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<IssueTypeFieldValuesAttachment>, "issueTypeFieldValuesAttachments/updateIssueTypeFieldValuesAttachment">;
|
|
14
|
+
updateMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<IssueTypeFieldValuesAttachment>[], "issueTypeFieldValuesAttachments/updateIssueTypeFieldValuesAttachments">;
|
|
16
15
|
deleteOne: import('@reduxjs/toolkit').ActionCreatorWithPayload<string, "issueTypeFieldValuesAttachments/deleteIssueTypeFieldValuesAttachment">;
|
|
17
16
|
deleteMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<string[], "issueTypeFieldValuesAttachments/deleteIssueTypeFieldValuesAttachments">;
|
|
18
|
-
initialize: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
17
|
+
initialize: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<IssueTypeFieldValuesAttachment>[], "issueTypeFieldValuesAttachments/initializeIssueTypeFieldValuesAttachments">;
|
|
19
18
|
};
|
|
20
19
|
selectors: {
|
|
21
|
-
selectById: import('../..').OvermapSelectorWithArgs<string,
|
|
22
|
-
selectByIds: (uuids: string[]) => (state: any) =>
|
|
20
|
+
selectById: import('../..').OvermapSelectorWithArgs<string, Stored<IssueTypeFieldValuesAttachment> | undefined>;
|
|
21
|
+
selectByIds: (uuids: string[]) => (state: any) => Stored<IssueTypeFieldValuesAttachment>[];
|
|
23
22
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}[]): Promise<OptimisticMultipleModelResult<IssueTypeFieldValuesAttachment>>;
|
|
29
|
-
bulkDelete(uuids: IssueTypeFieldValuesAttachment["uuid"][]): Promise<void>;
|
|
23
|
+
protected getId(model: Stored<IssueTypeFieldValuesAttachment>): string;
|
|
24
|
+
protected getBlockers(payload: UUID<Omit<Payload<IssueTypeFieldValuesAttachment>, "file_type" | "file_url">>): string[];
|
|
25
|
+
protected buildModel(data: Payload<IssueTypeFieldValuesAttachment>): Submitted<IssueTypeFieldValuesAttachment>;
|
|
26
|
+
protected buildPayload(model: Submitted<IssueTypeFieldValuesAttachment>): UUID<Omit<Payload<IssueTypeFieldValuesAttachment>, "file_type" | "file_url">>;
|
|
30
27
|
refreshStore(projectUuid: Project["uuid"], signal?: AbortSignal): Promise<IssueTypeFieldValuesAttachment[]>;
|
|
31
28
|
}
|
|
@@ -1,30 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IssueTypeFieldsAttachment, Organization, Payload, Stored, Submitted, UUID } from '../../typings';
|
|
2
2
|
import { BaseSDK } from '../base';
|
|
3
|
-
import { OptimisticMultipleModelResult } from '../typings';
|
|
4
3
|
import { OvermapRootState } from '../../store';
|
|
5
|
-
import {
|
|
6
|
-
export declare abstract class IssueTypeFieldsAttachmentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends
|
|
4
|
+
import { BaseOfflineFileModelApiService } from './BaseOfflineFileModelApiService';
|
|
5
|
+
export declare abstract class IssueTypeFieldsAttachmentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseOfflineFileModelApiService<IssueTypeFieldsAttachment["uuid"], IssueTypeFieldsAttachment, TState, TSDK> {
|
|
7
6
|
name: string;
|
|
8
7
|
url: string;
|
|
9
8
|
actions: {
|
|
10
|
-
addOne: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
11
|
-
addMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
12
|
-
setOne: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
13
|
-
setMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
14
|
-
updateOne: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
15
|
-
updateMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
9
|
+
addOne: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<IssueTypeFieldsAttachment>, "issueTypeFieldsAttachments/addIssueTypeFieldsAttachment">;
|
|
10
|
+
addMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<IssueTypeFieldsAttachment>[], "issueTypeFieldsAttachments/addIssueTypeFieldsAttachments">;
|
|
11
|
+
setOne: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<IssueTypeFieldsAttachment>, "issueTypeFieldsAttachments/setIssueTypeFieldsAttachment">;
|
|
12
|
+
setMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<IssueTypeFieldsAttachment>[], "issueTypeFieldsAttachments/setIssueTypeFieldsAttachments">;
|
|
13
|
+
updateOne: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<IssueTypeFieldsAttachment>, "issueTypeFieldsAttachments/updateIssueTypeFieldsAttachment">;
|
|
14
|
+
updateMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<IssueTypeFieldsAttachment>[], "issueTypeFieldsAttachments/updateIssueTypeFieldsAttachments">;
|
|
16
15
|
deleteOne: import('@reduxjs/toolkit').ActionCreatorWithPayload<string, "issueTypeFieldsAttachments/deleteIssueTypeFieldsAttachment">;
|
|
17
16
|
deleteMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<string[], "issueTypeFieldsAttachments/deleteIssueTypeFieldsAttachments">;
|
|
18
|
-
initialize: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
17
|
+
initialize: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<IssueTypeFieldsAttachment>[], "issueTypeFieldsAttachments/initializeIssueTypeFieldsAttachments">;
|
|
19
18
|
};
|
|
20
19
|
selectors: {
|
|
21
|
-
selectById: import('../..').OvermapSelectorWithArgs<string,
|
|
22
|
-
selectByIds: (uuids: string[]) => (state: any) =>
|
|
20
|
+
selectById: import('../..').OvermapSelectorWithArgs<string, Stored<IssueTypeFieldsAttachment> | undefined>;
|
|
21
|
+
selectByIds: (uuids: string[]) => (state: any) => Stored<IssueTypeFieldsAttachment>[];
|
|
23
22
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}[]): Promise<OptimisticMultipleModelResult<IssueTypeFieldsAttachment>>;
|
|
23
|
+
protected getId(model: Stored<IssueTypeFieldsAttachment>): string;
|
|
24
|
+
protected getBlockers(payload: UUID<Omit<Payload<IssueTypeFieldsAttachment>, "file_type" | "file_url">>): string[];
|
|
25
|
+
protected buildModel(data: Payload<IssueTypeFieldsAttachment>): Submitted<IssueTypeFieldsAttachment>;
|
|
26
|
+
protected buildPayload(model: Submitted<IssueTypeFieldsAttachment>): UUID<Omit<Payload<IssueTypeFieldsAttachment>, "file_type" | "file_url">>;
|
|
29
27
|
refreshStore(organizationUuid: Organization["uuid"], signal?: AbortSignal): Promise<IssueTypeFieldsAttachment[]>;
|
|
30
28
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Organization, Payload, ProjectAttachment, Stored, Submitted } from '../../typings';
|
|
2
2
|
import { BaseSDK } from '../base';
|
|
3
|
-
import { OptimisticMultipleModelResult } from '../typings';
|
|
4
3
|
import { OvermapRootState } from '../../store';
|
|
5
|
-
import {
|
|
6
|
-
export declare abstract class ProjectAttachmentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends
|
|
4
|
+
import { BaseOfflineFileModelApiService } from './BaseOfflineFileModelApiService';
|
|
5
|
+
export declare abstract class ProjectAttachmentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseOfflineFileModelApiService<ProjectAttachment["uuid"], ProjectAttachment, TState, TSDK> {
|
|
7
6
|
name: string;
|
|
8
7
|
url: string;
|
|
9
8
|
actions: {
|
|
@@ -22,18 +21,13 @@ export declare abstract class ProjectAttachmentService<TState extends OvermapRoo
|
|
|
22
21
|
selectByIds: (uuids: string[]) => (state: any) => Stored<ProjectAttachment>[];
|
|
23
22
|
};
|
|
24
23
|
protected getId(model: Stored<ProjectAttachment>): ProjectAttachment["uuid"];
|
|
25
|
-
protected buildModel(data:
|
|
26
|
-
protected buildPayload(model: Submitted<ProjectAttachment
|
|
24
|
+
protected buildModel(data: Payload<ProjectAttachment>): Submitted<ProjectAttachment>;
|
|
25
|
+
protected buildPayload(model: Submitted<ProjectAttachment>): {
|
|
27
26
|
uuid: string;
|
|
28
27
|
file_name: string;
|
|
29
28
|
file_sha1: string;
|
|
30
29
|
file_extension: string;
|
|
31
30
|
project: string;
|
|
32
31
|
};
|
|
33
|
-
bulkAdd(payloads: {
|
|
34
|
-
projectUuid: Project["uuid"];
|
|
35
|
-
file: File;
|
|
36
|
-
}[]): Promise<OptimisticMultipleModelResult<ProjectAttachment>>;
|
|
37
|
-
delete(uuid: ProjectAttachment["uuid"]): Promise<void>;
|
|
38
32
|
refreshStore(organizationUuid: Organization["uuid"], signal?: AbortSignal): Promise<ProjectAttachment[]>;
|
|
39
33
|
}
|
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
import { Project, ProjectFile } from '../../typings';
|
|
1
|
+
import { Payload, Project, ProjectFile, Stored, Submitted, UUID } from '../../typings';
|
|
2
2
|
import { BaseSDK } from '../base';
|
|
3
|
-
import {
|
|
3
|
+
import { OptimisticModelResult } from '../typings';
|
|
4
4
|
import { OvermapRootState } from '../../store';
|
|
5
|
-
import {
|
|
6
|
-
export declare abstract class ProjectFileService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends
|
|
5
|
+
import { BaseOfflineFileModelApiService } from './BaseOfflineFileModelApiService';
|
|
6
|
+
export declare abstract class ProjectFileService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseOfflineFileModelApiService<ProjectFile["uuid"], ProjectFile, TState, TSDK> {
|
|
7
7
|
name: string;
|
|
8
8
|
url: string;
|
|
9
9
|
actions: {
|
|
10
|
-
addOne: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
11
|
-
addMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
12
|
-
setOne: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
13
|
-
setMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
14
|
-
updateOne: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
15
|
-
updateMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
10
|
+
addOne: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<ProjectFile>, "projectFiles/addProjectFile">;
|
|
11
|
+
addMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<ProjectFile>[], "projectFiles/addProjectFiles">;
|
|
12
|
+
setOne: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<ProjectFile>, "projectFiles/setProjectFile">;
|
|
13
|
+
setMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<ProjectFile>[], "projectFiles/setProjectFiles">;
|
|
14
|
+
updateOne: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<ProjectFile>, "projectFiles/updateProjectFile">;
|
|
15
|
+
updateMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<ProjectFile>[], "projectFiles/updateProjectFiles">;
|
|
16
16
|
deleteOne: import('@reduxjs/toolkit').ActionCreatorWithPayload<string, "projectFiles/deleteProjectFile">;
|
|
17
17
|
deleteMany: import('@reduxjs/toolkit').ActionCreatorWithPayload<string[], "projectFiles/deleteProjectFiles">;
|
|
18
|
-
initialize: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
18
|
+
initialize: import('@reduxjs/toolkit').ActionCreatorWithPayload<Stored<ProjectFile>[], "projectFiles/initializeProjectFiles">;
|
|
19
19
|
};
|
|
20
20
|
selectors: {
|
|
21
|
-
selectById: import('../..').OvermapSelectorWithArgs<string,
|
|
22
|
-
selectByIds: (uuids: string[]) => (state: any) =>
|
|
21
|
+
selectById: import('../..').OvermapSelectorWithArgs<string, Stored<ProjectFile> | undefined>;
|
|
22
|
+
selectByIds: (uuids: string[]) => (state: any) => Stored<ProjectFile>[];
|
|
23
23
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
protected getId(model: Stored<ProjectFile>): ProjectFile["uuid"];
|
|
25
|
+
protected getBlockers(payload: UUID<Omit<Payload<ProjectFile>, "file_type" | "file_url">>): string[];
|
|
26
|
+
protected buildModel(data: Payload<ProjectFile>): Submitted<ProjectFile>;
|
|
27
|
+
protected buildPayload(model: Submitted<ProjectFile>): UUID<Omit<Payload<ProjectFile>, "file_type" | "file_url">>;
|
|
28
|
+
update(payload: UUID<Partial<Pick<ProjectFile, "bounds" | "canvas_bounds" | "z_index">>>): OptimisticModelResult<ProjectFile>;
|
|
27
29
|
refreshStore(projectUuid: Project["uuid"], signal?: AbortSignal): Promise<ProjectFile[]>;
|
|
28
30
|
}
|
package/dist/sdk/typings.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Store } from '@reduxjs/toolkit';
|
|
2
2
|
import { BaseState } from '../store';
|
|
3
|
-
import { Created, Model,
|
|
3
|
+
import { Created, GetS3UrlResponse, Model, RequiredFileWithNameModel, Stored } from '../typings';
|
|
4
4
|
import { HttpMethod } from '../enums';
|
|
5
5
|
import { DeferredPromise } from '../utils';
|
|
6
6
|
import { BaseSDK } from './base';
|
|
7
|
-
import { GetS3UrlResponse, GetS3UrlSuccessResponse } from './services';
|
|
8
7
|
export type OvermapSDKConstructor<TState extends BaseState, TSDK extends BaseSDK<TState>> = new (store: Store<TState>) => TSDK;
|
|
9
8
|
export interface TokenPair {
|
|
10
9
|
accessToken: string;
|
|
@@ -65,7 +64,17 @@ export type OptimisticModelResult<TModel extends Model> = [Stored<TModel>, Promi
|
|
|
65
64
|
/**
|
|
66
65
|
* Analogous to `OptimisticModelResult<TModel>`, but for multiple model instances.
|
|
67
66
|
*/
|
|
68
|
-
export type OptimisticMultipleModelResult<TModel extends Model> = [
|
|
67
|
+
export type OptimisticMultipleModelResult<TModel extends Model> = [Stored<TModel>[], Promise<Created<TModel>[]>];
|
|
68
|
+
export type OptimisticFileModelResult<TModel extends RequiredFileWithNameModel> = [
|
|
69
|
+
Stored<TModel>,
|
|
70
|
+
Promise<Created<TModel>>,
|
|
71
|
+
Promise<string>
|
|
72
|
+
];
|
|
73
|
+
export type OptimisticMultipleFileModelResult<TModel extends RequiredFileWithNameModel> = [
|
|
74
|
+
Stored<TModel>[],
|
|
75
|
+
Promise<Created<TModel>[]>,
|
|
76
|
+
Promise<string[]>
|
|
77
|
+
];
|
|
69
78
|
/**
|
|
70
79
|
* Used in situations such as deleting a model, where nothing is expected in return.
|
|
71
80
|
* @deprecated Use `Promise<undefined>` directly instead.
|
|
@@ -80,4 +89,3 @@ export type PaginatedResult<T> = {
|
|
|
80
89
|
previous: string | null;
|
|
81
90
|
results: T;
|
|
82
91
|
};
|
|
83
|
-
export type PresignedUrlsResponse = Record<string, GetS3UrlSuccessResponse>;
|
|
@@ -14,9 +14,6 @@ interface S3UrlPayload {
|
|
|
14
14
|
url: string;
|
|
15
15
|
fields: Record<string, string>;
|
|
16
16
|
}
|
|
17
|
-
/**
|
|
18
|
-
* Stores the auth state of the app (tokens, and whether user is logged in or not)
|
|
19
|
-
*/
|
|
20
17
|
export declare const fileSlice: import('@reduxjs/toolkit').Slice<FileState, {
|
|
21
18
|
setUploadUrl: (state: import('immer').WritableDraft<FileState>, action: PayloadAction<S3UrlPayload>) => void;
|
|
22
19
|
}, "file", "file", import('@reduxjs/toolkit').SliceSelectors<FileState>>;
|
package/dist/typings/files.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { Model } from './models';
|
|
2
|
+
export interface OptionalFileModel extends Model {
|
|
2
3
|
file_url: string | null;
|
|
3
4
|
file_sha1: string | null;
|
|
4
5
|
file_extension: string | null;
|
|
@@ -21,8 +22,22 @@ export interface FilePayload {
|
|
|
21
22
|
extension: string;
|
|
22
23
|
size: number;
|
|
23
24
|
}
|
|
24
|
-
export interface
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
file_extension: string;
|
|
25
|
+
export interface GetS3UrlSuccessResponse {
|
|
26
|
+
url: string;
|
|
27
|
+
fields: Record<string, string>;
|
|
28
28
|
}
|
|
29
|
+
export interface GetS3UrlWarningResponse {
|
|
30
|
+
warning: string;
|
|
31
|
+
}
|
|
32
|
+
export type GetS3UrlResponse = GetS3UrlSuccessResponse | GetS3UrlWarningResponse;
|
|
33
|
+
export type PresignedUrlsResponse = Record<string, GetS3UrlSuccessResponse>;
|
|
34
|
+
export type FileAnnotated<T> = T extends {
|
|
35
|
+
file: unknown;
|
|
36
|
+
} ? never : T & {
|
|
37
|
+
file: File;
|
|
38
|
+
};
|
|
39
|
+
export type FilePayloadAnnotated<T> = T extends {
|
|
40
|
+
file: unknown;
|
|
41
|
+
} ? never : T & {
|
|
42
|
+
file: FilePayload;
|
|
43
|
+
};
|
package/dist/utils/file.d.ts
CHANGED
|
@@ -1,15 +1,8 @@
|
|
|
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;
|
|
14
8
|
export declare function isObjectUrl(value: unknown): value is `blob:${string}`;
|
|
15
|
-
export declare function getFileExtension(file: File): string;
|
package/package.json
CHANGED
|
@@ -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["id"] | 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
|
-
}
|