@veltdev/sdk-dev 5.0.2-beta.11 → 5.0.2-beta.111
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/client/snippyly.model.d.ts +34 -1
- package/app/models/data/activity-resolver.data.model.d.ts +27 -0
- package/app/models/data/activity.data.model.d.ts +181 -0
- package/app/models/data/agent-suggestion.data.model.d.ts +57 -0
- package/app/models/data/attachment-resolver.data.model.d.ts +2 -2
- package/app/models/data/attachment.model.d.ts +1 -0
- package/app/models/data/autocomplete.data.model.d.ts +4 -3
- package/app/models/data/base-metadata.data.model.d.ts +3 -0
- package/app/models/data/comment-actions.data.model.d.ts +12 -0
- package/app/models/data/comment-annotation.data.model.d.ts +63 -0
- package/app/models/data/comment-events.data.model.d.ts +24 -0
- package/app/models/data/comment-resolver.data.model.d.ts +3 -3
- package/app/models/data/comment-sidebar-config.model.d.ts +2 -0
- package/app/models/data/comment.data.model.d.ts +18 -0
- package/app/models/data/config.data.model.d.ts +26 -0
- package/app/models/data/core-events.data.model.d.ts +72 -0
- package/app/models/data/crdt.data.model.d.ts +51 -0
- package/app/models/data/document-paths.data.model.d.ts +1 -0
- package/app/models/data/document.data.model.d.ts +2 -0
- package/app/models/data/live-state-events.data.model.d.ts +6 -0
- package/app/models/data/notification-resolver.data.model.d.ts +39 -0
- package/app/models/data/notification.model.d.ts +24 -0
- package/app/models/data/page-info.model.d.ts +9 -0
- package/app/models/data/presence-user.data.model.d.ts +5 -0
- package/app/models/data/provider.data.model.d.ts +6 -0
- package/app/models/data/reaction-annotation.data.model.d.ts +5 -0
- package/app/models/data/reaction-resolver.data.model.d.ts +3 -3
- package/app/models/data/recorder-annotation.data.model.d.ts +11 -0
- package/app/models/data/recorder-events.data.model.d.ts +3 -0
- package/app/models/data/recorder-resolver.data.model.d.ts +58 -0
- package/app/models/data/resolver.data.model.d.ts +1 -0
- package/app/models/data/rewriter-events.data.model.d.ts +44 -0
- package/app/models/data/suggestion-events.data.model.d.ts +57 -0
- package/app/models/data/suggestion.data.model.d.ts +267 -0
- package/app/models/data/user-resolver.data.model.d.ts +2 -0
- package/app/models/data/user.data.model.d.ts +50 -1
- package/app/models/element/activity-element.model.d.ts +33 -0
- package/app/models/element/comment-element.model.d.ts +44 -0
- package/app/models/element/crdt-element.model.d.ts +88 -1
- package/app/models/element/notification-element.model.d.ts +15 -1
- package/app/models/element/presence-element.model.d.ts +25 -0
- package/app/models/element/rewriter-element.model.d.ts +20 -0
- package/app/models/element/suggestion-element.model.d.ts +180 -0
- package/app/utils/console.d.ts +25 -0
- package/app/utils/constants.d.ts +226 -0
- package/app/utils/enums.d.ts +40 -7
- package/app/utils/page-info-store.d.ts +29 -0
- package/environments/environment.d.ts +48 -0
- package/models.d.ts +8 -0
- package/package.json +1 -1
- package/types.d.ts +3 -0
- package/velt.css +1 -1
- package/velt.js +140 -151
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Suggestions feature — public type surface for v1.
|
|
3
|
+
*
|
|
4
|
+
* Source contract: docs/suggestions-api-contract.md
|
|
5
|
+
* Source flows: docs/suggestions-implementation-flows.md
|
|
6
|
+
*
|
|
7
|
+
* Types are exported from the SDK's public barrel. Customer code interacts
|
|
8
|
+
* with these via Snippyly.getSuggestionElement(); the SDK constructs all
|
|
9
|
+
* Suggestion objects internally and customers do not build them directly.
|
|
10
|
+
*/
|
|
11
|
+
import { User } from './user.data.model';
|
|
12
|
+
/**
|
|
13
|
+
* Lifecycle state machine for a Suggestion.
|
|
14
|
+
*
|
|
15
|
+
* - pending: Just created, awaiting owner action.
|
|
16
|
+
* - approved: Owner clicked Approve. Customer apply handler ran successfully.
|
|
17
|
+
* - rejected: Owner clicked Reject (with optional reason).
|
|
18
|
+
* - stale: Target was unresolvable at approve time. Owner can dismiss.
|
|
19
|
+
* - apply_failed: Customer apply handler threw during a suggestionApproved event.
|
|
20
|
+
* Status set by the SDK after the throw was caught.
|
|
21
|
+
*/
|
|
22
|
+
export type SuggestionStatus = 'pending' | 'accepted' | 'rejected' | 'stale' | 'apply_failed';
|
|
23
|
+
/**
|
|
24
|
+
* Global per-user-per-session suggestion mode. Not persisted; reload returns to 'editing'.
|
|
25
|
+
*/
|
|
26
|
+
export type SuggestionMode = 'editing' | 'suggesting';
|
|
27
|
+
/**
|
|
28
|
+
* Discriminator for the substrate that produced a suggestion. v1: always 'custom'.
|
|
29
|
+
* Wrapper libraries (e.g. tiptap-velt-comments) widen this union when they integrate.
|
|
30
|
+
*
|
|
31
|
+
* Customers should treat unknown values as opaque; the field exists so customer code
|
|
32
|
+
* can differentiate substrate when domain-specific rendering matters.
|
|
33
|
+
*/
|
|
34
|
+
export type SuggestionTargetType = 'custom';
|
|
35
|
+
/**
|
|
36
|
+
* Single-arg config passed to `SuggestionElement.registerTarget(config)`.
|
|
37
|
+
* Carrying both `targetId` and `getter` in one object so the API can grow
|
|
38
|
+
* (e.g., metadata, target-specific options) without breaking customers.
|
|
39
|
+
*/
|
|
40
|
+
export interface RegisterTargetConfig<T = unknown> {
|
|
41
|
+
targetId: string;
|
|
42
|
+
getter: TargetGetter<T>;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Function the customer registers via SuggestionElement.registerTarget(config).
|
|
46
|
+
* Required for any non-primitive (wrapper) target.
|
|
47
|
+
*
|
|
48
|
+
* The SDK calls this getter twice in a typical edit cycle:
|
|
49
|
+
* 1. On focus of the tagged element — to snapshot the pre-edit value.
|
|
50
|
+
* 2. On commit (focusout / change) — to read the current value for the diff.
|
|
51
|
+
*
|
|
52
|
+
* IMPORTANT — edit-time state, not persisted state: the getter must reflect
|
|
53
|
+
* what the user is currently editing, not what's persisted in the customer's
|
|
54
|
+
* app store. If the customer's state is only updated on commit/approve (as
|
|
55
|
+
* is typical when suggesting mode is on), reading from that state would
|
|
56
|
+
* return the snapshot value at commit time, the diff check would short-
|
|
57
|
+
* circuit, and no suggestion would ever fire.
|
|
58
|
+
*
|
|
59
|
+
* Recommended: read from the DOM (controlled or uncontrolled inputs) so the
|
|
60
|
+
* getter always returns what's visible to the user.
|
|
61
|
+
*
|
|
62
|
+
* el.registerTarget('row.123', () => ({
|
|
63
|
+
* qty: parseInt(qtyInput.value, 10),
|
|
64
|
+
* price: parseInt(priceInput.value, 10),
|
|
65
|
+
* }));
|
|
66
|
+
*
|
|
67
|
+
* For controlled inputs (state updates on every keystroke), reading from
|
|
68
|
+
* the customer state is fine: `() => myState.row123`. The contract is
|
|
69
|
+
* "edit-time state" — whichever source of truth has it.
|
|
70
|
+
*/
|
|
71
|
+
export type TargetGetter<T = unknown> = () => T;
|
|
72
|
+
/**
|
|
73
|
+
* Returned from SuggestionElement.on(...). Calling it removes the handler.
|
|
74
|
+
*/
|
|
75
|
+
export type Unsubscribe = () => void;
|
|
76
|
+
/**
|
|
77
|
+
* Details about a target edit, passed to the customer's resolver handler and
|
|
78
|
+
* to subscribers of `targetEditStart` / `targetEditCommit` events.
|
|
79
|
+
*
|
|
80
|
+
* `element` is the DOM element that produced the edit. It's the tagged
|
|
81
|
+
* descendant — or, for wrappers that nest interactive controls inside a
|
|
82
|
+
* tagged container, the inner element that actually fired the event. In
|
|
83
|
+
* either case the SDK walks up to the nearest ancestor carrying
|
|
84
|
+
* `data-velt-suggestion-target` to resolve `targetId`.
|
|
85
|
+
*
|
|
86
|
+
* `element` is provided for read access only — customers should not retain
|
|
87
|
+
* the reference past the synchronous handler call.
|
|
88
|
+
*/
|
|
89
|
+
export interface TargetEditDetails<T = unknown> {
|
|
90
|
+
targetId: string;
|
|
91
|
+
oldValue: T;
|
|
92
|
+
newValue: T;
|
|
93
|
+
element: Element | null;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Return type of `onTargetEditCommit`. Returning a value auto-commits the
|
|
97
|
+
* suggestion using the (optional) overrides; returning null skips the
|
|
98
|
+
* auto-commit so a subscriber to `targetEditCommit` can drive it explicitly.
|
|
99
|
+
*/
|
|
100
|
+
export interface TargetEditCommitResult {
|
|
101
|
+
/** Override the SDK's default `${targetId}: ${old} → ${new}` summary. */
|
|
102
|
+
summary?: string;
|
|
103
|
+
/** Customer metadata persisted on the resulting Suggestion. */
|
|
104
|
+
metadata?: Record<string, unknown>;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Return type of `onTargetEditStart`. Reserved for future fields; v1 has
|
|
108
|
+
* no behavior-bearing return values, so customers may omit a return.
|
|
109
|
+
*
|
|
110
|
+
* Roadmap: future versions may accept `{ oldValue }` here so customers can
|
|
111
|
+
* override the SDK's auto-snapshot with a domain-canonical value.
|
|
112
|
+
*/
|
|
113
|
+
export interface TargetEditStartResult {
|
|
114
|
+
}
|
|
115
|
+
export type TargetEditStartHandler<T = unknown> = (details: TargetEditDetails<T>) => TargetEditStartResult | void | null;
|
|
116
|
+
export type TargetEditCommitHandler<T = unknown> = (details: TargetEditDetails<T>) => TargetEditCommitResult | null;
|
|
117
|
+
/**
|
|
118
|
+
* Config passed to `SuggestionElement.enableSuggestionMode(config?)`.
|
|
119
|
+
* Both callbacks are optional. If `onTargetEditCommit` is omitted, customers
|
|
120
|
+
* can still drive auto-commit by subscribing to the `targetEditCommit` event
|
|
121
|
+
* and calling the pre-bound `commitSuggestion` builder on the payload.
|
|
122
|
+
*/
|
|
123
|
+
export interface EnableSuggestionModeConfig {
|
|
124
|
+
/**
|
|
125
|
+
* Invoked on focus of a tagged element, after the SDK captures the
|
|
126
|
+
* snapshot. v1: informational — return value is reserved for future
|
|
127
|
+
* use (e.g. `{ oldValue }` to override the SDK's auto-snapshot).
|
|
128
|
+
*/
|
|
129
|
+
onTargetEditStart?: TargetEditStartHandler;
|
|
130
|
+
/**
|
|
131
|
+
* Invoked once per detected commit (on `change` for atomic inputs, on
|
|
132
|
+
* `focusout` for text-like inputs). Returning a `TargetEditCommitResult`
|
|
133
|
+
* auto-commits with the supplied summary/metadata; returning null defers
|
|
134
|
+
* to event subscribers.
|
|
135
|
+
*/
|
|
136
|
+
onTargetEditCommit?: TargetEditCommitHandler;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* SDK-managed suggestion data persisted on a CommentAnnotation.
|
|
140
|
+
* Present iff annotation.type === 'suggestion'.
|
|
141
|
+
*
|
|
142
|
+
* Customer code must not write to this directly — use the SuggestionElement API.
|
|
143
|
+
*/
|
|
144
|
+
export interface SuggestionData {
|
|
145
|
+
/** Lifecycle state machine. */
|
|
146
|
+
status: SuggestionStatus;
|
|
147
|
+
/** Stable, customer-owned target identifier. */
|
|
148
|
+
targetId: string;
|
|
149
|
+
/** v1: always 'custom'. Wrappers widen later. */
|
|
150
|
+
targetType: SuggestionTargetType;
|
|
151
|
+
/** Snapshot taken at startSuggestion / focus time. Frozen via structuredClone. */
|
|
152
|
+
oldValue: any;
|
|
153
|
+
/** Value submitted via commitSuggestion. */
|
|
154
|
+
newValue: any;
|
|
155
|
+
/** Optional human-readable description for logs / notifications. */
|
|
156
|
+
summary: string | null;
|
|
157
|
+
/**
|
|
158
|
+
* True if the live value at approve time differed from oldValue.
|
|
159
|
+
* v1 records flag only; v1.1 will surface a confirmation prompt.
|
|
160
|
+
*/
|
|
161
|
+
driftDetected: boolean;
|
|
162
|
+
/** Populated only when status === 'rejected'. */
|
|
163
|
+
rejectReason: string | null;
|
|
164
|
+
/**
|
|
165
|
+
* Full User snapshot of the resolver, populated when status moves to
|
|
166
|
+
* approved | rejected | stale | apply_failed. Snapshot rather than userId
|
|
167
|
+
* so customer code can render name/email/photoUrl without an extra lookup,
|
|
168
|
+
* and so historical suggestions retain their resolver record even if the
|
|
169
|
+
* user later updates their profile.
|
|
170
|
+
*/
|
|
171
|
+
resolvedBy: User | null;
|
|
172
|
+
resolvedAt: number | null;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Fields shared across every Suggestion regardless of status.
|
|
176
|
+
* Internal — used to build the per-status discriminated types below.
|
|
177
|
+
*/
|
|
178
|
+
interface SuggestionBase<T = unknown> {
|
|
179
|
+
/** Annotation document id (same as the underlying CommentAnnotation.annotationId). */
|
|
180
|
+
annotationId: string;
|
|
181
|
+
/** Stable, customer-owned target identifier. */
|
|
182
|
+
targetId: string;
|
|
183
|
+
/** v1: always 'custom'. */
|
|
184
|
+
targetType: SuggestionTargetType;
|
|
185
|
+
/** Snapshot taken at startSuggestion / focus time. */
|
|
186
|
+
oldValue: T;
|
|
187
|
+
/** Value submitted via commitSuggestion. */
|
|
188
|
+
newValue: T;
|
|
189
|
+
/** Optional human-readable description. */
|
|
190
|
+
summary: string | null;
|
|
191
|
+
/** Customer-defined metadata supplied via CommitSuggestionConfig.metadata. */
|
|
192
|
+
metadata: Record<string, any>;
|
|
193
|
+
/** True iff the live value at approve time differed from oldValue. */
|
|
194
|
+
driftDetected: boolean;
|
|
195
|
+
/**
|
|
196
|
+
* User of the suggestion's creator (sourced from annotation.from).
|
|
197
|
+
*/
|
|
198
|
+
createdBy?: User;
|
|
199
|
+
createdAt: number;
|
|
200
|
+
}
|
|
201
|
+
/** A suggestion in the 'pending' state — newly created, no owner action yet. */
|
|
202
|
+
export interface PendingSuggestion<T = unknown> extends SuggestionBase<T> {
|
|
203
|
+
status: 'pending';
|
|
204
|
+
rejectReason: null;
|
|
205
|
+
resolvedBy: null;
|
|
206
|
+
resolvedAt: null;
|
|
207
|
+
}
|
|
208
|
+
/** A suggestion that has been approved (apply handler success or pending invocation). */
|
|
209
|
+
export interface ApprovedSuggestion<T = unknown> extends SuggestionBase<T> {
|
|
210
|
+
status: 'accepted' | 'apply_failed';
|
|
211
|
+
rejectReason: null;
|
|
212
|
+
resolvedBy: User;
|
|
213
|
+
resolvedAt: number;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* A suggestion that has been rejected. `rejectReason` may be null when the
|
|
217
|
+
* rejecter dismissed without supplying a reason — matches the persisted
|
|
218
|
+
* `SuggestionData.rejectReason: string | null` shape.
|
|
219
|
+
*/
|
|
220
|
+
export interface RejectedSuggestion<T = unknown> extends SuggestionBase<T> {
|
|
221
|
+
status: 'rejected';
|
|
222
|
+
rejectReason: string | null;
|
|
223
|
+
resolvedBy: User;
|
|
224
|
+
resolvedAt: number;
|
|
225
|
+
}
|
|
226
|
+
/** A suggestion whose target was unresolvable at approve time. */
|
|
227
|
+
export interface StaleSuggestion<T = unknown> extends SuggestionBase<T> {
|
|
228
|
+
status: 'stale';
|
|
229
|
+
rejectReason: null;
|
|
230
|
+
resolvedBy: User | null;
|
|
231
|
+
resolvedAt: number | null;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Public Suggestion — discriminated union keyed by `status`. TypeScript narrows
|
|
235
|
+
* field types per status (e.g. `resolvedBy: User` is non-null on approved/rejected,
|
|
236
|
+
* `rejectReason: string | null` on rejected since one-click reject without a reason
|
|
237
|
+
* is supported).
|
|
238
|
+
*/
|
|
239
|
+
export type Suggestion<T = unknown> = PendingSuggestion<T> | ApprovedSuggestion<T> | RejectedSuggestion<T> | StaleSuggestion<T>;
|
|
240
|
+
export interface CommitSuggestionConfig<T = unknown> {
|
|
241
|
+
/**
|
|
242
|
+
* Must be registered (via data-velt-target attribute or registerTarget call)
|
|
243
|
+
* before commit, otherwise the suggestion is rejected with a dev-mode warning.
|
|
244
|
+
*/
|
|
245
|
+
targetId: string;
|
|
246
|
+
/** Any JSON-serializable value. Customer's apply handler interprets it. */
|
|
247
|
+
newValue: T;
|
|
248
|
+
/** Optional human-readable string for logs and notifications. */
|
|
249
|
+
summary?: string;
|
|
250
|
+
/** Optional customer-defined metadata. Stored on Suggestion.metadata. */
|
|
251
|
+
metadata?: Record<string, unknown>;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Pre-bound builder attached to `targetEditCommit` payloads. Calling it
|
|
255
|
+
* commits the suggestion with the SDK's default summary/metadata, optionally
|
|
256
|
+
* overridden by `result`. If the customer's `onTargetEditCommit` handler
|
|
257
|
+
* already returned a non-null result for this edit, this builder is a no-op
|
|
258
|
+
* (resolves immediately) so subscribers can't double-commit.
|
|
259
|
+
*/
|
|
260
|
+
export type TargetEditCommitBuilder = (result?: TargetEditCommitResult) => Promise<{
|
|
261
|
+
id: string;
|
|
262
|
+
} | null>;
|
|
263
|
+
export interface SuggestionGetSuggestionsFilter {
|
|
264
|
+
targetId?: string;
|
|
265
|
+
status?: SuggestionStatus | SuggestionStatus[];
|
|
266
|
+
}
|
|
267
|
+
export {};
|
|
@@ -33,6 +33,7 @@ export interface GetUserPermissionsResponse {
|
|
|
33
33
|
folders?: {
|
|
34
34
|
[folderId: string]: {
|
|
35
35
|
accessRole?: UserPermissionAccessRole;
|
|
36
|
+
accessType?: string;
|
|
36
37
|
expiresAt?: number;
|
|
37
38
|
error?: string;
|
|
38
39
|
errorCode?: UserPermissionAccessRoleResult;
|
|
@@ -49,6 +50,7 @@ export interface GetUserPermissionsResponse {
|
|
|
49
50
|
documents?: {
|
|
50
51
|
[documentId: string]: {
|
|
51
52
|
accessRole?: UserPermissionAccessRole;
|
|
53
|
+
accessType?: string;
|
|
52
54
|
expiresAt?: number;
|
|
53
55
|
error?: string;
|
|
54
56
|
errorCode?: UserPermissionAccessRoleResult;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SetDocumentsContext } from "./document.data.model";
|
|
2
|
+
import { ResolverEndpointConfig, ResolverResponse } from "./resolver.data.model";
|
|
2
3
|
import { UserContact } from "./user-contact.data.model";
|
|
3
4
|
import { UserPermissionAccessRole } from "./user-resolver.data.model";
|
|
4
5
|
export declare class User {
|
|
@@ -12,6 +13,8 @@ export declare class User {
|
|
|
12
13
|
* Default: Random avatar name.
|
|
13
14
|
*/
|
|
14
15
|
name?: string;
|
|
16
|
+
email_lowercase?: string;
|
|
17
|
+
name_lowercase?: string;
|
|
15
18
|
clientUserName?: string;
|
|
16
19
|
/**
|
|
17
20
|
* Your user's display picture URL.
|
|
@@ -110,7 +113,7 @@ export interface AuthRetryConfig {
|
|
|
110
113
|
retryDelay?: number;
|
|
111
114
|
}
|
|
112
115
|
export interface Context {
|
|
113
|
-
access
|
|
116
|
+
access?: {
|
|
114
117
|
[key: string]: string | number;
|
|
115
118
|
};
|
|
116
119
|
accessFields?: Array<string>;
|
|
@@ -143,6 +146,51 @@ export interface VeltPermissionProvider {
|
|
|
143
146
|
isContextEnabled?: boolean;
|
|
144
147
|
revokeAccessOn?: RevokeAccessOn[];
|
|
145
148
|
forceRefresh?: boolean;
|
|
149
|
+
/**
|
|
150
|
+
* LOCAL-DEV ONLY. When `true`, the SDK resolves permissions in the browser
|
|
151
|
+
* (via {@link endpointConfig} or {@link resolvePermissions}) and relays the
|
|
152
|
+
* results to the backend, instead of relying on the server-to-server
|
|
153
|
+
* Real-Time Permission Provider. This lets a `localhost` permission endpoint
|
|
154
|
+
* be reached without an ngrok/Cloudflare tunnel during development.
|
|
155
|
+
*
|
|
156
|
+
* This flag is an ergonomic switch only — it is NOT a security boundary.
|
|
157
|
+
* The backend independently gates browser-resolved results to dev/test API
|
|
158
|
+
* keys; production keys always ignore them and fall back to the server-side
|
|
159
|
+
* provider. MUST NOT be relied on in production.
|
|
160
|
+
*/
|
|
161
|
+
dev?: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* URL-based client-side resolver. When set (and {@link dev} is `true`), the
|
|
164
|
+
* browser POSTs `{ data: { requests } }` to `url` — byte-for-byte identical
|
|
165
|
+
* to what the server-side permission provider sends — and expects the same
|
|
166
|
+
* `{ data: PermissionResult[], success, statusCode }` response. Takes
|
|
167
|
+
* precedence over {@link resolvePermissions} when both are provided.
|
|
168
|
+
*/
|
|
169
|
+
endpointConfig?: ResolverEndpointConfig;
|
|
170
|
+
/**
|
|
171
|
+
* Callback-based client-side resolver. When set (and {@link dev} is `true`,
|
|
172
|
+
* and no {@link endpointConfig} URL is provided), it is invoked with the
|
|
173
|
+
* same `{ data: { requests } }` envelope and may return either a bare
|
|
174
|
+
* `PermissionResult[]` or a `ResolverResponse<PermissionResult[]>`.
|
|
175
|
+
*/
|
|
176
|
+
resolvePermissions?: (request: PermissionResolverRequest) => Promise<PermissionResult[] | ResolverResponse<PermissionResult[]>>;
|
|
177
|
+
/**
|
|
178
|
+
* Optional per-call timeout (ms) for the client-side resolver. When the
|
|
179
|
+
* resolver does not settle within this window the check fails closed (deny).
|
|
180
|
+
*/
|
|
181
|
+
resolveTimeout?: number;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* The request envelope handed to a client-side permission resolver
|
|
185
|
+
* ({@link VeltPermissionProvider.endpointConfig} URL body or
|
|
186
|
+
* {@link VeltPermissionProvider.resolvePermissions} callback argument). The
|
|
187
|
+
* shape mirrors the server-side permission provider request byte-for-byte so a
|
|
188
|
+
* customer's existing handler works unchanged.
|
|
189
|
+
*/
|
|
190
|
+
export interface PermissionResolverRequest {
|
|
191
|
+
data: {
|
|
192
|
+
requests: PermissionQuery[];
|
|
193
|
+
};
|
|
146
194
|
}
|
|
147
195
|
export declare enum PermissionResourceType {
|
|
148
196
|
FOLDER = "folder",
|
|
@@ -158,6 +206,7 @@ export interface PermissionQuery {
|
|
|
158
206
|
source: PermissionSource;
|
|
159
207
|
organizationId: string;
|
|
160
208
|
context?: Context | SetDocumentsContext;
|
|
209
|
+
parentFolderId?: string;
|
|
161
210
|
};
|
|
162
211
|
}
|
|
163
212
|
export interface PermissionResult {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { Observable } from "rxjs";
|
|
3
|
+
import { ActivityRecord, ActivitySubscribeConfig, CreateActivityData } from "../data/activity.data.model";
|
|
4
|
+
|
|
5
|
+
export declare class ActivityElement {
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Subscribe to activities with optional filtering configuration.
|
|
9
|
+
* Returns an Observable that, when unsubscribed, automatically cleans up the internal subscription.
|
|
10
|
+
* @param config Optional configuration to filter activities by scope, feature types, action types, etc.
|
|
11
|
+
* @returns Observable<ActivityRecord[] | null>
|
|
12
|
+
*/
|
|
13
|
+
getAllActivities: (config?: ActivitySubscribeConfig) => Observable<ActivityRecord[] | null>;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Create a new activity record.
|
|
17
|
+
* @param data The activity data including feature type, action type, target entity, etc.
|
|
18
|
+
* @returns Promise<void>
|
|
19
|
+
*/
|
|
20
|
+
createActivity: (data: CreateActivityData) => Promise<void>;
|
|
21
|
+
|
|
22
|
+
constructor();
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Subscribe to activities with optional filtering configuration.
|
|
26
|
+
*/
|
|
27
|
+
private _getAllActivities;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Create a new activity record.
|
|
31
|
+
*/
|
|
32
|
+
private _createActivity;
|
|
33
|
+
}
|
|
@@ -503,6 +503,16 @@ export declare class CommentElement {
|
|
|
503
503
|
*/
|
|
504
504
|
public disableReactions: () => void;
|
|
505
505
|
|
|
506
|
+
/**
|
|
507
|
+
* To enable anonymous email mentions in comments
|
|
508
|
+
*/
|
|
509
|
+
public enableAnonymousEmail: () => void;
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* To disable anonymous email mentions in comments
|
|
513
|
+
*/
|
|
514
|
+
public disableAnonymousEmail: () => void;
|
|
515
|
+
|
|
506
516
|
/**
|
|
507
517
|
* To set allowed recordings in comments
|
|
508
518
|
* @param allowedRecordings "all", "none" or "audio", "video", "screen"
|
|
@@ -936,6 +946,8 @@ export declare class CommentElement {
|
|
|
936
946
|
* To disable collapsed comment
|
|
937
947
|
*/
|
|
938
948
|
public disableCollapsedComments: () => void;
|
|
949
|
+
public enableCollapsedRepliesPreview: () => void;
|
|
950
|
+
public disableCollapsedRepliesPreview: () => void;
|
|
939
951
|
|
|
940
952
|
/**
|
|
941
953
|
* To enable query params comments
|
|
@@ -1390,6 +1402,16 @@ export declare class CommentElement {
|
|
|
1390
1402
|
*/
|
|
1391
1403
|
public getComposerData: (request: GetComposerDataRequest) => ComposerTextChangeEvent | null;
|
|
1392
1404
|
|
|
1405
|
+
/**
|
|
1406
|
+
* To enable pin drag
|
|
1407
|
+
*/
|
|
1408
|
+
public enablePinDrag: () => void;
|
|
1409
|
+
|
|
1410
|
+
/**
|
|
1411
|
+
* To disable pin drag
|
|
1412
|
+
*/
|
|
1413
|
+
public disablePinDrag: () => void;
|
|
1414
|
+
|
|
1393
1415
|
constructor();
|
|
1394
1416
|
/**
|
|
1395
1417
|
* Subscribe to comments on the current document.
|
|
@@ -1839,6 +1861,16 @@ export declare class CommentElement {
|
|
|
1839
1861
|
*/
|
|
1840
1862
|
private _disableReactions;
|
|
1841
1863
|
|
|
1864
|
+
/**
|
|
1865
|
+
* To enable anonymous email mentions in comments
|
|
1866
|
+
*/
|
|
1867
|
+
private _enableAnonymousEmail;
|
|
1868
|
+
|
|
1869
|
+
/**
|
|
1870
|
+
* To disable anonymous email mentions in comments
|
|
1871
|
+
*/
|
|
1872
|
+
private _disableAnonymousEmail;
|
|
1873
|
+
|
|
1842
1874
|
/**
|
|
1843
1875
|
* To set allowed recordings in comments
|
|
1844
1876
|
* @param allowedRecordings "all", "none" or "audio", "video", "screen"
|
|
@@ -2269,6 +2301,8 @@ export declare class CommentElement {
|
|
|
2269
2301
|
* To disable collapsed comment
|
|
2270
2302
|
*/
|
|
2271
2303
|
private _disableCollapsedComments;
|
|
2304
|
+
private _enableCollapsedRepliesPreview;
|
|
2305
|
+
private _disableCollapsedRepliesPreview;
|
|
2272
2306
|
|
|
2273
2307
|
/**
|
|
2274
2308
|
* To enable query params comments
|
|
@@ -2751,4 +2785,14 @@ export declare class CommentElement {
|
|
|
2751
2785
|
* @param type 'dropdown' | 'checkbox'
|
|
2752
2786
|
*/
|
|
2753
2787
|
private _setAssignToType;
|
|
2788
|
+
|
|
2789
|
+
/**
|
|
2790
|
+
* To enable pin drag
|
|
2791
|
+
*/
|
|
2792
|
+
private _enablePinDrag;
|
|
2793
|
+
|
|
2794
|
+
/**
|
|
2795
|
+
* To disable pin drag
|
|
2796
|
+
*/
|
|
2797
|
+
private _disablePinDrag;
|
|
2754
2798
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import { CrdtGetDataQuery, CrdtGetVersionQuery, CrdtOnDataChangeQuery, CrdtOnPresenceChangeQuery, CrdtOnRegisteredUserChangeQuery, CrdtOnStateChangeQuery, CrdtRegisterSyncUserQuery, CrdtSetPresenceQuery, CrdtSaveVersionQuery, CrdtUpdateDataQuery, CrdtUpdateStateQuery } from "../data/crdt.data.model";
|
|
2
|
+
import { CrdtGetDataQuery, CrdtGetMessagesQuery, CrdtGetSnapshotQuery, CrdtGetVersionQuery, CrdtGetVersionsQuery, CrdtMessageData, CrdtOnDataChangeQuery, CrdtOnMessageQuery, CrdtOnPresenceChangeQuery, CrdtOnRegisteredUserChangeQuery, CrdtOnStateChangeQuery, CrdtPruneMessagesQuery, CrdtPushMessageQuery, CrdtRegisterSyncUserQuery, CrdtSaveSnapshotQuery, CrdtSetPresenceQuery, CrdtSaveVersionQuery, CrdtSnapshotData, CrdtUpdateDataQuery, CrdtUpdateStateQuery } from "../data/crdt.data.model";
|
|
3
3
|
import { CrdtEventTypesMap } from "../data/crdt-events.data.model";
|
|
4
4
|
|
|
5
5
|
export declare class CrdtElement {
|
|
@@ -80,6 +80,12 @@ export declare class CrdtElement {
|
|
|
80
80
|
*/
|
|
81
81
|
getVersion: (getVersionQuery: CrdtGetVersionQuery) => Promise<any>;
|
|
82
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Get all versions of a specific CRDT document
|
|
85
|
+
* @param id Document ID
|
|
86
|
+
*/
|
|
87
|
+
getVersions: (getVersionsQuery: CrdtGetVersionsQuery) => Promise<any>;
|
|
88
|
+
|
|
83
89
|
/**
|
|
84
90
|
* Enable webhook
|
|
85
91
|
*/
|
|
@@ -96,6 +102,51 @@ export declare class CrdtElement {
|
|
|
96
102
|
*/
|
|
97
103
|
setWebhookDebounceTime: (time: number) => void;
|
|
98
104
|
|
|
105
|
+
/**
|
|
106
|
+
* Push a lib0-encoded message to the unified message stream.
|
|
107
|
+
* Uses Firebase push() for chronologically-ordered keys.
|
|
108
|
+
* Carries both sync (type 0) and awareness (type 1) messages.
|
|
109
|
+
* @param pushMessageQuery - contains id, data (encoded bytes), yjsClientId (Y.Doc client ID), optional messageType and eventData
|
|
110
|
+
*/
|
|
111
|
+
pushMessage: (pushMessageQuery: CrdtPushMessageQuery) => Promise<void>;
|
|
112
|
+
/**
|
|
113
|
+
* Subscribe to the unified message stream for real-time sync.
|
|
114
|
+
* Emits each new message individually as it arrives (streaming pattern).
|
|
115
|
+
* Returns an unsubscribe function.
|
|
116
|
+
* @param onMessageQuery - contains id, callback, and optional afterTs for filtering
|
|
117
|
+
*/
|
|
118
|
+
onMessage: (onMessageQuery: CrdtOnMessageQuery) => () => void;
|
|
119
|
+
/**
|
|
120
|
+
* Fetch all messages after a given timestamp (one-time read).
|
|
121
|
+
* Used for message replay during initial load (y-redis pattern).
|
|
122
|
+
* @param getMessagesQuery - contains id and optional afterTs
|
|
123
|
+
*/
|
|
124
|
+
getMessages: (getMessagesQuery: CrdtGetMessagesQuery) => Promise<CrdtMessageData[]>;
|
|
125
|
+
/**
|
|
126
|
+
* Get the latest full-state snapshot for a document.
|
|
127
|
+
* Used as the baseline for message replay during initial load.
|
|
128
|
+
* @param getSnapshotQuery - contains id
|
|
129
|
+
*/
|
|
130
|
+
getSnapshot: (getSnapshotQuery: CrdtGetSnapshotQuery) => Promise<CrdtSnapshotData | null>;
|
|
131
|
+
/**
|
|
132
|
+
* Save a full-state snapshot (state + vector) for fast initial load.
|
|
133
|
+
* Called periodically to create checkpoints, enabling message pruning.
|
|
134
|
+
* @param saveSnapshotQuery - contains id, state (Y.Doc update), and vector (state vector)
|
|
135
|
+
*/
|
|
136
|
+
saveSnapshot: (saveSnapshotQuery: CrdtSaveSnapshotQuery) => Promise<void>;
|
|
137
|
+
/**
|
|
138
|
+
* Remove messages older than the given timestamp from the message stream.
|
|
139
|
+
* Called after saving a snapshot to keep the message stream bounded.
|
|
140
|
+
* @param pruneMessagesQuery - contains id and beforeTs
|
|
141
|
+
*/
|
|
142
|
+
pruneMessages: (pruneMessagesQuery: CrdtPruneMessagesQuery) => Promise<void>;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* To set activity debounce time for batching CRDT edits (Default value is 10 minutes)
|
|
146
|
+
* @param time debounce time in milliseconds (minimum: 10 seconds)
|
|
147
|
+
*/
|
|
148
|
+
setActivityDebounceTime: (time: number) => void;
|
|
149
|
+
|
|
99
150
|
/**
|
|
100
151
|
* Subscribe to crdt actions
|
|
101
152
|
* @param action Action to subscribe to
|
|
@@ -188,6 +239,36 @@ export declare class CrdtElement {
|
|
|
188
239
|
*/
|
|
189
240
|
private _getVersions;
|
|
190
241
|
|
|
242
|
+
/**
|
|
243
|
+
* Push a message to the unified message stream
|
|
244
|
+
*/
|
|
245
|
+
private _pushMessage;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Subscribe to the unified message stream
|
|
249
|
+
*/
|
|
250
|
+
private _onMessage;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Fetch all messages after a given timestamp
|
|
254
|
+
*/
|
|
255
|
+
private _getMessages;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Get the latest snapshot for a document
|
|
259
|
+
*/
|
|
260
|
+
private _getSnapshot;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Save a full-state snapshot
|
|
264
|
+
*/
|
|
265
|
+
private _saveSnapshot;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Remove messages older than a given timestamp
|
|
269
|
+
*/
|
|
270
|
+
private _pruneMessages;
|
|
271
|
+
|
|
191
272
|
/**
|
|
192
273
|
* Enable webhook
|
|
193
274
|
*/
|
|
@@ -204,6 +285,12 @@ export declare class CrdtElement {
|
|
|
204
285
|
*/
|
|
205
286
|
private _setWebhookDebounceTime;
|
|
206
287
|
|
|
288
|
+
/**
|
|
289
|
+
* Set activity debounce time for batching CRDT edits
|
|
290
|
+
* @param time debounce time in milliseconds (minimum: 10 seconds)
|
|
291
|
+
*/
|
|
292
|
+
private _setActivityDebounceTime;
|
|
293
|
+
|
|
207
294
|
/**
|
|
208
295
|
* Subscribe to crdt actions
|
|
209
296
|
* @param action Action to subscribe to
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
|
|
3
|
-
import { GetNotificationsDataQuery, Notification, NotificationInitialSettingsConfig, NotificationSettingsConfig, NotificationTabConfig } from "../data/notification.model";
|
|
3
|
+
import { CrossOrganizationConfig, GetNotificationsDataQuery, Notification, NotificationInitialSettingsConfig, NotificationSettingsConfig, NotificationTabConfig } from "../data/notification.model";
|
|
4
4
|
|
|
5
5
|
export declare class NotificationElement {
|
|
6
6
|
/**
|
|
@@ -128,6 +128,16 @@ 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
|
+
|
|
131
141
|
constructor();
|
|
132
142
|
|
|
133
143
|
/**
|
|
@@ -254,4 +264,8 @@ export declare class NotificationElement {
|
|
|
254
264
|
* To disable current document only
|
|
255
265
|
*/
|
|
256
266
|
private _disableCurrentDocumentOnly;
|
|
267
|
+
|
|
268
|
+
private _enableCrossOrganization;
|
|
269
|
+
|
|
270
|
+
private _disableCrossOrganization;
|
|
257
271
|
}
|
|
@@ -50,6 +50,21 @@ export declare class PresenceElement {
|
|
|
50
50
|
* Subscribe to presence events
|
|
51
51
|
*/
|
|
52
52
|
on: <T extends keyof PresenceEventTypesMap>(action: T) => Observable<PresenceEventTypesMap[T]>;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Add a custom user to the presence list (e.g., an AI agent).
|
|
56
|
+
* The user will appear in presence alongside real users.
|
|
57
|
+
* @param request Object containing user data with at least userId required.
|
|
58
|
+
*/
|
|
59
|
+
addUser: (request: { user: Partial<PresenceUser>, localOnly?: boolean }) => void;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Remove a previously added custom user from the presence list.
|
|
63
|
+
* @param request Object containing user data with at least userId required, and optional localOnly flag.
|
|
64
|
+
* @param request.localOnly If true, user is only removed locally (not removed from DB). Default: false.
|
|
65
|
+
*/
|
|
66
|
+
removeUser: (request: { user: Partial<PresenceUser>, localOnly?: boolean }) => void;
|
|
67
|
+
|
|
53
68
|
constructor();
|
|
54
69
|
/**
|
|
55
70
|
* Subscribe to a list of all online users who are either active or inactive on the current document.
|
|
@@ -95,4 +110,14 @@ export declare class PresenceElement {
|
|
|
95
110
|
* Subscribe to presence events
|
|
96
111
|
*/
|
|
97
112
|
private _on;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Add a custom user to the presence list
|
|
116
|
+
*/
|
|
117
|
+
private _addUser;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Remove a custom user from the presence list
|
|
121
|
+
*/
|
|
122
|
+
private _removeUser;
|
|
98
123
|
}
|