@arbiwallet/contracts 1.0.70 → 1.0.72

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/user.ts CHANGED
@@ -185,6 +185,9 @@ export interface PostArbiWalletChatMessageRequest {
185
185
  walletUserId: number;
186
186
  /** Частичное тело от клиента: text, content, reply_to, datetime (ISO UTC). */
187
187
  jsonBody: string;
188
+ mediaFile?: Uint8Array | undefined;
189
+ mediaFilename?: string | undefined;
190
+ mediaContentType?: string | undefined;
188
191
  }
189
192
 
190
193
  export interface PostArbiWalletChatMessageResponse {
@@ -203,6 +206,34 @@ export interface ListArbiWalletChatMessagesResponse {
203
206
  bodyJson: string;
204
207
  }
205
208
 
209
+ export interface ProxyArbiWalletChatMediaRequest {
210
+ walletUserId: number;
211
+ url: string;
212
+ }
213
+
214
+ export interface ProxyArbiWalletChatMediaResponse {
215
+ httpStatus: number;
216
+ body: Uint8Array;
217
+ contentType: string;
218
+ }
219
+
220
+ export interface GetSupportChatLastReadRequest {
221
+ walletUserId: number;
222
+ }
223
+
224
+ export interface GetSupportChatLastReadResponse {
225
+ lastReadMessageId: number;
226
+ }
227
+
228
+ export interface SetSupportChatLastReadRequest {
229
+ walletUserId: number;
230
+ lastReadMessageId: number;
231
+ }
232
+
233
+ export interface SetSupportChatLastReadResponse {
234
+ ok: boolean;
235
+ }
236
+
206
237
  export interface UserBalance {
207
238
  asset: string;
208
239
  network: string;
@@ -270,6 +301,16 @@ export interface UserServiceClient {
270
301
  listArbiWalletChatMessages(
271
302
  request: ListArbiWalletChatMessagesRequest,
272
303
  ): Observable<ListArbiWalletChatMessagesResponse>;
304
+
305
+ /** Прокси медиа по HTTPS URL (allowlist): CRM session + X-Session-ID только в user-service; тело для отдачи на gateway → FE. */
306
+
307
+ proxyArbiWalletChatMedia(request: ProxyArbiWalletChatMediaRequest): Observable<ProxyArbiWalletChatMediaResponse>;
308
+
309
+ /** Локально в user-service: последний прочитанный message_id из chat-analytics (read receipt). */
310
+
311
+ getSupportChatLastRead(request: GetSupportChatLastReadRequest): Observable<GetSupportChatLastReadResponse>;
312
+
313
+ setSupportChatLastRead(request: SetSupportChatLastReadRequest): Observable<SetSupportChatLastReadResponse>;
273
314
  }
274
315
 
275
316
  export interface UserServiceController {
@@ -346,6 +387,31 @@ export interface UserServiceController {
346
387
  | Promise<ListArbiWalletChatMessagesResponse>
347
388
  | Observable<ListArbiWalletChatMessagesResponse>
348
389
  | ListArbiWalletChatMessagesResponse;
390
+
391
+ /** Прокси медиа по HTTPS URL (allowlist): CRM session + X-Session-ID только в user-service; тело для отдачи на gateway → FE. */
392
+
393
+ proxyArbiWalletChatMedia(
394
+ request: ProxyArbiWalletChatMediaRequest,
395
+ ):
396
+ | Promise<ProxyArbiWalletChatMediaResponse>
397
+ | Observable<ProxyArbiWalletChatMediaResponse>
398
+ | ProxyArbiWalletChatMediaResponse;
399
+
400
+ /** Локально в user-service: последний прочитанный message_id из chat-analytics (read receipt). */
401
+
402
+ getSupportChatLastRead(
403
+ request: GetSupportChatLastReadRequest,
404
+ ):
405
+ | Promise<GetSupportChatLastReadResponse>
406
+ | Observable<GetSupportChatLastReadResponse>
407
+ | GetSupportChatLastReadResponse;
408
+
409
+ setSupportChatLastRead(
410
+ request: SetSupportChatLastReadRequest,
411
+ ):
412
+ | Promise<SetSupportChatLastReadResponse>
413
+ | Observable<SetSupportChatLastReadResponse>
414
+ | SetSupportChatLastReadResponse;
349
415
  }
350
416
 
351
417
  export function UserServiceControllerMethods() {
@@ -363,6 +429,9 @@ export function UserServiceControllerMethods() {
363
429
  "forwardManagerChatMessage",
364
430
  "postArbiWalletChatMessage",
365
431
  "listArbiWalletChatMessages",
432
+ "proxyArbiWalletChatMedia",
433
+ "getSupportChatLastRead",
434
+ "setSupportChatLastRead",
366
435
  ];
367
436
  for (const method of grpcMethods) {
368
437
  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.70",
4
+ "version": "1.0.72",
5
5
  "scripts": {
6
6
  "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
7
7
  },
package/proto/user.proto CHANGED
@@ -22,6 +22,11 @@ service UserService {
22
22
  rpc PostArbiWalletChatMessage (PostArbiWalletChatMessageRequest) returns (PostArbiWalletChatMessageResponse);
23
23
  // Чат AlexAI (chat-analytics): GET /api/v1/arbi-wallet/messages?wallet_client_id=… — список сообщений пользователя.
24
24
  rpc ListArbiWalletChatMessages (ListArbiWalletChatMessagesRequest) returns (ListArbiWalletChatMessagesResponse);
25
+ // Прокси медиа по HTTPS URL (allowlist): CRM session + X-Session-ID только в user-service; тело для отдачи на gateway → FE.
26
+ rpc ProxyArbiWalletChatMedia (ProxyArbiWalletChatMediaRequest) returns (ProxyArbiWalletChatMediaResponse);
27
+ // Локально в user-service: последний прочитанный message_id из chat-analytics (read receipt).
28
+ rpc GetSupportChatLastRead (GetSupportChatLastReadRequest) returns (GetSupportChatLastReadResponse);
29
+ rpc SetSupportChatLastRead (SetSupportChatLastReadRequest) returns (SetSupportChatLastReadResponse);
25
30
  }
26
31
 
27
32
  enum UserStatus {
@@ -193,6 +198,9 @@ message PostArbiWalletChatMessageRequest {
193
198
  int32 wallet_user_id = 1;
194
199
  // Частичное тело от клиента: text, content, reply_to, datetime (ISO UTC).
195
200
  string json_body = 2;
201
+ optional bytes media_file = 3;
202
+ optional string media_filename = 4;
203
+ optional string media_content_type = 5;
196
204
  }
197
205
 
198
206
  message PostArbiWalletChatMessageResponse {
@@ -211,6 +219,34 @@ message ListArbiWalletChatMessagesResponse {
211
219
  string body_json = 2;
212
220
  }
213
221
 
222
+ message ProxyArbiWalletChatMediaRequest {
223
+ int32 wallet_user_id = 1;
224
+ string url = 2;
225
+ }
226
+
227
+ message ProxyArbiWalletChatMediaResponse {
228
+ int32 http_status = 1;
229
+ bytes body = 2;
230
+ string content_type = 3;
231
+ }
232
+
233
+ message GetSupportChatLastReadRequest {
234
+ int32 wallet_user_id = 1;
235
+ }
236
+
237
+ message GetSupportChatLastReadResponse {
238
+ int32 last_read_message_id = 1;
239
+ }
240
+
241
+ message SetSupportChatLastReadRequest {
242
+ int32 wallet_user_id = 1;
243
+ int32 last_read_message_id = 2;
244
+ }
245
+
246
+ message SetSupportChatLastReadResponse {
247
+ bool ok = 1;
248
+ }
249
+
214
250
  message UserBalance {
215
251
  string asset = 1;
216
252
  string network = 2;