|
|
@ -1,69 +1,70 @@ |
|
|
|
import { Module, RequestMethod } from '@nestjs/common'; |
|
|
|
import { Module, RequestMethod } from '@nestjs/common' |
|
|
|
import { APP_FILTER, APP_GUARD } from '@nestjs/core'; |
|
|
|
import { APP_FILTER, APP_GUARD } from '@nestjs/core' |
|
|
|
import { ExtractJwt } from 'passport-jwt'; |
|
|
|
import { ExtractJwt } from 'passport-jwt' |
|
|
|
import { Connection } from './connection/connection'; |
|
|
|
import { Connection } from './connection/connection' |
|
|
|
import { GlobalExceptionFilter } from './filters/global-exception/global-exception.filter'; |
|
|
|
import { GlobalExceptionFilter } from './filters/global-exception/global-exception.filter' |
|
|
|
import { GlobalGuard } from './guards/global/global.guard'; |
|
|
|
import { GlobalGuard } from './guards/global/global.guard' |
|
|
|
import { GlobalMiddleware } from './middlewares/global/global.middleware'; |
|
|
|
import { GlobalMiddleware } from './middlewares/global/global.middleware' |
|
|
|
import { AuthModule } from './modules/auth/auth.module'; |
|
|
|
import { AuthModule } from './modules/auth/auth.module' |
|
|
|
import { ExtractProjectIdMiddleware } from './middlewares/extract-project-id/extract-project-id.middleware'; |
|
|
|
import { ExtractProjectIdMiddleware } from './middlewares/extract-project-id/extract-project-id.middleware' |
|
|
|
import { AuthService } from './modules/auth/auth.service'; |
|
|
|
import { AuthService } from './modules/auth/auth.service' |
|
|
|
import { UsersModule } from './modules/users/users.module'; |
|
|
|
import { UsersModule } from './modules/users/users.module' |
|
|
|
import { MetaService } from './meta/meta.service'; |
|
|
|
import { MetaService } from './meta/meta.service' |
|
|
|
import { UsersService } from './modules/users/users.service'; |
|
|
|
import { UsersService } from './modules/users/users.service' |
|
|
|
import { UtilsModule } from './modules/utils/utils.module'; |
|
|
|
import { UtilsModule } from './modules/utils/utils.module' |
|
|
|
import { ProjectsModule } from './modules/projects/projects.module'; |
|
|
|
import { ProjectsModule } from './modules/projects/projects.module' |
|
|
|
import Noco from './Noco'; |
|
|
|
import Noco from './Noco' |
|
|
|
import { JwtStrategy } from './strategies/jwt.strategy'; |
|
|
|
import { JwtStrategy } from './strategies/jwt.strategy' |
|
|
|
import { TablesModule } from './modules/tables/tables.module'; |
|
|
|
import { TablesModule } from './modules/tables/tables.module' |
|
|
|
import { ViewsModule } from './modules/views/views.module'; |
|
|
|
import { ViewsModule } from './modules/views/views.module' |
|
|
|
import { FiltersModule } from './modules/filters/filters.module'; |
|
|
|
import { FiltersModule } from './modules/filters/filters.module' |
|
|
|
import { SortsModule } from './modules/sorts/sorts.module'; |
|
|
|
import { SortsModule } from './modules/sorts/sorts.module' |
|
|
|
import { ColumnsModule } from './modules/columns/columns.module'; |
|
|
|
import { ColumnsModule } from './modules/columns/columns.module' |
|
|
|
import { ViewColumnsModule } from './modules/view-columns/view-columns.module'; |
|
|
|
import { ViewColumnsModule } from './modules/view-columns/view-columns.module' |
|
|
|
import { BasesModule } from './modules/bases/bases.module'; |
|
|
|
import { BasesModule } from './modules/bases/bases.module' |
|
|
|
import { HooksModule } from './modules/hooks/hooks.module'; |
|
|
|
import { HooksModule } from './modules/hooks/hooks.module' |
|
|
|
import { SharedBasesModule } from './modules/shared-bases/shared-bases.module'; |
|
|
|
import { SharedBasesModule } from './modules/shared-bases/shared-bases.module' |
|
|
|
import { FormsModule } from './modules/forms/forms.module'; |
|
|
|
import { FormsModule } from './modules/forms/forms.module' |
|
|
|
import { GridsModule } from './modules/grids/grids.module'; |
|
|
|
import { GridsModule } from './modules/grids/grids.module' |
|
|
|
import { KanbansModule } from './modules/kanbans/kanbans.module'; |
|
|
|
import { KanbansModule } from './modules/kanbans/kanbans.module' |
|
|
|
import { GalleriesModule } from './modules/galleries/galleries.module'; |
|
|
|
import { GalleriesModule } from './modules/galleries/galleries.module' |
|
|
|
import { FormColumnsModule } from './modules/form-columns/form-columns.module'; |
|
|
|
import { FormColumnsModule } from './modules/form-columns/form-columns.module' |
|
|
|
import { GridColumnsModule } from './modules/grid-columns/grid-columns.module'; |
|
|
|
import { GridColumnsModule } from './modules/grid-columns/grid-columns.module' |
|
|
|
import { MapsModule } from './modules/maps/maps.module'; |
|
|
|
import { MapsModule } from './modules/maps/maps.module' |
|
|
|
import { ProjectUsersModule } from './modules/project-users/project-users.module'; |
|
|
|
import { ProjectUsersModule } from './modules/project-users/project-users.module' |
|
|
|
import { ModelVisibilitiesModule } from './modules/model-visibilities/model-visibilities.module'; |
|
|
|
import { ModelVisibilitiesModule } from './modules/model-visibilities/model-visibilities.module' |
|
|
|
import { HookFiltersModule } from './modules/hook-filters/hook-filters.module'; |
|
|
|
import { HookFiltersModule } from './modules/hook-filters/hook-filters.module' |
|
|
|
import { ApiTokensModule } from './modules/api-tokens/api-tokens.module'; |
|
|
|
import { ApiTokensModule } from './modules/api-tokens/api-tokens.module' |
|
|
|
import { AttachmentsModule } from './modules/attachments/attachments.module'; |
|
|
|
import { AttachmentsModule } from './modules/attachments/attachments.module' |
|
|
|
import { OrgLcenseModule } from './modules/org-lcense/org-lcense.module'; |
|
|
|
import { OrgLcenseModule } from './modules/org-lcense/org-lcense.module' |
|
|
|
import { OrgTokensModule } from './modules/org-tokens/org-tokens.module'; |
|
|
|
import { OrgTokensModule } from './modules/org-tokens/org-tokens.module' |
|
|
|
import { OrgUsersModule } from './modules/org-users/org-users.module'; |
|
|
|
import { OrgUsersModule } from './modules/org-users/org-users.module' |
|
|
|
import { MetaDiffsModule } from './modules/meta-diffs/meta-diffs.module'; |
|
|
|
import { MetaDiffsModule } from './modules/meta-diffs/meta-diffs.module' |
|
|
|
import { AuditsModule } from './modules/audits/audits.module'; |
|
|
|
import { AuditsModule } from './modules/audits/audits.module' |
|
|
|
import { DatasModule } from './modules/datas/datas.module'; |
|
|
|
import { DatasModule } from './modules/datas/datas.module' |
|
|
|
import { ApiDocsModule } from './modules/api-docs/api-docs.module'; |
|
|
|
import { ApiDocsModule } from './modules/api-docs/api-docs.module' |
|
|
|
import { PublicMetasModule } from './modules/public-metas/public-metas.module'; |
|
|
|
import { PublicMetasModule } from './modules/public-metas/public-metas.module' |
|
|
|
import { PublicDatasModule } from './modules/public-datas/public-datas.module'; |
|
|
|
import { PublicDatasModule } from './modules/public-datas/public-datas.module' |
|
|
|
import { PublicDatasExportModule } from './modules/public-datas-export/public-datas-export.module'; |
|
|
|
import { PublicDatasExportModule } from './modules/public-datas-export/public-datas-export.module' |
|
|
|
import { SyncModule } from './modules/sync/sync.module'; |
|
|
|
import { SyncModule } from './modules/sync/sync.module' |
|
|
|
import { ImportModule } from './modules/import/import.module'; |
|
|
|
import { ImportModule } from './modules/import/import.module' |
|
|
|
import { CachesModule } from './modules/caches/caches.module'; |
|
|
|
import { CachesModule } from './modules/caches/caches.module' |
|
|
|
import { TestModule } from './modules/test/test.module'; |
|
|
|
import { TestModule } from './modules/test/test.module' |
|
|
|
import { PluginsModule } from './modules/plugins/plugins.module'; |
|
|
|
import { PluginsModule } from './modules/plugins/plugins.module' |
|
|
|
import { GlobalModule } from './modules/global/global.module'; |
|
|
|
import { GlobalModule } from './modules/global/global.module' |
|
|
|
import { LocalStrategy } from './strategies/local.strategy'; |
|
|
|
import { LocalStrategy } from './strategies/local.strategy' |
|
|
|
import NcConfigFactory from './utils/NcConfigFactory'; |
|
|
|
import NcConfigFactory from './utils/NcConfigFactory' |
|
|
|
import NcUpgrader from './version-upgrader/NcUpgrader'; |
|
|
|
import NcUpgrader from './version-upgrader/NcUpgrader' |
|
|
|
import { ClientService } from './services/client/client.service'; |
|
|
|
import { ClientService } from './services/client/client.service' |
|
|
|
import { AuthTokenStrategy } from './strategies/authtoken.strategy/authtoken.strategy'; |
|
|
|
import { AuthTokenStrategy } from './strategies/authtoken.strategy/authtoken.strategy' |
|
|
|
import { BaseViewStrategy } from './strategies/base-view.strategy/base-view.strategy'; |
|
|
|
import { BaseViewStrategy } from './strategies/base-view.strategy/base-view.strategy' |
|
|
|
import { GoogleStrategy } from './strategies/google.strategy/google.strategy'; |
|
|
|
import { GoogleStrategy } from './strategies/google.strategy/google.strategy' |
|
|
|
import type { |
|
|
|
import type { |
|
|
|
MiddlewareConsumer, |
|
|
|
MiddlewareConsumer, |
|
|
|
OnApplicationBootstrap, |
|
|
|
OnApplicationBootstrap, |
|
|
|
Provider, |
|
|
|
Provider, |
|
|
|
} from '@nestjs/common'; |
|
|
|
} from '@nestjs/common' |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
/* |
|
|
|
|
|
|
|
|
|
|
|
export const JwtStrategyProvider: Provider = { |
|
|
|
export const JwtStrategyProvider: Provider = { |
|
|
@ -127,7 +128,7 @@ export const JwtStrategyProvider: Provider = { |
|
|
|
SyncModule, |
|
|
|
SyncModule, |
|
|
|
ImportModule, |
|
|
|
ImportModule, |
|
|
|
CachesModule, |
|
|
|
CachesModule, |
|
|
|
TestModule, |
|
|
|
...(process.env['PLAYWRIGHT_TEST'] === 'true' ? [TestModule] : []), |
|
|
|
PluginsModule, |
|
|
|
PluginsModule, |
|
|
|
], |
|
|
|
], |
|
|
|
controllers: [], |
|
|
|
controllers: [], |
|
|
@ -155,24 +156,25 @@ export class AppModule implements OnApplicationBootstrap { |
|
|
|
constructor( |
|
|
|
constructor( |
|
|
|
private readonly connection: Connection, |
|
|
|
private readonly connection: Connection, |
|
|
|
private readonly metaService: MetaService, |
|
|
|
private readonly metaService: MetaService, |
|
|
|
) {} |
|
|
|
) { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Global Middleware
|
|
|
|
// Global Middleware
|
|
|
|
configure(consumer: MiddlewareConsumer) { |
|
|
|
configure(consumer: MiddlewareConsumer) { |
|
|
|
consumer |
|
|
|
consumer |
|
|
|
.apply(GlobalMiddleware) |
|
|
|
.apply(GlobalMiddleware) |
|
|
|
.forRoutes({ path: '*', method: RequestMethod.ALL }); |
|
|
|
.forRoutes({ path: '*', method: RequestMethod.ALL }) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// app init
|
|
|
|
// app init
|
|
|
|
async onApplicationBootstrap(): Promise<void> { |
|
|
|
async onApplicationBootstrap(): Promise<void> { |
|
|
|
await this.connection.init(); |
|
|
|
await this.connection.init() |
|
|
|
await this.metaService.init(); |
|
|
|
await this.metaService.init() |
|
|
|
|
|
|
|
|
|
|
|
// todo: remove
|
|
|
|
// todo: remove
|
|
|
|
// temporary hack
|
|
|
|
// temporary hack
|
|
|
|
Noco._ncMeta = this.metaService; |
|
|
|
Noco._ncMeta = this.metaService |
|
|
|
Noco.config = this.connection.config; |
|
|
|
Noco.config = this.connection.config |
|
|
|
|
|
|
|
|
|
|
|
// run upgrader
|
|
|
|
// run upgrader
|
|
|
|
// await NcUpgrader.upgrade({ ncMeta: Noco._ncMeta });
|
|
|
|
// await NcUpgrader.upgrade({ ncMeta: Noco._ncMeta });
|
|
|
|