@barumetric/contracts 1.4.6 → 1.4.8

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/gen/ts/users.ts CHANGED
@@ -7,15 +7,63 @@
7
7
  /* eslint-disable */
8
8
  import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
9
  import { Observable } from "rxjs";
10
+ import { Timestamp } from "./google/protobuf/timestamp";
10
11
 
11
12
  export const protobufPackage = "users.v1";
12
13
 
14
+ export enum Gender {
15
+ GENDER_UNSPECIFIED = 0,
16
+ GENDER_MALE = 1,
17
+ GENDER_FEMALE = 2,
18
+ GENDER_OTHER = 3,
19
+ UNRECOGNIZED = -1,
20
+ }
21
+
22
+ export enum VerificationType {
23
+ VERIFICATION_TYPE_UNSPECIFIED = 0,
24
+ VERIFICATION_TYPE_PASSPORT = 1,
25
+ VERIFICATION_TYPE_DRIVER_LICENSE = 2,
26
+ VERIFICATION_TYPE_ID_CARD = 3,
27
+ VERIFICATION_TYPE_RESIDENCE_PERMIT = 4,
28
+ VERIFICATION_TYPE_BUSINESS_REGISTRATION = 5,
29
+ UNRECOGNIZED = -1,
30
+ }
31
+
32
+ export enum VerificationStatus {
33
+ VERIFICATION_STATUS_UNSPECIFIED = 0,
34
+ VERIFICATION_STATUS_PENDING = 1,
35
+ VERIFICATION_STATUS_APPROVED = 2,
36
+ VERIFICATION_STATUS_REJECTED = 3,
37
+ VERIFICATION_STATUS_EXPIRED = 4,
38
+ UNRECOGNIZED = -1,
39
+ }
40
+
41
+ export enum VerificationSource {
42
+ VERIFICATION_SOURCE_UNSPECIFIED = 0,
43
+ VERIFICATION_SOURCE_MANUAL_UPLOAD = 1,
44
+ VERIFICATION_SOURCE_BANK_API = 2,
45
+ VERIFICATION_SOURCE_THIRD_PARTY_KYC = 3,
46
+ VERIFICATION_SOURCE_AUTO = 4,
47
+ UNRECOGNIZED = -1,
48
+ }
49
+
50
+ export enum MessagePermission {
51
+ MESSAGE_PERMISSION_UNSPECIFIED = 0,
52
+ MESSAGE_PERMISSION_ALL = 1,
53
+ MESSAGE_PERMISSION_VERIFIED_ONLY = 2,
54
+ MESSAGE_PERMISSION_CONTACTS_ONLY = 3,
55
+ MESSAGE_PERMISSION_NONE = 4,
56
+ UNRECOGNIZED = -1,
57
+ }
58
+
13
59
  export interface GetMeRequest {
14
60
  id: string;
15
61
  }
16
62
 
17
63
  export interface GetMeResponse {
18
64
  user: User | undefined;
65
+ verifications: UserVerification[];
66
+ settings?: UserSettings | undefined;
19
67
  }
20
68
 
