@solidstarters/solid-core 1.2.45 → 1.2.47
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/controllers/authentication.controller.d.ts +1 -0
- package/dist/controllers/authentication.controller.d.ts.map +1 -1
- package/dist/controllers/user-view-metadata.controller.d.ts +43 -0
- package/dist/controllers/user-view-metadata.controller.d.ts.map +1 -0
- package/dist/controllers/user-view-metadata.controller.js +192 -0
- package/dist/controllers/user-view-metadata.controller.js.map +1 -0
- package/dist/dtos/create-user-view-metadata.dto.d.ts +8 -0
- package/dist/dtos/create-user-view-metadata.dto.d.ts.map +1 -0
- package/dist/dtos/create-user-view-metadata.dto.js +57 -0
- package/dist/dtos/create-user-view-metadata.dto.js.map +1 -0
- package/dist/dtos/create-user.dto.d.ts +8 -0
- package/dist/dtos/create-user.dto.d.ts.map +1 -1
- package/dist/dtos/create-user.dto.js +78 -5
- package/dist/dtos/create-user.dto.js.map +1 -1
- package/dist/dtos/create-view-metadata.dto.d.ts +4 -0
- package/dist/dtos/create-view-metadata.dto.d.ts.map +1 -1
- package/dist/dtos/create-view-metadata.dto.js +40 -3
- package/dist/dtos/create-view-metadata.dto.js.map +1 -1
- package/dist/dtos/selection-dynamic-query.dto.d.ts +1 -1
- package/dist/dtos/selection-dynamic-query.dto.d.ts.map +1 -1
- package/dist/dtos/selection-dynamic-query.dto.js +2 -3
- package/dist/dtos/selection-dynamic-query.dto.js.map +1 -1
- package/dist/dtos/update-user-view-metadata.dto.d.ts +9 -0
- package/dist/dtos/update-user-view-metadata.dto.d.ts.map +1 -0
- package/dist/dtos/update-user-view-metadata.dto.js +57 -0
- package/dist/dtos/update-user-view-metadata.dto.js.map +1 -0
- package/dist/dtos/update-user.dto.d.ts +8 -0
- package/dist/dtos/update-user.dto.d.ts.map +1 -1
- package/dist/dtos/update-user.dto.js +78 -7
- package/dist/dtos/update-user.dto.js.map +1 -1
- package/dist/dtos/update-view-metadata.dto.d.ts +4 -0
- package/dist/dtos/update-view-metadata.dto.d.ts.map +1 -1
- package/dist/dtos/update-view-metadata.dto.js +40 -10
- package/dist/dtos/update-view-metadata.dto.js.map +1 -1
- package/dist/dtos/upsert-user-view-metadata.dto.d.ts +6 -0
- package/dist/dtos/upsert-user-view-metadata.dto.d.ts.map +1 -0
- package/dist/dtos/upsert-user-view-metadata.dto.js +40 -0
- package/dist/dtos/upsert-user-view-metadata.dto.js.map +1 -0
- package/dist/entities/user-view-metadata.entity.d.ts +9 -0
- package/dist/entities/user-view-metadata.entity.d.ts.map +1 -0
- package/dist/entities/user-view-metadata.entity.js +47 -0
- package/dist/entities/user-view-metadata.entity.js.map +1 -0
- package/dist/entities/user.entity.d.ts +2 -0
- package/dist/entities/user.entity.d.ts.map +1 -1
- package/dist/entities/user.entity.js +11 -9
- package/dist/entities/user.entity.js.map +1 -1
- package/dist/entities/view-metadata.entity.d.ts +2 -0
- package/dist/entities/view-metadata.entity.d.ts.map +1 -1
- package/dist/entities/view-metadata.entity.js +15 -5
- package/dist/entities/view-metadata.entity.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +1 -1
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/seeders/seed-data/solid-core-metadata.json +412 -134
- package/dist/services/authentication.service.d.ts +1 -0
- package/dist/services/authentication.service.d.ts.map +1 -1
- package/dist/services/user-view-metadata.service.d.ts +24 -0
- package/dist/services/user-view-metadata.service.d.ts.map +1 -0
- package/dist/services/user-view-metadata.service.js +73 -0
- package/dist/services/user-view-metadata.service.js.map +1 -0
- package/dist/services/view-metadata.service.d.ts +3 -1
- package/dist/services/view-metadata.service.d.ts.map +1 -1
- package/dist/services/view-metadata.service.js +24 -7
- package/dist/services/view-metadata.service.js.map +1 -1
- package/dist/solid-core.module.d.ts.map +1 -1
- package/dist/solid-core.module.js +7 -1
- package/dist/solid-core.module.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -6
- package/src/controllers/user-view-metadata.controller.ts +99 -0
- package/src/dtos/create-user-view-metadata.dto.ts +27 -0
- package/src/dtos/create-user.dto.ts +67 -33
- package/src/dtos/create-view-metadata.dto.ts +33 -12
- package/src/dtos/selection-dynamic-query.dto.ts +1 -1
- package/src/dtos/update-user-view-metadata.dto.ts +28 -0
- package/src/dtos/update-user.dto.ts +67 -36
- package/src/dtos/update-view-metadata.dto.ts +35 -19
- package/src/dtos/upsert-user-view-metadata.dto.ts +17 -0
- package/src/entities/user-view-metadata.entity.ts +18 -0
- package/src/entities/user.entity.ts +12 -40
- package/src/entities/view-metadata.entity.ts +12 -13
- package/src/index.ts +1 -0
- package/src/interfaces.ts +1 -1
- package/src/seeders/seed-data/solid-core-metadata.json +412 -144
- package/src/services/user-view-metadata.service.ts +54 -0
- package/src/services/view-metadata.service.ts +23 -2
- package/src/solid-core.module.ts +7 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidstarters/solid-core",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.47",
|
|
4
4
|
"description": "This module is a NestJS module containing all the required core providers required by a Solid application",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -50,13 +50,13 @@
|
|
|
50
50
|
"luxon": "^3.4.4",
|
|
51
51
|
"mailgen": "^2.0.28",
|
|
52
52
|
"mongoose": "^8.7.0",
|
|
53
|
+
"mysql2": "^3.13.0",
|
|
53
54
|
"nodemailer": "^6.9.13",
|
|
54
55
|
"passport": "^0.7.0",
|
|
55
56
|
"passport-google-oauth2": "^0.2.0",
|
|
56
57
|
"passport-jwt": "^4.0.1",
|
|
57
58
|
"passport-local": "^1.0.0",
|
|
58
59
|
"pg": "^8.11.3",
|
|
59
|
-
"mysql2": "^3.13.0",
|
|
60
60
|
"pluralize": "^8.0.0",
|
|
61
61
|
"puppeteer": "^23.2.0",
|
|
62
62
|
"reflect-metadata": "^0.1.13",
|
|
@@ -87,6 +87,8 @@
|
|
|
87
87
|
"winston": "^3.17.0"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
|
+
"@angular-devkit/schematics": "^19.2.6",
|
|
91
|
+
"@angular-devkit/schematics-cli": "^19.2.6",
|
|
90
92
|
"@nestjs/axios": "^3.0.2",
|
|
91
93
|
"@nestjs/cache-manager": "^2.2.2",
|
|
92
94
|
"@nestjs/cli": "^10.0.0",
|
|
@@ -103,8 +105,7 @@
|
|
|
103
105
|
"@nestjs/swagger": "^7.2.0",
|
|
104
106
|
"@nestjs/testing": "^10.0.0",
|
|
105
107
|
"@nestjs/typeorm": "^10.0.1",
|
|
106
|
-
"
|
|
107
|
-
"nest-winston": "^1.9.7",
|
|
108
|
+
"@solidstarters/solid-code-builder": "^1.0.2",
|
|
108
109
|
"@types/express": "^4.17.17",
|
|
109
110
|
"@types/hapi__joi": "^17.1.12",
|
|
110
111
|
"@types/jest": "^29.5.2",
|
|
@@ -126,6 +127,8 @@
|
|
|
126
127
|
"eslint-plugin-prettier": "^5.0.0",
|
|
127
128
|
"jest": "^29.5.0",
|
|
128
129
|
"nest-cli": "^0.0.5",
|
|
130
|
+
"nest-commander": "^3.12.5",
|
|
131
|
+
"nest-winston": "^1.9.7",
|
|
129
132
|
"prettier": "^3.0.0",
|
|
130
133
|
"source-map-support": "^0.5.21",
|
|
131
134
|
"supertest": "^6.3.3",
|
|
@@ -136,8 +139,7 @@
|
|
|
136
139
|
"typeorm": "^0.3.20",
|
|
137
140
|
"typeorm-naming-strategies": "^4.1.0",
|
|
138
141
|
"typescript": "^5.1.3",
|
|
139
|
-
"winston": "^3.17.0"
|
|
140
|
-
"@solidstarters/solid-code-builder": "^1.0.2"
|
|
142
|
+
"winston": "^3.17.0"
|
|
141
143
|
},
|
|
142
144
|
"jest": {
|
|
143
145
|
"moduleFileExtensions": [
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { Controller, Post, Body, Param, UploadedFiles, UseInterceptors, Put, Get, Query, Delete, Patch } from '@nestjs/common';
|
|
2
|
+
import { AnyFilesInterceptor } from "@nestjs/platform-express";
|
|
3
|
+
import { ApiBearerAuth, ApiQuery, ApiTags } from '@nestjs/swagger';
|
|
4
|
+
import { UserViewMetadataService } from '../services/user-view-metadata.service';
|
|
5
|
+
import { CreateUserViewMetadataDto } from '../dtos/create-user-view-metadata.dto';
|
|
6
|
+
import { UpdateUserViewMetadataDto } from '../dtos/update-user-view-metadata.dto';
|
|
7
|
+
import { UpsertUserViewMetadataDto } from 'src/dtos/upsert-user-view-metadata.dto';
|
|
8
|
+
|
|
9
|
+
enum ShowSoftDeleted {
|
|
10
|
+
INCLUSIVE = "inclusive",
|
|
11
|
+
EXCLUSIVE = "exclusive",
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@ApiTags('Solid Core')
|
|
15
|
+
@Controller('user-view-metadata')
|
|
16
|
+
export class UserViewMetadataController {
|
|
17
|
+
constructor(private readonly service: UserViewMetadataService) { }
|
|
18
|
+
|
|
19
|
+
@ApiBearerAuth("jwt")
|
|
20
|
+
@Post()
|
|
21
|
+
@UseInterceptors(AnyFilesInterceptor())
|
|
22
|
+
create(@Body() createDto: CreateUserViewMetadataDto, @UploadedFiles() files: Array<Express.Multer.File>) {
|
|
23
|
+
return this.service.create(createDto, files);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@ApiBearerAuth("jwt")
|
|
27
|
+
@Post('/bulk')
|
|
28
|
+
@UseInterceptors(AnyFilesInterceptor())
|
|
29
|
+
insertMany(@Body() createDtos: CreateUserViewMetadataDto[], @UploadedFiles() filesArray: Express.Multer.File[][] = []) {
|
|
30
|
+
return this.service.insertMany(createDtos, filesArray);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@ApiBearerAuth("jwt")
|
|
35
|
+
@Put(':id')
|
|
36
|
+
@UseInterceptors(AnyFilesInterceptor())
|
|
37
|
+
update(@Param('id') id: number, @Body() updateDto: UpdateUserViewMetadataDto, @UploadedFiles() files: Array<Express.Multer.File>) {
|
|
38
|
+
return this.service.update(id, updateDto, files);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@ApiBearerAuth("jwt")
|
|
42
|
+
@Patch(':id')
|
|
43
|
+
@UseInterceptors(AnyFilesInterceptor())
|
|
44
|
+
partialUpdate(@Param('id') id: number, @Body() updateDto: UpdateUserViewMetadataDto, @UploadedFiles() files: Array<Express.Multer.File>) {
|
|
45
|
+
return this.service.update(id, updateDto, files, true);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@ApiBearerAuth("jwt")
|
|
49
|
+
@Post('/bulk-recover')
|
|
50
|
+
async recoverMany(@Body() ids: number[]) {
|
|
51
|
+
return this.service.recoverMany(ids);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@ApiBearerAuth("jwt")
|
|
55
|
+
@Get('/recover/:id')
|
|
56
|
+
async recover(@Param('id') id: number) {
|
|
57
|
+
return this.service.recover(id);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@ApiBearerAuth("jwt")
|
|
61
|
+
@ApiQuery({ name: 'showSoftDeleted', required: false, enum: ShowSoftDeleted })
|
|
62
|
+
@ApiQuery({ name: 'limit', required: false, type: Number })
|
|
63
|
+
@ApiQuery({ name: 'offset', required: false, type: Number })
|
|
64
|
+
@ApiQuery({ name: 'fields', required: false, type: Array })
|
|
65
|
+
@ApiQuery({ name: 'sort', required: false, type: Array })
|
|
66
|
+
@ApiQuery({ name: 'groupBy', required: false, type: Array })
|
|
67
|
+
@ApiQuery({ name: 'populate', required: false, type: Array })
|
|
68
|
+
@ApiQuery({ name: 'populateMedia', required: false, type: Array })
|
|
69
|
+
@ApiQuery({ name: 'filters', required: false, type: Array })
|
|
70
|
+
@Get()
|
|
71
|
+
async findMany(@Query() query: any) {
|
|
72
|
+
return this.service.find(query);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@ApiBearerAuth("jwt")
|
|
76
|
+
@Get(':id')
|
|
77
|
+
async findOne(@Param('id') id: string, @Query() query: any) {
|
|
78
|
+
return this.service.findOne(+id, query);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@ApiBearerAuth("jwt")
|
|
82
|
+
@Delete('/bulk')
|
|
83
|
+
async deleteMany(@Body() ids: number[]) {
|
|
84
|
+
return this.service.deleteMany(ids);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@ApiBearerAuth("jwt")
|
|
88
|
+
@Delete(':id')
|
|
89
|
+
async delete(@Param('id') id: number) {
|
|
90
|
+
return this.service.delete(id);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@ApiBearerAuth("jwt")
|
|
94
|
+
@Post('/upsert')
|
|
95
|
+
async upsert(@Body() query: UpsertUserViewMetadataDto) {
|
|
96
|
+
return this.service.upsert(query);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
+
import { IsInt } from 'class-validator';
|
|
3
|
+
import { IsOptional } from 'class-validator';
|
|
4
|
+
import { IsString, IsJSON } from 'class-validator';
|
|
5
|
+
|
|
6
|
+
export class CreateUserViewMetadataDto {
|
|
7
|
+
@IsOptional()
|
|
8
|
+
@IsInt()
|
|
9
|
+
@ApiProperty()
|
|
10
|
+
userId: number;
|
|
11
|
+
@IsString()
|
|
12
|
+
@IsOptional()
|
|
13
|
+
@ApiProperty()
|
|
14
|
+
userUserKey: string;
|
|
15
|
+
@IsOptional()
|
|
16
|
+
@IsJSON()
|
|
17
|
+
@ApiProperty()
|
|
18
|
+
layout: any = "{}";
|
|
19
|
+
@IsOptional()
|
|
20
|
+
@IsInt()
|
|
21
|
+
@ApiProperty()
|
|
22
|
+
viewMetadataId: number;
|
|
23
|
+
@IsString()
|
|
24
|
+
@IsOptional()
|
|
25
|
+
@ApiProperty()
|
|
26
|
+
viewMetadataUserKey: string;
|
|
27
|
+
}
|
|
@@ -1,121 +1,155 @@
|
|
|
1
1
|
import { IsString } from 'class-validator';
|
|
2
|
-
import { IsOptional, IsNotEmpty, Matches, IsBoolean, IsDate } from 'class-validator';
|
|
2
|
+
import { IsOptional, IsNotEmpty, Matches, IsBoolean, IsDate, ValidateNested, IsArray } from 'class-validator';
|
|
3
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
4
|
+
import { Type } from 'class-transformer';
|
|
5
|
+
import { UpdateRoleMetadataDto } from 'src/dtos/update-role-metadata.dto';
|
|
6
|
+
import { UpdateUserViewMetadataDto } from 'src/dtos/update-user-view-metadata.dto';
|
|
7
|
+
|
|
3
8
|
export class CreateUserDto {
|
|
4
9
|
@IsOptional()
|
|
5
10
|
@IsString()
|
|
11
|
+
@ApiProperty()
|
|
6
12
|
fullName: string;
|
|
7
|
-
|
|
8
13
|
@IsNotEmpty()
|
|
9
14
|
@IsString()
|
|
15
|
+
@ApiProperty()
|
|
10
16
|
username: string;
|
|
11
|
-
|
|
12
17
|
@IsOptional()
|
|
13
18
|
@IsString()
|
|
19
|
+
@ApiProperty()
|
|
14
20
|
email: string;
|
|
15
|
-
|
|
16
21
|
@IsOptional()
|
|
17
22
|
@IsString()
|
|
23
|
+
@ApiProperty()
|
|
18
24
|
mobile: string;
|
|
19
|
-
|
|
20
|
-
@IsNotEmpty()
|
|
25
|
+
@IsOptional()
|
|
21
26
|
@Matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^\da-zA-Z]).*$/)
|
|
22
27
|
@IsString()
|
|
28
|
+
@ApiProperty()
|
|
23
29
|
password: string;
|
|
24
|
-
|
|
25
|
-
@IsString()
|
|
30
|
+
@IsOptional()
|
|
26
31
|
@Matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^\da-zA-Z]).*$/)
|
|
27
|
-
@
|
|
32
|
+
@IsString()
|
|
33
|
+
@ApiProperty()
|
|
28
34
|
passwordConfirm: string;
|
|
29
|
-
|
|
30
35
|
@IsOptional()
|
|
31
36
|
@IsBoolean()
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
@ApiProperty()
|
|
38
|
+
forcePasswordChange: boolean = true;
|
|
34
39
|
@IsNotEmpty()
|
|
35
40
|
@IsString()
|
|
41
|
+
@ApiProperty()
|
|
36
42
|
lastLoginProvider: string = "local";
|
|
37
|
-
|
|
38
43
|
@IsOptional()
|
|
39
44
|
@IsString()
|
|
45
|
+
@ApiProperty()
|
|
40
46
|
accessCode: string;
|
|
41
|
-
|
|
42
47
|
@IsOptional()
|
|
43
48
|
@IsString()
|
|
49
|
+
@ApiProperty()
|
|
44
50
|
googleAccessToken: string;
|
|
45
|
-
|
|
46
51
|
@IsOptional()
|
|
47
52
|
@IsString()
|
|
53
|
+
@ApiProperty()
|
|
48
54
|
googleId: string;
|
|
49
|
-
|
|
50
55
|
@IsOptional()
|
|
51
56
|
@IsString()
|
|
57
|
+
@ApiProperty()
|
|
52
58
|
googleProfilePicture: string;
|
|
53
|
-
|
|
54
59
|
@IsNotEmpty()
|
|
55
60
|
@IsBoolean()
|
|
61
|
+
@ApiProperty()
|
|
56
62
|
active: boolean = true;
|
|
57
|
-
|
|
58
63
|
@IsOptional()
|
|
59
64
|
@IsDate()
|
|
65
|
+
@ApiProperty()
|
|
60
66
|
forgotPasswordConfirmedAt: Date = new Date("1970-01-01T00:00:00.000Z");
|
|
61
|
-
|
|
62
67
|
@IsOptional()
|
|
63
68
|
@IsString()
|
|
69
|
+
@ApiProperty()
|
|
64
70
|
verificationTokenOnForgotPassword: string;
|
|
65
|
-
|
|
66
71
|
@IsOptional()
|
|
67
72
|
@IsDate()
|
|
73
|
+
@ApiProperty()
|
|
68
74
|
verificationTokenOnForgotPasswordExpiresAt: Date = new Date("1970-01-01T00:00:00.000Z");
|
|
69
|
-
|
|
70
75
|
@IsOptional()
|
|
71
76
|
@IsDate()
|
|
77
|
+
@ApiProperty()
|
|
72
78
|
emailVerifiedOnRegistrationAt: Date = new Date("1970-01-01T00:00:00.000Z");
|
|
73
|
-
|
|
74
79
|
@IsOptional()
|
|
75
80
|
@IsString()
|
|
81
|
+
@ApiProperty()
|
|
76
82
|
emailVerificationTokenOnRegistration: string;
|
|
77
|
-
|
|
78
83
|
@IsOptional()
|
|
79
84
|
@IsDate()
|
|
85
|
+
@ApiProperty()
|
|
80
86
|
emailVerificationTokenOnRegistrationExpiresAt: Date = new Date("1970-01-01T00:00:00.000Z");
|
|
81
|
-
|
|
82
87
|
@IsOptional()
|
|
83
88
|
@IsDate()
|
|
89
|
+
@ApiProperty()
|
|
84
90
|
mobileVerifiedOnRegistrationAt: Date = new Date("1970-01-01T00:00:00.000Z");
|
|
85
|
-
|
|
86
91
|
@IsOptional()
|
|
87
92
|
@IsString()
|
|
93
|
+
@ApiProperty()
|
|
88
94
|
mobileVerificationTokenOnRegistration: string;
|
|
89
|
-
|
|
90
95
|
@IsOptional()
|
|
91
96
|
@IsDate()
|
|
97
|
+
@ApiProperty()
|
|
92
98
|
mobileVerificationTokenOnRegistrationExpiresAt: Date = new Date("1970-01-01T00:00:00.000Z");
|
|
93
|
-
|
|
94
99
|
@IsOptional()
|
|
95
100
|
@IsDate()
|
|
101
|
+
@ApiProperty()
|
|
96
102
|
emailVerifiedOnLoginAt: Date = new Date("1970-01-01T00:00:00.000Z");
|
|
97
|
-
|
|
98
103
|
@IsOptional()
|
|
99
104
|
@IsString()
|
|
105
|
+
@ApiProperty()
|
|
100
106
|
emailVerificationTokenOnLogin: string;
|
|
101
|
-
|
|
102
107
|
@IsOptional()
|
|
103
108
|
@IsDate()
|
|
109
|
+
@ApiProperty()
|
|
104
110
|
emailVerificationTokenOnLoginExpiresAt: Date = new Date("1970-01-01T00:00:00.000Z");
|
|
105
|
-
|
|
106
111
|
@IsOptional()
|
|
107
112
|
@IsDate()
|
|
113
|
+
@ApiProperty()
|
|
108
114
|
mobileVerifiedOnLoginAt: Date = new Date("1970-01-01T00:00:00.000Z");
|
|
109
|
-
|
|
110
115
|
@IsOptional()
|
|
111
116
|
@IsString()
|
|
117
|
+
@ApiProperty()
|
|
112
118
|
mobileVerificationTokenOnLogin: string;
|
|
113
|
-
|
|
114
119
|
@IsOptional()
|
|
115
120
|
@IsDate()
|
|
121
|
+
@ApiProperty()
|
|
116
122
|
mobileVerificationTokenOnLoginExpiresAt: Date = new Date("1970-01-01T00:00:00.000Z");
|
|
117
|
-
|
|
118
123
|
@IsOptional()
|
|
119
124
|
@IsString()
|
|
125
|
+
@ApiProperty()
|
|
120
126
|
customPayload: string;
|
|
127
|
+
@IsOptional()
|
|
128
|
+
@ApiProperty()
|
|
129
|
+
@IsArray()
|
|
130
|
+
@ValidateNested({ each: true })
|
|
131
|
+
@Type(() => UpdateRoleMetadataDto)
|
|
132
|
+
roles: UpdateRoleMetadataDto[];
|
|
133
|
+
@IsOptional()
|
|
134
|
+
@IsArray()
|
|
135
|
+
@ApiProperty()
|
|
136
|
+
rolesIds: number[];
|
|
137
|
+
@IsString()
|
|
138
|
+
@IsOptional()
|
|
139
|
+
@ApiProperty()
|
|
140
|
+
rolesCommand: string;
|
|
141
|
+
@IsOptional()
|
|
142
|
+
@ApiProperty()
|
|
143
|
+
@IsArray()
|
|
144
|
+
@ValidateNested({ each: true })
|
|
145
|
+
@Type(() => UpdateUserViewMetadataDto)
|
|
146
|
+
userViewMetadata: UpdateUserViewMetadataDto[];
|
|
147
|
+
@IsOptional()
|
|
148
|
+
@IsArray()
|
|
149
|
+
@ApiProperty()
|
|
150
|
+
userViewMetadataIds: number[];
|
|
151
|
+
@IsString()
|
|
152
|
+
@IsOptional()
|
|
153
|
+
@ApiProperty()
|
|
154
|
+
userViewMetadataCommand: string;
|
|
121
155
|
}
|
|
@@ -1,39 +1,60 @@
|
|
|
1
1
|
import { IsOptional, IsString } from 'class-validator';
|
|
2
2
|
import { Matches } from 'class-validator';
|
|
3
|
-
import { IsNotEmpty, IsJSON } from 'class-validator';
|
|
3
|
+
import { IsNotEmpty, IsJSON, IsInt, ValidateNested, IsArray } from 'class-validator';
|
|
4
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
5
|
+
import { Type } from 'class-transformer';
|
|
6
|
+
import { UpdateUserViewMetadataDto } from 'src/dtos/update-user-view-metadata.dto';
|
|
7
|
+
|
|
4
8
|
export class CreateViewMetadataDto {
|
|
5
9
|
@IsNotEmpty()
|
|
6
10
|
@Matches(/[a-z]+(-[a-z]+)*/, { message: "Only kebab case allowed for module name, also only lower case." })
|
|
7
11
|
@IsString()
|
|
12
|
+
@ApiProperty()
|
|
8
13
|
name: string;
|
|
9
|
-
|
|
10
14
|
@IsNotEmpty()
|
|
11
15
|
@IsString()
|
|
16
|
+
@ApiProperty()
|
|
12
17
|
displayName: string;
|
|
13
|
-
|
|
14
18
|
@IsNotEmpty()
|
|
15
19
|
@IsString()
|
|
20
|
+
@ApiProperty()
|
|
16
21
|
type: string;
|
|
17
|
-
|
|
18
22
|
@IsNotEmpty()
|
|
19
23
|
@IsJSON()
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
@ApiProperty()
|
|
25
|
+
context: any = "{}";
|
|
22
26
|
@IsNotEmpty()
|
|
23
27
|
@IsJSON()
|
|
28
|
+
@ApiProperty()
|
|
24
29
|
layout: any;
|
|
25
|
-
|
|
26
|
-
@
|
|
30
|
+
@IsOptional()
|
|
31
|
+
@IsInt()
|
|
32
|
+
@ApiProperty()
|
|
27
33
|
moduleId: number;
|
|
28
|
-
|
|
29
34
|
@IsString()
|
|
30
35
|
@IsOptional()
|
|
36
|
+
@ApiProperty()
|
|
31
37
|
moduleUserKey: string;
|
|
32
|
-
|
|
33
|
-
@
|
|
38
|
+
@IsOptional()
|
|
39
|
+
@IsInt()
|
|
40
|
+
@ApiProperty()
|
|
34
41
|
modelId: number;
|
|
35
|
-
|
|
36
42
|
@IsString()
|
|
37
43
|
@IsOptional()
|
|
44
|
+
@ApiProperty()
|
|
38
45
|
modelUserKey: string;
|
|
46
|
+
@IsOptional()
|
|
47
|
+
@ApiProperty()
|
|
48
|
+
@IsArray()
|
|
49
|
+
@ValidateNested({ each: true })
|
|
50
|
+
@Type(() => UpdateUserViewMetadataDto)
|
|
51
|
+
userViewMetadata: UpdateUserViewMetadataDto[];
|
|
52
|
+
@IsOptional()
|
|
53
|
+
@IsArray()
|
|
54
|
+
@ApiProperty()
|
|
55
|
+
userViewMetadataIds: number[];
|
|
56
|
+
@IsString()
|
|
57
|
+
@IsOptional()
|
|
58
|
+
@ApiProperty()
|
|
59
|
+
userViewMetadataCommand: string;
|
|
39
60
|
}
|
|
@@ -20,7 +20,7 @@ export class SelectionDynamicQueryDto extends PaginationQueryDto {
|
|
|
20
20
|
@ApiProperty({ description: "Search query string", type: String })
|
|
21
21
|
@IsString()
|
|
22
22
|
@IsOptional()
|
|
23
|
-
query?:
|
|
23
|
+
query?: any;
|
|
24
24
|
|
|
25
25
|
@ApiProperty({ description: "Value of a single dynamic option", type: String })
|
|
26
26
|
@IsString()
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IsInt,IsOptional, IsString, IsJSON } from 'class-validator';
|
|
2
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
3
|
+
|
|
4
|
+
export class UpdateUserViewMetadataDto {
|
|
5
|
+
@IsOptional()
|
|
6
|
+
@IsInt()
|
|
7
|
+
id: number;
|
|
8
|
+
@IsOptional()
|
|
9
|
+
@IsInt()
|
|
10
|
+
@ApiProperty()
|
|
11
|
+
userId: number;
|
|
12
|
+
@IsString()
|
|
13
|
+
@IsOptional()
|
|
14
|
+
@ApiProperty()
|
|
15
|
+
userUserKey: string;
|
|
16
|
+
@IsOptional()
|
|
17
|
+
@IsJSON()
|
|
18
|
+
@ApiProperty()
|
|
19
|
+
layout: any;
|
|
20
|
+
@IsOptional()
|
|
21
|
+
@IsInt()
|
|
22
|
+
@ApiProperty()
|
|
23
|
+
viewMetadataId: number;
|
|
24
|
+
@IsString()
|
|
25
|
+
@IsOptional()
|
|
26
|
+
@ApiProperty()
|
|
27
|
+
viewMetadataUserKey: string;
|
|
28
|
+
}
|
|
@@ -1,129 +1,160 @@
|
|
|
1
|
-
import { IsInt, IsOptional, IsString, IsNotEmpty, Matches, IsBoolean, IsDate } from 'class-validator';
|
|
1
|
+
import { IsInt, IsOptional, IsString, IsNotEmpty, Matches, IsBoolean, IsDate, ValidateNested, IsArray } from 'class-validator';
|
|
2
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
3
|
+
import { Type } from 'class-transformer';
|
|
4
|
+
import { UpdateRoleMetadataDto } from 'src/dtos/update-role-metadata.dto';
|
|
5
|
+
import { UpdateUserViewMetadataDto } from 'src/dtos/update-user-view-metadata.dto';
|
|
6
|
+
|
|
2
7
|
export class UpdateUserDto {
|
|
3
8
|
@IsOptional()
|
|
4
9
|
@IsInt()
|
|
5
10
|
id: number;
|
|
6
|
-
|
|
7
11
|
@IsOptional()
|
|
8
12
|
@IsString()
|
|
13
|
+
@ApiProperty()
|
|
9
14
|
fullName: string;
|
|
10
|
-
|
|
11
|
-
@IsOptional()
|
|
12
15
|
@IsNotEmpty()
|
|
16
|
+
@IsOptional()
|
|
13
17
|
@IsString()
|
|
18
|
+
@ApiProperty()
|
|
14
19
|
username: string;
|
|
15
|
-
|
|
16
20
|
@IsOptional()
|
|
17
21
|
@IsString()
|
|
22
|
+
@ApiProperty()
|
|
18
23
|
email: string;
|
|
19
|
-
|
|
20
24
|
@IsOptional()
|
|
21
25
|
@IsString()
|
|
26
|
+
@ApiProperty()
|
|
22
27
|
mobile: string;
|
|
23
|
-
|
|
24
28
|
@IsOptional()
|
|
25
|
-
@IsNotEmpty()
|
|
26
29
|
@Matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^\da-zA-Z]).*$/)
|
|
27
30
|
@IsString()
|
|
31
|
+
@ApiProperty()
|
|
28
32
|
password: string;
|
|
29
|
-
|
|
30
33
|
@IsOptional()
|
|
31
|
-
@IsString()
|
|
32
34
|
@Matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^\da-zA-Z]).*$/)
|
|
33
|
-
@
|
|
35
|
+
@IsString()
|
|
36
|
+
@ApiProperty()
|
|
34
37
|
passwordConfirm: string;
|
|
35
|
-
|
|
36
38
|
@IsOptional()
|
|
37
39
|
@IsBoolean()
|
|
40
|
+
@ApiProperty()
|
|
38
41
|
forcePasswordChange: boolean = true;
|
|
39
|
-
|
|
40
|
-
@IsOptional()
|
|
41
42
|
@IsNotEmpty()
|
|
43
|
+
@IsOptional()
|
|
42
44
|
@IsString()
|
|
45
|
+
@ApiProperty()
|
|
43
46
|
lastLoginProvider: string = "local";
|
|
44
|
-
|
|
45
47
|
@IsOptional()
|
|
46
48
|
@IsString()
|
|
49
|
+
@ApiProperty()
|
|
47
50
|
accessCode: string;
|
|
48
|
-
|
|
49
51
|
@IsOptional()
|
|
50
52
|
@IsString()
|
|
53
|
+
@ApiProperty()
|
|
51
54
|
googleAccessToken: string;
|
|
52
|
-
|
|
53
55
|
@IsOptional()
|
|
54
56
|
@IsString()
|
|
57
|
+
@ApiProperty()
|
|
55
58
|
googleId: string;
|
|
56
|
-
|
|
57
59
|
@IsOptional()
|
|
58
60
|
@IsString()
|
|
61
|
+
@ApiProperty()
|
|
59
62
|
googleProfilePicture: string;
|
|
60
|
-
|
|
61
|
-
@IsOptional()
|
|
62
63
|
@IsNotEmpty()
|
|
64
|
+
@IsOptional()
|
|
63
65
|
@IsBoolean()
|
|
66
|
+
@ApiProperty()
|
|
64
67
|
active: boolean = true;
|
|
65
|
-
|
|
66
68
|
@IsOptional()
|
|
67
69
|
@IsDate()
|
|
70
|
+
@ApiProperty()
|
|
68
71
|
forgotPasswordConfirmedAt: Date = new Date("1970-01-01T00:00:00.000Z");
|
|
69
|
-
|
|
70
72
|
@IsOptional()
|
|
71
73
|
@IsString()
|
|
74
|
+
@ApiProperty()
|
|
72
75
|
verificationTokenOnForgotPassword: string;
|
|
73
|
-
|
|
74
76
|
@IsOptional()
|
|
75
77
|
@IsDate()
|
|
78
|
+
@ApiProperty()
|
|
76
79
|
verificationTokenOnForgotPasswordExpiresAt: Date = new Date("1970-01-01T00:00:00.000Z");
|
|
77
|
-
|
|
78
80
|
@IsOptional()
|
|
79
81
|
@IsDate()
|
|
82
|
+
@ApiProperty()
|
|
80
83
|
emailVerifiedOnRegistrationAt: Date = new Date("1970-01-01T00:00:00.000Z");
|
|
81
|
-
|
|
82
84
|
@IsOptional()
|
|
83
85
|
@IsString()
|
|
86
|
+
@ApiProperty()
|
|
84
87
|
emailVerificationTokenOnRegistration: string;
|
|
85
|
-
|
|
86
88
|
@IsOptional()
|
|
87
89
|
@IsDate()
|
|
90
|
+
@ApiProperty()
|
|
88
91
|
emailVerificationTokenOnRegistrationExpiresAt: Date = new Date("1970-01-01T00:00:00.000Z");
|
|
89
|
-
|
|
90
92
|
@IsOptional()
|
|
91
93
|
@IsDate()
|
|
94
|
+
@ApiProperty()
|
|
92
95
|
mobileVerifiedOnRegistrationAt: Date = new Date("1970-01-01T00:00:00.000Z");
|
|
93
|
-
|
|
94
96
|
@IsOptional()
|
|
95
97
|
@IsString()
|
|
98
|
+
@ApiProperty()
|
|
96
99
|
mobileVerificationTokenOnRegistration: string;
|
|
97
|
-
|
|
98
100
|
@IsOptional()
|
|
99
101
|
@IsDate()
|
|
102
|
+
@ApiProperty()
|
|
100
103
|
mobileVerificationTokenOnRegistrationExpiresAt: Date = new Date("1970-01-01T00:00:00.000Z");
|
|
101
|
-
|
|
102
104
|
@IsOptional()
|
|
103
105
|
@IsDate()
|
|
106
|
+
@ApiProperty()
|
|
104
107
|
emailVerifiedOnLoginAt: Date = new Date("1970-01-01T00:00:00.000Z");
|
|
105
|
-
|
|
106
108
|
@IsOptional()
|
|
107
109
|
@IsString()
|
|
110
|
+
@ApiProperty()
|
|
108
111
|
emailVerificationTokenOnLogin: string;
|
|
109
|
-
|
|
110
112
|
@IsOptional()
|
|
111
113
|
@IsDate()
|
|
114
|
+
@ApiProperty()
|
|
112
115
|
emailVerificationTokenOnLoginExpiresAt: Date = new Date("1970-01-01T00:00:00.000Z");
|
|
113
|
-
|
|
114
116
|
@IsOptional()
|
|
115
117
|
@IsDate()
|
|
118
|
+
@ApiProperty()
|
|
116
119
|
mobileVerifiedOnLoginAt: Date = new Date("1970-01-01T00:00:00.000Z");
|
|
117
|
-
|
|
118
120
|
@IsOptional()
|
|
119
121
|
@IsString()
|
|
122
|
+
@ApiProperty()
|
|
120
123
|
mobileVerificationTokenOnLogin: string;
|
|
121
|
-
|
|
122
124
|
@IsOptional()
|
|
123
125
|
@IsDate()
|
|
126
|
+
@ApiProperty()
|
|
124
127
|
mobileVerificationTokenOnLoginExpiresAt: Date = new Date("1970-01-01T00:00:00.000Z");
|
|
125
|
-
|
|
126
128
|
@IsOptional()
|
|
127
129
|
@IsString()
|
|
130
|
+
@ApiProperty()
|
|
128
131
|
customPayload: string;
|
|
132
|
+
@IsOptional()
|
|
133
|
+
@ApiProperty()
|
|
134
|
+
@IsArray()
|
|
135
|
+
@ValidateNested({ each: true })
|
|
136
|
+
@Type(() => UpdateRoleMetadataDto)
|
|
137
|
+
roles: UpdateRoleMetadataDto[];
|
|
138
|
+
@IsOptional()
|
|
139
|
+
@IsArray()
|
|
140
|
+
@ApiProperty()
|
|
141
|
+
rolesIds: number[];
|
|
142
|
+
@IsString()
|
|
143
|
+
@IsOptional()
|
|
144
|
+
@ApiProperty()
|
|
145
|
+
rolesCommand: string;
|
|
146
|
+
@IsOptional()
|
|
147
|
+
@ApiProperty()
|
|
148
|
+
@IsArray()
|
|
149
|
+
@ValidateNested({ each: true })
|
|
150
|
+
@Type(() => UpdateUserViewMetadataDto)
|
|
151
|
+
userViewMetadata: UpdateUserViewMetadataDto[];
|
|
152
|
+
@IsOptional()
|
|
153
|
+
@IsArray()
|
|
154
|
+
@ApiProperty()
|
|
155
|
+
userViewMetadataIds: number[];
|
|
156
|
+
@IsString()
|
|
157
|
+
@IsOptional()
|
|
158
|
+
@ApiProperty()
|
|
159
|
+
userViewMetadataCommand: string;
|
|
129
160
|
}
|