@appxdigital/appx-core-cli 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/adminjs/admin.template.js +1 -1
- package/templates/adminjs/adminjs-app.module.template.js +1 -1
- package/templates/app.module.template.js +1 -1
- package/templates/bootstrap.template.js +6 -2
- package/templates/permissions.config.template.js +1 -1
- package/templates/prisma.module.template.js +1 -1
- package/utils/dependency-versions.json +4 -2
- package/wizard.js +13 -2
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import { addBasicFilters, createActions, createPermissionHandler, dynamicImport,
|
|
|
3
3
|
import { initializeComponents } from './component-loader';
|
|
4
4
|
import { readFileSync } from 'fs';
|
|
5
5
|
import { getDMMF } from '@prisma/sdk';
|
|
6
|
-
import {
|
|
6
|
+
import {PrismaService} from '@appxdigital/appx-core';
|
|
7
7
|
import { PrismaModule } from "../prisma/prisma.module";
|
|
8
8
|
|
|
9
9
|
const DEFAULT_ADMIN = {
|
|
@@ -8,7 +8,7 @@ import { ConfigModule } from '@nestjs/config';
|
|
|
8
8
|
import { APP_INTERCEPTOR } from '@nestjs/core';
|
|
9
9
|
import { AppController } from './app.controller';
|
|
10
10
|
import { AppService } from './app.service';
|
|
11
|
-
import {
|
|
11
|
+
import {AppxCoreModule, AuthModule, PrismaInterceptor} from '@appxdigital/appx-core';
|
|
12
12
|
import {
|
|
13
13
|
RequestContextModule,
|
|
14
14
|
RequestContextMiddleware,
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import { AppController } from './app.controller';
|
|
5
5
|
import { AppService } from './app.service';
|
|
6
6
|
import { ConfigModule } from '@nestjs/config';
|
|
7
|
-
import {
|
|
7
|
+
import {AuthModule, PrismaInterceptor, AppxCoreModule} from '@appxdigital/appx-core';
|
|
8
8
|
import { APP_INTERCEPTOR } from '@nestjs/core';
|
|
9
9
|
import {
|
|
10
10
|
RequestContextModule, RequestContextMiddleware,
|
|
@@ -3,9 +3,10 @@ import { AppModule } from './app.module';
|
|
|
3
3
|
import { ConfigService } from '@nestjs/config';
|
|
4
4
|
import * as session from 'express-session';
|
|
5
5
|
import * as passport from 'passport';
|
|
6
|
-
import {
|
|
6
|
+
import {PrismaService} from '@appxdigital/appx-core';
|
|
7
7
|
import { ValidationPipe } from '@nestjs/common';
|
|
8
|
-
import {
|
|
8
|
+
import {CorePrismaSessionStore} from '@appxdigital/appx-core';
|
|
9
|
+
import * as morgan from 'morgan';
|
|
9
10
|
|
|
10
11
|
async function bootstrap() {
|
|
11
12
|
const app = await NestFactory.create(AppModule);
|
|
@@ -17,6 +18,9 @@ async function bootstrap() {
|
|
|
17
18
|
const cookiename = configService.get<string>('SESSION_COOKIE_NAME');
|
|
18
19
|
const isProduction = process.env.NODE_ENV === 'production';
|
|
19
20
|
|
|
21
|
+
// Application request logging
|
|
22
|
+
app.use(morgan('[:date[iso]] :remote-addr :method :url :status :response-time ms - :res[content-length]'));
|
|
23
|
+
|
|
20
24
|
app.use(
|
|
21
25
|
session({
|
|
22
26
|
cookie: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Global, Module } from '@nestjs/common';
|
|
2
2
|
import { PrismaClient } from '@prisma/client';
|
|
3
|
-
import {
|
|
3
|
+
import {PERMISSIONS_CONFIG_TOKEN, PermissionsConfigType, PrismaService} from '@appxdigital/appx-core';
|
|
4
4
|
import { PermissionsConfig } from '../config/permissions.config';
|
|
5
5
|
|
|
6
6
|
@Global()
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"express": "4.21.1",
|
|
13
13
|
"argon2": "0.41.1",
|
|
14
14
|
"rxjs": "7.8.1",
|
|
15
|
-
"reflect-metadata": "0.2.0"
|
|
15
|
+
"reflect-metadata": "0.2.0",
|
|
16
|
+
"morgan": "^1.10.1"
|
|
16
17
|
},
|
|
17
18
|
"devDependencies": {
|
|
18
19
|
"@types/express": "5.0.0",
|
|
@@ -21,6 +22,7 @@
|
|
|
21
22
|
"@types/inquirer": "9.0.7",
|
|
22
23
|
"@types/multer": "1.4.12",
|
|
23
24
|
"@types/passport-local": "1.0.38",
|
|
24
|
-
"typescript": "5.1.3"
|
|
25
|
+
"typescript": "5.1.3",
|
|
26
|
+
"@types/morgan": "^1.9.10"
|
|
25
27
|
}
|
|
26
28
|
}
|
package/wizard.js
CHANGED
|
@@ -438,7 +438,7 @@ model User {
|
|
|
438
438
|
email String @unique
|
|
439
439
|
name String?
|
|
440
440
|
password String? /// @Role(none)
|
|
441
|
-
role Role @default(
|
|
441
|
+
role Role @default(GUEST)
|
|
442
442
|
}
|
|
443
443
|
|
|
444
444
|
model Session {
|
|
@@ -449,9 +449,20 @@ model Session {
|
|
|
449
449
|
userId Int?
|
|
450
450
|
}
|
|
451
451
|
|
|
452
|
+
model UserRefreshToken {
|
|
453
|
+
id String @id @default(cuid())
|
|
454
|
+
token String @unique
|
|
455
|
+
userId Int
|
|
456
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
457
|
+
expiresAt DateTime
|
|
458
|
+
createdAt DateTime @default(now())
|
|
459
|
+
revokedAt DateTime?
|
|
460
|
+
|
|
461
|
+
@@index([userId])
|
|
462
|
+
}
|
|
463
|
+
|
|
452
464
|
enum Role {
|
|
453
465
|
ADMIN
|
|
454
|
-
CLIENT
|
|
455
466
|
GUEST
|
|
456
467
|
}
|
|
457
468
|
`;
|