@veltdev/sdk 3.0.66 → 3.0.68

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.
@@ -0,0 +1,142 @@
1
+ import { CommentAccessMode } from "../../utils/enums";
2
+ import { Attachment } from "./attachment.model";
3
+ import { CommentAnnotation } from "./comment-annotation.data.model";
4
+ import { Comment } from "./comment.data.model";
5
+ import { CustomPriority, CustomStatus } from "./custom-filter.data.model";
6
+ import { ReactionItem } from "./reaction-annotation.data.model";
7
+ import { User } from "./user.data.model";
8
+ export declare class ActionOptions {
9
+ organizationId?: string;
10
+ documentId?: string;
11
+ }
12
+ export declare class UpdatePriorityConfig {
13
+ annotationId: string;
14
+ priority?: CustomPriority;
15
+ options?: ActionOptions;
16
+ }
17
+ export declare class UpdateStatusConfig {
18
+ annotationId: string;
19
+ status: CustomStatus;
20
+ options?: ActionOptions;
21
+ }
22
+ export declare class UpdateAccessConfig {
23
+ annotationId: string;
24
+ accessMode: CommentAccessMode;
25
+ options?: ActionOptions;
26
+ }
27
+ export declare class ResolveCommentAnnotationConfig {
28
+ annotationId: string;
29
+ options?: ActionOptions;
30
+ }
31
+ export declare class GetLinkConfig {
32
+ annotationId: string;
33
+ options?: ActionOptions;
34
+ }
35
+ export declare class CopyLinkConfig {
36
+ annotationId: string;
37
+ options?: ActionOptions;
38
+ }
39
+ export declare class AddCommentAnnotationConfig {
40
+ annotation: CommentAnnotation;
41
+ options?: ActionOptions;
42
+ }
43
+ export declare class ApproveCommentAnnotationConfig {
44
+ annotationId: string;
45
+ options?: ActionOptions;
46
+ }
47
+ export declare class AcceptCommentAnnotationConfig {
48
+ annotationId: string;
49
+ options?: ActionOptions;
50
+ }
51
+ export declare class RejectCommentAnnotationConfig {
52
+ annotationId: string;
53
+ options?: ActionOptions;
54
+ }
55
+ export declare class DeleteCommentAnnotationConfig {
56
+ annotationId: string;
57
+ options?: ActionOptions;
58
+ }
59
+ export declare class AddCommentConfig {
60
+ annotationId: string;
61
+ comment: Comment;
62
+ assignedTo?: User;
63
+ options?: ActionOptions;
64
+ }
65
+ export declare class UpdateCommentConfig {
66
+ annotationId: string;
67
+ comment: Comment;
68
+ skipDeleteThreadConfirmation?: boolean;
69
+ merge?: boolean;
70
+ options?: ActionOptions;
71
+ }
72
+ export declare class DeleteCommentConfig {
73
+ annotationId: string;
74
+ commentId: number;
75
+ skipDeleteThreadConfirmation?: boolean;
76
+ options?: ActionOptions;
77
+ }
78
+ export declare class GetCommentConfig {
79
+ annotationId: string;
80
+ options?: ActionOptions;
81
+ }
82
+ export declare class AddAttachmentConfig {
83
+ annotationId: string;
84
+ files: File[];
85
+ options?: ActionOptions;
86
+ }
87
+ export declare class AddAttachmentResponse {
88
+ valid: boolean;
89
+ file?: File;
90
+ maxAllowedSize: number;
91
+ error?: string;
92
+ attachment?: Attachment;
93
+ }
94
+ export declare class DeleteAttachmentConfig {
95
+ annotationId: string;
96
+ commentId: number;
97
+ attachmentId: number;
98
+ options?: ActionOptions;
99
+ }
100
+ export declare class GetAttachmentConfig {
101
+ annotationId: string;
102
+ commentId: number;
103
+ options?: ActionOptions;
104
+ }
105
+ export declare class GetRecordingConfig {
106
+ annotationId: string;
107
+ commentId: number;
108
+ options?: ActionOptions;
109
+ }
110
+ export declare class DeleteRecordingConfig {
111
+ annotationId: string;
112
+ commentId: number;
113
+ recorderId: string;
114
+ options?: ActionOptions;
115
+ }
116
+ export declare class AddReactionConfig {
117
+ annotationId: string;
118
+ commentId: number;
119
+ reaction: {
120
+ reactionId: string;
121
+ customReaction?: ReactionItem;
122
+ };
123
+ options?: ActionOptions;
124
+ }
125
+ export declare class DeleteReactionConfig {
126
+ annotationId: string;
127
+ commentId: number;
128
+ reaction: {
129
+ reactionId: string;
130
+ customReaction?: ReactionItem;
131
+ };
132
+ options?: ActionOptions;
133
+ }
134
+ export declare class ToggleReactionConfig {
135
+ annotationId: string;
136
+ commentId: number;
137
+ reaction: {
138
+ reactionId: string;
139
+ customReaction?: ReactionItem;
140
+ };
141
+ options?: ActionOptions;
142
+ }
@@ -1,6 +1,14 @@
1
- import { CommentStatus } from "../../utils/enums";
1
+ import { CommentAccessMode, CommentStatus } from "../../utils/enums";
2
+ import { Attachment } from "./attachment.model";
3
+ import { AddAttachmentResponse } from "./comment-actions.data.model";
2
4
  import { CommentAnnotation, UpdateContextConfig } from "./comment-annotation.data.model";
