@overmap-ai/core 1.0.49 → 1.0.50-bulk-form-submission.1
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/forms/renderer/FormSubmissionBrowser/FormSubmissionBrowser.d.ts +5 -5
- package/dist/forms/renderer/FormSubmissionViewer/FormSubmissionViewer.d.ts +3 -3
- package/dist/overmap-core.js +889 -454
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +889 -454
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/services/AttachmentService.d.ts +9 -7
- package/dist/sdk/services/UserFormSubmissionService.d.ts +9 -2
- package/dist/store/slices/categorySlice.d.ts +3 -1
- package/dist/store/slices/componentSlice.d.ts +1 -0
- package/dist/store/slices/componentTypeSlice.d.ts +1 -0
- package/dist/store/slices/documentSlice.d.ts +38 -3
- package/dist/store/slices/formRevisionSlice.d.ts +73 -0
- package/dist/store/slices/formSlice.d.ts +118 -0
- package/dist/store/slices/formSubmissionSlice.d.ts +47 -0
- package/dist/store/slices/index.d.ts +3 -1
- package/dist/store/slices/issueSlice.d.ts +13 -2
- package/dist/store/slices/projectFileSlice.d.ts +3 -1
- package/dist/store/slices/utils.d.ts +1 -0
- package/dist/store/slices/workspaceSlice.d.ts +3 -1
- package/dist/store/store.d.ts +10 -4
- package/dist/typings/files.d.ts +11 -1
- package/dist/typings/models/attachments.d.ts +11 -10
- package/dist/typings/models/base.d.ts +7 -0
- package/dist/typings/models/forms.d.ts +6 -11
- package/dist/utils/file.d.ts +2 -0
- package/package.json +1 -1
- package/dist/store/slices/userFormSlice.d.ts +0 -145
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
import { OfflineModel } from "./base";
|
|
2
|
-
import { MaybeObjectURL,
|
|
2
|
+
import { MaybeObjectURL, FileModel, FileWithNameModel } from "../files";
|
|
3
3
|
import { Project } from "./projects";
|
|
4
|
-
|
|
4
|
+
import { ProjectDocument } from "./documents";
|
|
5
|
+
export interface Attachment extends OfflineModel, FileWithNameModel {
|
|
5
6
|
description?: string;
|
|
6
|
-
file_name: string;
|
|
7
7
|
file_type: string;
|
|
8
8
|
submitted_at: string;
|
|
9
9
|
created_by: number;
|
|
10
10
|
}
|
|
11
|
-
export interface IssueAttachment extends Attachment
|
|
11
|
+
export interface IssueAttachment extends Attachment {
|
|
12
12
|
issue: string;
|
|
13
13
|
}
|
|
14
|
-
export interface ComponentAttachment extends Attachment
|
|
14
|
+
export interface ComponentAttachment extends Attachment {
|
|
15
15
|
component: string;
|
|
16
16
|
}
|
|
17
|
-
export interface ComponentTypeAttachment extends Attachment
|
|
17
|
+
export interface ComponentTypeAttachment extends Attachment {
|
|
18
18
|
component_type: string;
|
|
19
19
|
}
|
|
20
|
-
export interface ProjectAttachment extends Attachment
|
|
20
|
+
export interface ProjectAttachment extends Attachment {
|
|
21
21
|
project: Project["id"];
|
|
22
22
|
}
|
|
23
|
+
export interface DocumentAttachment extends Attachment {
|
|
24
|
+
document: ProjectDocument["offline_id"];
|
|
25
|
+
}
|
|
23
26
|
/** to get an AttachmentPayload for a specific type, pass in the given AttachmentType
|
|
24
27
|
* ex. AttachmentPayload<IssueAttachment> */
|
|
25
28
|
export type AttachmentPayload<TAttachment> = Omit<TAttachment, "file" | "submitted_at" | "created_by"> & {
|
|
26
29
|
file: MaybeObjectURL<File>;
|
|
27
30
|
};
|
|
28
|
-
export
|
|
29
|
-
file: string;
|
|
30
|
-
}
|
|
31
|
+
export type ProfilePic = FileModel;
|
|
@@ -4,6 +4,13 @@ export interface Model {
|
|
|
4
4
|
export interface OfflineModel extends Model {
|
|
5
5
|
offline_id: string;
|
|
6
6
|
}
|
|
7
|
+
export interface SubmittedAtModel extends Model {
|
|
8
|
+
submitted_at: string;
|
|
9
|
+
}
|
|
10
|
+
export interface TimeStampedModel extends Model {
|
|
11
|
+
created_at: string;
|
|
12
|
+
updated_at: string;
|
|
13
|
+
}
|
|
7
14
|
export type Offline<T> = T & {
|
|
8
15
|
offline_id: string;
|
|
9
16
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OfflineModel, Payload } from "./base";
|
|
1
|
+
import { OfflineModel, Payload, SubmittedAtModel } from "./base";
|
|
2
2
|
import { BaseSerializedObject, FieldValue, ISerializedField } from "../../forms";
|
|
3
|
-
import {
|
|
3
|
+
import { FileWithNameModel } from '../files';
|
|
4
4
|
import { WorkspaceIndexedModel } from "./workspace";
|
|
5
5
|
export type UserForm = Pick<WorkspaceIndexedModel, "index_workspace"> & {
|
|
6
6
|
favorite: boolean;
|
|
@@ -31,25 +31,20 @@ export interface UserFormRevision<TFields extends BaseSerializedObject = ISerial
|
|
|
31
31
|
revision: number | "Pending";
|
|
32
32
|
}
|
|
33
33
|
export type UserFormRevisionPayload = Omit<Payload<UserFormRevision>, "created_by" | "revision" | "form">;
|
|
34
|
-
export interface UserFormSubmission extends OfflineModel {
|
|
34
|
+
export interface UserFormSubmission extends OfflineModel, SubmittedAtModel {
|
|
35
35
|
form_revision: string;
|
|
36
36
|
values: Record<string, FieldValue>;
|
|
37
37
|
created_by: number;
|
|
38
|
-
created_at: string;
|
|
39
|
-
submitted_at: string;
|
|
40
|
-
updated_at: string;
|
|
41
38
|
issue?: string;
|
|
42
39
|
component?: string;
|
|
43
40
|
component_stage?: string;
|
|
44
41
|
}
|
|
45
|
-
export interface UserFormSubmissionAttachment extends OfflineModel,
|
|
42
|
+
export interface UserFormSubmissionAttachment extends OfflineModel, FileWithNameModel {
|
|
46
43
|
submission: string;
|
|
47
|
-
file_name: string;
|
|
48
44
|
field_identifier: string;
|
|
49
45
|
}
|
|
50
|
-
export interface UserFormRevisionAttachment extends OfflineModel,
|
|
46
|
+
export interface UserFormRevisionAttachment extends OfflineModel, FileWithNameModel {
|
|
51
47
|
revision: string;
|
|
52
|
-
file_name: string;
|
|
53
48
|
field_identifier: string;
|
|
54
49
|
}
|
|
55
|
-
export type UserFormSubmissionPayload = Omit<Payload<UserFormSubmission>, "created_by">;
|
|
50
|
+
export type UserFormSubmissionPayload = Omit<Payload<UserFormSubmission>, "created_by" | "submitted_at">;
|
package/dist/utils/file.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FileUploadPayload } from "../typings";
|
|
1
2
|
export declare const getFileS3Key: (file: File, hash?: string) => Promise<string>;
|
|
2
3
|
export declare function hashFile(file: Blob): Promise<string>;
|
|
3
4
|
export declare function getFileIdentifier(file: File): string;
|
|
@@ -5,6 +6,7 @@ export declare function getRenamedFile(file: File, newName: string): File & {
|
|
|
5
6
|
name: string;
|
|
6
7
|
};
|
|
7
8
|
export declare function downloadInMemoryFile(filename: string, text: string): void;
|
|
9
|
+
export declare const constructUploadedFilePayloads: (files: File[]) => Promise<FileUploadPayload[]>;
|
|
8
10
|
export declare const fileToBlob: (dataUrl: string) => Promise<Blob>;
|
|
9
11
|
export declare const blobToBase64: (blob: Blob) => Promise<string>;
|
|
10
12
|
export interface useFileSrcProps {
|
package/package.json
CHANGED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { PayloadAction, Reducer } from "@reduxjs/toolkit";
|
|
2
|
-
import { CachedUserForm, UserForm, UserFormRevision, UserFormRevisionAttachment, UserFormSubmission, UserFormSubmissionAttachment } from '../../typings/models/forms';
|
|
3
|
-
import { SearchArgs } from '../../typings/search';
|
|
4
|
-
import { Selector, SelectorWithArgs } from '../../typings/store';
|
|
5
|
-
import { Stored, Submitted } from "../../typings";
|
|
6
|
-
export interface UserFormState {
|
|
7
|
-
userForms: Record<string, Stored<UserForm>>;
|
|
8
|
-
submissions: Record<string, UserFormSubmission>;
|
|
9
|
-
submissionAttachments: Record<UserFormSubmission["offline_id"], UserFormSubmissionAttachment[]>;
|
|
10
|
-
revisions: Record<string, UserFormRevision>;
|
|
11
|
-
revisionAttachments: Record<UserFormRevision["offline_id"], UserFormRevisionAttachment[]>;
|
|
12
|
-
}
|
|
13
|
-
export declare const userFormSlice: import("@reduxjs/toolkit").Slice<UserFormState, {
|
|
14
|
-
setUserForms: (state: import("immer/dist/internal.js").WritableDraft<UserFormState>, action: {
|
|
15
|
-
payload: Submitted<UserForm>[];
|
|
16
|
-
}) => void;
|
|
17
|
-
addUserForm: (state: import("immer/dist/internal.js").WritableDraft<UserFormState>, action: {
|
|
18
|
-
payload: Submitted<UserForm>;
|
|
19
|
-
}) => void;
|
|
20
|
-
addUserForms: (state: import("immer/dist/internal.js").WritableDraft<UserFormState>, action: {
|
|
21
|
-
payload: Submitted<UserForm>[];
|
|
22
|
-
}) => void;
|
|
23
|
-
addUserFormRevisions: (state: import("immer/dist/internal.js").WritableDraft<UserFormState>, action: {
|
|
24
|
-
payload: UserFormRevision[];
|
|
25
|
-
}) => void;
|
|
26
|
-
addUserFormRevision: (state: import("immer/dist/internal.js").WritableDraft<UserFormState>, action: PayloadAction<UserFormRevision>) => void;
|
|
27
|
-
deleteUserFormRevision: (state: import("immer/dist/internal.js").WritableDraft<UserFormState>, action: PayloadAction<string>) => void;
|
|
28
|
-
deleteUserFormRevisions: (state: import("immer/dist/internal.js").WritableDraft<UserFormState>, action: {
|
|
29
|
-
payload: UserFormRevision[];
|
|
30
|
-
}) => void;
|
|
31
|
-
updateOrCreateUserFormSubmission: (state: import("immer/dist/internal.js").WritableDraft<UserFormState>, action: {
|
|
32
|
-
payload: UserFormSubmission;
|
|
33
|
-
}) => void;
|
|
34
|
-
addUserFormSubmissionAttachment: (state: import("immer/dist/internal.js").WritableDraft<UserFormState>, action: {
|
|
35
|
-
payload: UserFormSubmissionAttachment;
|
|
36
|
-
}) => void;
|
|
37
|
-
addUserFormRevisionAttachment: (state: import("immer/dist/internal.js").WritableDraft<UserFormState>, action: {
|
|
38
|
-
payload: UserFormRevisionAttachment;
|
|
39
|
-
}) => void;
|
|
40
|
-
setUserFormSubmissionAttachments: (state: import("immer/dist/internal.js").WritableDraft<UserFormState>, action: {
|
|
41
|
-
payload: UserFormSubmissionAttachment[];
|
|
42
|
-
}) => void;
|
|
43
|
-
setUserFormRevisionAttachments: (state: import("immer/dist/internal.js").WritableDraft<UserFormState>, action: {
|
|
44
|
-
payload: UserFormRevisionAttachment[];
|
|
45
|
-
}) => void;
|
|
46
|
-
deleteUserFormSubmission: (state: import("immer/dist/internal.js").WritableDraft<UserFormState>, action: PayloadAction<string>) => void;
|
|
47
|
-
deleteUserFormSubmissions: (state: import("immer/dist/internal.js").WritableDraft<UserFormState>, action: {
|
|
48
|
-
payload: UserFormSubmission[];
|
|
49
|
-
}) => void;
|
|
50
|
-
addUserFormSubmissions: (state: import("immer/dist/internal.js").WritableDraft<UserFormState>, action: {
|
|
51
|
-
payload: UserFormSubmission[];
|
|
52
|
-
}) => void;
|
|
53
|
-
setUserFormSubmissions: (state: import("immer/dist/internal.js").WritableDraft<UserFormState>, action: {
|
|
54
|
-
payload: UserFormSubmission[];
|
|
55
|
-
}) => void;
|
|
56
|
-
favoriteForm: (state: import("immer/dist/internal.js").WritableDraft<UserFormState>, action: {
|
|
57
|
-
payload: {
|
|
58
|
-
formId: string;
|
|
59
|
-
};
|
|
60
|
-
}) => void;
|
|
61
|
-
unfavoriteForm: (state: import("immer/dist/internal.js").WritableDraft<UserFormState>, action: {
|
|
62
|
-
payload: {
|
|
63
|
-
formId: string;
|
|
64
|
-
};
|
|
65
|
-
}) => void;
|
|
66
|
-
deleteUserForm: (state: import("immer/dist/internal.js").WritableDraft<UserFormState>, action: {
|
|
67
|
-
payload: string;
|
|
68
|
-
}) => void;
|
|
69
|
-
}, "userForms">;
|
|
70
|
-
export declare const addUserForm: import("@reduxjs/toolkit").ActionCreatorWithPayload<(Pick<import('../../typings/models/workspace').WorkspaceIndexedModel, "index_workspace"> & {
|
|
71
|
-
favorite: boolean;
|
|
72
|
-
component_type?: string | undefined;
|
|
73
|
-
} & {
|
|
74
|
-
owner_organization: number;
|
|
75
|
-
owner_user: undefined;
|
|
76
|
-
} & {
|
|
77
|
-
offline_id: string;
|
|
78
|
-
} & import('../../typings/models/base').OfflineModel & {
|
|
79
|
-
created_by: number;
|
|
80
|
-
submitted_at: string;
|
|
81
|
-
}) | (Pick<import('../../typings/models/workspace').WorkspaceIndexedModel, "index_workspace"> & {
|
|
82
|
-
favorite: boolean;
|
|
83
|
-
component_type?: string | undefined;
|
|
84
|
-
} & {
|
|
85
|
-
owner_organization: undefined;
|
|
86
|
-
owner_user: number;
|
|
87
|
-
} & {
|
|
88
|
-
offline_id: string;
|
|
89
|
-
} & import('../../typings/models/base').OfflineModel & {
|
|
90
|
-
created_by: number;
|
|
91
|
-
submitted_at: string;
|
|
92
|
-
}), "userForms/addUserForm">, addUserForms: import("@reduxjs/toolkit").ActionCreatorWithPayload<((Pick<import('../../typings/models/workspace').WorkspaceIndexedModel, "index_workspace"> & {
|
|
93
|
-
favorite: boolean;
|
|
94
|
-
component_type?: string | undefined;
|
|
95
|
-
} & {
|
|
96
|
-
owner_organization: number;
|
|
97
|
-
owner_user: undefined;
|
|
98
|
-
} & {
|
|
99
|
-
offline_id: string;
|
|
100
|
-
} & import('../../typings/models/base').OfflineModel & {
|
|
101
|
-
created_by: number;
|
|
102
|
-
submitted_at: string;
|
|
103
|
-
}) | (Pick<import('../../typings/models/workspace').WorkspaceIndexedModel, "index_workspace"> & {
|
|
104
|
-
favorite: boolean;
|
|
105
|
-
component_type?: string | undefined;
|
|
106
|
-
} & {
|
|
107
|
-
owner_organization: undefined;
|
|
108
|
-
owner_user: number;
|
|
109
|
-
} & {
|
|
110
|
-
offline_id: string;
|
|
111
|
-
} & import('../../typings/models/base').OfflineModel & {
|
|
112
|
-
created_by: number;
|
|
113
|
-
submitted_at: string;
|
|
114
|
-
}))[], "userForms/addUserForms">, addUserFormRevisions: import("@reduxjs/toolkit").ActionCreatorWithPayload<UserFormRevision<import('../../forms').ISerializedField>[], "userForms/addUserFormRevisions">, updateOrCreateUserFormSubmission: import("@reduxjs/toolkit").ActionCreatorWithPayload<UserFormSubmission, "userForms/updateOrCreateUserFormSubmission">, addUserFormSubmissions: import("@reduxjs/toolkit").ActionCreatorWithPayload<UserFormSubmission[], "userForms/addUserFormSubmissions">, deleteUserFormSubmission: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "userForms/deleteUserFormSubmission">, deleteUserFormSubmissions: import("@reduxjs/toolkit").ActionCreatorWithPayload<UserFormSubmission[], "userForms/deleteUserFormSubmissions">, favoriteForm: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
115
|
-
formId: string;
|
|
116
|
-
}, "userForms/favoriteForm">, unfavoriteForm: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
117
|
-
formId: string;
|
|
118
|
-
}, "userForms/unfavoriteForm">, deleteUserForm: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "userForms/deleteUserForm">, deleteUserFormRevision: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "userForms/deleteUserFormRevision">, deleteUserFormRevisions: import("@reduxjs/toolkit").ActionCreatorWithPayload<UserFormRevision<import('../../forms').ISerializedField>[], "userForms/deleteUserFormRevisions">, setUserFormSubmissions: import("@reduxjs/toolkit").ActionCreatorWithPayload<UserFormSubmission[], "userForms/setUserFormSubmissions">, addUserFormRevision: import("@reduxjs/toolkit").ActionCreatorWithPayload<UserFormRevision<import('../../forms').ISerializedField>, "userForms/addUserFormRevision">, addUserFormSubmissionAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<UserFormSubmissionAttachment, "userForms/addUserFormSubmissionAttachment">, addUserFormRevisionAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<UserFormRevisionAttachment, "userForms/addUserFormRevisionAttachment">, setUserFormSubmissionAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<UserFormSubmissionAttachment[], "userForms/setUserFormSubmissionAttachments">, setUserFormRevisionAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<UserFormRevisionAttachment[], "userForms/setUserFormRevisionAttachments">;
|
|
119
|
-
export type UserFormSearchArgs = SearchArgs<{
|
|
120
|
-
/** `undefined` means don't filter by favorite. `boolean` filters forms. */
|
|
121
|
-
favorites?: boolean;
|
|
122
|
-
/** organization owner */
|
|
123
|
-
owner_organization?: number;
|
|
124
|
-
/** user owner */
|
|
125
|
-
owner_user?: number;
|
|
126
|
-
}>;
|
|
127
|
-
export declare const selectSubmissionAttachments: SelectorWithArgs<string, UserFormSubmissionAttachment[]>;
|
|
128
|
-
export declare const selectRevisionAttachments: SelectorWithArgs<string, UserFormRevisionAttachment[]>;
|
|
129
|
-
export declare const selectFilteredUserForms: SelectorWithArgs<UserFormSearchArgs, CachedUserForm[]>;
|
|
130
|
-
export declare const selectFormRevision: SelectorWithArgs<string, UserFormRevision>;
|
|
131
|
-
export declare const selectLatestFormRevision: SelectorWithArgs<string, UserFormRevision>;
|
|
132
|
-
export declare const selectUserForm: SelectorWithArgs<string, Stored<UserForm>>;
|
|
133
|
-
export declare const selectUserFormSubmission: SelectorWithArgs<string, UserFormSubmission>;
|
|
134
|
-
export declare const selectRevisionsForForm: SelectorWithArgs<string, UserFormRevision[]>;
|
|
135
|
-
export declare const selectSubmissionsForForm: SelectorWithArgs<string, UserFormSubmission[]>;
|
|
136
|
-
export declare const selectSubmissionsForIssue: SelectorWithArgs<string, UserFormSubmission[]>;
|
|
137
|
-
export declare const selectSubmissionsForComponent: SelectorWithArgs<string, UserFormSubmission[]>;
|
|
138
|
-
export declare const selectComponentSubmissionMapping: Selector<Record<string, UserFormSubmission[]>>;
|
|
139
|
-
export declare const selectUserFormMapping: Selector<Record<Stored<UserForm>["offline_id"], Stored<UserForm>>>;
|
|
140
|
-
export declare const selectComponentTypeForm: SelectorWithArgs<string, Stored<UserForm>>;
|
|
141
|
-
export declare const selectLatestRevisionsFromComponentTypeIds: SelectorWithArgs<string[], Record<string, Stored<UserFormRevision>>>;
|
|
142
|
-
export declare const selectLatestRevisionByFormId: Selector<Record<Stored<UserForm>["offline_id"], UserFormRevision>>;
|
|
143
|
-
export declare const selectNumberOfUserForms: Selector<number>;
|
|
144
|
-
export declare const selectNumberOfGeneralUserForms: Selector<number>;
|
|
145
|
-
export declare const userFormReducer: Reducer<UserFormState>;
|