@alacard-project/shared 1.1.1 → 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 +25 -27
- 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
package/proto/logging.proto
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package logging;
|
|
4
|
-
|
|
5
|
-
service LoggingService {
|
|
6
|
-
// Log a service event
|
|
7
|
-
rpc LogEvent (LogEventRequest) returns (LogEventResponse);
|
|
8
|
-
|
|
9
|
-
// Log user action for audit trail
|
|
10
|
-
rpc LogUserAction (LogUserActionRequest) returns (LogUserActionResponse);
|
|
11
|
-
|
|
12
|
-
// Update service health status
|
|
13
|
-
rpc UpdateServiceStatus (UpdateServiceStatusRequest) returns (UpdateServiceStatusResponse);
|
|
14
|
-
|
|
15
|
-
// Query service logs
|
|
16
|
-
rpc GetServiceLogs (GetServiceLogsRequest) returns (GetServiceLogsResponse);
|
|
17
|
-
|
|
18
|
-
// Get service health status
|
|
19
|
-
rpc GetServiceStatus (GetServiceStatusRequest) returns (GetServiceStatusResponse);
|
|
20
|
-
|
|
21
|
-
// Query user actions
|
|
22
|
-
rpc GetUserActions (GetUserActionsRequest) returns (GetUserActionsResponse);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Log Event Messages
|
|
26
|
-
message LogEventRequest {
|
|
27
|
-
string serviceId = 1;
|
|
28
|
-
string serviceName = 2;
|
|
29
|
-
string level = 3; // DEBUG, INFO, WARN, ERROR, FATAL
|
|
30
|
-
string message = 4;
|
|
31
|
-
string metadata = 5; // JSON string
|
|
32
|
-
optional string userId = 6;
|
|
33
|
-
optional string requestId = 7;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
message LogEventResponse {
|
|
37
|
-
bool success = 1;
|
|
38
|
-
string logId = 2;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// User Action Messages
|
|
42
|
-
message LogUserActionRequest {
|
|
43
|
-
string userId = 1;
|
|
44
|
-
string userName = 2;
|
|
45
|
-
string action = 3;
|
|
46
|
-
string resource = 4;
|
|
47
|
-
optional string details = 5; // JSON string
|
|
48
|
-
optional string ipAddress = 6;
|
|
49
|
-
optional string userAgent = 7;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
message LogUserActionResponse {
|
|
53
|
-
bool success = 1;
|
|
54
|
-
string actionId = 2;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Service Status Messages
|
|
58
|
-
message UpdateServiceStatusRequest {
|
|
59
|
-
string serviceName = 1;
|
|
60
|
-
string status = 2; // HEALTHY, DEGRADED, DOWN, UNKNOWN
|
|
61
|
-
optional string version = 3;
|
|
62
|
-
optional int32 uptime = 4;
|
|
63
|
-
optional string metadata = 5; // JSON string
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
message UpdateServiceStatusResponse {
|
|
67
|
-
bool success = 1;
|
|
68
|
-
string statusId = 2;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// Query Messages
|
|
72
|
-
message GetServiceLogsRequest {
|
|
73
|
-
optional string serviceName = 1;
|
|
74
|
-
optional string level = 2;
|
|
75
|
-
optional string userId = 3;
|
|
76
|
-
optional string requestId = 4;
|
|
77
|
-
optional string startDate = 5; // ISO 8601 format
|
|
78
|
-
optional string endDate = 6; // ISO 8601 format
|
|
79
|
-
optional int32 limit = 7;
|
|
80
|
-
optional int32 offset = 8;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
message ServiceLogEntry {
|
|
84
|
-
string id = 1;
|
|
85
|
-
string serviceId = 2;
|
|
86
|
-
string serviceName = 3;
|
|
87
|
-
string level = 4;
|
|
88
|
-
string message = 5;
|
|
89
|
-
string metadata = 6;
|
|
90
|
-
string timestamp = 7;
|
|
91
|
-
optional string userId = 8;
|
|
92
|
-
optional string requestId = 9;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
message GetServiceLogsResponse {
|
|
96
|
-
repeated ServiceLogEntry logs = 1;
|
|
97
|
-
int32 total = 2;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
message GetServiceStatusRequest {
|
|
101
|
-
optional string serviceName = 1;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
message ServiceStatusEntry {
|
|
105
|
-
string id = 1;
|
|
106
|
-
string serviceName = 2;
|
|
107
|
-
string status = 3;
|
|
108
|
-
string lastHeartbeat = 4;
|
|
109
|
-
optional string version = 5;
|
|
110
|
-
optional int32 uptime = 6;
|
|
111
|
-
optional string metadata = 7;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
message GetServiceStatusResponse {
|
|
115
|
-
repeated ServiceStatusEntry statuses = 1;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
message GetUserActionsRequest {
|
|
119
|
-
optional string userId = 1;
|
|
120
|
-
optional string action = 2;
|
|
121
|
-
optional string resource = 3;
|
|
122
|
-
optional string startDate = 4;
|
|
123
|
-
optional string endDate = 5;
|
|
124
|
-
optional int32 limit = 6;
|
|
125
|
-
optional int32 offset = 7;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
message UserActionEntry {
|
|
129
|
-
string id = 1;
|
|
130
|
-
string userId = 2;
|
|
131
|
-
string userName = 3;
|
|
132
|
-
string action = 4;
|
|
133
|
-
string resource = 5;
|
|
134
|
-
string details = 6;
|
|
135
|
-
string timestamp = 7;
|
|
136
|
-
optional string ipAddress = 8;
|
|
137
|
-
optional string userAgent = 9;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
message GetUserActionsResponse {
|
|
141
|
-
repeated UserActionEntry actions = 1;
|
|
142
|
-
int32 total = 2;
|
|
143
|
-
}
|
package/proto/partner.proto
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package partner;
|
|
4
|
-
|
|
5
|
-
service PartnerService {
|
|
6
|
-
rpc FindOne (FindOneRequest) returns (PartnerResponse);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
message FindOneRequest {
|
|
10
|
-
string id = 1;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
message PartnerResponse {
|
|
14
|
-
string id = 1;
|
|
15
|
-
string name = 2;
|
|
16
|
-
string type = 3;
|
|
17
|
-
bool isActive = 4;
|
|
18
|
-
}
|
package/proto/terminal.proto
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package terminal;
|
|
4
|
-
|
|
5
|
-
service TerminalService {
|
|
6
|
-
rpc FindOne (FindOneRequest) returns (TerminalResponse);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
message FindOneRequest {
|
|
10
|
-
string id = 1;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
message TerminalResponse {
|
|
14
|
-
string id = 1;
|
|
15
|
-
string serialNumber = 2;
|
|
16
|
-
string model = 3;
|
|
17
|
-
bool isActive = 4;
|
|
18
|
-
}
|
package/proto/transaction.proto
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package transaction;
|
|
4
|
-
|
|
5
|
-
service TransactionService {
|
|
6
|
-
rpc Create (CreateTransactionDto) returns (Transaction) {}
|
|
7
|
-
rpc FindAll (FindTransactionsDto) returns (TransactionsResponse) {}
|
|
8
|
-
rpc FindOne (FindOneTransactionDto) returns (Transaction) {}
|
|
9
|
-
rpc Update (UpdateTransactionDto) returns (Transaction) {}
|
|
10
|
-
rpc Remove (FindOneTransactionDto) returns (Transaction) {}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
message Transaction {
|
|
14
|
-
string id = 1;
|
|
15
|
-
string cardId = 2;
|
|
16
|
-
double amount = 3;
|
|
17
|
-
string status = 4;
|
|
18
|
-
string createdAt = 5;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
message CreateTransactionDto {
|
|
22
|
-
string cardId = 1;
|
|
23
|
-
double amount = 2;
|
|
24
|
-
string description = 3;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
message UpdateTransactionDto {
|
|
28
|
-
string id = 1;
|
|
29
|
-
string status = 2;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
message FindOneTransactionDto {
|
|
33
|
-
string id = 1;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
message FindTransactionsDto {
|
|
37
|
-
string cardId = 1;
|
|
38
|
-
int32 skip = 2;
|
|
39
|
-
int32 take = 3;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
message TransactionsResponse {
|
|
43
|
-
repeated Transaction transactions = 1;
|
|
44
|
-
int32 total = 2;
|
|
45
|
-
}
|
package/proto/user.proto
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package user;
|
|
4
|
-
|
|
5
|
-
service UserService {
|
|
6
|
-
rpc GetUserById(GetUserByIdRequest) returns (UserResponse);
|
|
7
|
-
rpc GetUserByEmail(GetUserByEmailRequest) returns (UserResponse);
|
|
8
|
-
rpc GetUserPermissions(GetUserPermissionsRequest) returns (PermissionsResponse);
|
|
9
|
-
rpc CreateUser(CreateUserRequest) returns (UserResponse);
|
|
10
|
-
rpc UpdateUser(UpdateUserRequest) returns (UserResponse);
|
|
11
|
-
rpc UpdateProfile(UpdateProfileRequest) returns (UserResponse);
|
|
12
|
-
rpc DeleteUser(DeleteUserRequest) returns (DeleteUserResponse);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
message GetUserByIdRequest {
|
|
16
|
-
string userId = 1;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
message GetUserByEmailRequest {
|
|
20
|
-
string email = 1;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
message GetUserPermissionsRequest {
|
|
24
|
-
string userId = 1;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
message CreateUserRequest {
|
|
28
|
-
string email = 1;
|
|
29
|
-
string password = 2;
|
|
30
|
-
string role = 3;
|
|
31
|
-
|
|
32
|
-
// Employee Fields
|
|
33
|
-
optional string firstName = 4;
|
|
34
|
-
optional string lastName = 5;
|
|
35
|
-
optional string middleName = 6;
|
|
36
|
-
optional string position = 7;
|
|
37
|
-
optional string department = 8;
|
|
38
|
-
|
|
39
|
-
// Client Fields
|
|
40
|
-
optional string companyName = 9;
|
|
41
|
-
optional string taxId = 10;
|
|
42
|
-
optional string contactPhone = 11;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
message UpdateUserRequest {
|
|
46
|
-
string userId = 1;
|
|
47
|
-
optional string email = 2;
|
|
48
|
-
optional string role = 3;
|
|
49
|
-
optional bool isActive = 4;
|
|
50
|
-
optional string password = 5;
|
|
51
|
-
|
|
52
|
-
// Employee Fields
|
|
53
|
-
optional string firstName = 6;
|
|
54
|
-
optional string lastName = 7;
|
|
55
|
-
optional string middleName = 8;
|
|
56
|
-
optional string position = 9;
|
|
57
|
-
optional string department = 10;
|
|
58
|
-
|
|
59
|
-
// Client Fields
|
|
60
|
-
optional string companyName = 11;
|
|
61
|
-
optional string taxId = 12;
|
|
62
|
-
optional string contactPhone = 13;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
message UpdateProfileRequest {
|
|
66
|
-
string userId = 1;
|
|
67
|
-
optional string firstName = 2;
|
|
68
|
-
optional string lastName = 3;
|
|
69
|
-
optional string phone = 4;
|
|
70
|
-
optional string avatar = 5;
|
|
71
|
-
optional string companyName = 6;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
message DeleteUserRequest {
|
|
75
|
-
string userId = 1;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
message UserResponse {
|
|
79
|
-
string id = 1;
|
|
80
|
-
string email = 2;
|
|
81
|
-
string role = 3;
|
|
82
|
-
bool isActive = 4;
|
|
83
|
-
string createdAt = 5;
|
|
84
|
-
string updatedAt = 6;
|
|
85
|
-
|
|
86
|
-
// Profile Fields (Shared/Employee)
|
|
87
|
-
optional string firstName = 7;
|
|
88
|
-
optional string lastName = 8;
|
|
89
|
-
optional string middleName = 9;
|
|
90
|
-
optional string shortName = 10;
|
|
91
|
-
|
|
92
|
-
// Employee Specific
|
|
93
|
-
optional string position = 11;
|
|
94
|
-
optional string department = 12;
|
|
95
|
-
optional string internalPhone = 13;
|
|
96
|
-
optional string mobilePhone = 14;
|
|
97
|
-
optional string facsimileSignature = 15;
|
|
98
|
-
|
|
99
|
-
// Client Specific
|
|
100
|
-
optional string companyName = 16;
|
|
101
|
-
optional string taxId = 17;
|
|
102
|
-
optional string address = 18;
|
|
103
|
-
optional string contactPhone = 19;
|
|
104
|
-
|
|
105
|
-
optional string avatar = 20;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
message DeleteUserResponse {
|
|
109
|
-
bool success = 1;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
message Permission {
|
|
113
|
-
string id = 1;
|
|
114
|
-
string resource = 2;
|
|
115
|
-
string action = 3;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
message PermissionsResponse {
|
|
119
|
-
string userId = 1;
|
|
120
|
-
repeated Permission permissions = 2;
|
|
121
|
-
repeated string scopes = 3;
|
|
122
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export const INVITATION_CONFIG = {
|
|
2
|
-
DEFAULT_EXPIRATION_DAYS: 7,
|
|
3
|
-
TOKEN_LENGTH: 32,
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
export const PASSWORD_RESET_CONFIG = {
|
|
7
|
-
TOKEN_EXPIRY_HOURS: 1,
|
|
8
|
-
TOKEN_LENGTH: 32,
|
|
9
|
-
};
|
|
10
|
-
export const AUTH_CONFIG = {
|
|
11
|
-
JWT_ACCESS_EXPIRATION: '15m',
|
|
12
|
-
JWT_REFRESH_EXPIRATION: '7d',
|
|
13
|
-
SESSION_EXPIRATION_HOURS: 24,
|
|
14
|
-
MAX_LOGIN_ATTEMPTS: 5,
|
|
15
|
-
LOCKOUT_DURATION_MINUTES: 30,
|
|
16
|
-
} as const;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
export const AUTHENTICATION_MESSAGES = {
|
|
2
|
-
USER_NOT_FOUND: 'User with this email was not found.',
|
|
3
|
-
USER_ALREADY_EXISTS: 'User with this email already exists.',
|
|
4
|
-
INVALID_PASSWORD: 'The password you entered is incorrect.',
|
|
5
|
-
USER_INACTIVE: 'Your account is currently inactive. Please contact support.',
|
|
6
|
-
INVALID_REFRESH_TOKEN: 'Your session has expired or the refresh token is invalid.',
|
|
7
|
-
LOGOUT_SUCCESS: 'You have been successfully logged out.',
|
|
8
|
-
REGISTRATION_SUCCESS: 'Your account has been created successfully.',
|
|
9
|
-
REGISTER_SUCCESS: 'Account created successfully.',
|
|
10
|
-
LOGIN_SUCCESS: 'Logged in successfully.',
|
|
11
|
-
PASSWORD_RESET_SENT: 'A password reset link has been sent to your email.',
|
|
12
|
-
PASSWORD_RESET_SUCCESS: 'Your password has been reset successfully.',
|
|
13
|
-
INVALID_CREDENTIALS: 'The email or password you entered is incorrect.',
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const AUTH_MESSAGES = {
|
|
17
|
-
...AUTHENTICATION_MESSAGES,
|
|
18
|
-
USER_SUSPENDED: 'User account is suspended',
|
|
19
|
-
USER_LOCKED: 'User account is locked',
|
|
20
|
-
USER_DELETED: 'User account has been deleted',
|
|
21
|
-
TOKEN_EXPIRED: 'Token has expired',
|
|
22
|
-
TOKEN_INVALID: 'Invalid token',
|
|
23
|
-
TOKEN_REVOKED: 'Token has been revoked',
|
|
24
|
-
REFRESH_SUCCESS: 'Token refreshed successfully',
|
|
25
|
-
PASSWORD_CHANGED: 'Password changed successfully',
|
|
26
|
-
TWO_FACTOR_REQUIRED: 'PENDING_2FA',
|
|
27
|
-
TWO_FACTOR_VERIFIED: 'Two-factor authentication verified successfully',
|
|
28
|
-
TWO_FACTOR_INVALID: 'Invalid or expired two-factor code',
|
|
29
|
-
} as const;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
export const COOKIE_EXPIRATION = {
|
|
33
|
-
REFRESH_TOKEN_MS: 7 * 24 * 60 * 60 * 1000, // 7 days
|
|
34
|
-
ACCESS_TOKEN_MS: 15 * 60 * 1000, // 15 minutes
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export const INVITATION_MESSAGES = {
|
|
38
|
-
INVITATION_SENT: 'Invitation sent successfully.',
|
|
39
|
-
INVITATION_VALID: 'Invitation is valid.',
|
|
40
|
-
INVITATION_NOT_FOUND: 'Invitation not found.',
|
|
41
|
-
INVITATION_EXPIRED: 'Invitation has expired.',
|
|
42
|
-
INVITATION_ALREADY_USED: 'Invitation has already been used.',
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export const PASSWORD_RESET_MESSAGES = {
|
|
46
|
-
RESET_EMAIL_SENT: 'Password reset email sent.',
|
|
47
|
-
PASSWORD_RESET_SUCCESS: 'Password reset successfully.',
|
|
48
|
-
INVALID_TOKEN: 'Invalid password reset token.',
|
|
49
|
-
TOKEN_EXPIRED: 'Password reset token has expired.',
|
|
50
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export const COOKIE_NAMES = {
|
|
2
|
-
ACCESS_TOKEN: 'access_token',
|
|
3
|
-
REFRESH_TOKEN: 'refresh_token',
|
|
4
|
-
} as const;
|
|
5
|
-
|
|
6
|
-
export const PASSPORT_STRATEGIES = {
|
|
7
|
-
LOCAL: 'local',
|
|
8
|
-
JWT: 'jwt',
|
|
9
|
-
} as const;
|
|
10
|
-
|
|
11
|
-
export const SERVICE_TOKENS = {
|
|
12
|
-
USER_SERVICE: 'USER_SERVICE_TOKEN',
|
|
13
|
-
AUTH_SERVICE: 'AUTH_SERVICE_TOKEN',
|
|
14
|
-
LOGGING_SERVICE: 'LOGGING_SERVICE_TOKEN',
|
|
15
|
-
TOKEN_SERVICE: 'TOKEN_SERVICE_TOKEN',
|
|
16
|
-
} as const;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
export const ENV_KEYS = {
|
|
2
|
-
NODE_ENV: 'NODE_ENV',
|
|
3
|
-
PORT: 'PORT',
|
|
4
|
-
DATABASE_URL: 'DATABASE_URL',
|
|
5
|
-
REDIS_HOST: 'REDIS_HOST',
|
|
6
|
-
REDIS_PORT: 'REDIS_PORT',
|
|
7
|
-
REDIS_PASSWORD: 'REDIS_PASSWORD',
|
|
8
|
-
KAFKA_BROKERS: 'KAFKA_BROKERS',
|
|
9
|
-
JWT_SECRET: 'JWT_SECRET',
|
|
10
|
-
JWT_EXPIRES_IN: 'JWT_EXPIRES_IN',
|
|
11
|
-
JWT_REFRESH_SECRET: 'JWT_REFRESH_SECRET',
|
|
12
|
-
JWT_REFRESH_EXPIRES_IN: 'JWT_REFRESH_EXPIRES_IN',
|
|
13
|
-
GRPC_PORT: 'GRPC_PORT',
|
|
14
|
-
GRPC_URL: 'GRPC_URL',
|
|
15
|
-
|
|
16
|
-
LOGGING_PROTO_PATH: 'LOGGING_PROTO_PATH',
|
|
17
|
-
USER_PROTO_PATH: 'USER_PROTO_PATH',
|
|
18
|
-
AUTH_PROTO_PATH: 'AUTH_PROTO_PATH',
|
|
19
|
-
CLIENT_PROTO_PATH: 'CLIENT_PROTO_PATH',
|
|
20
|
-
CARD_PROTO_PATH: 'CARD_PROTO_PATH',
|
|
21
|
-
TRANSACTION_PROTO_PATH: 'TRANSACTION_PROTO_PATH',
|
|
22
|
-
TOKEN_PROTO_PATH: 'TOKEN_PROTO_PATH',
|
|
23
|
-
|
|
24
|
-
LOGGING_SERVICE_URL: 'LOGGING_SERVICE_URL',
|
|
25
|
-
CONFIG_SERVICE_URL: 'CONFIG_SERVICE_URL',
|
|
26
|
-
USER_SERVICE_URL: 'USER_SERVICE_URL',
|
|
27
|
-
AUTH_SERVICE_URL: 'AUTH_SERVICE_URL',
|
|
28
|
-
NOTIFICATION_SERVICE_URL: 'NOTIFICATION_SERVICE_URL',
|
|
29
|
-
TOKEN_SERVICE_URL: 'TOKEN_SERVICE_URL',
|
|
30
|
-
|
|
31
|
-
CONFIG_SERVICE_ENABLED: 'CONFIG_SERVICE_ENABLED',
|
|
32
|
-
INTERNAL_CONFIG_KEY: 'INTERNAL_CONFIG_KEY',
|
|
33
|
-
RATE_LIMIT_TTL: 'RATE_LIMIT_TTL',
|
|
34
|
-
RATE_LIMIT_MAX: 'RATE_LIMIT_MAX',
|
|
35
|
-
|
|
36
|
-
LOG_FILE_PATH: 'LOG_FILE_PATH',
|
|
37
|
-
LOG_RETENTION_DAYS: 'LOG_RETENTION_DAYS',
|
|
38
|
-
CORS_ORIGINS: 'CORS_ORIGINS',
|
|
39
|
-
} as const;
|
|
40
|
-
|
|
41
|
-
export const ENV_VALUES = {
|
|
42
|
-
NODE_ENV: {
|
|
43
|
-
DEVELOPMENT: 'development',
|
|
44
|
-
PRODUCTION: 'production',
|
|
45
|
-
TEST: 'test',
|
|
46
|
-
STAGING: 'staging',
|
|
47
|
-
LOCAL: 'local',
|
|
48
|
-
},
|
|
49
|
-
} as const;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ErrorCode } from '../enums/error.enum';
|
|
2
|
-
|
|
3
|
-
export const ErrorMessages: Record<string, string> = {
|
|
4
|
-
[ErrorCode.INTERNAL_SERVER_ERROR]: 'An internal server error occurred. Please try again later.',
|
|
5
|
-
[ErrorCode.VALIDATION_ERROR]: 'Input validation failed. Please check your data.',
|
|
6
|
-
[ErrorCode.AUTH_INVALID_TOKEN]: 'Your session token is invalid or has been revoked.',
|
|
7
|
-
[ErrorCode.AUTH_TOKEN_EXPIRED]: 'Your session has expired. Please log in again.',
|
|
8
|
-
[ErrorCode.AUTH_ACCESS_DENIED]: 'Access denied. You do not have the required role or scope.',
|
|
9
|
-
[ErrorCode.NOT_FOUND]: 'The requested resource was not found.',
|
|
10
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
export const GRPC_PACKAGES = {
|
|
2
|
-
LOGGING: 'logging',
|
|
3
|
-
CONFIG: 'config',
|
|
4
|
-
AUTH: 'auth',
|
|
5
|
-
USER: 'user',
|
|
6
|
-
TOKEN: 'token',
|
|
7
|
-
} as const;
|
|
8
|
-
|
|
9
|
-
export const GRPC_METHODS = {
|
|
10
|
-
LOGGING: {
|
|
11
|
-
SERVICE: 'LoggingService',
|
|
12
|
-
LOG_EVENT: 'LogEvent',
|
|
13
|
-
LOG_USER_ACTION: 'LogUserAction',
|
|
14
|
-
UPDATE_SERVICE_STATUS: 'UpdateServiceStatus',
|
|
15
|
-
GET_SERVICE_LOGS: 'GetServiceLogs',
|
|
16
|
-
GET_SERVICE_STATUS: 'GetServiceStatus',
|
|
17
|
-
GET_USER_ACTIONS: 'GetUserActions',
|
|
18
|
-
},
|
|
19
|
-
AUTH: {
|
|
20
|
-
SERVICE: 'AuthService',
|
|
21
|
-
LOGIN: 'Login',
|
|
22
|
-
CREATE_IDENTITY: 'CreateIdentity',
|
|
23
|
-
VALIDATE: 'Validate',
|
|
24
|
-
GET_USER_BY_ID: 'GetUserById',
|
|
25
|
-
GET_USER_BY_EMAIL: 'GetUserByEmail',
|
|
26
|
-
VALIDATE_TOKEN: 'ValidateToken',
|
|
27
|
-
REFRESH_TOKEN: 'RefreshToken',
|
|
28
|
-
REVOKE_TOKEN: 'RevokeToken',
|
|
29
|
-
GENERATE_TOKENS: 'GenerateTokens',
|
|
30
|
-
CHECK_PERMISSION: 'CheckPermission',
|
|
31
|
-
GET_USER_PERMISSIONS: 'GetUserPermissions',
|
|
32
|
-
},
|
|
33
|
-
USER: {
|
|
34
|
-
SERVICE: 'UserService',
|
|
35
|
-
GET_USER_BY_ID: 'GetUserById',
|
|
36
|
-
GET_USER_By_EMAIL: 'GetUserByEmail',
|
|
37
|
-
GET_USER_PERMISSIONS: 'GetUserPermissions',
|
|
38
|
-
CREATE_USER: 'CreateUser',
|
|
39
|
-
UPDATE_USER: 'UpdateUser',
|
|
40
|
-
UPDATE_PROFILE: 'UpdateProfile',
|
|
41
|
-
DELETE_USER: 'DeleteUser',
|
|
42
|
-
},
|
|
43
|
-
} as const;
|
package/src/constants/index.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export * from './env.constants';
|
|
2
|
-
export * from './http.constants';
|
|
3
|
-
export * from './microservices.constants';
|
|
4
|
-
export * from './grpc.constants';
|
|
5
|
-
export * from './error-messages';
|
|
6
|
-
export * from './auth.constants';
|
|
7
|
-
export * from './logging-messages.constants';
|
|
8
|
-
export * from './routes.constants';
|
|
9
|
-
export * from './queue.constants';
|
|
10
|
-
export * from './common.constants';
|
|
11
|
-
export * from './auth-config.constants';
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
export const LOGGING_MESSAGES = {
|
|
2
|
-
USER_LOGGED_IN: 'User successfully logged in',
|
|
3
|
-
USER_REGISTERED: 'New user registered',
|
|
4
|
-
USER_LOGGED_OUT: 'User logged out',
|
|
5
|
-
|
|
6
|
-
LOGIN_ATTEMPT_NONEXISTENT_EMAIL: 'Login attempt with non-existent email',
|
|
7
|
-
LOGIN_ATTEMPT_INVALID_PASSWORD: 'Login attempt with invalid password',
|
|
8
|
-
|
|
9
|
-
ACCESS_TOKEN_VALIDATED: 'Access token successfully validated',
|
|
10
|
-
ACCESS_TOKEN_VALIDATION_FAILED: 'Access token validation failed',
|
|
11
|
-
|
|
12
|
-
CONFIG_RELOADED: 'Configuration successfully reloaded',
|
|
13
|
-
VAULT_CONNECTED: 'Connected to HashiCorp Vault',
|
|
14
|
-
VAULT_CONNECTION_FAILED: 'Failed to connect to HashiCorp Vault',
|
|
15
|
-
|
|
16
|
-
LOGIN_FAILED: 'Login failed',
|
|
17
|
-
LOGIN_ATTEMPT_INACTIVE_USER: 'Login attempt from inactive user',
|
|
18
|
-
USER_VALIDATED: 'User validated',
|
|
19
|
-
USER_VALIDATION_FAILED: 'User validation failed',
|
|
20
|
-
JWT_PAYLOAD_VALIDATED: 'JWT payload validated',
|
|
21
|
-
JWT_PAYLOAD_VALIDATION_FAILED: 'JWT payload validation failed',
|
|
22
|
-
JWT_VALIDATION_ERROR: 'JWT validation error',
|
|
23
|
-
REGISTRATION_ATTEMPT_EXISTING_EMAIL: 'Registration attempt with existing email',
|
|
24
|
-
REGISTRATION_FAILED: 'Registration failed',
|
|
25
|
-
REFRESH_TOKEN_INVALID: 'Refresh token invalid',
|
|
26
|
-
REFRESH_TOKEN_REVOKED: 'Refresh token revoked',
|
|
27
|
-
REFRESH_TOKEN_REVOKED_MANUALLY: 'Refresh token revoked manually',
|
|
28
|
-
REFRESH_TOKEN_REVOKE_ATTEMPT_FAILED: 'Refresh token revoke attempt failed',
|
|
29
|
-
TOKEN_REVOKE_ERROR: 'Token revoke error',
|
|
30
|
-
PERMISSION_CHECK_PERFORMED: 'Permission check performed',
|
|
31
|
-
PERMISSION_CHECK_ERROR: 'Permission check error',
|
|
32
|
-
USER_PERMISSIONS_RETRIEVED: 'User permissions retrieved',
|
|
33
|
-
USER_PERMISSIONS_RETRIEVAL_ERROR: 'User permissions retrieval error',
|
|
34
|
-
|
|
35
|
-
INVITATION_CREATED: 'Invitation created',
|
|
36
|
-
INVITATION_VALIDATED: 'Invitation validated',
|
|
37
|
-
INVITATION_VALIDATION_FAILED: 'Invitation validation failed',
|
|
38
|
-
INVITATION_USED: 'Invitation used',
|
|
39
|
-
|
|
40
|
-
PASSWORD_RESET_TOKEN_CREATED: 'Password reset token created',
|
|
41
|
-
PASSWORD_RESET_SUCCESSFUL: 'Password reset successful',
|
|
42
|
-
PASSWORD_RESET_FAILED: 'Password reset failed',
|
|
43
|
-
|
|
44
|
-
// Service Logging
|
|
45
|
-
LOG_EVENT_FAILED: 'Failed to log event',
|
|
46
|
-
LOG_USER_ACTION_FAILED: 'Failed to log user action',
|
|
47
|
-
UPDATE_SERVICE_STATUS_FAILED: 'Failed to update service status',
|
|
48
|
-
GET_SERVICE_LOGS_FAILED: 'Failed to get service logs',
|
|
49
|
-
GET_SERVICE_STATUS_FAILED: 'Failed to get service status',
|
|
50
|
-
GET_USER_ACTIONS_FAILED: 'Failed to get user actions',
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export const LOG_CLEANUP_MESSAGES = {
|
|
54
|
-
CLEANUP_STARTED: 'Log cleanup started',
|
|
55
|
-
CLEANUP_COMPLETED: 'Log cleanup completed',
|
|
56
|
-
CLEANUP_FAILED: 'Log cleanup failed',
|
|
57
|
-
FILE_CLEANUP_SUCCESS: 'File cleanup successful',
|
|
58
|
-
FILE_CLEANUP_FAILED: 'File cleanup failed',
|
|
59
|
-
RETENTION_UPDATED: 'Retention period updated',
|
|
60
|
-
};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
export const MICROSERVICES = {
|
|
2
|
-
CONFIG: {
|
|
3
|
-
SERVICE_NAME: 'ConfigService',
|
|
4
|
-
PACKAGE: 'config',
|
|
5
|
-
},
|
|
6
|
-
LOGGING: {
|
|
7
|
-
SERVICE_NAME: 'LoggingService',
|
|
8
|
-
PACKAGE: 'logging',
|
|
9
|
-
},
|
|
10
|
-
KAFKA: {
|
|
11
|
-
SERVICE_NAME: 'KafkaService',
|
|
12
|
-
PACKAGE: 'kafka',
|
|
13
|
-
},
|
|
14
|
-
AUTH: {
|
|
15
|
-
SERVICE_NAME: 'AuthService',
|
|
16
|
-
PACKAGE: 'auth',
|
|
17
|
-
},
|
|
18
|
-
USER: {
|
|
19
|
-
SERVICE_NAME: 'UserService',
|
|
20
|
-
PACKAGE: 'user',
|
|
21
|
-
},
|
|
22
|
-
CLIENT: {
|
|
23
|
-
SERVICE_NAME: 'ClientService',
|
|
24
|
-
PACKAGE: 'client',
|
|
25
|
-
},
|
|
26
|
-
CARD: {
|
|
27
|
-
SERVICE_NAME: 'CardService',
|
|
28
|
-
PACKAGE: 'card',
|
|
29
|
-
},
|
|
30
|
-
TRANSACTION: {
|
|
31
|
-
SERVICE_NAME: 'TransactionService',
|
|
32
|
-
PACKAGE: 'transaction',
|
|
33
|
-
},
|
|
34
|
-
ACCOUNT: {
|
|
35
|
-
SERVICE_NAME: 'AccountService',
|
|
36
|
-
PACKAGE: 'account',
|
|
37
|
-
},
|
|
38
|
-
INVOICE: {
|
|
39
|
-
SERVICE_NAME: 'InvoiceService',
|
|
40
|
-
PACKAGE: 'invoice',
|
|
41
|
-
},
|
|
42
|
-
NOTIFICATION: {
|
|
43
|
-
SERVICE_NAME: 'NotificationService',
|
|
44
|
-
PACKAGE: 'notification',
|
|
45
|
-
},
|
|
46
|
-
ATTACHMENT: {
|
|
47
|
-
SERVICE_NAME: 'AttachmentService',
|
|
48
|
-
PACKAGE: 'attachment',
|
|
49
|
-
},
|
|
50
|
-
TERMINAL: {
|
|
51
|
-
SERVICE_NAME: 'TerminalService',
|
|
52
|
-
PACKAGE: 'terminal',
|
|
53
|
-
},
|
|
54
|
-
PARTNER: {
|
|
55
|
-
SERVICE_NAME: 'PartnerService',
|
|
56
|
-
PACKAGE: 'partner',
|
|
57
|
-
},
|
|
58
|
-
TOKEN: {
|
|
59
|
-
SERVICE_NAME: 'TokenService',
|
|
60
|
-
PACKAGE: 'token',
|
|
61
|
-
},
|
|
62
|
-
} as const;
|