@overmap-ai/core 1.0.65-strip-workspace-access.0 → 1.0.65-strip-workspace-access.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.
@@ -19,7 +19,7 @@ export interface BuildOfflineAttachmentData<TModelId> {
19
19
  file: File;
20
20
  sha1: string;
21
21
  submittedAt: string;
22
- createdBy: number;
22
+ createdBy?: number;
23
23
  description?: string;
24
24
  modelId: TModelId;
25
25
  }
@@ -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(category: Omit<Payload<Category>, "workspace">, workspaceId: string): OptimisticModelResult<Category>;
11
- update(category: Offline<Partial<Category>>, workspaceId: string): OptimisticModelResult<Category>;
12
- remove(category: Category, workspaceId: string): Promise<undefined>;
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, DocumentPayload, MovePosition, OvermapRootState, Submitted } from "../../typings";
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: DocumentPayload): OptimisticModelResult<Document>;
7
- update(document: Submitted<Partial<Document>>): OptimisticModelResult<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(documentId: string): Promise<Document[]>;
9
+ delete(id: string): Promise<Document[]>;
10
10
  refreshStore(projectId: number, organizationId: number): Promise<void>;
11
11
  }
@@ -15,8 +15,6 @@ export declare abstract class FormService<TState extends OvermapRootState, TSDK
15
15
  Promise<Created<FormRevision>>,
16
16
  Promise<Created<FormRevisionAttachment>[]>
17
17
  ]>;
18
- favorite(formId: string, projectId: number): Promise<undefined>;
19
- unfavorite(formId: string, projectId: number): Promise<undefined>;
20
18
  delete(formId: string): Promise<undefined>;
21
19
  refreshStore(projectId: number): Promise<void>;
22
20
  }
@@ -1,4 +1,4 @@
1
- import { FieldValue, FormSubmission, FormSubmissionAttachment, FormSubmissionPayload } from '../../typings/models/forms';
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: FormSubmissionPayload): Promise<[
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, Submitted } from "../../typings";
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(comment: Omit<Payload<IssueComment>, "author" | "submitted_at">): OptimisticModelResult<IssueComment>;
7
- update(comment: Submitted<IssueComment>): OptimisticModelResult<IssueComment>;
8
- remove(offline_id: string): Promise<undefined>;
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, IssueType, OvermapRootState, Submitted } from "../../typings";
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(issue: Issue, workspaceId: string, issueType?: IssueType["offline_id"] | null): OptimisticModelResult<Issue>;
10
- update(issue: Submitted<Partial<Issue>>): OptimisticModelResult<Issue>;
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, IssueTypePayload, Offline, OvermapRootState } from "../../typings";
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: IssueTypePayload, organizationId: number): OptimisticModelResult<IssueType>;
7
- update(payload: Offline<Partial<IssueType>>): OptimisticModelResult<IssueType>;
8
- delete(issueTypeId: string): Promise<void>;
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, Stored, Team, TeamPayload, User } from "../../typings";
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(teamPayload: TeamPayload, organizationId: number): OptimisticModelResult<Team>;
7
- update(team: Stored<Team>): OptimisticModelResult<Team>;
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,12 +1,12 @@
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";
5
5
  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
- add(workspace: Payload<Workspace>): OptimisticModelResult<Workspace>;
9
- update(workspace: Workspace): OptimisticModelResult<Workspace>;
8
+ add(payload: Payload<Workspace>): OptimisticModelResult<Workspace>;
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, Submitted } from "../../typings";
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: Submitted<Partial<Stored<Document>>>[];
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<Submitted<Partial<Stored<Document>>>[], "documents/updateDocuments">, moveDocument: import("@reduxjs/toolkit").ActionCreatorWithPayload<MoveDocumentPayload, "documents/moveDocument">, removeDocuments: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], "documents/removeDocuments">;
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 { CachedForm, Form } from '../../typings/models/forms';
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";
@@ -34,8 +34,6 @@ export declare const formSlice: import("@reduxjs/toolkit").Slice<FormState, {
34
34
  export declare const initializeForms: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<Form>[], "forms/initializeForms">, setForm: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<Form>, "forms/setForm">, addForm: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<Form>, "forms/addForm">, addForms: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<Form>[], "forms/addForms">, updateForm: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<Form>, "forms/updateForm">, deleteForm: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "forms/deleteForm">;
35
35
  export declare const formReducer: Reducer<FormState>;
36
36
  export type FormSearchArgs = SearchArgs<{
37
- /** `undefined` means don't filter by favorite. `boolean` filters forms. */
38
- favorites?: boolean;
39
37
  /** organization owner */
40
38
  organization?: number;
41
39
  }>;
@@ -45,7 +43,7 @@ export declare const selectForms: ((state: OvermapRootState) => Stored<Form>[])
45
43
  }> & {
46
44
  clearCache: () => void;
47
45
  };
48
- export declare const selectFilteredForms: OvermapSelectorWithArgs<FormSearchArgs, CachedForm[]>;
46
+ export declare const selectFilteredForms: OvermapSelectorWithArgs<FormSearchArgs, Stored<Form>[]>;
49
47
  export declare const selectFormById: OvermapSelectorWithArgs<string, Stored<Form> | undefined>;
50
48
  export declare const selectFormOfAssetType: OvermapSelectorWithArgs<string, Stored<Form> | undefined>;
