@alacard-project/shared 1.1.9 → 1.1.13

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 (119) hide show
  1. package/dist/browser.d.ts +1 -6
  2. package/dist/browser.js +1 -6
  3. package/dist/browser.js.map +1 -1
  4. package/dist/constants/iam.constants.d.ts +12 -0
  5. package/dist/constants/iam.constants.js +16 -0
  6. package/dist/constants/iam.constants.js.map +1 -0
  7. package/dist/constants/index.d.ts +4 -0
  8. package/dist/constants/index.js +4 -0
  9. package/dist/constants/index.js.map +1 -1
  10. package/dist/constants/microservices.constants.d.ts +10 -0
  11. package/dist/constants/microservices.constants.js +10 -0
  12. package/dist/constants/microservices.constants.js.map +1 -1
  13. package/dist/constants/orchestrator-messages.constants.d.ts +5 -0
  14. package/dist/constants/orchestrator-messages.constants.js +9 -0
  15. package/dist/constants/orchestrator-messages.constants.js.map +1 -0
  16. package/dist/constants/partner-messages.constants.d.ts +7 -0
  17. package/dist/constants/partner-messages.constants.js +11 -0
  18. package/dist/constants/partner-messages.constants.js.map +1 -0
  19. package/dist/constants/user.constants.d.ts +10 -0
  20. package/dist/constants/user.constants.js +14 -0
  21. package/dist/constants/user.constants.js.map +1 -0
  22. package/dist/contracts/card.contract.d.ts +38 -0
  23. package/dist/contracts/index.d.ts +1 -0
  24. package/dist/contracts/index.js +1 -0
  25. package/dist/contracts/index.js.map +1 -1
  26. package/dist/contracts/invoice.contract.d.ts +137 -0
  27. package/dist/contracts/invoice.contract.js +3 -0
  28. package/dist/contracts/invoice.contract.js.map +1 -0
  29. package/dist/contracts/terminal.contract.d.ts +43 -1
  30. package/dist/contracts/transaction.contract.d.ts +12 -0
  31. package/dist/decorators/permissions.decorator.d.ts +2 -2
  32. package/dist/decorators/permissions.decorator.js.map +1 -1
  33. package/dist/decorators/roles.decorator.d.ts +1 -1
  34. package/dist/dto/auth.dto.d.ts +1 -0
  35. package/dist/dto/auth.dto.js +5 -0
  36. package/dist/dto/auth.dto.js.map +1 -1
  37. package/dist/dto/card.dto.d.ts +5 -1
  38. package/dist/dto/card.dto.js +20 -0
  39. package/dist/dto/card.dto.js.map +1 -1
  40. package/dist/dto/iam.dto.d.ts +24 -0
  41. package/dist/dto/iam.dto.js +76 -0
  42. package/dist/dto/iam.dto.js.map +1 -0
  43. package/dist/dto/index.d.ts +1 -0
  44. package/dist/dto/index.js +1 -0
  45. package/dist/dto/index.js.map +1 -1
  46. package/dist/dto/invoice.dto.d.ts +29 -2
  47. package/dist/dto/invoice.dto.js +70 -4
  48. package/dist/dto/invoice.dto.js.map +1 -1
  49. package/dist/dto/partner.dto.d.ts +29 -0
  50. package/dist/dto/partner.dto.js +106 -1
  51. package/dist/dto/partner.dto.js.map +1 -1
  52. package/dist/dto/transaction.dto.d.ts +7 -0
  53. package/dist/dto/transaction.dto.js +35 -0
  54. package/dist/dto/transaction.dto.js.map +1 -1
  55. package/dist/enums/iam.enum.d.ts +5 -0
  56. package/dist/enums/iam.enum.js +7 -1
  57. package/dist/enums/iam.enum.js.map +1 -1
  58. package/dist/enums/index.d.ts +1 -0
  59. package/dist/enums/index.js +1 -0
  60. package/dist/enums/index.js.map +1 -1
  61. package/dist/enums/job.enum.d.ts +6 -1
  62. package/dist/enums/job.enum.js +5 -0
  63. package/dist/enums/job.enum.js.map +1 -1
  64. package/dist/enums/partner.enum.d.ts +5 -0
  65. package/dist/enums/partner.enum.js +10 -0
  66. package/dist/enums/partner.enum.js.map +1 -0
  67. package/dist/enums/permission.enum.d.ts +1 -1
  68. package/dist/enums/permission.enum.js +20 -20
  69. package/dist/enums/permission.enum.js.map +1 -1
  70. package/dist/filters/global-exception.filter.d.ts +1 -1
  71. package/dist/index.d.ts +3 -9
  72. package/dist/index.js +3 -9
  73. package/dist/index.js.map +1 -1
  74. package/dist/middleware/prisma-logging.middleware.d.ts +1 -1
  75. package/dist/resilience/circuit-breaker.service.js +6 -0
  76. package/dist/resilience/circuit-breaker.service.js.map +1 -1
  77. package/dist/resilience/redis-throttler-storage.d.ts +11 -0
  78. package/dist/resilience/redis-throttler-storage.js +76 -0
  79. package/dist/resilience/redis-throttler-storage.js.map +1 -0
  80. package/dist/resilience/resilience.module.js +3 -2
  81. package/dist/resilience/resilience.module.js.map +1 -1
  82. package/dist/tsconfig.tsbuildinfo +1 -1
  83. package/dist/types/client.types.d.ts +8 -0
  84. package/dist/types/client.types.js +3 -0
  85. package/dist/types/client.types.js.map +1 -0
  86. package/dist/types/index.d.ts +2 -0
  87. package/dist/types/index.js +2 -0
  88. package/dist/types/index.js.map +1 -1
  89. package/dist/types/orchestrator.types.d.ts +24 -0
  90. package/dist/types/orchestrator.types.js +3 -0
  91. package/dist/types/orchestrator.types.js.map +1 -0
  92. package/dist/utils/app.utils.js +62 -2
  93. package/dist/utils/app.utils.js.map +1 -1
  94. package/dist/utils/grpc-tracing.interceptor.d.ts +3 -1
  95. package/dist/utils/grpc-tracing.interceptor.js +20 -2
  96. package/dist/utils/grpc-tracing.interceptor.js.map +1 -1
  97. package/dist/utils/health.utils.d.ts +1 -1
  98. package/dist/utils/proto-path.js +14 -7
  99. package/dist/utils/proto-path.js.map +1 -1
  100. package/dist/utils/tracing.service.js +5 -1
  101. package/dist/utils/tracing.service.js.map +1 -1
  102. package/dist/utils/tracing.utils.js +40 -1
  103. package/dist/utils/tracing.utils.js.map +1 -1
  104. package/package.json +16 -4
  105. package/proto/account.proto +0 -32
  106. package/proto/attachment.proto +0 -12
  107. package/proto/auth.proto +0 -152
  108. package/proto/card.proto +0 -140
  109. package/proto/client.proto +0 -99
  110. package/proto/config.proto +0 -39
  111. package/proto/dbf.proto +0 -183
  112. package/proto/iam.proto +0 -70
  113. package/proto/logging.proto +0 -153
  114. package/proto/notification.proto +0 -44
  115. package/proto/partner.proto +0 -68
  116. package/proto/terminal.proto +0 -34
  117. package/proto/transaction.proto +0 -95
  118. package/proto/user.proto +0 -137
  119. package/proto/wallet.proto +0 -138
