mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +00:00
* Added new page for env vars
* Changed a field name
* Added some backend files
- Entity, Dto, services
* Started working with api endpoints
- implmented create
- added ability
* Added fields validation
- Added env variables into module
* Added update, delete, get apis
- Also implemented delete feature in frontend
* Implemented update operation on frontend
- Solved an api problem
* Added encryption
* Added encryption to update operation
- Exposed env vars to editor
- working on viewer
* Exposed env vars in viewer also
- Resolved a bug
* Updated edit & delete icon sizes
* Added specs
- Resolved issues that occurred while testing
* removed logout code
* Changed api endpoint
* splitted page into 3 different parts, Form & table
* Now, non-admin users can see all org env vars
* Resolved divider missing issue
* Added variable_type field
* Now secret server values will be shown as 'SecureValue'
* Now you can't update variable_type
* Now server will resolve the secret env values
* Resolved variable name issue
* Added unique constraints
* Resolved some frontend bugs
* Changed error text
* Fixed failing specs
* Added group permissions for org env vars
* Added permission checking in the backend
* Implemented permission checking in the frontend
* Edited spec for new changes
* Changed some specs and fixed failing specs
* Resolved failing case that showed up after merging with the latest develop
* Added default admin seed permissions
* Refactored some code
* Changed value to organization_id
* Fixed a bug
* Resolved a failing case
* Resolved PR changes
- Changed permission name
- Changed column type to enum
- Fixed some errors
- Refactored the code
* minor code change
* added scope
* Fixed: hide table when 0 no of vars available
* Fixed table dark theme issues
* Fixed encryption switch style
* Fixed failing cases and updated a spec
* Added %% for environment variables
* Added code to resolve single variable
* Fixed multi-variable usage
* resolved an issue
* removed extra divider
* Suggestions will also show up for %% too
* now, suggestions dropdown will only show env variables results
* env vars suggestions will not be included in js search results
* You can't resolve env variables from js code
- Also, we can't resolve js code from env variable enclosures
* added an info text
* Resolved variables issue
* fixed Viewer issue
* Resolved a bug
- client variable was not working on query preview and run actions
* Update error message while using server variable on canvas
* Revert "Update error message while using server variable on canvas"
This reverts commit 081e1c9e29.
* Resolved all PR changes
- removed prefix 'environmentVariable'
- redefined variable evaluation
- removed environmentVariable object from inspector
- fixed a small bug
* Fixed a server side issue
Co-authored-by: Sherfin Shamsudeen <sherfin94@gmail.com>
128 lines
4.1 KiB
TypeScript
128 lines
4.1 KiB
TypeScript
import { Module, OnModuleInit, RequestMethod, MiddlewareConsumer } from '@nestjs/common';
|
|
|
|
import { Connection } from 'typeorm';
|
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
import ormconfig from '../ormconfig';
|
|
import { SeedsModule } from './modules/seeds/seeds.module';
|
|
import { SeedsService } from '@services/seeds.service';
|
|
|
|
import { LoggerModule } from 'nestjs-pino';
|
|
import { SentryModule } from './modules/observability/sentry/sentry.module';
|
|
import * as Sentry from '@sentry/node';
|
|
|
|
import { ConfigModule } from '@nestjs/config';
|
|
import { ServeStaticModule } from '@nestjs/serve-static';
|
|
import { CaslModule } from './modules/casl/casl.module';
|
|
import { EmailService } from '@services/email.service';
|
|
import { MetaModule } from './modules/meta/meta.module';
|
|
import { AppController } from './controllers/app.controller';
|
|
import { AuthModule } from './modules/auth/auth.module';
|
|
import { UsersModule } from './modules/users/users.module';
|
|
import { FilesModule } from './modules/files/files.module';
|
|
import { AppConfigModule } from './modules/app_config/app_config.module';
|
|
import { AppsModule } from './modules/apps/apps.module';
|
|
import { FoldersModule } from './modules/folders/folders.module';
|
|
import { OrgEnvironmentVariablesModule } from './modules/org_environment_variables/org_environment_variables.module';
|
|
import { FolderAppsModule } from './modules/folder_apps/folder_apps.module';
|
|
import { DataQueriesModule } from './modules/data_queries/data_queries.module';
|
|
import { DataSourcesModule } from './modules/data_sources/data_sources.module';
|
|
import { OrganizationsModule } from './modules/organizations/organizations.module';
|
|
import { CommentModule } from './modules/comments/comment.module';
|
|
import { join } from 'path';
|
|
import { LibraryAppModule } from './modules/library_app/library_app.module';
|
|
import { ThreadModule } from './modules/thread/thread.module';
|
|
import { EventsModule } from './events/events.module';
|
|
import { GroupPermissionsModule } from './modules/group_permissions/group_permissions.module';
|
|
|
|
const imports = [
|
|
ConfigModule.forRoot({
|
|
isGlobal: true,
|
|
envFilePath: [`../.env.${process.env.NODE_ENV}`, '../.env'],
|
|
}),
|
|
LoggerModule.forRoot({
|
|
pinoHttp: {
|
|
level: (() => {
|
|
const logLevel = {
|
|
production: 'info',
|
|
development: 'debug',
|
|
test: 'error',
|
|
};
|
|
|
|
return logLevel[process.env.NODE_ENV] || 'info';
|
|
})(),
|
|
autoLogging: {
|
|
ignorePaths: ['/api/health'],
|
|
},
|
|
prettyPrint:
|
|
process.env.NODE_ENV !== 'production'
|
|
? {
|
|
colorize: true,
|
|
levelFirst: true,
|
|
translateTime: 'UTC:mm/dd/yyyy, h:MM:ss TT Z',
|
|
}
|
|
: false,
|
|
redact: ['req.headers.authorization'],
|
|
},
|
|
}),
|
|
TypeOrmModule.forRoot(ormconfig),
|
|
AppConfigModule,
|
|
SeedsModule,
|
|
AuthModule,
|
|
UsersModule,
|
|
AppsModule,
|
|
FoldersModule,
|
|
OrgEnvironmentVariablesModule,
|
|
FolderAppsModule,
|
|
DataQueriesModule,
|
|
DataSourcesModule,
|
|
OrganizationsModule,
|
|
CaslModule,
|
|
MetaModule,
|
|
LibraryAppModule,
|
|
GroupPermissionsModule,
|
|
FilesModule,
|
|
EventsModule,
|
|
];
|
|
|
|
if (process.env.SERVE_CLIENT !== 'false') {
|
|
imports.unshift(
|
|
ServeStaticModule.forRoot({
|
|
rootPath: join(__dirname, '../../../', 'frontend/build'),
|
|
})
|
|
);
|
|
}
|
|
|
|
if (process.env.APM_VENDOR == 'sentry') {
|
|
imports.unshift(
|
|
SentryModule.forRoot({
|
|
dsn: process.env.SENTRY_DNS,
|
|
tracesSampleRate: 1.0,
|
|
debug: !!process.env.SENTRY_DEBUG,
|
|
})
|
|
);
|
|
}
|
|
|
|
if (process.env.COMMENT_FEATURE_ENABLE !== 'false') {
|
|
imports.unshift(CommentModule, ThreadModule);
|
|
}
|
|
|
|
@Module({
|
|
imports,
|
|
controllers: [AppController],
|
|
providers: [EmailService, SeedsService],
|
|
})
|
|
export class AppModule implements OnModuleInit {
|
|
constructor(private connection: Connection) {}
|
|
|
|
configure(consumer: MiddlewareConsumer): void {
|
|
consumer.apply(Sentry.Handlers.requestHandler()).forRoutes({
|
|
path: '*',
|
|
method: RequestMethod.ALL,
|
|
});
|
|
}
|
|
|
|
onModuleInit(): void {
|
|
console.log(`Version: ${globalThis.TOOLJET_VERSION}`);
|
|
console.log(`Initializing server modules 📡 `);
|
|
}
|
|
}
|