@overmap-ai/common 0.0.1-more-code-dump.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/classes/DeferredPromise.d.ts +35 -0
- package/dist/classes/UUIDPromise.d.ts +10 -0
- package/dist/classes/index.d.ts +2 -0
- package/dist/constants/assets.d.ts +3 -0
- package/dist/constants/base.d.ts +3 -0
- package/dist/constants/documents.d.ts +1 -0
- package/dist/constants/empty.d.ts +4 -0
- package/dist/constants/errors.d.ts +1 -0
- package/dist/constants/index.d.ts +7 -0
- package/dist/constants/issues.d.ts +4 -0
- package/dist/constants/organizations.d.ts +2 -0
- package/dist/constants/users.d.ts +1 -0
- package/dist/enums/asset.d.ts +8 -0
- package/dist/enums/index.d.ts +5 -0
- package/dist/enums/issue.d.ts +22 -0
- package/dist/enums/organizations.d.ts +5 -0
- package/dist/enums/procedures.d.ts +11 -0
- package/dist/enums/verification.d.ts +8 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +478 -0
- package/dist/typings/index.d.ts +2 -0
- package/dist/typings/models/agents.d.ts +17 -0
- package/dist/typings/models/assets.d.ts +55 -0
- package/dist/typings/models/base.d.ts +81 -0
- package/dist/typings/models/documents.d.ts +14 -0
- package/dist/typings/models/emailDomain.d.ts +6 -0
- package/dist/typings/models/emailVerification.d.ts +12 -0
- package/dist/typings/models/forms.d.ts +42 -0
- package/dist/typings/models/geoImages.d.ts +9 -0
- package/dist/typings/models/index.d.ts +15 -0
- package/dist/typings/models/issues.d.ts +98 -0
- package/dist/typings/models/organizations.d.ts +11 -0
- package/dist/typings/models/procedures.d.ts +104 -0
- package/dist/typings/models/projects.d.ts +24 -0
- package/dist/typings/models/teams.d.ts +12 -0
- package/dist/typings/models/users.d.ts +8 -0
- package/dist/typings/models/utils.d.ts +36 -0
- package/dist/typings/uuid.d.ts +3 -0
- package/dist/utils/array.d.ts +1 -0
- package/dist/utils/empty.d.ts +4 -0
- package/dist/utils/errors.d.ts +1 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/models/assets.d.ts +3 -0
- package/dist/utils/models/base.d.ts +9 -0
- package/dist/utils/models/documents.d.ts +4 -0
- package/dist/utils/models/index.d.ts +4 -0
- package/dist/utils/models/issues.d.ts +4 -0
- package/dist/utils/string.d.ts +10 -0
- package/dist/utils/uuid.d.ts +5 -0
- package/package.json +53 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Asset } from './assets';
|
|
2
|
+
import { AbbreviationModel, CreatedByModel, FieldsAttachmentModel, FieldsModel, FieldValuesAttachmentModel, FieldValuesModel, IdentifierModel, IdentifierValueModel, IndexedModel, SubmittedAtModel, TimestampedModel, UUIDModel } from './base';
|
|
3
|
+
import { Issue } from './issues';
|
|
4
|
+
import { Organization } from './organizations';
|
|
5
|
+
import { Project } from './projects';
|
|
6
|
+
import { User } from './users';
|
|
7
|
+
export interface Form extends UUIDModel, TimestampedModel, SubmittedAtModel, CreatedByModel, AbbreviationModel {
|
|
8
|
+
organization: Organization["uuid"];
|
|
9
|
+
name: string;
|
|
10
|
+
description: string | null;
|
|
11
|
+
}
|
|
12
|
+
export interface FormRevision extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel, FieldsModel {
|
|
13
|
+
form: Form["uuid"];
|
|
14
|
+
}
|
|
15
|
+
export interface FormSubmission extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel, IndexedModel {
|
|
16
|
+
form_revision: FormRevision["uuid"];
|
|
17
|
+
form: Form["uuid"];
|
|
18
|
+
organization: Organization["uuid"] | null;
|
|
19
|
+
project: Project["uuid"] | null;
|
|
20
|
+
asset: Asset["uuid"] | null;
|
|
21
|
+
issue: Issue["uuid"] | null;
|
|
22
|
+
}
|
|
23
|
+
export interface FormSubmissionFieldValues extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel, FieldValuesModel {
|
|
24
|
+
form_submission: FormSubmission["uuid"];
|
|
25
|
+
}
|
|
26
|
+
export interface FormSubmissionFieldValuesAttachment extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel, FieldValuesAttachmentModel {
|
|
27
|
+
field_values: FormSubmissionFieldValues["uuid"];
|
|
28
|
+
}
|
|
29
|
+
export interface FormRevisionAttachment extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel, FieldsAttachmentModel {
|
|
30
|
+
form_revision: FormRevision["uuid"];
|
|
31
|
+
}
|
|
32
|
+
export interface FormIdentifier extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel, IdentifierModel {
|
|
33
|
+
form: Form["uuid"];
|
|
34
|
+
}
|
|
35
|
+
export interface FormIdentifierValue extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel, IdentifierValueModel {
|
|
36
|
+
form_submission: FormSubmission["uuid"];
|
|
37
|
+
form_identifier: FormIdentifier["uuid"];
|
|
38
|
+
}
|
|
39
|
+
export interface FormSubscriber extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel {
|
|
40
|
+
form: Form["uuid"];
|
|
41
|
+
user: User["id"];
|
|
42
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CreatedByModel, IndexedModel, MarkableModel, RequiredFileModel, SubmittedAtModel, TimestampedModel, UUIDModel } from './base';
|
|
2
|
+
import { Project } from './projects';
|
|
3
|
+
export interface GeoImage extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel, MarkableModel, RequiredFileModel, IndexedModel {
|
|
4
|
+
title: string | null;
|
|
5
|
+
description: string | null;
|
|
6
|
+
project: Project["uuid"];
|
|
7
|
+
direction: number | null;
|
|
8
|
+
original_date: string | null;
|
|
9
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type * from './agents';
|
|
2
|
+
export type * from './assets';
|
|
3
|
+
export type * from './base';
|
|
4
|
+
export type * from './documents';
|
|
5
|
+
export type * from './emailDomain';
|
|
6
|
+
export type * from './emailVerification';
|
|
7
|
+
export type * from './forms';
|
|
8
|
+
export type * from './geoImages';
|
|
9
|
+
export type * from './issues';
|
|
10
|
+
export type * from './organizations';
|
|
11
|
+
export type * from './procedures';
|
|
12
|
+
export type * from './projects';
|
|
13
|
+
export type * from './teams';
|
|
14
|
+
export type * from './users';
|
|
15
|
+
export type * from './utils';
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { IssueStatusType, IssuePriorityType, IssueUpdateChange } from '../../enums';
|
|
2
|
+
import { Asset } from './assets';
|
|
3
|
+
import { AbbreviationModel, ColorModel, CreatedByModel, FieldsAttachmentModel, FieldsModel, FieldValuesModel, IconModel, IdentifierModel, IdentifierValueModel, IndexedModel, MarkableModel, RequiredFileModel, SubmittedAtModel, TimestampedModel, UUIDModel } from './base';
|
|
4
|
+
import { Organization } from './organizations';
|
|
5
|
+
import { Project } from './projects';
|
|
6
|
+
import { User } from './users';
|
|
7
|
+
export interface Issue extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel, MarkableModel, IndexedModel {
|
|
8
|
+
title: string | null;
|
|
9
|
+
description: string | null;
|
|
10
|
+
priority: IssueTypePriority["uuid"];
|
|
11
|
+
status: IssueTypeStatus["uuid"];
|
|
12
|
+
assigned_to: User["id"] | null;
|
|
13
|
+
due_date: string | null;
|
|
14
|
+
issue_type: IssueType["uuid"];
|
|
15
|
+
project: Project["uuid"];
|
|
16
|
+
}
|
|
17
|
+
export interface IssueComment extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel {
|
|
18
|
+
issue: Issue["uuid"];
|
|
19
|
+
content: string;
|
|
20
|
+
resolved: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface IssueUpdateChangeTypes {
|
|
23
|
+
[IssueUpdateChange.STATUS]: {
|
|
24
|
+
name: IssueTypeStatus["name"];
|
|
25
|
+
color: IssueTypeStatus["color"];
|
|
26
|
+
uuid: IssueTypeStatus["uuid"];
|
|
27
|
+
};
|
|
28
|
+
[IssueUpdateChange.PRIORITY]: {
|
|
29
|
+
name: IssueTypePriority["name"];
|
|
30
|
+
color: IssueTypePriority["color"];
|
|
31
|
+
uuid: IssueTypePriority["uuid"];
|
|
32
|
+
};
|
|
33
|
+
[IssueUpdateChange.DESCRIPTION]: string;
|
|
34
|
+
[IssueUpdateChange.TITLE]: string;
|
|
35
|
+
[IssueUpdateChange.ASSIGNED_TO]: {
|
|
36
|
+
full_name: string;
|
|
37
|
+
id: User["id"];
|
|
38
|
+
} | null;
|
|
39
|
+
[IssueUpdateChange.DUE_DATE]: string | null;
|
|
40
|
+
}
|
|
41
|
+
export interface IssueUpdate extends UUIDModel, CreatedByModel, SubmittedAtModel, TimestampedModel {
|
|
42
|
+
issue: Issue["uuid"];
|
|
43
|
+
changes: Partial<{
|
|
44
|
+
[K in IssueUpdateChange]: IssueUpdateChangeTypes[K];
|
|
45
|
+
}>;
|
|
46
|
+
}
|
|
47
|
+
export interface IssueAssociation extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel {
|
|
48
|
+
issue: Issue["uuid"];
|
|
49
|
+
asset: Asset["uuid"];
|
|
50
|
+
}
|
|
51
|
+
export interface IssueTypeFields extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel, FieldsModel {
|
|
52
|
+
issue_type: IssueType["uuid"];
|
|
53
|
+
}
|
|
54
|
+
export interface IssueTypeFieldsAttachment extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel, FieldsAttachmentModel {
|
|
55
|
+
fields_revision: IssueTypeFields["uuid"];
|
|
56
|
+
}
|
|
57
|
+
export interface IssueTypeFieldValues extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel, FieldValuesModel {
|
|
58
|
+
fields_revision: IssueTypeFields["uuid"];
|
|
59
|
+
issue: Issue["uuid"];
|
|
60
|
+
}
|
|
61
|
+
export interface IssueTypeFieldValuesAttachment extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel, FieldsAttachmentModel {
|
|
62
|
+
field_values: IssueTypeFieldValues["uuid"];
|
|
63
|
+
}
|
|
64
|
+
export interface IssueType extends UUIDModel, SubmittedAtModel, IconModel, ColorModel, TimestampedModel, CreatedByModel, AbbreviationModel {
|
|
65
|
+
name: string;
|
|
66
|
+
description: string | null;
|
|
67
|
+
organization: Organization["uuid"];
|
|
68
|
+
default_status: IssueTypeStatus["uuid"] | null;
|
|
69
|
+
default_priority: IssueTypePriority["uuid"] | null;
|
|
70
|
+
}
|
|
71
|
+
export interface IssueTypeIdentifier extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel, IdentifierModel {
|
|
72
|
+
issue_type: IssueType["uuid"];
|
|
73
|
+
}
|
|
74
|
+
export interface IssueTypeIdentifierValue extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel, IdentifierValueModel {
|
|
75
|
+
issue: Issue["uuid"];
|
|
76
|
+
issue_type_identifier: IssueTypeIdentifier["uuid"];
|
|
77
|
+
}
|
|
78
|
+
export interface IssueAttachment extends UUIDModel, TimestampedModel, SubmittedAtModel, RequiredFileModel, CreatedByModel {
|
|
79
|
+
issue: Issue["uuid"];
|
|
80
|
+
}
|
|
81
|
+
export interface IssueTypeAttachment extends UUIDModel, TimestampedModel, SubmittedAtModel, RequiredFileModel, CreatedByModel {
|
|
82
|
+
issue_type: IssueType["uuid"];
|
|
83
|
+
}
|
|
84
|
+
export interface IssueCommentAttachment extends UUIDModel, TimestampedModel, SubmittedAtModel, RequiredFileModel, CreatedByModel {
|
|
85
|
+
issue_comment: IssueComment["uuid"];
|
|
86
|
+
}
|
|
87
|
+
export interface IssueTypeStatus extends UUIDModel, SubmittedAtModel, TimestampedModel, ColorModel, CreatedByModel {
|
|
88
|
+
issue_type: IssueType["uuid"];
|
|
89
|
+
name: string;
|
|
90
|
+
type: IssueStatusType;
|
|
91
|
+
order: number;
|
|
92
|
+
}
|
|
93
|
+
export interface IssueTypePriority extends UUIDModel, SubmittedAtModel, TimestampedModel, ColorModel, CreatedByModel {
|
|
94
|
+
issue_type: IssueType["uuid"];
|
|
95
|
+
name: string;
|
|
96
|
+
type: IssuePriorityType;
|
|
97
|
+
order: number;
|
|
98
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OrganizationAccessLevel } from '../../enums';
|
|
2
|
+
import { TimestampedModel, UUIDModel } from './base';
|
|
3
|
+
import { User } from './users';
|
|
4
|
+
export interface Organization extends UUIDModel, TimestampedModel {
|
|
5
|
+
name: string;
|
|
6
|
+
}
|
|
7
|
+
export interface OrganizationAccess extends UUIDModel, TimestampedModel {
|
|
8
|
+
user: User["id"];
|
|
9
|
+
organization: Organization["uuid"];
|
|
10
|
+
access_level: OrganizationAccessLevel;
|
|
11
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { JSONCondition } from '@adrekic/fieldsjson';
|
|
2
|
+
import { ProcedureStepEventType, ProcedureStepFieldValuesReviewType } from '../../enums';
|
|
3
|
+
import { Asset, AssetType } from './assets';
|
|
4
|
+
import { AbbreviationModel, ColorModel, CreatedByModel, FieldsAttachmentModel, FieldsModel, FieldValuesModel, IconModel, IndexedModel, RequiredFileModel, SubmittedAtModel, TimestampedModel, UUIDModel } from './base';
|
|
5
|
+
import { Organization } from './organizations';
|
|
6
|
+
import { Project } from './projects';
|
|
7
|
+
import { User } from './users';
|
|
8
|
+
export interface ProcedureType extends UUIDModel, TimestampedModel, SubmittedAtModel, CreatedByModel, IconModel, ColorModel, AbbreviationModel {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
organization: Organization["uuid"];
|
|
12
|
+
}
|
|
13
|
+
export interface ProcedureTypeAttachment extends UUIDModel, TimestampedModel, SubmittedAtModel, RequiredFileModel, CreatedByModel {
|
|
14
|
+
procedure_type: ProcedureType["uuid"];
|
|
15
|
+
}
|
|
16
|
+
export interface ProcedureStep extends UUIDModel, TimestampedModel, ColorModel, SubmittedAtModel, CreatedByModel {
|
|
17
|
+
procedure_type: ProcedureType["uuid"];
|
|
18
|
+
name: string;
|
|
19
|
+
order: number;
|
|
20
|
+
}
|
|
21
|
+
export interface ProcedureStepFields extends UUIDModel, TimestampedModel, SubmittedAtModel, CreatedByModel, FieldsModel {
|
|
22
|
+
procedure_step: ProcedureStep["uuid"];
|
|
23
|
+
field_conditions?: JSONCondition[] | null;
|
|
24
|
+
}
|
|
25
|
+
export interface ProcedureTypeFields extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel, FieldsModel {
|
|
26
|
+
procedure_type: ProcedureType["uuid"];
|
|
27
|
+
}
|
|
28
|
+
export interface ProcedureTypeFieldsAttachment extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel, FieldsAttachmentModel {
|
|
29
|
+
fields_revision: ProcedureTypeFields["uuid"];
|
|
30
|
+
}
|
|
31
|
+
export interface ProcedureFieldValues extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel, FieldValuesModel {
|
|
32
|
+
fields_revision: ProcedureTypeFields["uuid"];
|
|
33
|
+
procedure: Procedure["uuid"];
|
|
34
|
+
}
|
|
35
|
+
export interface ProcedureFieldValuesAttachment extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel, FieldsAttachmentModel {
|
|
36
|
+
field_values: ProcedureFieldValues["uuid"];
|
|
37
|
+
}
|
|
38
|
+
export interface ProcedureStepFieldsAttachment extends UUIDModel, TimestampedModel, SubmittedAtModel, CreatedByModel, FieldsAttachmentModel {
|
|
39
|
+
fields_revision: ProcedureStepFields["uuid"];
|
|
40
|
+
}
|
|
41
|
+
export interface Procedure extends UUIDModel, TimestampedModel, SubmittedAtModel, IndexedModel, CreatedByModel {
|
|
42
|
+
procedure_type: ProcedureType["uuid"];
|
|
43
|
+
project: Project["uuid"];
|
|
44
|
+
asset: Asset["uuid"];
|
|
45
|
+
procedure_initiative: ProcedureInitiative["uuid"] | null;
|
|
46
|
+
}
|
|
47
|
+
export interface ProcedureStepAssignee extends UUIDModel, TimestampedModel, SubmittedAtModel, CreatedByModel {
|
|
48
|
+
procedure: Procedure["uuid"];
|
|
49
|
+
procedure_step: ProcedureStep["uuid"];
|
|
50
|
+
user: User["id"];
|
|
51
|
+
}
|
|
52
|
+
export interface ProcedureStepComment extends UUIDModel, TimestampedModel, SubmittedAtModel, CreatedByModel {
|
|
53
|
+
procedure: Procedure["uuid"];
|
|
54
|
+
procedure_step: ProcedureStep["uuid"];
|
|
55
|
+
content: string;
|
|
56
|
+
resolved: boolean;
|
|
57
|
+
}
|
|
58
|
+
export type ProcedureStepEventTypeValueMapping = {
|
|
59
|
+
[ProcedureStepEventType.ADD_ASSIGNEE]: number;
|
|
60
|
+
[ProcedureStepEventType.REMOVE_ASSIGNEE]: number;
|
|
61
|
+
[ProcedureStepEventType.ADD_REVIEWER]: number;
|
|
62
|
+
[ProcedureStepEventType.REMOVE_REVIEWER]: number;
|
|
63
|
+
};
|
|
64
|
+
export type ProcedureEventEventTypeValueDiscriminator = {
|
|
65
|
+
[TType in ProcedureStepEventType]: {
|
|
66
|
+
type: TType;
|
|
67
|
+
value: ProcedureStepEventTypeValueMapping[TType];
|
|
68
|
+
};
|
|
69
|
+
}[ProcedureStepEventType];
|
|
70
|
+
export type ProcedureStepEvent = UUIDModel & TimestampedModel & CreatedByModel & ProcedureEventEventTypeValueDiscriminator & {
|
|
71
|
+
procedure: Procedure["uuid"];
|
|
72
|
+
procedure_step: ProcedureStep["uuid"];
|
|
73
|
+
};
|
|
74
|
+
export interface ProcedureStepFieldValues extends UUIDModel, TimestampedModel, SubmittedAtModel, CreatedByModel, FieldValuesModel {
|
|
75
|
+
procedure: Procedure["uuid"];
|
|
76
|
+
procedure_step: ProcedureStep["uuid"];
|
|
77
|
+
fields_revision: ProcedureStepFields["uuid"];
|
|
78
|
+
}
|
|
79
|
+
export interface ProcedureStepFieldValuesAttachment extends UUIDModel, TimestampedModel, SubmittedAtModel, CreatedByModel, FieldsAttachmentModel {
|
|
80
|
+
field_values: ProcedureStepFieldValues["uuid"];
|
|
81
|
+
}
|
|
82
|
+
export interface ProcedureStepFieldValuesReview extends UUIDModel, TimestampedModel, SubmittedAtModel, CreatedByModel {
|
|
83
|
+
field_values: ProcedureStepFieldValues["uuid"];
|
|
84
|
+
content: string;
|
|
85
|
+
type: ProcedureStepFieldValuesReviewType;
|
|
86
|
+
}
|
|
87
|
+
export interface ProcedureStepReviewer extends UUIDModel, TimestampedModel, SubmittedAtModel, CreatedByModel {
|
|
88
|
+
procedure: Procedure["uuid"];
|
|
89
|
+
procedure_step: ProcedureStep["uuid"];
|
|
90
|
+
user: User["id"];
|
|
91
|
+
}
|
|
92
|
+
export interface ProcedureStepDefaultAssignee extends UUIDModel, TimestampedModel, SubmittedAtModel, CreatedByModel {
|
|
93
|
+
procedure_step: ProcedureStep["uuid"];
|
|
94
|
+
user: User["id"];
|
|
95
|
+
}
|
|
96
|
+
export interface ProcedureStepDefaultReviewer extends UUIDModel, TimestampedModel, SubmittedAtModel, CreatedByModel {
|
|
97
|
+
procedure_step: ProcedureStep["uuid"];
|
|
98
|
+
user: User["id"];
|
|
99
|
+
}
|
|
100
|
+
export interface ProcedureInitiative extends UUIDModel, TimestampedModel, SubmittedAtModel, IndexedModel, CreatedByModel {
|
|
101
|
+
procedure_type: ProcedureType["uuid"];
|
|
102
|
+
project: Project["uuid"];
|
|
103
|
+
asset_type: AssetType["uuid"];
|
|
104
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BoundableModel, CreatedByModel, PolygonBoundedModel, RequiredFileModel, SubmittedAtModel, TimestampedModel, UUIDModel } from './base';
|
|
2
|
+
import { Organization, OrganizationAccess } from './organizations';
|
|
3
|
+
import { User } from './users';
|
|
4
|
+
export interface Project extends UUIDModel, TimestampedModel, PolygonBoundedModel, CreatedByModel {
|
|
5
|
+
name: string;
|
|
6
|
+
organization: Organization["uuid"];
|
|
7
|
+
}
|
|
8
|
+
export interface ProjectComment extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel {
|
|
9
|
+
project: Project["uuid"];
|
|
10
|
+
content: string;
|
|
11
|
+
resolved: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface ProjectFile extends UUIDModel, SubmittedAtModel, TimestampedModel, RequiredFileModel, BoundableModel, CreatedByModel {
|
|
14
|
+
z_index: number;
|
|
15
|
+
project: Project["uuid"];
|
|
16
|
+
}
|
|
17
|
+
export interface ProjectAccess extends UUIDModel, CreatedByModel, TimestampedModel {
|
|
18
|
+
user: User["id"];
|
|
19
|
+
project: Project["uuid"];
|
|
20
|
+
organization_access: OrganizationAccess["uuid"];
|
|
21
|
+
}
|
|
22
|
+
export interface ProjectAttachment extends UUIDModel, TimestampedModel, SubmittedAtModel, RequiredFileModel, CreatedByModel {
|
|
23
|
+
project: Project["uuid"];
|
|
24
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AbbreviationModel, ColorModel, CreatedByModel, IconModel, SubmittedAtModel, TimestampedModel, TreeModel, UUIDModel } from './base';
|
|
2
|
+
import { Organization, OrganizationAccess } from './organizations';
|
|
3
|
+
import { User } from './users';
|
|
4
|
+
export interface Team extends UUIDModel, TimestampedModel, SubmittedAtModel, IconModel, ColorModel, CreatedByModel, AbbreviationModel, TreeModel<string> {
|
|
5
|
+
name: string;
|
|
6
|
+
organization: Organization["uuid"];
|
|
7
|
+
}
|
|
8
|
+
export interface TeamMembership extends UUIDModel, TimestampedModel, CreatedByModel {
|
|
9
|
+
team: Team["uuid"];
|
|
10
|
+
user: User["id"];
|
|
11
|
+
organization_access: OrganizationAccess["uuid"];
|
|
12
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { UUIDModel } from './base';
|
|
2
|
+
export type UUIDModelMapping<TModel extends UUIDModel> = Record<TModel["uuid"], TModel>;
|
|
3
|
+
type FilteredKeys<T> = {
|
|
4
|
+
[P in keyof T]: T[P] extends never ? never : P;
|
|
5
|
+
}[keyof T];
|
|
6
|
+
type ExcludeNeverFields<O> = {
|
|
7
|
+
[K in FilteredKeys<O>]: O[K];
|
|
8
|
+
};
|
|
9
|
+
type PropertyUndefined<T> = {
|
|
10
|
+
[P in keyof T]?: T[P];
|
|
11
|
+
};
|
|
12
|
+
export type CommonAutoFields = "created_at" | "updated_at" | "index" | "revision";
|
|
13
|
+
/**
|
|
14
|
+
* Represents a model instance that has been submitted to the backend. Some properties (depending on which model, but in
|
|
15
|
+
* all cases, the `offline_id`) are guaranteed to be set.
|
|
16
|
+
*/
|
|
17
|
+
export type Submitted<TModel> = Omit<TModel, CommonAutoFields> & PropertyUndefined<ExcludeNeverFields<{
|
|
18
|
+
created_at: "created_at" extends keyof TModel ? undefined : never;
|
|
19
|
+
updated_at: "updated_at" extends keyof TModel ? undefined : never;
|
|
20
|
+
index: "index" extends keyof TModel ? undefined : never;
|
|
21
|
+
revision: "revision" extends keyof TModel ? undefined : never;
|
|
22
|
+
}>>;
|
|
23
|
+
/**
|
|
24
|
+
* Represents a model instance that has been submitted to the backend, accepted, then downloaded. Created models
|
|
25
|
+
* typically have additional properties that are only known once it has been processed and accepted by the API, such as
|
|
26
|
+
* the `created_at` timestamp, which is the time at which the data was written to the database.
|
|
27
|
+
*/
|
|
28
|
+
export type Created<TModel> = TModel;
|
|
29
|
+
/**
|
|
30
|
+
* Model instances that are stored in the Redux store can be already-created (and will likely be gotten with the initial
|
|
31
|
+
* data load), or to-be-created. In the former case, you will get a `Created<TModel>`. In the latter case, you will get
|
|
32
|
+
* a `Submitted<TModel>`.
|
|
33
|
+
*/
|
|
34
|
+
export type Stored<TModel> = Created<TModel> | Submitted<TModel>;
|
|
35
|
+
export type Payload<TModel> = Omit<TModel, CommonAutoFields | "uuid" | "id" | "submitted_at" | "created_by">;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function chunkArray<T>(arr: T[], chunkSize: number): T[][];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const fallbackToEmptyArray: <T>(array: T[]) => T[];
|
|
2
|
+
export declare const fallbackToEmptyObject: <T extends object>(object: T) => T;
|
|
3
|
+
export declare const fallbackToEmptySet: <T>(set: Set<T>) => Set<T>;
|
|
4
|
+
export declare const fallbackToEmptyMap: <TKey, TValue>(map: Map<TKey, TValue>) => Map<TKey, TValue>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isAbortError(value: unknown): value is Error;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Asset, AssetTypeStatus, Stored } from '../../typings';
|
|
2
|
+
export declare const assetTypeStatusSortFn: (a: Stored<AssetTypeStatus>, b: Stored<AssetTypeStatus>) => number;
|
|
3
|
+
export declare const assetFilterCallback: (asset: Stored<Asset>, filterValue: string) => boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SubmittedAtModel, UUIDModel } from '../../typings';
|
|
2
|
+
export declare function uuidModelSortFn<TModel extends UUIDModel>(a: TModel, b: TModel): number;
|
|
3
|
+
export declare const submittedAtModelSortFn: <TModel extends SubmittedAtModel>(a: TModel, b: TModel) => 0 | 1 | -1;
|
|
4
|
+
export declare const nameModelSortFn: <TModel extends {
|
|
5
|
+
name: string;
|
|
6
|
+
}>(a: TModel, b: TModel) => number;
|
|
7
|
+
export declare const nameModelFilterFn: <TModel extends {
|
|
8
|
+
name: string;
|
|
9
|
+
}>(model: TModel, filterValue: string) => boolean;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Tree } from 'ts-tree-lib';
|
|
2
|
+
import { Document, Stored } from '../../typings';
|
|
3
|
+
export declare const getDocumentTrees: (documents: Stored<Document>[]) => Tree<Stored<Document>>[];
|
|
4
|
+
export declare const getDocumentSubTree: (uuid: Document["uuid"], documents: Stored<Document>[]) => Tree<Stored<Document>>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Issue, IssueTypePriority, IssueTypeStatus, Stored } from '../../typings';
|
|
2
|
+
export declare const issueTypeStatusSortFn: (a: Stored<IssueTypeStatus>, b: Stored<IssueTypeStatus>) => number;
|
|
3
|
+
export declare const issueTypePrioritySortFn: (a: Stored<IssueTypePriority>, b: Stored<IssueTypePriority>) => number;
|
|
4
|
+
export declare const issueFilterCallback: (issue: Stored<Issue>, filterValue: string) => boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Given a string, returns a truncated version of it with an ellipsis character at the end if it is longer than
|
|
3
|
+
* maxLength. The resulting string will be no longer than maxLength. Note that the ellipsis is only one character long.
|
|
4
|
+
* @param str The string to truncate.
|
|
5
|
+
* @param maxLength The maximum length of the resulting string, including the ellipsis.
|
|
6
|
+
*/
|
|
7
|
+
export declare function truncate(str: string, maxLength: number): string;
|
|
8
|
+
export declare function pluralize(str: string, count: number): string;
|
|
9
|
+
export declare function generateAbbreviation(str: string): string;
|
|
10
|
+
export declare function includesLowercase(string: string, stringToInclude: string): boolean;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { UUID, UUIDModel } from '../typings';
|
|
2
|
+
export declare function uuidObj<T>(draft: T): UUID<T>;
|
|
3
|
+
export declare function toUuidIdRecord<TModel extends UUIDModel>(array: TModel[]): Record<string, TModel>;
|
|
4
|
+
export declare function toUuidArray<TModel extends UUIDModel>(array: TModel[]): string[];
|
|
5
|
+
export declare function uuidSortFn(a: string, b: string): number;
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@overmap-ai/common",
|
|
3
|
+
"version": "0.0.1-more-code-dump.0",
|
|
4
|
+
"license": "UNLICENSED",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"type": "module",
|
|
9
|
+
"sideEffects": false,
|
|
10
|
+
"main": "./dist/index.cjs",
|
|
11
|
+
"module": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.js",
|
|
17
|
+
"require": "./dist/index.cjs",
|
|
18
|
+
"default": "./dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./package.json": "./package.json"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"dev": "vite",
|
|
24
|
+
"build": "tsc && vite build",
|
|
25
|
+
"preview": "vite preview",
|
|
26
|
+
"type-check": "tsc --noEmit",
|
|
27
|
+
"lint": "oxlint --deny-warnings",
|
|
28
|
+
"lint:fix": "yarn lint --fix",
|
|
29
|
+
"format": "oxfmt",
|
|
30
|
+
"format:check": "yarn format --check"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@adrekic/fieldsjson": "^0.0.2",
|
|
34
|
+
"@tiptap/core": "3.10.4",
|
|
35
|
+
"@types/geojson": "7946.0.16",
|
|
36
|
+
"fast-tree-builder": "2.0.3",
|
|
37
|
+
"ts-tree-lib": "1.0.3",
|
|
38
|
+
"uuid": "11.1.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@types/node": "24.1.0",
|
|
42
|
+
"oxfmt": "0.61.0",
|
|
43
|
+
"oxlint": "1.76.0",
|
|
44
|
+
"oxlint-tsgolint": "7.0.2001",
|
|
45
|
+
"typescript": "~6.0.2",
|
|
46
|
+
"vite": "^8.3.0",
|
|
47
|
+
"vite-plugin-dts": "5.0.3"
|
|
48
|
+
},
|
|
49
|
+
"volta": {
|
|
50
|
+
"node": "24.11.0",
|
|
51
|
+
"yarn": "4.12.0"
|
|
52
|
+
}
|
|
53
|
+
}
|