jp.ms.common.modules 1.0.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/dist/config/database.d.ts +3 -0
- package/dist/config/database.js +13 -0
- package/dist/config/database.js.map +1 -0
- package/dist/config/index.d.ts +3 -0
- package/dist/config/index.js +10 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/locale.d.ts +2 -0
- package/dist/config/locale.js +26 -0
- package/dist/config/locale.js.map +1 -0
- package/dist/config/menu.d.ts +2 -0
- package/dist/config/menu.js +10 -0
- package/dist/config/menu.js.map +1 -0
- package/dist/dto/app-screen/app-screen-app-bar.dto.d.ts +8 -0
- package/dist/dto/app-screen/app-screen-app-bar.dto.js +56 -0
- package/dist/dto/app-screen/app-screen-app-bar.dto.js.map +1 -0
- package/dist/dto/app-screen/app-screen-section-button.dto.d.ts +8 -0
- package/dist/dto/app-screen/app-screen-section-button.dto.js +74 -0
- package/dist/dto/app-screen/app-screen-section-button.dto.js.map +1 -0
- package/dist/dto/app-screen/app-screen-section-buttons.dto.d.ts +6 -0
- package/dist/dto/app-screen/app-screen-section-buttons.dto.js +30 -0
- package/dist/dto/app-screen/app-screen-section-buttons.dto.js.map +1 -0
- package/dist/dto/app-screen/app-screen-section-image.dto.d.ts +6 -0
- package/dist/dto/app-screen/app-screen-section-image.dto.js +52 -0
- package/dist/dto/app-screen/app-screen-section-image.dto.js.map +1 -0
- package/dist/dto/app-screen/app-screen-section-list-item.dto.d.ts +17 -0
- package/dist/dto/app-screen/app-screen-section-list-item.dto.js +141 -0
- package/dist/dto/app-screen/app-screen-section-list-item.dto.js.map +1 -0
- package/dist/dto/app-screen/app-screen-section-req.dto.d.ts +6 -0
- package/dist/dto/app-screen/app-screen-section-req.dto.js +52 -0
- package/dist/dto/app-screen/app-screen-section-req.dto.js.map +1 -0
- package/dist/dto/app-screen/app-screen-section.dto.d.ts +16 -0
- package/dist/dto/app-screen/app-screen-section.dto.js +106 -0
- package/dist/dto/app-screen/app-screen-section.dto.js.map +1 -0
- package/dist/dto/app-screen/app-screen.dto.d.ts +9 -0
- package/dist/dto/app-screen/app-screen.dto.js +57 -0
- package/dist/dto/app-screen/app-screen.dto.js.map +1 -0
- package/dist/dto/app-screen/base-app-screen.dto.d.ts +6 -0
- package/dist/dto/app-screen/base-app-screen.dto.js +27 -0
- package/dist/dto/app-screen/base-app-screen.dto.js.map +1 -0
- package/dist/dto/app-screen/index.d.ts +9 -0
- package/dist/dto/app-screen/index.js +22 -0
- package/dist/dto/app-screen/index.js.map +1 -0
- package/dist/dto/base/base-table-summary-item.dto.d.ts +8 -0
- package/dist/dto/base/base-table-summary-item.dto.js +74 -0
- package/dist/dto/base/base-table-summary-item.dto.js.map +1 -0
- package/dist/dto/base/base-table-summary.dto.d.ts +5 -0
- package/dist/dto/base/base-table-summary.dto.js +27 -0
- package/dist/dto/base/base-table-summary.dto.js.map +1 -0
- package/dist/dto/base/base-table-yours-action.dto.d.ts +5 -0
- package/dist/dto/base/base-table-yours-action.dto.js +41 -0
- package/dist/dto/base/base-table-yours-action.dto.js.map +1 -0
- package/dist/dto/base/card.dto.d.ts +7 -0
- package/dist/dto/base/card.dto.js +63 -0
- package/dist/dto/base/card.dto.js.map +1 -0
- package/dist/dto/base/index.d.ts +5 -0
- package/dist/dto/base/index.js +14 -0
- package/dist/dto/base/index.js.map +1 -0
- package/dist/dto/base/player-check-state.dto.d.ts +5 -0
- package/dist/dto/base/player-check-state.dto.js +47 -0
- package/dist/dto/base/player-check-state.dto.js.map +1 -0
- package/dist/dto/index.d.ts +2 -0
- package/dist/dto/index.js +19 -0
- package/dist/dto/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/modules/events/events.gateway.d.ts +14 -0
- package/dist/modules/events/events.gateway.js +47 -0
- package/dist/modules/events/events.gateway.js.map +1 -0
- package/dist/modules/index.d.ts +7 -0
- package/dist/modules/index.js +16 -0
- package/dist/modules/index.js.map +1 -0
- package/dist/modules/menu/menu.constants.d.ts +1 -0
- package/dist/modules/menu/menu.constants.js +5 -0
- package/dist/modules/menu/menu.constants.js.map +1 -0
- package/dist/modules/menu/menu.controller.d.ts +8 -0
- package/dist/modules/menu/menu.controller.js +39 -0
- package/dist/modules/menu/menu.controller.js.map +1 -0
- package/dist/modules/menu/menu.interfaces.d.ts +13 -0
- package/dist/modules/menu/menu.interfaces.js +3 -0
- package/dist/modules/menu/menu.interfaces.js.map +1 -0
- package/dist/modules/menu/menu.module.d.ts +5 -0
- package/dist/modules/menu/menu.module.js +42 -0
- package/dist/modules/menu/menu.module.js.map +1 -0
- package/dist/modules/menu/menu.service.d.ts +10 -0
- package/dist/modules/menu/menu.service.js +42 -0
- package/dist/modules/menu/menu.service.js.map +1 -0
- package/dist/modules/players-manager/players-manager.module.d.ts +2 -0
- package/dist/modules/players-manager/players-manager.module.js +21 -0
- package/dist/modules/players-manager/players-manager.module.js.map +1 -0
- package/dist/modules/players-manager/players-manager.service.d.ts +9 -0
- package/dist/modules/players-manager/players-manager.service.js +37 -0
- package/dist/modules/players-manager/players-manager.service.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +40 -0
- package/readme.md +3 -0
- package/src/config/database.ts +12 -0
- package/src/config/index.ts +3 -0
- package/src/config/locale.ts +30 -0
- package/src/config/menu.ts +10 -0
- package/src/dto/app-screen/app-screen-app-bar.dto.ts +36 -0
- package/src/dto/app-screen/app-screen-section-button.dto.ts +51 -0
- package/src/dto/app-screen/app-screen-section-buttons.dto.ts +14 -0
- package/src/dto/app-screen/app-screen-section-image.dto.ts +33 -0
- package/src/dto/app-screen/app-screen-section-list-item.dto.ts +105 -0
- package/src/dto/app-screen/app-screen-section-req.dto.ts +33 -0
- package/src/dto/app-screen/app-screen-section.dto.ts +76 -0
- package/src/dto/app-screen/app-screen.dto.ts +37 -0
- package/src/dto/app-screen/base-app-screen.dto.ts +14 -0
- package/src/dto/app-screen/index.ts +9 -0
- package/src/dto/base/base-table-summary-item.dto.ts +52 -0
- package/src/dto/base/base-table-summary.dto.ts +13 -0
- package/src/dto/base/base-table-yours-action.dto.ts +25 -0
- package/src/dto/base/card.dto.ts +43 -0
- package/src/dto/base/index.ts +5 -0
- package/src/dto/base/player-check-state.dto.ts +30 -0
- package/src/dto/index.ts +2 -0
- package/src/index.ts +3 -0
- package/src/modules/events/events.gateway.ts +62 -0
- package/src/modules/index.ts +15 -0
- package/src/modules/menu/menu.constants.ts +1 -0
- package/src/modules/menu/menu.controller.ts +17 -0
- package/src/modules/menu/menu.interfaces.ts +15 -0
- package/src/modules/menu/menu.module.ts +32 -0
- package/src/modules/menu/menu.service.ts +53 -0
- package/src/modules/players-manager/players-manager.module.ts +9 -0
- package/src/modules/players-manager/players-manager.service.ts +27 -0
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "jp.ms.common.modules",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"author": "",
|
|
8
|
+
"license": "ISC",
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@nestjs/common": "11.1.0",
|
|
11
|
+
"@nestjs/config": "4.0.2",
|
|
12
|
+
"@nestjs/core": "11.1.0",
|
|
13
|
+
"@nestjs/mongoose": "11.0.3",
|
|
14
|
+
"@nestjs/websockets": "11.1.9",
|
|
15
|
+
"jp.common.models": "file:../jp.common.models",
|
|
16
|
+
"jp.db.schemas": "1.0.37",
|
|
17
|
+
"jp.ms.common.engine": "file:../jp.ms.common.engine",
|
|
18
|
+
"mongoose": "8.14.1",
|
|
19
|
+
"nestjs-i18n": "10.5.1",
|
|
20
|
+
"reflect-metadata": "0.2.2",
|
|
21
|
+
"rxjs": "7.8.2",
|
|
22
|
+
"socket.io": "4.8.1"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@nestjs/swagger": "11.2.3",
|
|
26
|
+
"@types/node": "22.15.3",
|
|
27
|
+
"class-transformer": "0.5.1",
|
|
28
|
+
"class-validator": "0.14.3",
|
|
29
|
+
"rimraf": "6.0.1",
|
|
30
|
+
"typescript": "5.8.3"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "rimraf dist && tsc",
|
|
34
|
+
"prepublish": "npm run build"
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"src",
|
|
38
|
+
"dist"
|
|
39
|
+
]
|
|
40
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ConfigModule, ConfigService } from '@nestjs/config';
|
|
2
|
+
import { MongooseModuleAsyncOptions } from '@nestjs/mongoose';
|
|
3
|
+
|
|
4
|
+
export function getDatabaseConfig (module: ConfigModule, service: object): MongooseModuleAsyncOptions {
|
|
5
|
+
return {
|
|
6
|
+
imports: [module],
|
|
7
|
+
useFactory: async (configService: ConfigService) => ({
|
|
8
|
+
uri: configService.get<string>('MONGODB_URI'),
|
|
9
|
+
}),
|
|
10
|
+
inject: [service],
|
|
11
|
+
} as MongooseModuleAsyncOptions;
|
|
12
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { join } from 'path';
|
|
2
|
+
import { AcceptLanguageResolver, HeaderResolver, I18nAsyncOptions, QueryResolver } from 'nestjs-i18n';
|
|
3
|
+
import { ConfigService } from '@nestjs/config';
|
|
4
|
+
|
|
5
|
+
interface LocaleParams {
|
|
6
|
+
module: object,
|
|
7
|
+
service: object,
|
|
8
|
+
dirname: string,
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function getLocaleConfig (module: object, service: object, dirname: string) {
|
|
12
|
+
return {
|
|
13
|
+
imports: [module],
|
|
14
|
+
useFactory: async (configService: ConfigService) => {
|
|
15
|
+
return ({
|
|
16
|
+
fallbackLanguage: 'en',
|
|
17
|
+
loaderOptions: {
|
|
18
|
+
path: join(dirname, configService.get<string>('LOCALE_PATH') as string),
|
|
19
|
+
watch: true,
|
|
20
|
+
},
|
|
21
|
+
})
|
|
22
|
+
},
|
|
23
|
+
resolvers: [
|
|
24
|
+
{ use: QueryResolver, options: ['lang'] },
|
|
25
|
+
AcceptLanguageResolver,
|
|
26
|
+
{ use: HeaderResolver, options: ['x-lang'] },
|
|
27
|
+
],
|
|
28
|
+
inject: [service],
|
|
29
|
+
} as I18nAsyncOptions;
|
|
30
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { I18nService } from 'nestjs-i18n';
|
|
2
|
+
|
|
3
|
+
import { MenuModuleOptions } from '../modules/menu/menu.interfaces';
|
|
4
|
+
|
|
5
|
+
export function getMenuConfig (service: object) {
|
|
6
|
+
return {
|
|
7
|
+
useFactory: async (i18n: I18nService) => ({ i18n: i18n }),
|
|
8
|
+
inject: [service],
|
|
9
|
+
} as MenuModuleOptions;
|
|
10
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Expose, Type } from 'class-transformer';
|
|
2
|
+
import { IAppScreenAppBar } from 'jp.common.models';
|
|
3
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
4
|
+
import { IsArray, IsString, ValidateNested } from 'class-validator';
|
|
5
|
+
|
|
6
|
+
import { AppScreenSectionButtonDto } from './app-screen-section-button.dto';
|
|
7
|
+
|
|
8
|
+
export class AppScreenAppBarDto implements IAppScreenAppBar {
|
|
9
|
+
@ApiProperty({
|
|
10
|
+
description: 'title',
|
|
11
|
+
required: true,
|
|
12
|
+
type: String,
|
|
13
|
+
})
|
|
14
|
+
@Expose()
|
|
15
|
+
@IsString()
|
|
16
|
+
title: string;
|
|
17
|
+
|
|
18
|
+
@ApiProperty({
|
|
19
|
+
description: 'type',
|
|
20
|
+
required: true,
|
|
21
|
+
type: String,
|
|
22
|
+
})
|
|
23
|
+
@Expose()
|
|
24
|
+
@IsString()
|
|
25
|
+
type: string;
|
|
26
|
+
|
|
27
|
+
@IsArray()
|
|
28
|
+
@ValidateNested({ each: true })
|
|
29
|
+
@Type(() => AppScreenSectionButtonDto)
|
|
30
|
+
@Expose()
|
|
31
|
+
actions: Array<AppScreenSectionButtonDto>;
|
|
32
|
+
|
|
33
|
+
@Type(() => AppScreenSectionButtonDto)
|
|
34
|
+
@Expose()
|
|
35
|
+
leading: AppScreenSectionButtonDto;
|
|
36
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
+
import { Expose } from 'class-transformer';
|
|
3
|
+
import { IsBoolean, IsString } from 'class-validator';
|
|
4
|
+
import { IAppScreenSectionButton } from 'jp.common.models';
|
|
5
|
+
|
|
6
|
+
export class AppScreenSectionButtonDto implements IAppScreenSectionButton {
|
|
7
|
+
@ApiProperty({
|
|
8
|
+
description: 'id',
|
|
9
|
+
required: false,
|
|
10
|
+
type: String,
|
|
11
|
+
})
|
|
12
|
+
@Expose()
|
|
13
|
+
@IsString()
|
|
14
|
+
id?: string;
|
|
15
|
+
|
|
16
|
+
@ApiProperty({
|
|
17
|
+
description: 'action',
|
|
18
|
+
required: true,
|
|
19
|
+
type: String,
|
|
20
|
+
})
|
|
21
|
+
@Expose()
|
|
22
|
+
@IsString()
|
|
23
|
+
action: string;
|
|
24
|
+
|
|
25
|
+
@ApiProperty({
|
|
26
|
+
description: 'title',
|
|
27
|
+
required: true,
|
|
28
|
+
type: String,
|
|
29
|
+
})
|
|
30
|
+
@Expose()
|
|
31
|
+
@IsString()
|
|
32
|
+
title: string;
|
|
33
|
+
|
|
34
|
+
@ApiProperty({
|
|
35
|
+
description: 'url',
|
|
36
|
+
required: false,
|
|
37
|
+
type: String,
|
|
38
|
+
})
|
|
39
|
+
@Expose()
|
|
40
|
+
@IsString()
|
|
41
|
+
url?: string;
|
|
42
|
+
|
|
43
|
+
@ApiProperty({
|
|
44
|
+
description: 'title',
|
|
45
|
+
required: true,
|
|
46
|
+
type: Boolean,
|
|
47
|
+
})
|
|
48
|
+
@Expose()
|
|
49
|
+
@IsBoolean()
|
|
50
|
+
disabled: boolean;
|
|
51
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Expose, Type } from 'class-transformer';
|
|
2
|
+
import { IAppScreenSectionButtons } from 'jp.common.models';
|
|
3
|
+
|
|
4
|
+
import { AppScreenSectionButtonDto } from './app-screen-section-button.dto';
|
|
5
|
+
|
|
6
|
+
export class AppScreenSectionButtonsDto implements IAppScreenSectionButtons {
|
|
7
|
+
@Type(() => AppScreenSectionButtonDto)
|
|
8
|
+
@Expose()
|
|
9
|
+
primary: AppScreenSectionButtonDto;
|
|
10
|
+
|
|
11
|
+
@Type(() => AppScreenSectionButtonDto)
|
|
12
|
+
@Expose()
|
|
13
|
+
secondary?: AppScreenSectionButtonDto;
|
|
14
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
+
import { Expose } from 'class-transformer';
|
|
3
|
+
import { IsString } from 'class-validator';
|
|
4
|
+
import { IAppScreenSectionImage } from 'jp.common.models';
|
|
5
|
+
|
|
6
|
+
export class AppScreenSectionImageDto implements IAppScreenSectionImage {
|
|
7
|
+
@ApiProperty({
|
|
8
|
+
description: 'icon',
|
|
9
|
+
required: false,
|
|
10
|
+
type: String,
|
|
11
|
+
})
|
|
12
|
+
@Expose()
|
|
13
|
+
@IsString()
|
|
14
|
+
icon?: string;
|
|
15
|
+
|
|
16
|
+
@ApiProperty({
|
|
17
|
+
description: 'iconText',
|
|
18
|
+
required: false,
|
|
19
|
+
type: String,
|
|
20
|
+
})
|
|
21
|
+
@Expose()
|
|
22
|
+
@IsString()
|
|
23
|
+
iconText?: string;
|
|
24
|
+
|
|
25
|
+
@ApiProperty({
|
|
26
|
+
description: 'imageUrl',
|
|
27
|
+
required: false,
|
|
28
|
+
type: String,
|
|
29
|
+
})
|
|
30
|
+
@Expose()
|
|
31
|
+
@IsString()
|
|
32
|
+
imageUrl?: string;
|
|
33
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
+
import { Expose, Type } from 'class-transformer';
|
|
3
|
+
import { IsBoolean, IsString, ValidateNested } from 'class-validator';
|
|
4
|
+
import { IAppScreenSectionListItem } from 'jp.common.models';
|
|
5
|
+
|
|
6
|
+
import { AppScreenSectionImageDto } from './app-screen-section-image.dto';
|
|
7
|
+
import { AppScreenSectionButtonsDto } from './app-screen-section-buttons.dto';
|
|
8
|
+
|
|
9
|
+
export class AppScreenSectionListItemDto implements IAppScreenSectionListItem {
|
|
10
|
+
@ApiProperty({
|
|
11
|
+
description: 'id',
|
|
12
|
+
required: true,
|
|
13
|
+
type: String,
|
|
14
|
+
})
|
|
15
|
+
@Expose()
|
|
16
|
+
@IsString()
|
|
17
|
+
id: string;
|
|
18
|
+
|
|
19
|
+
@ApiProperty({
|
|
20
|
+
description: 'type',
|
|
21
|
+
required: true,
|
|
22
|
+
type: String,
|
|
23
|
+
})
|
|
24
|
+
@Expose()
|
|
25
|
+
@IsString()
|
|
26
|
+
type: string;
|
|
27
|
+
|
|
28
|
+
@ApiProperty({
|
|
29
|
+
description: 'title',
|
|
30
|
+
required: true,
|
|
31
|
+
type: String,
|
|
32
|
+
})
|
|
33
|
+
@Expose()
|
|
34
|
+
@IsString()
|
|
35
|
+
title: string;
|
|
36
|
+
|
|
37
|
+
@ApiProperty({
|
|
38
|
+
description: 'subtitle',
|
|
39
|
+
required: true,
|
|
40
|
+
type: String,
|
|
41
|
+
})
|
|
42
|
+
@Expose()
|
|
43
|
+
@IsString()
|
|
44
|
+
subtitle: string;
|
|
45
|
+
|
|
46
|
+
@ApiProperty({
|
|
47
|
+
description: 'buttonId',
|
|
48
|
+
required: true,
|
|
49
|
+
type: String,
|
|
50
|
+
})
|
|
51
|
+
@Expose()
|
|
52
|
+
@IsString()
|
|
53
|
+
buttonId: string;
|
|
54
|
+
|
|
55
|
+
@ApiProperty({
|
|
56
|
+
description: 'url',
|
|
57
|
+
required: false,
|
|
58
|
+
type: String,
|
|
59
|
+
})
|
|
60
|
+
@Expose()
|
|
61
|
+
@IsString()
|
|
62
|
+
url?: string;
|
|
63
|
+
|
|
64
|
+
@ApiProperty({
|
|
65
|
+
description: 'active',
|
|
66
|
+
required: false,
|
|
67
|
+
type: Boolean,
|
|
68
|
+
})
|
|
69
|
+
@Expose()
|
|
70
|
+
@IsBoolean()
|
|
71
|
+
active: boolean;
|
|
72
|
+
|
|
73
|
+
@ApiProperty({
|
|
74
|
+
description: 'hasChevron',
|
|
75
|
+
required: false,
|
|
76
|
+
type: Boolean,
|
|
77
|
+
})
|
|
78
|
+
@Expose()
|
|
79
|
+
@IsBoolean()
|
|
80
|
+
hasChevron: boolean;
|
|
81
|
+
|
|
82
|
+
@ValidateNested()
|
|
83
|
+
@Type(() => AppScreenSectionImageDto)
|
|
84
|
+
@Expose()
|
|
85
|
+
image?: AppScreenSectionImageDto;
|
|
86
|
+
|
|
87
|
+
@ValidateNested()
|
|
88
|
+
@Type(() => AppScreenSectionImageDto)
|
|
89
|
+
@Expose()
|
|
90
|
+
extendedImage?: AppScreenSectionImageDto;
|
|
91
|
+
|
|
92
|
+
@ValidateNested()
|
|
93
|
+
@Type(() => AppScreenSectionButtonsDto)
|
|
94
|
+
@Expose()
|
|
95
|
+
extendedButtons: AppScreenSectionButtonsDto;
|
|
96
|
+
|
|
97
|
+
@ApiProperty({
|
|
98
|
+
description: 'extendedDescription',
|
|
99
|
+
required: false,
|
|
100
|
+
type: String,
|
|
101
|
+
})
|
|
102
|
+
@Expose()
|
|
103
|
+
@IsString()
|
|
104
|
+
extendedDescription?: string;
|
|
105
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
+
import { Expose } from 'class-transformer';
|
|
3
|
+
import { IsString } from 'class-validator';
|
|
4
|
+
import { IAppScreenSectionReq } from 'jp.common.models';
|
|
5
|
+
|
|
6
|
+
export class AppScreenSectionReqDto implements IAppScreenSectionReq {
|
|
7
|
+
@ApiProperty({
|
|
8
|
+
description: 'id',
|
|
9
|
+
required: true,
|
|
10
|
+
type: String,
|
|
11
|
+
})
|
|
12
|
+
@Expose()
|
|
13
|
+
@IsString()
|
|
14
|
+
id: string;
|
|
15
|
+
|
|
16
|
+
@ApiProperty({
|
|
17
|
+
description: 'label',
|
|
18
|
+
required: true,
|
|
19
|
+
type: String,
|
|
20
|
+
})
|
|
21
|
+
@Expose()
|
|
22
|
+
@IsString()
|
|
23
|
+
label: string;
|
|
24
|
+
|
|
25
|
+
@ApiProperty({
|
|
26
|
+
description: 'value',
|
|
27
|
+
required: true,
|
|
28
|
+
type: String,
|
|
29
|
+
})
|
|
30
|
+
@Expose()
|
|
31
|
+
@IsString()
|
|
32
|
+
value: string;
|
|
33
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
+
import { Expose, Type } from 'class-transformer';
|
|
3
|
+
import { IsArray, IsString, ValidateNested } from 'class-validator';
|
|
4
|
+
import { IAppScreenSection } from 'jp.common.models';
|
|
5
|
+
|
|
6
|
+
import { AppScreenSectionButtonsDto } from './app-screen-section-buttons.dto';
|
|
7
|
+
import { AppScreenSectionListItemDto } from './app-screen-section-list-item.dto';
|
|
8
|
+
import { AppScreenSectionReqDto } from './app-screen-section-req.dto';
|
|
9
|
+
import { AppScreenSectionImageDto } from './app-screen-section-image.dto';
|
|
10
|
+
|
|
11
|
+
export class AppScreenSectionDto implements IAppScreenSection {
|
|
12
|
+
@ApiProperty({
|
|
13
|
+
description: 'id',
|
|
14
|
+
required: true,
|
|
15
|
+
type: String,
|
|
16
|
+
})
|
|
17
|
+
@Expose()
|
|
18
|
+
@IsString()
|
|
19
|
+
id: string;
|
|
20
|
+
|
|
21
|
+
@ApiProperty({
|
|
22
|
+
description: 'type',
|
|
23
|
+
required: true,
|
|
24
|
+
type: String,
|
|
25
|
+
})
|
|
26
|
+
@Expose()
|
|
27
|
+
@IsString()
|
|
28
|
+
type: string;
|
|
29
|
+
|
|
30
|
+
@ApiProperty({
|
|
31
|
+
description: 'text',
|
|
32
|
+
required: false,
|
|
33
|
+
type: String,
|
|
34
|
+
})
|
|
35
|
+
@Expose()
|
|
36
|
+
@IsString()
|
|
37
|
+
text?: string;
|
|
38
|
+
|
|
39
|
+
@ApiProperty({
|
|
40
|
+
description: 'value',
|
|
41
|
+
required: false,
|
|
42
|
+
type: String,
|
|
43
|
+
})
|
|
44
|
+
@Expose()
|
|
45
|
+
@IsString()
|
|
46
|
+
value?: string;
|
|
47
|
+
|
|
48
|
+
@ApiProperty({
|
|
49
|
+
description: 'description',
|
|
50
|
+
required: false,
|
|
51
|
+
type: String,
|
|
52
|
+
})
|
|
53
|
+
@Expose()
|
|
54
|
+
@IsString()
|
|
55
|
+
description?: string;
|
|
56
|
+
|
|
57
|
+
@Type(() => AppScreenSectionButtonsDto)
|
|
58
|
+
@Expose()
|
|
59
|
+
buttons?: AppScreenSectionButtonsDto;
|
|
60
|
+
|
|
61
|
+
@Type(() => AppScreenSectionImageDto)
|
|
62
|
+
@Expose()
|
|
63
|
+
image?: AppScreenSectionImageDto;
|
|
64
|
+
|
|
65
|
+
@IsArray()
|
|
66
|
+
@ValidateNested({ each: true })
|
|
67
|
+
@Type(() => AppScreenSectionListItemDto)
|
|
68
|
+
@Expose()
|
|
69
|
+
list: Array<AppScreenSectionListItemDto>;
|
|
70
|
+
|
|
71
|
+
@IsArray()
|
|
72
|
+
@ValidateNested({ each: true })
|
|
73
|
+
@Type(() => AppScreenSectionReqDto)
|
|
74
|
+
@Expose()
|
|
75
|
+
reqs: Array<AppScreenSectionReqDto>;
|
|
76
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
+
import { Expose, Type } from 'class-transformer';
|
|
3
|
+
import { IsArray, IsString, ValidateNested } from 'class-validator';
|
|
4
|
+
import { IAppScreen } from 'jp.common.models';
|
|
5
|
+
|
|
6
|
+
import { AppScreenSectionDto } from './app-screen-section.dto';
|
|
7
|
+
import { AppScreenAppBarDto } from './app-screen-app-bar.dto';
|
|
8
|
+
|
|
9
|
+
export class AppScreenDto implements IAppScreen {
|
|
10
|
+
@ApiProperty({
|
|
11
|
+
description: 'ID',
|
|
12
|
+
required: true,
|
|
13
|
+
type: String,
|
|
14
|
+
})
|
|
15
|
+
@Expose()
|
|
16
|
+
@IsString()
|
|
17
|
+
id: string;
|
|
18
|
+
|
|
19
|
+
@ApiProperty({
|
|
20
|
+
description: 'type',
|
|
21
|
+
required: true,
|
|
22
|
+
type: String,
|
|
23
|
+
})
|
|
24
|
+
@Expose()
|
|
25
|
+
@IsString()
|
|
26
|
+
type: string;
|
|
27
|
+
|
|
28
|
+
@IsArray()
|
|
29
|
+
@ValidateNested({ each: true })
|
|
30
|
+
@Type(() => AppScreenSectionDto)
|
|
31
|
+
@Expose()
|
|
32
|
+
sections: Array<AppScreenSectionDto>;
|
|
33
|
+
|
|
34
|
+
@Type(() => AppScreenAppBarDto)
|
|
35
|
+
@Expose()
|
|
36
|
+
appBar?: AppScreenAppBarDto;
|
|
37
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Expose, plainToInstance, Type } from 'class-transformer';
|
|
2
|
+
import { IBaseAppScreen } from 'jp.common.models';
|
|
3
|
+
|
|
4
|
+
import { AppScreenDto } from './app-screen.dto';
|
|
5
|
+
|
|
6
|
+
export class BaseAppScreenDto implements IBaseAppScreen {
|
|
7
|
+
@Type(() => AppScreenDto)
|
|
8
|
+
@Expose()
|
|
9
|
+
screen: AppScreenDto;
|
|
10
|
+
|
|
11
|
+
constructor(screen: IBaseAppScreen) {
|
|
12
|
+
return plainToInstance(BaseAppScreenDto, screen, { excludeExtraneousValues: true });
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { BaseAppScreenDto } from './base-app-screen.dto';
|
|
2
|
+
export { AppScreenDto } from './app-screen.dto';
|
|
3
|
+
export { AppScreenAppBarDto } from './app-screen-app-bar.dto';
|
|
4
|
+
export { AppScreenSectionDto } from './app-screen-section.dto';
|
|
5
|
+
export { AppScreenSectionButtonDto } from './app-screen-section-button.dto';
|
|
6
|
+
export { AppScreenSectionButtonsDto } from './app-screen-section-buttons.dto';
|
|
7
|
+
export { AppScreenSectionImageDto } from './app-screen-section-image.dto';
|
|
8
|
+
export { AppScreenSectionListItemDto } from './app-screen-section-list-item.dto';
|
|
9
|
+
export { AppScreenSectionReqDto } from './app-screen-section-req.dto';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
+
import { Expose } from 'class-transformer';
|
|
3
|
+
import { IsString } from 'class-validator';
|
|
4
|
+
|
|
5
|
+
import { IBaseTableGameStateSummaryItem } from 'jp.common.models';
|
|
6
|
+
|
|
7
|
+
export class BaseTableSummaryItemDto implements IBaseTableGameStateSummaryItem {
|
|
8
|
+
@ApiProperty({
|
|
9
|
+
description: 'id',
|
|
10
|
+
required: true,
|
|
11
|
+
type: String,
|
|
12
|
+
})
|
|
13
|
+
@Expose()
|
|
14
|
+
@IsString()
|
|
15
|
+
id: string;
|
|
16
|
+
|
|
17
|
+
@ApiProperty({
|
|
18
|
+
description: 'label',
|
|
19
|
+
required: true,
|
|
20
|
+
type: String,
|
|
21
|
+
})
|
|
22
|
+
@Expose()
|
|
23
|
+
@IsString()
|
|
24
|
+
label: string;
|
|
25
|
+
|
|
26
|
+
@ApiProperty({
|
|
27
|
+
description: 'size',
|
|
28
|
+
required: true,
|
|
29
|
+
type: String,
|
|
30
|
+
})
|
|
31
|
+
@Expose()
|
|
32
|
+
@IsString()
|
|
33
|
+
size: string;
|
|
34
|
+
|
|
35
|
+
@ApiProperty({
|
|
36
|
+
description: 'type',
|
|
37
|
+
required: true,
|
|
38
|
+
type: String,
|
|
39
|
+
})
|
|
40
|
+
@Expose()
|
|
41
|
+
@IsString()
|
|
42
|
+
type: string;
|
|
43
|
+
|
|
44
|
+
@ApiProperty({
|
|
45
|
+
description: 'value',
|
|
46
|
+
required: true,
|
|
47
|
+
type: String,
|
|
48
|
+
})
|
|
49
|
+
@Expose()
|
|
50
|
+
@IsString()
|
|
51
|
+
value: string;
|
|
52
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Expose, Type } from 'class-transformer';
|
|
2
|
+
import { IsArray, ValidateNested } from 'class-validator';
|
|
3
|
+
import { IBaseTableGameStateSummary } from 'jp.common.models';
|
|
4
|
+
|
|
5
|
+
import { BaseTableSummaryItemDto } from './base-table-summary-item.dto';
|
|
6
|
+
|
|
7
|
+
export class BaseTableSummaryDto implements IBaseTableGameStateSummary {
|
|
8
|
+
@IsArray()
|
|
9
|
+
@ValidateNested({ each: true })
|
|
10
|
+
@Type(() => BaseTableSummaryItemDto)
|
|
11
|
+
@Expose()
|
|
12
|
+
list: Array<BaseTableSummaryItemDto>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
+
import { Expose } from 'class-transformer';
|
|
3
|
+
import { IsString } from 'class-validator';
|
|
4
|
+
|
|
5
|
+
import { IBaseTableGameStateYoursActionItem } from 'jp.common.models';
|
|
6
|
+
|
|
7
|
+
export class BaseTableYoursActionDto implements IBaseTableGameStateYoursActionItem {
|
|
8
|
+
@ApiProperty({
|
|
9
|
+
description: 'ID',
|
|
10
|
+
required: true,
|
|
11
|
+
type: String,
|
|
12
|
+
})
|
|
13
|
+
@Expose()
|
|
14
|
+
@IsString()
|
|
15
|
+
id: string;
|
|
16
|
+
|
|
17
|
+
@ApiProperty({
|
|
18
|
+
description: 'Title',
|
|
19
|
+
required: true,
|
|
20
|
+
type: String,
|
|
21
|
+
})
|
|
22
|
+
@Expose()
|
|
23
|
+
@IsString()
|
|
24
|
+
title: string;
|
|
25
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
+
import { Expose } from 'class-transformer';
|
|
3
|
+
import { IsString, IsNumber, IsBoolean } from 'class-validator';
|
|
4
|
+
|
|
5
|
+
import { IBaseTableGameStateCard } from 'jp.common.models';
|
|
6
|
+
|
|
7
|
+
export class CardDto implements IBaseTableGameStateCard {
|
|
8
|
+
@ApiProperty({
|
|
9
|
+
description: 'card ID',
|
|
10
|
+
required: true,
|
|
11
|
+
type: Number,
|
|
12
|
+
})
|
|
13
|
+
@Expose()
|
|
14
|
+
@IsNumber()
|
|
15
|
+
id: number;
|
|
16
|
+
|
|
17
|
+
@ApiProperty({
|
|
18
|
+
description: 'rank',
|
|
19
|
+
required: true,
|
|
20
|
+
type: Number,
|
|
21
|
+
})
|
|
22
|
+
@Expose()
|
|
23
|
+
@IsNumber()
|
|
24
|
+
rank: number;
|
|
25
|
+
|
|
26
|
+
@ApiProperty({
|
|
27
|
+
description: 'suit',
|
|
28
|
+
required: true,
|
|
29
|
+
type: String,
|
|
30
|
+
})
|
|
31
|
+
@Expose()
|
|
32
|
+
@IsString()
|
|
33
|
+
suit: string;
|
|
34
|
+
|
|
35
|
+
@ApiProperty({
|
|
36
|
+
description: 'disabled',
|
|
37
|
+
required: true,
|
|
38
|
+
type: Boolean,
|
|
39
|
+
})
|
|
40
|
+
@Expose()
|
|
41
|
+
@IsBoolean()
|
|
42
|
+
isDisable: boolean;
|
|
43
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { BaseTableYoursActionDto } from './base-table-yours-action.dto';
|
|
2
|
+
export { BaseTableSummaryItemDto } from './base-table-summary-item.dto';
|
|
3
|
+
export { BaseTableSummaryDto } from './base-table-summary.dto';
|
|
4
|
+
export { CardDto } from './card.dto';
|
|
5
|
+
export { PlayerCheckStateDto } from './player-check-state.dto';
|