@veltdev/sdk-dev 6.0.0-beta.1 → 6.0.0-beta.11

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.
Files changed (86) hide show
  1. package/app/client/snippyly.model.d.ts +2 -3
  2. package/app/models/data/comment-annotation.data.model.d.ts +7 -0
  3. package/app/models/data/comment-events.data.model.d.ts +29 -0
  4. package/app/models/data/comment-resolver.data.model.d.ts +15 -3
  5. package/app/models/data/resolver.data.model.d.ts +26 -1
  6. package/app/models/data/selection.model.d.ts +10 -8
  7. package/app/models/data/user-resolver.data.model.d.ts +11 -9
  8. package/app/models/data/user.data.model.d.ts +21 -18
  9. package/app/models/element/activity-element.model.d.ts +0 -1
  10. package/app/models/element/area-element.model.d.ts +0 -1
  11. package/app/models/element/arrow-element.model.d.ts +1 -2
  12. package/app/models/element/autocomplete-element.model.d.ts +0 -1
  13. package/app/models/element/comment-element.model.d.ts +77 -76
  14. package/app/models/element/contact-element.model.d.ts +1 -2
  15. package/app/models/element/crdt-element.model.d.ts +1 -1
  16. package/app/models/element/cursor-element.model.d.ts +1 -2
  17. package/app/models/element/huddle-element.model.d.ts +1 -2
  18. package/app/models/element/live-state-sync-element.model.d.ts +1 -1
  19. package/app/models/element/notification-element.model.d.ts +1 -1
  20. package/app/models/element/presence-element.model.d.ts +2 -3
  21. package/app/models/element/reaction-element.model.d.ts +1 -1
  22. package/app/models/element/recorder-element.model.d.ts +1 -2
  23. package/app/models/element/rewriter-element.model.d.ts +0 -1
  24. package/app/models/element/selection-element.model.d.ts +1 -1
  25. package/app/models/element/suggestion-element.model.d.ts +0 -1
  26. package/app/models/element/tag-element.model.d.ts +7 -8
  27. package/app/models/element/views-element.model.d.ts +1 -1
  28. package/app/utils/enums.d.ts +104 -66
  29. package/{chunk-PTTRYFYB.js → chunk-45AFLSTN.js} +1 -1
  30. package/{chunk-G46CTA6V.js → chunk-4AUKSZTD.js} +1 -1
  31. package/chunk-4FFPMABU.js +167 -0
  32. package/{chunk-X453UEMY.js → chunk-4NYJX2TA.js} +1 -1
  33. package/{chunk-UZJTB2H6.js → chunk-6CQP35TI.js} +1 -1
  34. package/{chunk-3KN3NYZR.js → chunk-6RE7E4UI.js} +1 -1
  35. package/{chunk-OQBVT36K.js → chunk-7BJOXXKB.js} +1 -1
  36. package/{chunk-WYMNU2Q5.js → chunk-7DJ6FAQU.js} +1 -1
  37. package/{chunk-BRIJGI4O.js → chunk-AE3HAZZP.js} +1 -1
  38. package/{chunk-X3GYH6JJ.js → chunk-B7JEFRI6.js} +1 -1
  39. package/{chunk-2MCCXRU6.js → chunk-BVOAAUMF.js} +1 -1
  40. package/{chunk-RFW75IKO.js → chunk-BYPLI57L.js} +1 -1
  41. package/{chunk-2BDYFELB.js → chunk-DC4XY76Y.js} +1 -1
  42. package/{chunk-IYJWYBXI.js → chunk-DNV5AXVR.js} +1 -1
  43. package/{chunk-C63JXSXB.js → chunk-EHFD7BDQ.js} +1 -1
  44. package/{chunk-P7SXN2XF.js → chunk-HXLFHQKR.js} +1 -1
  45. package/{chunk-YD4VUEL4.js → chunk-IYGDKLQF.js} +1 -1
  46. package/{chunk-PROSLKM3.js → chunk-JDRVES6B.js} +1 -1
  47. package/{chunk-ZI5OOBWM.js → chunk-JSM7AZPO.js} +1 -1
  48. package/{chunk-S4AU5GVL.js → chunk-K6LMPDA2.js} +1 -1
  49. package/chunk-KYM4A3Y5.js +193 -0
  50. package/{chunk-V2COGSFG.js → chunk-MX3IHG3M.js} +1 -1
  51. package/{chunk-JNJEOJET.js → chunk-NFB2QFWZ.js} +1 -1
  52. package/{chunk-FKZM4T63.js → chunk-PKSCPPL3.js} +1 -1
  53. package/{chunk-5ZWGZNCN.js → chunk-POOMHZRV.js} +1 -1
  54. package/{chunk-6NYVF3UW.js → chunk-RA6SFDHP.js} +1 -1
  55. package/{chunk-NVFQYVI5.js → chunk-RMNTICFD.js} +1 -1
  56. package/{chunk-HPCLPNY3.js → chunk-TRRDAYZ3.js} +1 -1
  57. package/{chunk-KFXLOTXX.js → chunk-TTTPO3O7.js} +1 -1
  58. package/{chunk-3RQKSLIV.js → chunk-XBIYBLRP.js} +1 -1
  59. package/{chunk-P2263MG2.js → chunk-YWIE7OOR.js} +1 -1
  60. package/{chunk-4HGZF7YE.js → chunk-ZINOKO4N.js} +1 -1
  61. package/{chunk-LXSCD43J.js → chunk-ZJBVC654.js} +1 -1
  62. package/package.json +1 -1
  63. package/types.d.ts +22 -22
  64. package/velt-activity-log.js +1 -1
  65. package/velt-area.js +1 -1
  66. package/velt-arrow.js +1 -1
  67. package/velt-comment.js +8 -8
  68. package/velt-crdt.js +1 -1
  69. package/velt-cursor.js +1 -1
  70. package/velt-huddle.js +1 -1
  71. package/velt-live-state-sync.js +1 -1
  72. package/velt-notification.js +1 -1
  73. package/velt-presence.js +1 -1
  74. package/velt-reaction.js +1 -1
  75. package/velt-recorder.js +1 -1
  76. package/velt-rewriter.js +1 -1
  77. package/velt-selection.js +1 -1
  78. package/velt-tag.js +1 -1
  79. package/velt-user-invite.js +1 -1
  80. package/velt-user-request.js +1 -1
  81. package/velt-video-player.js +1 -1
  82. package/velt-views.js +1 -1
  83. package/velt.d.ts +2 -3
  84. package/velt.js +9 -11
  85. package/chunk-GD4JQQR2.js +0 -167
  86. package/chunk-MEV4PQAP.js +0 -193
