Skip to content

Commit 5790488

Browse files
committed
Merge branch 'main' into backend_settings_rework
2 parents adaf323 + 4806ee2 commit 5790488

File tree

115 files changed

+2229
-1397
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+2229
-1397
lines changed

backend/knip.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "https://unpkg.com/knip@5/schema.json",
3+
"ignoreExportsUsedInFile": {
4+
"interface": true,
5+
"type": true
6+
},
7+
"ignore": ["src/migrations/**", "src/shared/config/datasource.config.ts", "src/enums/widget-type.enum.ts"],
8+
"tags": ["-lintignore"]
9+
}

backend/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
"migration:generate": "yarn run typeorm migration:generate -d dist/shared/config/datasource.config.js",
3030
"migration:create": "yarn run typeorm migration:create -d dist/shared/config/datasource.config.js",
3131
"migration:run": "yarn run typeorm migration:run -d dist/shared/config/datasource.config.js",
32-
"migration:revert": "npm run typeorm -- migration:revert -d dist/shared/config/datasource.config.js"
32+
"migration:revert": "npm run typeorm -- migration:revert -d dist/shared/config/datasource.config.js",
33+
"knip": "knip"
3334
},
3435
"dependencies": {
3536
"@amplitude/node": "1.10.2",
@@ -39,7 +40,6 @@
3940
"@nestjs/common": "11.1.8",
4041
"@nestjs/config": "4.0.2",
4142
"@nestjs/core": "11.1.8",
42-
"@nestjs/microservices": "^11.1.8",
4343
"@nestjs/platform-express": "11.1.8",
4444
"@nestjs/schedule": "^6.0.1",
4545
"@nestjs/swagger": "^11.2.1",
@@ -71,7 +71,6 @@
7171
"dotenv": "17.2.3",
7272
"eslint-plugin-security": "3.0.1",
7373
"express": "5.1.0",
74-
"express-rate-limit": "8.1.0",
7574
"fetch-blob": "^4.0.0",
7675
"helmet": "8.1.0",
7776
"i18n-iso-countries": "^7.14.0",
@@ -116,7 +115,7 @@
116115
"@types/express": "^5.0.5",
117116
"@types/ibm_db": "^3.2.0",
118117
"@types/json2csv": "^5.0.7",
119-
"@types/node": "^24.9.1",
118+
"@types/node": "^24.10.1",
120119
"@types/safe-regex": "^1.1.6",
121120
"@types/supertest": "^6.0.3",
122121
"@types/uuid": "^11.0.0",
@@ -127,12 +126,13 @@
127126
"eslint": "^9.38.0",
128127
"eslint-config-prettier": "^10.1.8",
129128
"eslint-plugin-import": "^2.32.0",
129+
"knip": "^5.70.2",
130130
"nock": "^14.0.10",
131131
"prettier": "^3.6.2",
132132
"supertest": "^7.1.4",
133133
"ts-loader": "^9.5.4",
134134
"ts-node": "^10.9.2",
135135
"tsconfig-paths": "^4.2.0",
136-
"typescript": "5.9.3"
136+
"typescript": "^5.9.3"
137137
}
138138
}

backend/src/app.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import { GetHelloUseCase } from './use-cases-app/get-hello.use.case.js';
3939
import { ThrottlerModule, ThrottlerGuard } from '@nestjs/throttler';
4040
import { SharedJobsModule } from './entities/shared-jobs/shared-jobs.module.js';
4141
import { TableCategoriesModule } from './entities/table-categories/table-categories.module.js';
42+
import { SignInAuditModule } from './entities/user-sign-in-audit/sign-in-audit.module.js';
4243
import { PersonalTableSettingsModule } from './entities/table-settings/personal-table-settings/personal-table-settings.module.js';
4344

