@veltdev/sdk 4.6.1 → 4.6.3
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.
|
@@ -3,6 +3,10 @@ import { VeltButtonClickEvent } from "./button.data.model";
|
|
|
3
3
|
import { PermissionSource, User } from "./user.data.model";
|
|
4
4
|
export type CoreEventTypesMap = {
|
|
5
5
|
[CoreEventTypes.PERMISSION_PROVIDER]: PermissionProviderEvent;
|
|
6
|
+
[CoreEventTypes.USER_RESOLVER]: UserResolverEvent;
|
|
7
|
+
[CoreEventTypes.COMMENT_RESOLVER]: CommentResolverEvent;
|
|
8
|
+
[CoreEventTypes.ATTACHMENT_RESOLVER]: AttachmentResolverEvent;
|
|
9
|
+
[CoreEventTypes.REACTION_RESOLVER]: ReactionResolverEvent;
|
|
6
10
|
[CoreEventTypes.VELT_BUTTON_CLICK]: VeltButtonClickEvent;
|
|
7
11
|
[CoreEventTypes.USER_UPDATE]: UserUpdateEvent;
|
|
8
12
|
[CoreEventTypes.DOCUMENT_INIT]: DocumentInitEvent;
|
|
@@ -11,14 +15,50 @@ export type CoreEventTypesMap = {
|
|
|
11
15
|
};
|
|
12
16
|
export type UserUpdateEvent = User | null;
|
|
13
17
|
export type DocumentInitEvent = boolean | undefined;
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
export declare enum UserResolverSource {
|
|
19
|
+
RESOLVE_USERS = "resolveUsers",
|
|
20
|
+
FORMAT_RESPONSE = "formatResponse",
|
|
21
|
+
MERGE_USER_WITH_PROVIDED_USER_DATA = "mergeUserWithProvidedUserData",
|
|
22
|
+
GET_TEMPORARY_USERS = "getTemporaryUsers",
|
|
23
|
+
SET_SINGLE_EDITOR_MODE_LIVE_STATE_DATA_FOR_DIFFERENT_USER_PRESENT_ON_TAB = "setSingleEditorModeLiveStateDataForDifferentUserPresentOnTab",
|
|
24
|
+
RESOLVE_AND_MERGE_SINGLE_EDITOR_LIVE_STATE_DATA_WITH_USER = "resolveAndMergeSingleEditorLiveStateDataWithUser",
|
|
25
|
+
GET_SINGLE_EDITOR_MODE_DATA = "getSingleEditorModeData",
|
|
26
|
+
RESOLVE_USERS_FROM_HUDDLE_MESSAGES = "resolveUsersFromHuddleMessages"
|
|
27
|
+
}
|
|
28
|
+
export declare enum CommentResolverSource {
|
|
29
|
+
RESOLVE_COMMENT_ANNOTATIONS = "resolveCommentAnnotations",
|
|
30
|
+
SAVE_COMMENT_ANNOTATION = "saveCommentAnnotation",
|
|
31
|
+
DELETE_COMMENT_ANNOTATION = "deleteCommentAnnotation",
|
|
32
|
+
FORMAT_RESPONSE = "formatResponse",
|
|
33
|
+
INIT_DOCUMENTS = "initDocuments",
|
|
34
|
+
SET_DATA = "setData",
|
|
35
|
+
UPDATE_DATA = "updateData",
|
|
36
|
+
DELETE_DATA = "deleteData"
|
|
37
|
+
}
|
|
38
|
+
export declare enum AttachmentResolverSource {
|
|
39
|
+
SAVE_ATTACHMENT = "saveAttachment",
|
|
40
|
+
DELETE_ATTACHMENT = "deleteAttachment",
|
|
41
|
+
UPLOAD_TO_RESOLVER = "uploadToResolver"
|
|
42
|
+
}
|
|
43
|
+
export declare enum ReactionResolverSource {
|
|
44
|
+
RESOLVE_REACTION_ANNOTATIONS = "resolveReactionAnnotations",
|
|
45
|
+
SAVE_REACTION_ANNOTATION = "saveReactionAnnotation",
|
|
46
|
+
DELETE_REACTION_ANNOTATION = "deleteReactionAnnotation",
|
|
47
|
+
FORMAT_RESPONSE = "formatResponse",
|
|
48
|
+
INIT_DOCUMENTS = "initDocuments",
|
|
49
|
+
SET_DATA = "setData",
|
|
50
|
+
UPDATE_DATA = "updateData",
|
|
51
|
+
DELETE_DATA = "deleteData"
|
|
52
|
+
}
|
|
53
|
+
export type BaseResolverEvent<TEventType, TMethodName> = {
|
|
54
|
+
event: TEventType;
|
|
55
|
+
methodName?: TMethodName;
|
|
17
56
|
source?: 'internal' | 'external';
|
|
18
57
|
timestamp?: number;
|
|
19
58
|
uniqueId?: string;
|
|
20
59
|
payload?: any;
|
|
21
60
|
};
|
|
61
|
+
export type PermissionProviderEvent = BaseResolverEvent<PermissionProviderEventType, PermissionSource>;
|
|
22
62
|
export type PermissionProviderEventType = {
|
|
23
63
|
RESOURCE_ACCESS_REQUEST_FORMED: 'resourceAccessRequestFormed';
|
|
24
64
|
RESOURCE_ACCESS_REQUEST_TRIGGERED: 'resourceAccessRequestTriggered';
|
|
@@ -26,6 +66,57 @@ export type PermissionProviderEventType = {
|
|
|
26
66
|
RESOURCE_ACCESS_ERROR: 'resourceAccessError';
|
|
27
67
|
RESOURCE_ACCESS_RESULT_FROM_CACHE: 'resourceAccessResultFromCache';
|
|
28
68
|
};
|
|
69
|
+
export type UserResolverEvent = BaseResolverEvent<UserResolverEventType, UserResolverSource>;
|
|
70
|
+
export type UserResolverEventType = {
|
|
71
|
+
USER_RESOLUTION_REQUEST_FORMED: 'userResolutionRequestFormed';
|
|
72
|
+
USER_RESOLUTION_REQUEST_TRIGGERED: 'userResolutionRequestTriggered';
|
|
73
|
+
USER_RESOLUTION_RESULT: 'userResolutionResult';
|
|
74
|
+
USER_RESOLUTION_ERROR: 'userResolutionError';
|
|
75
|
+
USER_RESOLUTION_RESULT_FROM_CACHE: 'userResolutionResultFromCache';
|
|
76
|
+
};
|
|
77
|
+
export type CommentResolverEvent = BaseResolverEvent<CommentResolverEventType, CommentResolverSource>;
|
|
78
|
+
export type CommentResolverEventType = {
|
|
79
|
+
COMMENT_RESOLUTION_REQUEST_FORMED: 'commentResolutionRequestFormed';
|
|
80
|
+
COMMENT_RESOLUTION_REQUEST_TRIGGERED: 'commentResolutionRequestTriggered';
|
|
81
|
+
COMMENT_RESOLUTION_RESULT: 'commentResolutionResult';
|
|
82
|
+
COMMENT_RESOLUTION_ERROR: 'commentResolutionError';
|
|
83
|
+
COMMENT_RESOLUTION_RESULT_FROM_CACHE: 'commentResolutionResultFromCache';
|
|
84
|
+
COMMENT_SAVE_REQUEST_FORMED: 'commentSaveRequestFormed';
|
|
85
|
+
COMMENT_SAVE_REQUEST_TRIGGERED: 'commentSaveRequestTriggered';
|
|
86
|
+
COMMENT_SAVE_RESULT: 'commentSaveResult';
|
|
87
|
+
COMMENT_SAVE_ERROR: 'commentSaveError';
|
|
88
|
+
COMMENT_DELETE_REQUEST_FORMED: 'commentDeleteRequestFormed';
|
|
89
|
+
COMMENT_DELETE_REQUEST_TRIGGERED: 'commentDeleteRequestTriggered';
|
|
90
|
+
COMMENT_DELETE_RESULT: 'commentDeleteResult';
|
|
91
|
+
COMMENT_DELETE_ERROR: 'commentDeleteError';
|
|
92
|
+
};
|
|
93
|
+
export type AttachmentResolverEvent = BaseResolverEvent<AttachmentResolverEventType, AttachmentResolverSource>;
|
|
94
|
+
export type AttachmentResolverEventType = {
|
|
95
|
+
ATTACHMENT_SAVE_REQUEST_FORMED: 'attachmentSaveRequestFormed';
|
|
96
|
+
ATTACHMENT_SAVE_REQUEST_TRIGGERED: 'attachmentSaveRequestTriggered';
|
|
97
|
+
ATTACHMENT_SAVE_RESULT: 'attachmentSaveResult';
|
|
98
|
+
ATTACHMENT_SAVE_ERROR: 'attachmentSaveError';
|
|
99
|
+
ATTACHMENT_DELETE_REQUEST_FORMED: 'attachmentDeleteRequestFormed';
|
|
100
|
+
ATTACHMENT_DELETE_REQUEST_TRIGGERED: 'attachmentDeleteRequestTriggered';
|
|
101
|
+
ATTACHMENT_DELETE_RESULT: 'attachmentDeleteResult';
|
|
102
|
+
ATTACHMENT_DELETE_ERROR: 'attachmentDeleteError';
|
|
103
|
+
};
|
|
104
|
+
export type ReactionResolverEvent = BaseResolverEvent<ReactionResolverEventType, ReactionResolverSource>;
|
|
105
|
+
export type ReactionResolverEventType = {
|
|
106
|
+
REACTION_RESOLUTION_REQUEST_FORMED: 'reactionResolutionRequestFormed';
|
|
107
|
+
REACTION_RESOLUTION_REQUEST_TRIGGERED: 'reactionResolutionRequestTriggered';
|
|
108
|
+
REACTION_RESOLUTION_RESULT: 'reactionResolutionResult';
|
|
109
|
+
REACTION_RESOLUTION_ERROR: 'reactionResolutionError';
|
|
110
|
+
REACTION_RESOLUTION_RESULT_FROM_CACHE: 'reactionResolutionResultFromCache';
|
|
111
|
+
REACTION_SAVE_REQUEST_FORMED: 'reactionSaveRequestFormed';
|
|
112
|
+
REACTION_SAVE_REQUEST_TRIGGERED: 'reactionSaveRequestTriggered';
|
|
113
|
+
REACTION_SAVE_RESULT: 'reactionSaveResult';
|
|
114
|
+
REACTION_SAVE_ERROR: 'reactionSaveError';
|
|
115
|
+
REACTION_DELETE_REQUEST_FORMED: 'reactionDeleteRequestFormed';
|
|
116
|
+
REACTION_DELETE_REQUEST_TRIGGERED: 'reactionDeleteRequestTriggered';
|
|
117
|
+
REACTION_DELETE_RESULT: 'reactionDeleteResult';
|
|
118
|
+
REACTION_DELETE_ERROR: 'reactionDeleteError';
|
|
119
|
+
};
|
|
29
120
|
export type ErrorEvent = {
|
|
30
121
|
event?: string;
|
|
31
122
|
sourceMethod?: string;
|
|
@@ -99,6 +99,10 @@ export declare class Options {
|
|
|
99
99
|
* If you want to force re-login the user.
|
|
100
100
|
*/
|
|
101
101
|
forceReset?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* If you want to throw an error if the user is not authenticated.
|
|
104
|
+
*/
|
|
105
|
+
throwError?: boolean;
|
|
102
106
|
}
|
|
103
107
|
export interface AuthRetryConfig {
|
|
104
108
|
retryCount?: number;
|
|
@@ -115,6 +119,7 @@ export interface VeltAuthProvider {
|
|
|
115
119
|
options?: Options;
|
|
116
120
|
retryConfig?: AuthRetryConfig;
|
|
117
121
|
generateToken?: () => Promise<string>;
|
|
122
|
+
onError?: (err: unknown) => void;
|
|
118
123
|
}
|
|
119
124
|
export declare enum RevokeAccessOnType {
|
|
120
125
|
DOCUMENT_UNSET = "document_unset",
|
package/app/utils/enums.d.ts
CHANGED
|
@@ -72,6 +72,10 @@ export declare const RecorderEventTypes: {
|
|
|
72
72
|
};
|
|
73
73
|
export declare const CoreEventTypes: {
|
|
74
74
|
readonly PERMISSION_PROVIDER: "permissionProvider";
|
|
75
|
+
readonly USER_RESOLVER: "userResolver";
|
|
76
|
+
readonly COMMENT_RESOLVER: "commentResolver";
|
|
77
|
+
readonly ATTACHMENT_RESOLVER: "attachmentResolver";
|
|
78
|
+
readonly REACTION_RESOLVER: "reactionResolver";
|
|
75
79
|
readonly VELT_BUTTON_CLICK: "veltButtonClick";
|
|
76
80
|
readonly USER_UPDATE: "userUpdate";
|
|
77
81
|
readonly INIT_UPDATE: "initUpdate";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veltdev/sdk",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.3",
|
|
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": [
|