@trafficgroup/knex-rel 0.1.8 → 0.1.10
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/.claude/settings.local.json +5 -2
- package/.env.prod +5 -0
- package/CLAUDE.md +2 -11
- package/dist/constants/video.constants.d.ts +12 -0
- package/dist/constants/video.constants.js +18 -0
- package/dist/constants/video.constants.js.map +1 -0
- package/dist/dao/VideoMinuteResultDAO.d.ts +4 -1
- package/dist/dao/VideoMinuteResultDAO.js +28 -31
- package/dist/dao/VideoMinuteResultDAO.js.map +1 -1
- package/dist/dao/auth/auth.dao.js +1 -4
- package/dist/dao/auth/auth.dao.js.map +1 -1
- package/dist/dao/batch/batch.dao.js +14 -13
- package/dist/dao/batch/batch.dao.js.map +1 -1
- package/dist/dao/camera/camera.dao.d.ts +17 -7
- package/dist/dao/camera/camera.dao.js +38 -56
- package/dist/dao/camera/camera.dao.js.map +1 -1
- package/dist/dao/chat/chat.dao.d.ts +1 -1
- package/dist/dao/chat/chat.dao.js +35 -25
- package/dist/dao/chat/chat.dao.js.map +1 -1
- package/dist/dao/folder/folder.dao.js +4 -8
- package/dist/dao/folder/folder.dao.js.map +1 -1
- package/dist/dao/location/location.dao.d.ts +17 -0
- package/dist/dao/location/location.dao.js +116 -0
- package/dist/dao/location/location.dao.js.map +1 -0
- package/dist/dao/message/message.dao.d.ts +1 -1
- package/dist/dao/message/message.dao.js +26 -18
- package/dist/dao/message/message.dao.js.map +1 -1
- package/dist/dao/report-configuration/report-configuration.dao.js +31 -32
- package/dist/dao/report-configuration/report-configuration.dao.js.map +1 -1
- package/dist/dao/study/study.dao.d.ts +1 -1
- package/dist/dao/study/study.dao.js +12 -17
- package/dist/dao/study/study.dao.js.map +1 -1
- package/dist/dao/user/user.dao.js +1 -4
- package/dist/dao/user/user.dao.js.map +1 -1
- package/dist/dao/user-push-notification-token/user-push-notification-token.dao.js +8 -26
- package/dist/dao/user-push-notification-token/user-push-notification-token.dao.js.map +1 -1
- package/dist/dao/video/video.dao.d.ts +9 -1
- package/dist/dao/video/video.dao.js +73 -27
- package/dist/dao/video/video.dao.js.map +1 -1
- package/dist/index.d.ts +8 -4
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces/batch/batch.interfaces.d.ts +1 -1
- package/dist/interfaces/camera/camera.interfaces.d.ts +4 -2
- package/dist/interfaces/chat/chat.interfaces.d.ts +3 -3
- package/dist/interfaces/folder/folder.interfaces.d.ts +1 -1
- package/dist/interfaces/location/location.interfaces.d.ts +9 -0
- package/dist/interfaces/location/location.interfaces.js +3 -0
- package/dist/interfaces/location/location.interfaces.js.map +1 -0
- package/dist/interfaces/message/message.interfaces.d.ts +2 -2
- package/dist/interfaces/study/study.interfaces.d.ts +6 -5
- package/dist/interfaces/user/user.interfaces.d.ts +1 -1
- package/dist/interfaces/user-push-notification-token/user-push-notification-token.interfaces.d.ts +1 -1
- package/dist/interfaces/video/video.interfaces.d.ts +3 -2
- package/migrations/20250717160737_migration.ts +1 -1
- package/migrations/20250717160908_migration.ts +2 -5
- package/migrations/20250717161310_migration.ts +1 -1
- package/migrations/20250717161406_migration.ts +3 -3
- package/migrations/20250717162431_migration.ts +1 -1
- package/migrations/20250717173228_migration.ts +2 -2
- package/migrations/20250717204731_migration.ts +1 -1
- package/migrations/20250722210109_migration.ts +4 -8
- package/migrations/20250722211019_migration.ts +1 -1
- package/migrations/20250723153852_migration.ts +10 -13
- package/migrations/20250723162257_migration.ts +7 -4
- package/migrations/20250723171109_migration.ts +7 -4
- package/migrations/20250723205331_migration.ts +9 -6
- package/migrations/20250724191345_migration.ts +11 -8
- package/migrations/20250730180932_migration.ts +13 -14
- package/migrations/20250730213625_migration.ts +11 -8
- package/migrations/20250804124509_migration.ts +21 -26
- package/migrations/20250804132053_migration.ts +8 -5
- package/migrations/20250804164518_migration.ts +7 -7
- package/migrations/20250823223016_migration.ts +21 -32
- package/migrations/20250910015452_migration.ts +6 -18
- package/migrations/20250911000000_migration.ts +4 -18
- package/migrations/20250917144153_migration.ts +7 -14
- package/migrations/20250930200521_migration.ts +4 -8
- package/migrations/20251010143500_migration.ts +6 -27
- package/migrations/20251020225758_migration.ts +15 -51
- package/migrations/20251112120000_migration.ts +81 -0
- package/migrations/20251112120100_migration.ts +21 -0
- package/migrations/20251112120200_migration.ts +38 -0
- package/migrations/20251112120300_migration.ts +22 -0
- package/package.json +1 -1
- package/src/constants/video.constants.ts +19 -0
- package/src/d.types.ts +14 -18
- package/src/dao/VideoMinuteResultDAO.ts +54 -72
- package/src/dao/auth/auth.dao.ts +55 -58
- package/src/dao/batch/batch.dao.ts +98 -101
- package/src/dao/camera/camera.dao.ts +125 -145
- package/src/dao/chat/chat.dao.ts +43 -45
- package/src/dao/folder/folder.dao.ts +56 -59
- package/src/dao/location/location.dao.ts +101 -0
- package/src/dao/message/message.dao.ts +32 -32
- package/src/dao/report-configuration/report-configuration.dao.ts +342 -370
- package/src/dao/study/study.dao.ts +63 -88
- package/src/dao/user/user.dao.ts +50 -52
- package/src/dao/user-push-notification-token/user-push-notification-token.dao.ts +49 -83
- package/src/dao/video/video.dao.ts +339 -313
- package/src/entities/BaseEntity.ts +1 -1
- package/src/index.ts +24 -26
- package/src/interfaces/auth/auth.interfaces.ts +10 -10
- package/src/interfaces/batch/batch.interfaces.ts +1 -1
- package/src/interfaces/camera/camera.interfaces.ts +9 -7
- package/src/interfaces/chat/chat.interfaces.ts +4 -4
- package/src/interfaces/folder/folder.interfaces.ts +2 -2
- package/src/interfaces/location/location.interfaces.ts +9 -0
- package/src/interfaces/message/message.interfaces.ts +3 -3
- package/src/interfaces/report-configuration/report-configuration.interfaces.ts +16 -16
- package/src/interfaces/study/study.interfaces.ts +7 -6
- package/src/interfaces/user/user.interfaces.ts +9 -9
- package/src/interfaces/user-push-notification-token/user-push-notification-token.interfaces.ts +9 -9
- package/src/interfaces/video/video.interfaces.ts +34 -33
- package/plan.md +0 -684
package/src/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { BatchDAO } from "./dao/batch/batch.dao";
|
|
|
4
4
|
export { CameraDAO } from "./dao/camera/camera.dao";
|
|
5
5
|
export { ChatDAO } from "./dao/chat/chat.dao";
|
|
6
6
|
export { FolderDAO } from "./dao/folder/folder.dao";
|
|
7
|
+
export { LocationDAO } from "./dao/location/location.dao";
|
|
7
8
|
export { MessageDAO } from "./dao/message/message.dao";
|
|
8
9
|
export { ReportConfigurationDAO } from "./dao/report-configuration/report-configuration.dao";
|
|
9
10
|
export { StudyDAO } from "./dao/study/study.dao";
|
|
@@ -12,45 +13,42 @@ export { UserPushNotificationTokenDAO } from "./dao/user-push-notification-token
|
|
|
12
13
|
export { VideoDAO } from "./dao/video/video.dao";
|
|
13
14
|
export { VideoMinuteResultDAO } from "./dao/VideoMinuteResultDAO";
|
|
14
15
|
|
|
16
|
+
// Constants
|
|
17
|
+
export {
|
|
18
|
+
VALID_VIDEO_SORT_FIELDS,
|
|
19
|
+
VALID_SORT_ORDERS,
|
|
20
|
+
VIDEO_SORT_COLUMN_MAP
|
|
21
|
+
} from "./constants/video.constants";
|
|
22
|
+
export type { VideoSortField, SortOrder } from "./constants/video.constants";
|
|
23
|
+
|
|
15
24
|
// Interfaces
|
|
16
25
|
export { IDataPaginator } from "./d.types";
|
|
17
26
|
export { IAuth } from "./interfaces/auth/auth.interfaces";
|
|
18
27
|
export { IBatch } from "./interfaces/batch/batch.interfaces";
|
|
19
28
|
export { ICamera } from "./interfaces/camera/camera.interfaces";
|
|
20
|
-
export {
|
|
21
|
-
IChat,
|
|
22
|
-
IChatCreate,
|
|
23
|
-
IChatUpdate,
|
|
24
|
-
} from "./interfaces/chat/chat.interfaces";
|
|
29
|
+
export { IChat, IChatCreate, IChatUpdate } from "./interfaces/chat/chat.interfaces";
|
|
25
30
|
export { IFolder } from "./interfaces/folder/folder.interfaces";
|
|
31
|
+
export { ILocation } from "./interfaces/location/location.interfaces";
|
|
32
|
+
export { IMessage, IMessageCreate, IMessageUpdate } from "./interfaces/message/message.interfaces";
|
|
26
33
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
IReportConfiguration,
|
|
33
|
-
IReportConfigurationData,
|
|
34
|
-
IReportConfigurationInput,
|
|
35
|
-
ICustomClass,
|
|
36
|
-
IValidationResult,
|
|
34
|
+
IReportConfiguration,
|
|
35
|
+
IReportConfigurationData,
|
|
36
|
+
IReportConfigurationInput,
|
|
37
|
+
ICustomClass,
|
|
38
|
+
IValidationResult
|
|
37
39
|
} from "./interfaces/report-configuration/report-configuration.interfaces";
|
|
38
40
|
export { IStudy } from "./interfaces/study/study.interfaces";
|
|
39
41
|
export { IUser } from "./interfaces/user/user.interfaces";
|
|
40
42
|
export { IUserPushNotificationToken } from "./interfaces/user-push-notification-token/user-push-notification-token.interfaces";
|
|
41
43
|
export { IVideo, ITrimPeriod } from "./interfaces/video/video.interfaces";
|
|
42
|
-
export {
|
|
43
|
-
IVideoMinuteResult,
|
|
44
|
-
IVideoMinuteResultInput,
|
|
45
|
-
IVideoMinuteBatch,
|
|
46
|
-
} from "./entities/VideoMinuteResult";
|
|
44
|
+
export { IVideoMinuteResult, IVideoMinuteResultInput, IVideoMinuteBatch } from "./entities/VideoMinuteResult";
|
|
47
45
|
export type {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
IStudyTimeGroupResult,
|
|
47
|
+
IGroupedStudyResponse,
|
|
48
|
+
IGroupedResponse,
|
|
49
|
+
IGroupedResult,
|
|
50
|
+
ITMCResult,
|
|
51
|
+
IATRResult,
|
|
54
52
|
} from "./dao/VideoMinuteResultDAO";
|
|
55
53
|
|
|
56
54
|
import KnexManager from "./KnexConnection";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export interface IAuth {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
2
|
+
id: number;
|
|
3
|
+
userId: number;
|
|
4
|
+
password: string;
|
|
5
|
+
twofaEnabled: boolean;
|
|
6
|
+
twofaSecret: string | null;
|
|
7
|
+
emailToken: string | null;
|
|
8
|
+
emailVerified: boolean;
|
|
9
|
+
created_at: string;
|
|
10
|
+
updated_at: string;
|
|
11
|
+
}
|
|
@@ -4,7 +4,7 @@ export interface IBatch {
|
|
|
4
4
|
id: number;
|
|
5
5
|
uuid: string;
|
|
6
6
|
folderId: number;
|
|
7
|
-
status:
|
|
7
|
+
status: 'PENDING' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED';
|
|
8
8
|
totalVideos: number;
|
|
9
9
|
completedVideos: number;
|
|
10
10
|
failedVideos: number;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export interface ICamera {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
id: number;
|
|
3
|
+
uuid: string;
|
|
4
|
+
locationId: number;
|
|
5
|
+
name: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
status: 'ACTIVE' | 'INACTIVE' | 'MAINTENANCE';
|
|
8
|
+
metadata: Record<string, any>;
|
|
9
|
+
created_at: string;
|
|
10
|
+
updated_at: string;
|
|
9
11
|
}
|
|
@@ -3,7 +3,7 @@ export interface IChat {
|
|
|
3
3
|
uuid?: string;
|
|
4
4
|
userId: number;
|
|
5
5
|
title: string;
|
|
6
|
-
status?:
|
|
6
|
+
status?: 'active' | 'archived';
|
|
7
7
|
created_at?: Date;
|
|
8
8
|
updated_at?: Date;
|
|
9
9
|
}
|
|
@@ -11,10 +11,10 @@ export interface IChat {
|
|
|
11
11
|
export interface IChatCreate {
|
|
12
12
|
userId: number;
|
|
13
13
|
title: string;
|
|
14
|
-
status?:
|
|
14
|
+
status?: 'active' | 'archived';
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export interface IChatUpdate {
|
|
18
18
|
title?: string;
|
|
19
|
-
status?:
|
|
20
|
-
}
|
|
19
|
+
status?: 'active' | 'archived';
|
|
20
|
+
}
|
|
@@ -5,9 +5,9 @@ export interface IFolder {
|
|
|
5
5
|
uuid: string;
|
|
6
6
|
name: string;
|
|
7
7
|
createdBy: number; // user.id
|
|
8
|
-
status:
|
|
8
|
+
status: 'UPLOADING' | 'COMPLETE';
|
|
9
9
|
studyId: number; // study.id
|
|
10
10
|
created_at: string;
|
|
11
11
|
updated_at: string;
|
|
12
12
|
study?: IStudy;
|
|
13
|
-
}
|
|
13
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface IMessage {
|
|
2
2
|
id?: number;
|
|
3
3
|
chatId: number;
|
|
4
|
-
role:
|
|
4
|
+
role: 'user' | 'assistant';
|
|
5
5
|
content: string;
|
|
6
6
|
created_at?: Date;
|
|
7
7
|
updated_at?: Date;
|
|
@@ -9,10 +9,10 @@ export interface IMessage {
|
|
|
9
9
|
|
|
10
10
|
export interface IMessageCreate {
|
|
11
11
|
chatId: number;
|
|
12
|
-
role:
|
|
12
|
+
role: 'user' | 'assistant';
|
|
13
13
|
content: string;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export interface IMessageUpdate {
|
|
17
17
|
content?: string;
|
|
18
|
-
}
|
|
18
|
+
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
export interface IReportConfiguration {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
id: number;
|
|
3
|
+
uuid: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
configuration: IReportConfigurationData;
|
|
7
|
+
created_at: Date;
|
|
8
|
+
updated_at: Date;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export interface IReportConfigurationData {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
version: string;
|
|
13
|
+
customClasses: ICustomClass[];
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export interface ICustomClass {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
name: string; // Max 30 chars
|
|
18
|
+
fhwaClasses: number[]; // Array of 1-13
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export interface IReportConfigurationInput {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
name: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
configuration: IReportConfigurationData;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export interface IValidationResult {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
valid: boolean;
|
|
29
|
+
errors: string[];
|
|
30
30
|
}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import type { IUser } from "../user/user.interfaces";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ILocation } from "../location/location.interfaces";
|
|
3
3
|
|
|
4
4
|
export interface IStudy {
|
|
5
5
|
id: number;
|
|
6
6
|
uuid: string;
|
|
7
7
|
name: string;
|
|
8
8
|
description?: string;
|
|
9
|
-
type:
|
|
9
|
+
type: 'TMC' | 'ATR';
|
|
10
10
|
createdBy: number;
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
locationId?: number;
|
|
12
|
+
isMultiCamera: boolean;
|
|
13
|
+
status: 'COMPLETE' | 'IN PROGRESS' | 'FAILED';
|
|
13
14
|
created_at: string;
|
|
14
15
|
updated_at: string;
|
|
15
16
|
user?: IUser;
|
|
16
|
-
|
|
17
|
-
}
|
|
17
|
+
location?: ILocation;
|
|
18
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export interface IUser {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
id: number;
|
|
3
|
+
uuid: string;
|
|
4
|
+
email: string;
|
|
5
|
+
nombre: string;
|
|
6
|
+
role: 'ADMIN' | 'USER';
|
|
7
|
+
profilePhoto?: string;
|
|
8
|
+
company?: string;
|
|
9
|
+
created_at: string;
|
|
10
|
+
updated_at: string;
|
|
11
11
|
}
|
package/src/interfaces/user-push-notification-token/user-push-notification-token.interfaces.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export interface IUserPushNotificationToken {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
2
|
+
id: number;
|
|
3
|
+
userId: number;
|
|
4
|
+
token: string;
|
|
5
|
+
available: boolean;
|
|
6
|
+
token_type: 'expo' | 'native';
|
|
7
|
+
device_type?: string;
|
|
8
|
+
created_at: string;
|
|
9
|
+
updated_at: string;
|
|
10
|
+
}
|
|
@@ -1,43 +1,44 @@
|
|
|
1
1
|
import type { IFolder } from "../folder/folder.interfaces";
|
|
2
2
|
|
|
3
3
|
export interface ITrimPeriod {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
startTime: string;
|
|
5
|
+
endTime: string;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
export interface IVideo {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
9
|
+
id: number;
|
|
10
|
+
uuid: string;
|
|
11
|
+
folderId: number;
|
|
12
|
+
annotationSourceId?: number;
|
|
13
|
+
cameraId?: number;
|
|
14
|
+
name: string;
|
|
15
|
+
videoLocation: string;
|
|
16
|
+
videoOutputLocation: string | null;
|
|
17
|
+
generateVideoOutput: boolean;
|
|
18
|
+
videoRate: number;
|
|
19
|
+
videoType: 'TMC' | 'ATR' | 'JUNCTION' | 'ROUNDABOUT' | 'PATHWAY';
|
|
20
|
+
metadata: Record<string, any>;
|
|
21
|
+
status: 'QUEUED' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'PENDING';
|
|
22
|
+
progress: number;
|
|
23
|
+
remainingTime: string;
|
|
24
|
+
results: Record<string, any>;
|
|
25
|
+
durationSeconds?: number;
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
// HLS streaming support
|
|
28
|
+
isHlsEnabled: boolean;
|
|
29
|
+
hlsPlaylist: string | null;
|
|
30
|
+
videoSizeMB: number | null;
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
// Enhanced metadata for hybrid streaming
|
|
33
|
+
streamingMetadata: Record<string, any> | null;
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
// Recording start time and video trimming support
|
|
36
|
+
recordingStartedAt?: Date;
|
|
37
|
+
trimEnabled?: boolean;
|
|
38
|
+
trimPeriods?: ITrimPeriod[] | null;
|
|
39
|
+
batchId?: number | null;
|
|
39
40
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
41
|
+
created_at: string;
|
|
42
|
+
updated_at: string;
|
|
43
|
+
folder?: IFolder;
|
|
44
|
+
}
|