@overmap-ai/core 1.0.74-model-indexes.3 → 1.0.74-more-clean-ups.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/overmap-core.js +1722 -1755
- package/dist/overmap-core.umd.cjs +7 -7
- package/dist/sdk/services/BaseAttachmentService.d.ts +3 -3
- package/dist/sdk/services/ProjectAttachmentService.d.ts +1 -1
- package/dist/store/slices/assetSlice.d.ts +2 -2
- package/dist/store/slices/assetStageCompletionSlice.d.ts +19 -19
- package/dist/store/slices/assetStageSlice.d.ts +9 -9
- package/dist/store/slices/assetTypeFieldValuesAttachmentSlice.d.ts +1 -1
- package/dist/store/slices/assetTypeFieldValuesSlice.d.ts +2 -2
- package/dist/store/slices/assetTypeFieldsAttachmentSlice.d.ts +2 -2
- package/dist/store/slices/assetTypeFieldsSlice.d.ts +3 -3
- package/dist/store/slices/assetTypeSlice.d.ts +2 -2
- package/dist/store/slices/emailDomainsSlice.d.ts +10 -10
- package/dist/store/slices/formRevisionSlice.d.ts +0 -1
- package/dist/store/slices/formSlice.d.ts +0 -1
- package/dist/store/slices/geoImageSlice.d.ts +17 -17
- package/dist/store/slices/issueTypeFieldsAttachmentSlice.d.ts +2 -2
- package/dist/store/slices/issueTypeFieldsSlice.d.ts +1 -1
- package/dist/store/slices/licenseSlice.d.ts +9 -9
- package/dist/store/slices/organizationAccessSlice.d.ts +9 -9
- package/dist/store/slices/projectAccessSlice.d.ts +9 -9
- package/dist/store/slices/projectSlice.d.ts +22 -1
- package/dist/typings/models/assets.d.ts +0 -1
- package/dist/typings/models/base.d.ts +5 -7
- package/dist/typings/models/fields.d.ts +1 -1
- package/dist/typings/models/forms.d.ts +2 -2
- package/dist/typings/models/issues.d.ts +20 -32
- package/dist/utils/offline.d.ts +1 -0
- package/dist/utils/utils.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,21 +1,37 @@
|
|
|
1
1
|
import { BaseSerializedObject, ISerializedField } from '@overmap-ai/forms';
|
|
2
2
|
import { IssuePriority, IssueStatus, IssueUpdateChange } from '../../enums';
|
|
3
|
+
import { COMMON_AUTO_FIELDS } from '../../utils';
|
|
3
4
|
import { CSSColor } from '../colors';
|
|
4
|
-
import { CreatedByModel, IndexedModel,
|
|
5
|
+
import { CreatedByModel, IndexedModel, OfflineModel, SubmittedAtModel, TimestampedModel } from './base';
|
|
5
6
|
import { FieldsAttachmentModel, FieldsModel, FieldValuesModel } from './fields';
|
|
6
7
|
import { CanvasMarkableModel, MarkableModel } from './geo';
|
|
7
8
|
import { User } from './users';
|
|
9
|
+
type FilteredKeys<T> = {
|
|
10
|
+
[P in keyof T]: T[P] extends never ? never : P;
|
|
11
|
+
}[keyof T];
|
|
12
|
+
type ExcludeNeverFields<O> = {
|
|
13
|
+
[K in FilteredKeys<O>]: O[K];
|
|
14
|
+
};
|
|
15
|
+
type PropertyUndefined<T> = {
|
|
16
|
+
[P in keyof T]?: T[P];
|
|
17
|
+
};
|
|
18
|
+
export type CommonAutoFields = (typeof COMMON_AUTO_FIELDS)[number];
|
|
8
19
|
/**
|
|
9
20
|
* Represents a model instance that has been submitted to the backend. Some properties (depending on which model, but in
|
|
10
21
|
* all cases, the `offline_id`) are guaranteed to be set.
|
|
11
22
|
*/
|
|
12
|
-
export type Submitted<TModel> =
|
|
23
|
+
export type Submitted<TModel> = Omit<TModel, CommonAutoFields> & PropertyUndefined<ExcludeNeverFields<{
|
|
24
|
+
created_at: "created_at" extends keyof TModel ? undefined : never;
|
|
25
|
+
updated_at: "updated_at" extends keyof TModel ? undefined : never;
|
|
26
|
+
index: "index" extends keyof TModel ? undefined : never;
|
|
27
|
+
revision: "revision" extends keyof TModel ? undefined : never;
|
|
28
|
+
}>>;
|
|
13
29
|
/**
|
|
14
30
|
* Represents a model instance that has been submitted to the backend, accepted, then downloaded. Created models
|
|
15
31
|
* typically have additional properties that are only known once it has been processed and accepted by the API, such as
|
|
16
32
|
* the `created_at` timestamp, which is the time at which the data was written to the database.
|
|
17
33
|
*/
|
|
18
|
-
export type Created<TModel> =
|
|
34
|
+
export type Created<TModel> = TModel;
|
|
19
35
|
/**
|
|
20
36
|
* Model instances that are stored in the Redux store can be already-created (and will likely be gotten with the initial
|
|
21
37
|
* data load), or to-be-created. In the former case, you will get a `Created<TModel>`. In the latter case, you will get
|
|
@@ -37,40 +53,11 @@ export interface Issue extends OfflineModel, SubmittedAtModel, CreatedByModel, M
|
|
|
37
53
|
issue_type: string;
|
|
38
54
|
project: number;
|
|
39
55
|
}
|
|
40
|
-
/**
|
|
41
|
-
* These details need to be provided by the frontend code before submitting to the backend.
|
|
42
|
-
*/
|
|
43
|
-
export interface SubmittedIssue extends OfflineModel, CreatedByModel {
|
|
44
|
-
submitted_at: string;
|
|
45
|
-
status: Exclude<Issue["status"], undefined>;
|
|
46
|
-
priority: Exclude<Issue["priority"], undefined>;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* These details exist on issues that have been successfully submitted, accepted, created, and serialized by the
|
|
50
|
-
* backend, then downloaded by the frontend.
|
|
51
|
-
*/
|
|
52
|
-
export interface CreatedIssue extends Issue {
|
|
53
|
-
title: Exclude<Issue["title"], undefined>;
|
|
54
|
-
description: Exclude<Issue["description"], undefined>;
|
|
55
|
-
assigned_to: Exclude<Issue["assigned_to"], undefined>;
|
|
56
|
-
due_date: Exclude<Issue["due_date"], undefined>;
|
|
57
|
-
category: Exclude<Issue["category"], undefined>;
|
|
58
|
-
geo_marker: Exclude<Issue["geo_marker"], undefined>;
|
|
59
|
-
created_at: string;
|
|
60
|
-
}
|
|
61
56
|
export interface IssueComment extends OfflineModel, SubmittedAtModel, TimestampedModel {
|
|
62
57
|
issue: string;
|
|
63
58
|
content: string;
|
|
64
59
|
author?: number;
|
|
65
60
|
}
|
|
66
|
-
export interface SubmittedIssueComment {
|
|
67
|
-
created_at: Exclude<IssueComment["created_at"], undefined>;
|
|
68
|
-
}
|
|
69
|
-
export interface CreatedIssueComment {
|
|
70
|
-
author: Exclude<IssueComment["author"], undefined>;
|
|
71
|
-
created_at: Exclude<IssueComment["created_at"], undefined>;
|
|
72
|
-
}
|
|
73
|
-
export type IssueCommentPayload = Omit<IssueComment, "author" | "created_at" | "offline_id">;
|
|
74
61
|
export interface IssueUpdateChangeTypes {
|
|
75
62
|
status: IssueStatus;
|
|
76
63
|
priority: IssuePriority;
|
|
@@ -110,3 +97,4 @@ export interface IssueTypeFieldValues extends OfflineModel, SubmittedAtModel, Ti
|
|
|
110
97
|
export interface IssueTypeFieldValuesAttachment extends OfflineModel, SubmittedAtModel, TimestampedModel, CreatedByModel, FieldsAttachmentModel {
|
|
111
98
|
field_values: string;
|
|
112
99
|
}
|
|
100
|
+
export {};
|
package/dist/utils/offline.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Offline, OfflineModel } from '../typings';
|
|
2
|
+
export declare const COMMON_AUTO_FIELDS: readonly ["created_at", "updated_at", "index", "revision"];
|
|
2
3
|
/**
|
|
3
4
|
* Adds a generated UUID to the "offline_id" key of the object.
|
|
4
5
|
* @param draft The model data to add the offline_id to
|
package/dist/utils/utils.d.ts
CHANGED
|
@@ -4,4 +4,5 @@ export declare const restructureCreateSelectorWithArgs: <TArgs, TRet>(selector:
|
|
|
4
4
|
export declare function onlyUniqueOfflineIds(value: OfflineModel, index: number, self: OfflineModel[]): boolean;
|
|
5
5
|
export declare function onlyUniqueHashes(value: IssueAttachment, index: number, self: IssueAttachment[]): boolean;
|
|
6
6
|
export declare const emailRegex: RegExp;
|
|
7
|
+
export declare function createPayload<TPayload extends object>(payload: TPayload): TPayload;
|
|
7
8
|
export {};
|
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.74-
|
|
6
|
+
"version": "1.0.74-more-clean-ups.0",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/overmap-core.umd.cjs",
|
|
9
9
|
"module": "dist/overmap-core.js",
|