@veltdev/sdk 5.0.2-beta.32 → 5.0.2-beta.34
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 +18 -0
- package/app/models/data/notification.model.d.ts +22 -0
- package/app/models/data/page-info.model.d.ts +9 -0
- package/app/models/element/notification-element.model.d.ts +15 -1
- package/app/utils/console.d.ts +25 -0
- package/app/utils/constants.d.ts +2 -0
- package/app/utils/page-info-store.d.ts +29 -0
- package/environments/environment.d.ts +45 -0
- package/package.json +1 -1
- package/types.d.ts +1 -0
- package/velt.js +93 -94
|
@@ -24,6 +24,7 @@ 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";
|
|
27
28
|
import { ReactionElement } from "../models/element/reaction-element.model";
|
|
28
29
|
import { CrdtElement } from "../models/element/crdt-element.model";
|
|
29
30
|
import { VeltEventMetadata, VeltDebugInfo } from "../models/data/event-metadata.data.model";
|
|
@@ -55,6 +56,23 @@ export declare class Snippyly {
|
|
|
55
56
|
* @param documentMetadata Document Metadata
|
|
56
57
|
*/
|
|
57
58
|
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;
|
|
58
76
|
/**
|
|
59
77
|
* Tell us the unique ID of the current document/resource on which you want to enable collaboration.
|
|
60
78
|
* @param id unique document ID
|
|
@@ -257,3 +257,25 @@ export interface NotificationsDocConfig {
|
|
|
257
257
|
export interface GetNotificationsDataQuery {
|
|
258
258
|
type?: 'all' | 'forYou' | 'documents';
|
|
259
259
|
}
|
|
260
|
+
/**
|
|
261
|
+
* Configuration for the opt-in cross-organization "For You" notifications feature.
|
|
262
|
+
*
|
|
263
|
+
* When enabled, the SDK merges notifications from other organizations the user
|
|
264
|
+
* belongs to (resolved from the global `userNotificationIndex`) into the existing
|
|
265
|
+
* "For You" feed. All fields are optional; sensible defaults are applied by
|
|
266
|
+
* `NotificationService.setCrossOrganizationConfig`.
|
|
267
|
+
*
|
|
268
|
+
* @see specs/notification-api-scope/spec.md
|
|
269
|
+
*/
|
|
270
|
+
export interface CrossOrganizationConfig {
|
|
271
|
+
/** Whether cross-organization notifications are active. Defaults to `true` on enable. */
|
|
272
|
+
enabled?: boolean;
|
|
273
|
+
/** Allowlist of organization IDs to include. When omitted, all indexed orgs are eligible. */
|
|
274
|
+
organizationIds?: string[];
|
|
275
|
+
/** Organization IDs to exclude. The current organization is always excluded. */
|
|
276
|
+
excludeOrganizationIds?: string[];
|
|
277
|
+
/** Upper bound on the number of organizations fetched. Defaults to 20. */
|
|
278
|
+
maxOrganizations?: number;
|
|
279
|
+
/** Feeds the merge applies to. Only `'forYou'` is supported; `'all'` is ignored with a warning. */
|
|
280
|
+
feeds?: ('forYou' | 'all')[];
|
|
281
|
+
}
|
|
@@ -47,4 +47,13 @@ export declare class PageInfo {
|
|
|
47
47
|
*/
|
|
48
48
|
screenWidth?: number;
|
|
49
49
|
deviceInfo?: IDeviceInfo;
|
|
50
|
+
/**
|
|
51
|
+
* @param applyClientOverride when true (default), merges the CURRENT document's client page
|
|
52
|
+
* info override at construction time — covers the bare `new PageInfo()` sites
|
|
53
|
+
* (cursor / presence / selection). No-op when the client hasn't provided any, so the
|
|
54
|
+
* default empty-page-info behavior is unchanged. `getPageInfo(documentId)` passes
|
|
55
|
+
* `false` so it can apply a specific document's override itself, without the current
|
|
56
|
+
* document's fields leaking onto a different document's page info.
|
|
57
|
+
*/
|
|
58
|
+
constructor(applyClientOverride?: boolean);
|
|
50
59
|
}
|
|
@@ -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
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare class Console {
|
|
2
|
+
static log: {
|
|
3
|
+
(...data: any[]): void;
|
|
4
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
5
|
+
};
|
|
6
|
+
static warn: {
|
|
7
|
+
(...data: any[]): void;
|
|
8
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
9
|
+
};
|
|
10
|
+
static error: {
|
|
11
|
+
(...data: any[]): void;
|
|
12
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
13
|
+
};
|
|
14
|
+
static debug: {
|
|
15
|
+
(...data: any[]): void;
|
|
16
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
17
|
+
};
|
|
18
|
+
static info: {
|
|
19
|
+
(...data: any[]): void;
|
|
20
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
21
|
+
};
|
|
22
|
+
static logsEnabled: boolean;
|
|
23
|
+
static catch: (message: string, error?: any) => void;
|
|
24
|
+
static showLogs(): boolean;
|
|
25
|
+
}
|
package/app/utils/constants.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ export declare class Constants {
|
|
|
37
37
|
static FIREBASE_PARTIAL_PATH_NOTIFICATION_USERS: string;
|
|
38
38
|
static FIREBASE_PARTIAL_PATH_DOC_NOTIFICATION: string;
|
|
39
39
|
static FIREBASE_PARTIAL_PATH_USER_NOTIFICATION: string;
|
|
40
|
+
static FIREBASE_PARTIAL_PATH_USER_NOTIFICATION_INDEX: string;
|
|
40
41
|
static FIREBASE_PARTIAL_PATH_GLOBAL: string;
|
|
41
42
|
static FIREBASE_PARTIAL_PATH_LOGINS: string;
|
|
42
43
|
static FIREBASE_PARTIAL_PATH_METADATA: string;
|
|
@@ -438,6 +439,7 @@ export declare class Constants {
|
|
|
438
439
|
VELT_SKELETON_LOADER: string;
|
|
439
440
|
VELT_SHADOW_DOM_INTERNAL: string;
|
|
440
441
|
VELT_SINGLE_EDITOR_MODE_PANEL: string;
|
|
442
|
+
VELT_MULTI_THREAD_COMMENT_DIALOG: string;
|
|
441
443
|
VELT_MULTI_THREAD_COMMENT_DIALOG_LIST: string;
|
|
442
444
|
VELT_MULTI_THREAD_COMMENT_DIALOG_PANEL: string;
|
|
443
445
|
VELT_MULTI_THREAD_COMMENT_DIALOG_COMPOSER_CONTAINER: string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { PageInfo } from "../models/data/page-info.model";
|
|
2
|
+
/**
|
|
3
|
+
* Register a resolver that returns the current client document id.
|
|
4
|
+
* Used to pick the right per-document override when no explicit document id is passed.
|
|
5
|
+
*/
|
|
6
|
+
export declare const registerCurrentClientDocumentIdGetter: (getter: () => string | number | undefined | null) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Set client-provided page info.
|
|
9
|
+
* @param pageInfo page info provided by the client
|
|
10
|
+
* @param documentId optional client document id; when omitted, sets the global override
|
|
11
|
+
*/
|
|
12
|
+
export declare const setClientPageInfo: (pageInfo: Partial<PageInfo> | undefined | null, documentId?: string | number) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Clear client-provided page info.
|
|
15
|
+
* @param documentId optional client document id; when omitted, clears the global override
|
|
16
|
+
*/
|
|
17
|
+
export declare const clearClientPageInfo: (documentId?: string | number) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Get the client-provided page info that applies for the given (or current) document.
|
|
20
|
+
* Per-document override wins; otherwise falls back to the global override.
|
|
21
|
+
* @param documentId optional client document id; when omitted, resolves the current document
|
|
22
|
+
* @returns client page info, or undefined when the client has not provided any
|
|
23
|
+
*/
|
|
24
|
+
export declare const getClientPageInfo: (documentId?: string | number) => Partial<PageInfo> | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Reset all client page info and the registered document-id resolver.
|
|
27
|
+
* Intended for tests.
|
|
28
|
+
*/
|
|
29
|
+
export declare const resetClientPageInfo: () => void;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export declare const environment: {
|
|
2
|
+
production: boolean;
|
|
3
|
+
staging: boolean;
|
|
4
|
+
firebaseLogLevel: string;
|
|
5
|
+
firebaseConfig: {
|
|
6
|
+
apiKey: string;
|
|
7
|
+
authDomain: string;
|
|
8
|
+
projectId: string;
|
|
9
|
+
storageBucket: string;
|
|
10
|
+
messagingSenderId: string;
|
|
11
|
+
appId: string;
|
|
12
|
+
};
|
|
13
|
+
firebaseNotificationsDatabaseURL: string;
|
|
14
|
+
segmentAnalyticsWriteKey: string;
|
|
15
|
+
useEmulators: boolean;
|
|
16
|
+
debugMode: boolean;
|
|
17
|
+
cloudFunction: {
|
|
18
|
+
sa: string;
|
|
19
|
+
getIceServers: string;
|
|
20
|
+
validateClient: string;
|
|
21
|
+
convertRecording: string;
|
|
22
|
+
chatgptCompletion: string;
|
|
23
|
+
rewriterAskAi: string;
|
|
24
|
+
whisperTranscription: string;
|
|
25
|
+
getPlanDetails: string;
|
|
26
|
+
getAllowedDocuments: string;
|
|
27
|
+
getNotificationsForDocuments: string;
|
|
28
|
+
videoBackend: string;
|
|
29
|
+
processRecording: string;
|
|
30
|
+
sdkProxy: string;
|
|
31
|
+
screenshot: string;
|
|
32
|
+
usCentral1: {
|
|
33
|
+
setEncryptedData: string;
|
|
34
|
+
};
|
|
35
|
+
asiaSouthEast1: {
|
|
36
|
+
setEncryptedData: string;
|
|
37
|
+
};
|
|
38
|
+
europeWest1: {
|
|
39
|
+
setEncryptedData: string;
|
|
40
|
+
};
|
|
41
|
+
asiaNorthEast1: {
|
|
42
|
+
setEncryptedData: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veltdev/sdk",
|
|
3
|
-
"version": "5.0.2-beta.
|
|
3
|
+
"version": "5.0.2-beta.34",
|
|
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,6 +14,7 @@ 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';
|
|
17
18
|
export * from './app/models/element/autocomplete-element.model';
|
|
18
19
|
export * from './app/models/element/reaction-element.model';
|
|
19
20
|
export * from './app/models/element/crdt-element.model';
|