@verentis/sdk 1.0.0 → 1.0.1
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 +31 -0
- package/dist/index.cjs +275 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +413 -4
- package/dist/index.d.ts +413 -4
- package/dist/index.js +275 -49
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -62,6 +62,268 @@ declare const APP_COMMANDS_CAPABILITY = "commands";
|
|
|
62
62
|
declare const APP_COMMAND_ID_PATTERN: RegExp;
|
|
63
63
|
declare function isAppCommand(value: unknown): value is AppCommand;
|
|
64
64
|
|
|
65
|
+
/** A conversation participant. `agent` is reserved for future AI participants and rejected today. */
|
|
66
|
+
interface ChatParticipant {
|
|
67
|
+
kind: 'user' | 'bot';
|
|
68
|
+
id: string;
|
|
69
|
+
}
|
|
70
|
+
type ConversationKind = 'direct' | 'group' | 'channel';
|
|
71
|
+
type ConversationVisibility = 'private' | 'public';
|
|
72
|
+
type HistoryPolicy = 'full' | 'fromJoin';
|
|
73
|
+
type MemberRole = 'owner' | 'admin' | 'member';
|
|
74
|
+
type AttentionLevel = 'all' | 'mentions' | 'none';
|
|
75
|
+
/** A versioned message part. Unknown types are rejected on write; readers fall back to `fallbackText`. */
|
|
76
|
+
type MessagePartInput = {
|
|
77
|
+
partId?: string;
|
|
78
|
+
type: 'text';
|
|
79
|
+
version?: 1;
|
|
80
|
+
data: {
|
|
81
|
+
markdown: string;
|
|
82
|
+
};
|
|
83
|
+
fallbackText?: string;
|
|
84
|
+
} | {
|
|
85
|
+
partId?: string;
|
|
86
|
+
type: 'link';
|
|
87
|
+
version?: 1;
|
|
88
|
+
data: {
|
|
89
|
+
url: string;
|
|
90
|
+
title?: string;
|
|
91
|
+
};
|
|
92
|
+
fallbackText?: string;
|
|
93
|
+
} | {
|
|
94
|
+
partId?: string;
|
|
95
|
+
type: 'mention';
|
|
96
|
+
version?: 1;
|
|
97
|
+
data: {
|
|
98
|
+
participant: ChatParticipant;
|
|
99
|
+
label?: string;
|
|
100
|
+
};
|
|
101
|
+
fallbackText?: string;
|
|
102
|
+
} | {
|
|
103
|
+
partId?: string;
|
|
104
|
+
type: 'fileRef';
|
|
105
|
+
version?: 1;
|
|
106
|
+
data: {
|
|
107
|
+
nodeId: string;
|
|
108
|
+
versionId?: string;
|
|
109
|
+
name?: string;
|
|
110
|
+
mimeType?: string;
|
|
111
|
+
size?: number;
|
|
112
|
+
};
|
|
113
|
+
fallbackText?: string;
|
|
114
|
+
};
|
|
115
|
+
interface MessagePart {
|
|
116
|
+
partId: string;
|
|
117
|
+
type: string;
|
|
118
|
+
version: number;
|
|
119
|
+
data: Record<string, unknown>;
|
|
120
|
+
fallbackText: string;
|
|
121
|
+
}
|
|
122
|
+
interface Membership {
|
|
123
|
+
role: MemberRole;
|
|
124
|
+
active: boolean;
|
|
125
|
+
joinedSeq: number;
|
|
126
|
+
/** First sequence this member may see (the history boundary). */
|
|
127
|
+
historyFromSeq: number;
|
|
128
|
+
}
|
|
129
|
+
interface Conversation {
|
|
130
|
+
id: string;
|
|
131
|
+
kind: ConversationKind;
|
|
132
|
+
visibility: ConversationVisibility;
|
|
133
|
+
historyPolicy: HistoryPolicy;
|
|
134
|
+
title?: string;
|
|
135
|
+
topic?: string;
|
|
136
|
+
archived: boolean;
|
|
137
|
+
createdAt: string;
|
|
138
|
+
createdBy: ChatParticipant;
|
|
139
|
+
/** Sequence of the latest durable change. */
|
|
140
|
+
highWatermark: number;
|
|
141
|
+
membershipRevision: number;
|
|
142
|
+
memberCount: number;
|
|
143
|
+
lastActivityAt: string;
|
|
144
|
+
/** Null when previewing a public channel you have not joined. */
|
|
145
|
+
membership?: Membership;
|
|
146
|
+
directParticipants?: ChatParticipant[];
|
|
147
|
+
}
|
|
148
|
+
interface ConversationSummary {
|
|
149
|
+
id: string;
|
|
150
|
+
kind: ConversationKind;
|
|
151
|
+
visibility: ConversationVisibility;
|
|
152
|
+
title?: string;
|
|
153
|
+
directParticipants?: ChatParticipant[];
|
|
154
|
+
archived: boolean;
|
|
155
|
+
highWatermark: number;
|
|
156
|
+
readThroughSeq: number;
|
|
157
|
+
unreadCount: number;
|
|
158
|
+
unreadMentionCount: number;
|
|
159
|
+
muted: boolean;
|
|
160
|
+
attention: AttentionLevel;
|
|
161
|
+
lastMessageId?: string;
|
|
162
|
+
lastMessageAuthor?: ChatParticipant;
|
|
163
|
+
lastMessagePreview?: string;
|
|
164
|
+
lastActivityAt: string;
|
|
165
|
+
}
|
|
166
|
+
interface ReplyPreview {
|
|
167
|
+
messageId: string;
|
|
168
|
+
/** False when the original is outside your history boundary or gone. */
|
|
169
|
+
available: boolean;
|
|
170
|
+
deleted: boolean;
|
|
171
|
+
author?: ChatParticipant;
|
|
172
|
+
preview?: string;
|
|
173
|
+
}
|
|
174
|
+
interface ChatMessage {
|
|
175
|
+
id: string;
|
|
176
|
+
conversationId: string;
|
|
177
|
+
/** Creation sequence; never changes on edit. */
|
|
178
|
+
seq: number;
|
|
179
|
+
lastEventSeq: number;
|
|
180
|
+
revision: number;
|
|
181
|
+
author: ChatParticipant;
|
|
182
|
+
contentVersion: number;
|
|
183
|
+
/** Absent for deleted messages (tombstones). */
|
|
184
|
+
parts?: MessagePart[];
|
|
185
|
+
fallbackText?: string;
|
|
186
|
+
replyTo?: ReplyPreview;
|
|
187
|
+
createdAt: string;
|
|
188
|
+
editedAt?: string;
|
|
189
|
+
deleted: boolean;
|
|
190
|
+
deletedAt?: string;
|
|
191
|
+
}
|
|
192
|
+
interface MessagePage {
|
|
193
|
+
/** Oldest first. */
|
|
194
|
+
items: ChatMessage[];
|
|
195
|
+
/** Cursor for the next older page; absent at the history boundary. */
|
|
196
|
+
before?: string;
|
|
197
|
+
highWatermark: number;
|
|
198
|
+
historyFromSeq: number;
|
|
199
|
+
}
|
|
200
|
+
interface ConversationEvent {
|
|
201
|
+
seq: number;
|
|
202
|
+
kind: string;
|
|
203
|
+
at: string;
|
|
204
|
+
author?: ChatParticipant;
|
|
205
|
+
messageId?: string;
|
|
206
|
+
/** Current state of the message (content may have changed since the event). */
|
|
207
|
+
message?: ChatMessage;
|
|
208
|
+
participants?: ChatParticipant[];
|
|
209
|
+
role?: MemberRole;
|
|
210
|
+
}
|
|
211
|
+
interface EventPage {
|
|
212
|
+
items: ConversationEvent[];
|
|
213
|
+
/** Cursor to continue from. */
|
|
214
|
+
next: string;
|
|
215
|
+
highWatermark: number;
|
|
216
|
+
hasMore: boolean;
|
|
217
|
+
/** The cursor cannot be continued: discard local state and reload from `conversation` and history. */
|
|
218
|
+
resetRequired: boolean;
|
|
219
|
+
conversation?: Conversation;
|
|
220
|
+
}
|
|
221
|
+
interface ChatPage<T> {
|
|
222
|
+
items: T[];
|
|
223
|
+
cursor?: string;
|
|
224
|
+
}
|
|
225
|
+
interface Member {
|
|
226
|
+
participant: ChatParticipant;
|
|
227
|
+
role: MemberRole;
|
|
228
|
+
joinedSeq: number;
|
|
229
|
+
joinedAt: string;
|
|
230
|
+
}
|
|
231
|
+
interface ReadState {
|
|
232
|
+
conversationId: string;
|
|
233
|
+
readThroughSeq: number;
|
|
234
|
+
unreadCount: number;
|
|
235
|
+
unreadMentionCount: number;
|
|
236
|
+
}
|
|
237
|
+
interface ConversationPreferences {
|
|
238
|
+
conversationId: string;
|
|
239
|
+
muted: boolean;
|
|
240
|
+
attention: AttentionLevel;
|
|
241
|
+
}
|
|
242
|
+
interface PublicChannel {
|
|
243
|
+
id: string;
|
|
244
|
+
title?: string;
|
|
245
|
+
topic?: string;
|
|
246
|
+
memberCount: number;
|
|
247
|
+
lastActivityAt: string;
|
|
248
|
+
}
|
|
249
|
+
interface ChatPerson {
|
|
250
|
+
userId: string;
|
|
251
|
+
displayName: string;
|
|
252
|
+
/** Relative avatar URL on the workspace API. */
|
|
253
|
+
avatarUrl: string;
|
|
254
|
+
}
|
|
255
|
+
interface ChatBot {
|
|
256
|
+
id: string;
|
|
257
|
+
app: string;
|
|
258
|
+
key: string;
|
|
259
|
+
displayName: string;
|
|
260
|
+
description?: string;
|
|
261
|
+
directMessages: 'none' | 'workspace';
|
|
262
|
+
}
|
|
263
|
+
interface ChatCommandArgument {
|
|
264
|
+
name: string;
|
|
265
|
+
type: 'string' | 'number' | 'boolean';
|
|
266
|
+
required: boolean;
|
|
267
|
+
description?: string;
|
|
268
|
+
}
|
|
269
|
+
interface ChatCommand {
|
|
270
|
+
/** `{app}/{name}`. */
|
|
271
|
+
id: string;
|
|
272
|
+
app: string;
|
|
273
|
+
name: string;
|
|
274
|
+
description: string;
|
|
275
|
+
botId?: string;
|
|
276
|
+
arguments: ChatCommandArgument[];
|
|
277
|
+
}
|
|
278
|
+
/** The validated Execution request a command invocation returns; run it with the user's own token. */
|
|
279
|
+
interface ChatCommandInvocation {
|
|
280
|
+
command: string;
|
|
281
|
+
eventSeq: number;
|
|
282
|
+
invocationKey: string;
|
|
283
|
+
workspaceId: string;
|
|
284
|
+
filePath: string;
|
|
285
|
+
branch: string;
|
|
286
|
+
/** JSON object text of the validated arguments. */
|
|
287
|
+
parameters: string;
|
|
288
|
+
}
|
|
289
|
+
interface CreateConversationOptions {
|
|
290
|
+
kind: ConversationKind;
|
|
291
|
+
participants?: ChatParticipant[];
|
|
292
|
+
title?: string;
|
|
293
|
+
topic?: string;
|
|
294
|
+
visibility?: ConversationVisibility;
|
|
295
|
+
historyPolicy?: HistoryPolicy;
|
|
296
|
+
/** Makes creation idempotent for this caller. */
|
|
297
|
+
idempotencyKey?: string;
|
|
298
|
+
}
|
|
299
|
+
interface SendMessageOptions {
|
|
300
|
+
replyTo?: string;
|
|
301
|
+
/** Makes the send idempotent: a retry with the same key and body returns the original message. */
|
|
302
|
+
idempotencyKey?: string;
|
|
303
|
+
}
|
|
304
|
+
interface BotPostOptions {
|
|
305
|
+
/** The bot's key when the app declares several. */
|
|
306
|
+
bot?: string;
|
|
307
|
+
conversationId?: string;
|
|
308
|
+
userId?: string;
|
|
309
|
+
parts: MessagePartInput[];
|
|
310
|
+
idempotencyKey?: string;
|
|
311
|
+
}
|
|
312
|
+
/** Identifier-only live hint; fetch content through the chat API. */
|
|
313
|
+
interface ChatChangeHint {
|
|
314
|
+
conversationId: string;
|
|
315
|
+
highWatermark: number;
|
|
316
|
+
kinds: Array<'messages' | 'members' | 'conversation'>;
|
|
317
|
+
}
|
|
318
|
+
type ChatConnectionStatus = 'idle' | 'connecting' | 'connected' | 'reconnecting' | 'disconnected';
|
|
319
|
+
interface ChatSubscriptionHandlers {
|
|
320
|
+
onChange: (hint: ChatChangeHint) => void;
|
|
321
|
+
/** Called with the host connection state; reconcile durable state after `connected` following a disconnect. */
|
|
322
|
+
onConnection?: (status: ChatConnectionStatus) => void;
|
|
323
|
+
/** The host refused the subscription (for example `chat.read` is not approved). */
|
|
324
|
+
onError?: (reason: string) => void;
|
|
325
|
+
}
|
|
326
|
+
|
|
65
327
|
type BridgeEventType = HostToAppMessage['type'];
|
|
66
328
|
/** Handles a host message; the resolved value (structured-cloneable, ideally JSON) is the reply. */
|
|
67
329
|
type HostMessageHandler = (payload: unknown) => unknown | Promise<unknown>;
|
|
@@ -93,6 +355,7 @@ declare class Bridge {
|
|
|
93
355
|
private commandFlushScheduled;
|
|
94
356
|
private commandRequests;
|
|
95
357
|
private _hostCapabilities;
|
|
358
|
+
private chatSubscribers;
|
|
96
359
|
private hostMessageHandlers;
|
|
97
360
|
private hostMessageRequests;
|
|
98
361
|
private wopiRequests;
|
|
@@ -161,6 +424,12 @@ declare class Bridge {
|
|
|
161
424
|
*/
|
|
162
425
|
onHostMessage(channel: string, handler: HostMessageHandler): () => void;
|
|
163
426
|
private receiveHostMessage;
|
|
427
|
+
/**
|
|
428
|
+
* Subscribes to the host's chat live hints (see `ChatModule.subscribeChanges`). The first subscriber asks the host
|
|
429
|
+
* to relay; the last one to leave stops it. Messages from another session are ignored.
|
|
430
|
+
*/
|
|
431
|
+
subscribeChat(handlers: ChatSubscriptionHandlers): () => void;
|
|
432
|
+
private receiveChat;
|
|
164
433
|
/** Subscribe to a specific message type from the host */
|
|
165
434
|
on(type: BridgeEventType, listener: BridgeListener): () => void;
|
|
166
435
|
/** Clean up event listeners */
|
|
@@ -408,6 +677,36 @@ interface VerentisThemeMessage extends VerentisMessage {
|
|
|
408
677
|
colorScheme: 'light' | 'dark';
|
|
409
678
|
variables?: Record<string, string>;
|
|
410
679
|
}
|
|
680
|
+
/** Host → app chat live-hint relay messages (bound to the bridge session). */
|
|
681
|
+
interface VerentisChatSubscribedMessage extends VerentisMessage {
|
|
682
|
+
type: 'verentis:chat:subscribed';
|
|
683
|
+
sessionId: string;
|
|
684
|
+
status: string;
|
|
685
|
+
}
|
|
686
|
+
interface VerentisChatChangedMessage extends VerentisMessage {
|
|
687
|
+
type: 'verentis:chat:changed';
|
|
688
|
+
sessionId: string;
|
|
689
|
+
hint: {
|
|
690
|
+
conversationId: string;
|
|
691
|
+
highWatermark: number;
|
|
692
|
+
kinds: string[];
|
|
693
|
+
};
|
|
694
|
+
}
|
|
695
|
+
interface VerentisChatConnectionMessage extends VerentisMessage {
|
|
696
|
+
type: 'verentis:chat:connection';
|
|
697
|
+
sessionId: string;
|
|
698
|
+
status: string;
|
|
699
|
+
}
|
|
700
|
+
interface VerentisChatErrorMessage extends VerentisMessage {
|
|
701
|
+
type: 'verentis:chat:error';
|
|
702
|
+
sessionId: string;
|
|
703
|
+
reason: string;
|
|
704
|
+
}
|
|
705
|
+
/** App → host chat relay subscription messages. */
|
|
706
|
+
interface VerentisChatSubscriptionMessage extends VerentisMessage {
|
|
707
|
+
type: 'verentis:chat:subscribe' | 'verentis:chat:unsubscribe';
|
|
708
|
+
sessionId: string;
|
|
709
|
+
}
|
|
411
710
|
interface VerentisReadyMessage extends VerentisMessage {
|
|
412
711
|
type: 'verentis:ready';
|
|
413
712
|
capabilities?: string[];
|
|
@@ -435,8 +734,8 @@ interface VerentisDirtyMessage extends VerentisMessage {
|
|
|
435
734
|
type: 'verentis:dirty';
|
|
436
735
|
isDirty: boolean;
|
|
437
736
|
}
|
|
438
|
-
type HostToAppMessage = VerentisInitMessage | VerentisActionInvokeMessage | VerentisCommandInvokeMessage | VerentisHostMessage | VerentisTokenRefreshedMessage | VerentisFileChangedMessage | VerentisThemeMessage | VerentisWopiResponse | NativeCollaborationResponse;
|
|
439
|
-
type AppToHostMessage = VerentisReadyMessage | VerentisActionsSetMessage | VerentisActionResultMessage | VerentisCommandsUpdateMessage | VerentisCommandResultMessage | VerentisHostReplyMessage | VerentisTokenRefreshMessage | VerentisNavigateMessage | VerentisResizeMessage | VerentisTitleMessage | VerentisDirtyMessage | VerentisWopiRequest | NativeCollaborationRequest;
|
|
737
|
+
type HostToAppMessage = VerentisInitMessage | VerentisActionInvokeMessage | VerentisCommandInvokeMessage | VerentisHostMessage | VerentisTokenRefreshedMessage | VerentisFileChangedMessage | VerentisThemeMessage | VerentisWopiResponse | NativeCollaborationResponse | VerentisChatSubscribedMessage | VerentisChatChangedMessage | VerentisChatConnectionMessage | VerentisChatErrorMessage;
|
|
738
|
+
type AppToHostMessage = VerentisReadyMessage | VerentisActionsSetMessage | VerentisActionResultMessage | VerentisCommandsUpdateMessage | VerentisCommandResultMessage | VerentisHostReplyMessage | VerentisTokenRefreshMessage | VerentisNavigateMessage | VerentisResizeMessage | VerentisTitleMessage | VerentisDirtyMessage | VerentisWopiRequest | NativeCollaborationRequest | VerentisChatSubscriptionMessage;
|
|
440
739
|
type AppSurface = 'file' | 'workspace';
|
|
441
740
|
interface AppContextBase {
|
|
442
741
|
application?: AppApplicationContext;
|
|
@@ -449,6 +748,8 @@ interface AppContextBase {
|
|
|
449
748
|
authorizationGeneration?: string;
|
|
450
749
|
wopiEnabled?: boolean;
|
|
451
750
|
};
|
|
751
|
+
/** In-app location the host asks the app to open (for example `/conversations/<id>` from a notification). */
|
|
752
|
+
location?: string;
|
|
452
753
|
}
|
|
453
754
|
interface AppApplicationContext {
|
|
454
755
|
manifestPath: string;
|
|
@@ -1016,6 +1317,8 @@ interface RunFileOptions {
|
|
|
1016
1317
|
arguments?: string[];
|
|
1017
1318
|
/** Structured parameters passed to the engine; serialized to JSON for the platform. */
|
|
1018
1319
|
parameters?: Record<string, unknown>;
|
|
1320
|
+
/** Idempotency key: requests with the same key from the same caller resolve to one execution. */
|
|
1321
|
+
invocationKey?: string;
|
|
1019
1322
|
}
|
|
1020
1323
|
/** Value type of a declared script argument. */
|
|
1021
1324
|
type ScriptArgumentType = 'string' | 'integer' | 'number' | 'boolean' | 'date';
|
|
@@ -1700,6 +2003,111 @@ declare class BusinessModule {
|
|
|
1700
2003
|
private headers;
|
|
1701
2004
|
}
|
|
1702
2005
|
|
|
2006
|
+
/**
|
|
2007
|
+
* Workspace chat (`/v1/chat`). Framework independent; the workspace and caller come from the token. In an installed
|
|
2008
|
+
* app, {@link subscribeChanges} relays identifier-only live hints over the host's existing realtime connection
|
|
2009
|
+
* (requires the approved `chat.read` permission); hints are best effort, so reconcile with {@link events} after
|
|
2010
|
+
* reconnecting and on resume.
|
|
2011
|
+
*/
|
|
2012
|
+
declare class ChatModule {
|
|
2013
|
+
private readonly http;
|
|
2014
|
+
private readonly bridge;
|
|
2015
|
+
private readonly executions?;
|
|
2016
|
+
constructor(http: HttpTransport, bridge?: Bridge | null, executions?: ExecutionsModule | undefined);
|
|
2017
|
+
listConversations(options?: {
|
|
2018
|
+
cursor?: string;
|
|
2019
|
+
limit?: number;
|
|
2020
|
+
}): Promise<ChatPage<ConversationSummary>>;
|
|
2021
|
+
createConversation(options: CreateConversationOptions): Promise<Conversation>;
|
|
2022
|
+
/** Opens (or returns the existing) direct conversation with one participant. */
|
|
2023
|
+
openDirect(participant: ChatParticipant): Promise<Conversation>;
|
|
2024
|
+
getConversation(conversationId: string): Promise<Conversation>;
|
|
2025
|
+
updateConversation(conversationId: string, changes: {
|
|
2026
|
+
title?: string;
|
|
2027
|
+
topic?: string;
|
|
2028
|
+
archived?: boolean;
|
|
2029
|
+
}): Promise<Conversation>;
|
|
2030
|
+
join(conversationId: string): Promise<Conversation>;
|
|
2031
|
+
listPublicChannels(options?: {
|
|
2032
|
+
query?: string;
|
|
2033
|
+
cursor?: string;
|
|
2034
|
+
limit?: number;
|
|
2035
|
+
}): Promise<ChatPage<PublicChannel>>;
|
|
2036
|
+
listMembers(conversationId: string): Promise<ChatPage<Member>>;
|
|
2037
|
+
addMembers(conversationId: string, participants: ChatParticipant[], role?: 'member' | 'admin'): Promise<Conversation>;
|
|
2038
|
+
/** Removes a member; pass yourself to leave. */
|
|
2039
|
+
removeMember(conversationId: string, participant: ChatParticipant): Promise<void>;
|
|
2040
|
+
changeRole(conversationId: string, participant: ChatParticipant, role: MemberRole): Promise<ChatPage<Member>>;
|
|
2041
|
+
listMessages(conversationId: string, options?: {
|
|
2042
|
+
before?: string;
|
|
2043
|
+
limit?: number;
|
|
2044
|
+
}): Promise<MessagePage>;
|
|
2045
|
+
getMessage(conversationId: string, messageId: string): Promise<ChatMessage>;
|
|
2046
|
+
send(conversationId: string, parts: MessagePartInput[], options?: SendMessageOptions): Promise<ChatMessage>;
|
|
2047
|
+
/** Sends Markdown text (rendered without raw HTML by every reader). */
|
|
2048
|
+
sendText(conversationId: string, markdown: string, options?: SendMessageOptions): Promise<ChatMessage>;
|
|
2049
|
+
/** Edits your own message; pass the revision you saw to reject a concurrent edit. */
|
|
2050
|
+
edit(conversationId: string, messageId: string, parts: MessagePartInput[], options?: {
|
|
2051
|
+
revision?: number;
|
|
2052
|
+
}): Promise<ChatMessage>;
|
|
2053
|
+
delete(conversationId: string, messageId: string): Promise<ChatMessage>;
|
|
2054
|
+
/**
|
|
2055
|
+
* Durable changes after a position: `afterSeq` is a snapshot's `highWatermark` (or the last sequence you applied);
|
|
2056
|
+
* `after` is the `next` cursor of a previous page.
|
|
2057
|
+
*/
|
|
2058
|
+
events(conversationId: string, options?: {
|
|
2059
|
+
after?: string;
|
|
2060
|
+
afterSeq?: number;
|
|
2061
|
+
limit?: number;
|
|
2062
|
+
}): Promise<EventPage>;
|
|
2063
|
+
/** Marks messages read through a sequence; never moves back and never past what the server has. */
|
|
2064
|
+
markRead(conversationId: string, readThroughSeq: number): Promise<ReadState>;
|
|
2065
|
+
setPreferences(conversationId: string, preferences: {
|
|
2066
|
+
muted?: boolean;
|
|
2067
|
+
attention?: AttentionLevel;
|
|
2068
|
+
}): Promise<ConversationPreferences>;
|
|
2069
|
+
/** People in your workspace (name and avatar only). */
|
|
2070
|
+
searchPeople(options?: {
|
|
2071
|
+
query?: string;
|
|
2072
|
+
cursor?: string;
|
|
2073
|
+
limit?: number;
|
|
2074
|
+
}): Promise<ChatPage<ChatPerson>>;
|
|
2075
|
+
listBots(): Promise<ChatPage<ChatBot>>;
|
|
2076
|
+
/** Workspace managers (`chat.manage`) decide whether a bot may message people directly. */
|
|
2077
|
+
updateBotSettings(botId: string, settings: {
|
|
2078
|
+
directMessages: 'none' | 'workspace';
|
|
2079
|
+
}): Promise<ChatBot>;
|
|
2080
|
+
listCommands(): Promise<ChatPage<ChatCommand>>;
|
|
2081
|
+
/** Validates and records a command invocation, returning the Execution request to run as you. */
|
|
2082
|
+
invokeCommand(conversationId: string, command: string, args?: Record<string, unknown>, options?: {
|
|
2083
|
+
idempotencyKey?: string;
|
|
2084
|
+
}): Promise<ChatCommandInvocation>;
|
|
2085
|
+
/**
|
|
2086
|
+
* Invokes an installed app's command and runs its script with your own authorisation. Retrying with the same
|
|
2087
|
+
* idempotency key reuses the invocation key, so Execution never runs it twice.
|
|
2088
|
+
*/
|
|
2089
|
+
runCommand(conversationId: string, command: string, args?: Record<string, unknown>, options?: {
|
|
2090
|
+
idempotencyKey?: string;
|
|
2091
|
+
}): Promise<{
|
|
2092
|
+
invocation: ChatCommandInvocation;
|
|
2093
|
+
execution: Execution;
|
|
2094
|
+
}>;
|
|
2095
|
+
/**
|
|
2096
|
+
* Posts as the installed app's bot from a running script. The bot is derived from the script's execution; the
|
|
2097
|
+
* conversation must have added the bot (or, for `userId`, the workspace must allow it to message people).
|
|
2098
|
+
* Retries briefly while Execution's start event is still on its way.
|
|
2099
|
+
*/
|
|
2100
|
+
postAsBot(options: BotPostOptions): Promise<{
|
|
2101
|
+
conversationId: string;
|
|
2102
|
+
message: ChatMessage;
|
|
2103
|
+
}>;
|
|
2104
|
+
/**
|
|
2105
|
+
* Subscribes to live change hints through the host (installed apps only). Returns an unsubscribe function.
|
|
2106
|
+
* Hints carry ids only; duplicates and reordering are normal, and hints are lost while disconnected.
|
|
2107
|
+
*/
|
|
2108
|
+
subscribeChanges(handlers: ChatSubscriptionHandlers): () => void;
|
|
2109
|
+
}
|
|
2110
|
+
|
|
1703
2111
|
/**
|
|
1704
2112
|
* The main Verentis SDK client.
|
|
1705
2113
|
* Provides access to file operations, workspace context, and (in iframe mode)
|
|
@@ -1714,6 +2122,7 @@ declare class VerentisClient {
|
|
|
1714
2122
|
settings: SettingsModule;
|
|
1715
2123
|
notifications: NotificationsModule;
|
|
1716
2124
|
business: BusinessModule;
|
|
2125
|
+
chat: ChatModule;
|
|
1717
2126
|
readonly context: ContextModule;
|
|
1718
2127
|
readonly bridge: Bridge | null;
|
|
1719
2128
|
readonly collaboration: NativeCollaborationClient;
|
|
@@ -1868,5 +2277,5 @@ declare class BridgeAuth implements AuthStrategy {
|
|
|
1868
2277
|
*/
|
|
1869
2278
|
declare function createVerentisClient(options?: VerentisClientOptions): VerentisClient;
|
|
1870
2279
|
|
|
1871
|
-
export { APP_COMMANDS_CAPABILITY, APP_COMMAND_BATCH_SIZE, APP_COMMAND_ID_PATTERN, ApiError, ApiKeyAuth, Bridge, BridgeAuth, BusinessModule, ContextModule, EnginesModule, ExecutionsModule, FilesModule, HOST_MESSAGE_CHANNEL_PATTERN, HttpTransport, InstallationsModule, NativeCollaborationClient, NativeCollaborationError, NotificationsModule, ResourcesModule, SCRIPT_ARGUMENTS_SCHEMA, SettingsModule, TokenAuth, VerentisClient, createVerentisClient, exactHttpsOrigin, findBestMatch, isAppCommand, isDurableSaveConfirmed, isHeaderAction, isNativeSaveResult, isNativeSnapshot, isTerminalStatus, isTrustedMessage, matchMimeType, validateCollaborationDocument, validateNativeCommand };
|
|
1872
|
-
export type { AppApplicationContext, AppCommand, AppCommandHandler, AppCommandRegistration, AppContext, AppSurface, AppToHostMessage, ApplicationDisplayOptions, ApplicationEntryPoint, ApplicationFileType, ApplicationLaunchConfig, ApplicationManifest, ApplicationSpec, ArchiveFormat, AuthOptions, AuthStrategy, BusinessCommand, BusinessCommitResult, BusinessContext, BusinessLedgerEntry, BusinessOperation, BusinessOutcomeRequest, BusinessParameters, BusinessReceivable, BusinessReceivableTotals, BusinessReport, BusinessReportLine, BusinessReportName, BusinessSnapshot, CatalogImage, CollaborationDocument, CollaborationDocumentContext, DeleteFileOptions, EngineFileType, EngineRuntime, EngineTool, EntryPointInfo, ExecuteEngineOptions, Execution, ExecutionEngine, ExecutionEngineListOptions, ExecutionListOptions, ExecutionLogs, ExecutionMode, ExecutionResult, ExecutionScopedOptions, ExecutionStatus, ExecutionTrigger, ExtractUploadOptions, FileAppContext, FileEntry, FileInfo, GetFileOptions, HeaderAction, HeaderActionHandler, HeaderActionRegistration, HeaderActionResult, HostMessageHandler, HostToAppMessage, Installation, InstallationDetail, InstallationGraphOutcomeStatus, InstallationGraphPackage, InstallationGraphPreview, InstallationGraphResult, InstallationLifecycleResult, InstallationListOptions, InstallationMode, InstallationScopedOptions, InstallationStatus, InstalledPackageDescriptor, InstalledPackagePayload, ManifestMetadata, MimeTypeBinding, MoveFileOptions, NamespacedSettings, NativeChangeSet, NativeCollaborationCommand, NativeCollaborationRequest, NativeCollaborationResponse, NativeElement, NativeFile, NativeParticipant, NativePointer, NativeSaveReceipt, NativeSaveResult, NativeScene, NativeSnapshot, NavigateOptions, NodeFileContent, NodeFileMetadata, NodeFileOptions, NotificationRequestOptions, NotificationRequestStatus, NotificationSendOptions, OAuthConfig, PackageDependency, PagedResult, PreviewInstallationOptions, ReadArchiveOptions, RequestOptions, ResolveInstallationOptions, ResourceMimeTypeBinding, ResourceRegistration, ResourceScopedOptions, RunFileOptions, SandboxOptions, ScriptArgumentDefinition, ScriptArgumentDescriptor, ScriptArgumentType, ScriptArgumentsOptions, SettingDeclaration, SettingDeclarationType, SettingGroup, SettingItem, SettingOption, SettingPresence, SettingsScopedOptions, TokenGrant, TokenInfo, UpdateInstallationOptions, VerentisActionInvokeMessage, VerentisActionResultMessage, VerentisActionsSetMessage, VerentisClientOptions, VerentisCommandInvokeMessage, VerentisCommandResultMessage, VerentisCommandsUpdateMessage, VerentisDirtyMessage, VerentisFileChangedMessage, VerentisHostMessage, VerentisHostReplyMessage, VerentisInitMessage, VerentisMessage, VerentisNavigateMessage, VerentisReadyMessage, VerentisResizeMessage, VerentisThemeMessage, VerentisTitleMessage, VerentisTokenRefreshMessage, VerentisTokenRefreshedMessage, VerentisWopiRequest, VerentisWopiResponse, WaitOptions, WopiContinuation, WopiLaunch, WopiSaveCheckpoint, WopiSaveStatus, WorkspaceAppContext, WorkspaceInfo, WriteFileOptions, WriteNodeFileOptions };
|
|
2280
|
+
export { APP_COMMANDS_CAPABILITY, APP_COMMAND_BATCH_SIZE, APP_COMMAND_ID_PATTERN, ApiError, ApiKeyAuth, Bridge, BridgeAuth, BusinessModule, ChatModule, ContextModule, EnginesModule, ExecutionsModule, FilesModule, HOST_MESSAGE_CHANNEL_PATTERN, HttpTransport, InstallationsModule, NativeCollaborationClient, NativeCollaborationError, NotificationsModule, ResourcesModule, SCRIPT_ARGUMENTS_SCHEMA, SettingsModule, TokenAuth, VerentisClient, createVerentisClient, exactHttpsOrigin, findBestMatch, isAppCommand, isDurableSaveConfirmed, isHeaderAction, isNativeSaveResult, isNativeSnapshot, isTerminalStatus, isTrustedMessage, matchMimeType, validateCollaborationDocument, validateNativeCommand };
|
|
2281
|
+
export type { AppApplicationContext, AppCommand, AppCommandHandler, AppCommandRegistration, AppContext, AppSurface, AppToHostMessage, ApplicationDisplayOptions, ApplicationEntryPoint, ApplicationFileType, ApplicationLaunchConfig, ApplicationManifest, ApplicationSpec, ArchiveFormat, AttentionLevel, AuthOptions, AuthStrategy, BotPostOptions, BusinessCommand, BusinessCommitResult, BusinessContext, BusinessLedgerEntry, BusinessOperation, BusinessOutcomeRequest, BusinessParameters, BusinessReceivable, BusinessReceivableTotals, BusinessReport, BusinessReportLine, BusinessReportName, BusinessSnapshot, CatalogImage, ChatBot, ChatChangeHint, ChatCommand, ChatCommandArgument, ChatCommandInvocation, ChatConnectionStatus, ChatMessage, ChatPage, ChatParticipant, ChatPerson, ChatSubscriptionHandlers, CollaborationDocument, CollaborationDocumentContext, Conversation, ConversationEvent, ConversationKind, ConversationPreferences, ConversationSummary, ConversationVisibility, CreateConversationOptions, DeleteFileOptions, EngineFileType, EngineRuntime, EngineTool, EntryPointInfo, EventPage, ExecuteEngineOptions, Execution, ExecutionEngine, ExecutionEngineListOptions, ExecutionListOptions, ExecutionLogs, ExecutionMode, ExecutionResult, ExecutionScopedOptions, ExecutionStatus, ExecutionTrigger, ExtractUploadOptions, FileAppContext, FileEntry, FileInfo, GetFileOptions, HeaderAction, HeaderActionHandler, HeaderActionRegistration, HeaderActionResult, HistoryPolicy, HostMessageHandler, HostToAppMessage, Installation, InstallationDetail, InstallationGraphOutcomeStatus, InstallationGraphPackage, InstallationGraphPreview, InstallationGraphResult, InstallationLifecycleResult, InstallationListOptions, InstallationMode, InstallationScopedOptions, InstallationStatus, InstalledPackageDescriptor, InstalledPackagePayload, ManifestMetadata, Member, MemberRole, Membership, MessagePage, MessagePart, MessagePartInput, MimeTypeBinding, MoveFileOptions, NamespacedSettings, NativeChangeSet, NativeCollaborationCommand, NativeCollaborationRequest, NativeCollaborationResponse, NativeElement, NativeFile, NativeParticipant, NativePointer, NativeSaveReceipt, NativeSaveResult, NativeScene, NativeSnapshot, NavigateOptions, NodeFileContent, NodeFileMetadata, NodeFileOptions, NotificationRequestOptions, NotificationRequestStatus, NotificationSendOptions, OAuthConfig, PackageDependency, PagedResult, PreviewInstallationOptions, PublicChannel, ReadArchiveOptions, ReadState, ReplyPreview, RequestOptions, ResolveInstallationOptions, ResourceMimeTypeBinding, ResourceRegistration, ResourceScopedOptions, RunFileOptions, SandboxOptions, ScriptArgumentDefinition, ScriptArgumentDescriptor, ScriptArgumentType, ScriptArgumentsOptions, SendMessageOptions, SettingDeclaration, SettingDeclarationType, SettingGroup, SettingItem, SettingOption, SettingPresence, SettingsScopedOptions, TokenGrant, TokenInfo, UpdateInstallationOptions, VerentisActionInvokeMessage, VerentisActionResultMessage, VerentisActionsSetMessage, VerentisClientOptions, VerentisCommandInvokeMessage, VerentisCommandResultMessage, VerentisCommandsUpdateMessage, VerentisDirtyMessage, VerentisFileChangedMessage, VerentisHostMessage, VerentisHostReplyMessage, VerentisInitMessage, VerentisMessage, VerentisNavigateMessage, VerentisReadyMessage, VerentisResizeMessage, VerentisThemeMessage, VerentisTitleMessage, VerentisTokenRefreshMessage, VerentisTokenRefreshedMessage, VerentisWopiRequest, VerentisWopiResponse, WaitOptions, WopiContinuation, WopiLaunch, WopiSaveCheckpoint, WopiSaveStatus, WorkspaceAppContext, WorkspaceInfo, WriteFileOptions, WriteNodeFileOptions };
|