@veltdev/types 5.0.3 → 6.0.0-beta.1

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.
@@ -24,7 +24,6 @@ import { TagElement } from "../models/element/tag-element.model";
24
24
  import { FeatureType } from "../utils/enums";
25
25
  import { UserContact } from "../models/data/user-contact.data.model";
26
26
  import { DocumentMetadata } from "../models/data/document-metadata.model";
27
- import { PageInfo } from "../models/data/page-info.model";
28
27
  import { ReactionElement } from "../models/element/reaction-element.model";
29
28
  import { CrdtElement } from "../models/element/crdt-element.model";
30
29
  import { VeltEventMetadata, VeltDebugInfo } from "../models/data/event-metadata.data.model";
@@ -56,23 +55,6 @@ export declare class Snippyly {
56
55
  * @param documentMetadata Document Metadata
57
56
  */
58
57
  setDocument: (id: string, documentMetadata?: DocumentMetadata) => Promise<void>;
59
- /**
60
- * Provide custom page info that the SDK should use instead of generating it from the browser
61
- * (`window.location` / `document.title`). Newly created data (comments, reactions, recordings,
62
- * presence, cursors, etc.) will use the provided page info. Already saved/existing data is not
63
- * affected.
64
- * @param pageInfo client-provided page info
65
- * @param options optional; pass a `documentId` to scope the page info to a specific document
66
- * (per-document page info takes precedence over the global page info)
67
- */
68
- setPageInfo: (pageInfo: PageInfo, options?: { documentId?: string; }) => void;
69
- /**
70
- * Clear custom page info previously set via `setPageInfo`. The SDK will resume generating
71
- * page info from the browser.
72
- * @param options optional; pass a `documentId` to clear only that document's page info,
73
- * otherwise the global page info is cleared
74
- */
75
- clearPageInfo: (options?: { documentId?: string; }) => void;
76
58
  /**
77
59
  * Tell us the unique ID of the current document/resource on which you want to enable collaboration.
78
60
  * @param id unique document ID
@@ -1,9 +1,9 @@
1
- import { AnnotationProperty } from "./annotation-property.data.model";
2
- import { CursorPosition } from "./cursor-position.data.model";
3
- import { Location } from "./location.model";
4
- import { PageInfo } from "./page-info.model";
5
- import { TargetElement } from "./target-element.data.model";
6
- import { User } from "./user.data.model";
1
+ import { AnnotationProperty } from "../../../models/data/annotation-property.data.model";
2
+ import { CursorPosition } from "../../../models/data/cursor-position.data.model";
3
+ import { Location } from "../../../models/data/location.model";
4
+ import { PageInfo } from "../../../models/data/page-info.model";
5
+ import { TargetElement } from "../../../models/data/target-element.data.model";
6
+ import { User } from "../../../models/data/user.data.model";
7
7
  export declare class ArrowAnnotation {
8
8
  /**
9
9
  * Unique identifier for the arrow pin annotation.
@@ -0,0 +1,37 @@
1
+ import { DocumentMetadata } from "../../../models/data/document-metadata.model";
2
+ import { PageInfo } from "../../../models/data/page-info.model";
3
+ import { User } from "../../../models/data/user.data.model";
4
+ export declare class UserRequest {
5
+ /**
6
+ * Unique id of the feedback
7
+ */
8
+ id?: string;
9
+ /**
10
+ * apiKey of the client
11
+ */
12
+ apiKey?: string | null;
13
+ /**
14
+ * Email id of the feedback giver
15
+ */
16
+ emailId?: string;
17
+ /**
18
+ * Message given by the user
19
+ */
20
+ message?: string;
21
+ /**
22
+ * User who added the feedback
23
+ */
24
+ from?: User | null;
25
+ /**
26
+ * Date when the feedback was added
27
+ */
28
+ lastUpdated?: any;
29
+ /**
30
+ * Document metadata
31
+ */
32
+ metadata?: DocumentMetadata | null;
33
+ /**
34
+ * User's page info
35
+ */
36
+ pageInfo?: PageInfo;
37
+ }
@@ -15,6 +15,13 @@ import { CommentAnnotationViews } from "./views.data.model";
15
15
  export interface CommentAnnotationVisibilityConfig {
16
16
  type: CommentVisibilityType;
17
17
  organizationId?: string;
18
+ /** Organization IDs for 'organizationPrivate' visibility — mirrors CommentVisibilityConfig.organizationIds (display-only). */
19
+ organizationIds?: string[];
20
+ /**
21
+ * User IDs that can see the comment (display-only mirror of the self tokens in
22
+ * `context.accessFields`). For non-public comments this ALWAYS includes the author's
23
+ * userId, reflecting the author self-token invariant (AC-002).
24
+ */
18
25
  userIds?: string[];
19
26
  }
