@veltdev/sdk-staging 4.5.5 → 4.5.6-beta.10

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.
@@ -41,6 +41,14 @@ export declare class DocumentPaths {
41
41
  * Huddle path.
42
42
  */
43
43
  audioHuddle?: string;
44
+ /**
45
+ * Heartbeat path.
46
+ */
47
+ heartbeat?: string;
48
+ /**
49
+ * Heartbeat by document path.
50
+ */
51
+ heartbeatByDocument?: string;
44
52
  /**
45
53
  * Document Id provided by the user.
46
54
  */
@@ -0,0 +1,10 @@
1
+ import { BaseMetadata } from "./base-metadata.data.model";
2
+ export interface Heartbeat {
3
+ id: string;
4
+ createdTimestamp: number;
5
+ userId: string;
6
+ veltUserId: string;
7
+ tabId: string;
8
+ metadata: BaseMetadata;
9
+ lastUpdatedTimestamp: number;
10
+ }
@@ -11,11 +11,12 @@ export declare class LiveStateDataMap {
11
11
  */
12
12
  default?: {
13
13
  singleEditor?: SingleEditorLiveStateData;
14
- autoSyncState?: {
15
- current?: LiveStateData;
16
- history?: {
17
- [liveStateDataId: string]: LiveStateData;
18
- };
19
- };
14
+ autoSyncState?: LiveStateAutoSyncState;
15
+ };
16
+ }
17
+ export declare class LiveStateAutoSyncState {
18
+ current?: LiveStateData;
19
+ history?: {
20
+ [liveStateDataId: string]: LiveStateData;
20
21
  };
21
22
  }
@@ -90,3 +90,9 @@ export interface LiveStateSingleEditorExternalUserPresence {
90
90
  */
91
91
  userIds?: string[];
92
92
  }
93
+ export interface FetchLiveStateDataRequest {
94
+ /**
95
+ * Unique identifier to identify the state data you are syncing.
96
+ */
97
+ liveStateDataId?: string;
98
+ }
@@ -1,6 +1,6 @@
1
1
  // @ts-nocheck
2
2
  import { ServerConnectionState } from '../../utils/enums';
3
- import { EditorAccessTimer, LiveStateDataConfig, LiveStateSingleEditorExternalUserPresence, SetLiveStateDataConfig, SetUserAsEditorResponse, SingleEditorConfig, UserEditorAccess } from '../data/live-state-data.data.model';
3
+ import { EditorAccessTimer, FetchLiveStateDataRequest, LiveStateDataConfig, LiveStateSingleEditorExternalUserPresence, SetLiveStateDataConfig, SetUserAsEditorResponse, SingleEditorConfig, UserEditorAccess } from '../data/live-state-data.data.model';
4
4
  import { LiveStateEventTypesMap } from '../data/live-state-events.data.model';
5
5
  import { User } from '../data/user.data.model';
6
6
 
@@ -20,6 +20,11 @@ export declare class LiveStateSyncElement {
20
20
  */
21
21
  getLiveStateData$: <T = unknown>(liveStateDataId?: string, liveStateDataConfig?: LiveStateDataConfig) => Observable<T>;
22
22
 
23
+ /**
24
+ * Fetches live state data.
25
+ */
26
+ fetchLiveStateData: <T = unknown>(request?: FetchLiveStateDataRequest) => Promise<T>;
27
+
23
28
  /**
24
29
  * Sets live state data for the provided ID and data.
25
30
  */
@@ -147,6 +152,16 @@ export declare class LiveStateSyncElement {
147
152
  */
148
153
  updateUserPresence: (userPresence: LiveStateSingleEditorExternalUserPresence) => void;
149
154
 
155
+ /**
156
+ * To enable heartbeat
157
+ */
158
+ enableHeartbeat: () => void;
159
+
160
+ /**
161
+ * To disable heartbeat
162
+ */
163
+ disableHeartbeat: () => void;
164
+
150
165
  /**
151
166
  * Subscribe to live state events
152
167
  */
@@ -168,6 +183,11 @@ export declare class LiveStateSyncElement {
168
183
  */
169
184
  private _getLiveStateData$;
170
185
 
186
+ /**
187
+ * Private method for fetching live state data.
188
+ */
189
+ private _fetchLiveStateData;
190
+
171
191
  /**
172
192
  * Private method for setting live state data.
173
193
  */
@@ -295,6 +315,16 @@ export declare class LiveStateSyncElement {
295
315
  */
296
316
  private _updateUserPresence;
297
317
 
318
+ /**
319
+ * To enable heartbeat
320
+ */
321
+ private _enableHeartbeat;
322
+
323
+ /**
324
+ * To disable heartbeat
325
+ */
326
+ private _disableHeartbeat;
327
+
298
328
  /**
299
329
  * Subscribe to live state events
300
330
  */
@@ -54,6 +54,8 @@ export declare class Constants {
54
54
  static FIREBASE_PARTIAL_PATH_NOTIFICATIONS: string;
55
55
  static FIREBASE_PARTIAL_PATH_ORGANIZATION_NOTIFICATIONS: string;
56
56
  static FIREBASE_PARTIAL_PATH_LAST_NOTIFICATION_TIMESTAMP: string;
57
+ static FIREBASE_PARTIAL_PATH_HEARTBEAT: string;
58
+ static FIREBASE_PARTIAL_PATH_HEARTBEAT_BY_DOCUMENT: string;
57
59
  static FIREBASE_PARTIAL_PATH_USERS: string;
58
60
  static FIREBASE_PARTIAL_PATH_PERMISSIONS_USERS: string;
59
61
  static FIREBASE_PARTIAL_PATH_USER_REQUESTS: string;
package/models.d.ts CHANGED
@@ -25,6 +25,7 @@ export * from './app/models/data/document-iam.data.model';
25
25
  export * from './app/models/data/document-metadata.model';
26
26
  export * from './app/models/data/document-paths.data.model';
27
27
  export * from './app/models/data/document-user.data.model';
28
+ export * from './app/models/data/heartbeat.data.model';
28
29
  export * from './app/models/data/huddle.model';
29
30
  export * from './app/models/data/live-state-data-map.data.model';
30
31
  export * from './app/models/data/live-state-data.data.model';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veltdev/sdk-staging",
3
- "version": "4.5.5",
3
+ "version": "4.5.6-beta.10",
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": [