@devline-smart-taxi/common 2.3.26

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 (92) hide show
  1. package/README.md +18 -0
  2. package/dist/decorators/access-roles.decorator.d.ts +3 -0
  3. package/dist/decorators/access-roles.decorator.js +8 -0
  4. package/dist/decorators/current-user.decorator.d.ts +6 -0
  5. package/dist/decorators/current-user.decorator.js +14 -0
  6. package/dist/dto/add-earning.dto.d.ts +8 -0
  7. package/dist/dto/add-earning.dto.js +41 -0
  8. package/dist/dto/branch-response.dto.d.ts +15 -0
  9. package/dist/dto/branch-response.dto.js +15 -0
  10. package/dist/dto/create-transaction.dto.d.ts +8 -0
  11. package/dist/dto/create-transaction.dto.js +41 -0
  12. package/dist/dto/create-trip.dto.d.ts +8 -0
  13. package/dist/dto/create-trip.dto.js +83 -0
  14. package/dist/dto/driver-response.dto.d.ts +30 -0
  15. package/dist/dto/driver-response.dto.js +23 -0
  16. package/dist/dto/filter.dto.d.ts +4 -0
  17. package/dist/dto/filter.dto.js +24 -0
  18. package/dist/dto/get-transactions.dto.d.ts +4 -0
  19. package/dist/dto/get-transactions.dto.js +22 -0
  20. package/dist/dto/manager-response.dto.d.ts +27 -0
  21. package/dist/dto/manager-response.dto.js +22 -0
  22. package/dist/dto/pagination.dto.d.ts +4 -0
  23. package/dist/dto/pagination.dto.js +36 -0
  24. package/dist/dto/trip-action.dto.d.ts +6 -0
  25. package/dist/dto/trip-action.dto.js +54 -0
  26. package/dist/dto/trip-response.dto.d.ts +19 -0
  27. package/dist/dto/trip-response.dto.js +12 -0
  28. package/dist/dto/update-trip.dto.d.ts +6 -0
  29. package/dist/dto/update-trip.dto.js +8 -0
  30. package/dist/dto/user-response.dto.d.ts +28 -0
  31. package/dist/dto/user-response.dto.js +23 -0
  32. package/dist/dto/users-image-response.dto.d.ts +15 -0
  33. package/dist/dto/users-image-response.dto.js +15 -0
  34. package/dist/dto/withdraw-balance.dto.d.ts +4 -0
  35. package/dist/dto/withdraw-balance.dto.js +26 -0
  36. package/dist/enums/driver-status.enum.d.ts +7 -0
  37. package/dist/enums/driver-status.enum.js +11 -0
  38. package/dist/enums/payment.enum.d.ts +10 -0
  39. package/dist/enums/payment.enum.js +15 -0
  40. package/dist/enums/roles.enum.d.ts +7 -0
  41. package/dist/enums/roles.enum.js +11 -0
  42. package/dist/enums/trip-status.enum.d.ts +11 -0
  43. package/dist/enums/trip-status.enum.js +15 -0
  44. package/dist/index.d.ts +33 -0
  45. package/dist/index.js +50 -0
  46. package/dist/prompt/error-prompt.d.ts +72 -0
  47. package/dist/prompt/error-prompt.js +76 -0
  48. package/dist/proto/auth-proto-path.d.ts +1 -0
  49. package/dist/proto/auth-proto-path.js +4 -0
  50. package/dist/proto/auth-proto-path.ts +3 -0
  51. package/dist/proto/auth.proto +12 -0
  52. package/dist/proto/balance-proto-path.d.ts +1 -0
  53. package/dist/proto/balance-proto-path.js +4 -0
  54. package/dist/proto/balance-proto-path.ts +2 -0
  55. package/dist/proto/balance.proto +114 -0
  56. package/dist/proto/branch-proto-path.d.ts +1 -0
  57. package/dist/proto/branch-proto-path.js +4 -0
  58. package/dist/proto/branch-proto-path.ts +3 -0
  59. package/dist/proto/branch.proto +84 -0
  60. package/dist/proto/common-proto-path.d.ts +1 -0
  61. package/dist/proto/common-proto-path.js +4 -0
  62. package/dist/proto/common-proto-path.ts +3 -0
  63. package/dist/proto/common.proto +33 -0
  64. package/dist/proto/driver-proto-path.d.ts +1 -0
  65. package/dist/proto/driver-proto-path.js +4 -0
  66. package/dist/proto/driver-proto-path.ts +3 -0
  67. package/dist/proto/driver.proto +354 -0
  68. package/dist/proto/manager-proto-path.d.ts +1 -0
  69. package/dist/proto/manager-proto-path.js +4 -0
  70. package/dist/proto/manager-proto-path.ts +3 -0
  71. package/dist/proto/manager.proto +128 -0
  72. package/dist/proto/matching-proto-path.d.ts +1 -0
  73. package/dist/proto/matching-proto-path.js +4 -0
  74. package/dist/proto/matching-proto-path.ts +3 -0
  75. package/dist/proto/matching.proto +63 -0
  76. package/dist/proto/rating-proto-path.d.ts +1 -0
  77. package/dist/proto/rating-proto-path.js +4 -0
  78. package/dist/proto/rating-proto-path.ts +3 -0
  79. package/dist/proto/rating.proto +60 -0
  80. package/dist/proto/trip-proto-path.d.ts +1 -0
  81. package/dist/proto/trip-proto-path.js +4 -0
  82. package/dist/proto/trip-proto-path.ts +3 -0
  83. package/dist/proto/trip.proto +162 -0
  84. package/dist/proto/user-proto-path.d.ts +1 -0
  85. package/dist/proto/user-proto-path.js +4 -0
  86. package/dist/proto/user-proto-path.ts +3 -0
  87. package/dist/proto/user.proto +165 -0
  88. package/dist/proto/users-image-proto-path.d.ts +1 -0
  89. package/dist/proto/users-image-proto-path.js +4 -0
  90. package/dist/proto/users-image-proto-path.ts +3 -0
  91. package/dist/proto/users-image.proto +93 -0
  92. package/package.json +33 -0
