@alacard-project/shared 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.
Files changed (100) hide show
  1. package/dist/constants/env.constants.d.ts +24 -0
  2. package/dist/constants/env.constants.js +28 -0
  3. package/dist/constants/env.constants.js.map +1 -0
  4. package/dist/constants/grpc.constants.d.ts +14 -0
  5. package/dist/constants/grpc.constants.js +18 -0
  6. package/dist/constants/grpc.constants.js.map +1 -0
  7. package/dist/constants/http.constants.d.ts +10 -0
  8. package/dist/constants/http.constants.js +14 -0
  9. package/dist/constants/http.constants.js.map +1 -0
  10. package/dist/constants/index.d.ts +5 -0
  11. package/dist/constants/index.js +22 -0
  12. package/dist/constants/index.js.map +1 -0
  13. package/dist/constants/logging.constants.d.ts +24 -0
  14. package/dist/constants/logging.constants.js +28 -0
  15. package/dist/constants/logging.constants.js.map +1 -0
  16. package/dist/constants/services.constants.d.ts +6 -0
  17. package/dist/constants/services.constants.js +10 -0
  18. package/dist/constants/services.constants.js.map +1 -0
  19. package/dist/contracts/config.contract.d.ts +12 -0
  20. package/dist/contracts/config.contract.js +3 -0
  21. package/dist/contracts/config.contract.js.map +1 -0
  22. package/dist/contracts/index.d.ts +2 -0
  23. package/dist/contracts/index.js +19 -0
  24. package/dist/contracts/index.js.map +1 -0
  25. package/dist/contracts/logging.contract.d.ts +101 -0
  26. package/dist/contracts/logging.contract.js +3 -0
  27. package/dist/contracts/logging.contract.js.map +1 -0
  28. package/dist/enums/environment.enum.d.ts +7 -0
  29. package/dist/enums/environment.enum.js +12 -0
  30. package/dist/enums/environment.enum.js.map +1 -0
  31. package/dist/enums/error-code.enum.d.ts +8 -0
  32. package/dist/enums/error-code.enum.js +13 -0
  33. package/dist/enums/error-code.enum.js.map +1 -0
  34. package/dist/enums/index.d.ts +5 -0
  35. package/dist/enums/index.js +22 -0
  36. package/dist/enums/index.js.map +1 -0
  37. package/dist/enums/log-level.enum.d.ts +7 -0
  38. package/dist/enums/log-level.enum.js +12 -0
  39. package/dist/enums/log-level.enum.js.map +1 -0
  40. package/dist/enums/notification-type.enum.d.ts +5 -0
  41. package/dist/enums/notification-type.enum.js +10 -0
  42. package/dist/enums/notification-type.enum.js.map +1 -0
  43. package/dist/enums/user-role.enum.d.ts +6 -0
  44. package/dist/enums/user-role.enum.js +11 -0
  45. package/dist/enums/user-role.enum.js.map +1 -0
  46. package/dist/index.d.ts +6 -0
  47. package/dist/index.js +23 -0
  48. package/dist/index.js.map +1 -0
  49. package/dist/logging/dto/log-filter.dto.d.ts +29 -0
  50. package/dist/logging/dto/log-filter.dto.js +146 -0
  51. package/dist/logging/dto/log-filter.dto.js.map +1 -0
  52. package/dist/logging/enums/log-level.enum.d.ts +7 -0
  53. package/dist/logging/enums/log-level.enum.js +12 -0
  54. package/dist/logging/enums/log-level.enum.js.map +1 -0
  55. package/dist/logging/index.d.ts +1 -0
  56. package/dist/logging/index.js +18 -0
  57. package/dist/logging/index.js.map +1 -0
  58. package/dist/tsconfig.tsbuildinfo +1 -0
  59. package/dist/types/auth.types.d.ts +9 -0
  60. package/dist/types/auth.types.js +3 -0
  61. package/dist/types/auth.types.js.map +1 -0
  62. package/dist/types/config.types.d.ts +26 -0
  63. package/dist/types/config.types.js +3 -0
  64. package/dist/types/config.types.js.map +1 -0
  65. package/dist/types/index.d.ts +2 -0
  66. package/dist/types/index.js +19 -0
  67. package/dist/types/index.js.map +1 -0
  68. package/dist/utils/proto-path.d.ts +1 -0
  69. package/dist/utils/proto-path.js +11 -0
  70. package/dist/utils/proto-path.js.map +1 -0
  71. package/package.json +23 -0
  72. package/proto/auth.proto +109 -0
  73. package/proto/config.proto +39 -0
  74. package/proto/dbf.proto +183 -0
  75. package/proto/logging.proto +143 -0
  76. package/proto/token.proto +50 -0
  77. package/proto/user.proto +87 -0
  78. package/src/constants/env.constants.ts +25 -0
  79. package/src/constants/grpc.constants.ts +15 -0
  80. package/src/constants/http.constants.ts +11 -0
  81. package/src/constants/index.ts +5 -0
  82. package/src/constants/logging.constants.ts +26 -0
  83. package/src/constants/services.constants.ts +6 -0
  84. package/src/contracts/config.contract.ts +14 -0
  85. package/src/contracts/index.ts +2 -0
  86. package/src/contracts/logging.contract.ts +115 -0
  87. package/src/enums/environment.enum.ts +7 -0
  88. package/src/enums/error-code.enum.ts +8 -0
  89. package/src/enums/index.ts +5 -0
  90. package/src/enums/log-level.enum.ts +7 -0
  91. package/src/enums/notification-type.enum.ts +5 -0
  92. package/src/enums/user-role.enum.ts +6 -0
  93. package/src/index.ts +6 -0
  94. package/src/logging/dto/log-filter.dto.ts +101 -0
  95. package/src/logging/index.ts +1 -0
  96. package/src/types/auth.types.ts +9 -0
  97. package/src/types/config.types.ts +30 -0
  98. package/src/types/index.ts +3 -0
  99. package/src/utils/proto-path.ts +15 -0
  100. package/tsconfig.json +24 -0
