@manonero/chat-client-sdk 1.0.0-beta.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/README.md +2343 -0
- package/dist/ChatClient.d.ts +122 -0
- package/dist/ChatClient.d.ts.map +1 -0
- package/dist/ChatClient.js +173 -0
- package/dist/ChatClient.js.map +1 -0
- package/dist/errors/ChatApiError.d.ts +22 -0
- package/dist/errors/ChatApiError.d.ts.map +1 -0
- package/dist/errors/ChatApiError.js +50 -0
- package/dist/errors/ChatApiError.js.map +1 -0
- package/dist/http/AuthApi.d.ts +26 -0
- package/dist/http/AuthApi.d.ts.map +1 -0
- package/dist/http/AuthApi.js +35 -0
- package/dist/http/AuthApi.js.map +1 -0
- package/dist/http/BotApi.d.ts +50 -0
- package/dist/http/BotApi.d.ts.map +1 -0
- package/dist/http/BotApi.js +67 -0
- package/dist/http/BotApi.js.map +1 -0
- package/dist/http/ConversationApi.d.ts +81 -0
- package/dist/http/ConversationApi.d.ts.map +1 -0
- package/dist/http/ConversationApi.js +115 -0
- package/dist/http/ConversationApi.js.map +1 -0
- package/dist/http/FileApi.d.ts +48 -0
- package/dist/http/FileApi.d.ts.map +1 -0
- package/dist/http/FileApi.js +68 -0
- package/dist/http/FileApi.js.map +1 -0
- package/dist/http/HealthApi.d.ts +26 -0
- package/dist/http/HealthApi.d.ts.map +1 -0
- package/dist/http/HealthApi.js +31 -0
- package/dist/http/HealthApi.js.map +1 -0
- package/dist/http/HttpClient.d.ts +51 -0
- package/dist/http/HttpClient.d.ts.map +1 -0
- package/dist/http/HttpClient.js +182 -0
- package/dist/http/HttpClient.js.map +1 -0
- package/dist/http/MessageApi.d.ts +67 -0
- package/dist/http/MessageApi.d.ts.map +1 -0
- package/dist/http/MessageApi.js +91 -0
- package/dist/http/MessageApi.js.map +1 -0
- package/dist/http/ParticipantApi.d.ts +28 -0
- package/dist/http/ParticipantApi.d.ts.map +1 -0
- package/dist/http/ParticipantApi.js +37 -0
- package/dist/http/ParticipantApi.js.map +1 -0
- package/dist/http/ProxyApi.d.ts +41 -0
- package/dist/http/ProxyApi.d.ts.map +1 -0
- package/dist/http/ProxyApi.js +57 -0
- package/dist/http/ProxyApi.js.map +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/realtime/ChatHubClient.d.ts +87 -0
- package/dist/realtime/ChatHubClient.d.ts.map +1 -0
- package/dist/realtime/ChatHubClient.js +182 -0
- package/dist/realtime/ChatHubClient.js.map +1 -0
- package/dist/realtime/NotificationHubClient.d.ts +73 -0
- package/dist/realtime/NotificationHubClient.d.ts.map +1 -0
- package/dist/realtime/NotificationHubClient.js +162 -0
- package/dist/realtime/NotificationHubClient.js.map +1 -0
- package/dist/realtime/ReconnectionManager.d.ts +65 -0
- package/dist/realtime/ReconnectionManager.d.ts.map +1 -0
- package/dist/realtime/ReconnectionManager.js +118 -0
- package/dist/realtime/ReconnectionManager.js.map +1 -0
- package/dist/types/auth.d.ts +28 -0
- package/dist/types/auth.d.ts.map +1 -0
- package/dist/types/auth.js +3 -0
- package/dist/types/auth.js.map +1 -0
- package/dist/types/block.d.ts +148 -0
- package/dist/types/block.d.ts.map +1 -0
- package/dist/types/block.js +47 -0
- package/dist/types/block.js.map +1 -0
- package/dist/types/bot.d.ts +48 -0
- package/dist/types/bot.d.ts.map +1 -0
- package/dist/types/bot.js +3 -0
- package/dist/types/bot.js.map +1 -0
- package/dist/types/chat-events.d.ts +153 -0
- package/dist/types/chat-events.d.ts.map +1 -0
- package/dist/types/chat-events.js +3 -0
- package/dist/types/chat-events.js.map +1 -0
- package/dist/types/common.d.ts +57 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/common.js +3 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/conversation.d.ts +70 -0
- package/dist/types/conversation.d.ts.map +1 -0
- package/dist/types/conversation.js +3 -0
- package/dist/types/conversation.js.map +1 -0
- package/dist/types/file.d.ts +31 -0
- package/dist/types/file.d.ts.map +1 -0
- package/dist/types/file.js +3 -0
- package/dist/types/file.js.map +1 -0
- package/dist/types/message.d.ts +83 -0
- package/dist/types/message.d.ts.map +1 -0
- package/dist/types/message.js +3 -0
- package/dist/types/message.js.map +1 -0
- package/dist/types/notification-events.d.ts +97 -0
- package/dist/types/notification-events.d.ts.map +1 -0
- package/dist/types/notification-events.js +3 -0
- package/dist/types/notification-events.js.map +1 -0
- package/dist/types/participant.d.ts +25 -0
- package/dist/types/participant.d.ts.map +1 -0
- package/dist/types/participant.js +3 -0
- package/dist/types/participant.js.map +1 -0
- package/dist/types/signalr.d.ts +87 -0
- package/dist/types/signalr.d.ts.map +1 -0
- package/dist/types/signalr.js +3 -0
- package/dist/types/signalr.js.map +1 -0
- package/dist/utils/TypedEventEmitter.d.ts +32 -0
- package/dist/utils/TypedEventEmitter.d.ts.map +1 -0
- package/dist/utils/TypedEventEmitter.js +60 -0
- package/dist/utils/TypedEventEmitter.js.map +1 -0
- package/package.json +40 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface GoogleLoginRequest {
|
|
2
|
+
idToken: string;
|
|
3
|
+
}
|
|
4
|
+
export interface DsAccountLoginRequest {
|
|
5
|
+
token: string;
|
|
6
|
+
}
|
|
7
|
+
export interface DevLoginRequest {
|
|
8
|
+
username: string;
|
|
9
|
+
password: string;
|
|
10
|
+
}
|
|
11
|
+
export type LoginRequest = GoogleLoginRequest | DsAccountLoginRequest | DevLoginRequest;
|
|
12
|
+
export interface AuthResponse {
|
|
13
|
+
token: string;
|
|
14
|
+
expiresAt: string;
|
|
15
|
+
user: AuthUserInfo;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Authenticated user information returned from login.
|
|
19
|
+
* NOTE: avatar is a plain string URL (NOT a MediaReference).
|
|
20
|
+
*/
|
|
21
|
+
export interface AuthUserInfo {
|
|
22
|
+
id: string;
|
|
23
|
+
uniqueName: string;
|
|
24
|
+
fullName: string;
|
|
25
|
+
/** Plain URL string, not MediaReference */
|
|
26
|
+
avatar?: string;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/types/auth.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,qBAAqB,GAAG,eAAe,CAAC;AAExF,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,YAAY,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/types/auth.ts"],"names":[],"mappings":"AAAA,kDAAkD"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
export type TextFormat = 'Plain' | 'Markdown' | 'Html' | 'ProseMirrorJson';
|
|
2
|
+
export type ButtonAction = 'Postback' | 'Url' | 'Call' | 'Copy';
|
|
3
|
+
export type ButtonStyle = 'Default' | 'Primary' | 'Danger';
|
|
4
|
+
export type ChoiceMode = 'Single' | 'Multiple';
|
|
5
|
+
export type QuickReplyAction = 'SendText' | 'Postback' | 'Url';
|
|
6
|
+
export type MentionType = 'User' | 'All' | 'Here' | 'Role';
|
|
7
|
+
import type { MediaReference } from './common.js';
|
|
8
|
+
export interface TextBlock {
|
|
9
|
+
$type: 'text';
|
|
10
|
+
format: TextFormat;
|
|
11
|
+
content: string;
|
|
12
|
+
plainText: string | null;
|
|
13
|
+
}
|
|
14
|
+
export interface ImageBlock {
|
|
15
|
+
$type: 'image';
|
|
16
|
+
source: MediaReference;
|
|
17
|
+
thumbnail: MediaReference | null;
|
|
18
|
+
altText: string | null;
|
|
19
|
+
width: number | null;
|
|
20
|
+
height: number | null;
|
|
21
|
+
caption: string | null;
|
|
22
|
+
fileSizeBytes: number | null;
|
|
23
|
+
}
|
|
24
|
+
export interface VideoBlock {
|
|
25
|
+
$type: 'video';
|
|
26
|
+
source: MediaReference;
|
|
27
|
+
thumbnail: MediaReference | null;
|
|
28
|
+
caption: string | null;
|
|
29
|
+
durationSeconds: number | null;
|
|
30
|
+
mimeType: string | null;
|
|
31
|
+
fileSizeBytes: number | null;
|
|
32
|
+
}
|
|
33
|
+
export interface AudioBlock {
|
|
34
|
+
$type: 'audio';
|
|
35
|
+
source: MediaReference;
|
|
36
|
+
durationSeconds: number | null;
|
|
37
|
+
mimeType: string | null;
|
|
38
|
+
transcript: string | null;
|
|
39
|
+
fileSizeBytes: number | null;
|
|
40
|
+
}
|
|
41
|
+
export interface FileBlock {
|
|
42
|
+
$type: 'file';
|
|
43
|
+
source: MediaReference;
|
|
44
|
+
fileName: string;
|
|
45
|
+
mimeType: string | null;
|
|
46
|
+
fileSizeBytes: number | null;
|
|
47
|
+
}
|
|
48
|
+
export interface LinkPreviewBlock {
|
|
49
|
+
$type: 'linkPreview';
|
|
50
|
+
url: string;
|
|
51
|
+
title: string | null;
|
|
52
|
+
description: string | null;
|
|
53
|
+
image: MediaReference | null;
|
|
54
|
+
siteName: string | null;
|
|
55
|
+
}
|
|
56
|
+
export interface EmbedBlock {
|
|
57
|
+
$type: 'embed';
|
|
58
|
+
url: string;
|
|
59
|
+
html: string | null;
|
|
60
|
+
width: number | null;
|
|
61
|
+
height: number | null;
|
|
62
|
+
}
|
|
63
|
+
export interface LocationBlock {
|
|
64
|
+
$type: 'location';
|
|
65
|
+
latitude: number;
|
|
66
|
+
longitude: number;
|
|
67
|
+
name: string | null;
|
|
68
|
+
address: string | null;
|
|
69
|
+
}
|
|
70
|
+
export interface ContactBlock {
|
|
71
|
+
$type: 'contact';
|
|
72
|
+
displayName: string;
|
|
73
|
+
phone: string | null;
|
|
74
|
+
email: string | null;
|
|
75
|
+
organization: string | null;
|
|
76
|
+
}
|
|
77
|
+
export interface ChoiceOption {
|
|
78
|
+
label: string;
|
|
79
|
+
value: string;
|
|
80
|
+
selected: boolean;
|
|
81
|
+
}
|
|
82
|
+
export interface ChoiceBlock {
|
|
83
|
+
$type: 'choice';
|
|
84
|
+
prompt: string;
|
|
85
|
+
options: ChoiceOption[];
|
|
86
|
+
mode: ChoiceMode;
|
|
87
|
+
submitted: boolean;
|
|
88
|
+
}
|
|
89
|
+
export interface CardField {
|
|
90
|
+
label: string;
|
|
91
|
+
value: string;
|
|
92
|
+
}
|
|
93
|
+
export interface ActionButton {
|
|
94
|
+
label: string;
|
|
95
|
+
action: ButtonAction;
|
|
96
|
+
value: string | null;
|
|
97
|
+
style: ButtonStyle;
|
|
98
|
+
}
|
|
99
|
+
export interface CardBlock {
|
|
100
|
+
$type: 'card';
|
|
101
|
+
title: string | null;
|
|
102
|
+
subtitle: string | null;
|
|
103
|
+
image: MediaReference | null;
|
|
104
|
+
fields: CardField[] | null;
|
|
105
|
+
buttons: ActionButton[] | null;
|
|
106
|
+
}
|
|
107
|
+
export interface CarouselBlock {
|
|
108
|
+
$type: 'carousel';
|
|
109
|
+
cards: CardBlock[];
|
|
110
|
+
}
|
|
111
|
+
export interface DividerBlock {
|
|
112
|
+
$type: 'divider';
|
|
113
|
+
}
|
|
114
|
+
export interface CustomBlock {
|
|
115
|
+
$type: 'custom';
|
|
116
|
+
type: string;
|
|
117
|
+
data: Record<string, unknown> | null;
|
|
118
|
+
}
|
|
119
|
+
/** Discriminated union of all message block types */
|
|
120
|
+
export type Block = TextBlock | ImageBlock | VideoBlock | AudioBlock | FileBlock | LinkPreviewBlock | EmbedBlock | LocationBlock | ContactBlock | ChoiceBlock | CardBlock | CarouselBlock | DividerBlock | CustomBlock;
|
|
121
|
+
export interface QuickReply {
|
|
122
|
+
label: string;
|
|
123
|
+
action: QuickReplyAction;
|
|
124
|
+
value: string | null;
|
|
125
|
+
icon: string | null;
|
|
126
|
+
}
|
|
127
|
+
export interface Mention {
|
|
128
|
+
type: MentionType;
|
|
129
|
+
targetId: string | null;
|
|
130
|
+
displayName: string;
|
|
131
|
+
offset: number | null;
|
|
132
|
+
length: number | null;
|
|
133
|
+
}
|
|
134
|
+
export declare function isTextBlock(b: Block): b is TextBlock;
|
|
135
|
+
export declare function isImageBlock(b: Block): b is ImageBlock;
|
|
136
|
+
export declare function isVideoBlock(b: Block): b is VideoBlock;
|
|
137
|
+
export declare function isAudioBlock(b: Block): b is AudioBlock;
|
|
138
|
+
export declare function isFileBlock(b: Block): b is FileBlock;
|
|
139
|
+
export declare function isLinkPreviewBlock(b: Block): b is LinkPreviewBlock;
|
|
140
|
+
export declare function isEmbedBlock(b: Block): b is EmbedBlock;
|
|
141
|
+
export declare function isLocationBlock(b: Block): b is LocationBlock;
|
|
142
|
+
export declare function isContactBlock(b: Block): b is ContactBlock;
|
|
143
|
+
export declare function isChoiceBlock(b: Block): b is ChoiceBlock;
|
|
144
|
+
export declare function isCardBlock(b: Block): b is CardBlock;
|
|
145
|
+
export declare function isCarouselBlock(b: Block): b is CarouselBlock;
|
|
146
|
+
export declare function isDividerBlock(b: Block): b is DividerBlock;
|
|
147
|
+
export declare function isCustomBlock(b: Block): b is CustomBlock;
|
|
148
|
+
//# sourceMappingURL=block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../src/types/block.ts"],"names":[],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,IAAI,UAAU,CAEtD;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,IAAI,aAAa,CAE5D;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,IAAI,YAAY,CAE1D;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,IAAI,WAAW,CAExD;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,IAAI,SAAS,CAEpD;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,IAAI,aAAa,CAE5D;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,IAAI,YAAY,CAE1D;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,IAAI,WAAW,CAExD"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// block.ts — Message block types (discriminated union)
|
|
2
|
+
// ---------------------------------------------------------------------------
|
|
3
|
+
// Type guards — narrow Block union based on $type discriminator
|
|
4
|
+
// ---------------------------------------------------------------------------
|
|
5
|
+
export function isTextBlock(b) {
|
|
6
|
+
return b.$type === 'text';
|
|
7
|
+
}
|
|
8
|
+
export function isImageBlock(b) {
|
|
9
|
+
return b.$type === 'image';
|
|
10
|
+
}
|
|
11
|
+
export function isVideoBlock(b) {
|
|
12
|
+
return b.$type === 'video';
|
|
13
|
+
}
|
|
14
|
+
export function isAudioBlock(b) {
|
|
15
|
+
return b.$type === 'audio';
|
|
16
|
+
}
|
|
17
|
+
export function isFileBlock(b) {
|
|
18
|
+
return b.$type === 'file';
|
|
19
|
+
}
|
|
20
|
+
export function isLinkPreviewBlock(b) {
|
|
21
|
+
return b.$type === 'linkPreview';
|
|
22
|
+
}
|
|
23
|
+
export function isEmbedBlock(b) {
|
|
24
|
+
return b.$type === 'embed';
|
|
25
|
+
}
|
|
26
|
+
export function isLocationBlock(b) {
|
|
27
|
+
return b.$type === 'location';
|
|
28
|
+
}
|
|
29
|
+
export function isContactBlock(b) {
|
|
30
|
+
return b.$type === 'contact';
|
|
31
|
+
}
|
|
32
|
+
export function isChoiceBlock(b) {
|
|
33
|
+
return b.$type === 'choice';
|
|
34
|
+
}
|
|
35
|
+
export function isCardBlock(b) {
|
|
36
|
+
return b.$type === 'card';
|
|
37
|
+
}
|
|
38
|
+
export function isCarouselBlock(b) {
|
|
39
|
+
return b.$type === 'carousel';
|
|
40
|
+
}
|
|
41
|
+
export function isDividerBlock(b) {
|
|
42
|
+
return b.$type === 'divider';
|
|
43
|
+
}
|
|
44
|
+
export function isCustomBlock(b) {
|
|
45
|
+
return b.$type === 'custom';
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=block.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.js","sourceRoot":"","sources":["../../src/types/block.ts"],"names":[],"mappings":"AAAA,uDAAuD;AA2KvD,8EAA8E;AAC9E,gEAAgE;AAChE,8EAA8E;AAE9E,MAAM,UAAU,WAAW,CAAC,CAAQ;IAClC,OAAO,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,CAAQ;IACnC,OAAO,CAAC,CAAC,KAAK,KAAK,OAAO,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,CAAQ;IACnC,OAAO,CAAC,CAAC,KAAK,KAAK,OAAO,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,CAAQ;IACnC,OAAO,CAAC,CAAC,KAAK,KAAK,OAAO,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,CAAQ;IAClC,OAAO,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,CAAQ;IACzC,OAAO,CAAC,CAAC,KAAK,KAAK,aAAa,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,CAAQ;IACnC,OAAO,CAAC,CAAC,KAAK,KAAK,OAAO,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,CAAQ;IACtC,OAAO,CAAC,CAAC,KAAK,KAAK,UAAU,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,CAAQ;IACrC,OAAO,CAAC,CAAC,KAAK,KAAK,SAAS,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,CAAQ;IACpC,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,CAAQ;IAClC,OAAO,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,CAAQ;IACtC,OAAO,CAAC,CAAC,KAAK,KAAK,UAAU,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,CAAQ;IACrC,OAAO,CAAC,CAAC,KAAK,KAAK,SAAS,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,CAAQ;IACpC,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { MediaReference } from './common.js';
|
|
2
|
+
/**
|
|
3
|
+
* Bot DTO returned from server.
|
|
4
|
+
*
|
|
5
|
+
* NOTE: BotDto does NOT include uniqueName/fullName — those live on the
|
|
6
|
+
* corresponding ParticipantDto. Use ParticipantApi.getById(bot.participantId)
|
|
7
|
+
* to fetch bot display name / avatar from participant record.
|
|
8
|
+
* CreateBotRequest / UpdateBotRequest accept uniqueName/fullName to create/update
|
|
9
|
+
* the associated participant, but the response only returns participantId.
|
|
10
|
+
*/
|
|
11
|
+
export interface BotDto {
|
|
12
|
+
id: string;
|
|
13
|
+
participantId: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
metadata?: Record<string, unknown>;
|
|
16
|
+
kafkaTopic: string;
|
|
17
|
+
isActive: boolean;
|
|
18
|
+
rateLimitPerSecond: number;
|
|
19
|
+
listenAllGroupMessages: boolean;
|
|
20
|
+
createdBy: string;
|
|
21
|
+
/** ISO 8601 */
|
|
22
|
+
createdAt: string;
|
|
23
|
+
/** ISO 8601 */
|
|
24
|
+
updatedAt: string;
|
|
25
|
+
}
|
|
26
|
+
export interface CreateBotRequest {
|
|
27
|
+
uniqueName: string;
|
|
28
|
+
fullName: string;
|
|
29
|
+
avatar?: MediaReference;
|
|
30
|
+
description?: string;
|
|
31
|
+
metadata?: Record<string, unknown>;
|
|
32
|
+
kafkaTopic: string;
|
|
33
|
+
rateLimitPerSecond?: number;
|
|
34
|
+
listenAllGroupMessages?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface UpdateBotRequest {
|
|
37
|
+
uniqueName?: string;
|
|
38
|
+
fullName?: string;
|
|
39
|
+
avatar?: MediaReference;
|
|
40
|
+
description?: string;
|
|
41
|
+
metadata?: Record<string, unknown>;
|
|
42
|
+
rateLimitPerSecond?: number;
|
|
43
|
+
listenAllGroupMessages?: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface RegenerateKeyResponse {
|
|
46
|
+
apiKey: string;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=bot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bot.d.ts","sourceRoot":"","sources":["../../src/types/bot.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;;;GAQG;AACH,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,sBAAsB,EAAE,OAAO,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAElC;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bot.js","sourceRoot":"","sources":["../../src/types/bot.ts"],"names":[],"mappings":"AAAA,gCAAgC"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import type { MediaReference } from './common.js';
|
|
2
|
+
import type { Block, QuickReply, Mention } from './block.js';
|
|
3
|
+
import type { SenderType, SystemEventInfo } from './message.js';
|
|
4
|
+
/**
|
|
5
|
+
* System event in SignalR context — extends REST SystemEventInfo with display names.
|
|
6
|
+
* Uses TypeScript extends to avoid field duplication.
|
|
7
|
+
*/
|
|
8
|
+
export interface SystemEventDto extends SystemEventInfo {
|
|
9
|
+
actorName?: string;
|
|
10
|
+
targetNames?: string[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Reaction group (SignalR version — flat array, NOT wrapped in ReactionSummary).
|
|
14
|
+
* Compare with REST ReactionSummary: { groups: ReactionGroup[], totalCount }.
|
|
15
|
+
*/
|
|
16
|
+
export interface ReactionGroupDto {
|
|
17
|
+
emoji: string;
|
|
18
|
+
count: number;
|
|
19
|
+
participantIds: string[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Message DTO as sent over ChatHub (SignalR version).
|
|
23
|
+
*
|
|
24
|
+
* Differences from REST MessageDto:
|
|
25
|
+
* - Added: senderName, senderAvatar, senderType
|
|
26
|
+
* - Removed: timestamp, editedAt, isDeleted, deletedAt
|
|
27
|
+
* - Uses updatedAt instead of editedAt
|
|
28
|
+
* - reactions: flat ReactionGroupDto[] (not reactionSummary wrapper)
|
|
29
|
+
* - plainTextContent (not plainTextIndex)
|
|
30
|
+
* - systemEvent: SystemEventDto (not SystemEventInfo)
|
|
31
|
+
*/
|
|
32
|
+
export interface ChatMessageDto {
|
|
33
|
+
id: string;
|
|
34
|
+
conversationId: string;
|
|
35
|
+
senderId: string;
|
|
36
|
+
senderName: string;
|
|
37
|
+
senderAvatar?: MediaReference;
|
|
38
|
+
senderType: SenderType;
|
|
39
|
+
blocks: Block[];
|
|
40
|
+
plainTextContent: string | null;
|
|
41
|
+
replyToMessageId: string | null;
|
|
42
|
+
quickReplies: QuickReply[] | null;
|
|
43
|
+
isEdited: boolean;
|
|
44
|
+
reactions: ReactionGroupDto[] | null;
|
|
45
|
+
mentions: Mention[] | null;
|
|
46
|
+
/** ISO 8601 */
|
|
47
|
+
createdAt: string;
|
|
48
|
+
/** ISO 8601 */
|
|
49
|
+
updatedAt: string | null;
|
|
50
|
+
clientMessageId: string | null;
|
|
51
|
+
systemEvent: SystemEventDto | null;
|
|
52
|
+
}
|
|
53
|
+
export interface MessageUpdatedDto {
|
|
54
|
+
messageId: string;
|
|
55
|
+
conversationId: string;
|
|
56
|
+
blocks: Block[];
|
|
57
|
+
plainTextContent: string | null;
|
|
58
|
+
mentions?: Mention[];
|
|
59
|
+
/** ISO 8601 */
|
|
60
|
+
updatedAt: string;
|
|
61
|
+
}
|
|
62
|
+
export type DeleteType = 'recall' | 'delete';
|
|
63
|
+
export interface MessageDeletedDto {
|
|
64
|
+
messageId: string;
|
|
65
|
+
conversationId: string;
|
|
66
|
+
deleteType: DeleteType;
|
|
67
|
+
deletedBy: string;
|
|
68
|
+
/** ISO 8601 */
|
|
69
|
+
deletedAt: string;
|
|
70
|
+
}
|
|
71
|
+
export interface ReactionAddedDto {
|
|
72
|
+
messageId: string;
|
|
73
|
+
conversationId: string;
|
|
74
|
+
participantId: string;
|
|
75
|
+
participantName: string;
|
|
76
|
+
emoji: string;
|
|
77
|
+
/** ISO 8601 */
|
|
78
|
+
createdAt: string;
|
|
79
|
+
}
|
|
80
|
+
/** NOTE: uses removedAt (not createdAt like ReactionAddedDto) */
|
|
81
|
+
export interface ReactionRemovedDto {
|
|
82
|
+
messageId: string;
|
|
83
|
+
conversationId: string;
|
|
84
|
+
participantId: string;
|
|
85
|
+
participantName: string;
|
|
86
|
+
emoji: string;
|
|
87
|
+
/** ISO 8601 */
|
|
88
|
+
removedAt: string;
|
|
89
|
+
}
|
|
90
|
+
export interface TypingDto {
|
|
91
|
+
conversationId: string;
|
|
92
|
+
participantId: string;
|
|
93
|
+
participantName: string;
|
|
94
|
+
}
|
|
95
|
+
export interface ReadReceiptUpdatedDto {
|
|
96
|
+
conversationId: string;
|
|
97
|
+
participantId: string;
|
|
98
|
+
lastReadMessageId: string;
|
|
99
|
+
/** ISO 8601 */
|
|
100
|
+
readAt: string;
|
|
101
|
+
}
|
|
102
|
+
export interface StreamStartedDto {
|
|
103
|
+
streamId: string;
|
|
104
|
+
messageId: string;
|
|
105
|
+
conversationId: string;
|
|
106
|
+
senderId: string;
|
|
107
|
+
senderName: string;
|
|
108
|
+
senderAvatar?: MediaReference;
|
|
109
|
+
replyToMessageId?: string;
|
|
110
|
+
/** ISO 8601 */
|
|
111
|
+
startedAt: string;
|
|
112
|
+
}
|
|
113
|
+
export interface StreamStatusUpdatedDto {
|
|
114
|
+
streamId: string;
|
|
115
|
+
messageId: string;
|
|
116
|
+
conversationId: string;
|
|
117
|
+
/** e.g. "thinking", "searching" */
|
|
118
|
+
status: string;
|
|
119
|
+
detail?: string;
|
|
120
|
+
/** ISO 8601 */
|
|
121
|
+
updatedAt: string;
|
|
122
|
+
}
|
|
123
|
+
export interface StreamChunkReceivedDto {
|
|
124
|
+
streamId: string;
|
|
125
|
+
messageId: string;
|
|
126
|
+
conversationId: string;
|
|
127
|
+
/** Text chunk to append to placeholder */
|
|
128
|
+
text: string;
|
|
129
|
+
/** Zero-based chunk index */
|
|
130
|
+
chunkIndex: number;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Stream completed — contains full message.
|
|
134
|
+
* NOTE: MessageReceived is NOT sent for streaming messages — this is the only completion signal.
|
|
135
|
+
*/
|
|
136
|
+
export interface StreamCompletedDto {
|
|
137
|
+
streamId: string;
|
|
138
|
+
messageId: string;
|
|
139
|
+
conversationId: string;
|
|
140
|
+
/** Full ChatMessageDto (SignalR version, NOT REST MessageDto) */
|
|
141
|
+
message: ChatMessageDto;
|
|
142
|
+
/** ISO 8601 */
|
|
143
|
+
completedAt: string;
|
|
144
|
+
}
|
|
145
|
+
export interface StreamAbortedDto {
|
|
146
|
+
streamId: string;
|
|
147
|
+
messageId: string;
|
|
148
|
+
conversationId: string;
|
|
149
|
+
reason: string;
|
|
150
|
+
/** ISO 8601 */
|
|
151
|
+
abortedAt: string;
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=chat-events.d.ts.map
|
|
@@ -0,0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EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-events.js","sourceRoot":"","sources":["../../src/types/chat-events.ts"],"names":[],"mappings":"AAAA,6DAA6D"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cursor-based paginated result.
|
|
3
|
+
* NOTE: nextCursor MUST be string — server returns .NET DateTime ticks
|
|
4
|
+
* (e.g. "638836680000000000", 18 digits) which exceeds Number.MAX_SAFE_INTEGER.
|
|
5
|
+
*/
|
|
6
|
+
export interface PaginatedResult<T> {
|
|
7
|
+
items: T[];
|
|
8
|
+
/** Opaque cursor string for next page. null when no more pages. */
|
|
9
|
+
nextCursor: string | null;
|
|
10
|
+
hasMore: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** Page-based (offset) paginated result. */
|
|
13
|
+
export interface PagedResult<T> {
|
|
14
|
+
items: T[];
|
|
15
|
+
page: number;
|
|
16
|
+
pageSize: number;
|
|
17
|
+
totalCount: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Reference to a stored media file.
|
|
21
|
+
* Internal storage uses storageKey; external URLs use url.
|
|
22
|
+
*/
|
|
23
|
+
export interface MediaReference {
|
|
24
|
+
storageKey?: string;
|
|
25
|
+
url?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* RFC 7807 Problem Details error format.
|
|
29
|
+
* Server returns this structure for all REST API errors.
|
|
30
|
+
*/
|
|
31
|
+
export interface ProblemDetails {
|
|
32
|
+
status: number;
|
|
33
|
+
title: string;
|
|
34
|
+
detail?: string;
|
|
35
|
+
type?: string;
|
|
36
|
+
}
|
|
37
|
+
/** Callback for file upload progress events. */
|
|
38
|
+
export type UploadProgressCallback = (loaded: number, total: number) => void;
|
|
39
|
+
/**
|
|
40
|
+
* Health check response.
|
|
41
|
+
* durations are .NET TimeSpan format strings (e.g. "00:00:00.1234567"), NOT numbers.
|
|
42
|
+
*/
|
|
43
|
+
export interface HealthStatus {
|
|
44
|
+
/** "Healthy" | "Degraded" | "Unhealthy" */
|
|
45
|
+
status: string;
|
|
46
|
+
/** .NET TimeSpan format — string, NOT number */
|
|
47
|
+
totalDuration: string;
|
|
48
|
+
results: Record<string, HealthCheckResult>;
|
|
49
|
+
}
|
|
50
|
+
export interface HealthCheckResult {
|
|
51
|
+
status: string;
|
|
52
|
+
description: string | null;
|
|
53
|
+
/** .NET TimeSpan format — string, NOT number */
|
|
54
|
+
duration: string;
|
|
55
|
+
error: string | null;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,mEAAmE;IACnE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,4CAA4C;AAC5C,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,gDAAgD;AAChD,MAAM,MAAM,sBAAsB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;AAE7E;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA,+CAA+C"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { MediaReference } from './common.js';
|
|
2
|
+
import type { MessageDto } from './message.js';
|
|
3
|
+
export type ConversationType = 'Group' | 'OneToOne' | 'Self';
|
|
4
|
+
/** Participant info in the context of a conversation */
|
|
5
|
+
export interface ConversationParticipantDto {
|
|
6
|
+
participantId: string;
|
|
7
|
+
/** ISO 8601 */
|
|
8
|
+
joinedAt: string;
|
|
9
|
+
/** ISO 8601, null if still active */
|
|
10
|
+
leftAt?: string | null;
|
|
11
|
+
isActive: boolean;
|
|
12
|
+
isPinned: boolean;
|
|
13
|
+
/** ISO 8601 */
|
|
14
|
+
pinnedAt?: string | null;
|
|
15
|
+
lastReadMessageId?: string | null;
|
|
16
|
+
/** ISO 8601 */
|
|
17
|
+
lastReadAt?: string | null;
|
|
18
|
+
unreadCount: number;
|
|
19
|
+
}
|
|
20
|
+
/** Full conversation object */
|
|
21
|
+
export interface ConversationDto {
|
|
22
|
+
id: string;
|
|
23
|
+
type: ConversationType;
|
|
24
|
+
/** Name (applicable for Group conversations) */
|
|
25
|
+
name?: string;
|
|
26
|
+
avatar?: MediaReference;
|
|
27
|
+
ownerId: string;
|
|
28
|
+
/** ISO 8601 */
|
|
29
|
+
lastMessageAt?: string;
|
|
30
|
+
lastMessageId?: string;
|
|
31
|
+
/** ISO 8601 */
|
|
32
|
+
createdAt: string;
|
|
33
|
+
/** ISO 8601 */
|
|
34
|
+
updatedAt: string;
|
|
35
|
+
participants: ConversationParticipantDto[];
|
|
36
|
+
}
|
|
37
|
+
/** Lightweight conversation item for listing */
|
|
38
|
+
export interface ConversationListItemDto {
|
|
39
|
+
id: string;
|
|
40
|
+
type: ConversationType;
|
|
41
|
+
name?: string;
|
|
42
|
+
avatar?: MediaReference;
|
|
43
|
+
/** ISO 8601 */
|
|
44
|
+
lastMessageAt?: string;
|
|
45
|
+
lastMessageId?: string;
|
|
46
|
+
/** Full message DTO for preview */
|
|
47
|
+
lastMessage?: MessageDto;
|
|
48
|
+
isPinned: boolean;
|
|
49
|
+
/** ISO 8601 */
|
|
50
|
+
pinnedAt?: string;
|
|
51
|
+
unreadCount: number;
|
|
52
|
+
participantCount: number;
|
|
53
|
+
}
|
|
54
|
+
export interface CreateConversationRequest {
|
|
55
|
+
type: ConversationType;
|
|
56
|
+
name?: string;
|
|
57
|
+
avatar?: MediaReference;
|
|
58
|
+
participantIds: string[];
|
|
59
|
+
}
|
|
60
|
+
/** Only applicable for Group conversations */
|
|
61
|
+
export interface UpdateConversationRequest {
|
|
62
|
+
name?: string;
|
|
63
|
+
avatar?: MediaReference;
|
|
64
|
+
}
|
|
65
|
+
export interface AddParticipantRequest {
|
|
66
|
+
participantId: string;
|
|
67
|
+
/** Default true — allow viewing history before joining */
|
|
68
|
+
canViewHistory?: boolean;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=conversation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../src/types/conversation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACl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AAE,MAAM,CAAC;IACvB,mCAAmC;IACnC,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,gBAAgB,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,8CAA8C;AAC9C,MAAM,WAAW,yBAAyB;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAED,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../../src/types/conversation.ts"],"names":[],"mappings":"AAAA,uCAAuC"}
|