Skip to content

Commit 693df8e

Browse files
committed
Merge branch 'main' into backend_unused_code
2 parents 1692400 + 5f2f15a commit 693df8e

30 files changed

Lines changed: 451 additions & 59 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
3+
{
4+
"name": "Node.js & TypeScript",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm"
7+
8+
// Features to add to the dev container. More info: https://containers.dev/features.
9+
// "features": {},
10+
11+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
12+
// "forwardPorts": [],
13+
14+
// Use 'postCreateCommand' to run commands after the container is created.
15+
// "postCreateCommand": "yarn install",
16+
17+
// Configure tool-specific properties.
18+
// "customizations": {},
19+
20+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
21+
// "remoteUser": "root"
22+
}

.github/workflows/backend.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,3 @@ jobs:
2929
- uses: extractions/setup-just@v1
3030
- name: license checker
3131
run: 'cd backend && npx license-checker --onlyAllow="MIT;ISC;Python-2.0;Apache-2.0;BSD;MPL;CC;Custom: http://github.com/dscape/statsd-parser;" --excludePrivatePackages'
32-
lint:
33-
runs-on:
34-
labels: ubuntu-latest-4-cores
35-
steps:
36-
- uses: actions/checkout@v3
37-
- uses: extractions/setup-just@v1
38-
- uses: actions/setup-node@v3
39-
with:
40-
node-version: '18'
41-
- run: cd backend && yarn install
42-
- run: cd backend && yarn run lint

.github/workflows/code-quality.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Code quality
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
quality:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v5
15+
with:
16+
persist-credentials: false
17+
- name: Setup Biome
18+
uses: biomejs/setup-biome@v2
19+
with:
20+
version: latest
21+
- name: Run Biome
22+
run: biome ci --formatter-enabled=false --assist-enabled=false .

autoadmin-ws-server/src/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
'use strict';
21
import express, { Router, json } from 'express';
32
import axios from 'axios';
43
const app = express();

backend/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"start:dev": "nest start --watch --preserveWatchOutput",
1515
"start:debug": "nest start --debug --watch",
1616
"start:prod": "node dist/main",
17-
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
1817
"test": "ava test/ava-tests/non-saas-tests/* --serial",
1918
"test-all": "ava --timeout=5m",
2019
"test-saas": "ava test/ava-tests/saas-tests/* ",

backend/src/exceptions/custom-exceptions/validation-exception.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ export class ValidationException extends HttpException {
1515
).join(', ')}`;
1616
})
1717
.join('.\n');
18-
} else {
19-
originalMessage = originalMessage;
2018
}
2119
super(originalMessage, HttpStatus.BAD_REQUEST);
2220
this.internalCode = ExceptionsInternalCodes.VALIDATOR_EXCEPTION;

backend/src/helpers/constants/constants.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export const Constants = {
9292
},
9393

9494
ONE_DAY_AGO: (): Date => {
95-
return new Date(new Date().getTime() - 24 * 60 * 60 * 1000);
95+
return new Date(Date.now() - 24 * 60 * 60 * 1000);
9696
},
9797

9898
CRON_SHEDULE: '30 5 13 * * *',
@@ -274,6 +274,7 @@ export const Constants = {
274274
// break;
275275
case type.toLowerCase().includes('dynamodb'):
276276
connection = parseTestDynamoDBConnectionString(connection_string) as CreateConnectionDto;
277+
break;
277278
default:
278279
break;
279280
}

backend/src/helpers/encryption/encryptor.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,17 @@ export class Encryptor {
140140
hash = CryptoJS.SHA384(data);
141141
return hash.toString(CryptoJS.enc.Hex);
142142

143-
case EncryptionAlgorithmEnum.pbkdf2:
143+
case EncryptionAlgorithmEnum.pbkdf2: {
144144
const salt = CryptoJS.lib.WordArray.random(128 / 8);
145145
return CryptoJS.PBKDF2(data, salt, {
146146
keySize: 256 / 32,
147147
}).toString();
148+
}
148149

149-
case EncryptionAlgorithmEnum.bcrypt:
150+
case EncryptionAlgorithmEnum.bcrypt: {
150151
const bSalt = await bcrypt.genSalt();
151152
return await bcrypt.hash(data, bSalt);
153+
}
152154

153155
case EncryptionAlgorithmEnum.argon2:
154156
return await argon2.hash(data);

backend/src/helpers/validators/validation-helper.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ export class ValidationHelper {
5656
return countries.isValid(countryCode);
5757
}
5858

59-
public isValidUrl(url: string): boolean {
60-
return validator.isURL(url);
61-
}
62-
6359
public static validateOrThrowHttpExceptionEmail(email: string): boolean {
6460
const isEmailValid = ValidationHelper.isValidEmail(email);
6561
if (isEmailValid) {

backend/test/mock.factory.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,10 +335,11 @@ export class MockFactory {
335335
return this.generateConnectionToSchemaOracleDBInDocker();
336336
case 'mssql':
337337
return this.generateConnectionToTestMsSQlDBInDocker();
338-
case 'mysql':
338+
case 'mysql': {
339339
const config = this.generateConnectionToTestMySQLDBInDocker();
340340
config.type = 'mysql2';
341341
return config;
342+
}
342343
}
343344
}
344345

0 commit comments

Comments
 (0)