@@ -0,0 +1,39 @@
1
+ syntax = "proto3";
2
+
3
+ package config;
4
+
5
+ service ConfigService {
6
+ rpc GetConfig (GetConfigRequest) returns (ConfigResponse);
7
+ rpc SetConfig (SetConfigRequest) returns (ConfigResponse);
8
+ rpc ListConfigs (ListConfigsRequest) returns (ListConfigsResponse);
9
+ }
10
+
11
+ message GetConfigRequest {
12
+ string serviceName = 1;
13
+ string environment = 2;
14
+ string version = 3;
15
+ }
16
+
17
+ message ConfigResponse {
18
+ map<string, string> values = 1;
19
+ }
20
+
21
+ message SetConfigRequest {
22
+ string serviceName = 1;
23
+ string environment = 2;
24
+ string key = 3;
25
+ string value = 4;
26
+ }
27
+
28
+ message ListConfigsRequest {
29
+ string environment = 1;
30
+ }
31
+
32
+ message ServiceConfig {
33
+ string serviceName = 1;
34
+ map<string, string> values = 2;
35
+ }
36
+
37
+ message ListConfigsResponse {
38
+ repeated ServiceConfig configs = 1;
39
+ }
@@ -0,0 +1,183 @@
1
+ syntax = "proto3";
2
+
3
+ package dbf;
4
+
5
+ // ==================== Service Definition ====================
6
+
7
+ service Dbf Service {
8
+ // Read DBF file with optional filtering
9
+ rpc ReadDbf(ReadDbfRequest) returns (ReadDbfResponse);
10
+
11
+ // Update a single field in specific record(s)
12
+ rpc UpdateField(UpdateFieldRequest) returns (UpdateFieldResponse);
13
+
14
+ // Batch update multiple records
15
+ rpc BatchUpdate(BatchUpdateRequest) returns (BatchUpdateResponse);
16
+
17
+ // Get DBF file schema/structure
18
+ rpc GetSchema(GetSchemaRequest) returns (GetSchemaResponse);
19
+
20
+ // List available DBF files
21
+ rpc ListFiles(ListFilesRequest) returns (ListFilesResponse);
22
+
23
+ // Pack DBF - remove deleted records (PACK in FoxPro)
24
+ rpc Pack(PackRequest) returns (PackResponse);
25
+
26
+ // Reindex DBF - rebuild indexes (REINDEX in FoxPro)
27
+ rpc Reindex(ReindexRequest) returns (ReindexResponse);
28
+
29
+ // Mark record for deletion (DELETE in FoxPro)
30
+ rpc MarkForDeletion(MarkForDeletionRequest) returns (MarkForDeletionResponse);
31
+ }
32
+
33
+ // ==================== Read Operations ====================
34
+
35
+ message ReadDbfRequest {
36
+ string filename = 1;
37
+ optional string filter = 2; // JSON filter conditions
38
+ optional int32 limit = 3;
39
+ optional int32 offset = 4;
40
+ }
41
+
42
+ message ReadDbfResponse {
43
+ bool success = 1;
44
+ repeated Record records = 2;
45
+ int32 total = 3;
46
+ optional string error = 4;
47
+ }
48
+
49
+ message Record {
50
+ map<string, string> fields = 1; // Field name -> value
51
+ }
52
+
53
+ // ==================== Update Operations ====================
54
+
55
+ message UpdateFieldRequest {
56
+ string filename = 1;
57
+ string field_name = 2;
58
+ string new_value = 3;
59
+ optional string filter = 4; // JSON filter to identify records
60
+ optional int32 record_index = 5; // Direct record index
61
+ string user_id = 6; // For audit logging
62
+ }
63
+
64
+ message UpdateFieldResponse {
65
+ bool success = 1;
66
+ int32 records_updated = 2;
67
+ optional string backup_path = 3;
68
+ optional string error = 4;
69
+ }
70
+
71
+ message BatchUpdateRequest {
72
+ string filename = 1;
73
+ repeated FieldUpdate updates = 2;
74
+ string user_id = 3;
75
+ }
76
+
77
+ message FieldUpdate {
78
+ int32 record_index = 1;
79
+ string field_name = 2;
80
+ string new_value = 3;
81
+ }
82
+
83
+ message BatchUpdateResponse {
84
+ bool success = 1;
85
+ int32 records_updated = 2;
86
+ int32 records_failed = 3;
87
+ repeated FailedUpdate failures = 4;
88
+ optional string backup_path = 5;
89
+ optional string error = 6;
90
+ }
91
+
92
+ message FailedUpdate {
93
+ int32 record_index = 1;
94
+ string error = 2;
95
+ }
96
+
97
+ // ==================== Schema Operations ====================
98
+
99
+ message GetSchemaRequest {
100
+ string filename = 1;
101
+ }
102
+
103
+ message GetSchemaResponse {
104
+ bool success = 1;
105
+ repeated FieldDefinition fields = 2;
106
+ int32 record_count = 3;
107
+ optional string error = 4;
108
+ }
109
+
110
+ message FieldDefinition {
111
+ string name = 1;
112
+ string type = 2; // C, N, L, D, etc.
113
+ int32 length = 3;
114
+ int32 decimal_count = 4;
115
+ }
116
+
117
+ // ==================== File Listing ====================
118
+
119
+ message ListFilesRequest {
120
+ optional string directory = 1;
121
+ }
122
+
123
+ message ListFilesResponse {
124
+ bool success = 1;
125
+ repeated DbfFile files = 2;
126
+ optional string error = 3;
127
+ }
128
+
129
+ message DbfFile {
130
+ string filename = 1;
131
+ string path = 2;
132
+ int64 size_bytes = 3;
133
+ int32 record_count = 4;
134
+ string last_modified = 5; // ISO string
135
+ }
136
+
137
+ // ==================== Pack Operation ====================
138
+
139
+ message PackRequest {
140
+ string filename = 1;
141
+ string user_id = 2;
142
+ }
143
+
144
+ message PackResponse {
145
+ bool success = 1;
146
+ int32 records_before = 2;
147
+ int32 records_after = 3;
148
+ int32 removed_count = 4;
149
+ optional string backup_path = 5;
150
+ optional string error = 6;
151
+ }
152
+
153
+ // ==================== Reindex Operation ====================
154
+
155
+ message ReindexRequest {
156
+ string filename = 1;
157
+ optional string index_field = 2; // Specific field to reindex
158
+ optional string user_id = 3;
159
+ }
160
+
161
+ message ReindexResponse {
162
+ bool success = 1;
163
+ string message = 2;
164
+ repeated string index_files = 3; // .CDX, .IDX files found
165
+ optional string recommendation = 4;
166
+ optional string error = 5;
167
+ }
168
+
169
+ // ==================== Mark for Deletion ====================
170
+
171
+ message MarkForDeletionRequest {
172
+ string filename = 1;
173
+ int32 record_index = 2;
174
+ string user_id = 3;
175
+ }
176
+
177
+ message MarkForDeletionResponse {
178
+ bool success = 1;
179
+ int32 record_index = 2;
180
+ bool marked_for_deletion = 3;
181
+ optional string backup_path = 4;
182
+ optional string error = 5;
183
+ }
@@ -0,0 +1,143 @@
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
+ }
@@ -0,0 +1,50 @@
1
+ syntax = "proto3";
2
+
3
+ package token;
4
+
5
+ service TokenService {
6
+ rpc GenerateTokens (GenerateTokensRequest) returns (TokensResponse);
7
+ rpc ValidateToken (ValidateTokenRequest) returns (ValidateTokenResponse);
8
+ rpc RefreshTokens (RefreshTokensRequest) returns (TokensResponse);
9
+ rpc RevokeToken (RevokeTokenRequest) returns (RevokeTokenResponse);
10
+ }
11
+
12
+ message GenerateTokensRequest {
13
+ string userId = 1;
14
+ string email = 2;
15
+ string role = 3;
16
+ repeated string scopes = 4;
17
+ string status = 5;
18
+ }
19
+
20
+ message TokensResponse {
21
+ string accessToken = 1;
22
+ string refreshToken = 2;
23
+ }
24
+
25
+ message ValidateTokenRequest {
26
+ string token = 1;
27
+ }
28
+
29
+ message ValidateTokenResponse {
30
+ bool isValid = 1;
31
+ string userId = 2;
32
+ string role = 3;
33
+ repeated string scopes = 4;
34
+ string status = 5;
35
+ }
36
+
37
+ message RefreshTokensRequest {
38
+ string refreshToken = 1;
39
+ string userAgent = 2;
40
+ string ipAddress = 3;
41
+ }
42
+
43
+ message RevokeTokenRequest {
44
+ string userId = 1;
45
+ string refreshToken = 2;
46
+ }
47
+
48
+ message RevokeTokenResponse {
49
+ bool success = 1;
50
+ }
@@ -0,0 +1,87 @@
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 name = 3;
31
+ string role = 4;
32
+ }
33
+
34
+ message UpdateUserRequest {
35
+ string userId = 1;
36
+ optional string name = 2;
37
+ optional string email = 3;
38
+ optional string role = 4;
39
+ optional bool isActive = 5;
40
+ optional string password = 6;
41
+ }
42
+
43
+ message UpdateProfileRequest {
44
+ string userId = 1;
45
+ optional string name = 2;
46
+ optional string phone = 3;
47
+ optional string avatar = 4;
48
+ optional string metadata = 5;
49
+ }
50
+
51
+ message DeleteUserRequest {
52
+ string userId = 1;
53
+ }
54
+
55
+ message UserResponse {
56
+ string id = 1;
57
+ string email = 2;
58
+ string name = 3;
59
+ string role = 4;
60
+ bool isActive = 5;
61
+ string createdAt = 6;
62
+ string updatedAt = 7;
63
+ string password = 8;
64
+ string lastName = 9;
65
+ string firstName = 10;
66
+ optional string middleName = 11;
67
+ string shortName = 12;
68
+ optional string internalPhone = 13;
69
+ optional string mobilePhone = 14;
70
+ optional string facsimileSignature = 15;
71
+ }
72
+
73
+ message DeleteUserResponse {
74
+ bool success = 1;
75
+ }
76
+
77
+ message Permission {
78
+ string id = 1;
79
+ string resource = 2;
80
+ string action = 3;
81
+ }
82
+
83
+ message PermissionsResponse {
84
+ string userId = 1;
85
+ repeated Permission permissions = 2;
86
+ repeated string scopes = 3;
87
+ }
@@ -0,0 +1,25 @@
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
+ RABBITMQ_URL: 'RABBITMQ_URL',
10
+ JWT_SECRET: 'JWT_SECRET',
11
+ GRPC_PORT: 'GRPC_PORT',
12
+ GRPC_URL: 'GRPC_URL',
13
+ LOGGING_PROTO_PATH: 'LOGGING_PROTO_PATH',
14
+ INTERNAL_CONFIG_KEY: 'INTERNAL_CONFIG_KEY',
15
+ RATE_LIMIT_TTL: 'RATE_LIMIT_TTL',
16
+ RATE_LIMIT_MAX: 'RATE_LIMIT_MAX',
17
+ CORS_ORIGINS: 'CORS_ORIGINS',
18
+ } as const;
19
+
20
+ export const ENV_VALUES = {
21
+ DEVELOPMENT: 'development',
22
+ PRODUCTION: 'production',
23
+ TEST: 'test',
24
+ STAGING: 'staging',
25
+ } as const;
@@ -0,0 +1,15 @@
1
+ export const GRPC_PACKAGES = {
2
+ LOGGING: 'logging',
3
+ CONFIG: 'config',
4
+ } as const;
5
+
6
+ export const GRPC_METHODS = {
7
+ LOGGING: {
8
+ LOG_EVENT: 'LogEvent',
9
+ LOG_USER_ACTION: 'LogUserAction',
10
+ UPDATE_SERVICE_STATUS: 'UpdateServiceStatus',
11
+ GET_SERVICE_LOGS: 'GetServiceLogs',
12
+ GET_SERVICE_STATUS: 'GetServiceStatus',
13
+ GET_USER_ACTIONS: 'GetUserActions',
14
+ },
15
+ } as const;
@@ -0,0 +1,11 @@
1
+ export const HTTP_METHODS = {
2
+ GET: 'GET',
3
+ POST: 'POST',
4
+ PUT: 'PUT',
5
+ DELETE: 'DELETE',
6
+ PATCH: 'PATCH',
7
+ } as const;
8
+
9
+ export const API_PREFIX = {
10
+ V1: '/api/v1',
11
+ } as const;
@@ -0,0 +1,5 @@
1
+ export * from './env.constants';
2
+ export * from './http.constants';
3
+ export * from './services.constants';
4
+ export * from './grpc.constants';
5
+ export * from './logging.constants';
@@ -0,0 +1,26 @@
1
+ export const LOG_RETENTION_PERIODS = {
2
+ SHORT: 7,
3
+ MEDIUM: 30,
4
+ LONG: 90,
5
+ } as const;
6
+
7
+ export const LOG_CLEANUP_MESSAGES = {
8
+ SUCCESS: 'Logs cleaned up successfully',
9
+ INVALID_DATE_RANGE: 'Invalid date range',
10
+ NO_LOGS_FOUND: 'No logs found for cleanup',
11
+ CLEANUP_STARTED: 'Log cleanup started',
12
+ CLEANUP_COMPLETED: 'Log cleanup completed',
13
+ CLEANUP_FAILED: 'Log cleanup failed',
14
+ FILE_CLEANUP_SUCCESS: 'File cleanup successful',
15
+ FILE_CLEANUP_FAILED: 'File cleanup failed',
16
+ RETENTION_UPDATED: 'Retention period updated',
17
+ } as const;
18
+
19
+ export const LOGGING_ERROR_MESSAGES = {
20
+ LOG_EVENT_FAILED: 'Failed to log event',
21
+ LOG_USER_ACTION_FAILED: 'Failed to log user action',
22
+ UPDATE_SERVICE_STATUS_FAILED: 'Failed to update service status',
23
+ GET_SERVICE_LOGS_FAILED: 'Failed to get service logs',
24
+ GET_SERVICE_STATUS_FAILED: 'Failed to get service status',
25
+ GET_USER_ACTIONS_FAILED: 'Failed to get user actions',
26
+ } as const;
@@ -0,0 +1,6 @@
1
+ export const MICROSERVICES = {
2
+ CONFIG: 'CONFIG_SERVICE',
3
+ LOGGING: 'LOGGING_SERVICE',
4
+ AUTH: 'AUTH_SERVICE',
5
+ USER: 'USER_SERVICE',
6
+ } as const;
@@ -0,0 +1,14 @@
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
+ }
@@ -0,0 +1,2 @@
1
+ export * from './config.contract';
2
+ export * from './logging.contract';