@veltdev/sdk-staging 5.0.2-beta.8 → 5.0.2-beta.81
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/app/client/snippyly.model.d.ts +39 -2
- package/app/models/data/activity-resolver.data.model.d.ts +27 -0
- package/app/models/data/activity.data.model.d.ts +181 -0
- package/app/models/data/agent-suggestion.data.model.d.ts +57 -0
- package/app/models/data/attachment-resolver.data.model.d.ts +2 -2
- package/app/models/data/attachment.model.d.ts +1 -0
- package/app/models/data/autocomplete.data.model.d.ts +4 -3
- package/app/models/data/base-metadata.data.model.d.ts +3 -0
- package/app/models/data/comment-actions.data.model.d.ts +14 -0
- package/app/models/data/comment-annotation.data.model.d.ts +62 -2
- package/app/models/data/comment-events.data.model.d.ts +27 -2
- package/app/models/data/comment-resolver.data.model.d.ts +3 -3
- package/app/models/data/comment-sidebar-config.model.d.ts +2 -0
- package/app/models/data/config.data.model.d.ts +26 -0
- package/app/models/data/core-events.data.model.d.ts +74 -1
- package/app/models/data/crdt.data.model.d.ts +51 -0
- package/app/models/data/document-paths.data.model.d.ts +1 -0
- package/app/models/data/document.data.model.d.ts +2 -0
- package/app/models/data/live-state-events.data.model.d.ts +6 -0
- package/app/models/data/notification-resolver.data.model.d.ts +39 -0
- package/app/models/data/notification.model.d.ts +4 -0
- package/app/models/data/page-info.model.d.ts +9 -0
- package/app/models/data/presence-user.data.model.d.ts +5 -0
- package/app/models/data/provider.data.model.d.ts +8 -1
- package/app/models/data/reaction-resolver.data.model.d.ts +3 -3
- package/app/models/data/recorder-annotation.data.model.d.ts +11 -0
- package/app/models/data/recorder-events.data.model.d.ts +3 -0
- package/app/models/data/recorder-resolver.data.model.d.ts +58 -0
- package/app/models/data/resolver.data.model.d.ts +1 -0
- package/app/models/data/rewriter-events.data.model.d.ts +44 -0
- package/app/models/data/suggestion-events.data.model.d.ts +57 -0
- package/app/models/data/suggestion.data.model.d.ts +267 -0
- package/app/models/data/user-resolver.data.model.d.ts +17 -1
- package/app/models/data/user.data.model.d.ts +3 -0
- package/app/models/element/activity-element.model.d.ts +33 -0
- package/app/models/element/comment-element.model.d.ts +48 -8
- package/app/models/element/crdt-element.model.d.ts +88 -1
- package/app/models/element/cross-organization-config.model.d.ts +17 -0
- package/app/models/element/notification-element.model.d.ts +15 -0
- package/app/models/element/presence-element.model.d.ts +25 -0
- package/app/models/element/rewriter-element.model.d.ts +20 -0
- package/app/models/element/suggestion-element.model.d.ts +180 -0
- package/app/utils/console.d.ts +25 -0
- package/app/utils/constants.d.ts +226 -0
- package/app/utils/enums.d.ts +41 -4
- package/app/utils/page-info-store.d.ts +29 -0
- package/environments/environment.d.ts +45 -0
- package/models.d.ts +8 -0
- package/package.json +1 -1
- package/types.d.ts +3 -0
- package/velt.css +1 -1
- package/velt.js +131 -143
|
@@ -51,6 +51,7 @@ export declare class Config {
|
|
|
51
51
|
advancedQueriesDisabled?: boolean;
|
|
52
52
|
/**
|
|
53
53
|
* The domain of the API proxy.
|
|
54
|
+
* @deprecated Use `proxyConfig.apiHost` instead.
|
|
54
55
|
*/
|
|
55
56
|
apiProxyDomain?: string;
|
|
56
57
|
/**
|
|
@@ -61,6 +62,26 @@ export declare class Config {
|
|
|
61
62
|
* Default: true
|
|
62
63
|
*/
|
|
63
64
|
globalStyles?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Configuration for routing all traffic through reverse proxies.
|
|
67
|
+
*/
|
|
68
|
+
proxyConfig?: ProxyConfig;
|
|
69
|
+
}
|
|
70
|
+
export interface ProxyConfig {
|
|
71
|
+
/** Custom host for the Velt CDN (e.g., 'cdn-proxy.customer.com') */
|
|
72
|
+
cdnHost?: string;
|
|
73
|
+
/** Custom host for the Velt API (e.g., 'api-proxy.customer.com') */
|
|
74
|
+
apiHost?: string;
|
|
75
|
+
/** Custom host for Firestore (e.g., 'firestore-proxy.customer.com') */
|
|
76
|
+
v2DbHost?: string;
|
|
77
|
+
/** Custom host for Firebase RTDB (e.g., 'rtdb-proxy.customer.com'). Replaces the firebaseio.com domain in all RTDB URLs. */
|
|
78
|
+
v1DbHost?: string;
|
|
79
|
+
/** Custom host for Firebase Storage (e.g., 'storage-proxy.customer.com'). Replaces firebasestorage.googleapis.com. */
|
|
80
|
+
storageHost?: string;
|
|
81
|
+
/** Custom host for Firebase Auth (e.g., 'auth-proxy.customer.com'). Replaces identitytoolkit.googleapis.com and securetoken.googleapis.com. */
|
|
82
|
+
authHost?: string;
|
|
83
|
+
/** Force long-polling for Firestore and RTDB instead of WebSocket. Default: false (WebSocket). */
|
|
84
|
+
forceLongPolling?: boolean;
|
|
64
85
|
}
|
|
65
86
|
export interface ExtendedFirebaseOptions extends FirebaseOptions {
|
|
66
87
|
storeDbId: string;
|
|
@@ -76,4 +97,9 @@ export interface DisableLogsConfig {
|
|
|
76
97
|
}
|
|
77
98
|
export interface GetProjectConfigResponse {
|
|
78
99
|
isPrivateCommentsEnabled: boolean;
|
|
100
|
+
activityConfig?: ActivityConfig;
|
|
101
|
+
}
|
|
102
|
+
export interface ActivityConfig {
|
|
103
|
+
immutable: boolean;
|
|
104
|
+
isEnabled: boolean;
|
|
79
105
|
}
|
|
@@ -7,6 +7,9 @@ export type CoreEventTypesMap = {
|
|
|
7
7
|
[CoreEventTypes.COMMENT_RESOLVER]: CommentResolverEvent;
|
|
8
8
|
[CoreEventTypes.ATTACHMENT_RESOLVER]: AttachmentResolverEvent;
|
|
9
9
|
[CoreEventTypes.REACTION_RESOLVER]: ReactionResolverEvent;
|
|
10
|
+
[CoreEventTypes.RECORDER_RESOLVER]: RecorderResolverEvent;
|
|
11
|
+
[CoreEventTypes.NOTIFICATION_RESOLVER]: NotificationResolverEvent;
|
|
12
|
+
[CoreEventTypes.ACTIVITY_RESOLVER]: ActivityResolverEvent;
|
|
10
13
|
[CoreEventTypes.VELT_BUTTON_CLICK]: VeltButtonClickEvent;
|
|
11
14
|
[CoreEventTypes.USER_UPDATE]: UserUpdateEvent;
|
|
12
15
|
[CoreEventTypes.DOCUMENT_INIT]: DocumentInitEvent;
|
|
@@ -23,7 +26,8 @@ export declare enum UserResolverSource {
|
|
|
23
26
|
SET_SINGLE_EDITOR_MODE_LIVE_STATE_DATA_FOR_DIFFERENT_USER_PRESENT_ON_TAB = "setSingleEditorModeLiveStateDataForDifferentUserPresentOnTab",
|
|
24
27
|
RESOLVE_AND_MERGE_SINGLE_EDITOR_LIVE_STATE_DATA_WITH_USER = "resolveAndMergeSingleEditorLiveStateDataWithUser",
|
|
25
28
|
GET_SINGLE_EDITOR_MODE_DATA = "getSingleEditorModeData",
|
|
26
|
-
RESOLVE_USERS_FROM_HUDDLE_MESSAGES = "resolveUsersFromHuddleMessages"
|
|
29
|
+
RESOLVE_USERS_FROM_HUDDLE_MESSAGES = "resolveUsersFromHuddleMessages",
|
|
30
|
+
RESOLVE_USER_IDS_BY_EMAIL = "resolveUserIdsByEmail"
|
|
27
31
|
}
|
|
28
32
|
export declare enum UserResolverModuleName {
|
|
29
33
|
IDENTIFY = "identify/authProvider",
|
|
@@ -146,6 +150,75 @@ export type ReactionResolverEventType = {
|
|
|
146
150
|
REACTION_DELETE_RESULT: 'reactionDeleteResult';
|
|
147
151
|
REACTION_DELETE_ERROR: 'reactionDeleteError';
|
|
148
152
|
};
|
|
153
|
+
export declare enum RecorderResolverSource {
|
|
154
|
+
RESOLVE_RECORDER_ANNOTATIONS = "resolveRecorderAnnotations",
|
|
155
|
+
SAVE_RECORDER_ANNOTATION = "saveRecorderAnnotation",
|
|
156
|
+
DELETE_RECORDER_ANNOTATION = "deleteRecorderAnnotation",
|
|
157
|
+
FORMAT_RESPONSE = "formatResponse",
|
|
158
|
+
INIT_DOCUMENTS = "initDocuments",
|
|
159
|
+
SET_DATA = "setData",
|
|
160
|
+
UPDATE_DATA = "updateData",
|
|
161
|
+
DELETE_DATA = "deleteData"
|
|
162
|
+
}
|
|
163
|
+
export declare enum RecorderResolverModuleName {
|
|
164
|
+
GET_RECORDER_ANNOTATIONS = "getRecorderAnnotations"
|
|
165
|
+
}
|
|
166
|
+
export type RecorderResolverEvent = BaseResolverEvent<RecorderResolverEventType, RecorderResolverSource, RecorderResolverModuleName>;
|
|
167
|
+
export type RecorderResolverEventType = {
|
|
168
|
+
RECORDER_RESOLUTION_REQUEST_FORMED: 'recorderResolutionRequestFormed';
|
|
169
|
+
RECORDER_RESOLUTION_REQUEST_TRIGGERED: 'recorderResolutionRequestTriggered';
|
|
170
|
+
RECORDER_RESOLUTION_RESULT: 'recorderResolutionResult';
|
|
171
|
+
RECORDER_RESOLUTION_ERROR: 'recorderResolutionError';
|
|
172
|
+
RECORDER_RESOLUTION_RESULT_FROM_CACHE: 'recorderResolutionResultFromCache';
|
|
173
|
+
RECORDER_SAVE_REQUEST_FORMED: 'recorderSaveRequestFormed';
|
|
174
|
+
RECORDER_SAVE_REQUEST_TRIGGERED: 'recorderSaveRequestTriggered';
|
|
175
|
+
RECORDER_SAVE_RESULT: 'recorderSaveResult';
|
|
176
|
+
RECORDER_SAVE_ERROR: 'recorderSaveError';
|
|
177
|
+
RECORDER_DELETE_REQUEST_FORMED: 'recorderDeleteRequestFormed';
|
|
178
|
+
RECORDER_DELETE_REQUEST_TRIGGERED: 'recorderDeleteRequestTriggered';
|
|
179
|
+
RECORDER_DELETE_RESULT: 'recorderDeleteResult';
|
|
180
|
+
RECORDER_DELETE_ERROR: 'recorderDeleteError';
|
|
181
|
+
};
|
|
182
|
+
export declare enum NotificationResolverSource {
|
|
183
|
+
RESOLVE_NOTIFICATIONS = "resolveNotifications",
|
|
184
|
+
DELETE_NOTIFICATION = "deleteNotification",
|
|
185
|
+
DELETE_DATA = "deleteData",
|
|
186
|
+
FORMAT_RESPONSE = "formatResponse"
|
|
187
|
+
}
|
|
188
|
+
export declare enum NotificationResolverModuleName {
|
|
189
|
+
GET_NOTIFICATIONS = "getNotifications"
|
|
190
|
+
}
|
|
191
|
+
export type NotificationResolverEventType = {
|
|
192
|
+
NOTIFICATION_RESOLUTION_REQUEST_FORMED: 'notificationResolutionRequestFormed';
|
|
193
|
+
NOTIFICATION_RESOLUTION_REQUEST_TRIGGERED: 'notificationResolutionRequestTriggered';
|
|
194
|
+
NOTIFICATION_RESOLUTION_RESULT: 'notificationResolutionResult';
|
|
195
|
+
NOTIFICATION_RESOLUTION_ERROR: 'notificationResolutionError';
|
|
196
|
+
NOTIFICATION_DELETE_REQUEST_FORMED: 'notificationDeleteRequestFormed';
|
|
197
|
+
NOTIFICATION_DELETE_REQUEST_TRIGGERED: 'notificationDeleteRequestTriggered';
|
|
198
|
+
NOTIFICATION_DELETE_RESULT: 'notificationDeleteResult';
|
|
199
|
+
NOTIFICATION_DELETE_ERROR: 'notificationDeleteError';
|
|
200
|
+
};
|
|
201
|
+
export type NotificationResolverEvent = BaseResolverEvent<NotificationResolverEventType, NotificationResolverSource, NotificationResolverModuleName>;
|
|
202
|
+
export declare enum ActivityResolverSource {
|
|
203
|
+
RESOLVE_ACTIVITIES = "resolveActivities",
|
|
204
|
+
SAVE_ACTIVITY = "saveActivity",
|
|
205
|
+
FORMAT_RESPONSE = "formatResponse"
|
|
206
|
+
}
|
|
207
|
+
export declare enum ActivityResolverModuleName {
|
|
208
|
+
GET_ACTIVITIES = "getActivities"
|
|
209
|
+
}
|
|
210
|
+
export type ActivityResolverEventType = {
|
|
211
|
+
ACTIVITY_RESOLUTION_REQUEST_FORMED: 'activityResolutionRequestFormed';
|
|
212
|
+
ACTIVITY_RESOLUTION_REQUEST_TRIGGERED: 'activityResolutionRequestTriggered';
|
|
213
|
+
ACTIVITY_RESOLUTION_RESULT: 'activityResolutionResult';
|
|
214
|
+
ACTIVITY_RESOLUTION_ERROR: 'activityResolutionError';
|
|
215
|
+
ACTIVITY_RESOLUTION_RESULT_FROM_CACHE: 'activityResolutionResultFromCache';
|
|
216
|
+
ACTIVITY_SAVE_REQUEST_FORMED: 'activitySaveRequestFormed';
|
|
217
|
+
ACTIVITY_SAVE_REQUEST_TRIGGERED: 'activitySaveRequestTriggered';
|
|
218
|
+
ACTIVITY_SAVE_RESULT: 'activitySaveResult';
|
|
219
|
+
ACTIVITY_SAVE_ERROR: 'activitySaveError';
|
|
220
|
+
};
|
|
221
|
+
export type ActivityResolverEvent = BaseResolverEvent<ActivityResolverEventType, ActivityResolverSource, ActivityResolverModuleName>;
|
|
149
222
|
export type ErrorEvent = {
|
|
150
223
|
event?: string;
|
|
151
224
|
sourceMethod?: string;
|
|
@@ -58,3 +58,54 @@ export interface CrdtDeleteVersionQuery {
|
|
|
58
58
|
id: string;
|
|
59
59
|
versionId: string;
|
|
60
60
|
}
|
|
61
|
+
export interface CrdtPushMessageQuery {
|
|
62
|
+
id: string;
|
|
63
|
+
data: number[];
|
|
64
|
+
yjsClientId: number;
|
|
65
|
+
messageType?: 'sync' | 'awareness';
|
|
66
|
+
/** User-facing value for event emission only (not stored in database) */
|
|
67
|
+
eventData?: unknown;
|
|
68
|
+
/** Yjs data type: 'text' | 'map' | 'array' | 'xml' | 'xmltext' */
|
|
69
|
+
type?: string;
|
|
70
|
+
/** Content key used in Y.Doc shared types */
|
|
71
|
+
contentKey?: string;
|
|
72
|
+
/** Editor/library source: 'tiptap', 'plate', 'codemirror', etc. */
|
|
73
|
+
source?: string;
|
|
74
|
+
}
|
|
75
|
+
export interface CrdtOnMessageQuery {
|
|
76
|
+
id: string;
|
|
77
|
+
callback: (message: CrdtMessageData) => void;
|
|
78
|
+
afterTs?: number;
|
|
79
|
+
}
|
|
80
|
+
export interface CrdtMessageData {
|
|
81
|
+
data: number[];
|
|
82
|
+
yjsClientId: number;
|
|
83
|
+
timestamp: number;
|
|
84
|
+
}
|
|
85
|
+
export interface CrdtSnapshotData {
|
|
86
|
+
state?: Uint8Array | number[];
|
|
87
|
+
vector?: Uint8Array | number[];
|
|
88
|
+
timestamp?: number;
|
|
89
|
+
}
|
|
90
|
+
export interface CrdtGetSnapshotQuery {
|
|
91
|
+
id: string;
|
|
92
|
+
}
|
|
93
|
+
export interface CrdtSaveSnapshotQuery {
|
|
94
|
+
id: string;
|
|
95
|
+
state: Uint8Array | number[];
|
|
96
|
+
vector: Uint8Array | number[];
|
|
97
|
+
/** Yjs data type: 'text' | 'map' | 'array' | 'xml' | 'xmltext' */
|
|
98
|
+
type?: string;
|
|
99
|
+
/** Content key used in Y.Doc shared types */
|
|
100
|
+
contentKey?: string;
|
|
101
|
+
/** Editor/library source: 'tiptap', 'plate', 'codemirror', etc. */
|
|
102
|
+
source?: string;
|
|
103
|
+
}
|
|
104
|
+
export interface CrdtGetMessagesQuery {
|
|
105
|
+
id: string;
|
|
106
|
+
afterTs?: number;
|
|
107
|
+
}
|
|
108
|
+
export interface CrdtPruneMessagesQuery {
|
|
109
|
+
id: string;
|
|
110
|
+
beforeTs: number;
|
|
111
|
+
}
|
|
@@ -16,6 +16,8 @@ export interface SetDocumentsRequestOptions {
|
|
|
16
16
|
locationId?: string;
|
|
17
17
|
rootDocumentId?: string;
|
|
18
18
|
context?: SetDocumentsContext;
|
|
19
|
+
debounceTime?: number;
|
|
20
|
+
optimisticPermissions?: boolean;
|
|
19
21
|
}
|
|
20
22
|
export interface UpdateDocumentsRequest<T = unknown> {
|
|
21
23
|
organizationId?: string;
|
|
@@ -5,12 +5,18 @@ export interface AccessRequestEvent {
|
|
|
5
5
|
editor?: User;
|
|
6
6
|
timestamp?: number;
|
|
7
7
|
status?: string;
|
|
8
|
+
totalUsers?: number;
|
|
9
|
+
presenceSnippylyUserIds?: string[];
|
|
10
|
+
presenceClientUserIds?: string[];
|
|
8
11
|
}
|
|
9
12
|
export interface SEMEvent {
|
|
10
13
|
viewer?: User;
|
|
11
14
|
editor?: User;
|
|
12
15
|
timestamp?: number;
|
|
13
16
|
role?: string;
|
|
17
|
+
totalUsers?: number;
|
|
18
|
+
presenceSnippylyUserIds?: string[];
|
|
19
|
+
presenceClientUserIds?: string[];
|
|
14
20
|
}
|
|
15
21
|
export type LiveStateEventTypesMap = {
|
|
16
22
|
[LiveStateSyncEventTypes.ACCESS_REQUESTED]: AccessRequestEvent;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ResolverEndpointConfig, ResolverResponse, RetryConfig } from "./resolver.data.model";
|
|
2
|
+
import { User } from "./user.data.model";
|
|
3
|
+
export interface NotificationDataProvider {
|
|
4
|
+
get?: (request: GetNotificationResolverRequest) => Promise<ResolverResponse<Record<string, PartialNotification>>>;
|
|
5
|
+
delete?: (request: DeleteNotificationResolverRequest) => Promise<ResolverResponse<undefined>>;
|
|
6
|
+
config?: NotificationResolverConfig;
|
|
7
|
+
}
|
|
8
|
+
export interface NotificationResolverConfig {
|
|
9
|
+
resolveTimeout?: number;
|
|
10
|
+
getRetryConfig?: RetryConfig;
|
|
11
|
+
deleteRetryConfig?: RetryConfig;
|
|
12
|
+
getConfig?: ResolverEndpointConfig;
|
|
13
|
+
deleteConfig?: ResolverEndpointConfig;
|
|
14
|
+
}
|
|
15
|
+
export interface GetNotificationResolverRequest {
|
|
16
|
+
organizationId: string;
|
|
17
|
+
notificationIds: string[];
|
|
18
|
+
}
|
|
19
|
+
export interface DeleteNotificationResolverRequest {
|
|
20
|
+
notificationId: string;
|
|
21
|
+
organizationId: string;
|
|
22
|
+
}
|
|
23
|
+
export interface PartialNotification {
|
|
24
|
+
notificationId: string;
|
|
25
|
+
displayHeadlineMessageTemplate?: string;
|
|
26
|
+
displayHeadlineMessageTemplateData?: {
|
|
27
|
+
actionUser?: User;
|
|
28
|
+
recipientUser?: User;
|
|
29
|
+
actionMessage?: string;
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
};
|
|
32
|
+
displayBodyMessage?: string;
|
|
33
|
+
displayBodyMessageTemplate?: string;
|
|
34
|
+
displayBodyMessageTemplateData?: {
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
};
|
|
37
|
+
notificationSourceData?: any;
|
|
38
|
+
[key: string]: any;
|
|
39
|
+
}
|
|
@@ -137,6 +137,10 @@ export declare class Notification {
|
|
|
137
137
|
* Is comment text available
|
|
138
138
|
*/
|
|
139
139
|
isCommentResolverUsed?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Is notification resolver used
|
|
142
|
+
*/
|
|
143
|
+
isNotificationResolverUsed?: boolean;
|
|
140
144
|
/**
|
|
141
145
|
* Display body message template
|
|
142
146
|
*/
|
|
@@ -47,4 +47,13 @@ export declare class PageInfo {
|
|
|
47
47
|
*/
|
|
48
48
|
screenWidth?: number;
|
|
49
49
|
deviceInfo?: IDeviceInfo;
|
|
50
|
+
/**
|
|
51
|
+
* @param applyClientOverride when true (default), merges the CURRENT document's client page
|
|
52
|
+
* info override at construction time — covers the bare `new PageInfo()` sites
|
|
53
|
+
* (cursor / presence / selection). No-op when the client hasn't provided any, so the
|
|
54
|
+
* default empty-page-info behavior is unchanged. `getPageInfo(documentId)` passes
|
|
55
|
+
* `false` so it can apply a specific document's override itself, without the current
|
|
56
|
+
* document's fields leaking onto a different document's page info.
|
|
57
|
+
*/
|
|
58
|
+
constructor(applyClientOverride?: boolean);
|
|
50
59
|
}
|
|
@@ -83,4 +83,9 @@ export declare class PresenceUser {
|
|
|
83
83
|
initial?: string;
|
|
84
84
|
isTabAway?: boolean;
|
|
85
85
|
isUserIdle?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Whether this custom user is local-only (not persisted to DB).
|
|
88
|
+
* Only applicable to users added via addUser API.
|
|
89
|
+
*/
|
|
90
|
+
localOnly?: boolean;
|
|
86
91
|
}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
+
import { ActivityAnnotationDataProvider } from "./activity-resolver.data.model";
|
|
1
2
|
import { CommentAnnotationDataProvider } from "./comment-resolver.data.model";
|
|
2
3
|
import { AttachmentDataProvider } from "./attachment-resolver.data.model";
|
|
4
|
+
import { NotificationDataProvider } from "./notification-resolver.data.model";
|
|
3
5
|
import { ReactionAnnotationDataProvider } from "./reaction-resolver.data.model";
|
|
4
|
-
import {
|
|
6
|
+
import { RecorderAnnotationDataProvider } from "./recorder-resolver.data.model";
|
|
7
|
+
import { AnonymousUserDataProvider, UserDataProvider } from "./user-resolver.data.model";
|
|
5
8
|
export interface VeltDataProvider {
|
|
6
9
|
comment?: CommentAnnotationDataProvider;
|
|
7
10
|
user?: UserDataProvider;
|
|
8
11
|
reaction?: ReactionAnnotationDataProvider;
|
|
9
12
|
attachment?: AttachmentDataProvider;
|
|
13
|
+
anonymousUser?: AnonymousUserDataProvider;
|
|
14
|
+
recorder?: RecorderAnnotationDataProvider;
|
|
15
|
+
notification?: NotificationDataProvider;
|
|
16
|
+
activity?: ActivityAnnotationDataProvider;
|
|
10
17
|
}
|
|
@@ -4,9 +4,9 @@ import { PartialUser } from "./comment-resolver.data.model";
|
|
|
4
4
|
import { ReactionAnnotation } from "./reaction-annotation.data.model";
|
|
5
5
|
import { ResolverConfig, ResolverResponse } from "./resolver.data.model";
|
|
6
6
|
export interface ReactionAnnotationDataProvider {
|
|
7
|
-
get
|
|
8
|
-
save
|
|
9
|
-
delete
|
|
7
|
+
get?: (request: GetReactionResolverRequest) => Promise<ResolverResponse<Record<string, PartialReactionAnnotation>>>;
|
|
8
|
+
save?: (request: SaveReactionResolverRequest) => Promise<ResolverResponse<undefined>>;
|
|
9
|
+
delete?: (request: DeleteReactionResolverRequest) => Promise<ResolverResponse<undefined>>;
|
|
10
10
|
config?: ResolverConfig;
|
|
11
11
|
}
|
|
12
12
|
export interface GetReactionResolverRequest {
|
|
@@ -150,6 +150,17 @@ export declare class RecorderAnnotation {
|
|
|
150
150
|
chunkUrls?: {
|
|
151
151
|
[key: number]: string;
|
|
152
152
|
};
|
|
153
|
+
/**
|
|
154
|
+
* Whether the recorder resolver is used for this annotation.
|
|
155
|
+
* Used by UI components to show loading states while resolver data is being fetched.
|
|
156
|
+
*/
|
|
157
|
+
isRecorderResolverUsed?: boolean;
|
|
158
|
+
/**
|
|
159
|
+
* Whether the real recording URL is available.
|
|
160
|
+
* Set to false when the annotation is first saved (URL is still a local blob),
|
|
161
|
+
* and true once the actual URL from storage is available after the async upload completes.
|
|
162
|
+
*/
|
|
163
|
+
isUrlAvailable?: boolean;
|
|
153
164
|
}
|
|
154
165
|
export interface RecorderAnnotationEditVersion {
|
|
155
166
|
from?: User;
|
|
@@ -4,6 +4,8 @@ export interface TranscriptionDoneEvent extends RecorderData {
|
|
|
4
4
|
}
|
|
5
5
|
export interface RecordingDoneEvent extends RecorderData {
|
|
6
6
|
}
|
|
7
|
+
export interface RecordingDoneLocalEvent extends RecorderData {
|
|
8
|
+
}
|
|
7
9
|
export interface RecordingDeleteEvent extends RecorderData {
|
|
8
10
|
}
|
|
9
11
|
export interface RecordingEditDoneEvent extends RecorderData {
|
|
@@ -35,6 +37,7 @@ export interface RecordingSaveInitiatedEvent {
|
|
|
35
37
|
export type RecorderEventTypesMap = {
|
|
36
38
|
[RecorderEventTypes.TRANSCRIPTION_DONE]: TranscriptionDoneEvent;
|
|
37
39
|
[RecorderEventTypes.RECORDING_DONE]: RecordingDoneEvent;
|
|
40
|
+
[RecorderEventTypes.RECORDING_DONE_LOCAL]: RecordingDoneLocalEvent;
|
|
38
41
|
[RecorderEventTypes.RECORDING_EDIT_DONE]: RecordingEditDoneEvent;
|
|
39
42
|
[RecorderEventTypes.DELETE_RECORDING]: RecordingDeleteEvent;
|
|
40
43
|
[RecorderEventTypes.RECORDING_STARTED]: RecordingStartedEvent;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ResolverActions } from "../../utils/enums";
|
|
2
|
+
import { AttachmentDataProvider } from "./attachment-resolver.data.model";
|
|
3
|
+
import { BaseMetadata } from "./base-metadata.data.model";
|
|
4
|
+
import { RecorderAnnotation } from "./recorder-annotation.data.model";
|
|
5
|
+
import { ResolverConfig, ResolverResponse } from "./resolver.data.model";
|
|
6
|
+
import { Attachment } from "./attachment.model";
|
|
7
|
+
import { Transcription } from "./transcription.data.model";
|
|
8
|
+
import { User } from "./user.data.model";
|
|
9
|
+
export interface RecorderAnnotationDataProvider {
|
|
10
|
+
get?: (request: GetRecorderResolverRequest) => Promise<ResolverResponse<Record<string, PartialRecorderAnnotation>>>;
|
|
11
|
+
save?: (request: SaveRecorderResolverRequest) => Promise<ResolverResponse<SaveRecorderResolverData | undefined>>;
|
|
12
|
+
delete?: (request: DeleteRecorderResolverRequest) => Promise<ResolverResponse<undefined>>;
|
|
13
|
+
config?: ResolverConfig;
|
|
14
|
+
uploadChunks?: boolean;
|
|
15
|
+
storage?: AttachmentDataProvider;
|
|
16
|
+
}
|
|
17
|
+
export interface GetRecorderResolverRequest {
|
|
18
|
+
organizationId: string;
|
|
19
|
+
recorderAnnotationIds?: string[];
|
|
20
|
+
documentIds?: string[];
|
|
21
|
+
}
|
|
22
|
+
export interface SaveRecorderResolverRequest {
|
|
23
|
+
recorderAnnotation: Record<string, PartialRecorderAnnotation>;
|
|
24
|
+
event?: ResolverActions;
|
|
25
|
+
metadata?: BaseMetadata;
|
|
26
|
+
}
|
|
27
|
+
export interface SaveRecorderResolverData {
|
|
28
|
+
transcription?: Transcription;
|
|
29
|
+
attachment?: Attachment | null;
|
|
30
|
+
attachments?: Attachment[];
|
|
31
|
+
}
|
|
32
|
+
export interface DeleteRecorderResolverRequest {
|
|
33
|
+
recorderAnnotationId: string;
|
|
34
|
+
metadata?: BaseMetadata;
|
|
35
|
+
event?: ResolverActions;
|
|
36
|
+
}
|
|
37
|
+
export interface PartialRecorderAnnotation {
|
|
38
|
+
annotationId: string;
|
|
39
|
+
metadata?: BaseMetadata;
|
|
40
|
+
from?: User;
|
|
41
|
+
transcription?: Transcription;
|
|
42
|
+
attachment?: Attachment | null;
|
|
43
|
+
attachments?: Attachment[];
|
|
44
|
+
chunkUrls?: Record<number, string>;
|
|
45
|
+
recordingEditVersions?: Record<number, PartialRecorderAnnotationEditVersion>;
|
|
46
|
+
[key: string]: any;
|
|
47
|
+
}
|
|
48
|
+
export interface PartialRecorderAnnotationEditVersion {
|
|
49
|
+
from?: User;
|
|
50
|
+
attachment?: Attachment | null;
|
|
51
|
+
attachments?: Attachment[];
|
|
52
|
+
transcription?: Transcription;
|
|
53
|
+
}
|
|
54
|
+
export interface PartialRecorderAnnotationResult {
|
|
55
|
+
strippedData: Record<string, PartialRecorderAnnotation> | null;
|
|
56
|
+
originalData: RecorderAnnotation | null;
|
|
57
|
+
eventType?: ResolverActions;
|
|
58
|
+
}
|
|
@@ -9,6 +9,7 @@ export interface ResolverConfig {
|
|
|
9
9
|
getRetryConfig?: RetryConfig;
|
|
10
10
|
resolveUsersConfig?: ResolveUsersConfig;
|
|
11
11
|
fieldsToRemove?: string[];
|
|
12
|
+
additionalFields?: string[];
|
|
12
13
|
getConfig?: ResolverEndpointConfig;
|
|
13
14
|
saveConfig?: ResolverEndpointConfig;
|
|
14
15
|
deleteConfig?: ResolverEndpointConfig;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { TargetTextRange } from './target-text-range.data.model';
|
|
2
|
+
import { RewriterEventTypes } from '../../utils/enums';
|
|
3
|
+
export type OpenAiModel = 'gpt-5.4' | 'gpt-5.4-pro' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5' | 'gpt-4.1' | 'gpt-4o' | 'gpt-4o-mini' | 'gpt-4-turbo' | 'o3-pro' | 'o3' | 'o3-mini' | 'o4-mini';
|
|
4
|
+
export type AnthropicModel = 'claude-opus-4-6' | 'claude-sonnet-4-6' | 'claude-haiku-4-5' | 'claude-sonnet-4-5' | 'claude-opus-4-5' | 'claude-opus-4-1' | 'claude-sonnet-4-0' | 'claude-opus-4-0';
|
|
5
|
+
export type GeminiModel = 'gemini-3.1-pro-preview' | 'gemini-3-flash-preview' | 'gemini-3.1-flash-lite-preview' | 'gemini-2.5-flash' | 'gemini-2.5-flash-lite' | 'gemini-2.5-pro';
|
|
6
|
+
export type AiModel = OpenAiModel | AnthropicModel | GeminiModel | (string & NonNullable<unknown>);
|
|
7
|
+
export interface TextSelectedEvent {
|
|
8
|
+
selectionId: string;
|
|
9
|
+
text: string;
|
|
10
|
+
targetTextRange: TargetTextRange;
|
|
11
|
+
}
|
|
12
|
+
export interface RewriterAskAiRequest {
|
|
13
|
+
model: AiModel;
|
|
14
|
+
prompt: string;
|
|
15
|
+
selectedText: string;
|
|
16
|
+
}
|
|
17
|
+
export interface RewriterReplaceTextRequest {
|
|
18
|
+
text: string;
|
|
19
|
+
event: TextSelectedEvent;
|
|
20
|
+
}
|
|
21
|
+
export interface RewriterAddCommentRequest {
|
|
22
|
+
text: string;
|
|
23
|
+
event: TextSelectedEvent;
|
|
24
|
+
}
|
|
25
|
+
export interface RewriterAskAiResponse {
|
|
26
|
+
text: string;
|
|
27
|
+
success: boolean;
|
|
28
|
+
error?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface RewriterReplaceTextResponse {
|
|
31
|
+
success: boolean;
|
|
32
|
+
originalText: string;
|
|
33
|
+
replacedText: string;
|
|
34
|
+
error?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface RewriterAddCommentResponse {
|
|
37
|
+
success: boolean;
|
|
38
|
+
annotationId?: string;
|
|
39
|
+
commentText?: string;
|
|
40
|
+
error?: string;
|
|
41
|
+
}
|
|
42
|
+
export type RewriterEventTypesMap = {
|
|
43
|
+
[RewriterEventTypes.TEXT_SELECTED]: TextSelectedEvent;
|
|
44
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { SuggestionEventTypes } from '../../utils/enums';
|
|
2
|
+
import { ApprovedSuggestion, PendingSuggestion, RejectedSuggestion, StaleSuggestion, TargetEditCommitBuilder, TargetEditDetails } from './suggestion.data.model';
|
|
3
|
+
/**
|
|
4
|
+
* Public payload types for the v1 Suggestions feature. Mirrors the layout of
|
|
5
|
+
* `comment-events.data.model.ts` and `recorder-events.data.model.ts`:
|
|
6
|
+
*
|
|
7
|
+
* - One named interface per event payload.
|
|
8
|
+
* - One `SuggestionEventTypesMap` keyed by `SuggestionEventTypes` enum values.
|
|
9
|
+
*
|
|
10
|
+
* Customers pass an event-name string (or the enum constant — they're
|
|
11
|
+
* equivalent) to `velt.getSuggestionElement().on(...)` and receive an
|
|
12
|
+
* `Observable<SuggestionEventTypesMap[T]>`.
|
|
13
|
+
*
|
|
14
|
+
* No separate `actor`/`user` field on the payloads: the user info is on
|
|
15
|
+
* `suggestion.createdBy` (for created) and `suggestion.resolvedBy` (for
|
|
16
|
+
* approved/rejected/stale). Matches the comment-event shape.
|
|
17
|
+
*/
|
|
18
|
+
export interface SuggestionCreatedEvent {
|
|
19
|
+
suggestion: PendingSuggestion;
|
|
20
|
+
timestamp: number;
|
|
21
|
+
}
|
|
22
|
+
export interface SuggestionApprovedEvent {
|
|
23
|
+
suggestion: ApprovedSuggestion;
|
|
24
|
+
timestamp: number;
|
|
25
|
+
}
|
|
26
|
+
export interface SuggestionRejectedEvent {
|
|
27
|
+
suggestion: RejectedSuggestion;
|
|
28
|
+
timestamp: number;
|
|
29
|
+
}
|
|
30
|
+
export interface SuggestionStaleEvent {
|
|
31
|
+
suggestion: StaleSuggestion;
|
|
32
|
+
timestamp: number;
|
|
33
|
+
}
|
|
34
|
+
export interface TargetEditStartEvent {
|
|
35
|
+
details: TargetEditDetails;
|
|
36
|
+
timestamp: number;
|
|
37
|
+
}
|
|
38
|
+
export interface TargetEditCommitEvent {
|
|
39
|
+
details: TargetEditDetails;
|
|
40
|
+
/**
|
|
41
|
+
* Pre-bound builder. Calling it commits the suggestion using the SDK's
|
|
42
|
+
* default summary/metadata, optionally overridden by `result`. If the
|
|
43
|
+
* customer's `onTargetEditCommit` handler already returned a non-null
|
|
44
|
+
* result for this edit, this builder is a no-op so subscribers can't
|
|
45
|
+
* double-commit.
|
|
46
|
+
*/
|
|
47
|
+
commitSuggestion: TargetEditCommitBuilder;
|
|
48
|
+
timestamp: number;
|
|
49
|
+
}
|
|
50
|
+
export type SuggestionEventTypesMap = {
|
|
51
|
+
[SuggestionEventTypes.SUGGESTION_CREATED]: SuggestionCreatedEvent;
|
|
52
|
+
[SuggestionEventTypes.SUGGESTION_APPROVED]: SuggestionApprovedEvent;
|
|
53
|
+
[SuggestionEventTypes.SUGGESTION_REJECTED]: SuggestionRejectedEvent;
|
|
54
|
+
[SuggestionEventTypes.SUGGESTION_STALE]: SuggestionStaleEvent;
|
|
55
|
+
[SuggestionEventTypes.TARGET_EDIT_START]: TargetEditStartEvent;
|
|
56
|
+
[SuggestionEventTypes.TARGET_EDIT_COMMIT]: TargetEditCommitEvent;
|
|
57
|
+
};
|