@veltdev/types-dev 4.5.0-beta.99 → 4.5.2-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.
Files changed (31) hide show
  1. package/app/client/snippyly.model.d.ts +23 -2
  2. package/app/models/data/autocomplete.data.model.d.ts +6 -0
  3. package/app/models/data/comment-actions.data.model.d.ts +7 -0
  4. package/app/models/data/comment-annotation.data.model.d.ts +3 -0
  5. package/app/models/data/comment-events.data.model.d.ts +5 -0
  6. package/app/models/data/comment-resolver.data.model.d.ts +19 -0
  7. package/app/models/data/comment-sidebar-config.model.d.ts +6 -0
  8. package/app/models/data/comment.data.model.d.ts +1 -0
  9. package/app/models/data/core-events.data.model.d.ts +2 -0
  10. package/app/models/data/crdt.data.model.d.ts +59 -0
  11. package/app/models/data/document-paths.data.model.d.ts +5 -0
  12. package/app/models/data/encryption-provider.data.model.d.ts +12 -0
  13. package/app/models/data/live-state-data.data.model.d.ts +18 -0
  14. package/app/models/data/media-preview-config.data.model.d.ts +2 -0
  15. package/app/models/data/notification.model.d.ts +3 -0
  16. package/app/models/data/reaction-resolver.data.model.d.ts +4 -2
  17. package/app/models/data/recorder-events.data.model.d.ts +19 -0
  18. package/app/models/data/recorder.model.d.ts +4 -0
  19. package/app/models/data/resolver.data.model.d.ts +1 -0
  20. package/app/models/data/user-iam.data.model.d.ts +6 -0
  21. package/app/models/data/user.data.model.d.ts +10 -0
  22. package/app/models/element/comment-element.model.d.ts +83 -13
  23. package/app/models/element/crdt-element.model.d.ts +166 -0
  24. package/app/models/element/live-state-sync-element.model.d.ts +13 -3
  25. package/app/models/element/notification-element.model.d.ts +43 -3
  26. package/app/models/element/recorder-element.model.d.ts +239 -169
  27. package/app/utils/constants.d.ts +45 -1
  28. package/app/utils/enums.d.ts +10 -2
  29. package/models.d.ts +2 -0
  30. package/package.json +1 -1
  31. package/types.d.ts +1 -0
@@ -3,7 +3,7 @@ import { Observable } from "rxjs";
3
3
  import { Config, DisableLogsConfig } from "../models/data/config.data.model";
4
4
  import { DocumentUser } from "../models/data/document-user.data.model";
5
5
  import { Location } from "../models/data/location.model";
6
- import { User, UserOptions } from "../models/data/user.data.model";
6
+ import { User, UserOptions, VeltAuthProvider } from "../models/data/user.data.model";
7
7
  import { CustomCss } from "../models/data/custom-css.data.model";
8
8
  import { AreaElement } from "../models/element/area-element.model";
9
9
  import { ArrowElement } from "../models/element/arrow-element.model";
@@ -24,12 +24,14 @@ import { FeatureType } from "../utils/enums";
24
24
  import { UserContact } from "../models/data/user-contact.data.model";
25
25
  import { DocumentMetadata } from "../models/data/document-metadata.model";
26
26
  import { ReactionElement } from "../models/element/reaction-element.model";
27
+ import { CrdtElement } from "../models/element/crdt-element.model";
27
28
  import { VeltEventMetadata } from "../models/data/event-metadata.data.model";
28
29
  import { CoreEventTypesMap } from "../models/data/core-events.data.model";
29
30
  import { Document, SetDocumentsRequestOptions, FetchDocumentsRequest, FetchFoldersRequest, UpdateDocumentsRequest, UpdateLocationsRequest } from "../models/data/document.data.model";
30
31
  import { FetchDocumentsResponse, FetchFoldersResponse } from "../models/data/document-events.data.model";
31
32
  import { UserDataProvider } from "../models/data/user-resolver.data.model";
32
33
  import { VeltDataProvider } from "../models/data/provider.data.model";
34
+ import { VeltEncryptionProvider } from "../models/data/encryption-provider.data.model";
33
35
  import { VeltResetButtonStateConfig } from "../models/data/button.data.model";
34
36
  import { SetLocationsRequestOptions } from "../models/data/location.model";
35
37
 
