@smartsoft001/crud-shell-nestjs 2.76.0 → 2.81.0
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/index.js +1840 -0
- package/package.json +3 -3
- package/src/lib/controllers/crud/crud.controller.d.ts +39 -0
- package/src/lib/controllers/crud/query-to-mongo.d.ts +5 -0
- package/src/lib/controllers/{index.ts → index.d.ts} +1 -3
- package/src/lib/gateways/crud/crud.gateway.d.ts +18 -0
- package/src/lib/gateways/index.d.ts +2 -0
- package/src/lib/guards/auth/auth.guard.d.ts +10 -0
- package/src/lib/nestjs.module.d.ts +31 -0
- package/.eslintrc +0 -13
- package/jest.config.ts +0 -27
- package/project.json +0 -43
- package/src/lib/controllers/crud/crud.controller.spec.ts +0 -111
- package/src/lib/controllers/crud/crud.controller.ts +0 -355
- package/src/lib/controllers/crud/query-to-mongo.spec.ts +0 -32
- package/src/lib/controllers/crud/query-to-mongo.ts +0 -295
- package/src/lib/gateways/crud/crud.gateway.spec.ts +0 -122
- package/src/lib/gateways/crud/crud.gateway.ts +0 -73
- package/src/lib/gateways/index.ts +0 -3
- package/src/lib/guards/auth/auth.guard.spec.ts +0 -61
- package/src/lib/guards/auth/auth.guard.ts +0 -22
- package/src/lib/nestjs.module.ts +0 -94
- package/tsconfig.json +0 -13
- package/tsconfig.lib.json +0 -11
- package/tsconfig.spec.json +0 -20
- /package/src/{index.ts → index.d.ts} +0 -0
- /package/{test-setup.ts → test-setup.d.ts} +0 -0
package/src/lib/nestjs.module.ts
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { DynamicModule, Module } from '@nestjs/common';
|
|
2
|
-
import { JwtModule } from '@nestjs/jwt';
|
|
3
|
-
import { PassportModule } from '@nestjs/passport';
|
|
4
|
-
|
|
5
|
-
import { SERVICES } from '@smartsoft001/crud-shell-app-services';
|
|
6
|
-
import { MongoModule } from '@smartsoft001/mongo';
|
|
7
|
-
import { SharedConfig, SharedModule } from '@smartsoft001/nestjs';
|
|
8
|
-
|
|
9
|
-
import { CONTROLLERS } from './controllers';
|
|
10
|
-
import { GATEWAYS } from './gateways';
|
|
11
|
-
import { AuthJwtGuard } from './guards/auth/auth.guard';
|
|
12
|
-
|
|
13
|
-
@Module({})
|
|
14
|
-
export class CrudShellNestjsModule {
|
|
15
|
-
static forRoot<T>(
|
|
16
|
-
options: SharedConfig & {
|
|
17
|
-
db: {
|
|
18
|
-
host: string;
|
|
19
|
-
port: number;
|
|
20
|
-
database: string;
|
|
21
|
-
username?: string;
|
|
22
|
-
password?: string;
|
|
23
|
-
collection?: string;
|
|
24
|
-
type?: T;
|
|
25
|
-
};
|
|
26
|
-
} & {
|
|
27
|
-
restApi: boolean;
|
|
28
|
-
socket: boolean;
|
|
29
|
-
},
|
|
30
|
-
): DynamicModule {
|
|
31
|
-
return {
|
|
32
|
-
module: CrudShellNestjsModule,
|
|
33
|
-
controllers: options.restApi ? CONTROLLERS : [],
|
|
34
|
-
providers: [
|
|
35
|
-
...SERVICES,
|
|
36
|
-
...(options.socket ? GATEWAYS : []),
|
|
37
|
-
AuthJwtGuard,
|
|
38
|
-
],
|
|
39
|
-
imports: [
|
|
40
|
-
...(options.restApi && options.tokenConfig.secretOrPrivateKey
|
|
41
|
-
? [
|
|
42
|
-
PassportModule.register({
|
|
43
|
-
defaultStrategy: 'jwt',
|
|
44
|
-
session: false,
|
|
45
|
-
}),
|
|
46
|
-
JwtModule.register({
|
|
47
|
-
secret: options.tokenConfig.secretOrPrivateKey,
|
|
48
|
-
signOptions: {
|
|
49
|
-
expiresIn: options.tokenConfig.expiredIn,
|
|
50
|
-
},
|
|
51
|
-
}),
|
|
52
|
-
]
|
|
53
|
-
: []),
|
|
54
|
-
SharedModule.forFeature(options),
|
|
55
|
-
MongoModule.forRoot(options.db),
|
|
56
|
-
],
|
|
57
|
-
exports: [...SERVICES, AuthJwtGuard, MongoModule.forRoot(options.db)],
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
@Module({})
|
|
63
|
-
export class CrudShellNestjsCoreModule {
|
|
64
|
-
static forRoot<T>(
|
|
65
|
-
options: SharedConfig & {
|
|
66
|
-
db: {
|
|
67
|
-
host: string;
|
|
68
|
-
port: number;
|
|
69
|
-
database: string;
|
|
70
|
-
username?: string;
|
|
71
|
-
password?: string;
|
|
72
|
-
collection?: string;
|
|
73
|
-
type?: any;
|
|
74
|
-
};
|
|
75
|
-
},
|
|
76
|
-
): DynamicModule {
|
|
77
|
-
return {
|
|
78
|
-
module: CrudShellNestjsModule,
|
|
79
|
-
providers: [...SERVICES, ...GATEWAYS, AuthJwtGuard],
|
|
80
|
-
imports: [
|
|
81
|
-
PassportModule.register({ defaultStrategy: 'jwt', session: false }),
|
|
82
|
-
JwtModule.register({
|
|
83
|
-
secret: options.tokenConfig.secretOrPrivateKey,
|
|
84
|
-
signOptions: {
|
|
85
|
-
expiresIn: options.tokenConfig.expiredIn,
|
|
86
|
-
},
|
|
87
|
-
}),
|
|
88
|
-
SharedModule.forRoot(options),
|
|
89
|
-
MongoModule.forRoot(options.db),
|
|
90
|
-
],
|
|
91
|
-
exports: [],
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
}
|
package/tsconfig.json
DELETED
package/tsconfig.lib.json
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"module": "commonjs",
|
|
5
|
-
"outDir": "../../../../dist/out-tsc",
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"types": ["node"]
|
|
8
|
-
},
|
|
9
|
-
"exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts"],
|
|
10
|
-
"include": ["**/*.ts"]
|
|
11
|
-
}
|
package/tsconfig.spec.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "../../../../dist/out-tsc",
|
|
5
|
-
"module": "commonjs",
|
|
6
|
-
"types": ["jest", "node"]
|
|
7
|
-
},
|
|
8
|
-
"include": [
|
|
9
|
-
"**/*.spec.ts",
|
|
10
|
-
"**/*.test.ts",
|
|
11
|
-
"**/*.spec.tsx",
|
|
12
|
-
"**/*.test.tsx",
|
|
13
|
-
"**/*.spec.js",
|
|
14
|
-
"**/*.test.js",
|
|
15
|
-
"**/*.spec.jsx",
|
|
16
|
-
"**/*.test.jsx",
|
|
17
|
-
"**/*.d.ts",
|
|
18
|
-
"jest.config.ts"
|
|
19
|
-
]
|
|
20
|
-
}
|
|
File without changes
|
|
File without changes
|