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
18 changes: 9 additions & 9 deletions autoadmin-ws-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@
"lint:fix": "biome check --write src/"
},
"dependencies": {
"@hono/node-server": "^1.19.9",
"hono": "^4.12.3",
"@hono/node-server": "^2.0.3",
"hono": "^4.12.21",
"jsonwebtoken": "^9.0.3",
"lru-cache": "^11.2.6",
"nanoid": "^5.1.6",
"lru-cache": "^11.5.0",
"nanoid": "^5.1.11",
"pino": "^10.3.1",
"ws": "^8.19.0",
"zod": "^4.3.6"
"ws": "^8.20.1",
"zod": "^4.4.3"
},
"devDependencies": {
"@biomejs/biome": "2.4.4",
"@biomejs/biome": "2.4.15",
"@types/jsonwebtoken": "^9.0.10",
"@types/node": "^22.10.2",
"@types/ws": "^8.18.1",
"tsx": "^4.21.0",
"typescript": "^5.9.3"
"tsx": "^4.22.3",
"typescript": "^6.0.3"
},
"pnpm": {
"onlyBuiltDependencies": [
Expand Down
387 changes: 187 additions & 200 deletions autoadmin-ws-server/pnpm-lock.yaml

Large diffs are not rendered by default.

90 changes: 45 additions & 45 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,88 +21,88 @@
"typeorm": "ts-node -r tsconfig-paths/register ../node_modules/.bin/typeorm",
"migration:generate": "pnpm run typeorm migration:generate -d dist/src/shared/config/datasource.config.js",
"migration:create": "pnpm run typeorm migration:create -d dist/src/shared/config/datasource.config.js",
"migration:run": "pnpm run typeorm migration:run -d dist/src/shared/config/datasource.config.js",
"migration:run": "pnpm run typeorm migration:run -d dist/src/shared/config/datasource.config.js --transaction=each",
"migration:revert": "pnpm run typeorm -- migration:revert -d dist/src/shared/config/datasource.config.js",
"knip": "knip"
},
"dependencies": {
"@amplitude/node": "1.10.2",
"@aws-sdk/client-dynamodb": "^3.1032.0",
"@aws-sdk/client-s3": "^3.1037.0",
"@aws-sdk/lib-dynamodb": "^3.1037.0",
"@aws-sdk/s3-request-presigner": "^3.1037.0",
"@cedar-policy/cedar-wasm": "^4.9.1",
"@clickhouse/client": "^1.18.2",
"@aws-sdk/client-dynamodb": "^3.1050.0",
"@aws-sdk/client-s3": "^3.1050.0",
"@aws-sdk/lib-dynamodb": "^3.1050.0",
"@aws-sdk/s3-request-presigner": "^3.1050.0",
"@cedar-policy/cedar-wasm": "^4.11.0",
"@clickhouse/client": "^1.18.5",
"@elastic/elasticsearch": "8.18.1",
"@electric-sql/pglite": "^0.4.0",
"@faker-js/faker": "^10.3.0",
"@langchain/aws": "^1.3.3",
"@langchain/core": "^1.1.33",
"@nestjs/common": "11.1.17",
"@nestjs/core": "11.1.17",
"@nestjs/platform-express": "11.1.17",
"@nestjs/schedule": "^6.1.1",
"@nestjs/swagger": "^11.2.6",
"@electric-sql/pglite": "^0.4.5",
"@faker-js/faker": "^10.4.0",
"@langchain/aws": "^1.3.8",
"@langchain/core": "^1.1.47",
"@nestjs/common": "11.1.21",
"@nestjs/core": "11.1.21",
"@nestjs/platform-express": "11.1.21",
"@nestjs/schedule": "^6.1.3",
"@nestjs/swagger": "^11.4.3",
"@nestjs/throttler": "^6.5.0",
"@nestjs/typeorm": "^11.0.0",
"@nestjs/typeorm": "^11.0.1",
"@rocketadmin/shared-code": "workspace:*",
"@sentry/minimal": "^6.19.7",
"@sentry/node": "10.44.0",
"@toon-format/toon": "^2.1.0",
"@sentry/node": "10.53.1",
"@toon-format/toon": "^2.3.0",
"@types/crypto-js": "^4.2.2",
"@types/jsonwebtoken": "^9.0.10",
"@types/multer": "^2.1.0",
"@types/nodemailer": "^7.0.11",
"@types/nodemailer": "^8.0.0",
"@types/nunjucks": "^3.2.6",
"@types/qrcode": "^1.5.6",
"@zapier/secret-scrubber": "^1.1.6",
"argon2": "0.44.0",
"axios": "^1.15.0",
"axios": "^1.16.1",
"basic-auth": "2.0.1",
"bcrypt": "6.0.0",
"body-parser": "^2.2.2",
"cassandra-driver": "^4.8.0",
"cassandra-driver": "^4.9.0",
"class-transformer": "0.5.1",
"class-validator": "^0.15.1",
"cookie-parser": "^1.4.7",
"crypto-js": "4.2.0",
"csv": "^6.5.0",
"dotenv": "17.3.1",
"csv": "^6.5.1",
"dotenv": "17.4.2",
"express": "5.2.1",
"helmet": "8.1.0",
"i18n-iso-countries": "^7.14.0",
"ip-range-check": "0.2.0",
"json2csv": "^5.0.7",
"json5": "^2.2.3",
"jsonwebtoken": "^9.0.3",
"knex": "3.1.0",
"lru-cache": "^11.2.7",
"mongodb": "^7.1.1",
"nanoid": "5.1.7",
"node-sql-parser": "^5.3.0",
"nodemailer": "^8.0.4",
"knex": "3.2.10",
"lru-cache": "^11.5.0",
"mongodb": "^7.2.0",
"nanoid": "5.1.11",
"node-sql-parser": "^5.4.0",
"nodemailer": "^8.0.7",
"nunjucks": "^3.2.4",
"otplib": "^12.0.1",
"p-queue": "9.1.0",
"pg-connection-string": "^2.12.0",
"p-queue": "9.3.0",
"pg-connection-string": "^2.13.0",
"qrcode": "^1.5.4",
"reflect-metadata": "0.2.2",
"rimraf": "6.1.3",
"rxjs": "7.8.2",
"safe-regex2": "^5.1.0",
"safe-regex2": "^5.1.1",
"secure-json-parse": "4.1.0",
"typeorm": "0.3.28",
"typeorm": "1.0.0",
"typeorm-pglite": "^0.3.4",
"uuid": "^13.0.0",
"validator": "^13.15.26",
"uuid": "^14.0.0",
"validator": "^13.15.35",
"winston": "3.19.0",
"zod": "^4.4.3"
},
"devDependencies": {
"@ava/typescript": "6.0.0",
"@nestjs/cli": "^11.0.16",
"@nestjs/schematics": "11.0.9",
"@nestjs/testing": "^11.1.17",
"@ava/typescript": "7.0.0",
"@nestjs/cli": "^11.0.21",
"@nestjs/schematics": "11.1.0",
"@nestjs/testing": "^11.1.21",
"@types/bcrypt": "^6.0.0",
"@types/body-parser": "^1.19.6",
"@types/cookie-parser": "^1.4.10",
Expand All @@ -112,14 +112,14 @@
"@types/node": "^24.10.1",
"@types/supertest": "^7.2.0",
"@types/validator": "^13.15.10",
"ava": "6.4.1",
"knip": "^5.88.0",
"nock": "^14.0.11",
"ava": "8.0.1",
"knip": "^6.14.1",
"nock": "^14.0.15",
"redis": "^5.12.1",
"supertest": "^7.2.2",
"ts-loader": "^9.5.4",
"ts-loader": "^9.5.7",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.9.3"
"typescript": "^6.0.3"
}
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import * as cedarWasm from '@cedar-policy/cedar-wasm/nodejs';
import { HttpException, HttpStatus, Inject, Injectable, Logger, OnModuleInit } from '@nestjs/common';
import { Messages } from '../../exceptions/text/messages.js';
import { Cacher } from '../../helpers/cache/cacher.js';
import { IGlobalDatabaseContext } from '../../common/application/global-database-context.interface.js';
import { BaseType } from '../../common/data-injection.tokens.js';
import { Messages } from '../../exceptions/text/messages.js';
import { Cacher } from '../../helpers/cache/cacher.js';
import { GroupEntity } from '../group/group.entity.js';
import { IComplexPermission } from '../permission/permission.interface.js';
import {
CEDAR_ACTION_TYPE,
CEDAR_USER_TYPE,
CedarAction,
CedarResourceType,
CedarValidationRequest,
CEDAR_ACTION_TYPE,
CEDAR_USER_TYPE,
} from './cedar-action-map.js';
import { ICedarAuthorizationService } from './cedar-authorization.service.interface.js';
import { buildCedarEntities } from './cedar-entity-builder.js';
import { parseCedarPolicyToClassicalPermissions } from './cedar-policy-parser.js';
import { CEDAR_SCHEMA } from './cedar-schema.js';
import * as cedarWasm from '@cedar-policy/cedar-wasm/nodejs';

@Injectable()
export class CedarAuthorizationService implements ICedarAuthorizationService, OnModuleInit {
Expand Down Expand Up @@ -61,14 +61,32 @@ export class CedarAuthorizationService implements ICedarAuthorizationService, On
const needsSentinel = action === CedarAction.DashboardCreate || !dashboardId;
const effectiveDashboardId = needsSentinel ? '__new__' : dashboardId;
resourceId = `${connectionId}/${effectiveDashboardId}`;
return this.evaluate(userId, connectionId, action, resourceType, resourceId, tableName, effectiveDashboardId, undefined);
return this.evaluate(
userId,
connectionId,
action,
resourceType,
resourceId,
tableName,
effectiveDashboardId,
undefined,
);
}
case 'panel': {
resourceType = CedarResourceType.Panel;
const needsSentinel = action === CedarAction.PanelCreate || !panelId;
const effectivePanelId = needsSentinel ? '__new__' : panelId;
resourceId = `${connectionId}/${effectivePanelId}`;
return this.evaluate(userId, connectionId, action, resourceType, resourceId, tableName, undefined, effectivePanelId);
return this.evaluate(
userId,
connectionId,
action,
resourceType,
resourceId,
tableName,
undefined,
effectivePanelId,
);
}
default:
return false;
Expand Down Expand Up @@ -219,7 +237,7 @@ export class CedarAuthorizationService implements ICedarAuthorizationService, On
private async assertUserNotSuspended(userId: string): Promise<void> {
const user = await this.globalDbContext.userRepository.findOne({
where: { id: userId },
select: ['id', 'suspended'],
select: { id: true, suspended: true },
});
if (user?.suspended) {
throw new HttpException(
Expand Down Expand Up @@ -325,5 +343,4 @@ export class CedarAuthorizationService implements ICedarAuthorizationService, On
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
isRedisConnectionUrl,
} from '@rocketadmin/shared-code/dist/src/data-access-layer/shared/create-data-access-object.js';
import { ConnectionTypesEnum } from '@rocketadmin/shared-code/dist/src/shared/enums/connection-types-enum.js';
import { getRepository } from 'typeorm';
import AbstractUseCase from '../../../common/abstract-use.case.js';
import { IGlobalDatabaseContext } from '../../../common/application/global-database-context.interface.js';
import { BaseType } from '../../../common/data-injection.tokens.js';
Expand All @@ -16,7 +15,6 @@ import { slackPostMessage } from '../../../helpers/slack/slack-post-message.js';
import { CreateConnectionDs } from '../application/data-structures/create-connection.ds.js';
import { TestConnectionResultDs } from '../application/data-structures/test-connection-result.ds.js';
import { UpdateConnectionDs } from '../application/data-structures/update-connection.ds.js';
import { ConnectionEntity } from '../connection.entity.js';
import { decryptConnectionCredentialsAsync } from '../utils/decrypt-connection-credentials-async.js';
import { isHostAllowed } from '../utils/is-host-allowed.js';
import { processAWSConnection } from '../utils/process-aws-connection.util.js';
Expand Down Expand Up @@ -66,7 +64,7 @@ export class TestConnectionUseCase
};
}
if (isConnectionTypeAgent(toUpdate.type)) {
const qb = await getRepository(ConnectionEntity)
const qb = this._dbContext.connectionRepository
.createQueryBuilder('connection')
.leftJoinAndSelect('connection.agent', 'agent')
.where('connection.id = :id', { id: connectionId });
Expand Down
2 changes: 1 addition & 1 deletion backend/src/entities/email/email/email.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Inject, Injectable } from '@nestjs/common';
import * as Sentry from '@sentry/node';
import Mail from 'nodemailer/lib/mailer/index.js';
import SMTPTransport from 'nodemailer/lib/smtp-transport';
import SMTPTransport from 'nodemailer/lib/smtp-transport/index.js';
import * as nunjucks from 'nunjucks';
import PQueue from 'p-queue';
import { BaseType } from '../../../common/data-injection.tokens.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@nestjs/common';
import nodemailer from 'nodemailer';
import SMTPTransport from 'nodemailer/lib/smtp-transport';
import SMTPTransport from 'nodemailer/lib/smtp-transport/index.js';
import { isSaaS } from '../../../helpers/app/is-saas.js';
import { IMessage } from '../email/email.interface.js';
import { EmailConfigService } from '../email-config/email-config.service.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import SMTPTransport from 'nodemailer/lib/smtp-transport';
import SMTPTransport from 'nodemailer/lib/smtp-transport/index.js';
import { IMessage } from '../email/email.interface.js';

export interface IEmailTransporterInterface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const secretAccessLogRepositoryExtension: ISecretAccessLogRepository = {
where: {
secretId,
},
relations: ['user'],
relations: { user: true },
order: {
accessedAt: 'DESC',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const customTableSchemaChangeRepositoryExtension: ITableSchemaChangeRepos
async findByIdWithRelations(id: string): Promise<TableSchemaChangeEntity | null> {
return await this.findOne({
where: { id },
relations: ['connection', 'author', 'previousChange'],
relations: { connection: true, author: true, previousChange: true },
});
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class CreateSecretUseCase extends AbstractUseCase<CreateSecretDS, Created

const user = await this._dbContext.userRepository.findOne({
where: { id: userId },
relations: ['company'],
relations: { company: true },
});

if (!user || !user.company) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class DeleteSecretUseCase extends AbstractUseCase<DeleteSecretDS, Deleted

const user = await this._dbContext.userRepository.findOne({
where: { id: userId },
relations: ['company'],
relations: { company: true },
});

if (!user || !user.company) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class GetSecretAuditLogUseCase

const user = await this._dbContext.userRepository.findOne({
where: { id: userId },
relations: ['company'],
relations: { company: true },
});

if (!user || !user.company) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class GetSecretBySlugUseCase extends AbstractUseCase<GetSecretDS, FoundSe

const user = await this._dbContext.userRepository.findOne({
where: { id: userId },
relations: ['company'],
relations: { company: true },
});

if (!user || !user.company) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class GetSecretsUseCase extends AbstractUseCase<GetSecretsDS, SecretsList

const user = await this._dbContext.userRepository.findOne({
where: { id: userId },
relations: ['company'],
relations: { company: true },
});

if (!user || !user.company) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class UpdateSecretUseCase extends AbstractUseCase<UpdateSecretDS, Updated

const user = await this._dbContext.userRepository.findOne({
where: { id: userId },
relations: ['company'],
relations: { company: true },
});

if (!user || !user.company) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class FindSignInAuditLogsUseCase

const user = await this._dbContext.userRepository.findOne({
where: { id: userId },
relations: ['company'],
relations: { company: true },
});

if (!user || user.company?.id !== companyId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export const userCustomRepositoryExtension: IUserRepository = {
async findUserWithConnections(userId: string): Promise<UserEntity> {
const user = await this.findOne({
where: { id: userId },
relations: ['connections'],
relations: { connections: true },
});
if (user?.connections?.length) {
await decryptConnectionsCredentialsAsync(user.connections);
Expand Down
Loading
Loading