@trafficgroup/knex-rel 0.0.26 → 0.0.28

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.
Files changed (94) hide show
  1. package/.claude/settings.local.json +9 -0
  2. package/CLAUDE.md +63 -0
  3. package/dist/KnexConnection.d.ts +17 -0
  4. package/dist/KnexConnection.js +99 -0
  5. package/dist/KnexConnection.js.map +1 -0
  6. package/dist/d.types.d.ts +17 -0
  7. package/dist/d.types.js +3 -0
  8. package/dist/d.types.js.map +1 -0
  9. package/dist/dao/auth/auth.dao.d.ts +13 -0
  10. package/dist/dao/auth/auth.dao.js +82 -0
  11. package/dist/dao/auth/auth.dao.js.map +1 -0
  12. package/dist/dao/chat/chat.dao.d.ts +13 -0
  13. package/dist/dao/chat/chat.dao.js +138 -0
  14. package/dist/dao/chat/chat.dao.js.map +1 -0
  15. package/dist/dao/folder/folder.dao.d.ts +11 -0
  16. package/dist/dao/folder/folder.dao.js +84 -0
  17. package/dist/dao/folder/folder.dao.js.map +1 -0
  18. package/dist/dao/message/message.dao.d.ts +13 -0
  19. package/dist/dao/message/message.dao.js +118 -0
  20. package/dist/dao/message/message.dao.js.map +1 -0
  21. package/dist/dao/study/study.dao.d.ts +11 -0
  22. package/dist/dao/study/study.dao.js +84 -0
  23. package/dist/dao/study/study.dao.js.map +1 -0
  24. package/dist/dao/user/user.dao.d.ts +12 -0
  25. package/dist/dao/user/user.dao.js +76 -0
  26. package/dist/dao/user/user.dao.js.map +1 -0
  27. package/dist/dao/user-push-notification-token/user-push-notification-token.dao.d.ts +14 -0
  28. package/dist/dao/user-push-notification-token/user-push-notification-token.dao.js +87 -0
  29. package/dist/dao/user-push-notification-token/user-push-notification-token.dao.js.map +1 -0
  30. package/dist/dao/video/video.dao.d.ts +20 -0
  31. package/dist/dao/video/video.dao.js +124 -0
  32. package/dist/dao/video/video.dao.js.map +1 -0
  33. package/dist/index.d.ts +19 -0
  34. package/dist/index.js +26 -0
  35. package/dist/index.js.map +1 -0
  36. package/dist/interfaces/auth/auth.interfaces.d.ts +11 -0
  37. package/dist/interfaces/auth/auth.interfaces.js +3 -0
  38. package/dist/interfaces/auth/auth.interfaces.js.map +1 -0
  39. package/dist/interfaces/chat/chat.interfaces.d.ts +18 -0
  40. package/dist/interfaces/chat/chat.interfaces.js +3 -0
  41. package/dist/interfaces/chat/chat.interfaces.js.map +1 -0
  42. package/dist/interfaces/folder/folder.interfaces.d.ts +12 -0
  43. package/dist/interfaces/folder/folder.interfaces.js +3 -0
  44. package/dist/interfaces/folder/folder.interfaces.js.map +1 -0
  45. package/dist/interfaces/message/message.interfaces.d.ts +16 -0
  46. package/dist/interfaces/message/message.interfaces.js +3 -0
  47. package/dist/interfaces/message/message.interfaces.js.map +1 -0
  48. package/dist/interfaces/study/study.interfaces.d.ts +11 -0
  49. package/dist/interfaces/study/study.interfaces.js +3 -0
  50. package/dist/interfaces/study/study.interfaces.js.map +1 -0
  51. package/dist/interfaces/user/user.interfaces.d.ts +11 -0
  52. package/dist/interfaces/user/user.interfaces.js +3 -0
  53. package/dist/interfaces/user/user.interfaces.js.map +1 -0
  54. package/dist/interfaces/user-push-notification-token/user-push-notification-token.interfaces.d.ts +10 -0
  55. package/dist/interfaces/user-push-notification-token/user-push-notification-token.interfaces.js +3 -0
  56. package/dist/interfaces/user-push-notification-token/user-push-notification-token.interfaces.js.map +1 -0
  57. package/dist/interfaces/video/video.interfaces.d.ts +20 -0
  58. package/dist/interfaces/video/video.interfaces.js +3 -0
  59. package/dist/interfaces/video/video.interfaces.js.map +1 -0
  60. package/knexfile.ts +5 -5
  61. package/migrations/20250717173228_migration.ts +9 -0
  62. package/migrations/20250717204731_migration.ts +13 -0
  63. package/migrations/20250722210109_migration.ts +60 -0
  64. package/migrations/20250722211019_migration.ts +15 -0
  65. package/migrations/20250723153852_migration.ts +19 -0
  66. package/migrations/20250723162257_migration.ts +16 -0
  67. package/migrations/20250723171109_migration.ts +16 -0
  68. package/migrations/20250723205331_migration.ts +18 -0
  69. package/migrations/20250724191345_migration.ts +18 -0
  70. package/migrations/20250730180932_migration.ts +22 -0
  71. package/migrations/20250730213625_migration.ts +18 -0
  72. package/migrations/20250804124509_migration.ts +43 -0
  73. package/migrations/20250804132053_migration.ts +18 -0
  74. package/migrations/20250804164518_migration.ts +17 -0
  75. package/package.json +47 -47
  76. package/src/d.types.ts +7 -7
  77. package/src/dao/auth/auth.dao.ts +61 -0
  78. package/src/dao/chat/chat.dao.ts +124 -0
  79. package/src/dao/folder/folder.dao.ts +66 -0
  80. package/src/dao/message/message.dao.ts +102 -0
  81. package/src/dao/study/study.dao.ts +66 -0
  82. package/src/dao/user/user.dao.ts +14 -10
  83. package/src/dao/user-push-notification-token/user-push-notification-token.dao.ts +65 -0
  84. package/src/dao/video/video.dao.ts +120 -0
  85. package/src/index.ts +23 -8
  86. package/src/interfaces/auth/auth.interfaces.ts +11 -0
  87. package/src/interfaces/chat/chat.interfaces.ts +20 -0
  88. package/src/interfaces/folder/folder.interfaces.ts +3 -0
  89. package/src/interfaces/message/message.interfaces.ts +18 -0
  90. package/src/interfaces/study/study.interfaces.ts +3 -0
  91. package/src/interfaces/user/user.interfaces.ts +2 -0
  92. package/src/interfaces/user-push-notification-token/user-push-notification-token.interfaces.ts +10 -0
  93. package/src/interfaces/video/video.interfaces.ts +9 -1
  94. package/.env +0 -5