@@ -1,9 +1,8 @@
1
- // @ts-nocheck
2
1
  import { Observable } from "rxjs";
3
2
  import { Config, DisableLogsConfig } from "../models/data/config.data.model";
4
3
  import { DocumentUser } from "../models/data/document-user.data.model";
5
4
  import { Location } from "../models/data/location.model";
6
- import { User, UserOptions, VeltAuthProvider, VeltPermissionProvider } from "../models/data/user.data.model";
5
+ import { User, Options, VeltAuthProvider, VeltPermissionProvider } from "../models/data/user.data.model";
7
6
  import { CustomCss } from "../models/data/custom-css.data.model";
8
7
  import { ActivityElement } from "../models/element/activity-element.model";
9
8
  import { AreaElement } from "../models/element/area-element.model";
@@ -40,7 +39,7 @@ import { HeartbeatConfig, Heartbeat, GetHeartbeatResponse } from "../models/data
40
39
  export declare class Snippyly {
41
40
  constructor();
42
41
  initConfig: (apiKey: string, config?: Config) => void;
43
- identify: (user: User, userOptions?: UserOptions) => Promise<unknown>;
42
+ identify: (user: User, userOptions?: Options) => Promise<unknown>;
44
43
  setVeltAuthProvider: (veltAuthProvider: VeltAuthProvider) => Promise<User | null>;
45
44
  /**
46
45
  * Tell us who the currently logged in user is.
@@ -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
  /**
@@ -89,6 +89,10 @@ export type CommentEventTypesMap = {
89
89
  [CommentEventTypes.COMMENT_TOOL_CLICKED]: CommentToolClickedEvent;
90
90
  [CommentEventTypes.SIDEBAR_BUTTON_CLICK]: SidebarButtonClickEvent;
91
91
  [CommentEventTypes.SIDEBAR_BUTTON_CLICKED]: SidebarButtonClickedEvent;
92
+ [CommentEventTypes.SIDEBAR_OPEN]: SidebarOpenEvent;
93
+ [CommentEventTypes.SIDEBAR_CLOSE]: SidebarCloseEvent;
94
+ [CommentEventTypes.COMMENT_CLICK]: CommentClickEvent;
95
+ [CommentEventTypes.COMMENT_NAVIGATION_BUTTON_CLICK]: CommentNavigationButtonClickEvent;
92
96
  [CommentEventTypes.ATTACHMENT_DOWNLOAD_CLICKED]: AttachmentDownloadClickedEvent;
93
97
  [CommentEventTypes.COMMENT_SAVED]: CommentSavedEvent;
94
98
  [CommentEventTypes.COMMENT_SAVE_TRIGGERED]: CommentSaveTriggeredEvent;
@@ -347,6 +351,31 @@ export interface SidebarButtonClickEvent {
347
351
  }
348
352
  export interface SidebarButtonClickedEvent extends SidebarButtonClickEvent {
349
353
  }
354
+ /** Fired when the comment sidebar opens. Subscribe via `commentElement.on('sidebarOpen')`. */
355
+ export interface SidebarOpenEvent {
356
+ metadata?: VeltEventMetadata;
357
+ }
358
+ /** Fired when the comment sidebar closes. Subscribe via `commentElement.on('sidebarClose')`. */
359
+ export interface SidebarCloseEvent {
360
+ metadata?: VeltEventMetadata;
361
+ }
362
+ /** Fired when a comment is clicked in the sidebar list. Subscribe via `commentElement.on('commentClick')`. */
363
+ export interface CommentClickEvent {
364
+ documentId?: string | null;
365
+ location?: Location | null;
366
+ targetElementId?: string | null;
367
+ context?: {
368
+ [key: string]: any;
369
+ };
370
+ annotation?: CommentAnnotation;
371
+ metadata?: VeltEventMetadata;
372
+ }
373
+ /**
374
+ * Fired when the navigation ("go to") button on a sidebar comment is clicked.
375
+ * Subscribe via `commentElement.on('commentNavigationButtonClick')`.
376
+ */
377
+ export interface CommentNavigationButtonClickEvent extends CommentClickEvent {
378
+ }
350
379
  export interface AttachmentDownloadClickedEvent {
351
380
  annotationId: string;
352
381
  commentAnnotation: CommentAnnotation;
@@ -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;
@@ -21,14 +21,16 @@ export declare class Selection {
21
21
  pageInfo: PageInfo;
22
22
  timestamp: number;
23
23
  }
24
- export declare enum UserIndicatorPosition {
25
- Start = "start",
26
- End = "end"
27
- }
28
- export declare enum UserIndicatorType {
29
- Avatar = "avatar",
30
- Label = "label"
31
- }
24
+ export declare const UserIndicatorPosition: {
25
+ readonly Start: "start";
26
+ readonly End: "end";
27
+ };
28
+ export type UserIndicatorPosition = (typeof UserIndicatorPosition)[keyof typeof UserIndicatorPosition];
29
+ export declare const UserIndicatorType: {
30
+ readonly Avatar: "avatar";
31
+ readonly Label: "label";
32
+ };
33
+ export type UserIndicatorType = (typeof UserIndicatorType)[keyof typeof UserIndicatorType];
32
34
  export declare class LiveSelectionData {
33
35
  [userIdHash: string]: Selection;
34
36
  }
@@ -61,12 +61,14 @@ export interface GetUserPermissionsResponse {
61
61
  };
62
62
  };
63
63
  }
