Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,3 @@ jobs:
- uses: extractions/setup-just@v1
- name: license checker
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'
lint:
runs-on:
labels: ubuntu-latest-4-cores
steps:
- uses: actions/checkout@v3
- uses: extractions/setup-just@v1
- uses: actions/setup-node@v3
with:
node-version: '18'
- run: cd backend && yarn install
- run: cd backend && yarn run lint
22 changes: 22 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Code quality

on:
push:
pull_request:

jobs:
quality:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v5
with:
persist-credentials: false
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: latest
- name: Run Biome
run: biome ci --formatter-enabled=false --assist-enabled=false .
1 change: 0 additions & 1 deletion autoadmin-ws-server/src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use strict';
import express, { Router, json } from 'express';
import axios from 'axios';
const app = express();
Expand Down
1 change: 0 additions & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"start:dev": "nest start --watch --preserveWatchOutput",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "ava test/ava-tests/non-saas-tests/* --serial",
"test-all": "ava --timeout=5m",
"test-saas": "ava test/ava-tests/saas-tests/* ",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ export class ValidationException extends HttpException {
).join(', ')}`;
})
.join('.\n');
} else {
originalMessage = originalMessage;
}
super(originalMessage, HttpStatus.BAD_REQUEST);
this.internalCode = ExceptionsInternalCodes.VALIDATOR_EXCEPTION;
Expand Down
3 changes: 2 additions & 1 deletion backend/src/helpers/constants/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const Constants = {
},

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

CRON_SHEDULE: '30 5 13 * * *',
Expand Down Expand Up @@ -274,6 +274,7 @@ export const Constants = {
// break;
case type.toLowerCase().includes('dynamodb'):
connection = parseTestDynamoDBConnectionString(connection_string) as CreateConnectionDto;
break;
default:
break;
}
Expand Down
6 changes: 4 additions & 2 deletions backend/src/helpers/encryption/encryptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,17 @@ export class Encryptor {
hash = CryptoJS.SHA384(data);
return hash.toString(CryptoJS.enc.Hex);

case EncryptionAlgorithmEnum.pbkdf2:
case EncryptionAlgorithmEnum.pbkdf2: {
const salt = CryptoJS.lib.WordArray.random(128 / 8);
return CryptoJS.PBKDF2(data, salt, {
keySize: 256 / 32,
}).toString();
}

case EncryptionAlgorithmEnum.bcrypt:
case EncryptionAlgorithmEnum.bcrypt: {
const bSalt = await bcrypt.genSalt();
return await bcrypt.hash(data, bSalt);
}

case EncryptionAlgorithmEnum.argon2:
return await argon2.hash(data);
Expand Down
4 changes: 0 additions & 4 deletions backend/src/helpers/validators/validation-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ export class ValidationHelper {
return countries.isValid(countryCode);
}

public isValidUrl(url: string): boolean {
return validator.isURL(url);
}

public static validateOrThrowHttpExceptionEmail(email: string): boolean {
const isEmailValid = ValidationHelper.isValidEmail(email);
if (isEmailValid) {
Expand Down
3 changes: 2 additions & 1 deletion backend/test/mock.factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,11 @@ export class MockFactory {
return this.generateConnectionToSchemaOracleDBInDocker();
case 'mssql':
return this.generateConnectionToTestMsSQlDBInDocker();
case 'mysql':
case 'mysql': {
const config = this.generateConnectionToTestMySQLDBInDocker();
config.type = 'mysql2';
return config;
}
}
}

Expand Down
222 changes: 222 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
{
"$schema": "https://biomejs.dev/schemas/2.3.8/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": false
},
"formatter": {
"enabled": true,
"indentStyle": "tab"
},
"linter": {
"enabled": true,
"rules": {
"recommended": false,
"a11y": {
"noAccessKey": "error",
"noAriaHiddenOnFocusable": "error",
"noAriaUnsupportedElements": "error",
"noAutofocus": "error",
"noDistractingElements": "error",
"noHeaderScope": "error",
"noInteractiveElementToNoninteractiveRole": "error",
"noLabelWithoutControl": "error",
"noNoninteractiveElementToInteractiveRole": "error",
"noNoninteractiveTabindex": "error",
"noPositiveTabindex": "error",
"noRedundantAlt": "error",
"noRedundantRoles": "error",
"noStaticElementInteractions": "error",
"noSvgWithoutTitle": "error",
"useAltText": "error",
"useAnchorContent": "error",
"useAriaActivedescendantWithTabindex": "error",
"useAriaPropsForRole": "error",
"useAriaPropsSupportedByRole": "error",
"useButtonType": "error",
"useFocusableInteractive": "error",
"useHeadingContent": "error",
"useHtmlLang": "error",
"useIframeTitle": "error",
"useKeyWithClickEvents": "error",
"useKeyWithMouseEvents": "error",
"useMediaCaption": "error",
"useSemanticElements": "error",
"useValidAnchor": "error",
"useValidAriaProps": "error",
"useValidAriaRole": "error",
"useValidAriaValues": "error",
"useValidAutocomplete": "error",
"useValidLang": "error"
},
"complexity": {
"noAdjacentSpacesInRegex": "error",
"noArguments": "error",
"noBannedTypes": "off",
"noCommaOperator": "off",
"noEmptyTypeParameters": "error",
"noExtraBooleanCast": "error",
"noFlatMapIdentity": "error",
"noStaticOnlyClass": "off",
"noThisInStatic": "off",
"noUselessCatch": "off",
"noUselessConstructor": "off",
"noUselessContinue": "off",
"noUselessEmptyExport": "error",
"noUselessEscapeInRegex": "error",
"noUselessFragments": "error",
"noUselessLabel": "error",
"noUselessLoneBlockStatements": "error",
"noUselessRename": "error",
"noUselessStringRaw": "error",
"noUselessSwitchCase": "error",
"noUselessTernary": "off",
"noUselessThisAlias": "error",
"noUselessTypeConstraint": "error",
"noUselessUndefinedInitialization": "off",
"noVoid": "error",
"useArrowFunction": "off",
"useDateNow": "error",
"useFlatMap": "off",
"useIndexOf": "off",
"useLiteralKeys": "off",
"useNumericLiterals": "error",
"useOptionalChain": "off",
"useRegexLiterals": "error",
"useSimpleNumberKeys": "error"
},
"correctness": {
"noConstAssign": "error",
"noConstantCondition": "error",
"noConstantMathMinMaxClamp": "error",
"noConstructorReturn": "error",
"noEmptyCharacterClassInRegex": "error",
"noEmptyPattern": "error",
"noGlobalObjectCalls": "error",
"noInnerDeclarations": "error",
"noInvalidBuiltinInstantiation": "error",
"noInvalidConstructorSuper": "error",
"noInvalidUseBeforeDeclaration": "off",
"noNonoctalDecimalEscape": "error",
"noPrecisionLoss": "error",
"noSelfAssign": "error",
"noSetterReturn": "error",
"noStringCaseMismatch": "error",
"noSwitchDeclarations": "error",
"noUnreachable": "error",
"noUnreachableSuper": "error",
"noUnsafeFinally": "error",
"noUnsafeOptionalChaining": "error",
"noUnusedFunctionParameters": "off",
"noUnusedImports": "off",
"noUnusedLabels": "error",
"noUnusedPrivateClassMembers": "off",
"noUnusedVariables": "off",
"noVoidElementsWithChildren": "error",
"noVoidTypeReturn": "error",
"useIsNan": "error",
"useParseIntRadix": "off",
"useValidForDirection": "error",
"useValidTypeof": "error",
"useYield": "error"
},
"performance": {
"noAccumulatingSpread": "error",
"noDynamicNamespaceImportAccess": "error"
},
"security": {
"noBlankTarget": "error",
"noGlobalEval": "error"
},
"suspicious": {
"noApproximativeNumericConstant": "error",
"noAssignInExpressions": "off",
"noAsyncPromiseExecutor": "off",
"noCatchAssign": "error",
"noClassAssign": "error",
"noCommentText": "error",
"noCompareNegZero": "error",
"noConfusingLabels": "error",
"noConfusingVoidType": "off",
"noConstEnum": "error",
"noControlCharactersInRegex": "off",
"noDebugger": "error",
"noDocumentCookie": "off",
"noDoubleEquals": "off",
"noDuplicateCase": "error",
"noDuplicateClassMembers": "error",
"noDuplicateElseIf": "error",
"noDuplicateJsxProps": "error",
"noDuplicateObjectKeys": "error",
"noDuplicateParameters": "error",
"noEmptyInterface": "error",
"noExplicitAny": "off",
"noExtraNonNullAssertion": "error",
"noFallthroughSwitchClause": "error",
"noFunctionAssign": "error",
"noGlobalAssign": "error",
"noGlobalIsFinite": "error",
"noGlobalIsNan": "off",
"noHeadImportInDocument": "error",
"noImplicitAnyLet": "off",
"noImportAssign": "error",
"noIrregularWhitespace": "error",
"noLabelVar": "error",
"noMisleadingCharacterClass": "error",
"noMisleadingInstantiator": "error",
"noMisrefactoredShorthandAssign": "error",
"noNonNullAssertedOptionalChain": "error",
"noOctalEscape": "error",
"noPrototypeBuiltins": "off",
"noRedeclare": "error",
"noRedundantUseStrict": "error",
"noSelfCompare": "error",
"noShadowRestrictedNames": "error",
"noSparseArray": "error",
"noSuspiciousSemicolonInJsx": "error",
"noTemplateCurlyInString": "error",
"noThenProperty": "error",
"noTsIgnore": "off",
"noUnsafeDeclarationMerging": "error",
"noUnsafeNegation": "error",
"noUselessEscapeInString": "error",
"noUselessRegexBackrefs": "error",
"noWith": "error",
"useAdjacentOverloadSignatures": "error",
"useAwait": "off",
"useDefaultSwitchClauseLast": "error",
"useGetterReturn": "error",
"useGoogleFontDisplay": "error",
"useIsArray": "error",
"useIterableCallbackReturn": "off",
"useNamespaceKeyword": "error"

}
}
},
"javascript": {
"formatter": {
"quoteStyle": "double"
},
"parser": {
"unsafeParameterDecoratorsEnabled": true
}
},
"html": {
"parser": {
"interpolation": true
}
},
"assist": {
"enabled": true,
"actions": {
"source": {
"organizeImports": "on"
}
}
}
}
2 changes: 1 addition & 1 deletion frontend/src/app/components/audit/audit.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ describe('AuditComponent', () => {
const fakeLog = {
Action: "received rows",
Date: "09/09/2021 5:47 PM",
Status: LogStatus.Successfully,
Status: LogStatus.Successfully,
Table: "Customers",
User: "[email protected]",
createdAt: "2021-09-09T14:47:44.160Z",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,4 @@
</ng-template>


</ng-template>
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ export class DbTableRowEditComponent implements OnInit {
this._tableRow.addTableRow(this.connectionID, this.tableName, formattedUpdatedRow)
.subscribe((res) => {
this.keyAttributesFromURL = {};
for (var i = 0; i < res.primaryColumns.length; i++) {
for (let i = 0; i < res.primaryColumns.length; i++) {
this.keyAttributesFromURL[res.primaryColumns[i].column_name] = res.row[res.primaryColumns[i].column_name];
}
this.ngZone.run(() => {
Expand Down
Loading
Loading