@abyss-project/tools 1.1.1 → 1.2.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/.eslintrc.js +33 -33
- package/.prettierrc +5 -5
- package/README.md +32 -32
- package/dist/api/extraction-plan-preset.api.js +1 -1
- package/dist/api/extraction-plan-preset.api.js.map +1 -1
- package/dist/api/extraction-settings.api.js +1 -1
- package/dist/api/extraction-settings.api.js.map +1 -1
- package/dist/api/extraction.api.js +1 -1
- package/dist/api/extraction.api.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/shape.utils.js +18 -18
- package/package.json +14 -9
- package/src/api/abyss.admin.api.ts +54 -54
- package/src/api/atlas-document.api.ts +68 -68
- package/src/api/atlas-group.api.ts +69 -69
- package/src/api/atlas-page.api.ts +124 -124
- package/src/api/atlas.api.ts +103 -103
- package/src/api/atlas.public.api.ts +42 -42
- package/src/api/board-card-checklist.api.ts +99 -99
- package/src/api/board-card-comment.api.ts +57 -57
- package/src/api/board-card-document.api.ts +57 -57
- package/src/api/board-card.api.ts +137 -137
- package/src/api/board-column.api.ts +54 -54
- package/src/api/board-label.api.ts +87 -87
- package/src/api/board.api.ts +122 -122
- package/src/api/draw.api.ts +97 -97
- package/src/api/draw.public.api.ts +48 -48
- package/src/api/extraction-plan-preset.api.ts +1 -1
- package/src/api/extraction-settings.api.ts +1 -1
- package/src/api/extraction.api.ts +1 -1
- package/src/api/memo.api.ts +97 -97
- package/src/api/metrics.api.ts +27 -27
- package/src/api/monitor.api.ts +6 -6
- package/src/api/organization.api.ts +14 -14
- package/src/api/retrospective-card.api.ts +74 -74
- package/src/api/retrospective-member.api.ts +54 -54
- package/src/api/retrospective-section.api.ts +74 -74
- package/src/api/retrospective.api.ts +124 -124
- package/src/api/retrospective.public.api.ts +147 -147
- package/src/api/short-link.admin.api.ts +39 -39
- package/src/api/short-link.api.ts +125 -125
- package/src/api/short-link.public.api.ts +60 -60
- package/src/api/tag.api.ts +72 -72
- package/src/constants/atlas.constants.ts +2 -2
- package/src/constants/board.constants.ts +7 -7
- package/src/constants/memo.constants.ts +3 -3
- package/src/constants/short-link.constants.ts +11 -11
- package/src/constants/tag.constants.ts +3 -3
- package/src/index.ts +1 -1
- package/src/server-sent-events/index.ts +13 -13
- package/src/server-sent-events/protocols/atlas/atlas.sse-protocol.ts +90 -90
- package/src/server-sent-events/protocols/atlas/index.ts +1 -1
- package/src/server-sent-events/protocols/board/board.sse-protocol.ts +115 -115
- package/src/server-sent-events/protocols/board/index.ts +1 -1
- package/src/server-sent-events/protocols/board-card/board-card.sse-protocol.ts +26 -26
- package/src/server-sent-events/protocols/board-card/index.ts +1 -1
- package/src/server-sent-events/protocols/index.ts +26 -26
- package/src/server-sent-events/protocols/retrospective/index.ts +1 -1
- package/src/server-sent-events/protocols/retrospective/retrospective.sse-protocol.ts +92 -92
- package/src/server-sent-events/server-sent-events.manager.ts +73 -73
- package/src/types/draw.type.ts +173 -173
- package/src/types/enum/api-error.enum.ts +23 -23
- package/src/types/enum/board-activity.enum.ts +189 -189
- package/src/types/enum/board-column-type.enum.ts +6 -6
- package/src/types/enum/pdf-operation.enum.ts +98 -98
- package/src/types/enum/rcb-bank.enum.ts +137 -137
- package/src/types/index.ts +5 -5
- package/src/types/interface/api/index.ts +5 -5
- package/src/types/interface/api/requests/abyss.admin.request.ts +20 -20
- package/src/types/interface/api/requests/atlas-document.request.ts +32 -32
- package/src/types/interface/api/requests/atlas-group.request.ts +45 -45
- package/src/types/interface/api/requests/atlas-page.request.ts +84 -84
- package/src/types/interface/api/requests/atlas.public.request.ts +21 -21
- package/src/types/interface/api/requests/atlas.request.ts +52 -52
- package/src/types/interface/api/requests/board-card-checklist.request.ts +61 -61
- package/src/types/interface/api/requests/board-card-comment.request.ts +28 -28
- package/src/types/interface/api/requests/board-card-document.request.ts +29 -29
- package/src/types/interface/api/requests/board-card.request.ts +86 -86
- package/src/types/interface/api/requests/board-column.request.ts +30 -30
- package/src/types/interface/api/requests/board-label.request.ts +42 -42
- package/src/types/interface/api/requests/board.request.ts +61 -61
- package/src/types/interface/api/requests/draw.public.request.ts +20 -20
- package/src/types/interface/api/requests/draw.request.ts +49 -49
- package/src/types/interface/api/requests/memo.request.ts +49 -49
- package/src/types/interface/api/requests/metrics.request.ts +7 -7
- package/src/types/interface/api/requests/retrospective-card.request.ts +38 -38
- package/src/types/interface/api/requests/retrospective-member.request.ts +20 -20
- package/src/types/interface/api/requests/retrospective-section.request.ts +43 -43
- package/src/types/interface/api/requests/retrospective.public.request.ts +84 -84
- package/src/types/interface/api/requests/retrospective.request.ts +59 -59
- package/src/types/interface/api/requests/short-link.admin.request.ts +35 -35
- package/src/types/interface/api/requests/short-link.public.request.ts +40 -40
- package/src/types/interface/api/requests/short-link.request.ts +71 -71
- package/src/types/interface/api/requests/tag.request.ts +54 -54
- package/src/types/interface/api/requests/transfer.request.ts +3 -3
- package/src/types/interface/api/responses/abyss.admin.response.ts +28 -28
- package/src/types/interface/api/responses/atlas-document.response.ts +24 -24
- package/src/types/interface/api/responses/atlas-group.response.ts +23 -23
- package/src/types/interface/api/responses/atlas-page.response.ts +53 -53
- package/src/types/interface/api/responses/atlas.public.response.ts +21 -21
- package/src/types/interface/api/responses/atlas.response.ts +32 -32
- package/src/types/interface/api/responses/board-card-checklist.response.ts +31 -31
- package/src/types/interface/api/responses/board-card-comment.response.ts +20 -20
- package/src/types/interface/api/responses/board-card-document.response.ts +21 -21
- package/src/types/interface/api/responses/board-card.response.ts +55 -55
- package/src/types/interface/api/responses/board-column.response.ts +20 -20
- package/src/types/interface/api/responses/board-label.response.ts +31 -31
- package/src/types/interface/api/responses/board.response.ts +81 -81
- package/src/types/interface/api/responses/count.response.ts +9 -9
- package/src/types/interface/api/responses/draw.public.response.ts +22 -22
- package/src/types/interface/api/responses/draw.response.ts +32 -32
- package/src/types/interface/api/responses/enriched-paginate.response.ts +11 -11
- package/src/types/interface/api/responses/memo.response.ts +32 -32
- package/src/types/interface/api/responses/metrics.response.ts +22 -22
- package/src/types/interface/api/responses/monitor.response.ts +8 -8
- package/src/types/interface/api/responses/recent.response.ts +18 -18
- package/src/types/interface/api/responses/retrospective-card.response.ts +23 -23
- package/src/types/interface/api/responses/retrospective-member.response.ts +22 -22
- package/src/types/interface/api/responses/retrospective-section.response.ts +23 -23
- package/src/types/interface/api/responses/retrospective.public.response.ts +57 -57
- package/src/types/interface/api/responses/retrospective.response.ts +32 -32
- package/src/types/interface/api/responses/short-link.admin.response.ts +21 -21
- package/src/types/interface/api/responses/short-link.public.response.ts +26 -26
- package/src/types/interface/api/responses/short-link.response.ts +38 -38
- package/src/types/interface/api/responses/tag.response.ts +38 -38
- package/src/types/interface/api/responses/transfer.response.ts +14 -14
- package/src/types/interface/api/type-message/api-error.ts +7 -7
- package/src/types/interface/api/type-message/base-paginate.ts +11 -11
- package/src/types/interface/api/type-message/response.ts +6 -6
- package/src/types/interface/index.ts +2 -2
- package/src/types/interface/models/atlas-document.dto.ts +22 -22
- package/src/types/interface/models/atlas-group.dto.ts +21 -21
- package/src/types/interface/models/atlas-page-content.dto.ts +17 -17
- package/src/types/interface/models/atlas-page.dto.ts +26 -26
- package/src/types/interface/models/atlas.dto.ts +34 -34
- package/src/types/interface/models/board-activity.dto.ts +20 -20
- package/src/types/interface/models/board-card-checklist-row.dto.ts +14 -14
- package/src/types/interface/models/board-card-checklist.dto.ts +16 -16
- package/src/types/interface/models/board-card-comment.dto.ts +15 -15
- package/src/types/interface/models/board-card-document.dto.ts +22 -22
- package/src/types/interface/models/board-card-label.dto.ts +14 -14
- package/src/types/interface/models/board-card-member.dto.ts +14 -14
- package/src/types/interface/models/board-card.dto.ts +37 -37
- package/src/types/interface/models/board-column.dto.ts +17 -17
- package/src/types/interface/models/board-label.dto.ts +13 -13
- package/src/types/interface/models/board.dto.ts +33 -33
- package/src/types/interface/models/content-share.dto.ts +16 -16
- package/src/types/interface/models/draw.dto.ts +30 -30
- package/src/types/interface/models/memo.dto.ts +23 -23
- package/src/types/interface/models/project.dto.ts +25 -25
- package/src/types/interface/models/retrospective-card.dto.ts +17 -17
- package/src/types/interface/models/retrospective-member.dto.ts +15 -15
- package/src/types/interface/models/retrospective-section.dto.ts +16 -16
- package/src/types/interface/models/retrospective.dto.ts +32 -32
- package/src/types/interface/models/short-link-click.dto.ts +33 -33
- package/src/types/interface/models/short-link.dto.ts +49 -49
- package/src/types/interface/models/tag.dto.ts +26 -26
- package/src/types/interface/models/team.dto.ts +12 -12
- package/src/types/interface/models/user.dto.ts +26 -26
- package/src/utils/board.utils.ts +57 -57
- package/src/utils/enum.utils.ts +5 -5
- package/src/utils/error.utils.ts +30 -30
- package/src/utils/icons.utils.ts +96 -96
- package/src/utils/shape.utils.ts +292 -292
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { IShortLink } from './short-link.dto';
|
|
2
|
-
|
|
3
|
-
export interface IShortLinkClick {
|
|
4
|
-
id: string;
|
|
5
|
-
shortLinkId: string;
|
|
6
|
-
ipAddress: string | null;
|
|
7
|
-
ipHash: string;
|
|
8
|
-
userAgent: string | null;
|
|
9
|
-
referer: string | null;
|
|
10
|
-
refererDomain: string | null;
|
|
11
|
-
/** Code pays ISO-3 (ex: "FRA", "USA", "DEU") */
|
|
12
|
-
countryCodeIso: string | null;
|
|
13
|
-
countryCode: string | null;
|
|
14
|
-
countryName: string | null;
|
|
15
|
-
continentCode: string | null;
|
|
16
|
-
city: string | null;
|
|
17
|
-
device: string | null;
|
|
18
|
-
browser: string | null;
|
|
19
|
-
os: string | null;
|
|
20
|
-
language: string | null;
|
|
21
|
-
utmSource: string | null;
|
|
22
|
-
utmMedium: string | null;
|
|
23
|
-
utmCampaign: string | null;
|
|
24
|
-
utmTerm: string | null;
|
|
25
|
-
utmContent: string | null;
|
|
26
|
-
isBotLikely: boolean;
|
|
27
|
-
isReturningVisitor: boolean;
|
|
28
|
-
clickedAt: Date;
|
|
29
|
-
createdAt?: Date;
|
|
30
|
-
updatedAt?: Date;
|
|
31
|
-
|
|
32
|
-
shortLink?: IShortLink;
|
|
33
|
-
}
|
|
1
|
+
import { IShortLink } from './short-link.dto';
|
|
2
|
+
|
|
3
|
+
export interface IShortLinkClick {
|
|
4
|
+
id: string;
|
|
5
|
+
shortLinkId: string;
|
|
6
|
+
ipAddress: string | null;
|
|
7
|
+
ipHash: string;
|
|
8
|
+
userAgent: string | null;
|
|
9
|
+
referer: string | null;
|
|
10
|
+
refererDomain: string | null;
|
|
11
|
+
/** Code pays ISO-3 (ex: "FRA", "USA", "DEU") */
|
|
12
|
+
countryCodeIso: string | null;
|
|
13
|
+
countryCode: string | null;
|
|
14
|
+
countryName: string | null;
|
|
15
|
+
continentCode: string | null;
|
|
16
|
+
city: string | null;
|
|
17
|
+
device: string | null;
|
|
18
|
+
browser: string | null;
|
|
19
|
+
os: string | null;
|
|
20
|
+
language: string | null;
|
|
21
|
+
utmSource: string | null;
|
|
22
|
+
utmMedium: string | null;
|
|
23
|
+
utmCampaign: string | null;
|
|
24
|
+
utmTerm: string | null;
|
|
25
|
+
utmContent: string | null;
|
|
26
|
+
isBotLikely: boolean;
|
|
27
|
+
isReturningVisitor: boolean;
|
|
28
|
+
clickedAt: Date;
|
|
29
|
+
createdAt?: Date;
|
|
30
|
+
updatedAt?: Date;
|
|
31
|
+
|
|
32
|
+
shortLink?: IShortLink;
|
|
33
|
+
}
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { IOrganization } from './organization.dto';
|
|
2
|
-
import { IUser } from './user.dto';
|
|
3
|
-
import { IProject } from './project.dto';
|
|
4
|
-
import { IShortLinkClick } from './short-link-click.dto';
|
|
5
|
-
import { IEntityTag } from './tag.dto';
|
|
6
|
-
|
|
7
|
-
export interface IShortLink {
|
|
8
|
-
id: string;
|
|
9
|
-
slug: string;
|
|
10
|
-
originalUrl: string;
|
|
11
|
-
title: string | null;
|
|
12
|
-
description: string | null;
|
|
13
|
-
userId: string | null;
|
|
14
|
-
projectId: string | null;
|
|
15
|
-
organizationId: string | null;
|
|
16
|
-
createdByUserId: string | null;
|
|
17
|
-
isActive: boolean;
|
|
18
|
-
clickCount: number;
|
|
19
|
-
uniqueClickCount: number;
|
|
20
|
-
lastClickedAt: Date | null;
|
|
21
|
-
expiresAt: Date | null;
|
|
22
|
-
maxClicks: number | null;
|
|
23
|
-
password: string | null;
|
|
24
|
-
createdAt?: Date;
|
|
25
|
-
updatedAt?: Date;
|
|
26
|
-
deletedAt?: Date | null;
|
|
27
|
-
|
|
28
|
-
user?: IUser | null;
|
|
29
|
-
project?: IProject | null;
|
|
30
|
-
organization?: IOrganization | null;
|
|
31
|
-
shortLinkClicks?: IShortLinkClick[];
|
|
32
|
-
entityTags?: IEntityTag[];
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface IShortLinkWithStats extends IShortLink {
|
|
36
|
-
stats?: {
|
|
37
|
-
clicksByDay: { date: string; clicks: number; uniqueClicks: number }[];
|
|
38
|
-
clicksByCountry: { country: string; clicks: number; countryName: string }[];
|
|
39
|
-
clicksByDevice: { device: string; clicks: number }[];
|
|
40
|
-
clicksByBrowser: { browser: string; clicks: number }[];
|
|
41
|
-
clicksByReferer: { referer: string; clicks: number }[];
|
|
42
|
-
clicksByUtmSource: { utmSource: string; clicks: number }[];
|
|
43
|
-
clicksByLanguage: { language: string; clicks: number }[];
|
|
44
|
-
clicksByRefererDomain: { refererDomain: string; clicks: number }[];
|
|
45
|
-
clicksLast24h: number;
|
|
46
|
-
returningVisitorsCount: number;
|
|
47
|
-
botClicksCount: number;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
1
|
+
import { IOrganization } from './organization.dto';
|
|
2
|
+
import { IUser } from './user.dto';
|
|
3
|
+
import { IProject } from './project.dto';
|
|
4
|
+
import { IShortLinkClick } from './short-link-click.dto';
|
|
5
|
+
import { IEntityTag } from './tag.dto';
|
|
6
|
+
|
|
7
|
+
export interface IShortLink {
|
|
8
|
+
id: string;
|
|
9
|
+
slug: string;
|
|
10
|
+
originalUrl: string;
|
|
11
|
+
title: string | null;
|
|
12
|
+
description: string | null;
|
|
13
|
+
userId: string | null;
|
|
14
|
+
projectId: string | null;
|
|
15
|
+
organizationId: string | null;
|
|
16
|
+
createdByUserId: string | null;
|
|
17
|
+
isActive: boolean;
|
|
18
|
+
clickCount: number;
|
|
19
|
+
uniqueClickCount: number;
|
|
20
|
+
lastClickedAt: Date | null;
|
|
21
|
+
expiresAt: Date | null;
|
|
22
|
+
maxClicks: number | null;
|
|
23
|
+
password: string | null;
|
|
24
|
+
createdAt?: Date;
|
|
25
|
+
updatedAt?: Date;
|
|
26
|
+
deletedAt?: Date | null;
|
|
27
|
+
|
|
28
|
+
user?: IUser | null;
|
|
29
|
+
project?: IProject | null;
|
|
30
|
+
organization?: IOrganization | null;
|
|
31
|
+
shortLinkClicks?: IShortLinkClick[];
|
|
32
|
+
entityTags?: IEntityTag[];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface IShortLinkWithStats extends IShortLink {
|
|
36
|
+
stats?: {
|
|
37
|
+
clicksByDay: { date: string; clicks: number; uniqueClicks: number }[];
|
|
38
|
+
clicksByCountry: { country: string; clicks: number; countryName: string }[];
|
|
39
|
+
clicksByDevice: { device: string; clicks: number }[];
|
|
40
|
+
clicksByBrowser: { browser: string; clicks: number }[];
|
|
41
|
+
clicksByReferer: { referer: string; clicks: number }[];
|
|
42
|
+
clicksByUtmSource: { utmSource: string; clicks: number }[];
|
|
43
|
+
clicksByLanguage: { language: string; clicks: number }[];
|
|
44
|
+
clicksByRefererDomain: { refererDomain: string; clicks: number }[];
|
|
45
|
+
clicksLast24h: number;
|
|
46
|
+
returningVisitorsCount: number;
|
|
47
|
+
botClicksCount: number;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
export interface ITag {
|
|
2
|
-
id: string;
|
|
3
|
-
name: string;
|
|
4
|
-
color: string;
|
|
5
|
-
userId: string;
|
|
6
|
-
organizationId: string | null;
|
|
7
|
-
createdAt?: Date;
|
|
8
|
-
updatedAt?: Date;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// Junction type for entity-tag relationships
|
|
12
|
-
export interface IEntityTag {
|
|
13
|
-
id: string;
|
|
14
|
-
entityId: string;
|
|
15
|
-
entityType: string;
|
|
16
|
-
tagId: string;
|
|
17
|
-
createdAt?: Date;
|
|
18
|
-
tag?: ITag | null;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// Stats entry for tag usage counts
|
|
22
|
-
export interface ITagStatEntry {
|
|
23
|
-
tagId: string;
|
|
24
|
-
entityType: string;
|
|
25
|
-
count: number;
|
|
26
|
-
}
|
|
1
|
+
export interface ITag {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
color: string;
|
|
5
|
+
userId: string;
|
|
6
|
+
organizationId: string | null;
|
|
7
|
+
createdAt?: Date;
|
|
8
|
+
updatedAt?: Date;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Junction type for entity-tag relationships
|
|
12
|
+
export interface IEntityTag {
|
|
13
|
+
id: string;
|
|
14
|
+
entityId: string;
|
|
15
|
+
entityType: string;
|
|
16
|
+
tagId: string;
|
|
17
|
+
createdAt?: Date;
|
|
18
|
+
tag?: ITag | null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Stats entry for tag usage counts
|
|
22
|
+
export interface ITagStatEntry {
|
|
23
|
+
tagId: string;
|
|
24
|
+
entityType: string;
|
|
25
|
+
count: number;
|
|
26
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { IOrganization } from './organization.dto';
|
|
2
|
-
|
|
3
|
-
export interface ITeam {
|
|
4
|
-
id?: string;
|
|
5
|
-
organizationId: string;
|
|
6
|
-
name: string;
|
|
7
|
-
updatedAt?: Date;
|
|
8
|
-
createdAt?: Date;
|
|
9
|
-
|
|
10
|
-
// Associations
|
|
11
|
-
organization?: IOrganization;
|
|
12
|
-
}
|
|
1
|
+
import { IOrganization } from './organization.dto';
|
|
2
|
+
|
|
3
|
+
export interface ITeam {
|
|
4
|
+
id?: string;
|
|
5
|
+
organizationId: string;
|
|
6
|
+
name: string;
|
|
7
|
+
updatedAt?: Date;
|
|
8
|
+
createdAt?: Date;
|
|
9
|
+
|
|
10
|
+
// Associations
|
|
11
|
+
organization?: IOrganization;
|
|
12
|
+
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { IAtlas } from './atlas.dto';
|
|
2
|
-
import { IBoard } from './board.dto';
|
|
3
|
-
import { IBoardCardComment } from './board-card-comment.dto';
|
|
4
|
-
import { IDraw } from './draw.dto';
|
|
5
|
-
import { IMemo } from './memo.dto';
|
|
6
|
-
import { IProject } from './project.dto';
|
|
7
|
-
import { IRetrospective } from './retrospective.dto';
|
|
8
|
-
import { IShortLink } from './short-link.dto';
|
|
9
|
-
|
|
10
|
-
export interface IUser {
|
|
11
|
-
id?: string;
|
|
12
|
-
apiKey: string;
|
|
13
|
-
isAdmin: boolean;
|
|
14
|
-
updatedAt?: Date;
|
|
15
|
-
createdAt?: Date;
|
|
16
|
-
|
|
17
|
-
// Associations
|
|
18
|
-
projects?: IProject[];
|
|
19
|
-
boards?: IBoard[];
|
|
20
|
-
draws?: IDraw[];
|
|
21
|
-
retrospectives?: IRetrospective[];
|
|
22
|
-
atlases?: IAtlas[];
|
|
23
|
-
memos?: IMemo[];
|
|
24
|
-
shortLinks?: IShortLink[];
|
|
25
|
-
boardCardComments?: IBoardCardComment[];
|
|
26
|
-
}
|
|
1
|
+
import { IAtlas } from './atlas.dto';
|
|
2
|
+
import { IBoard } from './board.dto';
|
|
3
|
+
import { IBoardCardComment } from './board-card-comment.dto';
|
|
4
|
+
import { IDraw } from './draw.dto';
|
|
5
|
+
import { IMemo } from './memo.dto';
|
|
6
|
+
import { IProject } from './project.dto';
|
|
7
|
+
import { IRetrospective } from './retrospective.dto';
|
|
8
|
+
import { IShortLink } from './short-link.dto';
|
|
9
|
+
|
|
10
|
+
export interface IUser {
|
|
11
|
+
id?: string;
|
|
12
|
+
apiKey: string;
|
|
13
|
+
isAdmin: boolean;
|
|
14
|
+
updatedAt?: Date;
|
|
15
|
+
createdAt?: Date;
|
|
16
|
+
|
|
17
|
+
// Associations
|
|
18
|
+
projects?: IProject[];
|
|
19
|
+
boards?: IBoard[];
|
|
20
|
+
draws?: IDraw[];
|
|
21
|
+
retrospectives?: IRetrospective[];
|
|
22
|
+
atlases?: IAtlas[];
|
|
23
|
+
memos?: IMemo[];
|
|
24
|
+
shortLinks?: IShortLink[];
|
|
25
|
+
boardCardComments?: IBoardCardComment[];
|
|
26
|
+
}
|
package/src/utils/board.utils.ts
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import { differenceInCalendarDays, isBefore } from 'date-fns';
|
|
2
|
-
import { BoardColumnType, IBoardCard } from '../types';
|
|
3
|
-
|
|
4
|
-
const BOARD_COLUMN_TYPE_STARTED = [BoardColumnType.DOING, BoardColumnType.DONE];
|
|
5
|
-
const BOARD_COLUMN_TYPE_DONE = [BoardColumnType.DONE];
|
|
6
|
-
|
|
7
|
-
export const isCardStartDateLate = (
|
|
8
|
-
boardCard: IBoardCard,
|
|
9
|
-
boardColumnType: BoardColumnType,
|
|
10
|
-
): boolean => {
|
|
11
|
-
if (!boardCard.startDate) {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
return (
|
|
15
|
-
isBefore(new Date(boardCard.startDate), new Date()) &&
|
|
16
|
-
!BOARD_COLUMN_TYPE_STARTED.includes(boardColumnType)
|
|
17
|
-
);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export const isAlmostCardStartDateLate = (
|
|
21
|
-
boardCard: IBoardCard,
|
|
22
|
-
boardColumnType: BoardColumnType,
|
|
23
|
-
): boolean => {
|
|
24
|
-
if (!boardCard.startDate) {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
return (
|
|
28
|
-
!isCardStartDateLate(boardCard, boardColumnType) &&
|
|
29
|
-
differenceInCalendarDays(new Date(boardCard.startDate), new Date()) <= 2
|
|
30
|
-
);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const isCardEndDateLate = (
|
|
34
|
-
boardCard: IBoardCard,
|
|
35
|
-
boardColumnType: BoardColumnType,
|
|
36
|
-
): boolean => {
|
|
37
|
-
if (!boardCard.endDate) {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
return (
|
|
41
|
-
isBefore(new Date(boardCard.endDate), new Date()) &&
|
|
42
|
-
!BOARD_COLUMN_TYPE_DONE.includes(boardColumnType)
|
|
43
|
-
);
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export const isAlmostCardEndDateLate = (
|
|
47
|
-
boardCard: IBoardCard,
|
|
48
|
-
boardColumnType: BoardColumnType,
|
|
49
|
-
): boolean => {
|
|
50
|
-
if (!boardCard.endDate) {
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
return (
|
|
54
|
-
!isCardEndDateLate(boardCard, boardColumnType) &&
|
|
55
|
-
Math.abs(differenceInCalendarDays(new Date(boardCard.endDate), new Date())) <= 2
|
|
56
|
-
);
|
|
57
|
-
};
|
|
1
|
+
import { differenceInCalendarDays, isBefore } from 'date-fns';
|
|
2
|
+
import { BoardColumnType, IBoardCard } from '../types';
|
|
3
|
+
|
|
4
|
+
const BOARD_COLUMN_TYPE_STARTED = [BoardColumnType.DOING, BoardColumnType.DONE];
|
|
5
|
+
const BOARD_COLUMN_TYPE_DONE = [BoardColumnType.DONE];
|
|
6
|
+
|
|
7
|
+
export const isCardStartDateLate = (
|
|
8
|
+
boardCard: IBoardCard,
|
|
9
|
+
boardColumnType: BoardColumnType,
|
|
10
|
+
): boolean => {
|
|
11
|
+
if (!boardCard.startDate) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
return (
|
|
15
|
+
isBefore(new Date(boardCard.startDate), new Date()) &&
|
|
16
|
+
!BOARD_COLUMN_TYPE_STARTED.includes(boardColumnType)
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const isAlmostCardStartDateLate = (
|
|
21
|
+
boardCard: IBoardCard,
|
|
22
|
+
boardColumnType: BoardColumnType,
|
|
23
|
+
): boolean => {
|
|
24
|
+
if (!boardCard.startDate) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
return (
|
|
28
|
+
!isCardStartDateLate(boardCard, boardColumnType) &&
|
|
29
|
+
differenceInCalendarDays(new Date(boardCard.startDate), new Date()) <= 2
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const isCardEndDateLate = (
|
|
34
|
+
boardCard: IBoardCard,
|
|
35
|
+
boardColumnType: BoardColumnType,
|
|
36
|
+
): boolean => {
|
|
37
|
+
if (!boardCard.endDate) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
return (
|
|
41
|
+
isBefore(new Date(boardCard.endDate), new Date()) &&
|
|
42
|
+
!BOARD_COLUMN_TYPE_DONE.includes(boardColumnType)
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const isAlmostCardEndDateLate = (
|
|
47
|
+
boardCard: IBoardCard,
|
|
48
|
+
boardColumnType: BoardColumnType,
|
|
49
|
+
): boolean => {
|
|
50
|
+
if (!boardCard.endDate) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
return (
|
|
54
|
+
!isCardEndDateLate(boardCard, boardColumnType) &&
|
|
55
|
+
Math.abs(differenceInCalendarDays(new Date(boardCard.endDate), new Date())) <= 2
|
|
56
|
+
);
|
|
57
|
+
};
|
package/src/utils/enum.utils.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export const enumToArray = (enums: Record<string, string>): string[] => {
|
|
2
|
-
return Object.keys(enums).map((type) => {
|
|
3
|
-
return enums[type];
|
|
4
|
-
});
|
|
5
|
-
};
|
|
1
|
+
export const enumToArray = (enums: Record<string, string>): string[] => {
|
|
2
|
+
return Object.keys(enums).map((type) => {
|
|
3
|
+
return enums[type];
|
|
4
|
+
});
|
|
5
|
+
};
|
package/src/utils/error.utils.ts
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { Code, ErrorType } from '../types';
|
|
2
|
-
|
|
3
|
-
type ErrorParams = { code: Code; type: ErrorType; message?: string };
|
|
4
|
-
|
|
5
|
-
export class ServiceException extends Error {
|
|
6
|
-
private readonly code: Code;
|
|
7
|
-
|
|
8
|
-
private readonly type: ErrorType;
|
|
9
|
-
|
|
10
|
-
getCode(): Code {
|
|
11
|
-
return this.code;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
getType(): ErrorType {
|
|
15
|
-
return this.type;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
constructor(params: ErrorParams) {
|
|
19
|
-
super(params.message);
|
|
20
|
-
this.code = params.code;
|
|
21
|
-
this.type = params.type;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export const handleError = (error: Error | ErrorParams, _params?: ErrorParams): Error => {
|
|
26
|
-
if (error instanceof Error) {
|
|
27
|
-
return error;
|
|
28
|
-
}
|
|
29
|
-
return new ServiceException(error);
|
|
30
|
-
};
|
|
1
|
+
import { Code, ErrorType } from '../types';
|
|
2
|
+
|
|
3
|
+
type ErrorParams = { code: Code; type: ErrorType; message?: string };
|
|
4
|
+
|
|
5
|
+
export class ServiceException extends Error {
|
|
6
|
+
private readonly code: Code;
|
|
7
|
+
|
|
8
|
+
private readonly type: ErrorType;
|
|
9
|
+
|
|
10
|
+
getCode(): Code {
|
|
11
|
+
return this.code;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
getType(): ErrorType {
|
|
15
|
+
return this.type;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
constructor(params: ErrorParams) {
|
|
19
|
+
super(params.message);
|
|
20
|
+
this.code = params.code;
|
|
21
|
+
this.type = params.type;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const handleError = (error: Error | ErrorParams, _params?: ErrorParams): Error => {
|
|
26
|
+
if (error instanceof Error) {
|
|
27
|
+
return error;
|
|
28
|
+
}
|
|
29
|
+
return new ServiceException(error);
|
|
30
|
+
};
|