@lenne.tech/nest-server 10.2.16 → 10.3.1
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/dist/core/common/helpers/context.helper.d.ts +1 -0
- package/dist/core/common/inputs/combined-filter.input.js +0 -5
- package/dist/core/common/inputs/combined-filter.input.js.map +1 -1
- package/dist/core/common/inputs/filter.input.js +0 -5
- package/dist/core/common/inputs/filter.input.js.map +1 -1
- package/dist/core/common/inputs/single-filter.input.js +0 -10
- package/dist/core/common/inputs/single-filter.input.js.map +1 -1
- package/dist/core/common/inputs/sort.input.js +0 -5
- package/dist/core/common/inputs/sort.input.js.map +1 -1
- package/dist/core/common/models/core-persistence.model.js +0 -1
- package/dist/core/common/models/core-persistence.model.js.map +1 -1
- package/dist/core/modules/auth/core-auth.controller.js +0 -7
- package/dist/core/modules/auth/core-auth.controller.js.map +1 -1
- package/dist/core/modules/auth/core-auth.model.js +0 -6
- package/dist/core/modules/auth/core-auth.model.js.map +1 -1
- package/dist/core/modules/auth/core-auth.resolver.js +0 -7
- package/dist/core/modules/auth/core-auth.resolver.js.map +1 -1
- package/dist/core/modules/auth/inputs/core-auth-sign-in.input.js +0 -7
- package/dist/core/modules/auth/inputs/core-auth-sign-in.input.js.map +1 -1
- package/dist/core/modules/auth/inputs/core-auth-sign-up.input.js +0 -3
- package/dist/core/modules/auth/inputs/core-auth-sign-up.input.js.map +1 -1
- package/dist/core/modules/auth/strategies/jwt-refresh.strategy.d.ts +1 -0
- package/dist/core/modules/file/core-file-info.model.js +0 -14
- package/dist/core/modules/file/core-file-info.model.js.map +1 -1
- package/dist/core/modules/file/core-file.controller.js +0 -4
- package/dist/core/modules/file/core-file.controller.js.map +1 -1
- package/dist/core/modules/file/core-file.resolver.js +0 -7
- package/dist/core/modules/file/core-file.resolver.js.map +1 -1
- package/dist/core/modules/health-check/core-health-check-result.model.js +0 -7
- package/dist/core/modules/health-check/core-health-check-result.model.js.map +1 -1
- package/dist/core/modules/health-check/core-health-check.controller.js +0 -4
- package/dist/core/modules/health-check/core-health-check.controller.js.map +1 -1
- package/dist/core/modules/user/core-user.model.js +0 -15
- package/dist/core/modules/user/core-user.model.js.map +1 -1
- package/dist/core/modules/user/inputs/core-user-create.input.js +0 -4
- package/dist/core/modules/user/inputs/core-user-create.input.js.map +1 -1
- package/dist/core/modules/user/inputs/core-user.input.js +0 -6
- package/dist/core/modules/user/inputs/core-user.input.js.map +1 -1
- package/dist/server/common/models/persistence.model.js +0 -5
- package/dist/server/common/models/persistence.model.js.map +1 -1
- package/dist/server/modules/auth/auth.controller.js +0 -3
- package/dist/server/modules/auth/auth.controller.js.map +1 -1
- package/dist/server/modules/auth/auth.model.js +0 -4
- package/dist/server/modules/auth/auth.model.js.map +1 -1
- package/dist/server/modules/auth/auth.resolver.js +0 -5
- package/dist/server/modules/auth/auth.resolver.js.map +1 -1
- package/dist/server/modules/auth/inputs/auth-sign-in.input.js +0 -3
- package/dist/server/modules/auth/inputs/auth-sign-in.input.js.map +1 -1
- package/dist/server/modules/auth/inputs/auth-sign-up.input.js +0 -5
- package/dist/server/modules/auth/inputs/auth-sign-up.input.js.map +1 -1
- package/dist/server/modules/file/file-info.model.js +0 -3
- package/dist/server/modules/file/file-info.model.js.map +1 -1
- package/dist/server/modules/file/file.controller.js +0 -4
- package/dist/server/modules/file/file.controller.js.map +1 -1
- package/dist/server/modules/user/avatar.controller.js +0 -1
- package/dist/server/modules/user/avatar.controller.js.map +1 -1
- package/dist/server/modules/user/inputs/user-create.input.js +0 -3
- package/dist/server/modules/user/inputs/user-create.input.js.map +1 -1
- package/dist/server/modules/user/inputs/user.input.js +0 -3
- package/dist/server/modules/user/inputs/user.input.js.map +1 -1
- package/dist/server/modules/user/outputs/find-and-count-users-result.output.js +0 -5
- package/dist/server/modules/user/outputs/find-and-count-users-result.output.js.map +1 -1
- package/dist/server/modules/user/user.model.d.ts +0 -1
- package/dist/server/modules/user/user.model.js +0 -14
- package/dist/server/modules/user/user.model.js.map +1 -1
- package/dist/server/server.controller.js +0 -2
- package/dist/server/server.controller.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +44 -44
- package/src/core/common/inputs/combined-filter.input.ts +0 -5
- package/src/core/common/inputs/filter.input.ts +0 -5
- package/src/core/common/inputs/single-filter.input.ts +0 -10
- package/src/core/common/inputs/sort.input.ts +0 -5
- package/src/core/common/models/core-persistence.model.ts +0 -1
- package/src/core/modules/auth/core-auth.controller.ts +0 -7
- package/src/core/modules/auth/core-auth.model.ts +0 -6
- package/src/core/modules/auth/core-auth.resolver.ts +0 -7
- package/src/core/modules/auth/inputs/core-auth-sign-in.input.ts +0 -7
- package/src/core/modules/auth/inputs/core-auth-sign-up.input.ts +0 -3
- package/src/core/modules/file/core-file-info.model.ts +0 -10
- package/src/core/modules/file/core-file.controller.ts +0 -4
- package/src/core/modules/file/core-file.resolver.ts +0 -7
- package/src/core/modules/health-check/core-health-check-result.model.ts +0 -7
- package/src/core/modules/health-check/core-health-check.controller.ts +0 -4
- package/src/core/modules/user/core-user.model.ts +0 -15
- package/src/core/modules/user/inputs/core-user-create.input.ts +0 -4
- package/src/core/modules/user/inputs/core-user.input.ts +0 -6
- package/src/server/common/models/persistence.model.ts +0 -5
- package/src/server/modules/auth/auth.controller.ts +0 -3
- package/src/server/modules/auth/auth.model.ts +0 -4
- package/src/server/modules/auth/auth.resolver.ts +0 -5
- package/src/server/modules/auth/inputs/auth-sign-in.input.ts +0 -3
- package/src/server/modules/auth/inputs/auth-sign-up.input.ts +0 -5
- package/src/server/modules/file/file-info.model.ts +0 -3
- package/src/server/modules/file/file.controller.ts +0 -4
- package/src/server/modules/user/avatar.controller.ts +0 -1
- package/src/server/modules/user/inputs/user-create.input.ts +0 -3
- package/src/server/modules/user/inputs/user.input.ts +0 -3
- package/src/server/modules/user/outputs/find-and-count-users-result.output.ts +0 -5
- package/src/server/modules/user/user.model.ts +0 -15
- package/src/server/server.controller.ts +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lenne.tech/nest-server",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.3.1",
|
|
4
4
|
"description": "Modern, fast, powerful Node.js web framework in TypeScript based on Nest with a GraphQL API and a connection to MongoDB (or other databases).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node",
|
|
@@ -63,20 +63,20 @@
|
|
|
63
63
|
"node": ">= 20"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@apollo/gateway": "2.
|
|
66
|
+
"@apollo/gateway": "2.8.4",
|
|
67
67
|
"@getbrevo/brevo": "1.0.1",
|
|
68
68
|
"@lenne.tech/mongoose-gridfs": "1.4.2",
|
|
69
69
|
"@lenne.tech/multer-gridfs-storage": "5.0.6",
|
|
70
|
-
"@nestjs/apollo": "12.0
|
|
71
|
-
"@nestjs/common": "10.
|
|
72
|
-
"@nestjs/core": "10.
|
|
73
|
-
"@nestjs/graphql": "12.0
|
|
70
|
+
"@nestjs/apollo": "12.2.0",
|
|
71
|
+
"@nestjs/common": "10.4.0",
|
|
72
|
+
"@nestjs/core": "10.4.0",
|
|
73
|
+
"@nestjs/graphql": "12.2.0",
|
|
74
74
|
"@nestjs/jwt": "10.2.0",
|
|
75
|
-
"@nestjs/mongoose": "10.0.
|
|
75
|
+
"@nestjs/mongoose": "10.0.10",
|
|
76
76
|
"@nestjs/passport": "10.0.3",
|
|
77
|
-
"@nestjs/platform-express": "10.
|
|
78
|
-
"@nestjs/schedule": "4.
|
|
79
|
-
"@nestjs/terminus": "10.2.
|
|
77
|
+
"@nestjs/platform-express": "10.4.0",
|
|
78
|
+
"@nestjs/schedule": "4.1.0",
|
|
79
|
+
"@nestjs/terminus": "10.2.3",
|
|
80
80
|
"apollo-server-core": "3.13.0",
|
|
81
81
|
"apollo-server-express": "3.13.0",
|
|
82
82
|
"bcrypt": "5.1.1",
|
|
@@ -84,72 +84,72 @@
|
|
|
84
84
|
"class-validator": "0.14.1",
|
|
85
85
|
"compression": "1.7.4",
|
|
86
86
|
"cookie-parser": "1.4.6",
|
|
87
|
-
"ejs": "3.1.
|
|
88
|
-
"graphql": "16.
|
|
89
|
-
"graphql-query-complexity": "0.
|
|
87
|
+
"ejs": "3.1.10",
|
|
88
|
+
"graphql": "16.9.0",
|
|
89
|
+
"graphql-query-complexity": "1.0.0",
|
|
90
90
|
"graphql-subscriptions": "2.0.0",
|
|
91
91
|
"graphql-upload": "15.0.2",
|
|
92
92
|
"js-sha256": "0.11.0",
|
|
93
93
|
"json-to-graphql-query": "2.2.5",
|
|
94
|
-
"light-my-request": "5.
|
|
94
|
+
"light-my-request": "5.13.0",
|
|
95
95
|
"lodash": "4.17.21",
|
|
96
|
-
"mongodb": "6.
|
|
97
|
-
"mongoose": "7.
|
|
96
|
+
"mongodb": "6.8.0",
|
|
97
|
+
"mongoose": "7.8.0",
|
|
98
98
|
"multer": "1.4.5-lts.1",
|
|
99
99
|
"node-mailjet": "6.0.5",
|
|
100
|
-
"nodemailer": "6.9.
|
|
101
|
-
"nodemon": "3.
|
|
100
|
+
"nodemailer": "6.9.14",
|
|
101
|
+
"nodemon": "3.1.4",
|
|
102
102
|
"passport": "0.7.0",
|
|
103
103
|
"passport-jwt": "4.0.1",
|
|
104
|
-
"reflect-metadata": "0.
|
|
105
|
-
"rfdc": "1.
|
|
106
|
-
"rimraf": "
|
|
104
|
+
"reflect-metadata": "0.2.2",
|
|
105
|
+
"rfdc": "1.4.1",
|
|
106
|
+
"rimraf": "6.0.1",
|
|
107
107
|
"rxjs": "7.8.1",
|
|
108
108
|
"yuml-diagram": "1.2.0"
|
|
109
109
|
},
|
|
110
110
|
"devDependencies": {
|
|
111
111
|
"@babel/plugin-proposal-private-methods": "7.18.6",
|
|
112
|
-
"@compodoc/compodoc": "1.1.
|
|
112
|
+
"@compodoc/compodoc": "1.1.25",
|
|
113
113
|
"@lenne.tech/eslint-config-ts": "0.0.16",
|
|
114
|
-
"@nestjs/cli": "10.
|
|
115
|
-
"@nestjs/schematics": "10.1.
|
|
116
|
-
"@nestjs/testing": "10.
|
|
117
|
-
"@swc/cli": "0.
|
|
118
|
-
"@swc/core": "1.
|
|
119
|
-
"@swc/jest": "0.2.
|
|
114
|
+
"@nestjs/cli": "10.4.4",
|
|
115
|
+
"@nestjs/schematics": "10.1.3",
|
|
116
|
+
"@nestjs/testing": "10.4.0",
|
|
117
|
+
"@swc/cli": "0.4.0",
|
|
118
|
+
"@swc/core": "1.7.10",
|
|
119
|
+
"@swc/jest": "0.2.36",
|
|
120
120
|
"@types/compression": "1.7.5",
|
|
121
|
-
"@types/cookie-parser": "1.4.
|
|
121
|
+
"@types/cookie-parser": "1.4.7",
|
|
122
122
|
"@types/ejs": "3.1.5",
|
|
123
123
|
"@types/express": "4.17.21",
|
|
124
|
-
"@types/jest": "29.5.
|
|
125
|
-
"@types/lodash": "4.
|
|
124
|
+
"@types/jest": "29.5.12",
|
|
125
|
+
"@types/lodash": "4.17.7",
|
|
126
126
|
"@types/multer": "1.4.11",
|
|
127
|
-
"@types/node": "
|
|
128
|
-
"@types/nodemailer": "6.4.
|
|
127
|
+
"@types/node": "22.2.0",
|
|
128
|
+
"@types/nodemailer": "6.4.15",
|
|
129
129
|
"@types/passport": "1.0.16",
|
|
130
130
|
"@types/supertest": "6.0.2",
|
|
131
|
-
"@typescript-eslint/eslint-plugin": "6.
|
|
132
|
-
"@typescript-eslint/parser": "6.
|
|
131
|
+
"@typescript-eslint/eslint-plugin": "6.21.0",
|
|
132
|
+
"@typescript-eslint/parser": "6.21.0",
|
|
133
133
|
"coffeescript": "2.7.0",
|
|
134
|
-
"eslint": "8.
|
|
134
|
+
"eslint": "8.57.0",
|
|
135
135
|
"eslint-config-prettier": "9.1.0",
|
|
136
|
-
"eslint-plugin-unused-imports": "3.
|
|
136
|
+
"eslint-plugin-unused-imports": "3.2.0",
|
|
137
137
|
"find-file-up": "2.0.1",
|
|
138
138
|
"grunt": "1.6.1",
|
|
139
139
|
"grunt-bg-shell": "2.3.3",
|
|
140
140
|
"grunt-contrib-clean": "2.0.1",
|
|
141
141
|
"grunt-contrib-watch": "1.1.0",
|
|
142
142
|
"grunt-sync": "0.8.2",
|
|
143
|
-
"husky": "
|
|
143
|
+
"husky": "9.1.4",
|
|
144
144
|
"jest": "29.7.0",
|
|
145
|
-
"npm-watch": "0.
|
|
146
|
-
"pm2": "5.
|
|
147
|
-
"prettier": "3.
|
|
145
|
+
"npm-watch": "0.13.0",
|
|
146
|
+
"pm2": "5.4.2",
|
|
147
|
+
"prettier": "3.3.3",
|
|
148
148
|
"pretty-quick": "4.0.0",
|
|
149
|
-
"supertest": "
|
|
150
|
-
"ts-jest": "29.
|
|
149
|
+
"supertest": "7.0.0",
|
|
150
|
+
"ts-jest": "29.2.4",
|
|
151
151
|
"ts-loader": "9.5.1",
|
|
152
|
-
"ts-morph": "
|
|
152
|
+
"ts-morph": "21.0.1",
|
|
153
153
|
"ts-node": "10.9.2",
|
|
154
154
|
"tsconfig-paths": "4.2.0",
|
|
155
155
|
"typescript": "5.3.3",
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { Field, InputType } from '@nestjs/graphql';
|
|
2
2
|
|
|
3
|
-
import { Restricted } from '../decorators/restricted.decorator';
|
|
4
3
|
import { LogicalOperatorEnum } from '../enums/logical-operator.enum';
|
|
5
|
-
import { RoleEnum } from '../enums/role.enum';
|
|
6
4
|
import { maps } from '../helpers/model.helper';
|
|
7
5
|
import { CoreInput } from './core-input.input';
|
|
8
6
|
import { FilterInput } from './filter.input';
|
|
9
7
|
|
|
10
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
11
8
|
@InputType({
|
|
12
9
|
description: 'Combination of multiple filters via logical operator',
|
|
13
10
|
})
|
|
@@ -15,7 +12,6 @@ export class CombinedFilterInput extends CoreInput {
|
|
|
15
12
|
/**
|
|
16
13
|
* Logical Operator to combine filters
|
|
17
14
|
*/
|
|
18
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
19
15
|
@Field(type => LogicalOperatorEnum, {
|
|
20
16
|
description: 'Logical Operator to combine filters',
|
|
21
17
|
})
|
|
@@ -24,7 +20,6 @@ export class CombinedFilterInput extends CoreInput {
|
|
|
24
20
|
/**
|
|
25
21
|
* Filters to combine via logical operator
|
|
26
22
|
*/
|
|
27
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
28
23
|
@Field(type => [FilterInput], {
|
|
29
24
|
description: 'Filters to combine via logical operator',
|
|
30
25
|
})
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Field, InputType } from '@nestjs/graphql';
|
|
2
2
|
|
|
3
|
-
import { Restricted } from '../decorators/restricted.decorator';
|
|
4
|
-
import { RoleEnum } from '../enums/role.enum';
|
|
5
3
|
import { CombinedFilterInput } from './combined-filter.input';
|
|
6
4
|
import { CoreInput } from './core-input.input';
|
|
7
5
|
import { SingleFilterInput } from './single-filter.input';
|
|
@@ -9,7 +7,6 @@ import { SingleFilterInput } from './single-filter.input';
|
|
|
9
7
|
/**
|
|
10
8
|
* Input for filtering. The `singleFilter` will be ignored if the `combinedFilter` is set.
|
|
11
9
|
*/
|
|
12
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
13
10
|
@InputType({
|
|
14
11
|
description: 'Input for filtering. The `singleFilter` will be ignored if the `combinedFilter` is set.',
|
|
15
12
|
})
|
|
@@ -17,7 +14,6 @@ export class FilterInput extends CoreInput {
|
|
|
17
14
|
/**
|
|
18
15
|
* Combination of multiple filters via logical operator
|
|
19
16
|
*/
|
|
20
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
21
17
|
@Field(type => CombinedFilterInput, {
|
|
22
18
|
description: 'Combination of multiple filters via logical operator',
|
|
23
19
|
nullable: true,
|
|
@@ -27,7 +23,6 @@ export class FilterInput extends CoreInput {
|
|
|
27
23
|
/**
|
|
28
24
|
* Filter for a single property
|
|
29
25
|
*/
|
|
30
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
31
26
|
@Field(type => SingleFilterInput, {
|
|
32
27
|
description: 'Filter for a single property',
|
|
33
28
|
nullable: true,
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
import { Field, InputType } from '@nestjs/graphql';
|
|
2
2
|
|
|
3
|
-
import { Restricted } from '../decorators/restricted.decorator';
|
|
4
3
|
import { ComparisonOperatorEnum } from '../enums/comparison-operator.enum';
|
|
5
|
-
import { RoleEnum } from '../enums/role.enum';
|
|
6
4
|
import { JSON } from '../scalars/json.scalar';
|
|
7
5
|
import { CoreInput } from './core-input.input';
|
|
8
6
|
|
|
9
7
|
/**
|
|
10
8
|
* Input for a configuration of a filter
|
|
11
9
|
*/
|
|
12
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
13
10
|
@InputType({ description: 'Input for a configuration of a filter' })
|
|
14
11
|
export class SingleFilterInput extends CoreInput {
|
|
15
12
|
/**
|
|
16
13
|
* Convert value to ObjectId
|
|
17
14
|
*/
|
|
18
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
19
15
|
@Field({
|
|
20
16
|
description: 'Convert value to ObjectId',
|
|
21
17
|
nullable: true,
|
|
@@ -25,14 +21,12 @@ export class SingleFilterInput extends CoreInput {
|
|
|
25
21
|
/**
|
|
26
22
|
* Name of the property to be used for the filter
|
|
27
23
|
*/
|
|
28
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
29
24
|
@Field({ description: 'Name of the property to be used for the filter' })
|
|
30
25
|
field: string = undefined;
|
|
31
26
|
|
|
32
27
|
/**
|
|
33
28
|
* Process value as reference
|
|
34
29
|
*/
|
|
35
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
36
30
|
@Field({
|
|
37
31
|
description: 'Process value as reference',
|
|
38
32
|
nullable: true,
|
|
@@ -42,7 +36,6 @@ export class SingleFilterInput extends CoreInput {
|
|
|
42
36
|
/**
|
|
43
37
|
* [Negate operator](https://docs.mongodb.com/manual/reference/operator/query/not/)
|
|
44
38
|
*/
|
|
45
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
46
39
|
@Field({
|
|
47
40
|
description: '[Negate operator](https://docs.mongodb.com/manual/reference/operator/query/not/)',
|
|
48
41
|
nullable: true,
|
|
@@ -52,7 +45,6 @@ export class SingleFilterInput extends CoreInput {
|
|
|
52
45
|
/**
|
|
53
46
|
* [Comparison operator](https://docs.mongodb.com/manual/reference/operator/query-comparison/)
|
|
54
47
|
*/
|
|
55
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
56
48
|
@Field(type => ComparisonOperatorEnum, {
|
|
57
49
|
description: '[Comparison operator](https://docs.mongodb.com/manual/reference/operator/query-comparison/)',
|
|
58
50
|
})
|
|
@@ -62,7 +54,6 @@ export class SingleFilterInput extends CoreInput {
|
|
|
62
54
|
* [Options](https://docs.mongodb.com/manual/reference/operator/query/regex/#op._S_options) for
|
|
63
55
|
* [REGEX](https://docs.mongodb.com/manual/reference/operator/query/regex/) operator
|
|
64
56
|
*/
|
|
65
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
66
57
|
@Field({
|
|
67
58
|
description:
|
|
68
59
|
'[Options](https://docs.mongodb.com/manual/reference/operator/query/regex/#op._S_options) for '
|
|
@@ -71,7 +62,6 @@ export class SingleFilterInput extends CoreInput {
|
|
|
71
62
|
})
|
|
72
63
|
options?: string = undefined;
|
|
73
64
|
|
|
74
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
75
65
|
@Field(type => JSON, { description: 'Value of the property' })
|
|
76
66
|
value: any = undefined;
|
|
77
67
|
}
|
|
@@ -1,27 +1,22 @@
|
|
|
1
1
|
import { Field, InputType } from '@nestjs/graphql';
|
|
2
2
|
|
|
3
|
-
import { Restricted } from '../decorators/restricted.decorator';
|
|
4
|
-
import { RoleEnum } from '../enums/role.enum';
|
|
5
3
|
import { SortOrderEnum } from '../enums/sort-order.emum';
|
|
6
4
|
import { CoreInput } from './core-input.input';
|
|
7
5
|
|
|
8
6
|
/**
|
|
9
7
|
* Sorting the returned elements
|
|
10
8
|
*/
|
|
11
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
12
9
|
@InputType({ description: 'Sorting the returned elements' })
|
|
13
10
|
export class SortInput extends CoreInput {
|
|
14
11
|
/**
|
|
15
12
|
* Field that is to be used for sorting
|
|
16
13
|
*/
|
|
17
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
18
14
|
@Field({ description: 'Field that is to be used for sorting' })
|
|
19
15
|
field: string = undefined;
|
|
20
16
|
|
|
21
17
|
/**
|
|
22
18
|
* SortInput order of the field
|
|
23
19
|
*/
|
|
24
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
25
20
|
@Field(type => SortOrderEnum, { description: 'SortInput order of the field' })
|
|
26
21
|
order: SortOrderEnum = undefined;
|
|
27
22
|
}
|
|
@@ -18,7 +18,6 @@ import { CoreModel } from './core-model.model';
|
|
|
18
18
|
* with undefined if possible. If necessary and useful, the init method can then be used deliberately:
|
|
19
19
|
* const corePersistenceModel = item ? CorePersistenceModel.map(item).init() : CorePersistenceModel.init();
|
|
20
20
|
*/
|
|
21
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
22
21
|
@ObjectType({
|
|
23
22
|
description: 'Persistence model which will be saved in DB',
|
|
24
23
|
isAbstract: true,
|
|
@@ -3,8 +3,6 @@ import { Args } from '@nestjs/graphql';
|
|
|
3
3
|
import { Response as ResponseType } from 'express';
|
|
4
4
|
|
|
5
5
|
import { CurrentUser } from '../../common/decorators/current-user.decorator';
|
|
6
|
-
import { Roles } from '../../common/decorators/roles.decorator';
|
|
7
|
-
import { RoleEnum } from '../../common/enums/role.enum';
|
|
8
6
|
import { ConfigService } from '../../common/services/config.service';
|
|
9
7
|
import { AuthGuardStrategy } from './auth-guard-strategy.enum';
|
|
10
8
|
import { CoreAuthModel } from './core-auth.model';
|
|
@@ -15,7 +13,6 @@ import { ICoreAuthUser } from './interfaces/core-auth-user.interface';
|
|
|
15
13
|
import { CoreAuthService } from './services/core-auth.service';
|
|
16
14
|
import { Tokens } from './tokens.decorator';
|
|
17
15
|
|
|
18
|
-
@Roles(RoleEnum.ADMIN)
|
|
19
16
|
@Controller('auth')
|
|
20
17
|
export class CoreAuthController {
|
|
21
18
|
/**
|
|
@@ -29,7 +26,6 @@ export class CoreAuthController {
|
|
|
29
26
|
/**
|
|
30
27
|
* Logout user (from specific device)
|
|
31
28
|
*/
|
|
32
|
-
@Roles(RoleEnum.S_EVERYONE)
|
|
33
29
|
@UseGuards(AuthGuard(AuthGuardStrategy.JWT))
|
|
34
30
|
@Get()
|
|
35
31
|
async logout(
|
|
@@ -45,7 +41,6 @@ export class CoreAuthController {
|
|
|
45
41
|
/**
|
|
46
42
|
* Refresh token (for specific device)
|
|
47
43
|
*/
|
|
48
|
-
@Roles(RoleEnum.S_EVERYONE)
|
|
49
44
|
@UseGuards(AuthGuard(AuthGuardStrategy.JWT_REFRESH))
|
|
50
45
|
@Get()
|
|
51
46
|
async refreshToken(
|
|
@@ -60,7 +55,6 @@ export class CoreAuthController {
|
|
|
60
55
|
/**
|
|
61
56
|
* Sign in user via email and password (on specific device)
|
|
62
57
|
*/
|
|
63
|
-
@Roles(RoleEnum.S_EVERYONE)
|
|
64
58
|
@Post()
|
|
65
59
|
async signIn(@Res() res: ResponseType, @Body('input') input: CoreAuthSignInInput): Promise<CoreAuthModel> {
|
|
66
60
|
const result = await this.authService.signIn(input);
|
|
@@ -70,7 +64,6 @@ export class CoreAuthController {
|
|
|
70
64
|
/**
|
|
71
65
|
* Register a new user account (on specific device)
|
|
72
66
|
*/
|
|
73
|
-
@Roles(RoleEnum.S_EVERYONE)
|
|
74
67
|
@Post()
|
|
75
68
|
async signUp(@Res() res: ResponseType, @Args('input') input: CoreAuthSignUpInput): Promise<CoreAuthModel> {
|
|
76
69
|
const result = await this.authService.signUp(input);
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { Field, ObjectType } from '@nestjs/graphql';
|
|
2
2
|
|
|
3
|
-
import { Restricted } from '../../common/decorators/restricted.decorator';
|
|
4
|
-
import { RoleEnum } from '../../common/enums/role.enum';
|
|
5
3
|
import { CoreModel } from '../../common/models/core-model.model';
|
|
6
4
|
import { CoreUserModel } from '../user/core-user.model';
|
|
7
5
|
|
|
8
6
|
/**
|
|
9
7
|
* CoreAuth model for the response after the sign in
|
|
10
8
|
*/
|
|
11
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
12
9
|
@ObjectType({ description: 'CoreAuth', isAbstract: true })
|
|
13
10
|
export class CoreAuthModel extends CoreModel {
|
|
14
11
|
// ===================================================================================================================
|
|
@@ -18,21 +15,18 @@ export class CoreAuthModel extends CoreModel {
|
|
|
18
15
|
/**
|
|
19
16
|
* JavaScript Web Token (JWT)
|
|
20
17
|
*/
|
|
21
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
22
18
|
@Field({ description: 'JavaScript Web Token (JWT)', nullable: true })
|
|
23
19
|
token?: string = undefined;
|
|
24
20
|
|
|
25
21
|
/**
|
|
26
22
|
* Refresh token
|
|
27
23
|
*/
|
|
28
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
29
24
|
@Field({ description: 'Refresh token', nullable: true })
|
|
30
25
|
refreshToken?: string = undefined;
|
|
31
26
|
|
|
32
27
|
/**
|
|
33
28
|
* Current user
|
|
34
29
|
*/
|
|
35
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
36
30
|
@Field({ description: 'Current user' })
|
|
37
31
|
user: CoreUserModel = undefined;
|
|
38
32
|
|
|
@@ -4,8 +4,6 @@ import { Response as ResponseType } from 'express';
|
|
|
4
4
|
|
|
5
5
|
import { CurrentUser } from '../../common/decorators/current-user.decorator';
|
|
6
6
|
import { GraphQLServiceOptions } from '../../common/decorators/graphql-service-options.decorator';
|
|
7
|
-
import { Roles } from '../../common/decorators/roles.decorator';
|
|
8
|
-
import { RoleEnum } from '../../common/enums/role.enum';
|
|
9
7
|
import { ServiceOptions } from '../../common/interfaces/service-options.interface';
|
|
10
8
|
import { ConfigService } from '../../common/services/config.service';
|
|
11
9
|
import { AuthGuardStrategy } from './auth-guard-strategy.enum';
|
|
@@ -20,7 +18,6 @@ import { Tokens } from './tokens.decorator';
|
|
|
20
18
|
/**
|
|
21
19
|
* Authentication resolver for the sign in
|
|
22
20
|
*/
|
|
23
|
-
@Roles(RoleEnum.ADMIN)
|
|
24
21
|
@Resolver(of => CoreAuthModel, { isAbstract: true })
|
|
25
22
|
export class CoreAuthResolver {
|
|
26
23
|
/**
|
|
@@ -38,7 +35,6 @@ export class CoreAuthResolver {
|
|
|
38
35
|
/**
|
|
39
36
|
* Logout user (from specific device)
|
|
40
37
|
*/
|
|
41
|
-
@Roles(RoleEnum.S_EVERYONE)
|
|
42
38
|
@UseGuards(AuthGuard(AuthGuardStrategy.JWT))
|
|
43
39
|
@Mutation(returns => Boolean, { description: 'Logout user (from specific device)' })
|
|
44
40
|
async logout(
|
|
@@ -54,7 +50,6 @@ export class CoreAuthResolver {
|
|
|
54
50
|
/**
|
|
55
51
|
* Refresh token (for specific device)
|
|
56
52
|
*/
|
|
57
|
-
@Roles(RoleEnum.S_EVERYONE)
|
|
58
53
|
@UseGuards(AuthGuard(AuthGuardStrategy.JWT_REFRESH))
|
|
59
54
|
@Mutation(returns => CoreAuthModel, { description: 'Refresh tokens (for specific device)' })
|
|
60
55
|
async refreshToken(
|
|
@@ -69,7 +64,6 @@ export class CoreAuthResolver {
|
|
|
69
64
|
/**
|
|
70
65
|
* Sign in user via email and password (on specific device)
|
|
71
66
|
*/
|
|
72
|
-
@Roles(RoleEnum.S_EVERYONE)
|
|
73
67
|
@Mutation(returns => CoreAuthModel, {
|
|
74
68
|
description: 'Sign in user via email and password and get JWT tokens (for specific device)',
|
|
75
69
|
})
|
|
@@ -85,7 +79,6 @@ export class CoreAuthResolver {
|
|
|
85
79
|
/**
|
|
86
80
|
* Register a new user account (on specific device)
|
|
87
81
|
*/
|
|
88
|
-
@Roles(RoleEnum.S_EVERYONE)
|
|
89
82
|
@Mutation(returns => CoreAuthModel, { description: 'Register a new user account (on specific device)' })
|
|
90
83
|
async signUp(
|
|
91
84
|
@GraphQLServiceOptions({ gqlPath: 'signUp.user' }) serviceOptions: ServiceOptions,
|
|
@@ -1,32 +1,25 @@
|
|
|
1
1
|
import { Field, InputType } from '@nestjs/graphql';
|
|
2
2
|
|
|
3
|
-
import { Restricted } from '../../../common/decorators/restricted.decorator';
|
|
4
|
-
import { RoleEnum } from '../../../common/enums/role.enum';
|
|
5
3
|
import { CoreInput } from '../../../common/inputs/core-input.input';
|
|
6
4
|
|
|
7
5
|
/**
|
|
8
6
|
* SignIn input
|
|
9
7
|
*/
|
|
10
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
11
8
|
@InputType({ description: 'Sign-in input' })
|
|
12
9
|
export class CoreAuthSignInInput extends CoreInput {
|
|
13
10
|
// ===================================================================================================================
|
|
14
11
|
// Properties
|
|
15
12
|
// ===================================================================================================================
|
|
16
13
|
|
|
17
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
18
14
|
@Field({ description: 'Device ID (is created automatically if it is not set)', nullable: true })
|
|
19
15
|
deviceId?: string = undefined;
|
|
20
16
|
|
|
21
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
22
17
|
@Field({ description: 'Device description', nullable: true })
|
|
23
18
|
deviceDescription?: string = undefined;
|
|
24
19
|
|
|
25
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
26
20
|
@Field({ description: 'Email', nullable: false })
|
|
27
21
|
email: string = undefined;
|
|
28
22
|
|
|
29
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
30
23
|
@Field({ description: 'Password', nullable: false })
|
|
31
24
|
password: string = undefined;
|
|
32
25
|
}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { InputType } from '@nestjs/graphql';
|
|
2
2
|
|
|
3
|
-
import { Restricted } from '../../../common/decorators/restricted.decorator';
|
|
4
|
-
import { RoleEnum } from '../../../common/enums/role.enum';
|
|
5
3
|
import { CoreAuthSignInInput } from './core-auth-sign-in.input';
|
|
6
4
|
|
|
7
5
|
/**
|
|
8
6
|
* SignUp input
|
|
9
7
|
*/
|
|
10
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
11
8
|
@InputType({ description: 'Sign-up input' })
|
|
12
9
|
export class CoreAuthSignUpInput extends CoreAuthSignInInput {}
|
|
@@ -2,21 +2,17 @@ import { Field, ObjectType } from '@nestjs/graphql';
|
|
|
2
2
|
import { Prop } from '@nestjs/mongoose';
|
|
3
3
|
import { Types } from 'mongoose';
|
|
4
4
|
|
|
5
|
-
import { Restricted } from '../../common/decorators/restricted.decorator';
|
|
6
|
-
import { RoleEnum } from '../../common/enums/role.enum';
|
|
7
5
|
import { CoreModel } from '../../common/models/core-model.model';
|
|
8
6
|
|
|
9
7
|
/**
|
|
10
8
|
* File info
|
|
11
9
|
*/
|
|
12
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
13
10
|
@ObjectType({ description: 'Information about file' })
|
|
14
11
|
export class CoreFileInfo extends CoreModel {
|
|
15
12
|
// ===========================================================================
|
|
16
13
|
// Getter
|
|
17
14
|
// ===========================================================================
|
|
18
15
|
|
|
19
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
20
16
|
get _id() {
|
|
21
17
|
return new Types.ObjectId(this.id);
|
|
22
18
|
}
|
|
@@ -25,11 +21,9 @@ export class CoreFileInfo extends CoreModel {
|
|
|
25
21
|
// Properties
|
|
26
22
|
// ===========================================================================
|
|
27
23
|
|
|
28
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
29
24
|
@Field(() => String, { description: 'ID of the file' })
|
|
30
25
|
id: string = undefined;
|
|
31
26
|
|
|
32
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
33
27
|
@Field(() => Number, {
|
|
34
28
|
description:
|
|
35
29
|
'The size of each chunk in bytes. GridFS divides the document into chunks of size chunkSize, '
|
|
@@ -39,22 +33,18 @@ export class CoreFileInfo extends CoreModel {
|
|
|
39
33
|
@Prop({ required: false, type: Number })
|
|
40
34
|
chunkSize: number = undefined;
|
|
41
35
|
|
|
42
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
43
36
|
@Field(() => String, { description: 'Content type', nullable: true })
|
|
44
37
|
@Prop({ required: false, type: String })
|
|
45
38
|
contentType?: string = undefined;
|
|
46
39
|
|
|
47
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
48
40
|
@Field(() => String, { description: 'Name of the file', nullable: true })
|
|
49
41
|
@Prop({ required: false, type: String })
|
|
50
42
|
filename?: string = undefined;
|
|
51
43
|
|
|
52
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
53
44
|
@Field(() => Number, { description: 'The size of the document in bytes', nullable: true })
|
|
54
45
|
@Prop({ required: false, type: Number })
|
|
55
46
|
length: number = undefined;
|
|
56
47
|
|
|
57
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
58
48
|
@Field(() => Date, { description: 'The date the file was first stored', nullable: true })
|
|
59
49
|
@Prop({ required: false, type: Date })
|
|
60
50
|
uploadDate: Date = undefined;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { BadRequestException, Controller, Get, NotFoundException, Param, Res } from '@nestjs/common';
|
|
2
2
|
|
|
3
|
-
import { Roles } from '../../common/decorators/roles.decorator';
|
|
4
|
-
import { RoleEnum } from '../../common/enums/role.enum';
|
|
5
3
|
import { CoreFileService } from './core-file.service';
|
|
6
4
|
|
|
7
5
|
/**
|
|
8
6
|
* File controller
|
|
9
7
|
*/
|
|
10
|
-
@Roles(RoleEnum.ADMIN)
|
|
11
8
|
@Controller('files')
|
|
12
9
|
export abstract class CoreFileController {
|
|
13
10
|
/**
|
|
@@ -18,7 +15,6 @@ export abstract class CoreFileController {
|
|
|
18
15
|
/**
|
|
19
16
|
* Download file
|
|
20
17
|
*/
|
|
21
|
-
@Roles(RoleEnum.S_EVERYONE)
|
|
22
18
|
@Get(':filename')
|
|
23
19
|
async getFile(@Param('filename') filename: string, @Res() res) {
|
|
24
20
|
if (!filename) {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Args, Mutation, Query, Resolver } from '@nestjs/graphql';
|
|
2
2
|
import * as GraphQLUpload from 'graphql-upload/GraphQLUpload.js';
|
|
3
3
|
|
|
4
|
-
import { Roles } from '../../common/decorators/roles.decorator';
|
|
5
|
-
import { RoleEnum } from '../../common/enums/role.enum';
|
|
6
4
|
import { CoreFileService } from './core-file.service';
|
|
7
5
|
import { CoreFileInfo } from './core-file-info.model';
|
|
8
6
|
import { FileUpload } from './interfaces/file-upload.interface';
|
|
@@ -10,7 +8,6 @@ import { FileUpload } from './interfaces/file-upload.interface';
|
|
|
10
8
|
/**
|
|
11
9
|
* File resolver
|
|
12
10
|
*/
|
|
13
|
-
@Roles(RoleEnum.ADMIN)
|
|
14
11
|
@Resolver()
|
|
15
12
|
export class CoreFileResolver {
|
|
16
13
|
/**
|
|
@@ -25,7 +22,6 @@ export class CoreFileResolver {
|
|
|
25
22
|
/**
|
|
26
23
|
* Get file info
|
|
27
24
|
*/
|
|
28
|
-
@Roles(RoleEnum.S_EVERYONE)
|
|
29
25
|
@Query(() => CoreFileInfo, { nullable: true })
|
|
30
26
|
async getFileInfo(@Args({ name: 'filename', type: () => String }) filename: string): Promise<any> {
|
|
31
27
|
return await this.fileService.getFileInfoByName(filename);
|
|
@@ -38,7 +34,6 @@ export class CoreFileResolver {
|
|
|
38
34
|
/**
|
|
39
35
|
* Delete file
|
|
40
36
|
*/
|
|
41
|
-
@Roles(RoleEnum.S_EVERYONE)
|
|
42
37
|
@Mutation(() => CoreFileInfo)
|
|
43
38
|
async deleteFile(@Args({ name: 'filename', type: () => String }) filename: string): Promise<any> {
|
|
44
39
|
return await this.fileService.deleteFileByName(filename);
|
|
@@ -47,7 +42,6 @@ export class CoreFileResolver {
|
|
|
47
42
|
/**
|
|
48
43
|
* Upload file
|
|
49
44
|
*/
|
|
50
|
-
@Roles(RoleEnum.S_EVERYONE)
|
|
51
45
|
@Mutation(() => CoreFileInfo)
|
|
52
46
|
async uploadFile(@Args({ name: 'file', type: () => GraphQLUpload }) file: FileUpload): Promise<any> {
|
|
53
47
|
return await this.fileService.createFile(file);
|
|
@@ -56,7 +50,6 @@ export class CoreFileResolver {
|
|
|
56
50
|
/**
|
|
57
51
|
* Upload files
|
|
58
52
|
*/
|
|
59
|
-
@Roles(RoleEnum.S_EVERYONE)
|
|
60
53
|
@Mutation(() => [CoreFileInfo])
|
|
61
54
|
async uploadFiles(@Args({ name: 'files', type: () => [GraphQLUpload] }) files: FileUpload[]): Promise<any> {
|
|
62
55
|
return await this.fileService.createFiles(files);
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { Field, ObjectType } from '@nestjs/graphql';
|
|
2
2
|
|
|
3
|
-
import { Restricted } from '../../common/decorators/restricted.decorator';
|
|
4
|
-
import { RoleEnum } from '../../common/enums/role.enum';
|
|
5
3
|
import { CoreModel } from '../../common/models/core-model.model';
|
|
6
4
|
import { JSON } from '../../common/scalars/json.scalar';
|
|
7
5
|
|
|
8
6
|
/**
|
|
9
7
|
* User model
|
|
10
8
|
*/
|
|
11
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
12
9
|
@ObjectType({ description: 'Health check result' })
|
|
13
10
|
export abstract class CoreHealthCheckResult extends CoreModel {
|
|
14
11
|
// ===================================================================================================================
|
|
@@ -18,14 +15,12 @@ export abstract class CoreHealthCheckResult extends CoreModel {
|
|
|
18
15
|
/**
|
|
19
16
|
* The overall status of the Health Check
|
|
20
17
|
*/
|
|
21
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
22
18
|
@Field({ description: 'The overall status of the Health Check', nullable: false })
|
|
23
19
|
status: 'error' | 'ok' | 'shutting_down' = undefined;
|
|
24
20
|
|
|
25
21
|
/**
|
|
26
22
|
* The info object contains information of each health indicator which is of status “up”
|
|
27
23
|
*/
|
|
28
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
29
24
|
@Field(type => JSON, {
|
|
30
25
|
description: 'The info object contains information of each health indicator which is of status “up”',
|
|
31
26
|
nullable: true,
|
|
@@ -35,7 +30,6 @@ export abstract class CoreHealthCheckResult extends CoreModel {
|
|
|
35
30
|
/**
|
|
36
31
|
* The error object contains information of each health indicator which is of status “down”
|
|
37
32
|
*/
|
|
38
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
39
33
|
@Field(type => JSON, {
|
|
40
34
|
description: 'The error object contains information of each health indicator which is of status “down”',
|
|
41
35
|
nullable: true,
|
|
@@ -45,7 +39,6 @@ export abstract class CoreHealthCheckResult extends CoreModel {
|
|
|
45
39
|
/**
|
|
46
40
|
* The details object contains information of every health indicator
|
|
47
41
|
*/
|
|
48
|
-
@Restricted(RoleEnum.S_EVERYONE)
|
|
49
42
|
@Field(type => JSON, {
|
|
50
43
|
description: 'The details object contains information of every health indicator',
|
|
51
44
|
nullable: false,
|