package/src/index.ts CHANGED
@@ -1,8 +1,23 @@
1
- // DAOs
2
- export { UserDAO } from "./dao/user/user.dao";
3
-
4
- // Interfaces
5
- export { IUser } from "./interfaces/user/user.interfaces";
6
-
7
- import KnexManager from "./KnexConnection";
8
- export { KnexManager };
1
+ // DAOs
2
+ export { UserDAO } from "./dao/user/user.dao";
3
+ export { StudyDAO } from "./dao/study/study.dao";
4
+ export { FolderDAO } from "./dao/folder/folder.dao";
5
+ export { VideoDAO } from "./dao/video/video.dao";
6
+ export { AuthDAO } from "./dao/auth/auth.dao";
7
+ export { UserPushNotificationTokenDAO } from "./dao/user-push-notification-token/user-push-notification-token.dao";
8
+ export { ChatDAO } from "./dao/chat/chat.dao";
9
+ export { MessageDAO } from "./dao/message/message.dao";
10
+
11
+ // Interfaces
12
+ export { IDataPaginator } from "./d.types";
13
+ export { IUser } from "./interfaces/user/user.interfaces";
14
+ export { IStudy } from "./interfaces/study/study.interfaces";
15
+ export { IFolder } from "./interfaces/folder/folder.interfaces";
16
+ export { IVideo } from "./interfaces/video/video.interfaces";
17
+ export { IAuth } from "./interfaces/auth/auth.interfaces";
18
+ export { IUserPushNotificationToken } from "./interfaces/user-push-notification-token/user-push-notification-token.interfaces";
19
+ export { IChat, IChatCreate, IChatUpdate } from "./interfaces/chat/chat.interfaces";
20
+ export { IMessage, IMessageCreate, IMessageUpdate } from "./interfaces/message/message.interfaces";
21
+
22
+ import KnexManager from "./KnexConnection";
23
+ export { KnexManager };
@@ -0,0 +1,11 @@
1
+ export interface IAuth {
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
+ }
@@ -0,0 +1,20 @@
1
+ export interface IChat {
2
+ id?: number;
3
+ uuid?: string;
4
+ userId: number;
5
+ title: string;
6
+ status?: 'active' | 'archived';
7
+ created_at?: Date;
8
+ updated_at?: Date;
9
+ }
10
+
11
+ export interface IChatCreate {
12
+ userId: number;
13
+ title: string;
14
+ status?: 'active' | 'archived';
15
+ }
16
+
17
+ export interface IChatUpdate {
18
+ title?: string;
19
+ status?: 'active' | 'archived';
20
+ }
@@ -1,3 +1,5 @@
1
+ import type { IStudy } from "../study/study.interfaces";
2
+
1
3
  export interface IFolder {
2
4
  id: number;
3
5
  uuid: string;
@@ -7,4 +9,5 @@ export interface IFolder {
7
9
  studyId: number; // study.id
8
10
  created_at: string;
9
11
  updated_at: string;
12
+ study?: IStudy;
10
13
  }
@@ -0,0 +1,18 @@
1
+ export interface IMessage {
2
+ id?: number;
3
+ chatId: number;
4
+ role: 'user' | 'assistant';
5
+ content: string;
6
+ created_at?: Date;
7
+ updated_at?: Date;
8
+ }
9
+
10
+ export interface IMessageCreate {
11
+ chatId: number;
12
+ role: 'user' | 'assistant';
13
+ content: string;
14
+ }
15
+
16
+ export interface IMessageUpdate {
17
+ content?: string;
18
+ }
@@ -1,3 +1,5 @@
1
+ import type { IUser } from "../user/user.interfaces";
2
+
1
3
  export interface IStudy {
2
4
  id: number;
3
5
  uuid: string;
@@ -6,4 +8,5 @@ export interface IStudy {
6
8
  status: 'COMPLETE' | 'IN PROGRESS' | 'FAILED';
7
9
  created_at: string;
8
10
  updated_at: string;
11
+ user?: IUser;
9
12
  }
@@ -4,6 +4,8 @@ export interface IUser {
4
4
  email: string;
5
5
  nombre: string;
6
6
  role: 'ADMIN' | 'USER';
7
+ profilePhoto?: string;
8
+ company?: string;
7
9
  created_at: string;
8
10
  updated_at: string;
9
11
  }
@@ -0,0 +1,10 @@
1
+ export interface IUserPushNotificationToken {
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,13 +1,21 @@
1
+ import type { IFolder } from "../folder/folder.interfaces";
2
+
1
3
  export interface IVideo {
2
4
  id: number;
3
5
  uuid: string;
4
6
  folderId: number;
7
+ name: string;
5
8
  videoLocation: string;
9
+ videoOutputLocation: string | null;
10
+ generateVideoOutput: boolean;
6
11
  videoRate: number;
7
12
  videoType: 'TMC' | 'ATR' | 'JUNCTION' | 'ROUNDABOUT' | 'PATHWAY';
8
13
  metadata: Record<string, any>;
9
- status: 'QUEUE' | 'PROCESSING' | 'COMPLETED' | 'FAILED';
14
+ status: 'QUEUED' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'PENDING';
15
+ progress: number;
16
+ remainingTime: string;
10
17
  results: Record<string, any>;
11
18
  created_at: string;
12
19
  updated_at: string;
20
+ folder?: IFolder;
13
21
  }
package/.env DELETED
@@ -1,5 +0,0 @@
1
- PG_DB=trafficgroup
2
- PG_USER=postgres
3
- PG_PASSWORD=DGp$I%9xb42s$A
4
- PG_HOST=trafficgroup-db.c2j4keo04gcg.us-east-1.rds.amazonaws.com
5
- PG_PORT=5432