5
+ import { Comment } from "./comment.data.model";
6
+ import { CustomPriority, CustomStatus } from "./custom-filter.data.model";
7
+ import { DocumentMetadata } from "./document-metadata.model";
3
8
  import { Location } from "./location.model";
9
+ import { OrganizationMetadata } from "./organization-metadata.model";
10
+ import { ReactionAnnotation } from "./reaction-annotation.data.model";
11
+ import { RecordedData } from "./recorder.model";
4
12
  import { User } from "./user.data.model";
5
13
  export interface CommentAddEventData {
6
14
  annotation: CommentAnnotation;
@@ -31,3 +39,120 @@ export interface CommentSuggestionEventData {
31
39
  replaceContentText?: string;
32
40
  annotation?: any;
33
41
  }
42
+ export interface CommentEventMetadata {
43
+ organizationMetadata?: OrganizationMetadata | null;
44
+ documentMetadata?: DocumentMetadata | null;
45
+ location?: Location | null;
46
+ }
47
+ export interface AddAttachmentEvent {
48
+ annotationId?: string;
49
+ commentAnnotation?: CommentAnnotation;
50
+ attachments: AddAttachmentResponse[];
51
+ metadata: CommentEventMetadata;
52
+ }
53
+ export interface DeleteAttachmentEvent {
54
+ annotationId?: string;
55
+ commentId?: number;
56
+ commentAnnotation?: CommentAnnotation;
57
+ attachment: Attachment;
58
+ metadata: CommentEventMetadata;
59
+ }
60
+ export interface AddCommentAnnotationEvent {
61
+ annotationId?: string;
62
+ commentAnnotation?: CommentAnnotation;
63
+ metadata: CommentEventMetadata;
64
+ }
65
+ export interface ApproveCommentAnnotationEvent {
66
+ annotationId?: string;
67
+ commentAnnotation?: CommentAnnotation;
68
+ metadata: CommentEventMetadata;
69
+ }
70
+ export interface AcceptCommentAnnotationEvent {
71
+ annotationId?: string;
72
+ commentAnnotation?: CommentAnnotation;
73
+ metadata: CommentEventMetadata;
74
+ }
75
+ export interface RejectCommentAnnotationEvent {
76
+ annotationId?: string;
77
+ commentAnnotation?: CommentAnnotation;
78
+ metadata: CommentEventMetadata;
79
+ }
80
+ export interface DeleteCommentAnnotationEvent {
81
+ annotationId?: string;
82
+ commentAnnotation?: CommentAnnotation;
83
+ metadata: CommentEventMetadata;
84
+ }
85
+ export interface AddCommentEvent {
86
+ annotationId?: string;
87
+ commentAnnotation?: CommentAnnotation;
88
+ commentId?: number;
89
+ comment: Comment;
90
+ metadata: CommentEventMetadata;
91
+ }
92
+ export interface UpdateCommentEvent {
93
+ annotationId?: string;
94
+ commentAnnotation?: CommentAnnotation;
95
+ commentId?: number;
96
+ comment: Comment;
97
+ metadata: CommentEventMetadata;
98
+ }
99
+ export interface DeleteCommentEvent {
100
+ annotationId?: string;
101
+ commentAnnotation?: CommentAnnotation;
102
+ commentId?: number;
103
+ comment: Comment;
104
+ metadata: CommentEventMetadata;
105
+ }
106
+ export interface DeleteRecordingEvent {
107
+ annotationId?: string;
108
+ commentAnnotation?: CommentAnnotation;
109
+ commentId?: number;
110
+ recording: RecordedData;
111
+ metadata: CommentEventMetadata;
112
+ }
113
+ export interface ReactionEvent {
114
+ annotationId?: string;
115
+ commentAnnotation?: CommentAnnotation;
116
+ commentId?: number;
117
+ reaction: ReactionAnnotation;
118
+ metadata: CommentEventMetadata;
119
+ }
120
+ export interface AddReactionEvent extends ReactionEvent {
121
+ }
122
+ export interface DeleteReactionEvent extends ReactionEvent {
123
+ }
124
+ export interface ToggleReactionEvent extends ReactionEvent {
125
+ }
126
+ export interface UpdateStatusEvent {
127
+ annotationId?: string;
128
+ commentAnnotation?: CommentAnnotation;
129
+ newStatus: CustomStatus;
130
+ oldStatus: CustomStatus;
131
+ metadata: CommentEventMetadata;
132
+ }
133
+ export interface UpdatePriorityEvent {
134
+ annotationId?: string;
135
+ commentAnnotation?: CommentAnnotation;
136
+ newPriority?: CustomPriority;
137
+ oldPriority?: CustomPriority;
138
+ metadata: CommentEventMetadata;
139
+ }
140
+ export interface UpdateAccessEvent {
141
+ annotationId?: string;
142
+ commentAnnotation?: CommentAnnotation;
143
+ newAccessMode?: CommentAccessMode;
144
+ oldAccessMode?: CommentAccessMode;
145
+ metadata: CommentEventMetadata;
146
+ }
147
+ export interface GetLinkEvent {
148
+ annotationId?: string;
149
+ commentAnnotation?: CommentAnnotation;
150
+ link: string | null;
151
+ metadata: CommentEventMetadata;
152
+ }
153
+ export interface CopyLinkEvent {
154
+ annotationId?: string;
155
+ commentAnnotation?: CommentAnnotation;
156
+ link: string;
157
+ metadata: CommentEventMetadata;
158
+ }
@@ -52,9 +52,10 @@ export declare class ReactionAnnotation {
52
52
  iconEmoji?: string;
53
53
  }
54
54
  export declare class ReactionMap {
55
- [reactionId: string]: {
56
- url?: string;
57
- svg?: string;
58
- emoji?: string;
59
- };
55
+ [reactionId: string]: ReactionItem;
56
+ }
57
+ export declare class ReactionItem {
58
+ url?: string;
59
+ svg?: string;
60
+ emoji?: string;
60
61
  }
@@ -1,12 +1,13 @@
1
1
  // @ts-nocheck
2
2
  import { Observable } from "rxjs";
3
3
  import { CommentAnnotation, CommentOnElementConfig, CommentSelectionChangeData, ManualCommentAnnotationConfig, UpdateContextConfig } from "../data/comment-annotation.data.model";
4
- import { CommentAddEventData, CommentUpdateEventData } from "../data/comment-events.data.model";
4
+ import { AcceptCommentAnnotationEvent, AddCommentAnnotationEvent, AddCommentEvent, AddReactionEvent, ApproveCommentAnnotationEvent, CommentAddEventData, CommentUpdateEventData, CopyLinkEvent, DeleteAttachmentEvent, DeleteCommentAnnotationEvent, DeleteCommentEvent, DeleteReactionEvent, DeleteRecordingEvent, GetLinkEvent, RejectCommentAnnotationEvent, ToggleReactionEvent, UpdateAccessEvent, UpdateCommentEvent, UpdatePriorityEvent, UpdateStatusEvent } from "../data/comment-events.data.model";
5
5
  import { CustomCategory, CustomPriority, CustomStatus } from "../data/custom-filter.data.model";
6
6
  import { CustomAnnotationDropdownData } from "../data/custom-chip-dropdown.data.model";
7
7
  import { AutocompleteData } from "../data/autocomplete.data.model";
8
8
  import { CommentSidebarCustomActionEventData, CommentSidebarData, CommentSidebarDataOptions } from "../data/comment-sidebar-config.model";
9
9
  export { ReactionMap } from '../data/reaction-annotation.data.model';
10
+ import { AcceptCommentAnnotationConfig, AddAttachmentConfig, AddAttachmentResponse, AddCommentAnnotationConfig, AddCommentConfig, AddReactionConfig, ApproveCommentAnnotationConfig, CopyLinkConfig, DeleteAttachmentConfig, DeleteCommentAnnotationConfig, DeleteCommentConfig, DeleteReactionConfig, DeleteRecordingConfig, GetAttachmentConfig, GetCommentConfig, GetLinkConfig, GetRecordingConfig, RejectCommentAnnotationConfig, ResolveCommentAnnotationConfig, ToggleReactionConfig, UpdateAccessConfig, UpdateCommentConfig, UpdatePriorityConfig, UpdateStatusConfig } from "../data/comment-actions.data.model";
10
11
  export declare class CommentElement {
11
12
  /**
12
13
  * Subscribe to comments on the current document.
@@ -912,6 +913,125 @@ export declare class CommentElement {
912
913
  */
913
914
  public disableShortUserName: () => void;
914
915
 
916
+ /**
917
+ * To add comment annotation
918
+ */
919
+ public addCommentAnnotation: (config: AddCommentAnnotationConfig) => Promise<AddCommentAnnotationEvent | null>;
920
+
921
+ /**
922
+ * To approve comment annotation
923
+ */
924
+ public approveCommentAnnotation: (config: ApproveCommentAnnotationConfig) => Promise<ApproveCommentAnnotationEvent | null>;
925
+
926
+ /**
927
+ * To accept comment annotation
928
+ */
929
+ public acceptCommentAnnotation: (config: AcceptCommentAnnotationConfig) => Promise<AcceptCommentAnnotationEvent | null>;
930
+
931
+ /**
932
+ * To reject comment annotation
933
+ */
934
+ public rejectCommentAnnotation: (config: RejectCommentAnnotationConfig) => Promise<RejectCommentAnnotationEvent | null>;
935
+
936
+ /**
937
+ * To delete comment annotation
938
+ */
939
+ public deleteCommentAnnotation: (config: DeleteCommentAnnotationConfig) => Promise<DeleteCommentAnnotationEvent | null>;
940
+
941
+ /**
942
+ * To update priority
943
+ */
944
+ public updatePriority: (config: UpdatePriorityConfig) => Promise<UpdatePriorityEvent | null>;
945
+
946
+ /**
947
+ * To update status
948
+ */
949
+ public updateStatus: (config: UpdateStatusConfig) => Promise<UpdateStatusEvent | null>;
950
+
951
+ /**
952
+ * To update access
953
+ */
954
+ public updateAccess: (config: UpdateAccessConfig) => Promise<UpdateAccessEvent | null>;
955
+
956
+ /**
957
+ * To resolve comment annotation
958
+ */
959
+ public resolveCommentAnnotation: (config: ResolveCommentAnnotationConfig) => Promise<any>;
960
+
961
+ /**
962
+ * To get link
963
+ */
964
+ public getLink: (config: GetLinkConfig) => Promise<GetLinkEvent | null>;
965
+
966
+ /**
967
+ * To copy link
968
+ */
969
+ public copyLink: (config: CopyLinkConfig) => Promise<CopyLinkEvent | null>;
970
+
971
+ /**
972
+ * To add comment
973
+ */
974
+ public addComment: (config: AddCommentConfig) => Promise<AddCommentEvent | null>;
975
+
976
+ /**
977
+ * To update comment
978
+ */
979
+ public updateComment: (config: UpdateCommentConfig) => Promise<UpdateCommentEvent | null>;
980
+
981
+ /**
982
+ * To delete comment
983
+ */
984
+ public deleteComment: (config: DeleteCommentConfig) => Promise<DeleteCommentEvent | null>;
985
+
986
+ /**
987
+ * To get comment
988
+ */
989
+ public getComment: (config: GetCommentConfig) => Promise<Comment[]>;
990
+
991
+ /**
992
+ * To add attachment
993
+ */
994
+ public addAttachment: (config: AddAttachmentConfig) => Promise<AddAttachmentResponse[]>;
995
+
996
+ /**
997
+ * To get attachment
998
+ */
999
+ public getAttachment: (config: GetAttachmentConfig) => Promise<Attachment[]>;
1000
+
1001
+ /**
1002
+ * To delete attachment
1003
+ */
1004
+ public deleteAttachment: (config: DeleteAttachmentConfig) => Promise<DeleteAttachmentEvent | null>;
1005
+
1006
+ /**
1007
+ * To get recording
1008
+ */
1009
+ public getRecording: (config: GetRecordingConfig) => Promise<RecordedData[]>;
1010
+
1011
+ /**
1012
+ * To delete recording
1013
+ */
1014
+ public deleteRecording: (config: DeleteRecordingConfig) => Promise<DeleteRecordingEvent | null>;
1015
+
1016
+ /**
1017
+ * To add reaction
1018
+ */
1019
+ public addReaction: (config: AddReactionConfig) => Promise<AddReactionEvent | null>;
1020
+
1021
+ /**
1022
+ * To delete reaction
1023
+ */
1024
+ public deleteReaction: (config: DeleteReactionConfig) => Promise<DeleteReactionEvent | null>;
1025
+
1026
+ /**
1027
+ * To toggle reaction
1028
+ */
1029
+ public toggleReaction: (config: ToggleReactionConfig) => Promise<ToggleReactionEvent | null>;
1030
+
1031
+ /**
1032
+ * Subscribe to comment actions
1033
+ */
1034
+ public on: (action: CommentActionTypes) => Observable<any>;
915
1035
  constructor();
916
1036
  /**
917
1037
  * Subscribe to comments on the current document.
@@ -1809,4 +1929,126 @@ export declare class CommentElement {
1809
1929
  * To disable short user name
1810
1930
  */
1811
1931
  private _disableShortUserName;
1932
+
1933
+ // actions
1934
+
1935
+ /**
1936
+ * To add comment annotation
1937
+ */
1938
+ private _addCommentAnnotation;
1939
+
1940
+ /**
1941
+ * To approve comment annotation
1942
+ */
1943
+ private _approveCommentAnnotation;
1944
+
1945
+ /**
1946
+ * To accept comment annotation
1947
+ */
1948
+ private _acceptCommentAnnotation;
1949
+
1950
+ /**
1951
+ * To reject comment annotation
1952
+ */
1953
+ private _rejectCommentAnnotation;
1954
+
1955
+ /**
1956
+ * To delete comment annotation
1957
+ */
1958
+ private _deleteCommentAnnotation;
1959
+
1960
+ /**
1961
+ * To update priority
1962
+ */
1963
+ private _updatePriority;
1964
+
1965
+ /**
1966
+ * To update status
1967
+ */
1968
+ private _updateStatus;
1969
+
1970
+ /**
1971
+ * To update access
1972
+ */
1973
+ private _updateAccess;
1974
+
1975
+ /**
1976
+ * To resolve comment annotation
1977
+ */
1978
+ private _resolveCommentAnnotation;
1979
+
1980
+ /**
1981
+ * To get link
1982
+ */
1983
+ private _getLink;
1984
+
1985
+ /**
1986
+ * To copy link
1987
+ */
1988
+ private _copyLink;
1989
+
1990
+ /**
1991
+ * To add comment
1992
+ */
1993
+ private _addComment;
1994
+
1995
+ /**
1996
+ * To update comment
1997
+ */
1998
+ private _updateComment;
1999
+
2000
+ /**
2001
+ * To delete comment
2002
+ */
2003
+ private _deleteComment;
2004
+
2005
+ /**
2006
+ * To get comment
2007
+ */
2008
+ private _getComment;
2009
+
2010
+ /**
2011
+ * To add attachment
2012
+ */
2013
+ private _addAttachment;
2014
+
2015
+ /**
2016
+ * To delete attachment
2017
+ */
2018
+ private _deleteAttachment;
2019
+
2020
+ /**
2021
+ * To get attachment
2022
+ */
2023
+ private _getAttachment;
2024
+
2025
+ /**
2026
+ * To delete recording
2027
+ */
2028
+ private _deleteRecording;
2029
+
2030
+ /**
2031
+ * To get recording
2032
+ */
2033
+ private _getRecording;
2034
+
2035
+ /**
2036
+ * To add reaction
2037
+ */
2038
+ private _addReaction;
2039
+
2040
+ /**
2041
+ * To delete reaction
2042
+ */
2043
+ private _deleteReaction;
2044
+
2045
+ /**
2046
+ * To toggle reaction
2047
+ */
2048
+ private _toggleReaction;
2049
+
2050
+ /**
2051
+ * Subscribe to comment actions
2052
+ */
2053
+ private _on;
1812
2054
  }
@@ -16,6 +16,29 @@ export declare enum CommentStatus {
16
16
  SUBSCRIBED = "subscribed",
17
17
  UNSUBSCRIBED = "unsubscribed"
18
18
  }
19
+ export declare enum CommentActionTypes {
20
+ ADD_COMMENT_ANNOTATION = "addCommentAnnotation",
21
+ UPDATE_COMMENT_ANNOTATION = "updateCommentAnnotation",
22
+ DELETE_COMMENT_ANNOTATION = "deleteCommentAnnotation",
23
+ APPROVE_COMMENT_ANNOTATION = "approveCommentAnnotation",
24
+ ACCEPT_COMMENT_ANNOTATION = "acceptCommentAnnotation",
25
+ REJECT_COMMENT_ANNOTATION = "rejectCommentAnnotation",
26
+ UPDATE_STATUS = "updateStatus",
27
+ UPDATE_PRIORITY = "updatePriority",
28
+ UPDATE_ACCESS = "updateAccess",
29
+ RESOLVE_COMMENT = "resolveComment",
30
+ ADD_COMMENT = "addComment",
31
+ UPDATE_COMMENT = "updateComment",
32
+ DELETE_COMMENT = "deleteComment",
33
+ ADD_ATTACHMENT = "addAttachment",
34
+ DELETE_ATTACHMENT = "deleteAttachment",
35
+ DELETE_RECORDING = "deleteRecording",
36
+ GET_LINK = "getLink",
37
+ COPY_LINK = "copyLink",
38
+ ADD_REACTION = "addReaction",
39
+ DELETE_REACTION = "deleteReaction",
40
+ TOGGLE_REACTION = "toggleReaction"
41
+ }
19
42
  export declare enum TagStatus {
20
43
  ADDED = "added",
21
44
  UPDATED = "updated",
package/models.d.ts CHANGED
@@ -5,6 +5,7 @@ export * from './app/models/data/chatgpt.data.model';
5
5
  export * from './app/models/data/comment-annotation.data.model';
6
6
  export * from './app/models/data/comment-events.data.model';
7
7
  export * from './app/models/data/comment.data.model';
8
+ export * from './app/models/data/comment-actions.data.model';
8
9
  export * from './app/models/data/config.data.model';
9
10
  export * from './app/models/data/cursor-position.data.model';
10
11
  export * from './app/models/data/cursor-user.data.model';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veltdev/sdk",
3
- "version": "3.0.66",
3
+ "version": "3.0.68",
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": [