-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: update the ways to use the nestjs services inside the rest …
…and graphql module
- Loading branch information
Showing
53 changed files
with
611 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
"cdktf", | ||
"codecov", | ||
"Concat", | ||
"datasources", | ||
"datetime", | ||
"dbml", | ||
"deepmerge", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { PrismaClient } from '@prisma/client'; | ||
|
||
import { DatabaseModule } from './database.module'; | ||
import { EncryptionModule } from './encryption.module'; | ||
|
||
import { | ||
ModelsModule as TraxionModelsModule, | ||
UserMiddlewareModule, | ||
} from '@trxn/generated-nestjs-models'; | ||
import { ModelsServicesModule as ServicesModule } from '@trxn/generated-nestjs-models-common'; | ||
import { ModelsRestModule } from '@trxn/generated-nestjs-models-rest'; | ||
import { BcryptService } from '@trxn/nestjs-bcrypt'; | ||
import { DATABASE_SERVICE } from '@trxn/nestjs-database'; | ||
|
||
@Module({ | ||
imports: [ | ||
// UserMiddlewareModule.registerAsync({ | ||
// imports: [EncryptionModule], | ||
// inject: [BcryptService], | ||
// useFactory: (bcryptService: BcryptService) => ({ | ||
// encryptionService: bcryptService, | ||
// }), | ||
// }), | ||
|
||
ServicesModule.register({ | ||
imports: [DatabaseModule], | ||
}), | ||
], | ||
exports: [ServicesModule], | ||
}) | ||
export class ModelsServicesModule {} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Module } from '@nestjs/common'; | ||
|
||
import { ModelsServicesModule } from './models-services.module'; | ||
|
||
import { ModelsRestModule as RestModule } from '@trxn/generated-nestjs-models-rest'; | ||
|
||
@Module({ | ||
imports: [ | ||
RestModule.register({ | ||
imports: [ModelsServicesModule], | ||
}), | ||
], | ||
exports: [RestModule], | ||
}) | ||
export class ModelsRestModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
16 changes: 16 additions & 0 deletions
16
...mmon/hapify/generated/nestjs-models-common/src/__kebab__/__kebab__-model.providers.ts.hpf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Provider } from '@nestjs/common'; | ||
|
||
import { | ||
<<Model pascal>>Service, | ||
} from './services'; | ||
|
||
import { | ||
<<Model constant>>_SERVICE, | ||
} from './<<Model kebab>>-model.constants'; | ||
|
||
export const <<Model constant>>_SERVICES_PROVIDERS: Provider[] = [ | ||
{ | ||
provide: <<Model constant>>_SERVICE, | ||
useClass: <<Model pascal>>Service, | ||
} | ||
]; |
3 changes: 2 additions & 1 deletion
3
...tes/nestjs-models-common/hapify/generated/nestjs-models-common/src/__kebab__/index.ts.hpf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './services'; | ||
export * from './<<Model kebab>>-model.constant'; | ||
export * from './<<Model kebab>>-model.constants'; | ||
export * from './<<Model kebab>>-model.providers'; |
8 changes: 4 additions & 4 deletions
8
...y/generated/nestjs-models-common/src/__kebab__/services/__kebab__-database.service.ts.hpf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import { DatabaseService } from '@trxn/nestjs-database'; | ||
import { DATABASE_SERVICE } from '@trxn/nestjs-database'; | ||
|
||
import { Prisma } from '@prisma/client'; | ||
import { Prisma, PrismaClient } from '@prisma/client'; | ||
|
||
export type <<Model pascal>>DatabaseService = Prisma.<<Model pascal>>Delegate<undefined> | ||
|
||
export function <<Model camel>>DatabaseServiceFactory( | ||
databaseService: DatabaseService, | ||
databaseService: PrismaClient, | ||
): Prisma.<<Model pascal>>Delegate<undefined> { | ||
return databaseService.<<Model camel>>; | ||
} | ||
|
||
export const <<Model camel>>DatabaseServiceInject = [DatabaseService]; | ||
export const <<Model camel>>DatabaseServiceInject = [DATABASE_SERVICE]; |
Oops, something went wrong.