package/proto/card.proto DELETED
@@ -1,140 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package card;
4
-
5
- service CardService {
6
- rpc Create (CreateCardDto) returns (Card) {}
7
- rpc FindAll (FindCardsDto) returns (CardsResponse) {}
8
- rpc GetOne (FindOneCardDto) returns (Card) {}
9
- rpc GetStats (Empty) returns (CardStatsResponse) {}
10
- rpc GetSyncHistory (GetSyncHistoryDto) returns (SyncHistoryResponse) {}
11
- rpc FindByClient (FindByClientDto) returns (CardsResponse) {}
12
- rpc Update (UpdateCardDto) returns (Card) {}
13
- rpc UpdatePhysicalBalance (UpdatePhysicalBalanceDto) returns (Card) {}
14
- rpc UpdateVirtualBalance (UpdateVirtualBalanceDto) returns (Card) {}
15
- rpc UpdateBalanceMode (UpdateBalanceModeDto) returns (Card) {}
16
- rpc Remove (FindOneCardDto) returns (DeleteResponse) {}
17
- }
18
-
19
- message Card {
20
- string id = 1;
21
- string cardNumber = 2;
22
- string cardType = 3;
23
- string cardStatus = 4;
24
- string clientId = 5;
25
- string accountId = 6;
26
- double balance = 7;
27
- double physicalBalance = 8;
28
- double virtualBalance = 9;
29
- string balanceMode = 10;
30
- string phoneNumber = 11;
31
- string lastSyncAt = 12;
32
- string issuedAt = 13;
33
- string expiresAt = 14;
34
- string createdAt = 15;
35
- string updatedAt = 16;
36
- }
37
-
38
- message CreateCardDto {
39
- string cardNumber = 1;
40
- string clientId = 2;
41
- string accountId = 3;
42
- string cardType = 4;
43
- string cardStatus = 5;
44
- double balance = 6;
45
- string phoneNumber = 7;
46
- string balanceMode = 8;
47
- }
48
-
49
- message UpdateCardDto {
50
- string id = 1;
51
- string clientId = 2;
52
- string accountId = 3;
53
- string cardType = 4;
54
- string cardStatus = 5;
55
- double balance = 6;
56
- string phoneNumber = 7;
57
- string balanceMode = 8;
58
- }
59
-
60
- message FindOneCardDto {
61
- string id = 1;
62
- }
63
-
64
- message FindByClientDto {
65
- string clientId = 1;
66
- string clientNumber = 2;
67
- }
68
-
69
- message FindCardsDto {
70
- int32 skip = 1;
71
- int32 take = 2;
72
- string clientId = 3;
73
- string status = 4;
74
- }
75
-
76
- message CardsResponse {
77
- repeated Card cards = 1;
78
- int32 total = 2;
79
- }
80
-
81
- message BalanceResponse {
82
- string cardId = 1;
83
- double balance = 2;
84
- string currency = 3;
85
- }
86
-
87
- message GetSyncHistoryDto {
88
- string id = 1;
89
- int32 page = 2;
90
- int32 limit = 3;
91
- }
92
-
93
- message SyncHistoryResponse {
94
- string cardId = 1;
95
- repeated SyncHistoryEntry history = 2;
96
- int32 total = 3;
97
- }
98
-
99
- message SyncHistoryEntry {
100
- string id = 1;
101
- string type = 2;
102
- string status = 3;
103
- double amountAdded = 4;
104
- double physBalanceBefore = 5;
105
- double physBalanceAfter = 6;
106
- string syncedAt = 7;
107
- string terminalId = 8;
108
- }
109
-
110
- message UpdatePhysicalBalanceDto {
111
- string id = 1;
112
- double amountAdded = 2;
113
- string terminalId = 3;
114
- string allocationId = 4;
115
- string rawData = 5;
116
- }
117
-
118
- message UpdateVirtualBalanceDto {
119
- string id = 1;
120
- double amount = 2;
121
- string reason = 3;
122
- }
123
-
124
- message UpdateBalanceModeDto {
125
- string id = 1;
126
- string mode = 2; // OFFLINE, ONLINE, HYBRID
127
- }
128
-
129
- message CardStatsResponse {
130
- int32 total = 1;
131
- int32 active = 2;
132
- int32 inactive = 3;
133
- int32 blocked = 4;
134
- }
135
-
136
- message Empty {}
137
-
138
- message DeleteResponse {
139
- bool success = 1;
140
- }
@@ -1,99 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package client;
4
-
5
- service ClientService {
6
- rpc Create (CreateClientDto) returns (Client) {}
7
- rpc FindAll (FindClientsDto) returns (ClientsResponse) {}
8
- rpc FindOne (FindOneClientDto) returns (Client) {}
9
- rpc Update (UpdateClientDto) returns (Client) {}
10
- rpc Remove (FindOneClientDto) returns (Client) {}
11
- rpc GetStats (GetStatsRequest) returns (ClientStatsResponse) {}
12
- }
13
-
14
- message GetStatsRequest {}
15
-
16
- message ClientStatsResponse {
17
- int32 totalClients = 1;
18
- int32 activeClients = 2;
19
- int32 newClientsLastMonth = 3;
20
- }
21
-
22
- message ClientContact {
23
- string id = 1;
24
- string contactType = 2;
25
- string value = 3;
26
- bool isPrimary = 4;
27
- }
28
-
29
- message ClientDetail {
30
- string id = 1;
31
- string detailType = 2;
32
- string value = 3;
33
- bool isActive = 4;
34
- }
35
-
36
- message Client {
37
- string id = 1;
38
- string clientNumber = 2;
39
- string clientNumberFormatted = 3;
40
- string clientType = 4;
41
- string shortName = 5;
42
- string fullName = 6;
43
- bool isActive = 7;
44
- string createdAt = 8;
45
- string updatedAt = 9;
46
- string closedAt = 10;
47
- repeated ClientContact contacts = 11;
48
- repeated ClientDetail details = 12;
49
- }
50
-
51
- message CreateClientContactDto {
52
- string contactType = 1;
53
- string value = 2;
54
- bool isPrimary = 3;
55
- }
56
-
57
- message CreateClientDetailDto {
58
- string detailType = 1;
59
- string value = 2;
60
- bool isActive = 3;
61
- }
62
-
63
- message CreateClientDto {
64
- string clientNumber = 1;
65
- string clientNumberFormatted = 2;
66
- string clientType = 3;
67
- string shortName = 4;
68
- string fullName = 5;
69
- bool isActive = 6;
70
- repeated CreateClientContactDto contacts = 7;
71
- repeated CreateClientDetailDto details = 8;
72
- }
73
-
74
- message UpdateClientDto {
75
- string id = 1;
76
- string clientNumber = 2;
77
- string clientNumberFormatted = 3;
78
- string clientType = 4;
79
- string shortName = 5;
80
- string fullName = 6;
81
- bool isActive = 7;
82
- repeated CreateClientContactDto contacts = 8;
83
- repeated CreateClientDetailDto details = 9;
84
- }
85
-
86
- message FindOneClientDto {
87
- string id = 1;
88
- }
89
-
90
- message FindClientsDto {
91
- string search = 1;
92
- int32 skip = 2;
93
- int32 take = 3;
94
- }
95
-
96
- message ClientsResponse {
97
- repeated Client clients = 1;
98
- int32 total = 2;
99
- }
@@ -1,39 +0,0 @@
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
- }
package/proto/dbf.proto DELETED
@@ -1,183 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package dbf;
4
-
5
- // ==================== Service Definition ====================
6
-
7
- service DbfService {
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
- }
package/proto/iam.proto DELETED
@@ -1,70 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package iam;
4
-
5
- service IamService {
6
- rpc GetIdentity (GetIdentityRequest) returns (IdentityResponse);
7
- rpc ListIdentities (ListIdentitiesRequest) returns (IdentitiesListResponse);
8
- rpc CreateIdentity (CreateIdentityRequest) returns (IdentityResponse);
9
- rpc UpdateIdentityStatus (UpdateStatusRequest) returns (IdentityResponse);
10
- rpc AssignRole (RoleRequest) returns (SuccessResponse);
11
- rpc RevokeRole (RoleRequest) returns (SuccessResponse);
12
- rpc ListRoles (Empty) returns (RolesListResponse);
13
- }
14
-
15
- message Empty {}
16
-
17
- message GetIdentityRequest {
18
- string id = 1;
19
- }
20
-
21
- message ListIdentitiesRequest {
22
- int32 skip = 1;
23
- int32 take = 2;
24
- string roleId = 3;
25
- string status = 4;
26
- string subjectType = 5;
27
- }
28
-
29
- message CreateIdentityRequest {
30
- string subjectType = 1;
31
- string email = 2;
32
- string password = 3;
33
- }
34
-
35
- message UpdateStatusRequest {
36
- string id = 1;
37
- string status = 2;
38
- }
39
-
40
- message RoleRequest {
41
- string identityId = 1;
42
- string roleId = 2;
43
- }
44
-
45
- message IdentityResponse {
46
- string id = 1;
47
- string subjectType = 2;
48
- string status = 3;
49
- string email = 4;
50
- repeated Role roles = 5;
51
- string createdAt = 6;
52
- }
53
-
54
- message Role {
55
- string id = 1;
56
- string name = 2;
57
- }
58
-
59
- message IdentitiesListResponse {
60
- repeated IdentityResponse items = 1;
61
- int32 total = 2;
62
- }
63
-
64
- message RolesListResponse {
65
- repeated Role items = 1;
66
- }
67
-
68
- message SuccessResponse {
69
- bool success = 1;
70
- }
@@ -1,153 +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
- rpc GetMetrics (GetMetricsRequest) returns (GetMetricsResponse);
25
- }
26
-
27
- // Log Event Messages
28
- message LogEventRequest {
29
- string serviceId = 1;
30
- string serviceName = 2;
31
- string level = 3; // DEBUG, INFO, WARN, ERROR, FATAL
32
- string message = 4;
33
- string metadata = 5; // JSON string
34
- optional string userId = 6;
35
- optional string requestId = 7;
36
- }
37
-
38
- message LogEventResponse {
39
- bool success = 1;
40
- string logId = 2;
41
- }
42
-
43
- // User Action Messages
44
- message LogUserActionRequest {
45
- string userId = 1;
46
- string userName = 2;
47
- string action = 3;
48
- string resource = 4;
49
- optional string details = 5; // JSON string
50
- optional string ipAddress = 6;
51
- optional string userAgent = 7;
52
- }
53
-
54
- message LogUserActionResponse {
55
- bool success = 1;
56
- string actionId = 2;
57
- }
58
-
59
- // Service Status Messages
60
- message UpdateServiceStatusRequest {
61
- string serviceName = 1;
62
- string status = 2; // HEALTHY, DEGRADED, DOWN, UNKNOWN
63
- optional string version = 3;
64
- optional int32 uptime = 4;
65
- optional string metadata = 5; // JSON string
66
- }
67
-
68
- message UpdateServiceStatusResponse {
69
- bool success = 1;
70
- string statusId = 2;
71
- }
72
-
73
- // Query Messages
74
- message GetServiceLogsRequest {
75
- optional string serviceName = 1;
76
- optional string level = 2;
77
- optional string userId = 3;
78
- optional string requestId = 4;
79
- optional string startDate = 5; // ISO 8601 format
80
- optional string endDate = 6; // ISO 8601 format
81
- optional int32 limit = 7;
82
- optional int32 offset = 8;
83
- }
84
-
85
- message ServiceLogEntry {
86
- string id = 1;
87
- string serviceId = 2;
88
- string serviceName = 3;
89
- string level = 4;
90
- string message = 5;
91
- string metadata = 6;
92
- string timestamp = 7;
93
- optional string userId = 8;
94
- optional string requestId = 9;
95
- }
96
-
97
- message GetServiceLogsResponse {
98
- repeated ServiceLogEntry logs = 1;
99
- int32 total = 2;
100
- }
101
-
102
- message GetServiceStatusRequest {
103
- optional string serviceName = 1;
104
- }
105
-
106
- message ServiceStatusEntry {
107
- string id = 1;
108
- string serviceName = 2;
109
- string status = 3;
110
- string lastHeartbeat = 4;
111
- optional string version = 5;
112
- optional int32 uptime = 6;
113
- optional string metadata = 7;
114
- }
115
-
116
- message GetServiceStatusResponse {
117
- repeated ServiceStatusEntry statuses = 1;
118
- }
119
-
120
- message GetUserActionsRequest {
121
- optional string userId = 1;
122
- optional string action = 2;
123
- optional string resource = 3;
124
- optional string startDate = 4;
125
- optional string endDate = 5;
126
- optional int32 limit = 6;
127
- optional int32 offset = 7;
128
- }
129
-
130
- message UserActionEntry {
131
- string id = 1;
132
- string userId = 2;
133
- string userName = 3;
134
- string action = 4;
135
- string resource = 5;
136
- string details = 6;
137
- string timestamp = 7;
138
- optional string ipAddress = 8;
139
- optional string userAgent = 9;
140
- }
141
-
142
- message GetUserActionsResponse {
143
- repeated UserActionEntry actions = 1;
144
- int32 total = 2;
145
- }
146
-
147
- message GetMetricsRequest {
148
- string service_name = 1;
149
- }
150
-
151
- message GetMetricsResponse {
152
- string metrics = 1;
153
- }