64
- export declare enum UserPermissionAccessRole {
65
- EDITOR = "editor",
66
- VIEWER = "viewer"
67
- }
68
- export declare enum UserPermissionAccessRoleResult {
69
- DOES_NOT_EXIST = "does_not_exist",
70
- PERMISSION_DENIED = "permission_denied",
71
- SOMETHING_WENT_WRONG = "something_went_wrong"
72
- }
64
+ export declare const UserPermissionAccessRole: {
65
+ readonly EDITOR: "editor";
66
+ readonly VIEWER: "viewer";
67
+ };
68
+ export type UserPermissionAccessRole = (typeof UserPermissionAccessRole)[keyof typeof UserPermissionAccessRole];
69
+ export declare const UserPermissionAccessRoleResult: {
70
+ readonly DOES_NOT_EXIST: "does_not_exist";
71
+ readonly PERMISSION_DENIED: "permission_denied";
72
+ readonly SOMETHING_WENT_WRONG: "something_went_wrong";
73
+ };
74
+ export type UserPermissionAccessRoleResult = (typeof UserPermissionAccessRoleResult)[keyof typeof UserPermissionAccessRoleResult];
@@ -125,18 +125,20 @@ export interface VeltAuthProvider {
125
125
  generateToken?: () => Promise<string>;
126
126
  onError?: (err: unknown) => void;
127
127
  }