@@ -37,6 +39,7 @@ export declare class Snippyly {
37
39
  constructor();
38
40
  initConfig: (apiKey: string, config?: Config) => void;
39
41
  identify: (user: User, userOptions?: UserOptions) => Promise<unknown>;
42
+ setVeltAuthProvider: (veltAuthProvider: VeltAuthProvider) => Promise<User | null>;
40
43
  /**
41
44
  * Tell us who the currently logged in user is.
42
45
  *
@@ -97,6 +100,10 @@ export declare class Snippyly {
97
100
  * To set the data provider.
98
101
  */
99
102
  setDataProviders: (dataProvider: VeltDataProvider) => void;
103
+ /**
104
+ * To set the encryption provider.
105
+ */
106
+ setEncryptionProvider: (encryptionProvider: VeltEncryptionProvider) => void;
100
107
  /**
101
108
  * Get Document ID
102
109
  */
@@ -225,6 +232,10 @@ export declare class Snippyly {
225
232
  * Get the Area Object.
226
233
  */
227
234
  getReactionElement: () => ReactionElement;
235
+ /**
236
+ * Get the CRDT Element Object.
237
+ */
238
+ getCrdtElement: () => CrdtElement;
228
239
  /**
229
240
  * Get the metadata of the current resource.
230
241
  */
@@ -345,8 +356,18 @@ export declare class Snippyly {
345
356
  */
346
357
  disableLogs: (config?: DisableLogsConfig) => void;
347
358
 
359
+ /**
360
+ * To enable safe eval.
361
+ */
362
+ enableSafeEval: () => void;
363
+
364
+ /**
365
+ * To disable safe eval.
366
+ */
367
+ disableSafeEval: () => void;
368
+
348
369
  /**
349
370
  * To reset the button toggle map.
350
371
  */
351
372
  resetVeltButtonState: (config?: VeltResetButtonStateConfig) => void;
352
- }
373
+ }
@@ -8,6 +8,7 @@ export declare class AutocompleteData {
8
8
  description?: string;
9
9
  type: 'custom' | 'contact' | 'group';
10
10
  data: AutocompleteItem[];
11
+ groups?: AutocompleteGroup[];
11
12
  }
12
13
  export declare class AutocompleteItem {
13
14
  id: string;
@@ -18,6 +19,7 @@ export declare class AutocompleteItem {
18
19
  svg?: string;
19
20
  };
20
21
  link?: string;
22
+ groupId?: string;
21
23
  }
22
24
  export declare class AutocompleteReplaceData {
23
25
  text: string;
@@ -34,6 +36,10 @@ export declare class AutocompleteUserContactReplaceData {
34
36
  userId: string;
35
37
  contact?: UserContact;
36
38
  }
39
+ export declare class AutocompleteGroup {
40
+ id: string;
41
+ name: string;
42
+ }
37
43
  export declare class AutocompleteChipData extends AutocompleteItem {
38
44
  type: 'contact' | 'custom';
39
45
  }
@@ -45,6 +45,10 @@ export interface AddCommentAnnotationRequest {
45
45
  annotation: CommentAnnotation;
46
46
  options?: RequestOptions;
47
47
  }
48
+ export interface PublishCommentAnnotationRequest {
49
+ annotationId: string;
50
+ options?: RequestOptions;
51
+ }
48
52
  export interface ApproveCommentAnnotationRequest {
49
53
  annotationId: string;
50
54
  options?: RequestOptions;
@@ -62,12 +66,15 @@ export interface DeleteCommentAnnotationRequest {
62
66
  options?: RequestOptions;
63
67
  }
64
68
  export interface CommentRequestQuery {
69
+ organizationId?: string;
65
70
  documentIds?: string[];
66
71
  locationIds?: string[];
67
72
  statusIds?: string[];
68
73
  folderId?: string;
69
74
  allDocuments?: boolean;
70
75
  locationId?: string;
76
+ aggregateDocuments?: boolean;
77
+ filterGhostComments?: boolean;
71
78
  }
72
79
  export interface SubscribeCommentAnnotationRequest {
73
80
  annotationId: string;
@@ -9,6 +9,7 @@ import { PageInfo } from "./page-info.model";
9
9
  import { TargetElement } from "./target-element.data.model";
10
10
  import { TargetTextRange } from "./target-text-range.data.model";
11
11
  import { User } from "./user.data.model";
12
+ import { CommentAnnotationViews } from "./views.data.model";
12
13
  export declare class CommentAnnotation {
13
14
  /**
14
15
  * Unique identifier for the comment pin annotation.
@@ -180,6 +181,8 @@ export declare class CommentAnnotation {
180
181
  multiThreadAnnotationId?: string;
181
182
  isDraft?: boolean;
182
183
  sourceId?: string;
184
+ views?: CommentAnnotationViews;
185
+ viewedByUserIds?: string[];
183
186
  }
184
187
  export declare class GhostComment {
185
188
  targetElement?: TargetElement | null;
@@ -102,6 +102,11 @@ export interface AddCommentAnnotationEvent {
102
102
  xpath: string;
103
103
  };
104
104
  }
105
+ export interface PublishCommentAnnotationEvent {
106
+ annotationId: string;
107
+ commentAnnotation: CommentAnnotation;
108
+ metadata: VeltEventMetadata;
109
+ }
105
110
  export interface ApproveCommentAnnotationEvent {
106
111
  annotationId: string;
107
112
  commentAnnotation: CommentAnnotation;
@@ -29,6 +29,14 @@ export interface SaveCommentResolverRequest {
29
29
  metadata?: BaseMetadata;
30
30
  commentId?: string;
31
31
  }
32
+ export interface PartialUser {
33
+ userId: string;
34
+ }
35
+ export interface PartialTaggedUserContacts {
36
+ userId: string;
37
+ contact?: PartialUser;
38
+ text?: string;
39
+ }
32
40
  export interface PartialComment {
33
41
  commentId: string | number;
34
42
  commentHtml?: string;
@@ -36,6 +44,9 @@ export interface PartialComment {
36
44
  attachments?: {
37
45
  [attachmentId: number]: PartialAttachment;
38
46
  };
47
+ from?: PartialUser;
48
+ to?: PartialUser[];
49
+ taggedUserContacts?: PartialTaggedUserContacts[];
39
50
  }
40
51
  export interface PartialCommentAnnotationResult {
41
52
  strippedData: {
@@ -44,10 +55,18 @@ export interface PartialCommentAnnotationResult {
44
55
  originalData: CommentAnnotation | null;
45
56
  eventType?: ResolverActions;
46
57
  }
58
+ export interface PartialTargetTextRange {
59
+ text: string;
60
+ }
47
61
  export interface PartialCommentAnnotation {
48
62
  annotationId: string;
49
63
  metadata?: BaseMetadata;
50
64
  comments: {
51
65
  [commentId: string]: PartialComment;
52
66
  };
67
+ from?: PartialUser;
68
+ assignedTo?: PartialUser;
69
+ targetTextRange?: PartialTargetTextRange;
70
+ resolvedByUserId?: string | null;
71
+ [key: string]: any;
53
72
  }
@@ -23,6 +23,7 @@ export declare class CommentSidebarFilterConfig {
23
23
  people?: FilterTypeConfig;
24
24
  assigned?: FilterTypeConfig;
25
25
  tagged?: FilterTypeConfig;
26
+ involved?: FilterTypeConfig;
26
27
  priority?: FilterTypeConfig;
27
28
  status?: FilterTypeConfig;
28
29
  category?: FilterTypeConfig;
@@ -55,6 +56,11 @@ export declare class CommentSidebarFilters {
55
56
  email?: string;
56
57
  name?: string;
57
58
  }[];
59
+ involved?: {
60
+ userId?: string;
61
+ email?: string;
62
+ name?: string;
63
+ }[];
58
64
  priority?: string[];
59
65
  status?: string[];
60
66
  category?: string[];
@@ -9,6 +9,7 @@ export declare class Comment {
9
9
  * Auto generated.
10
10
  */
11
11
  commentId: number;
12
+ context?: any;
12
13
  /**
13
14
  * This determines the comment content type.
14
15
  *
@@ -11,8 +11,10 @@ export type CoreEventTypesMap = {
11
11
  export type UserUpdateEvent = User | null;
12
12
  export type DocumentInitEvent = boolean | undefined;
13
13
  export type ErrorEvent = {
14
+ error?: string;
14
15
  code: string;
15
16
  message?: string;
17
+ source?: string;
16
18
  };
17
19
  export type InitUpdateEvent = {
18
20
  event: string;
@@ -0,0 +1,59 @@
1
+ export interface CrdtVersion {
2
+ versionId: string;
3
+ versionName?: string;
4
+ state: Uint8Array | number[];
5
+ timestamp: number;
6
+ }
7
+ export interface CrdtVersionWithEncryptedState extends Omit<CrdtVersion, 'state'> {
8
+ encryptedState: string;
9
+ }
10
+ export interface CrdtUpdateDataQuery {
11
+ id: string;
12
+ state: Uint8Array | number[];
13
+ }
14
+ export interface CrdtOnDataChangeQuery {
15
+ id: string;
16
+ callback: (data: any) => void;
17
+ }
18
+ export interface CrdtGetDataQuery {
19
+ id: string;
20
+ }
21
+ export interface CrdtOnStateChangeQuery {
22
+ id: string;
23
+ callback: (data: any) => void;
24
+ }
25
+ export interface CrdtUpdateStateQuery {
26
+ id: string;
27
+ state: Uint8Array | number[];
28
+ }
29
+ export interface CrdtRegisterSyncUserQuery {
30
+ id: string;
31
+ }
32
+ export interface CrdtOnRegisteredUserChangeQuery {
33
+ id: string;
34
+ callback: (data: any) => void;
35
+ }
36
+ export interface CrdtSetPresenceQuery {
37
+ id: string;
38
+ }
39
+ export interface CrdtOnPresenceChangeQuery {
40
+ id: string;
41
+ callback: (data: any) => void;
42
+ }
43
+ export interface CrdtSaveVersionQuery {
44
+ id: string;
45
+ versionId: string;
46
+ versionName?: string;
47
+ state: Uint8Array | number[];
48
+ }
49
+ export interface CrdtGetVersionQuery {
50
+ id: string;
51
+ versionId: string;
52
+ }
53
+ export interface CrdtGetVersionsQuery {
54
+ id: string;
55
+ }
56
+ export interface CrdtDeleteVersionQuery {
57
+ id: string;
58
+ versionId: string;
59
+ }
@@ -7,6 +7,7 @@ export declare class DocumentPaths {
7
7
  locationId?: string;
8
8
  allDocuments?: boolean;
9
9
  veltFolderId?: string;
10
+ folder?: string;
10
11
  /**
11
12
  * Presence path.
12
13
  */
@@ -72,6 +73,10 @@ export declare class DocumentPaths {
72
73
  * User login path.
73
74
  */
74
75
  logins?: string;
76
+ /**
77
+ * CRDT path.
78
+ */
79
+ crdt?: string;
75
80
  /**
76
81
  * Selection path.
77
82
  */
@@ -0,0 +1,12 @@
1
+ export interface EncryptConfig<T = any> {
2
+ data: T;
3
+ type?: string;
4
+ }
5
+ export interface DecryptConfig<R = any> {
6
+ data: R;
7
+ type?: string;
8
+ }
9
+ export interface VeltEncryptionProvider<T = any, R = any> {
10
+ encrypt: (config: EncryptConfig<T>) => Promise<R>;
11
+ decrypt: (config: DecryptConfig<R>) => Promise<T>;
12
+ }
@@ -1,4 +1,5 @@
1
1
  import { SingleEditorState, SingleEditorStatus } from "../../utils/enums";
2
+ import { ErrorEvent } from "./core-events.data.model";
2
3
  import { User } from "./user.data.model";
3
4
  export declare class LiveStateData {
4
5
  /**
@@ -72,3 +73,20 @@ export declare class EditorAccessTimer {
72
73
  export declare class LiveStateDataConfig {
73
74
  listenToNewChangesOnly?: boolean;
74
75
  }
76
+ export interface SetUserAsEditorResponse {
77
+ error?: ErrorEvent;
78
+ }
79
+ export interface LiveStateSingleEditorExternalUserPresence {
80
+ /**
81
+ * True if the same user is present on different tab.
82
+ */
83
+ sameUserPresentOnTab?: boolean;
84
+ /**
85
+ * True if the different user is present on different tab.
86
+ */
87
+ differentUserPresentOnTab?: boolean;
88
+ /**
89
+ * User ids of the users present on different tab.
90
+ */
91
+ userIds?: string[];
92
+ }
@@ -2,11 +2,13 @@ export declare class MediaPreviewConfig {
2
2
  audio?: {
3
3
  enabled?: boolean;
4
4
  deviceId?: string;
5
+ stream?: MediaStream;
5
6
  };
6
7
  video?: {
7
8
  enabled?: boolean;
8
9
  deviceId?: string;
9
10
  track?: MediaStreamTrack;
11
+ stream?: MediaStream;
10
12
  };
11
13
  screen?: {
12
14
  enabled?: boolean;
@@ -249,3 +249,6 @@ export interface NotificationsDocConfig {
249
249
  email: 'ALL' | 'NONE' | 'MINE';
250
250
  [key: string]: string;
251
251
  }
252
+ export interface GetNotificationsDataQuery {
253
+ type?: 'all' | 'forYou' | 'documents';
254
+ }
@@ -1,7 +1,8 @@
1
+ import { ResolverActions } from "../../utils/enums";
1
2
  import { BaseMetadata } from "./base-metadata.data.model";
3
+ import { PartialUser } from "./comment-resolver.data.model";
2
4
  import { ReactionAnnotation } from "./reaction-annotation.data.model";
3
- import { ResolverResponse, ResolverConfig } from "./resolver.data.model";
4
- import { ResolverActions } from "../../utils/enums";
5
+ import { ResolverConfig, ResolverResponse } from "./resolver.data.model";
5
6
  export interface ReactionAnnotationDataProvider {
6
7
  get: (request: GetReactionResolverRequest) => Promise<ResolverResponse<Record<string, PartialReactionAnnotation>>>;
7
8
  save: (request: SaveReactionResolverRequest) => Promise<ResolverResponse<undefined>>;
@@ -37,4 +38,5 @@ export interface PartialReactionAnnotation {
37
38
  annotationId: string;
38
39
  metadata?: BaseMetadata;
39
40
  icon?: string;
41
+ from?: PartialUser;
40
42
  }
@@ -8,10 +8,24 @@ export interface RecordingDeleteEvent extends RecorderData {
8
8
  }
9
9
  export interface RecordingEditDoneEvent extends RecorderData {
10
10
  }
11
+ export interface RecordingActionsEvent {
12
+ type: 'audio' | 'video' | 'screen';
13
+ }
14
+ export interface RecordingStartedEvent extends RecordingActionsEvent {
15
+ }
16
+ export interface RecordingPausedEvent extends RecordingActionsEvent {
17
+ }
18
+ export interface RecordingCancelledEvent extends RecordingActionsEvent {
19
+ }
20
+ export interface RecordingStoppedEvent extends RecordingActionsEvent {
21
+ }
22
+ export interface RecordingResumedEvent extends RecordingActionsEvent {
23
+ }
11
24
  export interface RecordingErrorEvent {
12
25
  type: string;
13
26
  message: string;
14
27
  recorderId?: string;
28
+ url?: string;
15
29
  }
16
30
  export interface RecordingSaveInitiatedEvent {
17
31
  annotationId?: string;
@@ -23,4 +37,9 @@ export type RecorderEventTypesMap = {
23
37
  [RecorderEventTypes.RECORDING_DONE]: RecordingDoneEvent;
24
38
  [RecorderEventTypes.RECORDING_EDIT_DONE]: RecordingEditDoneEvent;
25
39
  [RecorderEventTypes.DELETE_RECORDING]: RecordingDeleteEvent;
40
+ [RecorderEventTypes.RECORDING_STARTED]: RecordingStartedEvent;
41
+ [RecorderEventTypes.RECORDING_PAUSED]: RecordingPausedEvent;
42
+ [RecorderEventTypes.RECORDING_CANCELLED]: RecordingCancelledEvent;
43
+ [RecorderEventTypes.RECORDING_STOPPED]: RecordingStoppedEvent;
44
+ [RecorderEventTypes.RECORDING_RESUMED]: RecordingResumedEvent;
26
45
  };
@@ -105,3 +105,7 @@ export declare class RecorderEncodingOptions {
105
105
  safari?: MediaRecorderOptions;
106
106
  other?: MediaRecorderOptions;
107
107
  }
108
+ export declare class RecorderDevicePermissionOptions {
109
+ audio?: boolean;
110
+ video?: boolean;
111
+ }
@@ -4,6 +4,7 @@ export interface ResolverConfig {
4
4
  deleteRetryConfig?: RetryConfig;
5
5
  getRetryConfig?: RetryConfig;
6
6
  resolveUsersConfig?: ResolveUsersConfig;
7
+ fieldsToRemove?: string[];
7
8
  }
8
9
  export interface ResolveUsersConfig {
9
10
  organization?: boolean;
@@ -11,6 +11,12 @@ export declare class UserIAM {
11
11
  * The user's contact details
12
12
  */
13
13
  user: UserContact;
14
+ documentIds?: string[];
15
+ folderIds?: string[];
16
+ organizationIds?: string[];
17
+ documentIdsCount?: number;
18
+ folderIdsCount?: number;
19
+ organizationIdsCount?: number;
14
20
  /**
15
21
  * The user's role in the document
16
22
  */
@@ -99,3 +99,13 @@ export declare class Options {
99
99
  */
100
100
  forceReset?: boolean;
101
101
  }
102
+ export interface AuthRetryConfig {
103
+ retryCount?: number;
104
+ retryDelay?: number;
105
+ }
106
+ export interface VeltAuthProvider {
107
+ user: User;
108
+ options?: Options;
109
+ retryConfig?: AuthRetryConfig;
110
+ generateToken?: () => Promise<string>;
111
+ }