20
27
  /**
@@ -1,4 +1,4 @@
1
- import { ResolverActions } from "../../utils/enums";
1
+ import { ResolverActions, CommentResolverSaveEvent } from "../../utils/enums";
2
2
  import { PartialAttachment } from "./attachment-resolver.data.model";
3
3
  import { BaseMetadata } from "./base-metadata.data.model";
4
4
  import { CommentAnnotation } from "./comment-annotation.data.model";
@@ -25,9 +25,21 @@ export interface SaveCommentResolverRequest {
25
25
  commentAnnotation: {
26
26
  [key: string]: PartialCommentAnnotation;
27
27
  };
28
- event?: ResolverActions;
28
+ /**
29
+ * The save event. One of the 4 core PII events (`ResolverActions`) or, when the customer
30
+ * opts in via `ResolverConfig.additionalSaveEvents`, a non-core annotation-level event
31
+ * (`CommentResolverSaveEvent`). See specs/comment-resolver iteration-2.
32
+ */
33
+ event?: ResolverActions | CommentResolverSaveEvent;
29
34
  metadata?: BaseMetadata;
30
35
  commentId?: string;
36
+ /**
37
+ * The comment the action occurred on, resolved from `commentId` against the
38
+ * payload's `commentAnnotation[*].comments` map. Convenience field so the
39
+ * customer backend does not have to re-derive the target comment from
40
+ * `commentId`. Omitted when `commentId` is absent or no matching comment is found.
41
+ */
42
+ targetComment?: PartialComment;
31
43
  }
32
44
  export interface PartialUser {
33
45
  userId: string;
@@ -53,7 +65,7 @@ export interface PartialCommentAnnotationResult {
53
65
  [annotationId: string]: PartialCommentAnnotation;
54
66
  } | null;
55
67
  originalData: CommentAnnotation | null;
56
- eventType?: ResolverActions;
68
+ eventType?: ResolverActions | CommentResolverSaveEvent;
57
69
  }