128
- export declare enum RevokeAccessOnType {
129
- DOCUMENT_UNSET = "document_unset",
130
- USER_LOGOUT = "user_logout"
131
- }
132
- export declare enum PermissionSource {
133
- SET_DOCUMENTS = "setDocuments",
134
- IDENTIFY = "identify",
135
- GET_NOTIFICATIONS = "getNotifications",
136
- SET_NOTIFICATIONS = "setNotifications",
137
- REVOKE_ACCESS_ON_USER_LOGOUT = "revokeAccessOnUserLogout",
138
- REVOKE_ACCESS_ON_DOCUMENT_UNSET = "revokeAccessOnDocumentUnset"
139
- }
128
+ export declare const RevokeAccessOnType: {
129
+ readonly DOCUMENT_UNSET: "document_unset";
130
+ readonly USER_LOGOUT: "user_logout";
131
+ };
132
+ export type RevokeAccessOnType = (typeof RevokeAccessOnType)[keyof typeof RevokeAccessOnType];
133
+ export declare const PermissionSource: {
134
+ readonly SET_DOCUMENTS: "setDocuments";
135
+ readonly IDENTIFY: "identify";
136
+ readonly GET_NOTIFICATIONS: "getNotifications";
137
+ readonly SET_NOTIFICATIONS: "setNotifications";
138
+ readonly REVOKE_ACCESS_ON_USER_LOGOUT: "revokeAccessOnUserLogout";
139
+ readonly REVOKE_ACCESS_ON_DOCUMENT_UNSET: "revokeAccessOnDocumentUnset";
140
+ };
141
+ export type PermissionSource = (typeof PermissionSource)[keyof typeof PermissionSource];
140
142
  export interface RevokeAccessOn {
141
143
  type: RevokeAccessOnType;
142
144
  revokeOrganizationAccess?: boolean;
@@ -192,12 +194,13 @@ export interface PermissionResolverRequest {
192
194
  requests: PermissionQuery[];
193
195
  };
194
196
  }
195
- export declare enum PermissionResourceType {
196
- FOLDER = "folder",
197
- DOCUMENT = "document",
198
- ORGANIZATION = "organization",
199
- CONTEXT = "context"
200
- }
197
+ export declare const PermissionResourceType: {
198
+ readonly FOLDER: "folder";
199
+ readonly DOCUMENT: "document";
200
+ readonly ORGANIZATION: "organization";
201
+ readonly CONTEXT: "context";
202
+ };
203
+ export type PermissionResourceType = (typeof PermissionResourceType)[keyof typeof PermissionResourceType];
201
204
  export interface PermissionQuery {
202
205
  userId: string;
203
206
  resource: {
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  import { Observable } from "rxjs";
3
2
  import { ActivityRecord, ActivitySubscribeConfig, CreateActivityData } from "../data/activity.data.model";
4
3
 
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  export declare class AreaElement {
3
2
  /**
4
3
  * To enable area feature
@@ -1,10 +1,9 @@
1
- // @ts-nocheck
2
1
  export declare class ArrowElement {
3
2
  /**
4
3
  * To allow arrow in specific elements only
5
4
  * @param elementIds Element ids to be allowed for arrow
6
5
  */
7
- public allowedElementIds: (elementIds: string[]) => any;
6
+ public allowedElementIds: (elementIds: string[]) => void;
8
7
 
9
8
  constructor();
10
9
 
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  import { Observable } from "rxjs";
3
2
  import { AutocompleteData, AutocompleteChipData } from "../data/autocomplete.data.model";
4
3
  export declare class AutocompleteElement {