@@ -0,0 +1,63 @@
1
+ syntax = "proto3";
2
+
3
+ package matching;
4
+
5
+ // Matching Service - haydovchilarni qidirish va moslashtirish
6
+ service MatchingService {
7
+ // Yaqin haydovchilarni qidirish
8
+ rpc FindNearbyDrivers (SearchNearbyDriversRequest) returns (NearbyDriversResponse);
9
+
10
+ // Bitta haydovchi lokatsiyasini olish
11
+ rpc GetDriverLocation (GetDriverLocationRequest) returns (DriverLocationResponse);
12
+
13
+ // Haydovchi mavjudligini tekshirish
14
+ rpc CheckDriverAvailability (CheckDriverAvailabilityRequest) returns (DriverAvailabilityResponse);
15
+ }
16
+
17
+ // ==================== Find Nearby Drivers ====================
18
+
19
+ message SearchNearbyDriversRequest {
20
+ double lat = 1; // Latitude (-90 dan 90 gacha)
21
+ double lng = 2; // Longitude (-180 dan 180 gacha)
22
+ optional int32 limit = 3; // Max natijalar soni (default: 10, max: 50)
23
+ optional double radius_km = 4; // Qidiruv radiusi km da (default: 5, max: 100)
24
+ }
25
+
26
+ message NearbyDriver {
27
+ string driver_id = 1;
28
+ double lat = 2;
29
+ double lng = 3;
30
+ double rating = 4;
31
+ double distance_km = 5;
32
+ }
33
+
34
+ message NearbyDriversResponse {
35
+ repeated NearbyDriver drivers = 1;
36
+ int32 total = 2;
37
+ double search_radius_km = 3;
38
+ }
39
+
40
+ // ==================== Get Driver Location ====================
41
+
42
+ message GetDriverLocationRequest {
43
+ string driver_id = 1;
44
+ }
45
+
46
+ message DriverLocationResponse {
47
+ bool found = 1;
48
+ optional double lat = 2;
49
+ optional double lng = 3;
50
+ }
51
+
52
+ // ==================== Check Driver Availability ====================
53
+
54
+ message CheckDriverAvailabilityRequest {
55
+ string driver_id = 1;
56
+ }
57
+
58
+ message DriverAvailabilityResponse {
59
+ bool is_available = 1;
60
+ optional string status = 2; // ONLINE, BUSY, OFFLINE
61
+ optional double rating = 3;
62
+ optional string last_update = 4;
63
+ }
@@ -0,0 +1 @@
1
+ export declare const ratingProtoPath: string;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ratingProtoPath = void 0;
4
+ exports.ratingProtoPath = `${__dirname}/rating.proto`;
@@ -0,0 +1,3 @@
1
+ declare const __dirname: string;
2
+
3
+ export const ratingProtoPath = `${__dirname}/rating.proto`;
@@ -0,0 +1,60 @@
1
+ syntax = "proto3";
2
+
3
+ package rating;
4
+
5
+ import "common.proto";
6
+
7
+ // ==========================================
8
+ // 1. SERVICE
9
+ // ==========================================
10
+ service RatingService {
11
+ rpc UpsertRating (UpsertRatingRequest) returns (RatingResponse);
12
+ rpc GetAverageRating (common.NoParams) returns (AverageRatingResponse);
13
+ }
14
+
15
+ // ==========================================
16
+ // 3. REQUESTS
17
+ // ==========================================
18
+ message UpsertRatingRequest {
19
+ string tripId = 1;
20
+ string userId = 2;
21
+ int32 userRating = 3;
22
+ optional string userComment = 4;
23
+ }
24
+
25
+
26
+ // ==========================================
27
+ // 4. RESPONSES
28
+ // ==========================================
29
+ message RatingData {
30
+ string id = 1;
31
+ string tripId = 2;
32
+ string clientId = 3;
33
+ string driverId = 4;
34
+ optional int32 clientRating = 5;
35
+ optional string clientComment = 6;
36
+ optional string clientRatedAt = 7;
37
+ optional int32 driverRating = 8;
38
+ optional string driverComment = 9;
39
+ optional string driverRatedAt = 10;
40
+ string createdAt = 11;
41
+ string updatedAt = 12;
42
+ }
43
+
44
+ message RatingResponse {
45
+ int32 statusCode = 1;
46
+ string message = 2;
47
+ RatingData data = 3;
48
+ }
49
+
50
+ message AverageRatingData {
51
+ string userId = 1;
52
+ float averageRating = 2;
53
+ int32 totalRatings = 3;
54
+ }
55
+
56
+ message AverageRatingResponse {
57
+ int32 statusCode = 1;
58
+ string message = 2;
59
+ AverageRatingData data = 3;
60
+ }
@@ -0,0 +1 @@
1
+ export declare const tripProtoPath: string;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tripProtoPath = void 0;
4
+ exports.tripProtoPath = `${__dirname}/trip.proto`;
@@ -0,0 +1,3 @@
1
+ declare const __dirname: string;
2
+
3
+ export const tripProtoPath = `${__dirname}/trip.proto`;
@@ -0,0 +1,162 @@
1
+ syntax = "proto3";
2
+
3
+ package trip;
4
+
5
+ // ==========================================
6
+ // 1. SERVICES
7
+ // ==========================================
8
+ service TripService {
9
+ rpc CreateTrip (CreateTripRequest) returns (TripResponse);
10
+ rpc AcceptTrip (TripActionRequest) returns (AcceptTripResponse);
11
+ rpc DeclineTrip (TripActionRequest) returns (TripResponse);
12
+ rpc ConfirmTrip (TripActionRequest) returns (TripResponse);
13
+ rpc RejectAfterCall (TripActionRequest) returns (TripResponse);
14
+ rpc DriverArrived (TripActionRequest) returns (TripResponse);
15
+ // ON_ROAD
16
+ rpc StartTrip (TripActionRequest) returns (TripResponse);
17
+ rpc FinishTrip (TripActionRequest) returns (TripFinishResponse);
18
+ // HISTORY
19
+ rpc GetMyTrips (GetMyTripsRequest) returns (TripListResponse);
20
+ rpc GetTripById (GetTripByIdRequest) returns (TripDetailResponse);
21
+ rpc CancelTrip (CancelTripRequest) returns (TripResponse);
22
+ }
23
+
24
+ // ==========================================
25
+ // 2. COMMON MESSAGES
26
+ // ==========================================
27
+
28
+ message Id {
29
+ string id = 1;
30
+ }
31
+
32
+ message TripData {
33
+ string tripId = 1;
34
+ string status = 2;
35
+ string driverId = 3;
36
+ string clientPhoneNumber = 4; // AcceptTrip da client raqami
37
+ }
38
+
39
+ // ==========================================
40
+ // 3. REQUESTS
41
+ // ==========================================
42
+
43
+ message CancelTripRequest {
44
+ string tripId = 1;
45
+ string userId = 2;
46
+ optional string reason = 3; // Bekor qilish sababi
47
+ }
48
+
49
+ message CreateTripRequest {
50
+ string clientId = 1;
51
+ float clientLatitude = 3;
52
+ float clientLongitude = 4;
53
+ optional float destinationLatitude = 5;
54
+ optional float destinationLongitude = 6;
55
+ string paymentMethod = 7;
56
+ }
57
+
58
+ message TripActionRequest {
59
+ string tripId = 1;
60
+ string driverId = 2;
61
+ optional float latitude = 3;
62
+ optional float longitude = 4;
63
+ optional string carModel = 6;
64
+ optional string carNumber = 7;
65
+ optional string carColor = 8;
66
+ }
67
+
68
+ message GetMyTripsRequest {
69
+ string userId = 1;
70
+ string role = 2;
71
+ int32 page = 3;
72
+ int32 limit = 4;
73
+ optional string status = 5;
74
+ }
75
+
76
+ message GetTripByIdRequest {
77
+ string tripId = 1;
78
+ string userId = 2;
79
+ string role = 3;
80
+ }
81
+
82
+ // ==========================================
83
+ // 4. RESPONSES
84
+ // ==========================================
85
+
86
+ message TripResponse {
87
+ TripData data = 1;
88
+ int32 statusCode = 2;
89
+ string message = 3;
90
+ }
91
+
92
+ message AcceptTripResponse {
93
+ string tripId = 1;
94
+ string status = 2;
95
+ string driverId = 3;
96
+ string clientPhoneNumber = 4;
97
+ int32 statusCode = 5;
98
+ string message = 6;
99
+ }
100
+
101
+ message TripFinishResponse {
102
+ string tripId = 1;
103
+ float totalDistanceKm = 2;
104
+ float finalPrice = 3;
105
+ int32 durationMinutes = 4;
106
+ string message = 5;
107
+ int32 statusCode = 6;
108
+ }
109
+
110
+ // --- History ---
111
+
112
+ message TripListItem {
113
+ string tripId = 1;
114
+ string status = 2;
115
+ float distance = 3;
116
+ int32 duration = 4;
117
+ float totalSum = 5;
118
+ string paymentMethod = 6;
119
+ string paymentStatus = 7;
120
+ string createdAt = 8;
121
+ // Lokatsiyalar
122
+ optional float pickupLat = 9;
123
+ optional float pickupLng = 10;
124
+ optional float destinationLat = 11;
125
+ optional float destinationLng = 12;
126
+ // Mashina (faqat CLIENT uchun)
127
+ optional string carModel = 14;
128
+ optional string carNumber = 15;
129
+ optional string carColor = 16;
130
+ }
131
+
132
+ message TripListResponse {
133
+ repeated TripListItem trips = 1;
134
+ int32 total = 2;
135
+ int32 page = 3;
136
+ int32 limit = 4;
137
+ int32 statusCode = 5;
138
+ string message = 6;
139
+ }
140
+
141
+ message TripDetailResponse {
142
+ string tripId = 1;
143
+ string status = 2;
144
+ float distance = 3;
145
+ int32 duration = 4;
146
+ float totalSum = 5;
147
+ string paymentMethod = 6;
148
+ string paymentStatus = 7;
149
+ optional float pickupLat = 8;
150
+ optional float pickupLng = 9;
151
+ optional float destinationLat = 10;
152
+ optional float destinationLng = 11;
153
+ string createdAt = 12;
154
+ optional string startedAt = 13;
155
+ optional string endedAt = 14;
156
+ // Mashina
157
+ optional string carModel = 16;
158
+ optional string carNumber = 17;
159
+ optional string carColor = 18;
160
+ int32 statusCode = 19;
161
+ string message = 20;
162
+ }
@@ -0,0 +1 @@
1
+ export declare const userProtoPath: string;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.userProtoPath = void 0;
4
+ exports.userProtoPath = `${__dirname}/user.proto`;
@@ -0,0 +1,3 @@
1
+ declare const __dirname: string;
2
+
3
+ export const userProtoPath = `${__dirname}/user.proto`;
@@ -0,0 +1,165 @@
1
+ syntax = "proto3";
2
+
3
+ package user;
4
+
5
+ import "common.proto";
6
+
7
+ // ==========================================
8
+ // 1. SERVICES
9
+ // ==========================================
10
+
11
+ service UserService {
12
+ rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
13
+ rpc VerifyOtpAndAuth (VerifyOtpRequest) returns (VerifyOtpResponse);
14
+ rpc UpdateProfile (CreateUserRequest) returns (UpdateProfileResponse);
15
+ rpc GetAllWithPagination (GetAllWithPaginationRequest) returns (PaginationResult);
16
+ rpc UpdateUser (UpdateUserRequest) returns (common.SuccessResponseResult);
17
+ rpc DeleteUser (common.NoParams) returns (common.SuccessResponseResult);
18
+ rpc GetUserById (Id) returns (UserResponse);
19
+ rpc SendOtpForUpdatePhoneNumber(SendOtpRequest) returns (SendOtpResponse);
20
+ rpc VerifyOtpForUpdatePhoneNumber(VerifyOtpRequest) returns (common.SuccessResponseResult);
21
+ rpc RefreshToken (RefreshTokenRequest) returns (TokenResponse);
22
+ rpc BlockUser (Id) returns (common.SuccessResponseResult);
23
+ rpc GetMyProfile (common.NoParams) returns (UserResponse);
24
+ }
25
+
26
+ // ==========================================
27
+ // 2. COMMON MESSAGES
28
+ // ==========================================
29
+
30
+ message UserData {
31
+ string id = 1;
32
+ string phoneNumber = 2;
33
+ string firstName = 3;
34
+ optional string lastName = 4;
35
+ optional string email = 5;
36
+ optional string birthDate = 6;
37
+ optional string address = 7;
38
+ bool isDeleted = 8;
39
+ string createdAt = 9;
40
+ optional string updatedAt = 10;
41
+ string role = 11;
42
+ bool hasDataConsent = 12;
43
+ bool isBlocked = 13;
44
+ optional string profilePhotoUrl = 14;
45
+ }
46
+
47
+ message Id{
48
+ string id = 1;
49
+ }
50
+
51
+ enum RolesEnum {
52
+ ROLE_UNSPECIFIED = 0;
53
+ SUPER_ADMIN = 1;
54
+ ADMIN = 2;
55
+ DRIVER = 3;
56
+ CLIENT = 4;
57
+ }
58
+
59
+ // ==========================================
60
+ // 3. REQUESTS
61
+ // ==========================================
62
+
63
+ message SendOtpRequest {
64
+ string phoneNumber = 1;
65
+ }
66
+
67
+ message VerifyOtpRequest {
68
+ string phoneNumber = 1;
69
+ int32 otp = 2;
70
+ }
71
+
72
+ message CreateUserRequest {
73
+ string firstName = 1;
74
+ optional string lastName = 2;
75
+ optional string email = 3;
76
+ optional string birthDate = 4;
77
+ optional string address = 5;
78
+ bool hasDataConsent = 6;
79
+ optional string userImageId = 7;
80
+ }
81
+
82
+ message GetAllWithPaginationRequest {
83
+ optional int32 page = 1;
84
+ optional int32 pageSize = 2;
85
+ optional string search = 3;
86
+ }
87
+
88
+ message UpdateUserRequest {
89
+ optional string firstName = 1;
90
+ optional string lastName = 2;
91
+ optional string email = 3;
92
+ optional string birthDate = 4;
93
+ optional string address = 5;
94
+ string id = 6;
95
+ optional string userImageId = 7;
96
+ optional float rating = 8;
97
+ }
98
+
99
+ message RefreshTokenRequest {
100
+ string refreshToken = 1;
101
+ }
102
+
103
+ // ==========================================
104
+ // 4. RESPONSES
105
+ // ==========================================
106
+
107
+ message UpdateProfileResponse {
108
+ int32 statusCode = 1;
109
+ string message = 2;
110
+ common.SuccessResponse data = 3;
111
+ }
112
+
113
+ message SendOtpResponse {
114
+ int32 statusCode = 1;
115
+ string message = 2;
116
+ SendOtpData data = 3;
117
+ }
118
+
119
+ message SendOtpData {
120
+ string phoneNumber = 1;
121
+ int32 expiresIn = 2;
122
+ int32 otp = 3;
123
+ }
124
+
125
+ message UserResponse {
126
+ int32 statusCode = 1;
127
+ string message = 2;
128
+ UserData data = 3;
129
+ }
130
+
131
+ message Token{
132
+ string accessToken = 1;
133
+ string refreshToken = 2;
134
+ string id = 3;
135
+ }
136
+
137
+ message TokenResponse {
138
+ int32 statusCode = 1;
139
+ string message = 2;
140
+ Token data = 3;
141
+ }
142
+
143
+ message VerifyOtpResponse {
144
+ int32 statusCode = 1;
145
+ string message = 2;
146
+ VerifyOtpAndAuthData data = 3;
147
+ }
148
+
149
+ message VerifyOtpAndAuthData {
150
+ optional string accessToken = 1;
151
+ optional string refreshToken = 2;
152
+ bool isRegistered = 4;
153
+ }
154
+
155
+ message PaginationResult {
156
+ repeated UserData data = 1;
157
+ int32 totalElements = 2;
158
+ int32 totalPages = 3;
159
+ int32 pageSize = 4;
160
+ int32 currentPage = 5;
161
+ int32 from = 6;
162
+ int32 to = 7;
163
+ int32 statusCode = 8;
164
+ string message = 9;
165
+ }
@@ -0,0 +1 @@
1
+ export declare const usersImageProtoPath: string;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.usersImageProtoPath = void 0;
4
+ exports.usersImageProtoPath = `${__dirname}/users-image.proto`;
@@ -0,0 +1,3 @@
1
+ declare const __dirname: string;
2
+
3
+ export const usersImageProtoPath = `${__dirname}/users-image.proto`;
@@ -0,0 +1,93 @@
1
+ syntax = "proto3";
2
+
3
+ package users_image;
4
+
5
+ import "common.proto";
6
+
7
+ // ==========================================
8
+ // 1. SERVICES
9
+ // ==========================================
10
+ service UsersImageService {
11
+ // Yangi rasm yaratish
12
+ rpc CreateUsersImage (CreateUsersImageRequest) returns (UsersImageResponse);
13
+
14
+ // Barcha rasmlarni pagination bilan olish
15
+ rpc GetAllUsersImages (GetAllUsersImagesRequest) returns (UsersImagesPaginationResponse);
16
+
17
+ // ID bo'yicha rasm olish
18
+ rpc GetUsersImageById (common.IdRequest) returns (UsersImageResponse);
19
+
20
+ // Rasm ma'lumotlarini yangilash
21
+ rpc UpdateUsersImage (UpdateUsersImageRequest) returns (common.SuccessResponseResult);
22
+
23
+ // Rasmni soft delete qilish
24
+ rpc DeleteUsersImage (common.IdRequest) returns (common.SuccessResponseResult);
25
+ }
26
+
27
+ // ==========================================
28
+ // 2. REQUEST MESSAGES
29
+ // ==========================================
30
+
31
+ message CreateUsersImageRequest {
32
+ string id = 1; // ID (UUID)
33
+ string url = 2; // Rasm URL manzili
34
+ int32 size = 3; // Rasm hajmi (bigint)
35
+ string type = 4; // Rasm turi (MIME type)
36
+ string name = 5; // Rasm nomi
37
+ string original_filename = 6; // Original fayli nomi
38
+ }
39
+
40
+ message GetAllUsersImagesRequest {
41
+ optional int32 page = 1; // Sahifa raqami (default: 1)
42
+ optional int32 pageSize = 2; // Sahifa o'lchami (default: 10)
43
+ optional string search = 3; // Qidiruv so'zi (name bo'yicha)
44
+ }
45
+
46
+ message UpdateUsersImageRequest {
47
+ string id = 1; // UUID formatidagi ID
48
+ optional string url = 2; // Rasm URL manzili
49
+ optional int64 size = 3; // Rasm hajmi (bigint)
50
+ optional string type = 4; // Rasm turi (MIME type)
51
+ optional string name = 5; // Rasm nomi
52
+ optional string original_filename = 6; // Original fayli nomi
53
+ }
54
+
55
+ // ==========================================
56
+ // 3. RESPONSE MESSAGES
57
+ // ==========================================
58
+
59
+ message UsersImageResponse {
60
+ int32 statusCode = 1;
61
+ string message = 2;
62
+ UsersImageData data = 3;
63
+ }
64
+
65
+ message UsersImagesPaginationResponse {
66
+ repeated UsersImageData data = 1;
67
+ int32 totalElements = 2;
68
+ int32 totalPages = 3;
69
+ int32 pageSize = 4;
70
+ int32 currentPage = 5;
71
+ int32 from = 6;
72
+ int32 to = 7;
73
+ int32 statusCode = 8;
74
+ string message = 9;
75
+ }
76
+
77
+ // ==========================================
78
+ // 4. DATA TYPES (SUB-MESSAGES)
79
+ // ==========================================
80
+
81
+ message UsersImageData {
82
+ string id = 1; // UUID
83
+ string url = 2; // Rasm URL manzili
84
+ int32 size = 3; // Rasm hajmi (int32)
85
+ string type = 4; // Rasm turi (MIME type)
86
+ string name = 5; // Rasm nomi
87
+ string original_filename = 10; // Original kirish fayli nomi
88
+
89
+ string createdAt = 6; // Yaratilgan sana (ISO format)
90
+ optional string updatedAt = 7; // Yangilangan sana (ISO format)
91
+ bool isDeleted = 8; // O'chirilgan holati
92
+ bool isActive = 9; // Faol holati
93
+ }
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@devline-smart-taxi/common",
3
+ "version": "2.3.26",
4
+ "description": "Reusable NestJS common library",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "scripts": {
11
+ "build": "tsc && npm run copy-proto",
12
+ "copy-proto": "node scripts/copy-proto.js",
13
+ "prepublishOnly": "npm run build"
14
+ },
15
+ "peerDependencies": {
16
+ "@nestjs/common": "^10.0.0 || ^11.0.0",
17
+ "@nestjs/microservices": "^11.1.11",
18
+ "class-transformer": "^0.5.1",
19
+ "class-validator": "^0.14.0",
20
+ "rxjs": "^7.8.1"
21
+ },
22
+ "devDependencies": {
23
+ "reflect-metadata": "^0.2.2",
24
+ "typescript": "^5.9.3"
25
+ },
26
+ "publishConfig": {
27
+ "registry": "https://npm.pkg.github.com"
28
+ },
29
+ "dependencies": {
30
+ "@nestjs/mapped-types": "^2.1.0",
31
+ "@nestjs/swagger": "^11.2.6"
32
+ }
33
+ }