21
69
  export interface CreateUserRequest {
@@ -30,8 +78,21 @@ export interface CreateUserResponse {
30
78
 
31
79
  export interface PatchUserRequest {
32
80
  userId: string;
81
+ /** Базовые поля */
33
82
  name?: string | undefined;
34
- avatar?: string | undefined;
83
+ avatar?:
84
+ | string
85
+ | undefined;
86
+ /** Новые поля профиля */
87
+ bio?: string | undefined;
88
+ birthDate?: Timestamp | undefined;
89
+ gender?:
90
+ | Gender
91
+ | undefined;
92
+ /** Контакты (дополнительные) */
93
+ website?: string | undefined;
94
+ vkUrl?: string | undefined;
95
+ telegramUsername?: string | undefined;
35
96
  }
36
97
 
37
98
  export interface PatchUserResponse {
@@ -40,10 +101,107 @@ export interface PatchUserResponse {
40
101
 
41
102
  export interface User {
42
103
  id: string;
104
+ /** Базовые поля */
43
105
  name?: string | undefined;
44
106
  phone?: string | undefined;
45
107
  email?: string | undefined;
46
- avatar?: string | undefined;
108
+ avatar?:
109
+ | string
110
+ | undefined;
111
+ /** Новые поля профиля */
112
+ bio?: string | undefined;
113
+ birthDate?: Timestamp | undefined;
114
+ gender?:
115
+ | Gender
116
+ | undefined;
117
+ /** Контакты (дополнительные) */
118
+ website?: string | undefined;
119
+ vkUrl?: string | undefined;
120
+ telegramUsername?:
121
+ | string
122
+ | undefined;
123
+ /** Локация */
124
+ city?: string | undefined;
125
+ region?: string | undefined;
126
+ country?: string | undefined;
127
+ latitude?: number | undefined;
128
+ longitude?: number | undefined;
129
+ timezone?:
130
+ | string
131
+ | undefined;
132
+ /** Статусы */
133
+ isBusiness?: boolean | undefined;
134
+ isPremium?: boolean | undefined;
135
+ isBanned?: boolean | undefined;
136
+ banReason?: string | undefined;
137
+ bannedUntil?:
138
+ | Timestamp
139
+ | undefined;
140
+ /** Статистика (кэш) */
141
+ listingsCount?: number | undefined;
142
+ soldCount?: number | undefined;
143
+ boughtCount?: number | undefined;
144
+ reviewsCount?: number | undefined;
145
+ averageRating?:
146
+ | number
147
+ | undefined;
148
+ /** Метаданные */
149
+ lastActiveAt?: Timestamp | undefined;
150
+ registrationSource?:
151
+ | string
152
+ | undefined;
153
+ /** Timestamps */
154
+ createdAt: Timestamp | undefined;
155
+ updatedAt: Timestamp | undefined;
156
+ }
157
+
158
+ export interface UserVerification {
159
+ id: string;
160
+ userId: string;
161
+ isCurrent: boolean;
162
+ documentType: VerificationType;
163
+ source: VerificationSource;
164
+ status: VerificationStatus;
165
+ documentFrontUrl?: string | undefined;
166
+ documentBackUrl?: string | undefined;
167
+ selfieUrl?: string | undefined;
168
+ firstName: string;
169
+ lastName: string;
170
+ middleName?: string | undefined;
171
+ documentNumber: string;
172
+ issuedBy: string;
173
+ issuedDate: Timestamp | undefined;
174
+ expiresAt?: Timestamp | undefined;
175
+ reviewedBy?: string | undefined;
176
+ reviewedAt?: Timestamp | undefined;
177
+ rejectionReason?: string | undefined;
178
+ createdAt: Timestamp | undefined;
179
+ updatedAt: Timestamp | undefined;
180
+ }
181
+
182
+ export interface UserSettings {
183
+ id: string;
184
+ userId: string;
185
+ /** JSON string */
186
+ emailNotifications?:
187
+ | string
188
+ | undefined;
189
+ /** JSON string */
190
+ pushNotifications?:
191
+ | string
192
+ | undefined;
193
+ /** JSON string */
194
+ smsNotifications?: string | undefined;
195
+ showPhone: boolean;
196
+ showEmail: boolean;
197
+ showLocation: boolean;
198
+ allowMessagesFrom: MessagePermission;
199
+ language: string;
200
+ currency: string;
201
+ timezone: string;
202
+ autoRenewListings: boolean;
203
+ createdAt: Timestamp | undefined;
204
+ updatedAt: Timestamp | undefined;
47
205
  }
48
206
 
49
207
  export const USERS_V1_PACKAGE_NAME = "users.v1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barumetric/contracts",
3
- "version": "1.4.6",
3
+ "version": "1.4.8",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/proto/users.proto CHANGED
@@ -2,6 +2,8 @@ syntax = "proto3";
2
2
 
3
3
  package users.v1;
4
4
 
5
+ import "google/protobuf/timestamp.proto";
6
+
5
7
  service UsersService {
6
8
  rpc GetMe (GetMeRequest) returns (GetMeResponse);
7
9
 
@@ -15,6 +17,8 @@ message GetMeRequest {
15
17
 
16
18
  message GetMeResponse {
17
19
  User user = 1;
20
+ repeated UserVerification verifications = 2;
21
+ optional UserSettings settings = 3;
18
22
  }
19
23
 
20
24
  message CreateUserRequest {
@@ -31,8 +35,19 @@ message CreateUserResponse {
31
35
  message PatchUserRequest {
32
36
  string user_id = 1;
33
37
 
38
+ // Базовые поля
34
39
  optional string name = 2;
35
40
  optional string avatar = 3;
41
+
42
+ // Новые поля профиля
43
+ optional string bio = 4;
44
+ optional google.protobuf.Timestamp birth_date = 5;
45
+ optional Gender gender = 6;
46
+
47
+ // Контакты (дополнительные)
48
+ optional string website = 7;
49
+ optional string vk_url = 8;
50
+ optional string telegram_username = 9;
36
51
  }
37
52
 
38
53
  message PatchUserResponse {
@@ -41,8 +56,132 @@ message PatchUserResponse {
41
56
 
42
57
  message User {
43
58
  string id = 1;
59
+
60
+ // Базовые поля
44
61
  optional string name = 2;
45
62
  optional string phone = 3;
46
63
  optional string email = 4;
47
64
  optional string avatar = 5;
65
+
66
+ // Новые поля профиля
67
+ optional string bio = 6;
68
+ optional google.protobuf.Timestamp birth_date = 7;
69
+ optional Gender gender = 8;
70
+
71
+ // Контакты (дополнительные)
72
+ optional string website = 9;
73
+ optional string vk_url = 10;
74
+ optional string telegram_username = 11;
75
+
76
+ // Локация
77
+ optional string city = 12;
78
+ optional string region = 13;
79
+ optional string country = 14;
80
+ optional double latitude = 15;
81
+ optional double longitude = 16;
82
+ optional string timezone = 17;
83
+
84
+ // Статусы
85
+ optional bool is_business = 18;
86
+ optional bool is_premium = 19;
87
+ optional bool is_banned = 20;
88
+ optional string ban_reason = 21;
89
+ optional google.protobuf.Timestamp banned_until = 22;
90
+
91
+ // Статистика (кэш)
92
+ optional int32 listings_count = 23;
93
+ optional int32 sold_count = 24;
94
+ optional int32 bought_count = 25;
95
+ optional int32 reviews_count = 26;
96
+ optional float average_rating = 27;
97
+
98
+ // Метаданные
99
+ optional google.protobuf.Timestamp last_active_at = 28;
100
+ optional string registration_source = 29;
101
+
102
+ // Timestamps
103
+ google.protobuf.Timestamp created_at = 30;
104
+ google.protobuf.Timestamp updated_at = 31;
105
+ }
106
+
107
+ message UserVerification {
108
+ string id = 1;
109
+ string user_id = 2;
110
+ bool is_current = 3;
111
+ VerificationType document_type = 4;
112
+ VerificationSource source = 5;
113
+ VerificationStatus status = 6;
114
+ optional string document_front_url = 7;
115
+ optional string document_back_url = 8;
116
+ optional string selfie_url = 9;
117
+ string first_name = 10;
118
+ string last_name = 11;
119
+ optional string middle_name = 12;
120
+ string document_number = 13;
121
+ string issued_by = 14;
122
+ google.protobuf.Timestamp issued_date = 15;
123
+ optional google.protobuf.Timestamp expires_at = 16;
124
+ optional string reviewed_by = 17;
125
+ optional google.protobuf.Timestamp reviewed_at = 18;
126
+ optional string rejection_reason = 19;
127
+ google.protobuf.Timestamp created_at = 20;
128
+ google.protobuf.Timestamp updated_at = 21;
129
+ }
130
+
131
+ message UserSettings {
132
+ string id = 1;
133
+ string user_id = 2;
134
+ optional string email_notifications = 3; // JSON string
135
+ optional string push_notifications = 4; // JSON string
136
+ optional string sms_notifications = 5; // JSON string
137
+ bool show_phone = 6;
138
+ bool show_email = 7;
139
+ bool show_location = 8;
140
+ MessagePermission allow_messages_from = 9;
141
+ string language = 10;
142
+ string currency = 11;
143
+ string timezone = 12;
144
+ bool auto_renew_listings = 13;
145
+ google.protobuf.Timestamp created_at = 14;
146
+ google.protobuf.Timestamp updated_at = 15;
147
+ }
148
+
149
+ enum Gender {
150
+ GENDER_UNSPECIFIED = 0;
151
+ GENDER_MALE = 1;
152
+ GENDER_FEMALE = 2;
153
+ GENDER_OTHER = 3;
154
+ }
155
+
156
+ enum VerificationType {
157
+ VERIFICATION_TYPE_UNSPECIFIED = 0;
158
+ VERIFICATION_TYPE_PASSPORT = 1;
159
+ VERIFICATION_TYPE_DRIVER_LICENSE = 2;
160
+ VERIFICATION_TYPE_ID_CARD = 3;
161
+ VERIFICATION_TYPE_RESIDENCE_PERMIT = 4;
162
+ VERIFICATION_TYPE_BUSINESS_REGISTRATION = 5;
163
+ }
164
+
165
+ enum VerificationStatus {
166
+ VERIFICATION_STATUS_UNSPECIFIED = 0;
167
+ VERIFICATION_STATUS_PENDING = 1;
168
+ VERIFICATION_STATUS_APPROVED = 2;
169
+ VERIFICATION_STATUS_REJECTED = 3;
170
+ VERIFICATION_STATUS_EXPIRED = 4;
171
+ }
172
+
173
+ enum VerificationSource {
174
+ VERIFICATION_SOURCE_UNSPECIFIED = 0;
175
+ VERIFICATION_SOURCE_MANUAL_UPLOAD = 1;
176
+ VERIFICATION_SOURCE_BANK_API = 2;
177
+ VERIFICATION_SOURCE_THIRD_PARTY_KYC = 3;
178
+ VERIFICATION_SOURCE_AUTO = 4;
179
+ }
180
+
181
+ enum MessagePermission {
182
+ MESSAGE_PERMISSION_UNSPECIFIED = 0;
183
+ MESSAGE_PERMISSION_ALL = 1;
184
+ MESSAGE_PERMISSION_VERIFIED_ONLY = 2;
185
+ MESSAGE_PERMISSION_CONTACTS_ONLY = 3;
186
+ MESSAGE_PERMISSION_NONE = 4;
48
187
  }