58
70
  export interface PartialTargetTextRange {
59
71
  text: string;
@@ -1,6 +1,20 @@
1
+ import { CommentResolverSaveEvent } from "../../utils/enums";
1
2
  export interface ResolverEndpointConfig {
2
3
  url: string;
3
- headers?: Record<string, string>;
4
+ /**
5
+ * Request headers. Either a static object (captured once) OR an async function
6
+ * resolved on EVERY request — use the function form to forward a short-lived
7
+ * per-user token (re-evaluated per retry attempt, so each retry gets a fresh token).
8
+ */
9
+ headers?: Record<string, string> | (() => Promise<Record<string, string>>);
10
+ /**
11
+ * Forwarded to `fetch()` so cookie/session auth works for resolver endpoints.
12
+ * When unset the `credentials` key is omitted from the request, so `fetch` keeps
13
+ * its browser default of `'same-origin'` — byte-identical to the prior behavior
14
+ * (same-origin cookies are still sent). Set `'include'` for cross-origin cookie/
15
+ * session auth, or `'omit'` to explicitly suppress credentials.
16
+ */
17
+ credentials?: 'include' | 'same-origin' | 'omit';
4
18
  }
5
19
  export interface ResolverConfig {
6
20
  resolveTimeout?: number;
@@ -10,10 +24,21 @@ export interface ResolverConfig {
10
24
  resolveUsersConfig?: ResolveUsersConfig;
11
25
  fieldsToRemove?: string[];
12
26
  additionalFields?: string[];
27
+ /**
28
+ * Opt-in list of additional (non-core) annotation-level save events the customer
29
+ * wants delivered to the existing save endpoint, beyond the 4 core PII events
30
+ * (add/update/delete). Each entry's `event` is a `CommentResolverSaveEvent`.
31
+ * Array-of-objects for forward-extensibility. Absent/empty ⇒ iteration-1 behavior
32
+ * (no extra events) — see specs/comment-resolver iteration-2.
33
+ */
34
+ additionalSaveEvents?: AdditionalSaveEventConfig[];
13
35
  getConfig?: ResolverEndpointConfig;
14
36
  saveConfig?: ResolverEndpointConfig;
15
37
  deleteConfig?: ResolverEndpointConfig;
16
38
  }
39
+ export interface AdditionalSaveEventConfig {
40
+ event: CommentResolverSaveEvent;
41
+ }
17
42
  export interface ResolveUsersConfig {
18
43
  organization?: boolean;
19
44
  folder?: boolean;
@@ -1,3 +1,3 @@
1
- import { UserRequest } from "./user-request.data.model";
1
+ import { UserRequest } from "../../features/user-request/models/user-request.data.model";
2
2
  export declare class UserContactUs extends UserRequest {
3
3
  }
@@ -1,3 +1,3 @@
1
- import { UserRequest } from "./user-request.data.model";
1
+ import { UserRequest } from "../../features/user-request/models/user-request.data.model";
2
2
  export declare class UserFeedback extends UserRequest {
3
3
  }
@@ -1,3 +1,3 @@
1
- import { UserRequest } from "./user-request.data.model";
1
+ import { UserRequest } from "../../features/user-request/models/user-request.data.model";
2
2
  export declare class UserReportBug extends UserRequest {
3
3
  }
@@ -948,8 +948,6 @@ export declare class CommentElement {
948
948
  * To disable collapsed comment
949
949
  */
950
950
  public disableCollapsedComments: () => void;
951
- public enableCollapsedRepliesPreview: () => void;
952
- public disableCollapsedRepliesPreview: () => void;
953
951
 
954
952
  /**
955
953
  * To enable query params comments
@@ -2300,8 +2298,6 @@ export declare class CommentElement {
2300
2298
  * To disable collapsed comment
2301
2299
  */
2302
2300
  private _disableCollapsedComments;
2303
- private _enableCollapsedRepliesPreview;
2304
- private _disableCollapsedRepliesPreview;
2305
2301
 
2306
2302
  /**
2307
2303
  * To enable query params comments
@@ -1,6 +1,6 @@
1
1
  // @ts-nocheck
2
2
 
3
- import { CrossOrganizationConfig, GetNotificationsDataQuery, Notification, NotificationInitialSettingsConfig, NotificationSettingsConfig, NotificationTabConfig } from "../data/notification.model";
3
+ import { GetNotificationsDataQuery, Notification, NotificationInitialSettingsConfig, NotificationSettingsConfig, NotificationTabConfig } from "../data/notification.model";
4
4
 
5
5
  export declare class NotificationElement {
6
6
  /**
@@ -128,16 +128,6 @@ export declare class NotificationElement {
128
128
  */
129
129
  disableCurrentDocumentOnly: () => void;
130
130
 
131
- /**
132
- * Opt in to cross-organization "For You" notifications.
133
- */
134
- enableCrossOrganization: (config?: CrossOrganizationConfig | null) => void;
135
-
136
- /**
137
- * Opt out of cross-organization "For You" notifications.
138
- */
139
- disableCrossOrganization: () => void;
140
-
141
131
  constructor();
142
132
 
143
133
  /**
@@ -264,8 +254,4 @@ export declare class NotificationElement {
264
254
  * To disable current document only
265
255
  */
266
256
  private _disableCurrentDocumentOnly;
267
-
268
- private _enableCrossOrganization;
269
-
270
- private _disableCrossOrganization;
271
257
  }
@@ -203,8 +203,11 @@ export declare class Constants {
203
203
  VELT_TAGS: string;
204
204
  VELT_RECORDER_NOTES: string;
205
205
  VELT_RECORDER_CONTROL_PANEL: string;
206
- VELT_RECORDER_CONTROL_PANEL_INTERNAL: string;
206
+ VELT_RECORDER_CONTROL_PANEL_EMBED: string;
207
+ SNIPPYLY_RECORDER_CONTROL_PANEL_EMBED: string;
207
208
  VELT_RECORDER_PLAYER: string;
209
+ VELT_RECORDER_PLAYER_EMBED: string;
210
+ SNIPPYLY_RECORDER_PLAYER_EMBED: string;
208
211
  VELT_VIDEO_EDITOR: string;
209
212
  VELT_TEXT_HIGHLIGHT: string;
210
213
  VELT_COMMENT_TEXT_PORTAL: string;
@@ -271,6 +274,8 @@ export declare class Constants {
271
274
  VELT_COMMENT_BUBBLE_UNREAD_ICON: string;
272
275
  VELT_COMMENT_THREAD: string;
273
276
  VELT_COMMENT_PIN: string;
277
+ VELT_COMMENT_PIN_EMBED: string;
278
+ SNIPPYLY_COMMENT_PIN_EMBED: string;
274
279
  VELT_COMMENT_PIN_NUMBER: string;
275
280
  VELT_COMMENT_PIN_INDEX: string;
276
281
  VELT_COMMENT_PIN_TRIANGLE: string;
@@ -332,7 +337,11 @@ export declare class Constants {
332
337
  VELT_VIDEO_PLAYER: string;
333
338
  VELT_VIDEO_COMMENTS_TIMELINE: string;
334
339
  VELT_REACTION_TOOL: string;
340
+ SNIPPYLY_REACTION_TOOL: string;
341
+ VELT_REACTION_PIN: string;
342
+ SNIPPYLY_REACTION_PIN: string;
335
343
  VELT_INLINE_REACTIONS_SECTION: string;
344
+ SNIPPYLY_INLINE_REACTIONS_SECTION: string;
336
345
  VELT_VIEW_ANALYTICS: string;
337
346
  VELT_NOTIFICATIONS_TOOL: string;
338
347
  VELT_NOTIFICATIONS_TOOL_ICON: string;
@@ -33,6 +33,31 @@ export declare enum ResolverActions {
33
33
  RECORDER_ANNOTATION_DELETE = "recorder_annotation.delete",
34
34
  ACTIVITY_SAVE = "activity.save"
35
35
  }
36
+ /**
37
+ * Opt-in additional (non-core) comment save events for the Comment Annotations Resolver
38
+ * (specs/comment-resolver iteration-2). Values mirror the non-core `CommentActivityActionTypes`
39
+ * (single source of truth — enforced by a unit test). A self-hosting customer lists these in
40
+ * `ResolverConfig.additionalSaveEvents` to also receive annotation-level events (status change,
41
+ * priority change, assign, …) on the existing save endpoint. The 4 core events keep using
42
+ * `ResolverActions`. Kept in enums.ts (a leaf module) to avoid a
43
+ * resolver.data.model ↔ comment-resolver.data.model import cycle.
44
+ */
45
+ export declare enum CommentResolverSaveEvent {
46
+ STATUS_CHANGE = "comment_annotation.status_change",
47
+ PRIORITY_CHANGE = "comment_annotation.priority_change",
48
+ ASSIGN = "comment_annotation.assign",
49
+ ACCESS_MODE_CHANGE = "comment_annotation.access_mode_change",
50
+ CUSTOM_LIST_CHANGE = "comment_annotation.custom_list_change",
51
+ APPROVE = "comment_annotation.approve",
52
+ ACCEPT = "comment.accept",
53
+ REJECT = "comment.reject",
54
+ SUGGESTION_ACCEPT = "comment_annotation.suggestion_accept",
55
+ SUGGESTION_REJECT = "comment_annotation.suggestion_reject",
56
+ REACTION_ADD = "comment.reaction_add",
57
+ REACTION_DELETE = "comment.reaction_delete",
58
+ SUBSCRIBE = "comment_annotation.subscribe",
59
+ UNSUBSCRIBE = "comment_annotation.unsubscribe"
60
+ }
36
61
  export declare const CommentEventTypes: {
37
62
  readonly ADD_COMMENT_ANNOTATION: "addCommentAnnotation";
38
63
  readonly ADD_COMMENT_ANNOTATION_DRAFT: "addCommentAnnotationDraft";
@@ -199,7 +224,12 @@ export declare enum Features {
199
224
  LIVE_SELECTION = "liveSelection",
200
225
  NOTIFICATION = "notification",
201
226
  REACTION = "reaction",
202
- ACTIVITY = "activity"
227
+ ACTIVITY = "activity",
228
+ VIEWS = "views",
229
+ USER_INVITE = "userInvite",
230
+ USER_REQUEST = "userRequest",
231
+ VIDEO_PLAYER = "videoPlayer",
232
+ CRDT = "crdt"
203
233
  }
204
234
  export declare enum AnalyticsFeatures {
205
235
  AREA = "area",
@@ -221,7 +251,7 @@ export declare enum AnalyticsFeatures {
221
251
  INLINE_COMMENT = "inlineComment",
222
252
  COMMENT_SIDEBAR = "commentSidebar"
223
253
  }
224
- export type FeatureType = 'area' | 'arrow' | 'audioHuddle' | 'comment' | 'cursor' | 'huddle' | 'liveStateSync' | 'presence' | 'recorder' | 'rewriter' | 'tag' | 'liveSelection' | 'notification' | 'reaction' | 'multiThread' | 'activity';
254
+ export type FeatureType = 'area' | 'arrow' | 'audioHuddle' | 'comment' | 'cursor' | 'huddle' | 'liveStateSync' | 'presence' | 'recorder' | 'rewriter' | 'tag' | 'liveSelection' | 'notification' | 'reaction' | 'multiThread' | 'activity' | 'views' | 'userInvite' | 'userRequest' | 'videoPlayer' | 'crdt';
225
255
  export type AssignToType = 'dropdown' | 'checkbox';
226
256
  export declare enum DeviceType {
227
257
  DESKTOP = "Desktop",
package/models.d.ts CHANGED
@@ -3,7 +3,7 @@ export * from './app/models/data/anchor-record.data.model';
3
3
  export * from './app/models/data/attachment.model';
4
4
  export * from './app/models/data/activity.data.model';
5
5
  export * from './app/models/data/area-annotation.data.model';
6
- export * from './app/models/data/arrow-annotation.data.model';
6
+ export * from './app/features/arrow/models/arrow-annotation.model';
7
7
  export * from './app/models/data/agent-suggestion.data.model';
8
8
  export * from './app/models/data/base-metadata.data.model';
9
9
  export * from './app/models/data/button.data.model';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veltdev/types",
3
- "version": "5.0.3",
3
+ "version": "6.0.0-beta.1",
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": [
package/types.d.ts CHANGED
@@ -14,7 +14,6 @@ export * from './app/models/element/selection-element.model';
14
14
  export * from './app/models/element/tag-element.model';
15
15
  export * from './app/models/element/views-element.model';
16
16
  export * from './app/models/element/notification-element.model';
17
- export * from './app/models/element/cross-organization-config.model';
18
17
  export * from './app/models/element/autocomplete-element.model';
19
18
  export * from './app/models/element/reaction-element.model';
20
19
  export * from './app/models/element/crdt-element.model';