4445
@Module({
@@ -82,6 +83,7 @@ import { PersonalTableSettingsModule } from './entities/table-settings/personal-
8283
LoggingModule,
8384
SharedJobsModule,
8485
TableCategoriesModule,
86+
SignInAuditModule,
8587
PersonalTableSettingsModule,
8688
],
8789
controllers: [AppController],

backend/src/authorization/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export { AuthMiddleware } from './auth.middleware.js';
22
export { BasicAuthMiddleware } from './basic-auth.middleware.js';
3-
export { IRequestWithCognitoInfo, ICognitoDecodedData } from './cognito-decoded.interface.js';
3+
export { IRequestWithCognitoInfo } from './cognito-decoded.interface.js';

backend/src/common/application/global-database-context.interface.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ import { IDatabaseContext } from '../database-context.interface.js';
4848
import { TableCategoriesEntity } from '../../entities/table-categories/table-categories.entity.js';
4949
import { ITableCategoriesCustomRepository } from '../../entities/table-categories/repository/table-categories-repository.interface.js';
5050
import { ConnectionPropertiesEntity } from '../../entities/connection-properties/connection-properties.entity.js';
51+
import { SignInAuditEntity } from '../../entities/user-sign-in-audit/sign-in-audit.entity.js';
52+
import { ISignInAuditRepository } from '../../entities/user-sign-in-audit/repository/sign-in-audit-repository.interface.js';
5153
import { IPersonalTableSettingsRepository } from '../../entities/table-settings/personal-table-settings/repository/personal-table-settings.repository.interface.js';
5254
import { PersonalTableSettingsEntity } from '../../entities/table-settings/personal-table-settings/personal-table-settings.entity.js';
5355

@@ -85,5 +87,6 @@ export interface IGlobalDatabaseContext extends IDatabaseContext {
8587
tableFiltersRepository: Repository<TableFiltersEntity> & ITableFiltersCustomRepository;
8688
aiResponsesToUserRepository: Repository<AiResponsesToUserEntity> & IAiResponsesToUserRepository;
8789
tableCategoriesRepository: Repository<TableCategoriesEntity> & ITableCategoriesCustomRepository;
90+
signInAuditRepository: Repository<SignInAuditEntity> & ISignInAuditRepository;
8891
personalTableSettingsRepository: Repository<PersonalTableSettingsEntity> & IPersonalTableSettingsRepository;
8992
}

backend/src/common/application/global-database-context.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ import { aiResponsesToUserRepositoryExtension } from '../../entities/ai/ai-data-
9090
import { TableCategoriesEntity } from '../../entities/table-categories/table-categories.entity.js';
9191
import { ITableCategoriesCustomRepository } from '../../entities/table-categories/repository/table-categories-repository.interface.js';
9292
import { tableCategoriesCustomRepositoryExtension } from '../../entities/table-categories/repository/table-categories-repository.extension.js';
93+
import { SignInAuditEntity } from '../../entities/user-sign-in-audit/sign-in-audit.entity.js';
94+
import { ISignInAuditRepository } from '../../entities/user-sign-in-audit/repository/sign-in-audit-repository.interface.js';
95+
import { signInAuditCustomRepositoryExtension } from '../../entities/user-sign-in-audit/repository/sign-in-audit-custom-repository-extension.js';
9396
import { PersonalTableSettingsEntity } from '../../entities/table-settings/personal-table-settings/personal-table-settings.entity.js';
9497
import { IPersonalTableSettingsRepository } from '../../entities/table-settings/personal-table-settings/repository/personal-table-settings.repository.interface.js';
9598
import { personalTableSettingsCustomRepositoryExtension } from '../../entities/table-settings/personal-table-settings/repository/personal-table-settings-custom-repository-extension.js';
@@ -131,6 +134,7 @@ export class GlobalDatabaseContext implements IGlobalDatabaseContext {
131134
private _tableFiltersRepository: Repository<TableFiltersEntity> & ITableFiltersCustomRepository;
132135
private _aiResponsesToUserRepository: Repository<AiResponsesToUserEntity> & IAiResponsesToUserRepository;
133136
private _tableCategoriesRepository: Repository<TableCategoriesEntity> & ITableCategoriesCustomRepository;
137+
private _signInAuditRepository: Repository<SignInAuditEntity> & ISignInAuditRepository;
134138
private _personalTableSettingsRepository: Repository<PersonalTableSettingsEntity> & IPersonalTableSettingsRepository;
135139

136140
public constructor(
@@ -220,6 +224,9 @@ export class GlobalDatabaseContext implements IGlobalDatabaseContext {
220224
this._tableCategoriesRepository = this.appDataSource
221225
.getRepository(TableCategoriesEntity)
222226
.extend(tableCategoriesCustomRepositoryExtension);
227+
this._signInAuditRepository = this.appDataSource
228+
.getRepository(SignInAuditEntity)
229+
.extend(signInAuditCustomRepositoryExtension);
223230
this._personalTableSettingsRepository = this.appDataSource
224231
.getRepository(PersonalTableSettingsEntity)
225232
.extend(personalTableSettingsCustomRepositoryExtension);
@@ -358,6 +365,10 @@ export class GlobalDatabaseContext implements IGlobalDatabaseContext {
358365
return this._tableCategoriesRepository;
359366
}
360367

368+
public get signInAuditRepository(): Repository<SignInAuditEntity> & ISignInAuditRepository {
369+
return this._signInAuditRepository;
370+
}
371+
361372
public get personalTableSettingsRepository(): Repository<PersonalTableSettingsEntity> &
362373
IPersonalTableSettingsRepository {
363374
return this._personalTableSettingsRepository;

backend/src/common/data-injection.tokens.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,8 @@ export enum UseCaseType {
157157
GET_API_KEY = 'GET_API_KEY',
158158
DELETE_API_KEY = 'DELETE_API_KEY',
159159

160-
REQUEST_INFO_FROM_TABLE_WITH_AI = 'REQUEST_INFO_FROM_TABLE_WITH_AI',
161160
REQUEST_INFO_FROM_TABLE_WITH_AI_V2 = 'REQUEST_INFO_FROM_TABLE_WITH_AI_V2',
162161

163-
CREATE_THREAD_WITH_AI_ASSISTANT = 'CREATE_THREAD_WITH_AI_ASSISTANT',
164-
ADD_MESSAGE_TO_THREAD_WITH_AI_ASSISTANT = 'ADD_MESSAGE_TO_THREAD_WITH_AI_ASSISTANT',
165-
GET_ALL_USER_THREADS_WITH_AI_ASSISTANT = 'GET_ALL_USER_THREADS_WITH_AI_ASSISTANT',
166-
GET_ALL_THREAD_MESSAGES = 'GET_ALL_THREAD_MESSAGES',
167-
DELETE_THREAD_WITH_AI_ASSISTANT = 'DELETE_THREAD_WITH_AI_ASSISTANT',
168-
169162
CREATE_TABLE_FILTERS = 'CREATE_TABLE_FILTERS',
170163
FIND_TABLE_FILTERS = 'FIND_TABLE_FILTERS',
171164
DELETE_TABLE_FILTERS = 'DELETE_TABLE_FILTERS',
@@ -175,4 +168,6 @@ export enum UseCaseType {
175168

176169
CREATE_UPDATE_TABLE_CATEGORIES = 'CREATE_UPDATE_TABLE_CATEGORIES',
177170
FIND_TABLE_CATEGORIES = 'FIND_TABLE_CATEGORIES',
171+
172+
FIND_SIGN_IN_AUDIT_LOGS = 'FIND_SIGN_IN_AUDIT_LOGS',
178173
}

backend/src/entities/ai/application/data-structures/request-info-from-table.ds.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Response } from 'express';
2-
export class RequestInfoFromTableDS {
2+
class RequestInfoFromTableDS {
33
connectionId: string;
44
tableName: string;
55
user_message: string;

backend/src/entities/ai/application/data-structures/response-info.ds.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

backend/src/entities/ai/application/enums/message-roles.enum.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)