hermes-chat-react 0.1.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.
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=chunk-D42PTTYC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/index.cjs ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/index.ts
17
+ var src_exports = {};
18
+ module.exports = __toCommonJS(src_exports);
19
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["\n\nexport type HermesConfig =\n | {\n endpoint: string;\n token: string; \n apiKey?: never;\n secret?: never;\n userId?: never;\n displayName?: never;\n avatar?: never;\n email?: never;\n }\n | {\n endpoint: string;\n token?: never;\n apiKey: string; \n secret: string; \n userId: string; \n displayName: string; \n avatar?: string;\n email?: string;\n };\n\nexport interface HermesUser {\n userId: string; \n displayName: string;\n avatar?: string;\n email?: string;\n}\n\nexport interface ConnectResponse {\n success: boolean;\n token: string;\n user: HermesUser;\n}\n\nexport type RoomType = \"direct\" | \"group\";\n\nexport interface Room {\n _id: string;\n name?: string;\n type: RoomType;\n projectId: string;\n createdBy: string;\n members: string[];\n admins: string[];\n avatar?: string;\n description?: string;\n lastMessage?: Message;\n lastActivity: string;\n unreadCount: number;\n isMuted: boolean;\n isPinned: boolean;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CreateDirectRoomInput {\n targetUserId: string; \n}\n\nexport interface CreateGroupRoomInput {\n name: string;\n memberIds: string[]; \n description?: string;\n avatar?: string;\n}\n\nexport type MessageType =\n | \"text\"\n | \"link\"\n | \"image\"\n | \"video\"\n | \"audio\"\n | \"document\";\nexport type DeliveryStatus = \"sent\" | \"delivered\" | \"seen\";\n\nexport interface Reaction {\n emoji: string;\n users: string[];\n}\n\nexport interface Message {\n _id: string;\n roomId: string;\n senderId: string;\n type: MessageType;\n text?: string;\n url?: string;\n fileName?: string;\n fileSize?: number;\n mimeType?: string;\n thumbnail?: string;\n replyTo?: string;\n reactions: Reaction[];\n deliveryStatus: DeliveryStatus;\n seenBy: string[];\n isDeleted: boolean;\n deletedAt?: string;\n editedAt?: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface SendMessageInput {\n roomId: string;\n type: MessageType;\n text?: string;\n url?: string;\n fileName?: string;\n fileSize?: number;\n mimeType?: string;\n thumbnail?: string;\n replyTo?: string;\n}\n\nexport interface MessageHistoryResult {\n messages: Message[];\n hasMore: boolean;\n}\n\nexport interface PresenceEvent {\n userId: string;\n displayName: string;\n roomId?: string;\n}\n\nexport interface LastSeenEvent {\n userId: string;\n displayName?: string;\n lastSeen: string;\n}\n\nexport interface TypingEvent {\n userId: string;\n displayName: string;\n roomId: string;\n}\n\nexport interface ReceiptEvent {\n roomId: string;\n userId: string;\n lastMessageId: string;\n seenAt: string;\n}\n\nexport interface ReactionEvent {\n messageId: string;\n roomId: string;\n reactions: Reaction[];\n}\n\nexport interface UploadResult {\n type: MessageType;\n url: string;\n thumbnail?: string;\n fileName: string;\n fileSize: number;\n mimeType: string;\n}\n\nexport interface HermesEvents {\n connected: () => void;\n disconnected: (reason: string) => void;\n error: (error: Error) => void;\n \"message:receive\": (message: Message) => void;\n \"message:deleted\": (data: { messageId: string; roomId: string }) => void;\n \"message:edited\": (message: Message) => void;\n \"room:created\": (room: Room) => void;\n \"room:deleted\": (data: { roomId: string }) => void;\n \"room:member:joined\": (data: { roomId: string; userId: string }) => void;\n \"room:member:left\": (data: { roomId: string; userId: string }) => void;\n \"user:online\": (event: PresenceEvent) => void;\n \"user:offline\": (event: LastSeenEvent) => void;\n \"typing:started\": (event: TypingEvent) => void;\n \"typing:stopped\": (event: TypingEvent) => void;\n \"receipt:updated\": (event: ReceiptEvent) => void;\n \"reaction:updated\": (event: ReactionEvent) => void;\n}\n\nexport type ConnectionStatus =\n | \"idle\"\n | \"connecting\"\n | \"connected\"\n | \"disconnected\"\n | \"error\";\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -0,0 +1,166 @@
1
+ type HermesConfig = {
2
+ endpoint: string;
3
+ token: string;
4
+ apiKey?: never;
5
+ secret?: never;
6
+ userId?: never;
7
+ displayName?: never;
8
+ avatar?: never;
9
+ email?: never;
10
+ } | {
11
+ endpoint: string;
12
+ token?: never;
13
+ apiKey: string;
14
+ secret: string;
15
+ userId: string;
16
+ displayName: string;
17
+ avatar?: string;
18
+ email?: string;
19
+ };
20
+ interface HermesUser {
21
+ userId: string;
22
+ displayName: string;
23
+ avatar?: string;
24
+ email?: string;
25
+ }
26
+ interface ConnectResponse {
27
+ success: boolean;
28
+ token: string;
29
+ user: HermesUser;
30
+ }
31
+ type RoomType = "direct" | "group";
32
+ interface Room {
33
+ _id: string;
34
+ name?: string;
35
+ type: RoomType;
36
+ projectId: string;
37
+ createdBy: string;
38
+ members: string[];
39
+ admins: string[];
40
+ avatar?: string;
41
+ description?: string;
42
+ lastMessage?: Message;
43
+ lastActivity: string;
44
+ unreadCount: number;
45
+ isMuted: boolean;
46
+ isPinned: boolean;
47
+ createdAt: string;
48
+ updatedAt: string;
49
+ }
50
+ interface CreateDirectRoomInput {
51
+ targetUserId: string;
52
+ }
53
+ interface CreateGroupRoomInput {
54
+ name: string;
55
+ memberIds: string[];
56
+ description?: string;
57
+ avatar?: string;
58
+ }
59
+ type MessageType = "text" | "link" | "image" | "video" | "audio" | "document";
60
+ type DeliveryStatus = "sent" | "delivered" | "seen";
61
+ interface Reaction {
62
+ emoji: string;
63
+ users: string[];
64
+ }
65
+ interface Message {
66
+ _id: string;
67
+ roomId: string;
68
+ senderId: string;
69
+ type: MessageType;
70
+ text?: string;
71
+ url?: string;
72
+ fileName?: string;
73
+ fileSize?: number;
74
+ mimeType?: string;
75
+ thumbnail?: string;
76
+ replyTo?: string;
77
+ reactions: Reaction[];
78
+ deliveryStatus: DeliveryStatus;
79
+ seenBy: string[];
80
+ isDeleted: boolean;
81
+ deletedAt?: string;
82
+ editedAt?: string;
83
+ createdAt: string;
84
+ updatedAt: string;
85
+ }
86
+ interface SendMessageInput {
87
+ roomId: string;
88
+ type: MessageType;
89
+ text?: string;
90
+ url?: string;
91
+ fileName?: string;
92
+ fileSize?: number;
93
+ mimeType?: string;
94
+ thumbnail?: string;
95
+ replyTo?: string;
96
+ }
97
+ interface MessageHistoryResult {
98
+ messages: Message[];
99
+ hasMore: boolean;
100
+ }
101
+ interface PresenceEvent {
102
+ userId: string;
103
+ displayName: string;
104
+ roomId?: string;
105
+ }
106
+ interface LastSeenEvent {
107
+ userId: string;
108
+ displayName?: string;
109
+ lastSeen: string;
110
+ }
111
+ interface TypingEvent {
112
+ userId: string;
113
+ displayName: string;
114
+ roomId: string;
115
+ }
116
+ interface ReceiptEvent {
117
+ roomId: string;
118
+ userId: string;
119
+ lastMessageId: string;
120
+ seenAt: string;
121
+ }
122
+ interface ReactionEvent {
123
+ messageId: string;
124
+ roomId: string;
125
+ reactions: Reaction[];
126
+ }
127
+ interface UploadResult {
128
+ type: MessageType;
129
+ url: string;
130
+ thumbnail?: string;
131
+ fileName: string;
132
+ fileSize: number;
133
+ mimeType: string;
134
+ }
135
+ interface HermesEvents {
136
+ connected: () => void;
137
+ disconnected: (reason: string) => void;
138
+ error: (error: Error) => void;
139
+ "message:receive": (message: Message) => void;
140
+ "message:deleted": (data: {
141
+ messageId: string;
142
+ roomId: string;
143
+ }) => void;
144
+ "message:edited": (message: Message) => void;
145
+ "room:created": (room: Room) => void;
146
+ "room:deleted": (data: {
147
+ roomId: string;
148
+ }) => void;
149
+ "room:member:joined": (data: {
150
+ roomId: string;
151
+ userId: string;
152
+ }) => void;
153
+ "room:member:left": (data: {
154
+ roomId: string;
155
+ userId: string;
156
+ }) => void;
157
+ "user:online": (event: PresenceEvent) => void;
158
+ "user:offline": (event: LastSeenEvent) => void;
159
+ "typing:started": (event: TypingEvent) => void;
160
+ "typing:stopped": (event: TypingEvent) => void;
161
+ "receipt:updated": (event: ReceiptEvent) => void;
162
+ "reaction:updated": (event: ReactionEvent) => void;
163
+ }
164
+ type ConnectionStatus = "idle" | "connecting" | "connected" | "disconnected" | "error";
165
+
166
+ export type { ConnectResponse, ConnectionStatus, CreateDirectRoomInput, CreateGroupRoomInput, DeliveryStatus, HermesConfig, HermesEvents, HermesUser, LastSeenEvent, Message, MessageHistoryResult, MessageType, PresenceEvent, Reaction, ReactionEvent, ReceiptEvent, Room, RoomType, SendMessageInput, TypingEvent, UploadResult };
@@ -0,0 +1,166 @@
1
+ type HermesConfig = {
2
+ endpoint: string;
3
+ token: string;
4
+ apiKey?: never;
5
+ secret?: never;
6
+ userId?: never;
7
+ displayName?: never;
8
+ avatar?: never;
9
+ email?: never;
10
+ } | {
11
+ endpoint: string;
12
+ token?: never;
13
+ apiKey: string;
14
+ secret: string;
15
+ userId: string;
16
+ displayName: string;
17
+ avatar?: string;
18
+ email?: string;
19
+ };
20
+ interface HermesUser {
21
+ userId: string;
22
+ displayName: string;
23
+ avatar?: string;
24
+ email?: string;
25
+ }
26
+ interface ConnectResponse {
27
+ success: boolean;
28
+ token: string;
29
+ user: HermesUser;
30
+ }
31
+ type RoomType = "direct" | "group";
32
+ interface Room {
33
+ _id: string;
34
+ name?: string;
35
+ type: RoomType;
36
+ projectId: string;
37
+ createdBy: string;
38
+ members: string[];
39
+ admins: string[];
40
+ avatar?: string;
41
+ description?: string;
42
+ lastMessage?: Message;
43
+ lastActivity: string;
44
+ unreadCount: number;
45
+ isMuted: boolean;
46
+ isPinned: boolean;
47
+ createdAt: string;
48
+ updatedAt: string;
49
+ }
50
+ interface CreateDirectRoomInput {
51
+ targetUserId: string;
52
+ }
53
+ interface CreateGroupRoomInput {
54
+ name: string;
55
+ memberIds: string[];
56
+ description?: string;
57
+ avatar?: string;
58
+ }
59
+ type MessageType = "text" | "link" | "image" | "video" | "audio" | "document";
60
+ type DeliveryStatus = "sent" | "delivered" | "seen";
61
+ interface Reaction {
62
+ emoji: string;
63
+ users: string[];
64
+ }
65
+ interface Message {
66
+ _id: string;
67
+ roomId: string;
68
+ senderId: string;
69
+ type: MessageType;
70
+ text?: string;
71
+ url?: string;
72
+ fileName?: string;
73
+ fileSize?: number;
74
+ mimeType?: string;
75
+ thumbnail?: string;
76
+ replyTo?: string;
77
+ reactions: Reaction[];
78
+ deliveryStatus: DeliveryStatus;
79
+ seenBy: string[];
80
+ isDeleted: boolean;
81
+ deletedAt?: string;
82
+ editedAt?: string;
83
+ createdAt: string;
84
+ updatedAt: string;
85
+ }
86
+ interface SendMessageInput {
87
+ roomId: string;
88
+ type: MessageType;
89
+ text?: string;
90
+ url?: string;
91
+ fileName?: string;
92
+ fileSize?: number;
93
+ mimeType?: string;
94
+ thumbnail?: string;
95
+ replyTo?: string;
96
+ }
97
+ interface MessageHistoryResult {
98
+ messages: Message[];
99
+ hasMore: boolean;
100
+ }
101
+ interface PresenceEvent {
102
+ userId: string;
103
+ displayName: string;
104
+ roomId?: string;
105
+ }
106
+ interface LastSeenEvent {
107
+ userId: string;
108
+ displayName?: string;
109
+ lastSeen: string;
110
+ }
111
+ interface TypingEvent {
112
+ userId: string;
113
+ displayName: string;
114
+ roomId: string;
115
+ }
116
+ interface ReceiptEvent {
117
+ roomId: string;
118
+ userId: string;
119
+ lastMessageId: string;
120
+ seenAt: string;
121
+ }
122
+ interface ReactionEvent {
123
+ messageId: string;
124
+ roomId: string;
125
+ reactions: Reaction[];
126
+ }
127
+ interface UploadResult {
128
+ type: MessageType;
129
+ url: string;
130
+ thumbnail?: string;
131
+ fileName: string;
132
+ fileSize: number;
133
+ mimeType: string;
134
+ }
135
+ interface HermesEvents {
136
+ connected: () => void;
137
+ disconnected: (reason: string) => void;
138
+ error: (error: Error) => void;
139
+ "message:receive": (message: Message) => void;
140
+ "message:deleted": (data: {
141
+ messageId: string;
142
+ roomId: string;
143
+ }) => void;
144
+ "message:edited": (message: Message) => void;
145
+ "room:created": (room: Room) => void;
146
+ "room:deleted": (data: {
147
+ roomId: string;
148
+ }) => void;
149
+ "room:member:joined": (data: {
150
+ roomId: string;
151
+ userId: string;
152
+ }) => void;
153
+ "room:member:left": (data: {
154
+ roomId: string;
155
+ userId: string;
156
+ }) => void;
157
+ "user:online": (event: PresenceEvent) => void;
158
+ "user:offline": (event: LastSeenEvent) => void;
159
+ "typing:started": (event: TypingEvent) => void;
160
+ "typing:stopped": (event: TypingEvent) => void;
161
+ "receipt:updated": (event: ReceiptEvent) => void;
162
+ "reaction:updated": (event: ReactionEvent) => void;
163
+ }
164
+ type ConnectionStatus = "idle" | "connecting" | "connected" | "disconnected" | "error";
165
+
166
+ export type { ConnectResponse, ConnectionStatus, CreateDirectRoomInput, CreateGroupRoomInput, DeliveryStatus, HermesConfig, HermesEvents, HermesUser, LastSeenEvent, Message, MessageHistoryResult, MessageType, PresenceEvent, Reaction, ReactionEvent, ReceiptEvent, Room, RoomType, SendMessageInput, TypingEvent, UploadResult };
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ import "./chunk-D42PTTYC.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}