@aepstore-dev/contracts 1.105.0 → 1.106.0

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/payments.d.ts CHANGED
@@ -3,6 +3,23 @@ export declare const protobufPackage = "payments.v1";
3
3
  export interface Ok {
4
4
  ok: boolean;
5
5
  }
6
+ export interface GetSupportPurchasesContextRequest {
7
+ userId: string;
8
+ /** clamped to 1..5 by payments-service */
9
+ limit: number;
10
+ }
11
+ export interface SupportPurchaseContext {
12
+ purchaseId: string;
13
+ status: string;
14
+ createdAt: string;
15
+ completedAt: string;
16
+ productId: string;
17
+ productName: string;
18
+ accessStatus: string;
19
+ }
20
+ export interface SupportPurchasesContext {
21
+ items: SupportPurchaseContext[];
22
+ }
6
23
  /**
7
24
  * ---------------------------------------------------------------------------
8
25
  * Purchase / checkout / topup
@@ -638,6 +655,11 @@ export interface PaymentsServiceClient {
638
655
  getMyPurchases(request: GetMyPurchasesRequest): Observable<PurchasesListResponse>;
639
656
  getPurchase(request: GetPurchaseRequest): Observable<Purchase>;
640
657
  refundPurchase(request: RefundPurchaseRequest): Observable<Purchase>;
658
+ /**
659
+ * Internal, read-only purchase summary for support AI. No money-provider,
660
+ * card, ledger, payout or withdrawal data is exposed.
661
+ */
662
+ getSupportPurchasesContext(request: GetSupportPurchasesContextRequest): Observable<SupportPurchasesContext>;
641
663
  /** ----- wallet ----- */
642
664
  getWallet(request: GetWalletRequest): Observable<WalletResponse>;
643
665
  listTransactions(request: ListTransactionsRequest): Observable<TransactionsListResponse>;
