adamo-types 1.0.17 → 1.0.21

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/README.md CHANGED
@@ -25,6 +25,28 @@ Describes web specific interfaces
25
25
  ### Summary
26
26
  Describes admind specific interfaces
27
27
 
28
+ #### User Creation within SYS03/Infonova
29
+
30
+ **Creation Request**
31
+ ```typescript
32
+ interface UserCreationDTO {
33
+ name: string
34
+ email: string
35
+ language: string
36
+ givenName: string
37
+ familyName: string
38
+ workGroupName: string
39
+ password: string
40
+ role: string
41
+ channel: string[]
42
+ salesman: boolean
43
+ }
44
+ ```
45
+
46
+ **Creation Response**
47
+ ```json
48
+ ```
49
+
28
50
  ## Common
29
51
  ### Summary
30
52
  Describes common interfaces between the various tenents
@@ -33,7 +55,7 @@ Describes common interfaces between the various tenents
33
55
  ### Login
34
56
  **login request**
35
57
  ```typescript
36
- export interface LoginRequest {
58
+ export interface UserLoginDTO {
37
59
  username: string
38
60
  password: string
39
61
  }
@@ -41,19 +63,25 @@ export interface LoginRequest {
41
63
 
42
64
  **login response**
43
65
  ```typescript
44
- export interface LoginResponse {
66
+ export interface UserLoginAccessToken {
45
67
  username: string
46
- channels: string[]
47
- role: string
68
+ access_token: string
48
69
  }
49
70
  ```
50
71
 
72
+ `access_token` - is a JWT consisting of metadata related to the user that signed in:
73
+ - channels
74
+ - roles
75
+ - tenentPermissions
76
+ - iat
77
+ each `access_token` is valid (currently) for 24 hours
78
+
51
79
  **example**
52
80
  ```typescript
53
81
  try {
54
82
  import { LoginRequest, LoginResponse } from 'adamo-types/common/login'
55
83
 
56
- const data: LoginRequest = {
84
+ const data: UserLoginDTO = {
57
85
  username: 'username',
58
86
  password: 'password'
59
87
  }
@@ -63,8 +91,7 @@ try {
63
91
  data
64
92
  })
65
93
 
66
- const loginResponse: LoginResponse = response.data
67
-
94
+ const loginResponse: UserLoginDTO = response.data
68
95
  } catch(e: unknown) {
69
96
  // do something incase of error
70
97
  }
File without changes
File without changes
@@ -0,0 +1,14 @@
1
+ interface Users {
2
+ name: string
3
+ email: string
4
+ language: string
5
+ givenName: string
6
+ familyName: string
7
+ workGroupName: string
8
+ password: string
9
+ role: string
10
+ channel: string[]
11
+ salesman: boolean
12
+ }
13
+
14
+ export type UserCreationDTO = Users[]
File without changes
package/bss/index.ts ADDED
File without changes
@@ -1,3 +1,3 @@
1
- export * from './interface/request/login.request.interface'
2
- export * from './interface/response/login.response.interface'
1
+ export * from './request/login.request.interface'
2
+ export * from './response/login.response.interface'
3
3
 
@@ -2,6 +2,12 @@ export interface UserLoginPayload {
2
2
  username: string
3
3
  channels: string[]
4
4
  roles: string[]
5
+ tenentPermissions: string[]
6
+ }
7
+
8
+ export interface UserLoginAccessToken {
9
+ username: string
10
+ access_token: string
5
11
  }
6
12
 
7
13
  export interface AclUserRolesPayload {
@@ -0,0 +1,8 @@
1
+ export interface UserJWT {
2
+ username: string
3
+ channels: string[]
4
+ tenentPermissions: string[]
5
+ roles: string[]
6
+ iat: number
7
+ }
8
+
@@ -0,0 +1,12 @@
1
+ export interface UserSessionRequest {
2
+ username: string
3
+ password: string
4
+ }
5
+
6
+ export interface DecodedJWTUser {
7
+ username: string
8
+ channels: string[]
9
+ tenentPermissions: string[]
10
+ roles: string[]
11
+ iat: number
12
+ }
@@ -0,0 +1,2 @@
1
+ export * from './data/user.data'
2
+ export * from './auth/user.auth'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adamo-types",
3
- "version": "1.0.17",
3
+ "version": "1.0.21",
4
4
  "description": "A types library for api communication agreement",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -0,0 +1,2 @@
1
+ // export * from './request/web.order.request'
2
+ // export * from './response/web.order.response'
File without changes
File without changes