adamo-types 1.0.22 → 1.0.26

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.
@@ -1,14 +1,54 @@
1
- interface Users {
1
+ import { IsString, IsArray, IsNotEmpty, IsBoolean, ValidateNested } from 'class-validator'
2
+ import { Type } from 'class-transformer'
3
+
4
+ export class Users {
5
+ @IsNotEmpty()
6
+ @IsString()
2
7
  name: string
8
+
9
+ @IsNotEmpty()
10
+ @IsString()
3
11
  email: string
12
+
13
+ @IsNotEmpty()
14
+ @IsString()
4
15
  language: string
16
+
17
+ @IsNotEmpty()
18
+ @IsString()
5
19
  givenName: string
20
+
21
+ @IsNotEmpty()
22
+ @IsString()
6
23
  familyName: string
24
+
25
+ @IsNotEmpty()
26
+ @IsString()
7
27
  workGroupName: string
28
+
29
+ @IsNotEmpty()
30
+ @IsString()
8
31
  password: string
32
+
33
+ @IsNotEmpty()
34
+ @IsString()
9
35
  role: string
36
+
37
+ @IsArray()
38
+ @ValidateNested({ each: true })
10
39
  channel: string[]
40
+
41
+ @IsNotEmpty()
42
+ @IsBoolean()
11
43
  salesman: boolean
12
44
  }
13
45
 
14
- export type UserCreationDTO = Users[]
46
+ export class UserCreationDTO {
47
+ @IsString()
48
+ ticket: string
49
+
50
+ @IsArray()
51
+ @ValidateNested({ each: true })
52
+ @Type(() => Users)
53
+ users: Users[]
54
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adamo-types",
3
- "version": "1.0.22",
3
+ "version": "1.0.26",
4
4
  "description": "A types library for api communication agreement",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -10,6 +10,8 @@
10
10
  "homepage": "https://bitbucket.org/adamodev/adamo-types",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
+ "class-transformer": "^0.4.0",
14
+ "class-validator": "^0.13.1",
13
15
  "typescript": "^4.4.3"
14
16
  }
15
17
  }