@@ -720,6 +742,11 @@ export interface PaymentsServiceController {
720
742
  getMyPurchases(request: GetMyPurchasesRequest): Promise<PurchasesListResponse> | Observable<PurchasesListResponse> | PurchasesListResponse;
721
743
  getPurchase(request: GetPurchaseRequest): Promise<Purchase> | Observable<Purchase> | Purchase;
722
744
  refundPurchase(request: RefundPurchaseRequest): Promise<Purchase> | Observable<Purchase> | Purchase;
745
+ /**
746
+ * Internal, read-only purchase summary for support AI. No money-provider,
747
+ * card, ledger, payout or withdrawal data is exposed.
748
+ */
749
+ getSupportPurchasesContext(request: GetSupportPurchasesContextRequest): Promise<SupportPurchasesContext> | Observable<SupportPurchasesContext> | SupportPurchasesContext;
723
750
  /** ----- wallet ----- */
724
751
  getWallet(request: GetWalletRequest): Promise<WalletResponse> | Observable<WalletResponse> | WalletResponse;
725
752
  listTransactions(request: ListTransactionsRequest): Promise<TransactionsListResponse> | Observable<TransactionsListResponse> | TransactionsListResponse;
package/gen/payments.js CHANGED
@@ -19,6 +19,7 @@ function PaymentsServiceControllerMethods() {
19
19
  "getMyPurchases",
20
20
  "getPurchase",
21
21
  "refundPurchase",
22
+ "getSupportPurchasesContext",
22
23
  "getWallet",
23
24
  "listTransactions",
24
25
  "getTransactionMonths",
package/gen/payments.ts CHANGED
@@ -14,6 +14,26 @@ export interface Ok {
14
14
  ok: boolean;
15
15
  }
16
16
 
17
+ export interface GetSupportPurchasesContextRequest {
18
+ userId: string;
19
+ /** clamped to 1..5 by payments-service */
20
+ limit: number;
21
+ }
22
+
23
+ export interface SupportPurchaseContext {
24
+ purchaseId: string;
25
+ status: string;
26
+ createdAt: string;
27
+ completedAt: string;
28
+ productId: string;
29
+ productName: string;
30
+ accessStatus: string;
31
+ }
32
+
33
+ export interface SupportPurchasesContext {
34
+ items: SupportPurchaseContext[];
35
+ }
36
+
17
37
  /**
18
38
  * ---------------------------------------------------------------------------
19
39
  * Purchase / checkout / topup
@@ -730,6 +750,13 @@ export interface PaymentsServiceClient {
730
750
 
731
751
  refundPurchase(request: RefundPurchaseRequest): Observable<Purchase>;
732
752
 
753
+ /**
754
+ * Internal, read-only purchase summary for support AI. No money-provider,
755
+ * card, ledger, payout or withdrawal data is exposed.
756
+ */
757
+
758
+ getSupportPurchasesContext(request: GetSupportPurchasesContextRequest): Observable<SupportPurchasesContext>;
759
+
733
760
  /** ----- wallet ----- */
734
761
 
735
762
  getWallet(request: GetWalletRequest): Observable<WalletResponse>;
@@ -867,6 +894,15 @@ export interface PaymentsServiceController {
867
894
 
868
895
  refundPurchase(request: RefundPurchaseRequest): Promise<Purchase> | Observable<Purchase> | Purchase;
869
896
 
897
+ /**
898
+ * Internal, read-only purchase summary for support AI. No money-provider,
899
+ * card, ledger, payout or withdrawal data is exposed.
900
+ */
901
+
902
+ getSupportPurchasesContext(
903
+ request: GetSupportPurchasesContextRequest,
904
+ ): Promise<SupportPurchasesContext> | Observable<SupportPurchasesContext> | SupportPurchasesContext;
905
+
870
906
  /** ----- wallet ----- */
871
907
 
872
908
  getWallet(request: GetWalletRequest): Promise<WalletResponse> | Observable<WalletResponse> | WalletResponse;
@@ -1027,6 +1063,7 @@ export function PaymentsServiceControllerMethods() {
1027
1063
  "getMyPurchases",
1028
1064
  "getPurchase",
1029
1065
  "refundPurchase",
1066
+ "getSupportPurchasesContext",
1030
1067
  "getWallet",
1031
1068
  "listTransactions",
1032
1069
  "getTransactionMonths",
package/gen/support.d.ts CHANGED
@@ -46,6 +46,9 @@ export interface Ticket {
46
46
  reportedAt: string;
47
47
  /** SUPPORT|USER, empty when no one is expected (e.g. CLOSED) */
48
48
  waitingFor: string;
49
+ /** WEB|TELEGRAM */
50
+ originChannel: string;
51
+ contactId: string;
49
52
  }
50
53
  export interface TicketAssignee {
51
54
  id: string;
@@ -78,6 +81,14 @@ export interface TicketMessage {
78
81
  isReadByStaff: boolean;
79
82
  /** first known staff read timestamp for this message, '' if unread */
80
83
  staffReadAt: string;
84
+ /** USER|GUEST|STAFF|AI|SYSTEM */
85
+ authorType: string;
86
+ aiCitations: AiCitation[];
87
+ }
88
+ export interface AiCitation {
89
+ sourceId: string;
90
+ title: string;
91
+ reference: string;
81
92
  }
82
93
  export interface TicketAttachment {
83
94
  fileName: string;
@@ -327,6 +338,95 @@ export interface TicketsListResponse {
327
338
  page: number;
328
339
  limit: number;
329
340
  }
341
+ export interface ChannelIdentity {
342
+ channel: string;
343
+ externalUserId: string;
344
+ externalChatId: string;
345
+ username: string;
346
+ displayName: string;
347
+ locale: string;
348
+ }
349
+ export interface GetChannelSessionRequest {
350
+ identity: ChannelIdentity | undefined;
351
+ correlationId: string;
352
+ }
353
+ export interface ChannelSession {
354
+ identityId: string;
355
+ contactId: string;
356
+ userId: string;
357
+ isLinked: boolean;
358
+ activeTicket: Ticket | undefined;
359
+ }
360
+ export interface CreateChannelTicketRequest {
361
+ identity: ChannelIdentity | undefined;
362
+ externalEventId: string;
363
+ idempotencyKey: string;
364
+ correlationId: string;
365
+ subject: string;
366
+ body: string;
367
+ category: string;
368
+ }
369
+ export interface AppendChannelMessageRequest {
370
+ identity: ChannelIdentity | undefined;
371
+ externalEventId: string;
372
+ idempotencyKey: string;
373
+ correlationId: string;
374
+ body: string;
375
+ }
376
+ export interface ChannelMutationResponse {
377
+ session: ChannelSession | undefined;
378
+ message: TicketMessage | undefined;
379
+ duplicate: boolean;
380
+ }
381
+ export interface RequestHumanHandoffRequest {
382
+ identity: ChannelIdentity | undefined;
383
+ externalEventId: string;
384
+ correlationId: string;
385
+ }
386
+ export interface CloseChannelTicketRequest {
387
+ identity: ChannelIdentity | undefined;
388
+ externalEventId: string;
389
+ correlationId: string;
390
+ }
391
+ export interface LinkChannelIdentityRequest {
392
+ identity: ChannelIdentity | undefined;
393
+ /** trusted gateway result, never accepted from the bot body */
394
+ userId: string;
395
+ correlationId: string;
396
+ }
397
+ export interface ChannelDelivery {
398
+ id: string;
399
+ channel: string;
400
+ recipientExternalChatId: string;
401
+ body: string;
402
+ status: string;
403
+ attempts: number;
404
+ correlationId: string;
405
+ createdAt: string;
406
+ }
407
+ export interface LeaseChannelDeliveriesRequest {
408
+ channel: string;
409
+ workerId: string;
410
+ limit: number;
411
+ leaseSeconds: number;
412
+ }
413
+ export interface ChannelDeliveriesResponse {
414
+ items: ChannelDelivery[];
415
+ }
416
+ export interface AcknowledgeChannelDeliveryRequest {
417
+ deliveryId: string;
418
+ workerId: string;
419
+ providerMessageId: string;
420
+ correlationId: string;
421
+ }
422
+ export interface FailChannelDeliveryRequest {
423
+ deliveryId: string;
424
+ workerId: string;
425
+ errorCode: string;
426
+ retryAfterMs: number;
427
+ permanent: boolean;
428
+ correlationId: string;
429
+ }
330
430
  export declare const SUPPORT_V1_PACKAGE_NAME = "support.v1";
331
431
  /**
332
432
  * Support ticket system (G1). Enums as strings matching the DB:
@@ -356,6 +456,19 @@ export interface SupportServiceClient {
356
456
  getTicketCreationBan(request: GetTicketCreationBanRequest): Observable<TicketCreationBanState>;
357
457
  setTicketCreationBan(request: SetTicketCreationBanRequest): Observable<SupportTicketBan>;
358
458
  clearTicketCreationBan(request: ClearTicketCreationBanRequest): Observable<TicketCreationBanState>;
459
+ /**
460
+ * Internal channel adapter API. Gateway authenticates the external channel
461
+ * and forwards only validated identifiers to these methods.
462
+ */
463
+ getChannelSession(request: GetChannelSessionRequest): Observable<ChannelSession>;
464
+ createChannelTicket(request: CreateChannelTicketRequest): Observable<ChannelMutationResponse>;
465
+ appendChannelMessage(request: AppendChannelMessageRequest): Observable<ChannelMutationResponse>;
466
+ requestHumanHandoff(request: RequestHumanHandoffRequest): Observable<ChannelSession>;
467
+ closeChannelTicket(request: CloseChannelTicketRequest): Observable<ChannelSession>;
468
+ linkChannelIdentity(request: LinkChannelIdentityRequest): Observable<ChannelSession>;
469
+ leaseChannelDeliveries(request: LeaseChannelDeliveriesRequest): Observable<ChannelDeliveriesResponse>;
470
+ acknowledgeChannelDelivery(request: AcknowledgeChannelDeliveryRequest): Observable<ChannelDelivery>;
471
+ failChannelDelivery(request: FailChannelDeliveryRequest): Observable<ChannelDelivery>;
359
472
  }
360
473
  /**
361
474
  * Support ticket system (G1). Enums as strings matching the DB:
@@ -385,6 +498,19 @@ export interface SupportServiceController {
385
498
  getTicketCreationBan(request: GetTicketCreationBanRequest): Promise<TicketCreationBanState> | Observable<TicketCreationBanState> | TicketCreationBanState;
386
499
  setTicketCreationBan(request: SetTicketCreationBanRequest): Promise<SupportTicketBan> | Observable<SupportTicketBan> | SupportTicketBan;
387
500
  clearTicketCreationBan(request: ClearTicketCreationBanRequest): Promise<TicketCreationBanState> | Observable<TicketCreationBanState> | TicketCreationBanState;
501
+ /**
502
+ * Internal channel adapter API. Gateway authenticates the external channel
503
+ * and forwards only validated identifiers to these methods.
504
+ */
505
+ getChannelSession(request: GetChannelSessionRequest): Promise<ChannelSession> | Observable<ChannelSession> | ChannelSession;
506
+ createChannelTicket(request: CreateChannelTicketRequest): Promise<ChannelMutationResponse> | Observable<ChannelMutationResponse> | ChannelMutationResponse;
507
+ appendChannelMessage(request: AppendChannelMessageRequest): Promise<ChannelMutationResponse> | Observable<ChannelMutationResponse> | ChannelMutationResponse;
508
+ requestHumanHandoff(request: RequestHumanHandoffRequest): Promise<ChannelSession> | Observable<ChannelSession> | ChannelSession;
509
+ closeChannelTicket(request: CloseChannelTicketRequest): Promise<ChannelSession> | Observable<ChannelSession> | ChannelSession;
510
+ linkChannelIdentity(request: LinkChannelIdentityRequest): Promise<ChannelSession> | Observable<ChannelSession> | ChannelSession;
511
+ leaseChannelDeliveries(request: LeaseChannelDeliveriesRequest): Promise<ChannelDeliveriesResponse> | Observable<ChannelDeliveriesResponse> | ChannelDeliveriesResponse;
512
+ acknowledgeChannelDelivery(request: AcknowledgeChannelDeliveryRequest): Promise<ChannelDelivery> | Observable<ChannelDelivery> | ChannelDelivery;
513
+ failChannelDelivery(request: FailChannelDeliveryRequest): Promise<ChannelDelivery> | Observable<ChannelDelivery> | ChannelDelivery;
388
514
  }
389
515
  export declare function SupportServiceControllerMethods(): (constructor: Function) => void;
390
516
  export declare const SUPPORT_SERVICE_NAME = "SupportService";
package/gen/support.js CHANGED
@@ -34,6 +34,15 @@ function SupportServiceControllerMethods() {
34
34
  "getTicketCreationBan",
35
35
  "setTicketCreationBan",
36
36
  "clearTicketCreationBan",
37
+ "getChannelSession",
38
+ "createChannelTicket",
39
+ "appendChannelMessage",
40
+ "requestHumanHandoff",
41
+ "closeChannelTicket",
42
+ "linkChannelIdentity",
43
+ "leaseChannelDeliveries",
44
+ "acknowledgeChannelDelivery",
45
+ "failChannelDelivery",
37
46
  ];
38
47
  for (const method of grpcMethods) {
39
48
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
package/gen/support.ts CHANGED
@@ -58,6 +58,9 @@ export interface Ticket {
58
58
  reportedAt: string;
59
59
  /** SUPPORT|USER, empty when no one is expected (e.g. CLOSED) */
60
60
  waitingFor: string;
61
+ /** WEB|TELEGRAM */
62
+ originChannel: string;
63
+ contactId: string;
61
64
  }
62
65
 
63
66
  export interface TicketAssignee {
@@ -92,6 +95,15 @@ export interface TicketMessage {
92
95
  isReadByStaff: boolean;
93
96
  /** first known staff read timestamp for this message, '' if unread */
94
97
  staffReadAt: string;
98
+ /** USER|GUEST|STAFF|AI|SYSTEM */
99
+ authorType: string;
100
+ aiCitations: AiCitation[];
101
+ }
102
+
103
+ export interface AiCitation {
104
+ sourceId: string;
105
+ title: string;
106
+ reference: string;
95
107
  }
96
108
 
97
109
  export interface TicketAttachment {
@@ -371,6 +383,111 @@ export interface TicketsListResponse {
371
383
  limit: number;
372
384
  }
373
385
 
386
+ export interface ChannelIdentity {
387
+ channel: string;
388
+ externalUserId: string;
389
+ externalChatId: string;
390
+ username: string;
391
+ displayName: string;
392
+ locale: string;
393
+ }
394
+
395
+ export interface GetChannelSessionRequest {
396
+ identity: ChannelIdentity | undefined;
397
+ correlationId: string;
398
+ }
399
+
400
+ export interface ChannelSession {
401
+ identityId: string;
402
+ contactId: string;
403
+ userId: string;
404
+ isLinked: boolean;
405
+ activeTicket: Ticket | undefined;
406
+ }
407
+
408
+ export interface CreateChannelTicketRequest {
409
+ identity: ChannelIdentity | undefined;
410
+ externalEventId: string;
411
+ idempotencyKey: string;
412
+ correlationId: string;
413
+ subject: string;
414
+ body: string;
415
+ category: string;
416
+ }
417
+
418
+ export interface AppendChannelMessageRequest {
419
+ identity: ChannelIdentity | undefined;
420
+ externalEventId: string;
421
+ idempotencyKey: string;
422
+ correlationId: string;
423
+ body: string;
424
+ }
425
+
426
+ export interface ChannelMutationResponse {
427
+ session: ChannelSession | undefined;
428
+ message: TicketMessage | undefined;
429
+ duplicate: boolean;
430
+ }
431
+
432
+ export interface RequestHumanHandoffRequest {
433
+ identity: ChannelIdentity | undefined;
434
+ externalEventId: string;
435
+ correlationId: string;
436
+ }
437
+
438
+ export interface CloseChannelTicketRequest {
439
+ identity: ChannelIdentity | undefined;
440
+ externalEventId: string;
441
+ correlationId: string;
442
+ }
443
+
444
+ export interface LinkChannelIdentityRequest {
445
+ identity:
446
+ | ChannelIdentity
447
+ | undefined;
448
+ /** trusted gateway result, never accepted from the bot body */
449
+ userId: string;
450
+ correlationId: string;
451
+ }
452
+
453
+ export interface ChannelDelivery {
454
+ id: string;
455
+ channel: string;
456
+ recipientExternalChatId: string;
457
+ body: string;
458
+ status: string;
459
+ attempts: number;
460
+ correlationId: string;
461
+ createdAt: string;
462
+ }
463
+
464
+ export interface LeaseChannelDeliveriesRequest {
465
+ channel: string;
466
+ workerId: string;
467
+ limit: number;
468
+ leaseSeconds: number;
469
+ }
470
+
471
+ export interface ChannelDeliveriesResponse {
472
+ items: ChannelDelivery[];
473
+ }
474
+
475
+ export interface AcknowledgeChannelDeliveryRequest {
476
+ deliveryId: string;
477
+ workerId: string;
478
+ providerMessageId: string;
479
+ correlationId: string;
480
+ }
481
+
482
+ export interface FailChannelDeliveryRequest {
483
+ deliveryId: string;
484
+ workerId: string;
485
+ errorCode: string;
486
+ retryAfterMs: number;
487
+ permanent: boolean;
488
+ correlationId: string;
489
+ }
490
+
374
491
  export const SUPPORT_V1_PACKAGE_NAME = "support.v1";
375
492
 
376
493
  /**
@@ -424,6 +541,29 @@ export interface SupportServiceClient {
424
541
  setTicketCreationBan(request: SetTicketCreationBanRequest): Observable<SupportTicketBan>;
425
542
 
426
543
  clearTicketCreationBan(request: ClearTicketCreationBanRequest): Observable<TicketCreationBanState>;
544
+
545
+ /**
546
+ * Internal channel adapter API. Gateway authenticates the external channel
547
+ * and forwards only validated identifiers to these methods.
548
+ */
549
+
550
+ getChannelSession(request: GetChannelSessionRequest): Observable<ChannelSession>;
551
+
552
+ createChannelTicket(request: CreateChannelTicketRequest): Observable<ChannelMutationResponse>;
553
+
554
+ appendChannelMessage(request: AppendChannelMessageRequest): Observable<ChannelMutationResponse>;
555
+
556
+ requestHumanHandoff(request: RequestHumanHandoffRequest): Observable<ChannelSession>;
557
+
558
+ closeChannelTicket(request: CloseChannelTicketRequest): Observable<ChannelSession>;
559
+
560
+ linkChannelIdentity(request: LinkChannelIdentityRequest): Observable<ChannelSession>;
561
+
562
+ leaseChannelDeliveries(request: LeaseChannelDeliveriesRequest): Observable<ChannelDeliveriesResponse>;
563
+
564
+ acknowledgeChannelDelivery(request: AcknowledgeChannelDeliveryRequest): Observable<ChannelDelivery>;
565
+
566
+ failChannelDelivery(request: FailChannelDeliveryRequest): Observable<ChannelDelivery>;
427
567
  }
428
568
 
429
569
  /**
@@ -501,6 +641,47 @@ export interface SupportServiceController {
501
641
  clearTicketCreationBan(
502
642
  request: ClearTicketCreationBanRequest,
503
643
  ): Promise<TicketCreationBanState> | Observable<TicketCreationBanState> | TicketCreationBanState;
644
+
645
+ /**
646
+ * Internal channel adapter API. Gateway authenticates the external channel
647
+ * and forwards only validated identifiers to these methods.
648
+ */
649
+
650
+ getChannelSession(
651
+ request: GetChannelSessionRequest,
652
+ ): Promise<ChannelSession> | Observable<ChannelSession> | ChannelSession;
653
+
654
+ createChannelTicket(
655
+ request: CreateChannelTicketRequest,
656
+ ): Promise<ChannelMutationResponse> | Observable<ChannelMutationResponse> | ChannelMutationResponse;
657
+
658
+ appendChannelMessage(
659
+ request: AppendChannelMessageRequest,
660
+ ): Promise<ChannelMutationResponse> | Observable<ChannelMutationResponse> | ChannelMutationResponse;
661
+
662
+ requestHumanHandoff(
663
+ request: RequestHumanHandoffRequest,
664
+ ): Promise<ChannelSession> | Observable<ChannelSession> | ChannelSession;
665
+
666
+ closeChannelTicket(
667
+ request: CloseChannelTicketRequest,
668
+ ): Promise<ChannelSession> | Observable<ChannelSession> | ChannelSession;
669
+
670
+ linkChannelIdentity(
671
+ request: LinkChannelIdentityRequest,
672
+ ): Promise<ChannelSession> | Observable<ChannelSession> | ChannelSession;
673
+
674
+ leaseChannelDeliveries(
675
+ request: LeaseChannelDeliveriesRequest,
676
+ ): Promise<ChannelDeliveriesResponse> | Observable<ChannelDeliveriesResponse> | ChannelDeliveriesResponse;
677
+
678
+ acknowledgeChannelDelivery(
679
+ request: AcknowledgeChannelDeliveryRequest,
680
+ ): Promise<ChannelDelivery> | Observable<ChannelDelivery> | ChannelDelivery;
681
+
682
+ failChannelDelivery(
683
+ request: FailChannelDeliveryRequest,
684
+ ): Promise<ChannelDelivery> | Observable<ChannelDelivery> | ChannelDelivery;
504
685
  }
505
686
 
506
687
  export function SupportServiceControllerMethods() {
@@ -526,6 +707,15 @@ export function SupportServiceControllerMethods() {
526
707
  "getTicketCreationBan",
527
708
  "setTicketCreationBan",
528
709
  "clearTicketCreationBan",
710
+ "getChannelSession",
711
+ "createChannelTicket",
712
+ "appendChannelMessage",
713
+ "requestHumanHandoff",
714
+ "closeChannelTicket",
715
+ "linkChannelIdentity",
716
+ "leaseChannelDeliveries",
717
+ "acknowledgeChannelDelivery",
718
+ "failChannelDelivery",
529
719
  ];
530
720
  for (const method of grpcMethods) {
531
721
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
package/gen/users.d.ts CHANGED
@@ -26,6 +26,19 @@ export declare enum PremiumPeriod {
26
26
  export interface Ok {
27
27
  ok: boolean;
28
28
  }
29
+ export interface GetSupportUserContextRequest {
30
+ userId: string;
31
+ }
32
+ export interface SupportUserContext {
33
+ userId: string;
34
+ username: string;
35
+ fullName: string;
36
+ accountStatus: string;
37
+ isVerified: boolean;
38
+ createdAt: string;
39
+ locale: string;
40
+ roles: string[];
41
+ }
29
42
  export interface User {
30
43
  id: string;
31
44
  email: string;
@@ -779,6 +792,8 @@ export interface UsersServiceClient {
779
792
  collectUserExportData(request: CollectUserExportDataRequest): Observable<CollectUserExportDataResponse>;
780
793
  /** Unified read for the settings page */
781
794
  getAccountSettings(request: GetAccountSettingsRequest): Observable<AccountSettingsResponse>;
795
+ /** Internal, read-only and deliberately minimal context for support AI. */
796
+ getSupportUserContext(request: GetSupportUserContextRequest): Observable<SupportUserContext>;
782
797
  /** Password — separate from generic createCode/verifyCode reset flow. */
783
798
  changePassword(request: ChangePasswordRequest): Observable<Ok>;
784
799
  }
@@ -847,6 +862,8 @@ export interface UsersServiceController {
847
862
  collectUserExportData(request: CollectUserExportDataRequest): Promise<CollectUserExportDataResponse> | Observable<CollectUserExportDataResponse> | CollectUserExportDataResponse;
848
863
  /** Unified read for the settings page */
849
864
  getAccountSettings(request: GetAccountSettingsRequest): Promise<AccountSettingsResponse> | Observable<AccountSettingsResponse> | AccountSettingsResponse;
865
+ /** Internal, read-only and deliberately minimal context for support AI. */
866
+ getSupportUserContext(request: GetSupportUserContextRequest): Promise<SupportUserContext> | Observable<SupportUserContext> | SupportUserContext;
850
867
  /** Password — separate from generic createCode/verifyCode reset flow. */
851
868
  changePassword(request: ChangePasswordRequest): Promise<Ok> | Observable<Ok> | Ok;
852
869
  }
package/gen/users.js CHANGED
@@ -78,6 +78,7 @@ function UsersServiceControllerMethods() {
78
78
  "completeDataExport",
79
79
  "collectUserExportData",
80
80
  "getAccountSettings",
81
+ "getSupportUserContext",
81
82
  "changePassword",
82
83
  ];
83
84
  for (const method of grpcMethods) {
package/gen/users.ts CHANGED
@@ -40,6 +40,21 @@ export interface Ok {
40
40
  ok: boolean;
41
41
  }
42
42
 
43
+ export interface GetSupportUserContextRequest {
44
+ userId: string;
45
+ }
46
+
47
+ export interface SupportUserContext {
48
+ userId: string;
49
+ username: string;
50
+ fullName: string;
51
+ accountStatus: string;
52
+ isVerified: boolean;
53
+ createdAt: string;
54
+ locale: string;
55
+ roles: string[];
56
+ }
57
+
43
58
  export interface User {
44
59
  id: string;
45
60
  email: string;
@@ -941,6 +956,10 @@ export interface UsersServiceClient {
941
956
 
942
957
  getAccountSettings(request: GetAccountSettingsRequest): Observable<AccountSettingsResponse>;
943
958
 
959
+ /** Internal, read-only and deliberately minimal context for support AI. */
960
+
961
+ getSupportUserContext(request: GetSupportUserContextRequest): Observable<SupportUserContext>;
962
+
944
963
  /** Password — separate from generic createCode/verifyCode reset flow. */
945
964
 
946
965
  changePassword(request: ChangePasswordRequest): Observable<Ok>;
@@ -1126,6 +1145,12 @@ export interface UsersServiceController {
1126
1145
  request: GetAccountSettingsRequest,
1127
1146
  ): Promise<AccountSettingsResponse> | Observable<AccountSettingsResponse> | AccountSettingsResponse;
1128
1147
 
1148
+ /** Internal, read-only and deliberately minimal context for support AI. */
1149
+
1150
+ getSupportUserContext(
1151
+ request: GetSupportUserContextRequest,
1152
+ ): Promise<SupportUserContext> | Observable<SupportUserContext> | SupportUserContext;
1153
+
1129
1154
  /** Password — separate from generic createCode/verifyCode reset flow. */
1130
1155
 
1131
1156
  changePassword(request: ChangePasswordRequest): Promise<Ok> | Observable<Ok> | Ok;
@@ -1172,6 +1197,7 @@ export function UsersServiceControllerMethods() {
1172
1197
  "completeDataExport",
1173
1198
  "collectUserExportData",
1174
1199
  "getAccountSettings",
1200
+ "getSupportUserContext",
1175
1201
  "changePassword",
1176
1202
  ];
1177
1203
  for (const method of grpcMethods) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aepstore-dev/contracts",
3
- "version": "1.105.0",
3
+ "version": "1.106.0",
4
4
  "description": "Protobuf definitions for aepstore microservices",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -12,6 +12,9 @@ service PaymentsService {
12
12
  rpc GetMyPurchases(GetMyPurchasesRequest) returns (PurchasesListResponse);
13
13
  rpc GetPurchase(GetPurchaseRequest) returns (Purchase);
14
14
  rpc RefundPurchase(RefundPurchaseRequest) returns (Purchase);
15
+ // Internal, read-only purchase summary for support AI. No money-provider,
16
+ // card, ledger, payout or withdrawal data is exposed.
17
+ rpc GetSupportPurchasesContext(GetSupportPurchasesContextRequest) returns (SupportPurchasesContext);
15
18
 
16
19
  // ----- wallet -----
17
20
  rpc GetWallet(GetWalletRequest) returns (WalletResponse);
@@ -79,6 +82,25 @@ service PaymentsService {
79
82
 
80
83
  message Ok { bool ok = 1; }
81
84
 
85
+ message GetSupportPurchasesContextRequest {
86
+ string user_id = 1;
87
+ int32 limit = 2; // clamped to 1..5 by payments-service
88
+ }
89
+
90
+ message SupportPurchaseContext {
91
+ string purchase_id = 1;
92
+ string status = 2;
93
+ string created_at = 3;
94
+ string completed_at = 4;
95
+ string product_id = 5;
96
+ string product_name = 6;
97
+ string access_status = 7;
98
+ }
99
+
100
+ message SupportPurchasesContext {
101
+ repeated SupportPurchaseContext items = 1;
102
+ }
103
+
82
104
  // ---------------------------------------------------------------------------
83
105
  // Purchase / checkout / topup
84
106
  // ---------------------------------------------------------------------------
@@ -29,6 +29,18 @@ service SupportService {
29
29
  rpc GetTicketCreationBan(GetTicketCreationBanRequest) returns (TicketCreationBanState);
30
30
  rpc SetTicketCreationBan(SetTicketCreationBanRequest) returns (SupportTicketBan);
31
31
  rpc ClearTicketCreationBan(ClearTicketCreationBanRequest) returns (TicketCreationBanState);
32
+
33
+ // Internal channel adapter API. Gateway authenticates the external channel
34
+ // and forwards only validated identifiers to these methods.
35
+ rpc GetChannelSession(GetChannelSessionRequest) returns (ChannelSession);
36
+ rpc CreateChannelTicket(CreateChannelTicketRequest) returns (ChannelMutationResponse);
37
+ rpc AppendChannelMessage(AppendChannelMessageRequest) returns (ChannelMutationResponse);
38
+ rpc RequestHumanHandoff(RequestHumanHandoffRequest) returns (ChannelSession);
39
+ rpc CloseChannelTicket(CloseChannelTicketRequest) returns (ChannelSession);
40
+ rpc LinkChannelIdentity(LinkChannelIdentityRequest) returns (ChannelSession);
41
+ rpc LeaseChannelDeliveries(LeaseChannelDeliveriesRequest) returns (ChannelDeliveriesResponse);
42
+ rpc AcknowledgeChannelDelivery(AcknowledgeChannelDeliveryRequest) returns (ChannelDelivery);
43
+ rpc FailChannelDelivery(FailChannelDeliveryRequest) returns (ChannelDelivery);
32
44
  }
33
45
 
34
46
  message PingRequest { string message = 1; }
@@ -63,6 +75,8 @@ message Ticket {
63
75
  TicketAssignee assignee = 26;
64
76
  string reported_at = 27;
65
77
  string waiting_for = 28; // SUPPORT|USER, empty when no one is expected (e.g. CLOSED)
78
+ string origin_channel = 29; // WEB|TELEGRAM
79
+ string contact_id = 30;
66
80
  }
67
81
 
68
82
  message TicketAssignee {
@@ -91,6 +105,14 @@ message TicketMessage {
91
105
  string deleted_at = 12;
92
106
  bool is_read_by_staff = 13; // true for user messages already read by support staff
93
107
  string staff_read_at = 14; // first known staff read timestamp for this message, '' if unread
108
+ string author_type = 15; // USER|GUEST|STAFF|AI|SYSTEM
109
+ repeated AiCitation ai_citations = 16;
110
+ }
111
+
112
+ message AiCitation {
113
+ string source_id = 1;
114
+ string title = 2;
115
+ string reference = 3;
94
116
  }
95
117
 
96
118
  message TicketAttachment {
@@ -331,3 +353,109 @@ message TicketsListResponse {
331
353
  int32 page = 3;
332
354
  int32 limit = 4;
333
355
  }
356
+
357
+ // ---------------------------------------------------------------------------
358
+ // Channel adapters (internal only)
359
+ // ---------------------------------------------------------------------------
360
+
361
+ message ChannelIdentity {
362
+ string channel = 1;
363
+ string external_user_id = 2;
364
+ string external_chat_id = 3;
365
+ string username = 4;
366
+ string display_name = 5;
367
+ string locale = 6;
368
+ }
369
+
370
+ message GetChannelSessionRequest {
371
+ ChannelIdentity identity = 1;
372
+ string correlation_id = 2;
373
+ }
374
+
375
+ message ChannelSession {
376
+ string identity_id = 1;
377
+ string contact_id = 2;
378
+ string user_id = 3;
379
+ bool is_linked = 4;
380
+ Ticket active_ticket = 5;
381
+ }
382
+
383
+ message CreateChannelTicketRequest {
384
+ ChannelIdentity identity = 1;
385
+ string external_event_id = 2;
386
+ string idempotency_key = 3;
387
+ string correlation_id = 4;
388
+ string subject = 5;
389
+ string body = 6;
390
+ string category = 7;
391
+ }
392
+
393
+ message AppendChannelMessageRequest {
394
+ ChannelIdentity identity = 1;
395
+ string external_event_id = 2;
396
+ string idempotency_key = 3;
397
+ string correlation_id = 4;
398
+ string body = 5;
399
+ }
400
+
401
+ message ChannelMutationResponse {
402
+ ChannelSession session = 1;
403
+ TicketMessage message = 2;
404
+ bool duplicate = 3;
405
+ }
406
+
407
+ message RequestHumanHandoffRequest {
408
+ ChannelIdentity identity = 1;
409
+ string external_event_id = 2;
410
+ string correlation_id = 3;
411
+ }
412
+
413
+ message CloseChannelTicketRequest {
414
+ ChannelIdentity identity = 1;
415
+ string external_event_id = 2;
416
+ string correlation_id = 3;
417
+ }
418
+
419
+ message LinkChannelIdentityRequest {
420
+ ChannelIdentity identity = 1;
421
+ string user_id = 2; // trusted gateway result, never accepted from the bot body
422
+ string correlation_id = 3;
423
+ }
424
+
425
+ message ChannelDelivery {
426
+ string id = 1;
427
+ string channel = 2;
428
+ string recipient_external_chat_id = 3;
429
+ string body = 4;
430
+ string status = 5;
431
+ int32 attempts = 6;
432
+ string correlation_id = 7;
433
+ string created_at = 8;
434
+ }
435
+
436
+ message LeaseChannelDeliveriesRequest {
437
+ string channel = 1;
438
+ string worker_id = 2;
439
+ int32 limit = 3;
440
+ int32 lease_seconds = 4;
441
+ }
442
+
443
+ message ChannelDeliveriesResponse {
444
+ repeated ChannelDelivery items = 1;
445
+ }
446
+
447
+ message AcknowledgeChannelDeliveryRequest {
448
+ string delivery_id = 1;
449
+ string worker_id = 2;
450
+ string provider_message_id = 3;
451
+ string correlation_id = 4;
452
+ }
453
+
454
+ message FailChannelDeliveryRequest {
455
+ string delivery_id = 1;
456
+ string worker_id = 2;
457
+ string error_code = 3;
458
+ int32 retry_after_ms = 4;
459
+ bool permanent = 5;
460
+ string correlation_id = 6;
461
+ }
package/proto/users.proto CHANGED
@@ -64,12 +64,27 @@ service UsersService {
64
64
  // Unified read for the settings page
65
65
  rpc GetAccountSettings(GetAccountSettingsRequest) returns (AccountSettingsResponse);
66
66
 
67
+ // Internal, read-only and deliberately minimal context for support AI.
68
+ rpc GetSupportUserContext(GetSupportUserContextRequest) returns (SupportUserContext);
69
+
67
70
  // Password — separate from generic createCode/verifyCode reset flow.
68
71
  rpc ChangePassword(ChangePasswordRequest) returns (Ok);
69
72
  }
70
73
 
71
74
  message Ok { bool ok = 1; }
72
75
 
76
+ message GetSupportUserContextRequest { string user_id = 1; }
77
+ message SupportUserContext {
78
+ string user_id = 1;
79
+ string username = 2;
80
+ string full_name = 3;
81
+ string account_status = 4;
82
+ bool is_verified = 5;
83
+ string created_at = 6;
84
+ string locale = 7;
85
+ repeated string roles = 8;
86
+ }
87
+
73
88
  // =================================================================
74
89
  // Common types
75
90
  // =================================================================