@veltdev/sdk 4.6.8 → 4.6.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.
@@ -190,6 +190,7 @@ export declare class CommentAnnotation {
190
190
  views?: CommentAnnotationViews;
191
191
  viewedByUserIds?: string[];
192
192
  viewedBy?: User[];
193
+ unread?: boolean;
193
194
  }
194
195
  export declare class GhostComment {
195
196
  targetElement?: TargetElement | null;
@@ -0,0 +1,25 @@
1
+ import { CrdtEventTypes } from "../../utils/enums";
2
+ export type CrdtEventTypesMap = {
3
+ [CrdtEventTypes.UPDATE_DATA]: CrdtUpdateDataEvent;
4
+ };
5
+ export declare enum CrdtSource {
6
+ INTERNAL = "internal",
7
+ EXTERNAL = "external"
8
+ }
9
+ export declare enum CrdtMethodName {
10
+ UPDATE_DATA = "updateData"
11
+ }
12
+ export type CrdtUpdateDataEvent = {
13
+ methodName: string;
14
+ uniqueId: string;
15
+ timestamp: number;
16
+ source: string;
17
+ payload: CrdtUpdateDataPayload;
18
+ };
19
+ export type CrdtUpdateDataPayload = {
20
+ id: string;
21
+ data: unknown;
22
+ lastUpdatedBy: string;
23
+ sessionId?: string | null;
24
+ lastUpdate: string;
25
+ };
@@ -10,6 +10,7 @@ export interface CrdtVersionWithEncryptedState extends Omit<CrdtVersion, 'state'
10
10
  export interface CrdtUpdateDataQuery {
11
11
  id: string;
12
12
  state: Uint8Array | number[];
13
+ data?: unknown;
13
14
  }
14
15
  export interface CrdtOnDataChangeQuery {
15
16
  id: string;
@@ -1,4 +1,4 @@
1
- import { AreaStatus, ArrowStatus, CommentStatus, HuddleActionTypes, NotificationSettingsItemType, NotificationSource, TagStatus, UserActionTypes } from "../../utils/enums";
1
+ import { AreaStatus, ArrowStatus, CommentStatus, CrdtActionTypes, HuddleActionTypes, NotificationSettingsItemType, NotificationSource, TagStatus, UserActionTypes } from "../../utils/enums";
2
2
  import { DocumentMetadata } from "./document-metadata.model";
3
3
  import { DocumentUser } from "./document-user.data.model";
4
4
  import { Location } from "./location.model";
@@ -23,7 +23,7 @@ export declare class NotificationRawData {
23
23
  /**
24
24
  * Type of notification like 'Added', 'Updated' etc.
25
25
  */
26
- actionType?: AreaStatus | ArrowStatus | CommentStatus | TagStatus | UserActionTypes | HuddleActionTypes;
26
+ actionType?: AreaStatus | ArrowStatus | CommentStatus | TagStatus | UserActionTypes | HuddleActionTypes | CrdtActionTypes;
27
27
  /**
28
28
  * Annotation object
29
29
  */
@@ -97,6 +97,7 @@ export declare class NotificationRawData {
97
97
  notifyUsers?: {
98
98
  [email: string]: boolean;
99
99
  };
100
+ crdtData?: unknown;
100
101
  notificationSourceData?: any;
101
102
  }
102
103
  export declare class Notification {
@@ -1,5 +1,6 @@
1
1
  // @ts-nocheck
2
2
  import { CrdtGetDataQuery, CrdtGetVersionQuery, CrdtOnDataChangeQuery, CrdtOnPresenceChangeQuery, CrdtOnRegisteredUserChangeQuery, CrdtOnStateChangeQuery, CrdtRegisterSyncUserQuery, CrdtSetPresenceQuery, CrdtSaveVersionQuery, CrdtUpdateDataQuery, CrdtUpdateStateQuery } from "../data/crdt.data.model";
3
+ import { CrdtEventTypesMap } from "../data/crdt-events.data.model";
3
4
 
4
5
  export declare class CrdtElement {
5
6
  /**
@@ -79,6 +80,29 @@ export declare class CrdtElement {
79
80
  */
80
81
  getVersion: (getVersionQuery: CrdtGetVersionQuery) => Promise<any>;
81
82
 
83
+ /**
84
+ * Enable webhook
85
+ */
86
+ enableWebhook: () => void;
87
+
88
+ /**
89
+ * Disable webhook
90
+ */
91
+ disableWebhook: () => void;
92
+
93
+ /**
94
+ * Set webhook debounce time
95
+ * @param time debounce time in milliseconds
96
+ */
97
+ setWebhookDebounceTime: (time: number) => void;
98
+
99
+ /**
100
+ * Subscribe to crdt actions
101
+ * @param action Action to subscribe to
102
+ * @returns Observable of the action
103
+ */
104
+ on: <T extends keyof CrdtEventTypesMap>(action: T) => Observable<CrdtEventTypesMap[T]>;
105
+
82
106
  constructor();
83
107
 
84
108
  /**
@@ -163,4 +187,27 @@ export declare class CrdtElement {
163
187
  * @param id Document ID
164
188
  */
165
189
  private _getVersions;
190
+
191
+ /**
192
+ * Enable webhook
193
+ */
194
+ private _enableWebhook;
195
+
196
+ /**
197
+ * Disable webhook
198
+ */
199
+ private _disableWebhook;
200
+
201
+ /**
202
+ * Set webhook debounce time
203
+ * @param time debounce time in milliseconds
204
+ */
205
+ private _setWebhookDebounceTime;
206
+
207
+ /**
208
+ * Subscribe to crdt actions
209
+ * @param action Action to subscribe to
210
+ * @returns Observable of the action
211
+ */
212
+ private _on;
166
213
  }
@@ -99,12 +99,16 @@ export declare const PresenceEventTypes: {
99
99
  export declare const NotificationEventTypes: {
100
100
  readonly SETTINGS_UPDATED: "settingsUpdated";
101
101
  };
102
+ export declare const CrdtEventTypes: {
103
+ readonly UPDATE_DATA: "updateData";
104
+ };
102
105
  export type CommentEventType = typeof CommentEventTypes[keyof typeof CommentEventTypes];
103
106
  export type RecorderEventType = typeof RecorderEventTypes[keyof typeof RecorderEventTypes];
104
107
  export type CoreEventType = typeof CoreEventTypes[keyof typeof CoreEventTypes];
105
108
  export type LiveStateSyncEventType = typeof LiveStateSyncEventTypes[keyof typeof LiveStateSyncEventTypes];
106
109
  export type PresenceEventType = typeof PresenceEventTypes[keyof typeof PresenceEventTypes];
107
110
  export type NotificationEventType = typeof NotificationEventTypes[keyof typeof NotificationEventTypes];
111
+ export type CrdtEventType = typeof CrdtEventTypes[keyof typeof CrdtEventTypes];
108
112
  export declare enum TagStatus {
109
113
  ADDED = "added",
110
114
  UPDATED = "updated",
@@ -120,6 +124,9 @@ export declare enum HuddleActionTypes {
120
124
  CREATED = "created",
121
125
  JOINED = "joined"
122
126
  }
127
+ export declare enum CrdtActionTypes {
128
+ UPDATE_DATA = "updateData"
129
+ }
123
130
  export declare enum RecorderStatus {
124
131
  ADDED = "added",
125
132
  UPDATED = "updated",
@@ -252,7 +259,7 @@ export type RecorderStatusType = 'started' | 'paused' | 'resumed' | 'stopped' |
252
259
  export type HuddleType = 'audio' | 'video' | 'presentation';
253
260
  export type NotificationTabId = 'for-you' | 'all' | 'document' | 'people';
254
261
  export type NotificationTabType = 'forYou' | 'all' | 'documents' | 'people';
255
- export type NotificationSource = 'area' | 'arrow' | 'comment' | 'tag' | 'huddle' | 'userInvite' | 'user' | 'recorder' | 'huddleInvite' | 'userFeedback' | 'userContactUs' | 'userReportBug' | 'documentViews' | 'custom';
262
+ export type NotificationSource = 'area' | 'arrow' | 'comment' | 'tag' | 'huddle' | 'userInvite' | 'user' | 'recorder' | 'huddleInvite' | 'userFeedback' | 'userContactUs' | 'userReportBug' | 'documentViews' | 'crdt' | 'custom';
256
263
  export type SingleEditorStatus = 'pending' | 'accepted' | 'rejected' | 'cancelled';
257
264
  export type SingleEditorState = 'idle' | 'inProgress' | 'completed';
258
265
  export type AudioWaveformVariant = 'expanded' | 'minified' | 'player' | 'preview' | 'preview-mini' | 'editor';
@@ -273,7 +280,7 @@ export type RecorderVariant = 'default' | 'embed';
273
280
  export type ReactionPinType = 'timeline' | 'comment';
274
281
  export type SidebarPosition = 'left' | 'right';
275
282
  export type SidebarSortingCriteria = 'date' | 'unread' | null;
276
- export type SidebarFilterCriteria = 'all' | 'read' | 'unread' | 'resolved' | null;
283
+ export type SidebarFilterCriteria = 'all' | 'read' | 'unread' | 'resolved' | 'open' | 'reset' | null;
277
284
  export type SidebarFilterSearchType = 'people' | 'assigned' | 'tagged' | 'involved' | 'pages' | 'documents' | 'statuses' | 'priorities' | 'categories' | 'versions' | string;
278
285
  export type InlineSortingCriteria = 'createdFirst' | 'createdLast' | 'updatedFirst' | 'updatedLast';
279
286
  export type NotificationPanelMode = 'popover' | 'sidebar';
package/models.d.ts CHANGED
@@ -81,4 +81,5 @@ export * from './app/models/data/user-resolver.data.model';
81
81
  export * from './app/models/data/provider.data.model';
82
82
  export * from './app/models/data/resolver.data.model';
83
83
  export * from './app/models/data/crdt.data.model';
84
+ export * from './app/models/data/crdt-events.data.model';
84
85
  export * from './app/models/data/encryption-provider.data.model';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veltdev/sdk",
3
- "version": "4.6.8",
3
+ "version": "4.6.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": [