@veltdev/sdk 4.6.0-beta.1 → 4.6.0-beta.2
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.
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { CoreEventTypes } from "../../utils/enums";
|
|
2
2
|
import { VeltButtonClickEvent } from "./button.data.model";
|
|
3
|
-
import { User } from "./user.data.model";
|
|
3
|
+
import { PermissionSource, User } from "./user.data.model";
|
|
4
4
|
export type CoreEventTypesMap = {
|
|
5
|
+
[CoreEventTypes.PERMISSION_PROVIDER]: PermissionProviderEvent;
|
|
5
6
|
[CoreEventTypes.VELT_BUTTON_CLICK]: VeltButtonClickEvent;
|
|
6
7
|
[CoreEventTypes.USER_UPDATE]: UserUpdateEvent;
|
|
7
8
|
[CoreEventTypes.DOCUMENT_INIT]: DocumentInitEvent;
|
|
@@ -10,12 +11,47 @@ export type CoreEventTypesMap = {
|
|
|
10
11
|
};
|
|
11
12
|
export type UserUpdateEvent = User | null;
|
|
12
13
|
export type DocumentInitEvent = boolean | undefined;
|
|
14
|
+
export type PermissionProviderEvent = {
|
|
15
|
+
event: PermissionProviderEventType;
|
|
16
|
+
methodName?: PermissionSource;
|
|
17
|
+
source?: 'internal' | 'external';
|
|
18
|
+
timestamp?: number;
|
|
19
|
+
uniqueId?: string;
|
|
20
|
+
payload?: any;
|
|
21
|
+
};
|
|
22
|
+
export type PermissionProviderEventType = {
|
|
23
|
+
RESOURCE_ACCESS_REQUEST_FORMED: 'resourceAccessRequestFormed';
|
|
24
|
+
RESOURCE_ACCESS_REQUEST_TRIGGERED: 'resourceAccessRequestTriggered';
|
|
25
|
+
RESOURCE_ACCESS_RESULT: 'resourceAccessResult';
|
|
26
|
+
RESOURCE_ACCESS_ERROR: 'resourceAccessError';
|
|
27
|
+
RESOURCE_ACCESS_RESULT_FROM_CACHE: 'resourceAccessResultFromCache';
|
|
28
|
+
};
|
|
13
29
|
export type ErrorEvent = {
|
|
30
|
+
event?: string;
|
|
31
|
+
sourceMethod?: string;
|
|
32
|
+
documentIds?: string[];
|
|
33
|
+
userId?: string;
|
|
34
|
+
timestamp?: number;
|
|
14
35
|
error?: string;
|
|
15
|
-
code
|
|
36
|
+
code?: string;
|
|
16
37
|
message?: string;
|
|
17
38
|
source?: string;
|
|
18
39
|
};
|
|
40
|
+
export declare enum InitUpdateMethodNames {
|
|
41
|
+
SET_DOCUMENTS = "setDocuments",
|
|
42
|
+
SET_ROOT_DOCUMENT = "setRootDocument",
|
|
43
|
+
SET_DOCUMENT_ID = "setDocumentId",
|
|
44
|
+
UNSET_DOCUMENT_ID = "unsetDocumentId",
|
|
45
|
+
UNSET_DOCUMENTS = "unsetDocuments",
|
|
46
|
+
SET_LOCATION = "setLocation",
|
|
47
|
+
SET_LOCATIONS = "setLocations",
|
|
48
|
+
SET_ROOT_LOCATION = "setRootLocation",
|
|
49
|
+
ADD_LOCATION = "addLocation",
|
|
50
|
+
REMOVE_LOCATION = "removeLocation",
|
|
51
|
+
REMOVE_LOCATIONS = "removeLocations",
|
|
52
|
+
UNSET_LOCATION_IDS = "unsetLocationIds",
|
|
53
|
+
REMOVE_LOCATIONS_SUCCESS = "removeLocationsSuccess"
|
|
54
|
+
}
|
|
19
55
|
export type InitUpdateEvent = {
|
|
20
56
|
event: string;
|
|
21
57
|
methodName?: string;
|
|
@@ -124,7 +124,9 @@ export declare enum PermissionSource {
|
|
|
124
124
|
SET_DOCUMENTS = "setDocuments",
|
|
125
125
|
IDENTIFY = "identify",
|
|
126
126
|
GET_NOTIFICATIONS = "getNotifications",
|
|
127
|
-
SET_NOTIFICATIONS = "setNotifications"
|
|
127
|
+
SET_NOTIFICATIONS = "setNotifications",
|
|
128
|
+
REVOKE_ACCESS_ON_USER_LOGOUT = "revokeAccessOnUserLogout",
|
|
129
|
+
REVOKE_ACCESS_ON_DOCUMENT_UNSET = "revokeAccessOnDocumentUnset"
|
|
128
130
|
}
|
|
129
131
|
export interface RevokeAccessOn {
|
|
130
132
|
type: RevokeAccessOnType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veltdev/sdk",
|
|
3
|
-
"version": "4.6.0-beta.
|
|
3
|
+
"version": "4.6.0-beta.2",
|
|
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": [
|