51
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,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
- payload: User[];
10
- }) => void;
11
- addUsers: (state: import("immer/dist/internal.js").WritableDraft<UserState>, action: {
12
- payload: User[];
13
- }) => void;
14
- setCurrentUser: (state: import("immer/dist/internal.js").WritableDraft<UserState>, action: {
15
- payload: User;
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">, addFavouriteProjectId: import("@reduxjs/toolkit").ActionCreatorWithPayload<number, "users/addFavouriteProjectId">, removeFavouriteProjectId: import("@reduxjs/toolkit").ActionCreatorWithPayload<number, "users/removeFavouriteProjectId">, setTourStep: import("@reduxjs/toolkit").ActionCreatorWithPayload<number, "users/setTourStep">, removeUser: import("@reduxjs/toolkit").ActionCreatorWithPayload<number, "users/removeUser">;
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>>(state: TState, action: {
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>>(state: TState_1, action: {
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>>(state: TState_2, action: {
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>>(state: TState_3, action: {
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>>(state: TState_4, action: {
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, "workspace/addWorkspace">, updateWorkspace: import("@reduxjs/toolkit").ActionCreatorWithPayload<Workspace, "workspace/updateWorkspace">, deleteWorkspace: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "workspace/deleteWorkspace">;
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;
@@ -44,5 +44,5 @@ export interface ColorModel {
44
44
  color: CSSColor;
45
45
  }
46
46
  export interface CreatedByModel {
47
- created_by: User["id"];
47
+ created_by?: User["id"] | null;
48
48
  }
@@ -1,6 +1,6 @@
1
- import { OfflineModel } from "./base";
1
+ import { CreatedByModel, OfflineModel, SubmittedAtModel, TimestampedModel } from "./base";
2
2
  import { CSSColor } from "../colors";
3
- export interface Category extends OfflineModel {
3
+ export interface Category extends OfflineModel, SubmittedAtModel, TimestampedModel, CreatedByModel {
4
4
  name: string;
5
5
  description?: string;
6
6
  color: CSSColor;
@@ -1,4 +1,4 @@
1
- import { ColorModel, CreatedByModel, IconModel, OfflineModel, Payload, SubmittedAtModel, TimestampedModel } from "./base";
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,9 +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
- favorite: boolean;
91
- created_by: number;
89
+ export interface Form extends OfflineModel, SubmittedAtModel, CreatedByModel {
92
90
  asset_type?: string;
93
91
  issue_type?: string;
94
92
  organization?: number;
@@ -98,22 +96,17 @@ export type SubmittedForm = Form & OfflineModel & {
98
96
  created_by: number;
99
97
  submitted_at: string;
100
98
  };
101
- export type CreatedForm = SubmittedForm & {
102
- created_at: string;
103
- };
104
99
  export type CachedForm = SubmittedForm & {
105
100
  latestRevision: FormRevision;
106
101
  };
107
- export interface FormRevision<TFields extends BaseSerializedObject = ISerializedField> extends OfflineModel {
102
+ export interface FormRevision<TFields extends BaseSerializedObject = ISerializedField> extends OfflineModel, SubmittedAtModel, TimestampedModel, CreatedByModel {
108
103
  form: string;
109
104
  title: string;
110
105
  description?: string;
111
106
  fields: TFields[];
112
- created_by: number;
113
- submitted_at: string;
114
107
  revision: number | "Pending";
115
108
  }
116
- export type FormRevisionPayload = Omit<Payload<FormRevision>, "created_by" | "revision" | "form" | "submitted_at">;
109
+ export type FormRevisionPayload = Omit<Payload<FormRevision>, "revision" | "form">;
117
110
  export interface FormSubmission extends OfflineModel, SubmittedAtModel, CreatedByModel {
118
111
  published_at?: string | null;
119
112
  form_revision: string;
@@ -131,5 +124,4 @@ export interface FormRevisionAttachment extends Attachment {
131
124
  revision: string;
132
125
  field_identifier: string;
133
126
  }
134
- export type FormSubmissionPayload = Omit<Payload<FormSubmission>, "created_by" | "submitted_at">;
135
127
  export {};
@@ -1,8 +1,7 @@
1
- import { ColorModel, CreatedByModel, IconModel, OfflineModel, Payload, SubmittedAtModel } from "./base";
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 : TModel extends Form ? SubmittedForm : Omit<TModel, "created_at" | "created_by" | "id">);
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 extends Form ? CreatedForm : 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?: IssuePriority;
33
- status?: IssueStatus;
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 SubmittedIssue, Pick<WorkspaceIndexedModel, "index"> {
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, Payload, SubmittedAtModel } from "./base";
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">;
@@ -1,5 +1,5 @@
1
- import { Model, OfflineModel } from "./base";
2
- export interface Workspace extends OfflineModel {
1
+ import { CreatedByModel, Model, OfflineModel, SubmittedAtModel, TimestampedModel } from "./base";
2
+ export interface Workspace extends OfflineModel, TimestampedModel, SubmittedAtModel, CreatedByModel {
3
3
  name: string;
4
4
  project: number;
5
5
  abbreviation: string | null;
@@ -7,5 +7,5 @@ export interface Workspace extends OfflineModel {
7
7
  }
8
8
  export interface WorkspaceIndexedModel extends Model {
9
9
  index: number | null;
10
- index_workspace: string | null;
10
+ index_workspace: string;
11
11
  }
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.0",
6
+ "version": "1.0.65-strip-workspace-access.2",
7
7
  "type": "module",
8
8
  "main": "dist/overmap-core.umd.cjs",
9
9
  "module": "dist/overmap-core.js",