@veltdev/sdk-staging 5.0.2-beta.2 → 5.0.2-beta.21
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 +10 -1
- package/app/models/data/activity.data.model.d.ts +177 -0
- package/app/models/data/autocomplete.data.model.d.ts +3 -3
- package/app/models/data/base-metadata.data.model.d.ts +3 -0
- package/app/models/data/comment-actions.data.model.d.ts +2 -0
- package/app/models/data/comment-annotation.data.model.d.ts +11 -3
- package/app/models/data/comment-events.data.model.d.ts +17 -4
- package/app/models/data/config.data.model.d.ts +5 -0
- package/app/models/data/core-events.data.model.d.ts +2 -1
- package/app/models/data/crdt.data.model.d.ts +51 -0
- package/app/models/data/live-state-events.data.model.d.ts +6 -0
- package/app/models/data/provider.data.model.d.ts +2 -1
- package/app/models/data/user-resolver.data.model.d.ts +15 -1
- package/app/models/element/activity-element.model.d.ts +33 -0
- package/app/models/element/comment-element.model.d.ts +20 -0
- package/app/models/element/crdt-element.model.d.ts +88 -1
- package/app/utils/constants.d.ts +31 -0
- package/app/utils/enums.d.ts +17 -3
- package/models.d.ts +1 -0
- package/package.json +1 -1
- package/types.d.ts +1 -0
- package/velt.js +116 -116
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import { CrdtGetDataQuery, CrdtGetVersionQuery, CrdtOnDataChangeQuery, CrdtOnPresenceChangeQuery, CrdtOnRegisteredUserChangeQuery, CrdtOnStateChangeQuery, CrdtRegisterSyncUserQuery, CrdtSetPresenceQuery, CrdtSaveVersionQuery, CrdtUpdateDataQuery, CrdtUpdateStateQuery } from "../data/crdt.data.model";
|
|
2
|
+
import { CrdtGetDataQuery, CrdtGetMessagesQuery, CrdtGetSnapshotQuery, CrdtGetVersionQuery, CrdtGetVersionsQuery, CrdtMessageData, CrdtOnDataChangeQuery, CrdtOnMessageQuery, CrdtOnPresenceChangeQuery, CrdtOnRegisteredUserChangeQuery, CrdtOnStateChangeQuery, CrdtPruneMessagesQuery, CrdtPushMessageQuery, CrdtRegisterSyncUserQuery, CrdtSaveSnapshotQuery, CrdtSetPresenceQuery, CrdtSaveVersionQuery, CrdtSnapshotData, CrdtUpdateDataQuery, CrdtUpdateStateQuery } from "../data/crdt.data.model";
|
|
3
3
|
import { CrdtEventTypesMap } from "../data/crdt-events.data.model";
|
|
4
4
|
|
|
5
5
|
export declare class CrdtElement {
|
|
@@ -80,6 +80,12 @@ export declare class CrdtElement {
|
|
|
80
80
|
*/
|
|
81
81
|
getVersion: (getVersionQuery: CrdtGetVersionQuery) => Promise<any>;
|
|
82
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Get all versions of a specific CRDT document
|
|
85
|
+
* @param id Document ID
|
|
86
|
+
*/
|
|
87
|
+
getVersions: (getVersionsQuery: CrdtGetVersionsQuery) => Promise<any>;
|
|
88
|
+
|
|
83
89
|
/**
|
|
84
90
|
* Enable webhook
|
|
85
91
|
*/
|
|
@@ -96,6 +102,51 @@ export declare class CrdtElement {
|
|
|
96
102
|
*/
|
|
97
103
|
setWebhookDebounceTime: (time: number) => void;
|
|
98
104
|
|
|
105
|
+
/**
|
|
106
|
+
* Push a lib0-encoded message to the unified message stream.
|
|
107
|
+
* Uses Firebase push() for chronologically-ordered keys.
|
|
108
|
+
* Carries both sync (type 0) and awareness (type 1) messages.
|
|
109
|
+
* @param pushMessageQuery - contains id, data (encoded bytes), yjsClientId (Y.Doc client ID), optional messageType and eventData
|
|
110
|
+
*/
|
|
111
|
+
pushMessage: (pushMessageQuery: CrdtPushMessageQuery) => Promise<void>;
|
|
112
|
+
/**
|
|
113
|
+
* Subscribe to the unified message stream for real-time sync.
|
|
114
|
+
* Emits each new message individually as it arrives (streaming pattern).
|
|
115
|
+
* Returns an unsubscribe function.
|
|
116
|
+
* @param onMessageQuery - contains id, callback, and optional afterTs for filtering
|
|
117
|
+
*/
|
|
118
|
+
onMessage: (onMessageQuery: CrdtOnMessageQuery) => () => void;
|
|
119
|
+
/**
|
|
120
|
+
* Fetch all messages after a given timestamp (one-time read).
|
|
121
|
+
* Used for message replay during initial load (y-redis pattern).
|
|
122
|
+
* @param getMessagesQuery - contains id and optional afterTs
|
|
123
|
+
*/
|
|
124
|
+
getMessages: (getMessagesQuery: CrdtGetMessagesQuery) => Promise<CrdtMessageData[]>;
|
|
125
|
+
/**
|
|
126
|
+
* Get the latest full-state snapshot for a document.
|
|
127
|
+
* Used as the baseline for message replay during initial load.
|
|
128
|
+
* @param getSnapshotQuery - contains id
|
|
129
|
+
*/
|
|
130
|
+
getSnapshot: (getSnapshotQuery: CrdtGetSnapshotQuery) => Promise<CrdtSnapshotData | null>;
|
|
131
|
+
/**
|
|
132
|
+
* Save a full-state snapshot (state + vector) for fast initial load.
|
|
133
|
+
* Called periodically to create checkpoints, enabling message pruning.
|
|
134
|
+
* @param saveSnapshotQuery - contains id, state (Y.Doc update), and vector (state vector)
|
|
135
|
+
*/
|
|
136
|
+
saveSnapshot: (saveSnapshotQuery: CrdtSaveSnapshotQuery) => Promise<void>;
|
|
137
|
+
/**
|
|
138
|
+
* Remove messages older than the given timestamp from the message stream.
|
|
139
|
+
* Called after saving a snapshot to keep the message stream bounded.
|
|
140
|
+
* @param pruneMessagesQuery - contains id and beforeTs
|
|
141
|
+
*/
|
|
142
|
+
pruneMessages: (pruneMessagesQuery: CrdtPruneMessagesQuery) => Promise<void>;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* To set activity debounce time for batching CRDT edits (Default value is 10 minutes)
|
|
146
|
+
* @param time debounce time in milliseconds (minimum: 10 seconds)
|
|
147
|
+
*/
|
|
148
|
+
setActivityDebounceTime: (time: number) => void;
|
|
149
|
+
|
|
99
150
|
/**
|
|
100
151
|
* Subscribe to crdt actions
|
|
101
152
|
* @param action Action to subscribe to
|
|
@@ -188,6 +239,36 @@ export declare class CrdtElement {
|
|
|
188
239
|
*/
|
|
189
240
|
private _getVersions;
|
|
190
241
|
|
|
242
|
+
/**
|
|
243
|
+
* Push a message to the unified message stream
|
|
244
|
+
*/
|
|
245
|
+
private _pushMessage;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Subscribe to the unified message stream
|
|
249
|
+
*/
|
|
250
|
+
private _onMessage;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Fetch all messages after a given timestamp
|
|
254
|
+
*/
|
|
255
|
+
private _getMessages;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Get the latest snapshot for a document
|
|
259
|
+
*/
|
|
260
|
+
private _getSnapshot;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Save a full-state snapshot
|
|
264
|
+
*/
|
|
265
|
+
private _saveSnapshot;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Remove messages older than a given timestamp
|
|
269
|
+
*/
|
|
270
|
+
private _pruneMessages;
|
|
271
|
+
|
|
191
272
|
/**
|
|
192
273
|
* Enable webhook
|
|
193
274
|
*/
|
|
@@ -204,6 +285,12 @@ export declare class CrdtElement {
|
|
|
204
285
|
*/
|
|
205
286
|
private _setWebhookDebounceTime;
|
|
206
287
|
|
|
288
|
+
/**
|
|
289
|
+
* Set activity debounce time for batching CRDT edits
|
|
290
|
+
* @param time debounce time in milliseconds (minimum: 10 seconds)
|
|
291
|
+
*/
|
|
292
|
+
private _setActivityDebounceTime;
|
|
293
|
+
|
|
207
294
|
/**
|
|
208
295
|
* Subscribe to crdt actions
|
|
209
296
|
* @param action Action to subscribe to
|
package/app/utils/constants.d.ts
CHANGED
|
@@ -57,6 +57,8 @@ export declare class Constants {
|
|
|
57
57
|
static FIREBASE_PARTIAL_PATH_NOTIFICATIONS: string;
|
|
58
58
|
static FIREBASE_PARTIAL_PATH_ORGANIZATION_NOTIFICATIONS: string;
|
|
59
59
|
static FIREBASE_PARTIAL_PATH_LAST_NOTIFICATION_TIMESTAMP: string;
|
|
60
|
+
static FIREBASE_PARTIAL_PATH_ACTIVITIES: string;
|
|
61
|
+
static FIREBASE_PARTIAL_PATH_LAST_ACTIVITY_TIMESTAMP: string;
|
|
60
62
|
static FIREBASE_PARTIAL_PATH_HEARTBEAT: string;
|
|
61
63
|
static FIREBASE_PARTIAL_PATH_HEARTBEAT_BY_DOCUMENT: string;
|
|
62
64
|
static FIREBASE_PARTIAL_PATH_USERS: string;
|
|
@@ -244,7 +246,36 @@ export declare class Constants {
|
|
|
244
246
|
VELT_NOTIFICATIONS_HISTORY_PANEL: string;
|
|
245
247
|
VELT_WIREFRAME: string;
|
|
246
248
|
VELT_AUTOCOMPLETE: string;
|
|
249
|
+
VELT_AUTOCOMPLETE_PANEL: string;
|
|
250
|
+
VELT_AUTOCOMPLETE_OPTION: string;
|
|
251
|
+
VELT_AUTOCOMPLETE_OPTION_ICON: string;
|
|
252
|
+
VELT_AUTOCOMPLETE_OPTION_NAME: string;
|
|
253
|
+
VELT_AUTOCOMPLETE_OPTION_DESCRIPTION: string;
|
|
254
|
+
VELT_AUTOCOMPLETE_OPTION_ERROR_ICON: string;
|
|
255
|
+
VELT_AUTOCOMPLETE_GROUP_OPTION: string;
|
|
256
|
+
VELT_AUTOCOMPLETE_TOOL: string;
|
|
257
|
+
VELT_AUTOCOMPLETE_EMPTY: string;
|
|
247
258
|
VELT_AUTOCOMPLETE_CHIP: string;
|
|
259
|
+
VELT_AUTOCOMPLETE_CHIP_TOOLTIP: string;
|
|
260
|
+
VELT_AUTOCOMPLETE_CHIP_TOOLTIP_ICON: string;
|
|
261
|
+
VELT_AUTOCOMPLETE_CHIP_TOOLTIP_NAME: string;
|
|
262
|
+
VELT_AUTOCOMPLETE_CHIP_TOOLTIP_DESCRIPTION: string;
|
|
263
|
+
VELT_AUTOCOMPLETE_CONTEXT_WRAPPER: string;
|
|
264
|
+
VELT_COMMENT_DIALOG_VISIBILITY_BANNER: string;
|
|
265
|
+
VELT_COMMENT_DIALOG_VISIBILITY_BANNER_ICON: string;
|
|
266
|
+
VELT_COMMENT_DIALOG_VISIBILITY_BANNER_TEXT: string;
|
|
267
|
+
VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN: string;
|
|
268
|
+
VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_TRIGGER: string;
|
|
269
|
+
VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_TRIGGER_LABEL: string;
|
|
270
|
+
VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_TRIGGER_AVATAR_LIST: string;
|
|
271
|
+
VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_TRIGGER_AVATAR_LIST_ITEM: string;
|
|
272
|
+
VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_TRIGGER_AVATAR_LIST_REMAINING_COUNT: string;
|
|
273
|
+
VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_TRIGGER_ICON: string;
|
|
274
|
+
VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_CONTENT: string;
|
|
275
|
+
VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_CONTENT_ITEM: string;
|
|
276
|
+
VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_CONTENT_ITEM_ICON: string;
|
|
277
|
+
VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_CONTENT_ITEM_LABEL: string;
|
|
278
|
+
VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_CONTENT_USER_PICKER: string;
|
|
248
279
|
VELT_COMMENT_COMPOSER: string;
|
|
249
280
|
VELT_SKELETON_LOADER: string;
|
|
250
281
|
VELT_SHADOW_DOM_INTERNAL: string;
|
package/app/utils/enums.d.ts
CHANGED
|
@@ -60,10 +60,13 @@ export declare const CommentEventTypes: {
|
|
|
60
60
|
readonly COMMENT_PIN_CLICKED: "commentPinClicked";
|
|
61
61
|
readonly COMMENT_BUBBLE_CLICKED: "commentBubbleClicked";
|
|
62
62
|
readonly COMMENT_TOOL_CLICK: "commentToolClick";
|
|
63
|
+
readonly COMMENT_TOOL_CLICKED: "commentToolClicked";
|
|
63
64
|
readonly SIDEBAR_BUTTON_CLICK: "sidebarButtonClick";
|
|
65
|
+
readonly SIDEBAR_BUTTON_CLICKED: "sidebarButtonClicked";
|
|
64
66
|
readonly ATTACHMENT_DOWNLOAD_CLICKED: "attachmentDownloadClicked";
|
|
65
67
|
readonly COMMENT_SAVED: "commentSaved";
|
|
66
|
-
readonly
|
|
68
|
+
readonly COMMENT_SAVE_TRIGGERED: "commentSaveTriggered";
|
|
69
|
+
readonly VISIBILITY_OPTION_CLICKED: "visibilityOptionClicked";
|
|
67
70
|
};
|
|
68
71
|
export declare const RecorderEventTypes: {
|
|
69
72
|
readonly TRANSCRIPTION_DONE: "transcriptionDone";
|
|
@@ -169,7 +172,8 @@ export declare enum Features {
|
|
|
169
172
|
REWRITER = "rewriter",
|
|
170
173
|
LIVE_SELECTION = "liveSelection",
|
|
171
174
|
NOTIFICATION = "notification",
|
|
172
|
-
REACTION = "reaction"
|
|
175
|
+
REACTION = "reaction",
|
|
176
|
+
ACTIVITY = "activity"
|
|
173
177
|
}
|
|
174
178
|
export declare enum AnalyticsFeatures {
|
|
175
179
|
AREA = "area",
|
|
@@ -191,7 +195,7 @@ export declare enum AnalyticsFeatures {
|
|
|
191
195
|
INLINE_COMMENT = "inlineComment",
|
|
192
196
|
COMMENT_SIDEBAR = "commentSidebar"
|
|
193
197
|
}
|
|
194
|
-
export type FeatureType = 'area' | 'arrow' | 'audioHuddle' | 'comment' | 'cursor' | 'huddle' | 'liveStateSync' | 'presence' | 'recorder' | 'rewriter' | 'tag' | 'liveSelection' | 'notification' | 'reaction' | 'multiThread';
|
|
198
|
+
export type FeatureType = 'area' | 'arrow' | 'audioHuddle' | 'comment' | 'cursor' | 'huddle' | 'liveStateSync' | 'presence' | 'recorder' | 'rewriter' | 'tag' | 'liveSelection' | 'notification' | 'reaction' | 'multiThread' | 'activity';
|
|
195
199
|
export type AssignToType = 'dropdown' | 'checkbox';
|
|
196
200
|
export declare enum DeviceType {
|
|
197
201
|
DESKTOP = "Desktop",
|
|
@@ -310,3 +314,13 @@ export type NotificationSettingsItemType = 'ALL' | 'MINE' | 'NONE' | string;
|
|
|
310
314
|
* Type for notification settings layout
|
|
311
315
|
*/
|
|
312
316
|
export type NotificationSettingsLayout = 'accordion' | 'dropdown';
|
|
317
|
+
/**
|
|
318
|
+
* Enum for comment visibility options in the visibility banner dropdown
|
|
319
|
+
*/
|
|
320
|
+
export declare enum CommentVisibilityOption {
|
|
321
|
+
RESTRICTED_SELF = "restrictedSelf",
|
|
322
|
+
RESTRICTED_SELECTED_PEOPLE = "restrictedSelectedPeople",
|
|
323
|
+
ORGANIZATION_PRIVATE = "organizationPrivate",
|
|
324
|
+
PUBLIC = "public"
|
|
325
|
+
}
|
|
326
|
+
export type CommentVisibilityOptionType = `${CommentVisibilityOption}`;
|
package/models.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './app/utils/enums';
|
|
2
2
|
export * from './app/models/data/anchor-record.data.model';
|
|
3
3
|
export * from './app/models/data/attachment.model';
|
|
4
|
+
export * from './app/models/data/activity.data.model';
|
|
4
5
|
export * from './app/models/data/area-annotation.data.model';
|
|
5
6
|
export * from './app/models/data/arrow-annotation.data.model';
|
|
6
7
|
export * from './app/models/data/base-metadata.data.model';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veltdev/sdk-staging",
|
|
3
|
-
"version": "5.0.2-beta.
|
|
3
|
+
"version": "5.0.2-beta.21",
|
|
4
4
|
"description": "Velt is an SDK to add collaborative features to your product within minutes. Example: Comments like Figma, Frame.io, Google docs or sheets, Recording like Loom, Huddles like Slack and much more.",
|
|
5
5
|
"homepage": "https://velt.dev",
|
|
6
6
|
"keywords": [
|
package/types.d.ts
CHANGED
|
@@ -17,4 +17,5 @@ export * from './app/models/element/notification-element.model';
|
|
|
17
17
|
export * from './app/models/element/autocomplete-element.model';
|
|
18
18
|
export * from './app/models/element/reaction-element.model';
|
|
19
19
|
export * from './app/models/element/crdt-element.model';
|
|
20
|
+
export * from './app/models/element/activity-element.model';
|
|
20
21
|
export * from './models';
|