@veltdev/types-dev 5.0.2-beta.15 → 5.0.2-beta.17
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.
- package/app/models/data/activity.data.model.d.ts +175 -0
- package/app/models/data/autocomplete.data.model.d.ts +3 -3
- package/app/models/data/base-metadata.data.model.d.ts +3 -0
- package/app/models/data/config.data.model.d.ts +5 -0
- package/app/models/element/crdt-element.model.d.ts +11 -0
- package/app/utils/constants.d.ts +16 -0
- package/app/utils/enums.d.ts +3 -2
- package/models.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { BaseMetadata } from './base-metadata.data.model';
|
|
3
|
+
import { User } from './user.data.model';
|
|
4
|
+
/**
|
|
5
|
+
* Feature types that can generate activities.
|
|
6
|
+
*/
|
|
7
|
+
export type ActivityFeatureType = 'comment' | 'reaction' | 'recorder' | 'crdt' | 'custom';
|
|
8
|
+
/**
|
|
9
|
+
* Comment action type constants following the `entity_type.action` naming pattern.
|
|
10
|
+
* Annotation-level actions use `comment_annotation.*`, comment-level use `comment.*`.
|
|
11
|
+
*/
|
|
12
|
+
export declare const CommentActivityActionTypes: {
|
|
13
|
+
readonly ANNOTATION_ADD: "comment_annotation.add";
|
|
14
|
+
readonly ANNOTATION_DELETE: "comment_annotation.delete";
|
|
15
|
+
readonly COMMENT_ADD: "comment.add";
|
|
16
|
+
readonly COMMENT_UPDATE: "comment.update";
|
|
17
|
+
readonly COMMENT_DELETE: "comment.delete";
|
|
18
|
+
readonly STATUS_CHANGE: "comment_annotation.status_change";
|
|
19
|
+
readonly PRIORITY_CHANGE: "comment_annotation.priority_change";
|
|
20
|
+
readonly ASSIGN: "comment_annotation.assign";
|
|
21
|
+
readonly ACCESS_MODE_CHANGE: "comment_annotation.access_mode_change";
|
|
22
|
+
readonly CUSTOM_LIST_CHANGE: "comment_annotation.custom_list_change";
|
|
23
|
+
readonly APPROVE: "comment_annotation.approve";
|
|
24
|
+
readonly ACCEPT: "comment.accept";
|
|
25
|
+
readonly REJECT: "comment.reject";
|
|
26
|
+
readonly REACTION_ADD: "comment.reaction_add";
|
|
27
|
+
readonly REACTION_DELETE: "comment.reaction_delete";
|
|
28
|
+
readonly SUBSCRIBE: "comment_annotation.subscribe";
|
|
29
|
+
readonly UNSUBSCRIBE: "comment_annotation.unsubscribe";
|
|
30
|
+
};
|
|
31
|
+
export type CommentActivityActionType = typeof CommentActivityActionTypes[keyof typeof CommentActivityActionTypes];
|
|
32
|
+
/**
|
|
33
|
+
* Recorder action type constants following the `recording.*` naming pattern.
|
|
34
|
+
*/
|
|
35
|
+
export declare const RecorderActivityActionTypes: {
|
|
36
|
+
readonly RECORDING_ADD: "recording.add";
|
|
37
|
+
readonly RECORDING_DELETE: "recording.delete";
|
|
38
|
+
};
|
|
39
|
+
export type RecorderActivityActionType = typeof RecorderActivityActionTypes[keyof typeof RecorderActivityActionTypes];
|
|
40
|
+
/**
|
|
41
|
+
* Reaction action type constants following the `reaction.*` naming pattern.
|
|
42
|
+
*/
|
|
43
|
+
export declare const ReactionActivityActionTypes: {
|
|
44
|
+
readonly REACTION_ADD: "reaction.add";
|
|
45
|
+
readonly REACTION_DELETE: "reaction.delete";
|
|
46
|
+
};
|
|
47
|
+
export type ReactionActivityActionType = typeof ReactionActivityActionTypes[keyof typeof ReactionActivityActionTypes];
|
|
48
|
+
/**
|
|
49
|
+
* CRDT action type constants following the `crdt.*` naming pattern.
|
|
50
|
+
*/
|
|
51
|
+
export declare const CrdtActivityActionTypes: {
|
|
52
|
+
readonly EDITOR_EDIT: "crdt.editor_edit";
|
|
53
|
+
};
|
|
54
|
+
export type CrdtActivityActionType = typeof CrdtActivityActionTypes[keyof typeof CrdtActivityActionTypes];
|
|
55
|
+
/**
|
|
56
|
+
* Represents a single from/to change pair.
|
|
57
|
+
* `from` is always present (null for 'added' events) for uniform structure.
|
|
58
|
+
*/
|
|
59
|
+
export interface ActivityChange<T = unknown> {
|
|
60
|
+
from?: T | null;
|
|
61
|
+
to?: T | null;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Dynamic change tracking. Keys are domain-specific (e.g., 'status', 'commentText', 'assignedTo').
|
|
65
|
+
* No fixed keys — activities span multiple features.
|
|
66
|
+
*/
|
|
67
|
+
export interface ActivityChanges {
|
|
68
|
+
[key: string]: ActivityChange | undefined;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Metadata for activity records. Extends BaseMetadata with denormalized IDs
|
|
72
|
+
* for efficient querying at the organization level.
|
|
73
|
+
*/
|
|
74
|
+
export declare class ActivityMetadata extends BaseMetadata {
|
|
75
|
+
[key: string]: any;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Core activity record representing a single activity event.
|
|
79
|
+
*
|
|
80
|
+
* @typeParam TEntity - Type of the parent entity snapshot (e.g., CommentAnnotation)
|
|
81
|
+
* @typeParam TTarget - Type of the sub-entity snapshot (e.g., Comment)
|
|
82
|
+
*/
|
|
83
|
+
export declare class ActivityRecord<TEntity = unknown, TTarget = unknown> {
|
|
84
|
+
/** Auto-generated unique ID */
|
|
85
|
+
id: string;
|
|
86
|
+
/** Feature that generated this activity */
|
|
87
|
+
featureType: ActivityFeatureType;
|
|
88
|
+
/** Action that occurred, following `entity_type.action` pattern */
|
|
89
|
+
actionType: string;
|
|
90
|
+
/** Event type that occurred */
|
|
91
|
+
eventType?: string;
|
|
92
|
+
/** User who performed the action */
|
|
93
|
+
actionUser: User;
|
|
94
|
+
/** Server timestamp (set by backend) */
|
|
95
|
+
timestamp: number;
|
|
96
|
+
/** Denormalized IDs for querying */
|
|
97
|
+
metadata: ActivityMetadata;
|
|
98
|
+
/** ID of the parent entity (annotationId, recordingId, etc.) */
|
|
99
|
+
targetEntityId: string;
|
|
100
|
+
/** ID of the sub-entity acted on (commentId within annotation, null for entity-level actions) */
|
|
101
|
+
targetSubEntityId?: string | null;
|
|
102
|
+
/** Linear-style from/to change pairs */
|
|
103
|
+
changes?: ActivityChanges;
|
|
104
|
+
/** Full parent entity snapshot at time of action */
|
|
105
|
+
entityData?: TEntity;
|
|
106
|
+
/** Sub-entity snapshot (or user-provided data for custom activities) */
|
|
107
|
+
entityTargetData?: TTarget;
|
|
108
|
+
/** Display message template — ONLY for custom activities */
|
|
109
|
+
displayMessageTemplate?: string;
|
|
110
|
+
/** Template variable values — ONLY for custom activities */
|
|
111
|
+
displayMessageTemplateData?: Record<string, unknown>;
|
|
112
|
+
/** Icon URL or identifier for display */
|
|
113
|
+
actionIcon?: string;
|
|
114
|
+
/** If true, this activity cannot be updated or deleted via REST API */
|
|
115
|
+
immutable?: boolean;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Configuration for subscribing to activities.
|
|
119
|
+
* Behavior is determined by the props passed:
|
|
120
|
+
* - No config → org-wide
|
|
121
|
+
* - documentIds → specific documents
|
|
122
|
+
* - currentDocumentOnly → current document only
|
|
123
|
+
*/
|
|
124
|
+
export interface ActivitySubscribeConfig {
|
|
125
|
+
/** Subscribe to activities for a specific organization (defaults to current org) */
|
|
126
|
+
organizationId?: string;
|
|
127
|
+
/** Subscribe to activities for specific document IDs */
|
|
128
|
+
documentIds?: string[];
|
|
129
|
+
/** Subscribe to activities for the current document only (auto-switches on setDocument) */
|
|
130
|
+
currentDocumentOnly?: boolean;
|
|
131
|
+
/** Only fetch activities from the last N days (default: 30) */
|
|
132
|
+
maxDays?: number;
|
|
133
|
+
/** Allowlist: only include activities with these feature types */
|
|
134
|
+
featureTypes?: ActivityFeatureType[];
|
|
135
|
+
/** Disallowlist: exclude activities with these feature types (ignored if featureTypes is set) */
|
|
136
|
+
excludeFeatureTypes?: ActivityFeatureType[];
|
|
137
|
+
/** Allowlist: only include activities with these action types */
|
|
138
|
+
actionTypes?: string[];
|
|
139
|
+
/** Disallowlist: exclude activities with these action types (ignored if actionTypes is set) */
|
|
140
|
+
excludeActionTypes?: string[];
|
|
141
|
+
/** Allowlist: only include activities by these user IDs */
|
|
142
|
+
userIds?: string[];
|
|
143
|
+
/** Disallowlist: exclude activities by these user IDs (ignored if userIds is set) */
|
|
144
|
+
excludeUserIds?: string[];
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Represents an active activity subscription.
|
|
148
|
+
* Returned by `activityService.subscribe()`.
|
|
149
|
+
*/
|
|
150
|
+
export interface ActivitySubscription {
|
|
151
|
+
/** Observable stream of activities for this subscription's scope. null = not yet loaded. */
|
|
152
|
+
getActivities$(): Observable<ActivityRecord[] | null>;
|
|
153
|
+
/** Unsubscribe and clean up this subscription */
|
|
154
|
+
unsubscribe(): void;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Data required to create an activity.
|
|
158
|
+
* Used for all activity types: comment, reaction, recorder, custom, etc.
|
|
159
|
+
*/
|
|
160
|
+
export interface CreateActivityData<TEntity = unknown, TTarget = unknown> {
|
|
161
|
+
featureType: ActivityFeatureType;
|
|
162
|
+
actionType: string;
|
|
163
|
+
eventType?: string;
|
|
164
|
+
targetEntityId: string;
|
|
165
|
+
targetSubEntityId?: string | null;
|
|
166
|
+
changes?: ActivityChanges;
|
|
167
|
+
entityData?: TEntity;
|
|
168
|
+
entityTargetData?: TTarget;
|
|
169
|
+
/** Icon URL or identifier — typically used for custom activities */
|
|
170
|
+
actionIcon?: string;
|
|
171
|
+
/** Display message template — only for custom activities */
|
|
172
|
+
displayMessageTemplate?: string;
|
|
173
|
+
/** Template variable values — only for custom activities */
|
|
174
|
+
displayMessageTemplateData?: Record<string, unknown>;
|
|
175
|
+
}
|
|
@@ -22,17 +22,17 @@ export declare class AutocompleteItem {
|
|
|
22
22
|
groupId?: string;
|
|
23
23
|
}
|
|
24
24
|
export declare class AutocompleteReplaceData {
|
|
25
|
-
text
|
|
25
|
+
text?: string;
|
|
26
26
|
custom: AutocompleteItem;
|
|
27
27
|
}
|
|
28
28
|
export declare class AutocompleteGroupReplaceData {
|
|
29
|
-
text
|
|
29
|
+
text?: string;
|
|
30
30
|
groupId: string;
|
|
31
31
|
clientGroupId: string;
|
|
32
32
|
group?: OrganizationUserGroup;
|
|
33
33
|
}
|
|
34
34
|
export declare class AutocompleteUserContactReplaceData {
|
|
35
|
-
text
|
|
35
|
+
text?: string;
|
|
36
36
|
userId: string;
|
|
37
37
|
contact?: UserContact;
|
|
38
38
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DocumentMetadata } from './document-metadata.model';
|
|
1
2
|
export declare class BaseMetadata {
|
|
2
3
|
apiKey?: string;
|
|
3
4
|
documentId?: string;
|
|
@@ -6,4 +7,6 @@ export declare class BaseMetadata {
|
|
|
6
7
|
clientOrganizationId?: string;
|
|
7
8
|
folderId?: string;
|
|
8
9
|
veltFolderId?: string;
|
|
10
|
+
documentMetadata?: DocumentMetadata;
|
|
11
|
+
sdkVersion?: string | null;
|
|
9
12
|
}
|
|
@@ -95,6 +95,11 @@ export declare class CrdtElement {
|
|
|
95
95
|
* @param time debounce time in milliseconds
|
|
96
96
|
*/
|
|
97
97
|
setWebhookDebounceTime: (time: number) => void;
|
|
98
|
+
/**
|
|
99
|
+
* To set activity debounce time for batching CRDT edits (Default value is 10 minutes)
|
|
100
|
+
* @param time debounce time in milliseconds (minimum: 10 seconds)
|
|
101
|
+
*/
|
|
102
|
+
setActivityDebounceTime: (time: number) => void;
|
|
98
103
|
|
|
99
104
|
/**
|
|
100
105
|
* Subscribe to crdt actions
|
|
@@ -204,6 +209,12 @@ export declare class CrdtElement {
|
|
|
204
209
|
*/
|
|
205
210
|
private _setWebhookDebounceTime;
|
|
206
211
|
|
|
212
|
+
/**
|
|
213
|
+
* Set activity debounce time for batching CRDT edits
|
|
214
|
+
* @param time debounce time in milliseconds (minimum: 10 seconds)
|
|
215
|
+
*/
|
|
216
|
+
private _setActivityDebounceTime;
|
|
217
|
+
|
|
207
218
|
/**
|
|
208
219
|
* Subscribe to crdt actions
|
|
209
220
|
* @param action Action to subscribe to
|
package/app/utils/constants.d.ts
CHANGED
|
@@ -57,6 +57,8 @@ export declare class Constants {
|
|
|
57
57
|
static FIREBASE_PARTIAL_PATH_NOTIFICATIONS: string;
|
|
58
58
|
static FIREBASE_PARTIAL_PATH_ORGANIZATION_NOTIFICATIONS: string;
|
|
59
59
|
static FIREBASE_PARTIAL_PATH_LAST_NOTIFICATION_TIMESTAMP: string;
|
|
60
|
+
static FIREBASE_PARTIAL_PATH_ACTIVITIES: string;
|
|
61
|
+
static FIREBASE_PARTIAL_PATH_LAST_ACTIVITY_TIMESTAMP: string;
|
|
60
62
|
static FIREBASE_PARTIAL_PATH_HEARTBEAT: string;
|
|
61
63
|
static FIREBASE_PARTIAL_PATH_HEARTBEAT_BY_DOCUMENT: string;
|
|
62
64
|
static FIREBASE_PARTIAL_PATH_USERS: string;
|
|
@@ -244,7 +246,21 @@ export declare class Constants {
|
|
|
244
246
|
VELT_NOTIFICATIONS_HISTORY_PANEL: string;
|
|
245
247
|
VELT_WIREFRAME: string;
|
|
246
248
|
VELT_AUTOCOMPLETE: string;
|
|
249
|
+
VELT_AUTOCOMPLETE_PANEL: string;
|
|
250
|
+
VELT_AUTOCOMPLETE_OPTION: string;
|
|
251
|
+
VELT_AUTOCOMPLETE_OPTION_ICON: string;
|
|
252
|
+
VELT_AUTOCOMPLETE_OPTION_NAME: string;
|
|
253
|
+
VELT_AUTOCOMPLETE_OPTION_DESCRIPTION: string;
|
|
254
|
+
VELT_AUTOCOMPLETE_OPTION_ERROR_ICON: string;
|
|
255
|
+
VELT_AUTOCOMPLETE_GROUP_OPTION: string;
|
|
256
|
+
VELT_AUTOCOMPLETE_TOOL: string;
|
|
257
|
+
VELT_AUTOCOMPLETE_EMPTY: string;
|
|
247
258
|
VELT_AUTOCOMPLETE_CHIP: string;
|
|
259
|
+
VELT_AUTOCOMPLETE_CHIP_TOOLTIP: string;
|
|
260
|
+
VELT_AUTOCOMPLETE_CHIP_TOOLTIP_ICON: string;
|
|
261
|
+
VELT_AUTOCOMPLETE_CHIP_TOOLTIP_NAME: string;
|
|
262
|
+
VELT_AUTOCOMPLETE_CHIP_TOOLTIP_DESCRIPTION: string;
|
|
263
|
+
VELT_AUTOCOMPLETE_CONTEXT_WRAPPER: string;
|
|
248
264
|
VELT_COMMENT_COMPOSER: string;
|
|
249
265
|
VELT_SKELETON_LOADER: string;
|
|
250
266
|
VELT_SHADOW_DOM_INTERNAL: string;
|
package/app/utils/enums.d.ts
CHANGED
|
@@ -174,7 +174,8 @@ export declare enum Features {
|
|
|
174
174
|
REWRITER = "rewriter",
|
|
175
175
|
LIVE_SELECTION = "liveSelection",
|
|
176
176
|
NOTIFICATION = "notification",
|
|
177
|
-
REACTION = "reaction"
|
|
177
|
+
REACTION = "reaction",
|
|
178
|
+
ACTIVITY = "activity"
|
|
178
179
|
}
|
|
179
180
|
export declare enum AnalyticsFeatures {
|
|
180
181
|
AREA = "area",
|
|
@@ -196,7 +197,7 @@ export declare enum AnalyticsFeatures {
|
|
|
196
197
|
INLINE_COMMENT = "inlineComment",
|
|
197
198
|
COMMENT_SIDEBAR = "commentSidebar"
|
|
198
199
|
}
|
|
199
|
-
export type FeatureType = 'area' | 'arrow' | 'audioHuddle' | 'comment' | 'cursor' | 'huddle' | 'liveStateSync' | 'presence' | 'recorder' | 'rewriter' | 'tag' | 'liveSelection' | 'notification' | 'reaction' | 'multiThread';
|
|
200
|
+
export type FeatureType = 'area' | 'arrow' | 'audioHuddle' | 'comment' | 'cursor' | 'huddle' | 'liveStateSync' | 'presence' | 'recorder' | 'rewriter' | 'tag' | 'liveSelection' | 'notification' | 'reaction' | 'multiThread' | 'activity';
|
|
200
201
|
export type AssignToType = 'dropdown' | 'checkbox';
|
|
201
202
|
export declare enum DeviceType {
|
|
202
203
|
DESKTOP = "Desktop",
|
package/models.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './app/utils/enums';
|
|
2
2
|
export * from './app/models/data/anchor-record.data.model';
|
|
3
3
|
export * from './app/models/data/attachment.model';
|
|
4
|
+
export * from './app/models/data/activity.data.model';
|
|
4
5
|
export * from './app/models/data/area-annotation.data.model';
|
|
5
6
|
export * from './app/models/data/arrow-annotation.data.model';
|
|
6
7
|
export * from './app/models/data/base-metadata.data.model';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veltdev/types-dev",
|
|
3
|
-
"version": "5.0.2-beta.
|
|
3
|
+
"version": "5.0.2-beta.17",
|
|
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": [
|