@rentbase/common 1.0.13 → 1.0.14

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.
@@ -4,21 +4,16 @@
4
4
  */
5
5
  export interface ChatSessionCreatedEvent {
6
6
  session_id: string;
7
- session_type: "property" | "trip" | "support" | "system";
7
+ session_type: "property" | "support" | "system";
8
8
  property_id?: string;
9
- trip_id?: string;
10
- seat_booking_id?: string;
11
9
  tenant_auth_user_id?: string;
12
10
  landlord_auth_user_id?: string;
13
- rider_auth_user_id?: string;
14
- driver_auth_user_id?: string;
15
11
  participant_count: number;
16
12
  created_at: string;
17
13
  }
18
14
  export interface ChatSessionClosedEvent {
19
15
  session_id: string;
20
16
  property_id?: string;
21
- trip_id?: string;
22
17
  closed_by_auth_user_id?: string;
23
18
  reason?: string;
24
19
  total_messages: number;
@@ -29,7 +24,7 @@ export interface ChatParticipantMutedEvent {
29
24
  session_id: string;
30
25
  property_id?: string;
31
26
  auth_user_id: string;
32
- role: "tenant" | "landlord" | "rider" | "driver" | "support_agent";
27
+ role: "tenant" | "landlord" | "support_agent";
33
28
  muted: boolean;
34
29
  muted_at: string;
35
30
  }
@@ -37,9 +32,8 @@ export interface MessageSentEvent {
37
32
  message_id: string;
38
33
  session_id: string;
39
34
  property_id?: string;
40
- trip_id?: string;
41
35
  sender_auth_user_id: string;
42
- sender_role: "tenant" | "landlord" | "rider" | "driver" | "support_agent";
36
+ sender_role: "tenant" | "landlord" | "support_agent";
43
37
  message_type: "text" | "image" | "audio" | "system";
44
38
  has_attachments: boolean;
45
39
  attachment_count: number;
@@ -47,6 +41,17 @@ export interface MessageSentEvent {
47
41
  system_event_key?: string;
48
42
  sent_at: string;
49
43
  }
44
+ /**
45
+ * ChatPushMessageCreatedEvent
46
+ * Push-friendly event emitted by chat-messaging-service.
47
+ * Includes explicit recipients so notifications-service can send push without extra DB lookups.
48
+ */
49
+ export interface ChatPushMessageCreatedEvent {
50
+ sessionId: string;
51
+ senderAuthUserId: string;
52
+ recipientAuthUserIds: string[];
53
+ previewText?: string;
54
+ }
50
55
  export interface MessageDeliveredEvent {
51
56
  message_id: string;
52
57
  session_id: string;
@@ -66,7 +71,6 @@ export interface SystemMessageAddedEvent {
66
71
  message_id: string;
67
72
  session_id: string;
68
73
  property_id?: string;
69
- trip_id?: string;
70
74
  system_event_key: string;
71
75
  message_text: string;
72
76
  added_at: string;
@@ -74,12 +78,11 @@ export interface SystemMessageAddedEvent {
74
78
  export interface CallInitiatedEvent {
75
79
  call_session_id: string;
76
80
  property_id?: string;
77
- trip_id?: string;
78
81
  chat_session_id?: string;
79
82
  caller_auth_user_id: string;
80
- caller_role: "tenant" | "landlord" | "rider" | "driver" | "support_agent";
83
+ caller_role: "tenant" | "landlord" | "support_agent";
81
84
  callee_auth_user_id: string;
82
- callee_role: "tenant" | "landlord" | "rider" | "driver" | "support_agent";
85
+ callee_role: "tenant" | "landlord" | "support_agent";
83
86
  call_type: "audio" | "video";
84
87
  provider_name: string;
85
88
  provider_room_id: string;
@@ -87,6 +90,8 @@ export interface CallInitiatedEvent {
87
90
  }
88
91
  export interface CallRingingEvent {
89
92
  call_session_id: string;
93
+ chat_session_id?: string;
94
+ property_id?: string;
90
95
  caller_auth_user_id: string;
91
96
  callee_auth_user_id: string;
92
97
  call_type: "audio" | "video";
@@ -95,6 +100,8 @@ export interface CallRingingEvent {
95
100
  }
96
101
  export interface CallAnsweredEvent {
97
102
  call_session_id: string;
103
+ chat_session_id?: string;
104
+ property_id?: string;
98
105
  caller_auth_user_id: string;
99
106
  callee_auth_user_id: string;
100
107
  call_type: "audio" | "video";
@@ -103,6 +110,8 @@ export interface CallAnsweredEvent {
103
110
  }
104
111
  export interface CallRejectedEvent {
105
112
  call_session_id: string;
113
+ chat_session_id?: string;
114
+ property_id?: string;
106
115
  caller_auth_user_id: string;
107
116
  callee_auth_user_id: string;
108
117
  rejected_by_auth_user_id: string;
@@ -111,6 +120,8 @@ export interface CallRejectedEvent {
111
120
  }
112
121
  export interface CallMissedEvent {
113
122
  call_session_id: string;
123
+ chat_session_id?: string;
124
+ property_id?: string;
114
125
  caller_auth_user_id: string;
115
126
  callee_auth_user_id: string;
116
127
  ring_duration_seconds?: number;
@@ -118,6 +129,8 @@ export interface CallMissedEvent {
118
129
  }
119
130
  export interface CallEndedEvent {
120
131
  call_session_id: string;
132
+ chat_session_id?: string;
133
+ property_id?: string;
121
134
  caller_auth_user_id: string;
122
135
  callee_auth_user_id: string;
123
136
  call_type: "audio" | "video";
@@ -128,6 +141,8 @@ export interface CallEndedEvent {
128
141
  }
129
142
  export interface CallFailedEvent {
130
143
  call_session_id: string;
144
+ chat_session_id?: string;
145
+ property_id?: string;
131
146
  caller_auth_user_id: string;
132
147
  callee_auth_user_id: string;
133
148
  error_code?: string;
@@ -137,6 +152,8 @@ export interface CallFailedEvent {
137
152
  }
138
153
  export interface CallRatedEvent {
139
154
  call_session_id: string;
155
+ chat_session_id?: string;
156
+ property_id?: string;
140
157
  rated_by_auth_user_id: string;
141
158
  rated_as: "caller" | "callee";
142
159
  rating: number;
@@ -145,6 +162,8 @@ export interface CallRatedEvent {
145
162
  }
146
163
  export interface CallProviderStatusUpdateEvent {
147
164
  call_session_id: string;
165
+ chat_session_id?: string;
166
+ property_id?: string;
148
167
  provider_name: string;
149
168
  provider_status: string;
150
169
  previous_status: string;
@@ -5,7 +5,8 @@ import { PropertyCreatedEvent, PropertyUpdatedEvent, PropertyStatusChangedEvent,
5
5
  import { NotificationCreatedEvent, NotificationSentEvent, NotificationDeliveredEvent, NotificationFailedEvent, NotificationReadEvent, NotificationPreferencesUpdatedEvent, NotificationTemplateCreatedEvent, NotificationTemplateUpdatedEvent, NotificationBulkSendInitiatedEvent, NotificationBulkSendCompletedEvent } from "./notification-events";
6
6
  import { IncidentReportCreatedEvent, IncidentReportUpdatedEvent, IncidentReportResolvedEvent, SOSTriggeredEvent, SOSAcknowledgedEvent, SOSRespondingEvent, SOSResolvedEvent, DisciplinaryActionCreatedEvent, DisciplinaryActionActivatedEvent, DisciplinaryActionRevokedEvent, SafetyNoteCreatedEvent, SafetyAuditLogCreatedEvent } from "./safety-events";
7
7
  import { WalletCreatedEvent, WalletAdjustedEvent, WalletBalanceUpdatedEvent, WalletStatusChangedEvent, WalletTransactionCreatedEvent, TransactionStatusChangedEvent, PaymentIntentCreatedEvent, PaymentIntentSucceededEvent, PaymentIntentFailedEvent, PaymentIntentCancelledEvent, PaymentChargeRefundedEvent, PayoutRequestedEvent, PayoutApprovedEvent, PayoutProcessingEvent, PayoutSucceededEvent, PayoutFailedEvent, PayoutCancelledEvent, WebhookReceivedEvent, WebhookProcessedEvent } from "./payment-events";
8
- import { ChatSessionCreatedEvent, ChatSessionClosedEvent, ChatParticipantMutedEvent, MessageSentEvent, MessageDeliveredEvent, MessageReadEvent, SystemMessageAddedEvent, CallInitiatedEvent, CallRingingEvent, CallAnsweredEvent, CallRejectedEvent, CallMissedEvent, CallEndedEvent, CallFailedEvent, CallRatedEvent, CallProviderStatusUpdateEvent } from "./chat-events";
8
+ import { ChatSessionCreatedEvent, ChatSessionClosedEvent, ChatParticipantMutedEvent, ChatPushMessageCreatedEvent, MessageSentEvent, MessageDeliveredEvent, MessageReadEvent, SystemMessageAddedEvent, CallInitiatedEvent, CallRingingEvent, CallAnsweredEvent, CallRejectedEvent, CallMissedEvent, CallEndedEvent, CallFailedEvent, CallRatedEvent, CallProviderStatusUpdateEvent } from "./chat-events";
9
+ import { PropertyEnquiryCreatedEvent, PropertyEnquiryStatusChangedEvent } from "./property-enquiry-events";
9
10
  import { CampaignCreatedEvent, CampaignActivatedEvent, CampaignStatusChangedEvent, CampaignExpiredEvent, PromoCodeCreatedEvent, PromoCodeBulkCreatedEvent, PromoCodeAppliedEvent, PromoCodeStatusChangedEvent, ReferralCodeGeneratedEvent, ReferralClaimedEvent, ReferralQualifiedEvent, ReferralRewardsGrantedEvent, ReferralStatusChangedEvent, RewardCreditIssuedEvent, RewardCreditUsedEvent, RewardCreditExpiredEvent, RewardCreditCancelledEvent, DiscountCalculatedEvent, DiscountAppliedEvent, CampaignRedemptionEvent, ReferralConversionEvent } from "./promotion-events";
10
11
  import { KycDocumentUploadedEvent, KycDocumentVerifiedEvent, KycDocumentRejectedEvent, KycDocumentDeletedEvent, LandlordApplicationCreatedEvent, LandlordApplicationSubmittedEvent, LandlordApplicationUnderReviewEvent, LandlordApplicationNeedsInfoEvent, LandlordApplicationApprovedEvent, LandlordApplicationRejectedEvent, LandlordApplicationUpdatedEvent } from "./kyc-events";
11
12
  export interface EventMap {
@@ -24,6 +25,8 @@ export interface EventMap {
24
25
  "property.status_changed": PropertyStatusChangedEvent;
25
26
  "property.deleted": PropertyDeletedEvent;
26
27
  "property.viewed": PropertyViewedEvent;
28
+ "property.enquiry.created": PropertyEnquiryCreatedEvent;
29
+ "property.enquiry.status.changed": PropertyEnquiryStatusChangedEvent;
27
30
  "property_offer.created": PropertyOfferCreatedEvent;
28
31
  "property_offer.updated": PropertyOfferUpdatedEvent;
29
32
  "property_offer.accepted": PropertyOfferAcceptedEvent;
@@ -89,6 +92,7 @@ export interface EventMap {
89
92
  "chat.session.created": ChatSessionCreatedEvent;
90
93
  "chat.session.closed": ChatSessionClosedEvent;
91
94
  "chat.participant.muted": ChatParticipantMutedEvent;
95
+ "chat.push.message.created": ChatPushMessageCreatedEvent;
92
96
  "message.sent": MessageSentEvent;
93
97
  "message.delivered": MessageDeliveredEvent;
94
98
  "message.read": MessageReadEvent;
@@ -139,6 +143,7 @@ export * from "./request-events";
139
143
  export * from "./geo-config-events";
140
144
  export * from "./user-events";
141
145
  export * from "./property-events";
146
+ export * from "./property-enquiry-events";
142
147
  export * from "./notification-events";
143
148
  export * from "./safety-events";
144
149
  export * from "./payment-events";
@@ -15,6 +15,7 @@ __exportStar(require("./request-events"), exports);
15
15
  __exportStar(require("./geo-config-events"), exports);
16
16
  __exportStar(require("./user-events"), exports);
17
17
  __exportStar(require("./property-events"), exports);
18
+ __exportStar(require("./property-enquiry-events"), exports);
18
19
  __exportStar(require("./notification-events"), exports);
19
20
  __exportStar(require("./safety-events"), exports);
20
21
  __exportStar(require("./payment-events"), exports);
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Property Enquiry Events
3
+ * Custom events emitted by property-service for enquiry/request workflows.
4
+ */
5
+ export declare type PropertyEnquiryRequestType = "viewing" | "offer" | "get";
6
+ export declare type PropertyEnquiryStatus = "pending" | "accepted" | "declined" | "expired" | "cancelled_by_tenant" | "cancelled_by_landlord";
7
+ export interface PropertyEnquiryCreatedEvent {
8
+ enquiryId: string;
9
+ propertyId: string;
10
+ requestType: PropertyEnquiryRequestType;
11
+ tenantAuthUserId: string;
12
+ landlordAuthUserId: string;
13
+ tenantMessage?: string;
14
+ }
15
+ export interface PropertyEnquiryStatusChangedEvent {
16
+ enquiryId: string;
17
+ propertyId: string;
18
+ requestType: PropertyEnquiryRequestType;
19
+ tenantAuthUserId: string;
20
+ landlordAuthUserId: string;
21
+ fromStatus?: PropertyEnquiryStatus;
22
+ toStatus: PropertyEnquiryStatus;
23
+ actorAuthUserId?: string;
24
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ /**
3
+ * Property Enquiry Events
4
+ * Custom events emitted by property-service for enquiry/request workflows.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rentbase/common",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "common library for rentbase",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",