@alacard-project/shared 1.1.0 → 1.1.2
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/dto/index.d.ts +1 -0
- package/dist/dto/index.js +1 -0
- package/dist/dto/index.js.map +1 -1
- package/dist/dto/invoice.dto.d.ts +12 -0
- package/dist/dto/invoice.dto.js +62 -0
- package/dist/dto/invoice.dto.js.map +1 -0
- package/dist/enums/auth.enum.d.ts +2 -3
- package/dist/enums/auth.enum.js +2 -3
- package/dist/enums/auth.enum.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/dist/resilience/circuit-breaker.service.d.ts +2 -3
- package/dist/resilience/circuit-breaker.service.js +9 -15
- package/dist/resilience/circuit-breaker.service.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/{filters/http-exception.filter.js → utils/filters.js} +3 -12
- package/dist/utils/filters.js.map +1 -0
- package/dist/{interceptors/transform.interceptor.d.ts → utils/interceptors.d.ts} +0 -1
- package/dist/{interceptors/transform.interceptor.js → utils/interceptors.js} +3 -3
- package/dist/utils/interceptors.js.map +1 -0
- package/dist/utils/tracing.utils.js +7 -0
- package/dist/utils/tracing.utils.js.map +1 -0
- package/package.json +24 -26
- package/dist/config/base-config.service.d.ts +0 -25
- package/dist/config/base-config.service.js +0 -87
- package/dist/config/base-config.service.js.map +0 -1
- package/dist/constants/logging.constants.d.ts +0 -24
- package/dist/constants/logging.constants.js +0 -28
- package/dist/constants/logging.constants.js.map +0 -1
- package/dist/constants/monitoring.constants.d.ts +0 -51
- package/dist/constants/monitoring.constants.js +0 -55
- package/dist/constants/monitoring.constants.js.map +0 -1
- package/dist/constants/tokens.constants.d.ts +0 -6
- package/dist/constants/tokens.constants.js +0 -10
- package/dist/constants/tokens.constants.js.map +0 -1
- package/dist/filters/http-exception.filter.js.map +0 -1
- package/dist/filters/index.d.ts +0 -1
- package/dist/filters/index.js +0 -18
- package/dist/filters/index.js.map +0 -1
- package/dist/interceptors/http-logging.interceptor.d.ts +0 -10
- package/dist/interceptors/http-logging.interceptor.js +0 -74
- package/dist/interceptors/http-logging.interceptor.js.map +0 -1
- package/dist/interceptors/index.d.ts +0 -2
- package/dist/interceptors/index.js +0 -19
- package/dist/interceptors/index.js.map +0 -1
- package/dist/interceptors/logging.interceptor.d.ts +0 -6
- package/dist/interceptors/logging.interceptor.js +0 -41
- package/dist/interceptors/logging.interceptor.js.map +0 -1
- package/dist/interceptors/transform.interceptor.js.map +0 -1
- package/dist/observability/index.d.ts +0 -2
- package/dist/observability/index.js +0 -19
- package/dist/observability/index.js.map +0 -1
- package/dist/observability/metrics/metrics.module.d.ts +0 -2
- package/dist/observability/metrics/metrics.module.js +0 -28
- package/dist/observability/metrics/metrics.module.js.map +0 -1
- package/dist/observability/tracing.js +0 -28
- package/dist/observability/tracing.js.map +0 -1
- package/dist/utils/logging-client.d.ts +0 -9
- package/dist/utils/logging-client.js +0 -58
- package/dist/utils/logging-client.js.map +0 -1
- package/dist/utils/prometheus.utils.d.ts +0 -9
- package/dist/utils/prometheus.utils.js +0 -66
- package/dist/utils/prometheus.utils.js.map +0 -1
- package/proto/auth.proto +0 -123
- package/proto/card.proto +0 -43
- package/proto/client.proto +0 -45
- package/proto/config.proto +0 -39
- package/proto/dbf.proto +0 -183
- package/proto/logging.proto +0 -143
- package/proto/partner.proto +0 -18
- package/proto/terminal.proto +0 -18
- package/proto/transaction.proto +0 -45
- package/proto/user.proto +0 -122
- package/src/constants/auth-config.constants.ts +0 -16
- package/src/constants/auth.constants.ts +0 -50
- package/src/constants/common.constants.ts +0 -16
- package/src/constants/env.constants.ts +0 -49
- package/src/constants/error-messages.ts +0 -10
- package/src/constants/grpc.constants.ts +0 -43
- package/src/constants/http.constants.ts +0 -11
- package/src/constants/index.ts +0 -11
- package/src/constants/logging-messages.constants.ts +0 -60
- package/src/constants/microservices.constants.ts +0 -62
- package/src/constants/queue.constants.ts +0 -8
- package/src/constants/routes.constants.ts +0 -21
- package/src/contracts/auth.contract.ts +0 -146
- package/src/contracts/config.contract.ts +0 -14
- package/src/contracts/index.ts +0 -14
- package/src/contracts/logging.contract.ts +0 -115
- package/src/contracts/token.contract.ts +0 -47
- package/src/decorators/index.ts +0 -3
- package/src/decorators/permissions.decorator.ts +0 -5
- package/src/decorators/roles.decorator.ts +0 -5
- package/src/decorators/scopes.decorator.ts +0 -4
- package/src/dto/account.dto.ts +0 -28
- package/src/dto/auth.dto.ts +0 -233
- package/src/dto/card.dto.ts +0 -64
- package/src/dto/client.dto.ts +0 -137
- package/src/dto/index.ts +0 -8
- package/src/dto/logging.dto.ts +0 -101
- package/src/dto/partner.dto.ts +0 -18
- package/src/dto/transaction.dto.ts +0 -52
- package/src/dto/user.dto.ts +0 -28
- package/src/enums/auth.enum.ts +0 -13
- package/src/enums/env.enum.ts +0 -7
- package/src/enums/error.enum.ts +0 -28
- package/src/enums/events.enum.ts +0 -22
- package/src/enums/health.enum.ts +0 -7
- package/src/enums/iam.enum.ts +0 -28
- package/src/enums/index.ts +0 -10
- package/src/enums/logging.enum.ts +0 -7
- package/src/enums/notification.enum.ts +0 -5
- package/src/enums/permission.enum.ts +0 -31
- package/src/enums/user.enum.ts +0 -27
- package/src/errors/app.error.ts +0 -33
- package/src/errors/error-map.ts +0 -105
- package/src/filters/http-exception.filter.ts +0 -49
- package/src/filters/index.ts +0 -2
- package/src/index.ts +0 -17
- package/src/interceptors/index.ts +0 -3
- package/src/interceptors/logging.interceptor.ts +0 -37
- package/src/interceptors/transform.interceptor.ts +0 -21
- package/src/observability/index.ts +0 -3
- package/src/observability/metrics/metrics.module.ts +0 -16
- package/src/observability/tracing.ts +0 -33
- package/src/resilience/circuit-breaker.service.ts +0 -46
- package/src/resilience/resilience.module.ts +0 -9
- package/src/types/auth.types.ts +0 -38
- package/src/types/common.types.ts +0 -18
- package/src/types/config.types.ts +0 -32
- package/src/types/iam.types.ts +0 -78
- package/src/types/index.ts +0 -6
- package/src/types/monitoring.types.ts +0 -77
- package/src/types/user.types.ts +0 -11
- package/src/utils/app.utils.ts +0 -52
- package/src/utils/health.utils.ts +0 -24
- package/src/utils/proto-path.ts +0 -21
- package/src/utils/user.utils.ts +0 -3
- package/tsconfig.json +0 -28
- /package/dist/{filters/http-exception.filter.d.ts → utils/filters.d.ts} +0 -0
- /package/dist/{observability/tracing.d.ts → utils/tracing.utils.d.ts} +0 -0
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export const ROUTES = {
|
|
2
|
-
AUTH: {
|
|
3
|
-
BASE: 'auth',
|
|
4
|
-
LOGIN: 'login',
|
|
5
|
-
LOGOUT: 'logout',
|
|
6
|
-
REGISTER: 'register',
|
|
7
|
-
PROFILE: 'profile',
|
|
8
|
-
REFRESH: 'refresh',
|
|
9
|
-
INVITE: 'invite',
|
|
10
|
-
INVITATIONS: 'invitations',
|
|
11
|
-
REGISTER_BY_INVITE: 'register-by-invite',
|
|
12
|
-
},
|
|
13
|
-
USER: {
|
|
14
|
-
BASE: 'users',
|
|
15
|
-
},
|
|
16
|
-
} as const;
|
|
17
|
-
|
|
18
|
-
export const AUTH_ROUTES = {
|
|
19
|
-
PASSWORD_RESET_REQUEST: 'password-reset/request',
|
|
20
|
-
PASSWORD_RESET_CONFIRM: 'password-reset/confirm',
|
|
21
|
-
};
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { RegisterDto, LoginDto, UserResponse } from '../dto/auth.dto';
|
|
3
|
-
import { JwtTokens } from '../types/auth.types';
|
|
4
|
-
import { GenerateTokensRequest } from './token.contract';
|
|
5
|
-
import { UserRole } from '../enums';
|
|
6
|
-
|
|
7
|
-
export interface GetUserByIdGrpcRequest {
|
|
8
|
-
userId: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface GetUserByIdGrpcResponse {
|
|
12
|
-
user: UserResponse;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface GetUserByEmailGrpcRequest {
|
|
16
|
-
email: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface GetUserByEmailGrpcResponse {
|
|
20
|
-
user: UserResponse;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface ValidateTokenGrpcRequest {
|
|
24
|
-
token: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface ValidateTokenGrpcResponse {
|
|
28
|
-
valid: boolean;
|
|
29
|
-
user?: UserResponse;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface RefreshTokenGrpcRequest {
|
|
33
|
-
refreshToken: string;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface RevokeTokenGrpcRequest {
|
|
37
|
-
refreshToken: string;
|
|
38
|
-
userId: string;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface RevokeTokenGrpcResponse {
|
|
42
|
-
success: boolean;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export interface CheckPermissionGrpcRequest {
|
|
46
|
-
userId: string;
|
|
47
|
-
resource: string;
|
|
48
|
-
action: string;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface CheckPermissionGrpcResponse {
|
|
52
|
-
hasPermission: boolean;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface GetUserPermissionsGrpcRequest {
|
|
56
|
-
userId: string;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export interface CreateIdentityRequest {
|
|
60
|
-
email: string;
|
|
61
|
-
password: string;
|
|
62
|
-
name?: string;
|
|
63
|
-
userId: string;
|
|
64
|
-
role: UserRole;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export interface GetUserPermissionsGrpcResponse {
|
|
68
|
-
userId: string;
|
|
69
|
-
permissions: Array<{ resource: string; action: string }>;
|
|
70
|
-
scopes: string[];
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export interface CreateUserRequest {
|
|
74
|
-
userId?: string;
|
|
75
|
-
email: string;
|
|
76
|
-
role: UserRole;
|
|
77
|
-
password?: string;
|
|
78
|
-
|
|
79
|
-
// Employee Fields
|
|
80
|
-
firstName?: string;
|
|
81
|
-
lastName?: string;
|
|
82
|
-
middleName?: string;
|
|
83
|
-
position?: string;
|
|
84
|
-
department?: string;
|
|
85
|
-
|
|
86
|
-
// Client Fields
|
|
87
|
-
companyName?: string;
|
|
88
|
-
taxId?: string;
|
|
89
|
-
contactPhone?: string;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export interface UpdateUserRequest {
|
|
93
|
-
userId: string;
|
|
94
|
-
email?: string;
|
|
95
|
-
role?: UserRole;
|
|
96
|
-
password?: string;
|
|
97
|
-
isActive?: boolean;
|
|
98
|
-
|
|
99
|
-
// Employee Fields
|
|
100
|
-
firstName?: string;
|
|
101
|
-
lastName?: string;
|
|
102
|
-
middleName?: string;
|
|
103
|
-
position?: string;
|
|
104
|
-
department?: string;
|
|
105
|
-
|
|
106
|
-
// Client Fields
|
|
107
|
-
companyName?: string;
|
|
108
|
-
taxId?: string;
|
|
109
|
-
contactPhone?: string;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export interface UpdateProfileRequest {
|
|
113
|
-
userId: string;
|
|
114
|
-
firstName?: string;
|
|
115
|
-
lastName?: string;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
export interface DeleteUserRequest {
|
|
119
|
-
userId: string;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export interface PermissionsResponse {
|
|
123
|
-
userId: string;
|
|
124
|
-
permissions: Array<{ id?: string; resource: string; action: string }>;
|
|
125
|
-
scopes: string[];
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// Aliases for backward compatibility or cleaner naming
|
|
129
|
-
export type GetUserByIdRequest = GetUserByIdGrpcRequest;
|
|
130
|
-
export type GetUserByEmailRequest = GetUserByEmailGrpcRequest;
|
|
131
|
-
export type GetUserPermissionsRequest = GetUserPermissionsGrpcRequest;
|
|
132
|
-
export type DeleteUserResponse = { success: boolean };
|
|
133
|
-
|
|
134
|
-
export interface IAuthService {
|
|
135
|
-
login(data: LoginDto): Observable<JwtTokens>;
|
|
136
|
-
generateTokens(data: GenerateTokensRequest): Observable<JwtTokens>;
|
|
137
|
-
createIdentity(data: CreateIdentityRequest): Observable<{ identityId: string }>;
|
|
138
|
-
validate(data: { token: string }): Observable<{ valid: boolean; userId?: string; email?: string; role?: UserRole }>;
|
|
139
|
-
validateToken(data: ValidateTokenGrpcRequest): Observable<ValidateTokenGrpcResponse>;
|
|
140
|
-
refreshToken(data: RefreshTokenGrpcRequest): Observable<JwtTokens>;
|
|
141
|
-
revokeToken(data: RevokeTokenGrpcRequest): Observable<RevokeTokenGrpcResponse>;
|
|
142
|
-
checkPermission(data: CheckPermissionGrpcRequest): Observable<CheckPermissionGrpcResponse>;
|
|
143
|
-
getUserPermissions(data: GetUserPermissionsGrpcRequest): Observable<GetUserPermissionsGrpcResponse>;
|
|
144
|
-
getUserById(data: GetUserByIdGrpcRequest): Observable<GetUserByIdGrpcResponse>;
|
|
145
|
-
getUserByEmail(data: GetUserByEmailGrpcRequest): Observable<GetUserByEmailGrpcResponse>;
|
|
146
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface GetConfigRequest {
|
|
2
|
-
serviceName: string;
|
|
3
|
-
environment: string;
|
|
4
|
-
version: string;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export interface ConfigResponse {
|
|
8
|
-
values: Record<string, string>;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface ListConfigsResponse {
|
|
12
|
-
service: string;
|
|
13
|
-
values: Record<string, string>;
|
|
14
|
-
}
|
package/src/contracts/index.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export * from './config.contract';
|
|
2
|
-
export * from './logging.contract';
|
|
3
|
-
export * from './auth.contract';
|
|
4
|
-
// export * from './token.contract';
|
|
5
|
-
export type {
|
|
6
|
-
GenerateTokensRequest,
|
|
7
|
-
TokensResponse,
|
|
8
|
-
ITokenService,
|
|
9
|
-
ValidateTokenRequest,
|
|
10
|
-
ValidateTokenResponse,
|
|
11
|
-
RefreshTokensRequest,
|
|
12
|
-
RevokeTokenRequest,
|
|
13
|
-
RevokeTokenResponse
|
|
14
|
-
} from './token.contract';
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
export interface LogEventGrpcRequest {
|
|
2
|
-
serviceId: string;
|
|
3
|
-
serviceName: string;
|
|
4
|
-
level: string;
|
|
5
|
-
message: string;
|
|
6
|
-
metadata: string;
|
|
7
|
-
userId?: string;
|
|
8
|
-
requestId?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface LogEventGrpcResponse {
|
|
12
|
-
success: boolean;
|
|
13
|
-
logId: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface LogUserActionGrpcRequest {
|
|
17
|
-
userId: string;
|
|
18
|
-
userName: string;
|
|
19
|
-
action: string;
|
|
20
|
-
resource: string;
|
|
21
|
-
details?: string;
|
|
22
|
-
ipAddress?: string;
|
|
23
|
-
userAgent?: string;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface LogUserActionGrpcResponse {
|
|
27
|
-
success: boolean;
|
|
28
|
-
actionId: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface UpdateServiceStatusGrpcRequest {
|
|
32
|
-
serviceName: string;
|
|
33
|
-
status: string;
|
|
34
|
-
version?: string;
|
|
35
|
-
uptime?: number;
|
|
36
|
-
metadata?: string;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface UpdateServiceStatusGrpcResponse {
|
|
40
|
-
success: boolean;
|
|
41
|
-
statusId: string;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface GetServiceLogsGrpcRequest {
|
|
45
|
-
serviceName?: string;
|
|
46
|
-
level?: string;
|
|
47
|
-
userId?: string;
|
|
48
|
-
requestId?: string;
|
|
49
|
-
startDate?: string;
|
|
50
|
-
endDate?: string;
|
|
51
|
-
limit?: number;
|
|
52
|
-
offset?: number;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface ServiceLogEntry {
|
|
56
|
-
id: string;
|
|
57
|
-
serviceId: string;
|
|
58
|
-
serviceName: string;
|
|
59
|
-
level: string;
|
|
60
|
-
message: string;
|
|
61
|
-
metadata: string;
|
|
62
|
-
timestamp: string;
|
|
63
|
-
userId?: string;
|
|
64
|
-
requestId?: string;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export interface GetServiceLogsGrpcResponse {
|
|
68
|
-
logs: ServiceLogEntry[];
|
|
69
|
-
total: number;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export interface GetServiceStatusGrpcRequest {
|
|
73
|
-
serviceName?: string;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export interface ServiceStatusEntry {
|
|
77
|
-
id: string;
|
|
78
|
-
serviceName: string;
|
|
79
|
-
status: string;
|
|
80
|
-
lastHeartbeat: string;
|
|
81
|
-
version?: string;
|
|
82
|
-
uptime?: number;
|
|
83
|
-
metadata?: string;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export interface GetServiceStatusGrpcResponse {
|
|
87
|
-
statuses: ServiceStatusEntry[];
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export interface GetUserActionsGrpcRequest {
|
|
91
|
-
userId?: string;
|
|
92
|
-
action?: string;
|
|
93
|
-
resource?: string;
|
|
94
|
-
startDate?: string;
|
|
95
|
-
endDate?: string;
|
|
96
|
-
limit?: number;
|
|
97
|
-
offset?: number;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export interface UserActionEntry {
|
|
101
|
-
id: string;
|
|
102
|
-
userId: string;
|
|
103
|
-
userName: string;
|
|
104
|
-
action: string;
|
|
105
|
-
resource: string;
|
|
106
|
-
details: string;
|
|
107
|
-
timestamp: string;
|
|
108
|
-
ipAddress?: string;
|
|
109
|
-
userAgent?: string;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export interface GetUserActionsGrpcResponse {
|
|
113
|
-
actions: UserActionEntry[];
|
|
114
|
-
total: number;
|
|
115
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
|
|
3
|
-
export interface GenerateTokensRequest {
|
|
4
|
-
userId: string;
|
|
5
|
-
email: string;
|
|
6
|
-
role: string;
|
|
7
|
-
scopes?: string[];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface TokensResponse {
|
|
11
|
-
accessToken: string;
|
|
12
|
-
refreshToken: string;
|
|
13
|
-
expiresIn: number;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface ValidateTokenRequest {
|
|
17
|
-
token: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface ValidateTokenResponse {
|
|
21
|
-
isValid: boolean;
|
|
22
|
-
userId: string;
|
|
23
|
-
role: string;
|
|
24
|
-
scopes: string[];
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface RefreshTokensRequest {
|
|
28
|
-
refreshToken: string;
|
|
29
|
-
userAgent?: string;
|
|
30
|
-
ipAddress?: string;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface RevokeTokenRequest {
|
|
34
|
-
userId: string;
|
|
35
|
-
refreshToken: string;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface RevokeTokenResponse {
|
|
39
|
-
success: boolean;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export interface ITokenService {
|
|
43
|
-
generateTokens(request: GenerateTokensRequest): Observable<TokensResponse>;
|
|
44
|
-
validateToken(request: ValidateTokenRequest): Observable<ValidateTokenResponse>;
|
|
45
|
-
refreshTokens(request: RefreshTokensRequest): Observable<TokensResponse>;
|
|
46
|
-
revokeToken(request: RevokeTokenRequest): Observable<RevokeTokenResponse>;
|
|
47
|
-
}
|
package/src/decorators/index.ts
DELETED
package/src/dto/account.dto.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { IsString, IsOptional } from 'class-validator';
|
|
2
|
-
|
|
3
|
-
export class CreateAccountDto {
|
|
4
|
-
@IsString()
|
|
5
|
-
accountNumber!: string;
|
|
6
|
-
|
|
7
|
-
@IsOptional()
|
|
8
|
-
@IsString()
|
|
9
|
-
clientNumber?: string;
|
|
10
|
-
|
|
11
|
-
@IsOptional()
|
|
12
|
-
@IsString()
|
|
13
|
-
currency?: string;
|
|
14
|
-
|
|
15
|
-
@IsOptional()
|
|
16
|
-
@IsString() // Or @IsNumber() depending on your schema. Assuming string for Decimal/Money
|
|
17
|
-
balance?: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export class UpdateAccountDto {
|
|
21
|
-
@IsOptional()
|
|
22
|
-
@IsString()
|
|
23
|
-
status?: string;
|
|
24
|
-
|
|
25
|
-
@IsOptional()
|
|
26
|
-
@IsString()
|
|
27
|
-
balance?: string;
|
|
28
|
-
}
|
package/src/dto/auth.dto.ts
DELETED
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
import { IsEmail, IsString, MinLength, IsEnum, IsOptional } from 'class-validator';
|
|
2
|
-
import { UserRole } from '../enums/user.enum';
|
|
3
|
-
import { ServiceTokenType, IdentifierType } from '../enums';
|
|
4
|
-
|
|
5
|
-
export class RegisterDto {
|
|
6
|
-
@IsEmail()
|
|
7
|
-
email!: string;
|
|
8
|
-
|
|
9
|
-
@IsString()
|
|
10
|
-
@MinLength(8)
|
|
11
|
-
password!: string;
|
|
12
|
-
|
|
13
|
-
@IsEnum(UserRole)
|
|
14
|
-
@IsOptional()
|
|
15
|
-
role?: UserRole;
|
|
16
|
-
|
|
17
|
-
@IsString()
|
|
18
|
-
@IsOptional()
|
|
19
|
-
firstName?: string;
|
|
20
|
-
|
|
21
|
-
@IsString()
|
|
22
|
-
@IsOptional()
|
|
23
|
-
lastName?: string;
|
|
24
|
-
|
|
25
|
-
@IsString()
|
|
26
|
-
@IsOptional()
|
|
27
|
-
userId?: string;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export class LoginDto {
|
|
31
|
-
@IsEmail()
|
|
32
|
-
email!: string;
|
|
33
|
-
|
|
34
|
-
@IsString()
|
|
35
|
-
password!: string;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Employee Login DTO
|
|
40
|
-
* Used for employee authentication via email
|
|
41
|
-
*/
|
|
42
|
-
export class EmployeeLoginDto {
|
|
43
|
-
@IsEmail()
|
|
44
|
-
email!: string;
|
|
45
|
-
|
|
46
|
-
@IsString()
|
|
47
|
-
@MinLength(8)
|
|
48
|
-
password!: string;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Public Login DTO
|
|
53
|
-
* Used for client and partner authentication via username
|
|
54
|
-
*/
|
|
55
|
-
export class PublicLoginDto {
|
|
56
|
-
@IsString()
|
|
57
|
-
username!: string;
|
|
58
|
-
|
|
59
|
-
@IsString()
|
|
60
|
-
@MinLength(8)
|
|
61
|
-
password!: string;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export interface UserResponse {
|
|
65
|
-
id: string;
|
|
66
|
-
email: string;
|
|
67
|
-
role: UserRole;
|
|
68
|
-
isActive: boolean;
|
|
69
|
-
status: string;
|
|
70
|
-
createdAt?: string;
|
|
71
|
-
updatedAt?: string;
|
|
72
|
-
|
|
73
|
-
// Profile Fields (Shared/Employee)
|
|
74
|
-
firstName?: string;
|
|
75
|
-
lastName?: string;
|
|
76
|
-
middleName?: string;
|
|
77
|
-
shortName?: string;
|
|
78
|
-
|
|
79
|
-
// Employee Specific
|
|
80
|
-
position?: string;
|
|
81
|
-
department?: string;
|
|
82
|
-
internalPhone?: string;
|
|
83
|
-
mobilePhone?: string;
|
|
84
|
-
facsimileSignature?: string;
|
|
85
|
-
|
|
86
|
-
// Client/Partner Specific
|
|
87
|
-
companyName?: string;
|
|
88
|
-
taxId?: string;
|
|
89
|
-
address?: string;
|
|
90
|
-
contactPhone?: string;
|
|
91
|
-
|
|
92
|
-
avatar?: string;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export interface UserProfileDto {
|
|
96
|
-
id: string;
|
|
97
|
-
email: string;
|
|
98
|
-
role: string;
|
|
99
|
-
isActive: boolean;
|
|
100
|
-
status: string;
|
|
101
|
-
createdAt: Date;
|
|
102
|
-
updatedAt: Date;
|
|
103
|
-
fullName: string;
|
|
104
|
-
position: string;
|
|
105
|
-
department: string;
|
|
106
|
-
emailVerified: boolean;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
export class InviteRequestBody {
|
|
110
|
-
@IsEmail()
|
|
111
|
-
email!: string;
|
|
112
|
-
|
|
113
|
-
@IsEnum(UserRole)
|
|
114
|
-
role!: UserRole;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export class RegisterByInviteBody extends RegisterDto {
|
|
118
|
-
@IsString()
|
|
119
|
-
token!: string;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export class ResetPasswordRequestBody {
|
|
123
|
-
@IsEmail()
|
|
124
|
-
email!: string;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export class ResetPasswordConfirmBody {
|
|
128
|
-
@IsString()
|
|
129
|
-
token!: string;
|
|
130
|
-
|
|
131
|
-
@IsString()
|
|
132
|
-
@MinLength(8)
|
|
133
|
-
newPassword!: string;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Logout DTO
|
|
138
|
-
*/
|
|
139
|
-
export class LogoutDto {
|
|
140
|
-
@IsString()
|
|
141
|
-
@IsOptional()
|
|
142
|
-
refreshToken?: string;
|
|
143
|
-
|
|
144
|
-
@IsString()
|
|
145
|
-
@IsOptional()
|
|
146
|
-
sessionId?: string;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
export class RefreshTokenDto {
|
|
150
|
-
@IsString()
|
|
151
|
-
refreshToken!: string;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Service Token DTOs
|
|
156
|
-
*/
|
|
157
|
-
export class CreateServiceTokenDto {
|
|
158
|
-
@IsString()
|
|
159
|
-
serviceName!: string;
|
|
160
|
-
|
|
161
|
-
@IsEnum(ServiceTokenType)
|
|
162
|
-
type!: ServiceTokenType;
|
|
163
|
-
|
|
164
|
-
@IsOptional()
|
|
165
|
-
@IsString()
|
|
166
|
-
description?: string;
|
|
167
|
-
|
|
168
|
-
@IsOptional()
|
|
169
|
-
@IsString()
|
|
170
|
-
name?: string;
|
|
171
|
-
|
|
172
|
-
@IsString()
|
|
173
|
-
identityId!: string;
|
|
174
|
-
|
|
175
|
-
@IsOptional()
|
|
176
|
-
@IsString()
|
|
177
|
-
expiresInDays?: number;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
export class ValidateServiceTokenDto {
|
|
181
|
-
@IsString()
|
|
182
|
-
token!: string;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* Credential DTOs
|
|
187
|
-
*/
|
|
188
|
-
export class CreateCredentialDto {
|
|
189
|
-
@IsEnum(IdentifierType)
|
|
190
|
-
identifierType!: IdentifierType;
|
|
191
|
-
|
|
192
|
-
@IsString()
|
|
193
|
-
identifierValue!: string;
|
|
194
|
-
|
|
195
|
-
@IsString()
|
|
196
|
-
password!: string;
|
|
197
|
-
|
|
198
|
-
@IsString()
|
|
199
|
-
identityId!: string;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* Session DTOs
|
|
204
|
-
*/
|
|
205
|
-
export class CreateSessionDto {
|
|
206
|
-
@IsString()
|
|
207
|
-
identityId!: string;
|
|
208
|
-
|
|
209
|
-
@IsOptional()
|
|
210
|
-
@IsString()
|
|
211
|
-
ipAddress?: string;
|
|
212
|
-
|
|
213
|
-
@IsOptional()
|
|
214
|
-
@IsString()
|
|
215
|
-
userAgent?: string;
|
|
216
|
-
|
|
217
|
-
@IsOptional()
|
|
218
|
-
@IsString()
|
|
219
|
-
deviceInfo?: string;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* 2FA Verification DTO
|
|
224
|
-
*/
|
|
225
|
-
export class Verify2faDto {
|
|
226
|
-
@IsString()
|
|
227
|
-
challengeId!: string;
|
|
228
|
-
|
|
229
|
-
@IsString()
|
|
230
|
-
@MinLength(6)
|
|
231
|
-
code!: string;
|
|
232
|
-
}
|
|
233
|
-
|