@solidstarters/solid-core 1.2.51 → 1.2.52
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/list-of-values.controller.d.ts +41 -0
- package/dist/controllers/list-of-values.controller.d.ts.map +1 -0
- package/dist/controllers/list-of-values.controller.js +179 -0
- package/dist/controllers/list-of-values.controller.js.map +1 -0
- package/dist/controllers/saved-filters.controller.d.ts +41 -0
- package/dist/controllers/saved-filters.controller.d.ts.map +1 -0
- package/dist/controllers/saved-filters.controller.js +179 -0
- package/dist/controllers/saved-filters.controller.js.map +1 -0
- package/dist/dtos/create-list-of-values.dto.d.ts +6 -6
- package/dist/dtos/create-list-of-values.dto.d.ts.map +1 -1
- package/dist/dtos/create-list-of-values.dto.js +24 -7
- package/dist/dtos/create-list-of-values.dto.js.map +1 -1
- package/dist/dtos/create-saved-filters.dto.d.ts +12 -0
- package/dist/dtos/create-saved-filters.dto.d.ts.map +1 -0
- package/dist/dtos/create-saved-filters.dto.js +80 -0
- package/dist/dtos/create-saved-filters.dto.js.map +1 -0
- package/dist/dtos/update-list-of-values.dto.d.ts +10 -0
- package/dist/dtos/update-list-of-values.dto.d.ts.map +1 -0
- package/dist/dtos/update-list-of-values.dto.js +67 -0
- package/dist/dtos/update-list-of-values.dto.js.map +1 -0
- package/dist/dtos/update-saved-filters.dto.d.ts +13 -0
- package/dist/dtos/update-saved-filters.dto.d.ts.map +1 -0
- package/dist/dtos/update-saved-filters.dto.js +82 -0
- package/dist/dtos/update-saved-filters.dto.js.map +1 -0
- package/dist/entities/list-of-values.entity.d.ts +1 -1
- package/dist/entities/list-of-values.entity.d.ts.map +1 -1
- package/dist/entities/list-of-values.entity.js +11 -7
- package/dist/entities/list-of-values.entity.js.map +1 -1
- package/dist/entities/saved-filters.entity.d.ts +13 -0
- package/dist/entities/saved-filters.entity.d.ts.map +1 -0
- package/dist/entities/saved-filters.entity.js +59 -0
- package/dist/entities/saved-filters.entity.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/providers/list-of-values-selection-providers.service.js +2 -2
- package/dist/providers/list-of-values-selection-providers.service.js.map +1 -1
- package/dist/seeders/module-metadata-seeder.service.d.ts +6 -2
- package/dist/seeders/module-metadata-seeder.service.d.ts.map +1 -1
- package/dist/seeders/module-metadata-seeder.service.js +24 -8
- package/dist/seeders/module-metadata-seeder.service.js.map +1 -1
- package/dist/seeders/seed-data/solid-core-metadata.json +1197 -141
- package/dist/services/list-of-values.service.d.ts +21 -10
- package/dist/services/list-of-values.service.d.ts.map +1 -1
- package/dist/services/list-of-values.service.js +43 -31
- package/dist/services/list-of-values.service.js.map +1 -1
- package/dist/services/saved-filters.service.d.ts +22 -0
- package/dist/services/saved-filters.service.d.ts.map +1 -0
- package/dist/services/saved-filters.service.js +56 -0
- package/dist/services/saved-filters.service.js.map +1 -0
- package/dist/solid-core.module.d.ts.map +1 -1
- package/dist/solid-core.module.js +12 -0
- package/dist/solid-core.module.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/controllers/list-of-values.controller.ts +93 -0
- package/src/controllers/saved-filters.controller.ts +93 -0
- package/src/dtos/create-list-of-values.dto.ts +27 -19
- package/src/dtos/create-saved-filters.dto.ts +42 -0
- package/src/dtos/update-list-of-values.dto.ts +36 -0
- package/src/dtos/update-saved-filters.dto.ts +45 -0
- package/src/entities/list-of-values.entity.ts +9 -14
- package/src/entities/saved-filters.entity.ts +24 -0
- package/src/index.ts +2 -0
- package/src/providers/list-of-values-selection-providers.service.ts +2 -2
- package/src/seeders/module-metadata-seeder.service.ts +22 -3
- package/src/seeders/seed-data/solid-core-metadata.json +1445 -389
- package/src/services/list-of-values.service.ts +55 -47
- package/src/services/saved-filters.service.ts +34 -0
- package/src/solid-core.module.ts +12 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidstarters/solid-core",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.52",
|
|
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",
|
|
@@ -0,0 +1,93 @@
|
|
|
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 { ListOfValuesService } from '../services/list-of-values.service';
|
|
5
|
+
import { CreateListOfValuesDto } from '../dtos/create-list-of-values.dto';
|
|
6
|
+
import { UpdateListOfValuesDto } from '../dtos/update-list-of-values.dto';
|
|
7
|
+
|
|
8
|
+
enum ShowSoftDeleted {
|
|
9
|
+
INCLUSIVE = "inclusive",
|
|
10
|
+
EXCLUSIVE = "exclusive",
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@ApiTags('Solid Core')
|
|
14
|
+
@Controller('list-of-values')
|
|
15
|
+
export class ListOfValuesController {
|
|
16
|
+
constructor(private readonly service: ListOfValuesService) {}
|
|
17
|
+
|
|
18
|
+
@ApiBearerAuth("jwt")
|
|
19
|
+
@Post()
|
|
20
|
+
@UseInterceptors(AnyFilesInterceptor())
|
|
21
|
+
create(@Body() createDto: CreateListOfValuesDto, @UploadedFiles() files: Array<Express.Multer.File>) {
|
|
22
|
+
return this.service.create(createDto, files);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@ApiBearerAuth("jwt")
|
|
26
|
+
@Post('/bulk')
|
|
27
|
+
@UseInterceptors(AnyFilesInterceptor())
|
|
28
|
+
insertMany(@Body() createDtos: CreateListOfValuesDto[], @UploadedFiles() filesArray: Express.Multer.File[][] = []) {
|
|
29
|
+
return this.service.insertMany(createDtos, filesArray);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@ApiBearerAuth("jwt")
|
|
34
|
+
@Put(':id')
|
|
35
|
+
@UseInterceptors(AnyFilesInterceptor())
|
|
36
|
+
update(@Param('id') id: number, @Body() updateDto: UpdateListOfValuesDto, @UploadedFiles() files: Array<Express.Multer.File>) {
|
|
37
|
+
return this.service.update(id, updateDto, files);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@ApiBearerAuth("jwt")
|
|
41
|
+
@Patch(':id')
|
|
42
|
+
@UseInterceptors(AnyFilesInterceptor())
|
|
43
|
+
partialUpdate(@Param('id') id: number, @Body() updateDto: UpdateListOfValuesDto, @UploadedFiles() files: Array<Express.Multer.File>) {
|
|
44
|
+
return this.service.update(id, updateDto, files, true);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@ApiBearerAuth("jwt")
|
|
48
|
+
@Post('/bulk-recover')
|
|
49
|
+
async recoverMany(@Body() ids: number[]) {
|
|
50
|
+
return this.service.recoverMany(ids);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@ApiBearerAuth("jwt")
|
|
54
|
+
@Get('/recover/:id')
|
|
55
|
+
async recover(@Param('id') id: number) {
|
|
56
|
+
return this.service.recover(id);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@ApiBearerAuth("jwt")
|
|
60
|
+
@ApiQuery({ name: 'showSoftDeleted', required: false, enum: ShowSoftDeleted })
|
|
61
|
+
@ApiQuery({ name: 'limit', required: false, type: Number })
|
|
62
|
+
@ApiQuery({ name: 'offset', required: false, type: Number })
|
|
63
|
+
@ApiQuery({ name: 'fields', required: false, type: Array })
|
|
64
|
+
@ApiQuery({ name: 'sort', required: false, type: Array })
|
|
65
|
+
@ApiQuery({ name: 'groupBy', required: false, type: Array })
|
|
66
|
+
@ApiQuery({ name: 'populate', required: false, type: Array })
|
|
67
|
+
@ApiQuery({ name: 'populateMedia', required: false, type: Array })
|
|
68
|
+
@ApiQuery({ name: 'filters', required: false, type: Array })
|
|
69
|
+
@Get()
|
|
70
|
+
async findMany(@Query() query: any) {
|
|
71
|
+
return this.service.find(query);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@ApiBearerAuth("jwt")
|
|
75
|
+
@Get(':id')
|
|
76
|
+
async findOne(@Param('id') id: string, @Query() query: any) {
|
|
77
|
+
return this.service.findOne(+id, query);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@ApiBearerAuth("jwt")
|
|
81
|
+
@Delete('/bulk')
|
|
82
|
+
async deleteMany(@Body() ids: number[]) {
|
|
83
|
+
return this.service.deleteMany(ids);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@ApiBearerAuth("jwt")
|
|
87
|
+
@Delete(':id')
|
|
88
|
+
async delete(@Param('id') id: number) {
|
|
89
|
+
return this.service.delete(id);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
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 { SavedFiltersService } from '../services/saved-filters.service';
|
|
5
|
+
import { CreateSavedFiltersDto } from '../dtos/create-saved-filters.dto';
|
|
6
|
+
import { UpdateSavedFiltersDto } from '../dtos/update-saved-filters.dto';
|
|
7
|
+
|
|
8
|
+
enum ShowSoftDeleted {
|
|
9
|
+
INCLUSIVE = "inclusive",
|
|
10
|
+
EXCLUSIVE = "exclusive",
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@ApiTags('Solid Core')
|
|
14
|
+
@Controller('saved-filters')
|
|
15
|
+
export class SavedFiltersController {
|
|
16
|
+
constructor(private readonly service: SavedFiltersService) {}
|
|
17
|
+
|
|
18
|
+
@ApiBearerAuth("jwt")
|
|
19
|
+
@Post()
|
|
20
|
+
@UseInterceptors(AnyFilesInterceptor())
|
|
21
|
+
create(@Body() createDto: CreateSavedFiltersDto, @UploadedFiles() files: Array<Express.Multer.File>) {
|
|
22
|
+
return this.service.create(createDto, files);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@ApiBearerAuth("jwt")
|
|
26
|
+
@Post('/bulk')
|
|
27
|
+
@UseInterceptors(AnyFilesInterceptor())
|
|
28
|
+
insertMany(@Body() createDtos: CreateSavedFiltersDto[], @UploadedFiles() filesArray: Express.Multer.File[][] = []) {
|
|
29
|
+
return this.service.insertMany(createDtos, filesArray);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@ApiBearerAuth("jwt")
|
|
34
|
+
@Put(':id')
|
|
35
|
+
@UseInterceptors(AnyFilesInterceptor())
|
|
36
|
+
update(@Param('id') id: number, @Body() updateDto: UpdateSavedFiltersDto, @UploadedFiles() files: Array<Express.Multer.File>) {
|
|
37
|
+
return this.service.update(id, updateDto, files);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@ApiBearerAuth("jwt")
|
|
41
|
+
@Patch(':id')
|
|
42
|
+
@UseInterceptors(AnyFilesInterceptor())
|
|
43
|
+
partialUpdate(@Param('id') id: number, @Body() updateDto: UpdateSavedFiltersDto, @UploadedFiles() files: Array<Express.Multer.File>) {
|
|
44
|
+
return this.service.update(id, updateDto, files, true);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@ApiBearerAuth("jwt")
|
|
48
|
+
@Post('/bulk-recover')
|
|
49
|
+
async recoverMany(@Body() ids: number[]) {
|
|
50
|
+
return this.service.recoverMany(ids);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@ApiBearerAuth("jwt")
|
|
54
|
+
@Get('/recover/:id')
|
|
55
|
+
async recover(@Param('id') id: number) {
|
|
56
|
+
return this.service.recover(id);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@ApiBearerAuth("jwt")
|
|
60
|
+
@ApiQuery({ name: 'showSoftDeleted', required: false, enum: ShowSoftDeleted })
|
|
61
|
+
@ApiQuery({ name: 'limit', required: false, type: Number })
|
|
62
|
+
@ApiQuery({ name: 'offset', required: false, type: Number })
|
|
63
|
+
@ApiQuery({ name: 'fields', required: false, type: Array })
|
|
64
|
+
@ApiQuery({ name: 'sort', required: false, type: Array })
|
|
65
|
+
@ApiQuery({ name: 'groupBy', required: false, type: Array })
|
|
66
|
+
@ApiQuery({ name: 'populate', required: false, type: Array })
|
|
67
|
+
@ApiQuery({ name: 'populateMedia', required: false, type: Array })
|
|
68
|
+
@ApiQuery({ name: 'filters', required: false, type: Array })
|
|
69
|
+
@Get()
|
|
70
|
+
async findMany(@Query() query: any) {
|
|
71
|
+
return this.service.find(query);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@ApiBearerAuth("jwt")
|
|
75
|
+
@Get(':id')
|
|
76
|
+
async findOne(@Param('id') id: string, @Query() query: any) {
|
|
77
|
+
return this.service.findOne(+id, query);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@ApiBearerAuth("jwt")
|
|
81
|
+
@Delete('/bulk')
|
|
82
|
+
async deleteMany(@Body() ids: number[]) {
|
|
83
|
+
return this.service.deleteMany(ids);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@ApiBearerAuth("jwt")
|
|
87
|
+
@Delete(':id')
|
|
88
|
+
async delete(@Param('id') id: number) {
|
|
89
|
+
return this.service.delete(id);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
}
|
|
@@ -1,22 +1,30 @@
|
|
|
1
|
-
import { ApiProperty } from
|
|
1
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
+
import { IsString } from 'class-validator';
|
|
3
|
+
import { IsNotEmpty, IsBoolean, IsOptional, IsInt } from 'class-validator';
|
|
2
4
|
|
|
3
5
|
export class CreateListOfValuesDto {
|
|
4
|
-
|
|
5
|
-
@
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
@
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
@ApiProperty(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
@
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
@
|
|
21
|
-
|
|
6
|
+
@IsNotEmpty()
|
|
7
|
+
@IsString()
|
|
8
|
+
@ApiProperty()
|
|
9
|
+
type: string;
|
|
10
|
+
@IsNotEmpty()
|
|
11
|
+
@IsString()
|
|
12
|
+
@ApiProperty()
|
|
13
|
+
value: string;
|
|
14
|
+
@IsNotEmpty()
|
|
15
|
+
@IsString()
|
|
16
|
+
@ApiProperty()
|
|
17
|
+
display: string;
|
|
18
|
+
@IsNotEmpty()
|
|
19
|
+
@IsString()
|
|
20
|
+
@ApiProperty()
|
|
21
|
+
description: string;
|
|
22
|
+
@IsOptional()
|
|
23
|
+
@IsBoolean()
|
|
24
|
+
@ApiProperty()
|
|
25
|
+
default: boolean = false;
|
|
26
|
+
@IsOptional()
|
|
27
|
+
@IsInt()
|
|
28
|
+
@ApiProperty()
|
|
29
|
+
sequence: number;
|
|
22
30
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
+
import { IsString } from 'class-validator';
|
|
3
|
+
import { IsOptional, IsNotEmpty, IsBoolean, IsInt } from 'class-validator';
|
|
4
|
+
|
|
5
|
+
export class CreateSavedFiltersDto {
|
|
6
|
+
@IsOptional()
|
|
7
|
+
@IsString()
|
|
8
|
+
@ApiProperty()
|
|
9
|
+
filterQueryJson: string;
|
|
10
|
+
@IsNotEmpty()
|
|
11
|
+
@IsString()
|
|
12
|
+
@ApiProperty()
|
|
13
|
+
name: string;
|
|
14
|
+
@IsOptional()
|
|
15
|
+
@IsBoolean()
|
|
16
|
+
@ApiProperty()
|
|
17
|
+
isPrivate: boolean = false;
|
|
18
|
+
@IsOptional()
|
|
19
|
+
@IsInt()
|
|
20
|
+
@ApiProperty({ description: "This is the user id field" })
|
|
21
|
+
userId: number;
|
|
22
|
+
@IsString()
|
|
23
|
+
@IsOptional()
|
|
24
|
+
@ApiProperty({ description: "This is the user id field" })
|
|
25
|
+
userUserKey: string;
|
|
26
|
+
@IsOptional()
|
|
27
|
+
@IsInt()
|
|
28
|
+
@ApiProperty({ description: "This is the model related to saved filter." })
|
|
29
|
+
modelId: number;
|
|
30
|
+
@IsString()
|
|
31
|
+
@IsOptional()
|
|
32
|
+
@ApiProperty({ description: "This is the model related to saved filter." })
|
|
33
|
+
modelUserKey: string;
|
|
34
|
+
@IsOptional()
|
|
35
|
+
@IsInt()
|
|
36
|
+
@ApiProperty({ description: "This is the view related to saved filter." })
|
|
37
|
+
viewId: number;
|
|
38
|
+
@IsString()
|
|
39
|
+
@IsOptional()
|
|
40
|
+
@ApiProperty({ description: "This is the view related to saved filter." })
|
|
41
|
+
viewUserKey: string;
|
|
42
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { IsInt,IsOptional, IsString, IsNotEmpty, IsBoolean } from 'class-validator';
|
|
2
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
3
|
+
|
|
4
|
+
export class UpdateListOfValuesDto {
|
|
5
|
+
@IsOptional()
|
|
6
|
+
@IsInt()
|
|
7
|
+
id: number;
|
|
8
|
+
@IsNotEmpty()
|
|
9
|
+
@IsOptional()
|
|
10
|
+
@IsString()
|
|
11
|
+
@ApiProperty()
|
|
12
|
+
type: string;
|
|
13
|
+
@IsNotEmpty()
|
|
14
|
+
@IsOptional()
|
|
15
|
+
@IsString()
|
|
16
|
+
@ApiProperty()
|
|
17
|
+
value: string;
|
|
18
|
+
@IsNotEmpty()
|
|
19
|
+
@IsOptional()
|
|
20
|
+
@IsString()
|
|
21
|
+
@ApiProperty()
|
|
22
|
+
display: string;
|
|
23
|
+
@IsNotEmpty()
|
|
24
|
+
@IsOptional()
|
|
25
|
+
@IsString()
|
|
26
|
+
@ApiProperty()
|
|
27
|
+
description: string;
|
|
28
|
+
@IsOptional()
|
|
29
|
+
@IsBoolean()
|
|
30
|
+
@ApiProperty()
|
|
31
|
+
default: boolean;
|
|
32
|
+
@IsOptional()
|
|
33
|
+
@IsInt()
|
|
34
|
+
@ApiProperty()
|
|
35
|
+
sequence: number;
|
|
36
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { IsInt,IsOptional, IsString, IsNotEmpty, IsBoolean } from 'class-validator';
|
|
2
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
3
|
+
|
|
4
|
+
export class UpdateSavedFiltersDto {
|
|
5
|
+
@IsOptional()
|
|
6
|
+
@IsInt()
|
|
7
|
+
id: number;
|
|
8
|
+
@IsOptional()
|
|
9
|
+
@IsString()
|
|
10
|
+
@ApiProperty()
|
|
11
|
+
filterQueryJson: string;
|
|
12
|
+
@IsNotEmpty()
|
|
13
|
+
@IsOptional()
|
|
14
|
+
@IsString()
|
|
15
|
+
@ApiProperty()
|
|
16
|
+
name: string;
|
|
17
|
+
@IsOptional()
|
|
18
|
+
@IsBoolean()
|
|
19
|
+
@ApiProperty()
|
|
20
|
+
isPrivate: boolean;
|
|
21
|
+
@IsOptional()
|
|
22
|
+
@IsInt()
|
|
23
|
+
@ApiProperty({ description: "This is the user id field" })
|
|
24
|
+
userId: number;
|
|
25
|
+
@IsString()
|
|
26
|
+
@IsOptional()
|
|
27
|
+
@ApiProperty({ description: "This is the user id field" })
|
|
28
|
+
userUserKey: string;
|
|
29
|
+
@IsOptional()
|
|
30
|
+
@IsInt()
|
|
31
|
+
@ApiProperty({ description: "This is the model related to saved filter." })
|
|
32
|
+
modelId: number;
|
|
33
|
+
@IsString()
|
|
34
|
+
@IsOptional()
|
|
35
|
+
@ApiProperty({ description: "This is the model related to saved filter." })
|
|
36
|
+
modelUserKey: string;
|
|
37
|
+
@IsOptional()
|
|
38
|
+
@IsInt()
|
|
39
|
+
@ApiProperty({ description: "This is the view related to saved filter." })
|
|
40
|
+
viewId: number;
|
|
41
|
+
@IsString()
|
|
42
|
+
@IsOptional()
|
|
43
|
+
@ApiProperty({ description: "This is the view related to saved filter." })
|
|
44
|
+
viewUserKey: string;
|
|
45
|
+
}
|
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
import { CommonEntity } from
|
|
2
|
-
import { Column
|
|
1
|
+
import { CommonEntity } from 'src/entities/common.entity'
|
|
2
|
+
import {Entity, Column} from 'typeorm'
|
|
3
3
|
|
|
4
4
|
@Entity("ss_list_of_values")
|
|
5
5
|
export class ListOfValues extends CommonEntity {
|
|
6
|
-
@Column({
|
|
6
|
+
@Column({ type: "varchar" })
|
|
7
7
|
type: string;
|
|
8
|
-
|
|
9
|
-
@Column({ name: "value" })
|
|
8
|
+
@Column({ type: "varchar" })
|
|
10
9
|
value: string;
|
|
11
|
-
|
|
12
|
-
@Column({ name: "display" })
|
|
10
|
+
@Column({ type: "varchar" })
|
|
13
11
|
display: string;
|
|
14
|
-
|
|
15
|
-
@Column({ name: "description" })
|
|
12
|
+
@Column({ type: "varchar" })
|
|
16
13
|
description: string;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
@Column({ name: "sequence" })
|
|
14
|
+
@Column({ type: "boolean", nullable: true, default: false })
|
|
15
|
+
default: boolean = false;
|
|
16
|
+
@Column({ type: "int", nullable: true })
|
|
22
17
|
sequence: number;
|
|
23
18
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CommonEntity } from 'src/entities/common.entity'
|
|
2
|
+
import {Entity, Column, JoinColumn, ManyToOne} from 'typeorm';
|
|
3
|
+
import { User } from 'src/entities/user.entity';
|
|
4
|
+
import { ModelMetadata } from 'src/entities/model-metadata.entity';
|
|
5
|
+
import { ViewMetadata } from 'src/entities/view-metadata.entity'
|
|
6
|
+
|
|
7
|
+
@Entity("ss_saved_fitlers")
|
|
8
|
+
export class SavedFilters extends CommonEntity {
|
|
9
|
+
@Column({ type: "text", nullable: true })
|
|
10
|
+
filterQueryJson: string;
|
|
11
|
+
@Column({ type: "varchar" })
|
|
12
|
+
name: string;
|
|
13
|
+
@Column({ type: "boolean", nullable: true, default: false })
|
|
14
|
+
isPrivate: boolean = false;
|
|
15
|
+
@ManyToOne(() => User, { onDelete: "RESTRICT", nullable: false })
|
|
16
|
+
@JoinColumn()
|
|
17
|
+
user: User;
|
|
18
|
+
@ManyToOne(() => ModelMetadata, { onDelete: "RESTRICT", nullable: false })
|
|
19
|
+
@JoinColumn()
|
|
20
|
+
model: ModelMetadata;
|
|
21
|
+
@ManyToOne(() => ViewMetadata, { onDelete: "RESTRICT", nullable: false })
|
|
22
|
+
@JoinColumn()
|
|
23
|
+
view: ViewMetadata;
|
|
24
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -102,8 +102,10 @@ export * from './entities/user-password-history.entity'
|
|
|
102
102
|
export * from './entities/user.entity'
|
|
103
103
|
export * from './entities/view-metadata.entity'
|
|
104
104
|
export * from './entities/setting.entity'
|
|
105
|
+
export * from './entities/saved-filters.entity'
|
|
105
106
|
export * from './entities/user-view-metadata.entity'
|
|
106
107
|
export * from './entities/security-rule.entity'
|
|
108
|
+
export * from './entities/saved-filters.entity'
|
|
107
109
|
|
|
108
110
|
export * from './enums/auth-type.enum'
|
|
109
111
|
|
|
@@ -32,8 +32,8 @@ export class ListOfValuesSelectionProvider implements ISelectionProvider<ListOfV
|
|
|
32
32
|
|
|
33
33
|
async values(query: string, ctxt: ListOfValuesProviderContext): Promise<readonly ISelectionProviderValues[]> {
|
|
34
34
|
const paginatedQuery = new PaginationQueryDto(DEFAULT_LIMIT, 0);
|
|
35
|
-
const lovs = await this.listOfValuesService.
|
|
36
|
-
const selectionValues = lovs.map(lov => {
|
|
35
|
+
const lovs = await this.listOfValuesService.find(paginatedQuery);
|
|
36
|
+
const selectionValues = lovs.records.map(lov => {
|
|
37
37
|
return {
|
|
38
38
|
label: lov.display,
|
|
39
39
|
value: lov.value
|
|
@@ -34,6 +34,8 @@ import { SettingService } from 'src/services/setting.service';
|
|
|
34
34
|
import { Setting } from 'src/entities/setting.entity';
|
|
35
35
|
import { CreateSecurityRuleDto } from 'src/dtos/create-security-rule.dto';
|
|
36
36
|
import { SecurityRuleRepository } from 'src/repository/security-rule.repository';
|
|
37
|
+
import { ListOfValuesService } from 'src/services/list-of-values.service';
|
|
38
|
+
import { CreateListOfValuesDto } from 'src/dtos/create-list-of-values.dto';
|
|
37
39
|
|
|
38
40
|
@Injectable()
|
|
39
41
|
export class ModuleMetadataSeederService {
|
|
@@ -53,6 +55,7 @@ export class ModuleMetadataSeederService {
|
|
|
53
55
|
private readonly mediaStorageProviderSeederService: MediaStorageProviderMetadataSeederService,
|
|
54
56
|
private readonly emailTemplateService: EmailTemplateService,
|
|
55
57
|
private readonly smsTemplateService: SmsTemplateService,
|
|
58
|
+
private readonly listOfValuesService: ListOfValuesService,
|
|
56
59
|
@InjectRepository(PermissionMetadata)
|
|
57
60
|
private readonly permissionRepo: Repository<PermissionMetadata>,
|
|
58
61
|
private readonly solidRegistry: SolidRegistry,
|
|
@@ -61,7 +64,7 @@ export class ModuleMetadataSeederService {
|
|
|
61
64
|
@Inject(iamConfig.KEY) private readonly iamConfiguration: ConfigType<typeof iamConfig>,
|
|
62
65
|
@Inject(commonConfig.KEY)
|
|
63
66
|
private readonly commonConfiguration: ConfigType<typeof commonConfig>,
|
|
64
|
-
private readonly
|
|
67
|
+
private readonly seetingService: SettingService,
|
|
65
68
|
@InjectRepository(Setting, 'default')
|
|
66
69
|
readonly settingsRepo: Repository<Setting>,
|
|
67
70
|
readonly securityRuleRepo: SecurityRuleRepository,
|
|
@@ -204,6 +207,12 @@ export class ModuleMetadataSeederService {
|
|
|
204
207
|
await this.seedSecurityRules(securityRules);
|
|
205
208
|
this.logger.debug(`[End] Processing security rules for ${moduleMetadata.name}`);
|
|
206
209
|
|
|
210
|
+
// List Of Values
|
|
211
|
+
this.logger.debug(`[Start] Processing security rules for ${moduleMetadata.name}`);
|
|
212
|
+
const listOfValues: CreateListOfValuesDto[] = overallMetadata.listOfValues;
|
|
213
|
+
await this.seedListOfValues(listOfValues);
|
|
214
|
+
this.logger.debug(`[End] Processing List Of Values for ${moduleMetadata.name}`);
|
|
215
|
+
|
|
207
216
|
this.logger.debug(`[End] module seed data: ${overallMetadata}`);
|
|
208
217
|
|
|
209
218
|
}
|
|
@@ -499,7 +508,7 @@ export class ModuleMetadataSeederService {
|
|
|
499
508
|
async seedSettings(createDto: CreateSettingDto) {
|
|
500
509
|
const settingsArray: any[] = await this.settingsRepo.find();
|
|
501
510
|
if (!settingsArray || settingsArray.length === 0) {
|
|
502
|
-
this.
|
|
511
|
+
this.seetingService.create(createDto);
|
|
503
512
|
}
|
|
504
513
|
}
|
|
505
514
|
|
|
@@ -509,7 +518,17 @@ export class ModuleMetadataSeederService {
|
|
|
509
518
|
return;
|
|
510
519
|
}
|
|
511
520
|
for (const dto of rulesDto) {
|
|
512
|
-
await this.securityRuleRepo.upsertWithDto({...dto, securityRuleConfig: JSON.stringify(dto.securityRuleConfig)});
|
|
521
|
+
await this.securityRuleRepo.upsertWithDto({ ...dto, securityRuleConfig: JSON.stringify(dto.securityRuleConfig) });
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
async seedListOfValues(listOfValuesDto: CreateListOfValuesDto[]) {
|
|
526
|
+
if (!listOfValuesDto || listOfValuesDto.length === 0) {
|
|
527
|
+
this.logger.debug(`No List Of Values found to seed`);
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
for (let j = 0; j < listOfValuesDto.length; j++) {
|
|
531
|
+
await this.listOfValuesService.upsert(listOfValuesDto);
|
|
513
532
|
}
|
|
514
533
|
}
|
|
515
534
|
|