@arbiwallet/contracts 1.0.224 → 1.0.225

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.
@@ -61,6 +61,28 @@ export interface ListManagersResponse {
61
61
  pages: number;
62
62
  }
63
63
 
64
+ export interface BatchGetManagersByIdsRequest {
65
+ ids: string[];
66
+ }
67
+
68
+ export interface BatchGetManagersByIdsResponseRecord {
69
+ id: string;
70
+ email: string;
71
+ username: string;
72
+ firstName: string;
73
+ lastName: string;
74
+ displayName: string;
75
+ avatarUrl: string;
76
+ status: CrmManagerRecordStatus;
77
+ createdAtUnixMs: number;
78
+ updatedAtUnixMs: number;
79
+ sectionPermissions: SectionPermission[];
80
+ }
81
+
82
+ export interface BatchGetManagersByIdsResponse {
83
+ managers: BatchGetManagersByIdsResponseRecord[];
84
+ }
85
+
64
86
  export interface GetManagerRequest {
65
87
  managerId: string;
66
88
  }
@@ -219,6 +241,8 @@ export const CRM_MANAGER_PACKAGE_NAME = "crm_manager";
219
241
  export interface CrmManagerAdminServiceClient {
220
242
  listManagers(request: ListManagersRequest): Observable<ListManagersResponse>;
221
243
 
244
+ batchGetManagersByIds(request: BatchGetManagersByIdsRequest): Observable<BatchGetManagersByIdsResponse>;
245
+
222
246
  getManager(request: GetManagerRequest): Observable<GetManagerResponse>;
223
247
 
224
248
  createManager(request: CreateManagerRequest): Observable<CreateManagerResponse>;
@@ -243,6 +267,10 @@ export interface CrmManagerAdminServiceController {
243
267
  request: ListManagersRequest,
244
268
  ): Promise<ListManagersResponse> | Observable<ListManagersResponse> | ListManagersResponse;
245
269
 
270
+ batchGetManagersByIds(
271
+ request: BatchGetManagersByIdsRequest,
272
+ ): Promise<BatchGetManagersByIdsResponse> | Observable<BatchGetManagersByIdsResponse> | BatchGetManagersByIdsResponse;
273
+
246
274
  getManager(
247
275
  request: GetManagerRequest,
248
276
  ): Promise<GetManagerResponse> | Observable<GetManagerResponse> | GetManagerResponse;
@@ -282,6 +310,7 @@ export function CrmManagerAdminServiceControllerMethods() {
282
310
  return function (constructor: Function) {
283
311
  const grpcMethods: string[] = [
284
312
  "listManagers",
313
+ "batchGetManagersByIds",
285
314
  "getManager",
286
315
  "createManager",
287
316
  "updateManager",
package/gen/user.ts CHANGED
@@ -346,6 +346,38 @@ export interface ContactChangeMessageResponse {
346
346
  message: string;
347
347
  }
348
348
 
349
+ export interface BatchGetUserIdsBySearchRequest {
350
+ search: string;
351
+ /** Максимум возвращаемых id; сервис может дополнительно ограничить. */
352
+ limit: number;
353
+ }
354
+
355
+ export interface BatchGetUserIdsBySearchResponse {
356
+ userIds: number[];
357
+ /** true, если совпадений больше, чем limit (результат был обрезан). */
358
+ tooManyMatches: boolean;
359
+ totalMatches: number;
360
+ }
361
+
362
+ export interface BatchGetUsersByIdsRequest {
363
+ userIds: number[];
364
+ }
365
+
366
+ export interface BatchUserPublicItem {
367
+ id: number;
368
+ uid: number;
369
+ firstName?: string | undefined;
370
+ lastName?: string | undefined;
371
+ avatar?: string | undefined;
372
+ telegramUsername?: string | undefined;
373
+ status: UserStatus;
374
+ crmCustomerId?: number | undefined;
375
+ }
376
+
377
+ export interface BatchGetUsersByIdsResponse {
378
+ items: BatchUserPublicItem[];
379
+ }
380
+
349
381
  export interface UserBalance {
350
382
  asset: string;
351
383
  network: string;
@@ -461,6 +493,14 @@ export interface UserServiceClient {
461
493
  requestChangePhoneCode(request: RequestChangePhoneCodeRequest): Observable<ContactChangeMessageResponse>;
462
494
 
463
495
  verifyChangePhoneCode(request: VerifyChangePhoneCodeRequest): Observable<UserResponse>;
496
+
497
+ /** Батч-поиск пользователей по строке: возвращает только id (с защитой от слишком широкого поиска). */
498
+
499
+ batchGetUserIdsBySearch(request: BatchGetUserIdsBySearchRequest): Observable<BatchGetUserIdsBySearchResponse>;
500
+
501
+ /** Батч-получение публичных данных пользователей по списку id (для enrichment в других сервисах). */
502
+
503
+ batchGetUsersByIds(request: BatchGetUsersByIdsRequest): Observable<BatchGetUsersByIdsResponse>;
464
504
  }
465
505
 
466
506
  export interface UserServiceController {
@@ -625,6 +665,21 @@ export interface UserServiceController {
625
665
  verifyChangePhoneCode(
626
666
  request: VerifyChangePhoneCodeRequest,
627
667
  ): Promise<UserResponse> | Observable<UserResponse> | UserResponse;
668
+
669
+ /** Батч-поиск пользователей по строке: возвращает только id (с защитой от слишком широкого поиска). */
670
+
671
+ batchGetUserIdsBySearch(
672
+ request: BatchGetUserIdsBySearchRequest,
673
+ ):
674
+ | Promise<BatchGetUserIdsBySearchResponse>
675
+ | Observable<BatchGetUserIdsBySearchResponse>
676
+ | BatchGetUserIdsBySearchResponse;
677
+
678
+ /** Батч-получение публичных данных пользователей по списку id (для enrichment в других сервисах). */
679
+
680
+ batchGetUsersByIds(
681
+ request: BatchGetUsersByIdsRequest,
682
+ ): Promise<BatchGetUsersByIdsResponse> | Observable<BatchGetUsersByIdsResponse> | BatchGetUsersByIdsResponse;
628
683
  }
629
684
 
630
685
  export function UserServiceControllerMethods() {
@@ -655,6 +710,8 @@ export function UserServiceControllerMethods() {
655
710
  "verifyChangeEmailCode",
656
711
  "requestChangePhoneCode",
657
712
  "verifyChangePhoneCode",
713
+ "batchGetUserIdsBySearch",
714
+ "batchGetUsersByIds",
658
715
  ];
659
716
  for (const method of grpcMethods) {
660
717
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arbiwallet/contracts",
3
3
  "descriptions": "Generate and manage smart contracts for ArbiWallet",
4
- "version": "1.0.224",
4
+ "version": "1.0.225",
5
5
  "scripts": {
6
6
  "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
7
7
  },
@@ -3,6 +3,7 @@ package crm_manager;
3
3
 
4
4
  service CrmManagerAdminService {
5
5
  rpc ListManagers (ListManagersRequest) returns (ListManagersResponse);
6
+ rpc BatchGetManagersByIds (BatchGetManagersByIdsRequest) returns (BatchGetManagersByIdsResponse);
6
7
  rpc GetManager (GetManagerRequest) returns (GetManagerResponse);
7
8
  rpc CreateManager (CreateManagerRequest) returns (CreateManagerResponse);
8
9
  rpc UpdateManager (UpdateManagerRequest) returns (UpdateManagerResponse);
@@ -64,6 +65,28 @@ message ListManagersResponse {
64
65
  int32 pages = 5;
65
66
  }
66
67
 
68
+ message BatchGetManagersByIdsRequest {
69
+ repeated string ids = 1;
70
+ }
71
+
72
+ message BatchGetManagersByIdsResponseRecord {
73
+ string id = 1;
74
+ string email = 2;
75
+ string username = 3;
76
+ string first_name = 4;
77
+ string last_name = 5;
78
+ string display_name = 6;
79
+ string avatar_url = 7;
80
+ CrmManagerRecordStatus status = 8;
81
+ int64 created_at_unix_ms = 9;
82
+ int64 updated_at_unix_ms = 10;
83
+ repeated SectionPermission section_permissions = 11;
84
+ }
85
+
86
+ message BatchGetManagersByIdsResponse {
87
+ repeated BatchGetManagersByIdsResponseRecord managers = 1;
88
+ }
89
+
67
90
  message GetManagerRequest {
68
91
  string manager_id = 1;
69
92
  }
package/proto/user.proto CHANGED
@@ -44,6 +44,10 @@ service UserService {
44
44
  // Смена phone: отправка SMS-кода через Twilio.
45
45
  rpc RequestChangePhoneCode (RequestChangePhoneCodeRequest) returns (ContactChangeMessageResponse);
46
46
  rpc VerifyChangePhoneCode (VerifyChangePhoneCodeRequest) returns (UserResponse);
47
+ // Батч-поиск пользователей по строке: возвращает только id (с защитой от слишком широкого поиска).
48
+ rpc BatchGetUserIdsBySearch (BatchGetUserIdsBySearchRequest) returns (BatchGetUserIdsBySearchResponse);
49
+ // Батч-получение публичных данных пользователей по списку id (для enrichment в других сервисах).
50
+ rpc BatchGetUsersByIds (BatchGetUsersByIdsRequest) returns (BatchGetUsersByIdsResponse);
47
51
  }
48
52
 
49
53
  enum UserStatus {
@@ -376,6 +380,38 @@ message ContactChangeMessageResponse {
376
380
  string message = 1;
377
381
  }
378
382
 
383
+ message BatchGetUserIdsBySearchRequest {
384
+ string search = 1;
385
+ // Максимум возвращаемых id; сервис может дополнительно ограничить.
386
+ int32 limit = 2;
387
+ }
388
+
389
+ message BatchGetUserIdsBySearchResponse {
390
+ repeated int32 user_ids = 1;
391
+ // true, если совпадений больше, чем limit (результат был обрезан).
392
+ bool too_many_matches = 2;
393
+ int32 total_matches = 3;
394
+ }
395
+
396
+ message BatchGetUsersByIdsRequest {
397
+ repeated int32 user_ids = 1;
398
+ }
399
+
400
+ message BatchUserPublicItem {
401
+ int32 id = 1;
402
+ int32 uid = 2;
403
+ optional string first_name = 3;
404
+ optional string last_name = 4;
405
+ optional string avatar = 5;
406
+ optional string telegram_username = 6;
407
+ UserStatus status = 7;
408
+ optional int32 crm_customer_id = 8;
409
+ }
410
+
411
+ message BatchGetUsersByIdsResponse {
412
+ repeated BatchUserPublicItem items = 1;
413
+ }
414
+
379
415
  message UserBalance {
380
416
  string asset = 1;
381
417
  string network = 2;