Skip to content

Commit 4806ee2

Browse files
authored
Merge pull request #1454 from rocket-admin/backend_refactoring
Backend refactoring
2 parents 5aa644e + 499d2e4 commit 4806ee2

77 files changed

Lines changed: 361 additions & 1501 deletions

File tree

Some content is hidden

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

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/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/data-injection.tokens.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,8 @@ export enum UseCaseType {
153153
GET_API_KEY = 'GET_API_KEY',
154154
DELETE_API_KEY = 'DELETE_API_KEY',
155155

156-
REQUEST_INFO_FROM_TABLE_WITH_AI = 'REQUEST_INFO_FROM_TABLE_WITH_AI',
157156
REQUEST_INFO_FROM_TABLE_WITH_AI_V2 = 'REQUEST_INFO_FROM_TABLE_WITH_AI_V2',
158157

159-
CREATE_THREAD_WITH_AI_ASSISTANT = 'CREATE_THREAD_WITH_AI_ASSISTANT',
160-
ADD_MESSAGE_TO_THREAD_WITH_AI_ASSISTANT = 'ADD_MESSAGE_TO_THREAD_WITH_AI_ASSISTANT',
161-
GET_ALL_USER_THREADS_WITH_AI_ASSISTANT = 'GET_ALL_USER_THREADS_WITH_AI_ASSISTANT',
162-
GET_ALL_THREAD_MESSAGES = 'GET_ALL_THREAD_MESSAGES',
163-
DELETE_THREAD_WITH_AI_ASSISTANT = 'DELETE_THREAD_WITH_AI_ASSISTANT',
164-
165158
CREATE_TABLE_FILTERS = 'CREATE_TABLE_FILTERS',
166159
FIND_TABLE_FILTERS = 'FIND_TABLE_FILTERS',
167160
DELETE_TABLE_FILTERS = 'DELETE_TABLE_FILTERS',

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.

backend/src/entities/ai/utils/command-validity-check.util.ts

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

backend/src/entities/ai/utils/prompt-generating.util.ts

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

backend/src/entities/ai/utils/wrap-query-with-limit.util.ts

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

0 commit comments

Comments
 (0)