@overmap-ai/core 1.0.65-strip-workspace-access.1 → 1.0.65-strip-workspace-access.3
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 +304 -452
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +304 -452
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/services/BaseAttachmentService.d.ts +1 -1
- package/dist/sdk/services/CategoryService.d.ts +3 -7
- package/dist/sdk/services/DocumentService.d.ts +4 -4
- package/dist/sdk/services/FormSubmissionService.d.ts +2 -2
- package/dist/sdk/services/IssueCommentService.d.ts +4 -4
- package/dist/sdk/services/IssueService.d.ts +3 -3
- package/dist/sdk/services/IssueTypeService.d.ts +4 -4
- package/dist/sdk/services/ProjectFileService.d.ts +1 -1
- package/dist/sdk/services/TeamService.d.ts +3 -3
- package/dist/sdk/services/WorkspaceService.d.ts +2 -2
- package/dist/store/slices/documentSlice.d.ts +3 -3
- package/dist/store/slices/formSlice.d.ts +2 -2
- package/dist/store/slices/issueCommentSlice.d.ts +2 -1
- package/dist/store/slices/issueSlice.d.ts +4 -20
- package/dist/store/slices/userSlice.d.ts +13 -33
- package/dist/store/slices/workspaceSlice.d.ts +11 -11
- package/dist/typings/models/documents.d.ts +1 -2
- package/dist/typings/models/forms.d.ts +4 -11
- package/dist/typings/models/issueTypes.d.ts +1 -2
- package/dist/typings/models/issues.d.ts +8 -11
- package/dist/typings/models/projects.d.ts +2 -4
- package/dist/typings/models/teams.d.ts +1 -2
- package/package.json +1 -1
|
@@ -2,13 +2,9 @@ import { Category, Offline, OvermapRootState, Payload } from "../../typings";
|
|
|
2
2
|
import { OptimisticModelResult } from "../typings";
|
|
3
3
|
import { BaseApiService } from "./BaseApiService";
|
|
4
4
|
import type { BaseSDK } from "../base";
|
|
5
|
-
/**
|
|
6
|
-
* Handles the creation of Category Service
|
|
7
|
-
* TODO: Support editing and deleting categories
|
|
8
|
-
*/
|
|
9
5
|
export declare abstract class CategoryService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
|
|
10
|
-
add(payload:
|
|
11
|
-
update(
|
|
12
|
-
remove(
|
|
6
|
+
add(payload: Payload<Category>): OptimisticModelResult<Category>;
|
|
7
|
+
update(payload: Offline<Partial<Payload<Category>>>): OptimisticModelResult<Category>;
|
|
8
|
+
remove(id: string): Promise<undefined>;
|
|
13
9
|
refreshStore(projectId: number): Promise<undefined>;
|
|
14
10
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Document,
|
|
1
|
+
import { Document, MovePosition, Offline, OvermapRootState, Payload } from "../../typings";
|
|
2
2
|
import { OptimisticModelResult } from "../typings";
|
|
3
3
|
import { BaseApiService } from "./BaseApiService";
|
|
4
4
|
import type { BaseSDK } from "../base";
|
|
5
5
|
export declare abstract class DocumentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
|
|
6
|
-
add(payload:
|
|
7
|
-
update(document:
|
|
6
|
+
add(payload: Payload<Document>): OptimisticModelResult<Document>;
|
|
7
|
+
update(document: Offline<Partial<Payload<Document>>>): OptimisticModelResult<Document>;
|
|
8
8
|
move(documentId: string, targetDocumentId: string | null, position: MovePosition): Promise<Document[]>;
|
|
9
|
-
delete(
|
|
9
|
+
delete(id: string): Promise<Document[]>;
|
|
10
10
|
refreshStore(projectId: number, organizationId: number): Promise<void>;
|
|
11
11
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FieldValue, FormSubmission, FormSubmissionAttachment
|
|
1
|
+
import { FieldValue, FormSubmission, FormSubmissionAttachment } from '../../typings/models/forms';
|
|
2
2
|
import { PresignedUrlsResponse } from "../typings";
|
|
3
3
|
import { Created, Offline, OvermapRootState, Payload, Stored } from "../../typings";
|
|
4
4
|
import type { BaseSDK } from "../base";
|
|
@@ -11,7 +11,7 @@ interface BulkAddRequestReturnValue {
|
|
|
11
11
|
export declare abstract class FormSubmissionService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseUploadService<TState, TSDK> {
|
|
12
12
|
private bulkAddSubmissionAttachments;
|
|
13
13
|
private bulkDeleteSubmissionAttachments;
|
|
14
|
-
add(payload:
|
|
14
|
+
add(payload: Payload<FormSubmission>): Promise<[
|
|
15
15
|
Stored<FormSubmission>,
|
|
16
16
|
Stored<FormSubmissionAttachment>[],
|
|
17
17
|
Promise<Created<FormSubmission>>,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { IssueComment, OvermapRootState, Payload
|
|
1
|
+
import { IssueComment, Offline, OvermapRootState, Payload } from "../../typings";
|
|
2
2
|
import { OptimisticModelResult } from "../typings";
|
|
3
3
|
import { BaseApiService } from "./BaseApiService";
|
|
4
4
|
import type { BaseSDK } from "../base";
|
|
5
5
|
export declare abstract class IssueCommentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
|
|
6
|
-
add(
|
|
7
|
-
update(
|
|
8
|
-
remove(
|
|
6
|
+
add(payload: Omit<Payload<IssueComment>, "author">): OptimisticModelResult<IssueComment>;
|
|
7
|
+
update(payload: Offline<Partial<Payload<IssueComment>>>): OptimisticModelResult<IssueComment>;
|
|
8
|
+
remove(id: string): Promise<undefined>;
|
|
9
9
|
refreshStore(projectId: number): Promise<void>;
|
|
10
10
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { OptimisticModelResult } from "../typings";
|
|
2
|
-
import { Issue,
|
|
2
|
+
import { Issue, Offline, OvermapRootState, Payload } from "../../typings";
|
|
3
3
|
import { BaseApiService } from "./BaseApiService";
|
|
4
4
|
import type { BaseSDK } from "../base";
|
|
5
5
|
/**
|
|
6
6
|
* Handles CRUD operations on issues
|
|
7
7
|
*/
|
|
8
8
|
export declare abstract class IssueService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
|
|
9
|
-
add(
|
|
10
|
-
update(
|
|
9
|
+
add(payload: Payload<Issue>): OptimisticModelResult<Issue>;
|
|
10
|
+
update(payload: Offline<Partial<Payload<Issue>>>): OptimisticModelResult<Issue>;
|
|
11
11
|
remove(id: string): Promise<undefined>;
|
|
12
12
|
refreshStore(projectId: number): Promise<undefined>;
|
|
13
13
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { OptimisticModelResult } from "../typings";
|
|
2
|
-
import { IssueType,
|
|
2
|
+
import { IssueType, Offline, OvermapRootState, Payload } from "../../typings";
|
|
3
3
|
import { BaseApiService } from "./BaseApiService";
|
|
4
4
|
import type { BaseSDK } from "../base";
|
|
5
5
|
export declare abstract class IssueTypeService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
|
|
6
|
-
add(payload:
|
|
7
|
-
update(payload: Offline<Partial<IssueType
|
|
8
|
-
delete(
|
|
6
|
+
add(payload: Payload<IssueType>): OptimisticModelResult<IssueType>;
|
|
7
|
+
update(payload: Offline<Partial<Payload<IssueType>>>): OptimisticModelResult<IssueType>;
|
|
8
|
+
delete(id: string): Promise<void>;
|
|
9
9
|
refreshStore(organizationId: number): Promise<void>;
|
|
10
10
|
}
|
|
@@ -7,8 +7,8 @@ import type { BaseSDK } from "../base";
|
|
|
7
7
|
* Handles creation and caching of ProjectFiles
|
|
8
8
|
*/
|
|
9
9
|
export declare abstract class ProjectFileService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
|
|
10
|
-
refreshStore(projectId: number): Promise<void>;
|
|
11
10
|
saveExisting(file: ProjectFile): Promise<ProjectFile>;
|
|
12
11
|
saveActive(): OptimisticGenericResult<ProjectFile>;
|
|
13
12
|
delete(projectFileId: string): Promise<undefined>;
|
|
13
|
+
refreshStore(projectId: number): Promise<void>;
|
|
14
14
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { OvermapRootState,
|
|
1
|
+
import { Offline, OvermapRootState, Payload, Team, User } from "../../typings";
|
|
2
2
|
import { OptimisticModelResult } from "../typings";
|
|
3
3
|
import { BaseApiService } from "./BaseApiService";
|
|
4
4
|
import type { BaseSDK } from "../base";
|
|
5
5
|
export declare abstract class TeamService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
|
|
6
|
-
add(
|
|
7
|
-
update(
|
|
6
|
+
add(payload: Payload<Team>): OptimisticModelResult<Team>;
|
|
7
|
+
update(payload: Offline<Partial<Payload<Team>>>): OptimisticModelResult<Team>;
|
|
8
8
|
delete(teamId: string): Promise<undefined>;
|
|
9
9
|
setMembers(teamId: string, members: User["id"][]): Promise<undefined>;
|
|
10
10
|
addMembers(teamId: string, members: User["id"][]): Promise<undefined>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Payload } from '../../typings/models/base';
|
|
1
|
+
import { Offline, Payload } from '../../typings/models/base';
|
|
2
2
|
import { Workspace } from '../../typings/models/workspace';
|
|
3
3
|
import { OptimisticModelResult } from "../typings";
|
|
4
4
|
import { OvermapRootState } from "../../typings";
|
|
@@ -6,7 +6,7 @@ import { BaseApiService } from "./BaseApiService";
|
|
|
6
6
|
import type { BaseSDK } from "../base";
|
|
7
7
|
export declare abstract class WorkspaceService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
|
|
8
8
|
add(payload: Payload<Workspace>): OptimisticModelResult<Workspace>;
|
|
9
|
-
update(
|
|
9
|
+
update(payload: Offline<Partial<Payload<Workspace>>>): OptimisticModelResult<Workspace>;
|
|
10
10
|
delete(workspaceId: string): Promise<undefined>;
|
|
11
11
|
refreshStore(projectId: number): Promise<undefined>;
|
|
12
12
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Reducer } from "@reduxjs/toolkit";
|
|
2
|
-
import type { Document, MovePosition, OvermapRootState, OvermapSelector, OvermapSelectorWithArgs, Stored
|
|
2
|
+
import type { Document, MovePosition, OvermapRootState, OvermapSelector, OvermapSelectorWithArgs, Stored } from "../../typings";
|
|
3
3
|
export interface DocumentState {
|
|
4
4
|
documents: Record<string, Stored<Document>>;
|
|
5
5
|
}
|
|
@@ -16,7 +16,7 @@ export declare const documentSlice: import("@reduxjs/toolkit").Slice<DocumentSta
|
|
|
16
16
|
payload: Stored<Document>[];
|
|
17
17
|
}) => void;
|
|
18
18
|
updateDocuments: (state: import("immer/dist/internal.js").WritableDraft<DocumentState>, action: {
|
|
19
|
-
payload:
|
|
19
|
+
payload: Stored<Document>[];
|
|
20
20
|
}) => void;
|
|
21
21
|
moveDocument: (state: import("immer/dist/internal.js").WritableDraft<DocumentState>, action: {
|
|
22
22
|
payload: MoveDocumentPayload;
|
|
@@ -25,7 +25,7 @@ export declare const documentSlice: import("@reduxjs/toolkit").Slice<DocumentSta
|
|
|
25
25
|
payload: string[];
|
|
26
26
|
}) => void;
|
|
27
27
|
}, "documents">;
|
|
28
|
-
export declare const setDocuments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<Document>[], "documents/setDocuments">, addDocuments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<Document>[], "documents/addDocuments">, updateDocuments: import("@reduxjs/toolkit").ActionCreatorWithPayload<
|
|
28
|
+
export declare const setDocuments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<Document>[], "documents/setDocuments">, addDocuments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<Document>[], "documents/addDocuments">, updateDocuments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<Document>[], "documents/updateDocuments">, moveDocument: import("@reduxjs/toolkit").ActionCreatorWithPayload<MoveDocumentPayload, "documents/moveDocument">, removeDocuments: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], "documents/removeDocuments">;
|
|
29
29
|
export declare const selectDocumentsMapping: OvermapSelector<Record<string, Stored<Document>>>;
|
|
30
30
|
export declare const selectDocuments: OvermapSelector<Stored<Document>[]>;
|
|
31
31
|
export declare const selectDocumentById: OvermapSelectorWithArgs<string, Stored<Document> | undefined>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Reducer } from "@reduxjs/toolkit";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Form } from '../../typings/models/forms';
|
|
3
3
|
import type { SearchArgs } from '../../typings/search';
|
|
4
4
|
import type { OvermapSelector, OvermapSelectorWithArgs } from '../../typings/store';
|
|
5
5
|
import type { OvermapRootState, Stored } from "../../typings";
|
|
@@ -43,7 +43,7 @@ export declare const selectForms: ((state: OvermapRootState) => Stored<Form>[])
|
|
|
43
43
|
}> & {
|
|
44
44
|
clearCache: () => void;
|
|
45
45
|
};
|
|
46
|
-
export declare const selectFilteredForms: OvermapSelectorWithArgs<FormSearchArgs,
|
|
46
|
+
export declare const selectFilteredForms: OvermapSelectorWithArgs<FormSearchArgs, Stored<Form>[]>;
|
|
47
47
|
export declare const selectFormById: OvermapSelectorWithArgs<string, Stored<Form> | undefined>;
|
|
48
48
|
export declare const selectFormOfAssetType: OvermapSelectorWithArgs<string, Stored<Form> | undefined>;
|
|
49
49
|
export declare const selectFormOfIssueType: OvermapSelectorWithArgs<string, Stored<Form> | undefined>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Reducer } from "@reduxjs/toolkit";
|
|
2
2
|
import type { ModelState } from "../typings";
|
|
3
|
-
import type { IssueComment, OvermapRootState, Stored } from "../../typings";
|
|
3
|
+
import type { IssueComment, OvermapRootState, OvermapSelectorWithArgs, Stored } from "../../typings";
|
|
4
4
|
export type IssueCommentState = ModelState<Stored<IssueComment>>;
|
|
5
5
|
export declare const issueCommentSlice: import("@reduxjs/toolkit").Slice<IssueCommentState, {
|
|
6
6
|
addIssueComment: <TState extends ModelState<Stored<IssueComment>>>(state: TState, action: {
|
|
@@ -30,5 +30,6 @@ export declare const issueCommentSlice: import("@reduxjs/toolkit").Slice<IssueCo
|
|
|
30
30
|
}, "issueComments">;
|
|
31
31
|
export declare const setIssueComments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<IssueComment>[], "issueComments/setIssueComments">, setIssueComment: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<IssueComment>, "issueComments/setIssueComment">, addIssueComment: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<IssueComment>, "issueComments/addIssueComment">, addIssueComments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<IssueComment>[], "issueComments/addIssueComments">, deleteIssueComment: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "issueComments/deleteIssueComment">, deleteIssueComments: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], "issueComments/deleteIssueComments">;
|
|
32
32
|
export declare const selectIssueCommentMapping: (state: OvermapRootState) => Record<string, Stored<IssueComment>>;
|
|
33
|
+
export declare const selectIssueCommentById: OvermapSelectorWithArgs<string, Stored<IssueComment> | undefined>;
|
|
33
34
|
export declare const selectCommentsOfIssue: (args: string) => (state: OvermapRootState) => Stored<IssueComment>[];
|
|
34
35
|
export declare const issueCommentReducer: Reducer<IssueCommentState>;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { Issue, OvermapRootState,
|
|
1
|
+
import { Reducer } from "@reduxjs/toolkit";
|
|
2
|
+
import type { Issue, OvermapRootState, OvermapSelectorWithArgs, Stored } from "../../typings";
|
|
3
3
|
import type { ModelState } from "../typings";
|
|
4
|
-
|
|
5
|
-
offlineId: string;
|
|
6
|
-
lastOpenedEpochTime: number;
|
|
7
|
-
}
|
|
8
|
-
export interface IssueState extends ModelState<Stored<Issue>> {
|
|
9
|
-
recentIssueIds: RecentIssueId[];
|
|
10
|
-
}
|
|
4
|
+
export type IssueState = ModelState<Stored<Issue>>;
|
|
11
5
|
export declare const issueSlice: import("@reduxjs/toolkit").Slice<IssueState, {
|
|
12
6
|
initializeIssues: <TState extends ModelState<Stored<Issue>>>(state: TState, action: {
|
|
13
7
|
payload: Stored<Issue>[];
|
|
@@ -33,14 +27,8 @@ export declare const issueSlice: import("@reduxjs/toolkit").Slice<IssueState, {
|
|
|
33
27
|
payload: string[];
|
|
34
28
|
type: string;
|
|
35
29
|
}) => void;
|
|
36
|
-
cleanRecentIssues: (state: import("immer/dist/internal.js").WritableDraft<IssueState>) => void;
|
|
37
|
-
addToRecentIssues: (state: import("immer/dist/internal.js").WritableDraft<IssueState>, action: {
|
|
38
|
-
payload: string;
|
|
39
|
-
}) => void;
|
|
40
|
-
resetRecentIssues: (state: import("immer/dist/internal.js").WritableDraft<IssueState>) => void;
|
|
41
|
-
removeRecentIssue: (state: import("immer/dist/internal.js").WritableDraft<IssueState>, action: PayloadAction<string>) => void;
|
|
42
30
|
}, "issues">;
|
|
43
|
-
export declare const initializeIssues: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<Issue>[], "issues/initializeIssues">, addIssue: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<Issue>, "issues/addIssue">, addIssues: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<Issue>[], "issues/addIssues">, updateIssue: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<Issue>, "issues/updateIssue">, deleteIssue: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "issues/deleteIssue">, deleteIssues: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], "issues/deleteIssues"
|
|
31
|
+
export declare const initializeIssues: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<Issue>[], "issues/initializeIssues">, addIssue: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<Issue>, "issues/addIssue">, addIssues: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<Issue>[], "issues/addIssues">, updateIssue: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<Issue>, "issues/updateIssue">, deleteIssue: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "issues/deleteIssue">, deleteIssues: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], "issues/deleteIssues">;
|
|
44
32
|
export interface IssueFilterArgs {
|
|
45
33
|
filterByAssignedTo: boolean;
|
|
46
34
|
filterByStatus: boolean;
|
|
@@ -48,10 +36,6 @@ export interface IssueFilterArgs {
|
|
|
48
36
|
filterByWorkspace: boolean;
|
|
49
37
|
}
|
|
50
38
|
export declare const selectIssueMapping: (state: OvermapRootState) => Record<string, Stored<Issue>>;
|
|
51
|
-
export declare const selectRecentIssueIds: (state: OvermapRootState) => RecentIssueId[];
|
|
52
39
|
export declare const selectIssueById: OvermapSelectorWithArgs<string, Stored<Issue> | undefined>;
|
|
53
|
-
export declare const searchIssues: OvermapSelectorWithArgs<SearchArgs, SearchResult<Stored<Issue>>[]>;
|
|
54
40
|
export declare const selectIssuesByIds: (args: string[]) => (state: OvermapRootState) => Stored<Issue>[];
|
|
55
|
-
export declare const selectRecentIssuesAsSearchResults: OvermapSelector<SearchableRecentResult<Stored<Issue>>[]>;
|
|
56
41
|
export declare const issueReducer: Reducer<IssueState>;
|
|
57
|
-
export {};
|
|
@@ -1,45 +1,25 @@
|
|
|
1
|
-
import { Reducer } from "@reduxjs/toolkit";
|
|
1
|
+
import { PayloadAction, Reducer } from "@reduxjs/toolkit";
|
|
2
2
|
import type { OvermapRootState, OvermapSelectorWithArgs, User } from "../../typings";
|
|
3
3
|
export interface UserState {
|
|
4
|
-
currentUser: User;
|
|
4
|
+
currentUser: User | null;
|
|
5
5
|
users: Record<number, User>;
|
|
6
6
|
}
|
|
7
7
|
export declare const userSlice: import("@reduxjs/toolkit").Slice<UserState, {
|
|
8
|
-
setUsers: (state: import("immer/dist/internal.js").WritableDraft<UserState>, action:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}) => void;
|
|
17
|
-
setProfilePicture: (state: import("immer/dist/internal.js").WritableDraft<UserState>, action: {
|
|
18
|
-
payload: {
|
|
19
|
-
file?: string;
|
|
20
|
-
file_sha1?: string;
|
|
21
|
-
};
|
|
22
|
-
}) => void;
|
|
23
|
-
addFavouriteProjectId: (state: import("immer/dist/internal.js").WritableDraft<UserState>, action: {
|
|
24
|
-
payload: number;
|
|
25
|
-
}) => void;
|
|
26
|
-
removeFavouriteProjectId: (state: import("immer/dist/internal.js").WritableDraft<UserState>, action: {
|
|
27
|
-
payload: number;
|
|
28
|
-
}) => void;
|
|
29
|
-
setTourStep: (state: import("immer/dist/internal.js").WritableDraft<UserState>, action: {
|
|
30
|
-
payload: number;
|
|
31
|
-
}) => void;
|
|
32
|
-
removeUser: (state: import("immer/dist/internal.js").WritableDraft<UserState>, action: {
|
|
33
|
-
payload: number;
|
|
34
|
-
}) => void;
|
|
8
|
+
setUsers: (state: import("immer/dist/internal.js").WritableDraft<UserState>, action: PayloadAction<User[]>) => void;
|
|
9
|
+
addUsers: (state: import("immer/dist/internal.js").WritableDraft<UserState>, action: PayloadAction<User[]>) => void;
|
|
10
|
+
setCurrentUser: (state: import("immer/dist/internal.js").WritableDraft<UserState>, action: PayloadAction<User | null>) => void;
|
|
11
|
+
setProfilePicture: (state: import("immer/dist/internal.js").WritableDraft<UserState>, action: PayloadAction<{
|
|
12
|
+
file?: string;
|
|
13
|
+
file_sha1?: string;
|
|
14
|
+
}>) => void;
|
|
15
|
+
removeUser: (state: import("immer/dist/internal.js").WritableDraft<UserState>, action: PayloadAction<number>) => void;
|
|
35
16
|
}, "users">;
|
|
36
|
-
export declare const setCurrentUser: import("@reduxjs/toolkit").ActionCreatorWithPayload<User, "users/setCurrentUser">, setProfilePicture: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
17
|
+
export declare const setCurrentUser: import("@reduxjs/toolkit").ActionCreatorWithPayload<User | null, "users/setCurrentUser">, setProfilePicture: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
37
18
|
file?: string | undefined;
|
|
38
19
|
file_sha1?: string | undefined;
|
|
39
|
-
}, "users/setProfilePicture">, setUsers: import("@reduxjs/toolkit").ActionCreatorWithPayload<User[], "users/setUsers">, addUsers: import("@reduxjs/toolkit").ActionCreatorWithPayload<User[], "users/addUsers">,
|
|
20
|
+
}, "users/setProfilePicture">, setUsers: import("@reduxjs/toolkit").ActionCreatorWithPayload<User[], "users/setUsers">, addUsers: import("@reduxjs/toolkit").ActionCreatorWithPayload<User[], "users/addUsers">, removeUser: import("@reduxjs/toolkit").ActionCreatorWithPayload<number, "users/removeUser">;
|
|
40
21
|
export declare const userReducer: Reducer<UserState>;
|
|
41
|
-
export declare const selectCurrentUser: (state: OvermapRootState) => User;
|
|
22
|
+
export declare const selectCurrentUser: (state: OvermapRootState) => User | null;
|
|
42
23
|
export declare const selectUsersMapping: (state: OvermapRootState) => Record<number, User>;
|
|
43
24
|
export declare const selectUserById: OvermapSelectorWithArgs<number, User | undefined>;
|
|
44
25
|
export declare const selectUsersByIds: (args: number[]) => (state: OvermapRootState) => User[];
|
|
45
|
-
export declare const selectFavouriteProjects: (state: OvermapRootState) => number[];
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { Reducer } from "@reduxjs/toolkit";
|
|
2
2
|
import type { OvermapRootState, OvermapSelector, OvermapSelectorWithArgs, Stored, Workspace } from "../../typings";
|
|
3
3
|
import type { ModelState } from "../typings";
|
|
4
|
-
export type WorkspaceState = ModelState<Workspace
|
|
4
|
+
export type WorkspaceState = ModelState<Stored<Workspace>>;
|
|
5
5
|
export declare const workspaceSlice: import("@reduxjs/toolkit").Slice<WorkspaceState, {
|
|
6
|
-
initializeWorkspaces: <TState extends ModelState<Workspace
|
|
7
|
-
payload: Workspace[];
|
|
6
|
+
initializeWorkspaces: <TState extends ModelState<Stored<Workspace>>>(state: TState, action: {
|
|
7
|
+
payload: Stored<Workspace>[];
|
|
8
8
|
type: string;
|
|
9
9
|
}) => void;
|
|
10
|
-
setWorkspaces: <TState_1 extends ModelState<Workspace
|
|
11
|
-
payload: Workspace[];
|
|
10
|
+
setWorkspaces: <TState_1 extends ModelState<Stored<Workspace>>>(state: TState_1, action: {
|
|
11
|
+
payload: Stored<Workspace>[];
|
|
12
12
|
type: string;
|
|
13
13
|
}) => void;
|
|
14
|
-
addWorkspace: <TState_2 extends ModelState<Workspace
|
|
15
|
-
payload: Workspace
|
|
14
|
+
addWorkspace: <TState_2 extends ModelState<Stored<Workspace>>>(state: TState_2, action: {
|
|
15
|
+
payload: Stored<Workspace>;
|
|
16
16
|
type: string;
|
|
17
17
|
}) => void;
|
|
18
|
-
updateWorkspace: <TState_3 extends ModelState<Workspace
|
|
19
|
-
payload: Workspace
|
|
18
|
+
updateWorkspace: <TState_3 extends ModelState<Stored<Workspace>>>(state: TState_3, action: {
|
|
19
|
+
payload: Stored<Workspace>;
|
|
20
20
|
type: string;
|
|
21
21
|
}) => void;
|
|
22
|
-
deleteWorkspace: <TState_4 extends ModelState<Workspace
|
|
22
|
+
deleteWorkspace: <TState_4 extends ModelState<Stored<Workspace>>>(state: TState_4, action: {
|
|
23
23
|
payload: string;
|
|
24
24
|
type: string;
|
|
25
25
|
}) => void;
|
|
26
26
|
}, "workspace">;
|
|
27
|
-
export declare const initializeWorkspaces: import("@reduxjs/toolkit").ActionCreatorWithPayload<Workspace[], "workspace/initializeWorkspaces">, setWorkspaces: import("@reduxjs/toolkit").ActionCreatorWithPayload<Workspace[], "workspace/setWorkspaces">, addWorkspace: import("@reduxjs/toolkit").ActionCreatorWithPayload<Workspace
|
|
27
|
+
export declare const initializeWorkspaces: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<Workspace>[], "workspace/initializeWorkspaces">, setWorkspaces: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<Workspace>[], "workspace/setWorkspaces">, addWorkspace: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<Workspace>, "workspace/addWorkspace">, updateWorkspace: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<Workspace>, "workspace/updateWorkspace">, deleteWorkspace: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "workspace/deleteWorkspace">;
|
|
28
28
|
export declare const selectWorkspaceMapping: OvermapSelector<Record<string, Workspace>>;
|
|
29
29
|
export declare const selectWorkspaces: ((state: OvermapRootState) => Workspace[]) & import("reselect").OutputSelectorFields<(args_0: Record<string, Workspace>) => Workspace[], {
|
|
30
30
|
clearCache: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColorModel, CreatedByModel, IconModel, OfflineModel,
|
|
1
|
+
import { ColorModel, CreatedByModel, IconModel, OfflineModel, SubmittedAtModel, TimestampedModel } from "./base";
|
|
2
2
|
export interface Document extends OfflineModel, SubmittedAtModel, CreatedByModel, TimestampedModel, IconModel, ColorModel {
|
|
3
3
|
title: string | null;
|
|
4
4
|
description: string | null;
|
|
@@ -8,5 +8,4 @@ export interface Document extends OfflineModel, SubmittedAtModel, CreatedByModel
|
|
|
8
8
|
project?: number;
|
|
9
9
|
organization?: number;
|
|
10
10
|
}
|
|
11
|
-
export type DocumentPayload = Payload<Document>;
|
|
12
11
|
export type MovePosition = "left" | "right" | "left-child" | "right-child";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLInputTypeAttribute } from "react";
|
|
2
|
-
import { CreatedByModel, OfflineModel, Payload, SubmittedAtModel } from "./base";
|
|
2
|
+
import { CreatedByModel, OfflineModel, Payload, SubmittedAtModel, TimestampedModel } from "./base";
|
|
3
3
|
import { Attachment } from "./attachments";
|
|
4
4
|
export interface BaseSerializedField<TIdentifier extends FieldTypeIdentifier = FieldTypeIdentifier> extends BaseSerializedObject<TIdentifier> {
|
|
5
5
|
label: string;
|
|
@@ -86,8 +86,7 @@ export interface BaseSerializedObject<TIdentifier extends FieldTypeIdentifier =
|
|
|
86
86
|
identifier: string;
|
|
87
87
|
type: TIdentifier;
|
|
88
88
|
}
|
|
89
|
-
export interface Form extends OfflineModel, SubmittedAtModel {
|
|
90
|
-
created_by: number;
|
|
89
|
+
export interface Form extends OfflineModel, SubmittedAtModel, CreatedByModel {
|
|
91
90
|
asset_type?: string;
|
|
92
91
|
issue_type?: string;
|
|
93
92
|
organization?: number;
|
|
@@ -97,22 +96,17 @@ export type SubmittedForm = Form & OfflineModel & {
|
|
|
97
96
|
created_by: number;
|
|
98
97
|
submitted_at: string;
|
|
99
98
|
};
|
|
100
|
-
export type CreatedForm = SubmittedForm & {
|
|
101
|
-
created_at: string;
|
|
102
|
-
};
|
|
103
99
|
export type CachedForm = SubmittedForm & {
|
|
104
100
|
latestRevision: FormRevision;
|
|
105
101
|
};
|
|
106
|
-
export interface FormRevision<TFields extends BaseSerializedObject = ISerializedField> extends OfflineModel {
|
|
102
|
+
export interface FormRevision<TFields extends BaseSerializedObject = ISerializedField> extends OfflineModel, SubmittedAtModel, TimestampedModel, CreatedByModel {
|
|
107
103
|
form: string;
|
|
108
104
|
title: string;
|
|
109
105
|
description?: string;
|
|
110
106
|
fields: TFields[];
|
|
111
|
-
created_by: number;
|
|
112
|
-
submitted_at: string;
|
|
113
107
|
revision: number | "Pending";
|
|
114
108
|
}
|
|
115
|
-
export type FormRevisionPayload = Omit<Payload<FormRevision>, "
|
|
109
|
+
export type FormRevisionPayload = Omit<Payload<FormRevision>, "revision" | "form">;
|
|
116
110
|
export interface FormSubmission extends OfflineModel, SubmittedAtModel, CreatedByModel {
|
|
117
111
|
published_at?: string | null;
|
|
118
112
|
form_revision: string;
|
|
@@ -130,5 +124,4 @@ export interface FormRevisionAttachment extends Attachment {
|
|
|
130
124
|
revision: string;
|
|
131
125
|
field_identifier: string;
|
|
132
126
|
}
|
|
133
|
-
export type FormSubmissionPayload = Omit<Payload<FormSubmission>, "created_by" | "submitted_at">;
|
|
134
127
|
export {};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { ColorModel, CreatedByModel, IconModel, OfflineModel,
|
|
1
|
+
import { ColorModel, CreatedByModel, IconModel, OfflineModel, SubmittedAtModel } from "./base";
|
|
2
2
|
import { Organization } from "./organizations";
|
|
3
3
|
export interface IssueType extends OfflineModel, SubmittedAtModel, IconModel, ColorModel, CreatedByModel {
|
|
4
4
|
name?: string;
|
|
5
5
|
description?: string;
|
|
6
6
|
organization: Organization["id"];
|
|
7
7
|
}
|
|
8
|
-
export type IssueTypePayload = Payload<Omit<IssueType, "created_by" | "submitted_at" | "organization">>;
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import type { CreatedByModel, Offline, OfflineModel, SubmittedAtModel } from "./base";
|
|
1
|
+
import type { CreatedByModel, Offline, OfflineModel, SubmittedAtModel, TimestampedModel } from "./base";
|
|
2
2
|
import { IssuePriority, IssueStatus } from "../../enums";
|
|
3
3
|
import type { WorkspaceIndexedModel } from "./workspace";
|
|
4
4
|
import type { CanvasMarkableModel, MarkableModel } from "./geo";
|
|
5
|
-
import type { CreatedForm, Form, SubmittedForm } from "./forms";
|
|
6
5
|
import type { User } from "./users";
|
|
7
6
|
import type { CSSColor } from "../colors";
|
|
8
7
|
/**
|
|
9
8
|
* Represents a model instance that has been submitted to the backend. Some properties (depending on which model, but in
|
|
10
9
|
* all cases, the `offline_id`) are guaranteed to be set.
|
|
11
10
|
*/
|
|
12
|
-
export type Submitted<TModel> = Offline<TModel> & (TModel extends Issue ? SubmittedIssue :
|
|
11
|
+
export type Submitted<TModel> = Offline<TModel> & (TModel extends Issue ? SubmittedIssue : Omit<TModel, "created_at" | "id">);
|
|
13
12
|
/**
|
|
14
13
|
* Represents a model instance that has been submitted to the backend, accepted, then downloaded. Created models
|
|
15
14
|
* typically have additional properties that are only known once it has been processed and accepted by the API, such as
|
|
16
15
|
* the `created_at` timestamp, which is the time at which the data was written to the database.
|
|
17
16
|
*/
|
|
18
|
-
export type Created<TModel> = Submitted<TModel> & (TModel extends Issue ? CreatedIssue : TModel extends IssueComment ? CreatedIssueComment : TModel
|
|
17
|
+
export type Created<TModel> = Submitted<TModel> & (TModel extends Issue ? CreatedIssue : TModel extends IssueComment ? CreatedIssueComment : TModel);
|
|
19
18
|
/**
|
|
20
19
|
* Model instances that are stored in the Redux store can be already-created (and will likely be gotten with the initial
|
|
21
20
|
* data load), or to-be-created. In the former case, you will get a `Created<TModel>`. In the latter case, you will get
|
|
@@ -26,11 +25,11 @@ export type Stored<TModel> = Created<TModel> | Submitted<TModel>;
|
|
|
26
25
|
* Represents the properties you can always expect on any object representing an issue. These are the minimal details
|
|
27
26
|
* required when creating an issue.
|
|
28
27
|
*/
|
|
29
|
-
export interface Issue extends Pick<WorkspaceIndexedModel, "index_workspace">, MarkableModel, CanvasMarkableModel {
|
|
28
|
+
export interface Issue extends OfflineModel, SubmittedAtModel, CreatedByModel, Pick<WorkspaceIndexedModel, "index_workspace">, MarkableModel, CanvasMarkableModel {
|
|
30
29
|
title?: string | null;
|
|
31
30
|
description?: string | null;
|
|
32
|
-
priority
|
|
33
|
-
status
|
|
31
|
+
priority: IssuePriority;
|
|
32
|
+
status: IssueStatus;
|
|
34
33
|
assigned_to?: number | null;
|
|
35
34
|
due_date?: string | Date | null;
|
|
36
35
|
category?: string | null;
|
|
@@ -48,7 +47,7 @@ export interface SubmittedIssue extends OfflineModel, CreatedByModel {
|
|
|
48
47
|
* These details exist on issues that have been successfully submitted, accepted, created, and serialized by the
|
|
49
48
|
* backend, then downloaded by the frontend.
|
|
50
49
|
*/
|
|
51
|
-
export interface CreatedIssue extends
|
|
50
|
+
export interface CreatedIssue extends Issue, Pick<WorkspaceIndexedModel, "index"> {
|
|
52
51
|
title: Exclude<Issue["title"], undefined>;
|
|
53
52
|
description: Exclude<Issue["description"], undefined>;
|
|
54
53
|
assigned_to: Exclude<Issue["assigned_to"], undefined>;
|
|
@@ -57,12 +56,10 @@ export interface CreatedIssue extends SubmittedIssue, Pick<WorkspaceIndexedModel
|
|
|
57
56
|
geo_marker: Exclude<Issue["geo_marker"], undefined>;
|
|
58
57
|
created_at: string;
|
|
59
58
|
}
|
|
60
|
-
export interface IssueComment extends OfflineModel {
|
|
59
|
+
export interface IssueComment extends OfflineModel, SubmittedAtModel, TimestampedModel {
|
|
61
60
|
issue: string;
|
|
62
61
|
content: string;
|
|
63
62
|
author?: number;
|
|
64
|
-
created_at?: string;
|
|
65
|
-
submitted_at: string;
|
|
66
63
|
}
|
|
67
64
|
export interface SubmittedIssueComment {
|
|
68
65
|
created_at: Exclude<IssueComment["created_at"], undefined>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Model, OfflineModel } from "./base";
|
|
1
|
+
import { Model, OfflineModel, SubmittedAtModel } from "./base";
|
|
2
2
|
import { FileWithNameModel } from "../files";
|
|
3
3
|
import { BoundableModel, CanvasBoundableModel } from "./geo";
|
|
4
4
|
export interface Project extends Model, BoundableModel, CanvasBoundableModel {
|
|
@@ -10,9 +10,7 @@ export interface Project extends Model, BoundableModel, CanvasBoundableModel {
|
|
|
10
10
|
issues_count?: number;
|
|
11
11
|
form_submissions_count?: number;
|
|
12
12
|
}
|
|
13
|
-
export interface ProjectFile extends OfflineModel, FileWithNameModel, BoundableModel, CanvasBoundableModel {
|
|
14
|
-
submitted_at: string;
|
|
13
|
+
export interface ProjectFile extends OfflineModel, SubmittedAtModel, FileWithNameModel, BoundableModel, CanvasBoundableModel {
|
|
15
14
|
z_index: number;
|
|
16
15
|
project: number;
|
|
17
16
|
}
|
|
18
|
-
export type ProjectPayload = Omit<Project, "id" | "file" | "fileBlob">;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColorModel, IconModel, OfflineModel,
|
|
1
|
+
import { ColorModel, IconModel, OfflineModel, SubmittedAtModel } from "./base";
|
|
2
2
|
import { Organization } from "./organizations";
|
|
3
3
|
import { User } from "./users";
|
|
4
4
|
export interface Team extends OfflineModel, SubmittedAtModel, IconModel, ColorModel {
|
|
@@ -7,4 +7,3 @@ export interface Team extends OfflineModel, SubmittedAtModel, IconModel, ColorMo
|
|
|
7
7
|
organization: Organization["id"];
|
|
8
8
|
members: User["id"][];
|
|
9
9
|
}
|
|
10
|
-
export type TeamPayload = Omit<Payload<Team>, "organization" | "submitted_at">;
|
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.65-strip-workspace-access.
|
|
6
|
+
"version": "1.0.65-strip-workspace-access.3",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/overmap-core.umd.cjs",
|
|
9
9
|
"module": "dist/overmap-core.js",
|