@liveblocks/core 3.12.0 → 3.12.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.
- package/dist/index.cjs +202 -203
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +102 -66
- package/dist/index.d.ts +102 -66
- package/dist/index.js +161 -162
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -331,22 +331,36 @@ type ContextualPromptContext = {
|
|
|
331
331
|
afterSelection: string;
|
|
332
332
|
};
|
|
333
333
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
334
|
+
type OpCode = (typeof OpCode)[keyof typeof OpCode];
|
|
335
|
+
declare const OpCode: Readonly<{
|
|
336
|
+
INIT: 0;
|
|
337
|
+
SET_PARENT_KEY: 1;
|
|
338
|
+
CREATE_LIST: 2;
|
|
339
|
+
UPDATE_OBJECT: 3;
|
|
340
|
+
CREATE_OBJECT: 4;
|
|
341
|
+
DELETE_CRDT: 5;
|
|
342
|
+
DELETE_OBJECT_KEY: 6;
|
|
343
|
+
CREATE_MAP: 7;
|
|
344
|
+
CREATE_REGISTER: 8;
|
|
345
|
+
ACK: 9;
|
|
346
|
+
}>;
|
|
347
|
+
declare namespace OpCode {
|
|
348
|
+
type INIT = typeof OpCode.INIT;
|
|
349
|
+
type SET_PARENT_KEY = typeof OpCode.SET_PARENT_KEY;
|
|
350
|
+
type CREATE_LIST = typeof OpCode.CREATE_LIST;
|
|
351
|
+
type UPDATE_OBJECT = typeof OpCode.UPDATE_OBJECT;
|
|
352
|
+
type CREATE_OBJECT = typeof OpCode.CREATE_OBJECT;
|
|
353
|
+
type DELETE_CRDT = typeof OpCode.DELETE_CRDT;
|
|
354
|
+
type DELETE_OBJECT_KEY = typeof OpCode.DELETE_OBJECT_KEY;
|
|
355
|
+
type CREATE_MAP = typeof OpCode.CREATE_MAP;
|
|
356
|
+
type CREATE_REGISTER = typeof OpCode.CREATE_REGISTER;
|
|
357
|
+
type ACK = typeof OpCode.ACK;
|
|
344
358
|
}
|
|
345
359
|
/**
|
|
346
360
|
* These operations are the payload for {@link UpdateStorageServerMsg} messages
|
|
347
361
|
* only.
|
|
348
362
|
*/
|
|
349
|
-
type Op =
|
|
363
|
+
type Op = CreateOp | UpdateObjectOp | DeleteCrdtOp | SetParentKeyOp | DeleteObjectKeyOp | AckOpV7 | AckOpV8;
|
|
350
364
|
type CreateOp = CreateObjectOp | CreateRegisterOp | CreateMapOp | CreateListOp;
|
|
351
365
|
type UpdateObjectOp = {
|
|
352
366
|
readonly opId?: string;
|
|
@@ -397,30 +411,15 @@ type DeleteCrdtOp = {
|
|
|
397
411
|
readonly id: string;
|
|
398
412
|
readonly type: OpCode.DELETE_CRDT;
|
|
399
413
|
};
|
|
400
|
-
type
|
|
414
|
+
type AckOpV7 = {
|
|
401
415
|
readonly type: OpCode.DELETE_CRDT;
|
|
402
416
|
readonly id: "ACK";
|
|
403
417
|
readonly opId: string;
|
|
404
418
|
};
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
*
|
|
410
|
-
* Why?
|
|
411
|
-
* It's important for the client to receive an acknowledgement for this, so
|
|
412
|
-
* that it can correctly update its own unacknowledged Ops administration.
|
|
413
|
-
* Otherwise it could get in "synchronizing" state indefinitely.
|
|
414
|
-
*
|
|
415
|
-
* CLEVER HACK
|
|
416
|
-
* Introducing a new Op type for this would not be backward-compatible as
|
|
417
|
-
* receiving such Op would crash old clients :(
|
|
418
|
-
* So the clever backward-compatible hack pulled here is that we codify the
|
|
419
|
-
* acknowledgement as a "deletion Op" for the non-existing node id "ACK". In
|
|
420
|
-
* old clients such Op is accepted, but will effectively be a no-op as that
|
|
421
|
-
* node does not exist, but as a side-effect the Op will get acknowledged.
|
|
422
|
-
*/
|
|
423
|
-
declare function ackOp(opId: string): AckOp;
|
|
419
|
+
type AckOpV8 = {
|
|
420
|
+
readonly type: OpCode.ACK;
|
|
421
|
+
readonly opId: string;
|
|
422
|
+
};
|
|
424
423
|
type SetParentKeyOp = {
|
|
425
424
|
readonly opId?: string;
|
|
426
425
|
readonly id: string;
|
|
@@ -434,13 +433,22 @@ type DeleteObjectKeyOp = {
|
|
|
434
433
|
readonly key: string;
|
|
435
434
|
};
|
|
436
435
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
436
|
+
type ClientMsgCode = (typeof ClientMsgCode)[keyof typeof ClientMsgCode];
|
|
437
|
+
declare const ClientMsgCode: Readonly<{
|
|
438
|
+
UPDATE_PRESENCE: 100;
|
|
439
|
+
BROADCAST_EVENT: 103;
|
|
440
|
+
FETCH_STORAGE: 200;
|
|
441
|
+
UPDATE_STORAGE: 201;
|
|
442
|
+
FETCH_YDOC: 300;
|
|
443
|
+
UPDATE_YDOC: 301;
|
|
444
|
+
}>;
|
|
445
|
+
declare namespace ClientMsgCode {
|
|
446
|
+
type UPDATE_PRESENCE = typeof ClientMsgCode.UPDATE_PRESENCE;
|
|
447
|
+
type BROADCAST_EVENT = typeof ClientMsgCode.BROADCAST_EVENT;
|
|
448
|
+
type FETCH_STORAGE = typeof ClientMsgCode.FETCH_STORAGE;
|
|
449
|
+
type UPDATE_STORAGE = typeof ClientMsgCode.UPDATE_STORAGE;
|
|
450
|
+
type FETCH_YDOC = typeof ClientMsgCode.FETCH_YDOC;
|
|
451
|
+
type UPDATE_YDOC = typeof ClientMsgCode.UPDATE_YDOC;
|
|
444
452
|
}
|
|
445
453
|
/**
|
|
446
454
|
* Messages that can be sent from the client to the server.
|
|
@@ -573,11 +581,18 @@ type PlainLsonList = {
|
|
|
573
581
|
type PlainLson = PlainLsonObject | PlainLsonMap | PlainLsonList | Json;
|
|
574
582
|
|
|
575
583
|
type IdTuple<T> = [id: string, value: T];
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
584
|
+
type CrdtType = (typeof CrdtType)[keyof typeof CrdtType];
|
|
585
|
+
declare const CrdtType: Readonly<{
|
|
586
|
+
OBJECT: 0;
|
|
587
|
+
LIST: 1;
|
|
588
|
+
MAP: 2;
|
|
589
|
+
REGISTER: 3;
|
|
590
|
+
}>;
|
|
591
|
+
declare namespace CrdtType {
|
|
592
|
+
type OBJECT = typeof CrdtType.OBJECT;
|
|
593
|
+
type LIST = typeof CrdtType.LIST;
|
|
594
|
+
type MAP = typeof CrdtType.MAP;
|
|
595
|
+
type REGISTER = typeof CrdtType.REGISTER;
|
|
581
596
|
}
|
|
582
597
|
type SerializedCrdt = SerializedRootObject | SerializedChild;
|
|
583
598
|
type SerializedChild = SerializedObject | SerializedList | SerializedMap | SerializedRegister;
|
|
@@ -2468,25 +2483,46 @@ type Delegates<T extends BaseAuthResult> = {
|
|
|
2468
2483
|
canZombie: () => boolean;
|
|
2469
2484
|
};
|
|
2470
2485
|
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2486
|
+
type ServerMsgCode = (typeof ServerMsgCode)[keyof typeof ServerMsgCode];
|
|
2487
|
+
declare const ServerMsgCode: Readonly<{
|
|
2488
|
+
UPDATE_PRESENCE: 100;
|
|
2489
|
+
USER_JOINED: 101;
|
|
2490
|
+
USER_LEFT: 102;
|
|
2491
|
+
BROADCASTED_EVENT: 103;
|
|
2492
|
+
ROOM_STATE: 104;
|
|
2493
|
+
INITIAL_STORAGE_STATE: 200;
|
|
2494
|
+
UPDATE_STORAGE: 201;
|
|
2495
|
+
UPDATE_YDOC: 300;
|
|
2496
|
+
THREAD_CREATED: 400;
|
|
2497
|
+
THREAD_DELETED: 407;
|
|
2498
|
+
THREAD_METADATA_UPDATED: 401;
|
|
2499
|
+
THREAD_UPDATED: 408;
|
|
2500
|
+
COMMENT_CREATED: 402;
|
|
2501
|
+
COMMENT_EDITED: 403;
|
|
2502
|
+
COMMENT_DELETED: 404;
|
|
2503
|
+
COMMENT_REACTION_ADDED: 405;
|
|
2504
|
+
COMMENT_REACTION_REMOVED: 406;
|
|
2505
|
+
REJECT_STORAGE_OP: 299;
|
|
2506
|
+
}>;
|
|
2507
|
+
declare namespace ServerMsgCode {
|
|
2508
|
+
type UPDATE_PRESENCE = typeof ServerMsgCode.UPDATE_PRESENCE;
|
|
2509
|
+
type USER_JOINED = typeof ServerMsgCode.USER_JOINED;
|
|
2510
|
+
type USER_LEFT = typeof ServerMsgCode.USER_LEFT;
|
|
2511
|
+
type BROADCASTED_EVENT = typeof ServerMsgCode.BROADCASTED_EVENT;
|
|
2512
|
+
type ROOM_STATE = typeof ServerMsgCode.ROOM_STATE;
|
|
2513
|
+
type INITIAL_STORAGE_STATE = typeof ServerMsgCode.INITIAL_STORAGE_STATE;
|
|
2514
|
+
type UPDATE_STORAGE = typeof ServerMsgCode.UPDATE_STORAGE;
|
|
2515
|
+
type UPDATE_YDOC = typeof ServerMsgCode.UPDATE_YDOC;
|
|
2516
|
+
type THREAD_CREATED = typeof ServerMsgCode.THREAD_CREATED;
|
|
2517
|
+
type THREAD_DELETED = typeof ServerMsgCode.THREAD_DELETED;
|
|
2518
|
+
type THREAD_METADATA_UPDATED = typeof ServerMsgCode.THREAD_METADATA_UPDATED;
|
|
2519
|
+
type THREAD_UPDATED = typeof ServerMsgCode.THREAD_UPDATED;
|
|
2520
|
+
type COMMENT_CREATED = typeof ServerMsgCode.COMMENT_CREATED;
|
|
2521
|
+
type COMMENT_EDITED = typeof ServerMsgCode.COMMENT_EDITED;
|
|
2522
|
+
type COMMENT_DELETED = typeof ServerMsgCode.COMMENT_DELETED;
|
|
2523
|
+
type COMMENT_REACTION_ADDED = typeof ServerMsgCode.COMMENT_REACTION_ADDED;
|
|
2524
|
+
type COMMENT_REACTION_REMOVED = typeof ServerMsgCode.COMMENT_REACTION_REMOVED;
|
|
2525
|
+
type REJECT_STORAGE_OP = typeof ServerMsgCode.REJECT_STORAGE_OP;
|
|
2490
2526
|
}
|
|
2491
2527
|
/**
|
|
2492
2528
|
* Messages that can be sent from the server to the client.
|
|
@@ -2676,9 +2712,9 @@ type RoomStateServerMsg<U extends BaseUserMeta> = {
|
|
|
2676
2712
|
};
|
|
2677
2713
|
};
|
|
2678
2714
|
/**
|
|
2679
|
-
*
|
|
2715
|
+
* Metadata sent from the server to the client.
|
|
2680
2716
|
*/
|
|
2681
|
-
readonly meta
|
|
2717
|
+
readonly meta: JsonObject;
|
|
2682
2718
|
};
|
|
2683
2719
|
/**
|
|
2684
2720
|
* Sent by the WebSocket server to a single client in response to the client
|
|
@@ -3564,7 +3600,7 @@ type DynamicSessionInfo = {
|
|
|
3564
3600
|
readonly actor: number;
|
|
3565
3601
|
readonly nonce: string;
|
|
3566
3602
|
readonly scopes: string[];
|
|
3567
|
-
readonly meta
|
|
3603
|
+
readonly meta: JsonObject;
|
|
3568
3604
|
};
|
|
3569
3605
|
type Polyfills = {
|
|
3570
3606
|
atob?: (data: string) => string;
|
|
@@ -5144,4 +5180,4 @@ type EnsureJson<T> = T extends Json ? T : T extends Array<infer I> ? (EnsureJson
|
|
|
5144
5180
|
[K in keyof T as EnsureJson<T[K]> extends never ? never : K]: EnsureJson<T[K]>;
|
|
5145
5181
|
};
|
|
5146
5182
|
|
|
5147
|
-
export { type
|
|
5183
|
+
export { type AckOpV7, type AckOpV8, type ActivityData, type AiAssistantContentPart, type AiAssistantMessage, type AiChat, type AiChatMessage, type AiChatsQuery, type AiKnowledgeRetrievalPart, type AiKnowledgeSource, type AiOpaqueToolDefinition, type AiOpaqueToolInvocationProps, type AiReasoningPart, type AiRetrievalPart, type AiSourcesPart, type AiTextPart, type AiToolDefinition, type AiToolExecuteCallback, type AiToolExecuteContext, type AiToolInvocationPart, type AiToolInvocationProps, type AiToolTypePack, type AiUrlSource, type AiUserMessage, type AiWebRetrievalPart, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, type BaseGroupInfo, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type CommentAttachment, type CommentBody, type CommentBodyBlockElement, type CommentBodyElement, type CommentBodyInlineElement, type CommentBodyLink, type CommentBodyLinkElementArgs, type CommentBodyMention, type CommentBodyMentionElementArgs, type CommentBodyParagraph, type CommentBodyParagraphElementArgs, type CommentBodyText, type CommentBodyTextElementArgs, type CommentData, type CommentDataPlain, type CommentLocalAttachment, type CommentMixedAttachment, type CommentReaction, type CommentUserReaction, type CommentUserReactionPlain, type CommentsEventServerMsg, type ContextualPromptContext, type ContextualPromptResponse, type CopilotId, CrdtType, type CreateListOp, type CreateManagedPoolOptions, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type Cursor, type CustomAuthenticationResult, type DAD, type DE, type DGI, type DM, type DP, type DRI, type DS, type DU, DefaultMap, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, Deque, DerivedSignal, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type DistributiveOmit, type EnsureJson, type EnterOptions, type EventSource, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type GroupData, type GroupDataPlain, type GroupMemberData, type GroupMentionData, type GroupScopes, type History, type HistoryVersion, HttpError, type ISODateString, type ISignal, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IYjsProvider, type IdTuple, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InferFromSchema, type InitialDocumentStateServerMsg, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, type LargeMessageStrategy, type LayerKey, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LiveblocksErrorContext, type LostConnectionEvent, type Lson, type LsonObject, MENTION_CHARACTER, type ManagedPool, type MentionData, type MessageId, MutableSignal, type NoInfr, type NodeMap, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, type Observable, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialNotificationSettings, type PartialUnless, type Patchable, Permission, type PlainLson, type PlainLsonFields, type PlainLsonList, type PlainLsonMap, type PlainLsonObject, type Poller, type PrivateClientApi, type PrivateRoomApi, Promise_withResolvers, type QueryMetadata, type QueryParams, type RejectedStorageOpServerMsg, type Relax, type RenderableToolResultResponse, type Resolve, type ResolveGroupsInfoArgs, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomStateServerMsg, type RoomSubscriptionSettings, type SearchCommentsResult, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type SetParentKeyOp, Signal, type SignalType, SortedList, type Status, type StorageStatus, type StorageUpdate, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type SubscriptionData, type SubscriptionDataPlain, type SubscriptionDeleteInfo, type SubscriptionDeleteInfoPlain, type SubscriptionKey, type SyncSource, type SyncStatus, TextEditorType, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToImmutable, type ToJson, type ToolResultResponse, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type UploadAttachmentOptions, type UrlMetadata, type User, type UserJoinServerMsg, type UserLeftServerMsg, type UserMentionData, type UserRoomSubscriptionSettings, type UserSubscriptionData, type UserSubscriptionDataPlain, WebsocketCloseCodes, type WithNavigation, type WithOptional, type WithRequired, type YDocUpdateServerMsg, type YjsSyncStatus, asPos, assert, assertNever, autoRetry, b64decode, batch, checkBounds, chunk, cloneLson, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToGroupData, convertToInboxNotificationData, convertToSubscriptionData, convertToThreadData, convertToUserSubscriptionData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createManagedPool, createNotificationSettings, createThreadId, defineAiTool, deprecate, deprecateIf, detectDupes, entries, errorIf, findLastIndex, freeze, generateUrl, getMentionsFromCommentBody, getSubscriptionKey, html, htmlSafe, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isNotificationChannelEnabled, isNumberOperator, isPlainObject, isStartsWithOperator, isUrl, kInternal, keys, legacy_patchImmutableObject, lsonToJson, makeAbortController, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, objectToQuery, patchLiveObjectKey, patchNotificationSettings, raise, resolveMentionsInCommentBody, sanitizeUrl, shallow, shallow2, stableStringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, url, urljoin, wait, warnOnce, warnOnceIf, withTimeout };
|
package/dist/index.d.ts
CHANGED
|
@@ -331,22 +331,36 @@ type ContextualPromptContext = {
|
|
|
331
331
|
afterSelection: string;
|
|
332
332
|
};
|
|
333
333
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
334
|
+
type OpCode = (typeof OpCode)[keyof typeof OpCode];
|
|
335
|
+
declare const OpCode: Readonly<{
|
|
336
|
+
INIT: 0;
|
|
337
|
+
SET_PARENT_KEY: 1;
|
|
338
|
+
CREATE_LIST: 2;
|
|
339
|
+
UPDATE_OBJECT: 3;
|
|
340
|
+
CREATE_OBJECT: 4;
|
|
341
|
+
DELETE_CRDT: 5;
|
|
342
|
+
DELETE_OBJECT_KEY: 6;
|
|
343
|
+
CREATE_MAP: 7;
|
|
344
|
+
CREATE_REGISTER: 8;
|
|
345
|
+
ACK: 9;
|
|
346
|
+
}>;
|
|
347
|
+
declare namespace OpCode {
|
|
348
|
+
type INIT = typeof OpCode.INIT;
|
|
349
|
+
type SET_PARENT_KEY = typeof OpCode.SET_PARENT_KEY;
|
|
350
|
+
type CREATE_LIST = typeof OpCode.CREATE_LIST;
|
|
351
|
+
type UPDATE_OBJECT = typeof OpCode.UPDATE_OBJECT;
|
|
352
|
+
type CREATE_OBJECT = typeof OpCode.CREATE_OBJECT;
|
|
353
|
+
type DELETE_CRDT = typeof OpCode.DELETE_CRDT;
|
|
354
|
+
type DELETE_OBJECT_KEY = typeof OpCode.DELETE_OBJECT_KEY;
|
|
355
|
+
type CREATE_MAP = typeof OpCode.CREATE_MAP;
|
|
356
|
+
type CREATE_REGISTER = typeof OpCode.CREATE_REGISTER;
|
|
357
|
+
type ACK = typeof OpCode.ACK;
|
|
344
358
|
}
|
|
345
359
|
/**
|
|
346
360
|
* These operations are the payload for {@link UpdateStorageServerMsg} messages
|
|
347
361
|
* only.
|
|
348
362
|
*/
|
|
349
|
-
type Op =
|
|
363
|
+
type Op = CreateOp | UpdateObjectOp | DeleteCrdtOp | SetParentKeyOp | DeleteObjectKeyOp | AckOpV7 | AckOpV8;
|
|
350
364
|
type CreateOp = CreateObjectOp | CreateRegisterOp | CreateMapOp | CreateListOp;
|
|
351
365
|
type UpdateObjectOp = {
|
|
352
366
|
readonly opId?: string;
|
|
@@ -397,30 +411,15 @@ type DeleteCrdtOp = {
|
|
|
397
411
|
readonly id: string;
|
|
398
412
|
readonly type: OpCode.DELETE_CRDT;
|
|
399
413
|
};
|
|
400
|
-
type
|
|
414
|
+
type AckOpV7 = {
|
|
401
415
|
readonly type: OpCode.DELETE_CRDT;
|
|
402
416
|
readonly id: "ACK";
|
|
403
417
|
readonly opId: string;
|
|
404
418
|
};
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
*
|
|
410
|
-
* Why?
|
|
411
|
-
* It's important for the client to receive an acknowledgement for this, so
|
|
412
|
-
* that it can correctly update its own unacknowledged Ops administration.
|
|
413
|
-
* Otherwise it could get in "synchronizing" state indefinitely.
|
|
414
|
-
*
|
|
415
|
-
* CLEVER HACK
|
|
416
|
-
* Introducing a new Op type for this would not be backward-compatible as
|
|
417
|
-
* receiving such Op would crash old clients :(
|
|
418
|
-
* So the clever backward-compatible hack pulled here is that we codify the
|
|
419
|
-
* acknowledgement as a "deletion Op" for the non-existing node id "ACK". In
|
|
420
|
-
* old clients such Op is accepted, but will effectively be a no-op as that
|
|
421
|
-
* node does not exist, but as a side-effect the Op will get acknowledged.
|
|
422
|
-
*/
|
|
423
|
-
declare function ackOp(opId: string): AckOp;
|
|
419
|
+
type AckOpV8 = {
|
|
420
|
+
readonly type: OpCode.ACK;
|
|
421
|
+
readonly opId: string;
|
|
422
|
+
};
|
|
424
423
|
type SetParentKeyOp = {
|
|
425
424
|
readonly opId?: string;
|
|
426
425
|
readonly id: string;
|
|
@@ -434,13 +433,22 @@ type DeleteObjectKeyOp = {
|
|
|
434
433
|
readonly key: string;
|
|
435
434
|
};
|
|
436
435
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
436
|
+
type ClientMsgCode = (typeof ClientMsgCode)[keyof typeof ClientMsgCode];
|
|
437
|
+
declare const ClientMsgCode: Readonly<{
|
|
438
|
+
UPDATE_PRESENCE: 100;
|
|
439
|
+
BROADCAST_EVENT: 103;
|
|
440
|
+
FETCH_STORAGE: 200;
|
|
441
|
+
UPDATE_STORAGE: 201;
|
|
442
|
+
FETCH_YDOC: 300;
|
|
443
|
+
UPDATE_YDOC: 301;
|
|
444
|
+
}>;
|
|
445
|
+
declare namespace ClientMsgCode {
|
|
446
|
+
type UPDATE_PRESENCE = typeof ClientMsgCode.UPDATE_PRESENCE;
|
|
447
|
+
type BROADCAST_EVENT = typeof ClientMsgCode.BROADCAST_EVENT;
|
|
448
|
+
type FETCH_STORAGE = typeof ClientMsgCode.FETCH_STORAGE;
|
|
449
|
+
type UPDATE_STORAGE = typeof ClientMsgCode.UPDATE_STORAGE;
|
|
450
|
+
type FETCH_YDOC = typeof ClientMsgCode.FETCH_YDOC;
|
|
451
|
+
type UPDATE_YDOC = typeof ClientMsgCode.UPDATE_YDOC;
|
|
444
452
|
}
|
|
445
453
|
/**
|
|
446
454
|
* Messages that can be sent from the client to the server.
|
|
@@ -573,11 +581,18 @@ type PlainLsonList = {
|
|
|
573
581
|
type PlainLson = PlainLsonObject | PlainLsonMap | PlainLsonList | Json;
|
|
574
582
|
|
|
575
583
|
type IdTuple<T> = [id: string, value: T];
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
584
|
+
type CrdtType = (typeof CrdtType)[keyof typeof CrdtType];
|
|
585
|
+
declare const CrdtType: Readonly<{
|
|
586
|
+
OBJECT: 0;
|
|
587
|
+
LIST: 1;
|
|
588
|
+
MAP: 2;
|
|
589
|
+
REGISTER: 3;
|
|
590
|
+
}>;
|
|
591
|
+
declare namespace CrdtType {
|
|
592
|
+
type OBJECT = typeof CrdtType.OBJECT;
|
|
593
|
+
type LIST = typeof CrdtType.LIST;
|
|
594
|
+
type MAP = typeof CrdtType.MAP;
|
|
595
|
+
type REGISTER = typeof CrdtType.REGISTER;
|
|
581
596
|
}
|
|
582
597
|
type SerializedCrdt = SerializedRootObject | SerializedChild;
|
|
583
598
|
type SerializedChild = SerializedObject | SerializedList | SerializedMap | SerializedRegister;
|
|
@@ -2468,25 +2483,46 @@ type Delegates<T extends BaseAuthResult> = {
|
|
|
2468
2483
|
canZombie: () => boolean;
|
|
2469
2484
|
};
|
|
2470
2485
|
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2486
|
+
type ServerMsgCode = (typeof ServerMsgCode)[keyof typeof ServerMsgCode];
|
|
2487
|
+
declare const ServerMsgCode: Readonly<{
|
|
2488
|
+
UPDATE_PRESENCE: 100;
|
|
2489
|
+
USER_JOINED: 101;
|
|
2490
|
+
USER_LEFT: 102;
|
|
2491
|
+
BROADCASTED_EVENT: 103;
|
|
2492
|
+
ROOM_STATE: 104;
|
|
2493
|
+
INITIAL_STORAGE_STATE: 200;
|
|
2494
|
+
UPDATE_STORAGE: 201;
|
|
2495
|
+
UPDATE_YDOC: 300;
|
|
2496
|
+
THREAD_CREATED: 400;
|
|
2497
|
+
THREAD_DELETED: 407;
|
|
2498
|
+
THREAD_METADATA_UPDATED: 401;
|
|
2499
|
+
THREAD_UPDATED: 408;
|
|
2500
|
+
COMMENT_CREATED: 402;
|
|
2501
|
+
COMMENT_EDITED: 403;
|
|
2502
|
+
COMMENT_DELETED: 404;
|
|
2503
|
+
COMMENT_REACTION_ADDED: 405;
|
|
2504
|
+
COMMENT_REACTION_REMOVED: 406;
|
|
2505
|
+
REJECT_STORAGE_OP: 299;
|
|
2506
|
+
}>;
|
|
2507
|
+
declare namespace ServerMsgCode {
|
|
2508
|
+
type UPDATE_PRESENCE = typeof ServerMsgCode.UPDATE_PRESENCE;
|
|
2509
|
+
type USER_JOINED = typeof ServerMsgCode.USER_JOINED;
|
|
2510
|
+
type USER_LEFT = typeof ServerMsgCode.USER_LEFT;
|
|
2511
|
+
type BROADCASTED_EVENT = typeof ServerMsgCode.BROADCASTED_EVENT;
|
|
2512
|
+
type ROOM_STATE = typeof ServerMsgCode.ROOM_STATE;
|
|
2513
|
+
type INITIAL_STORAGE_STATE = typeof ServerMsgCode.INITIAL_STORAGE_STATE;
|
|
2514
|
+
type UPDATE_STORAGE = typeof ServerMsgCode.UPDATE_STORAGE;
|
|
2515
|
+
type UPDATE_YDOC = typeof ServerMsgCode.UPDATE_YDOC;
|
|
2516
|
+
type THREAD_CREATED = typeof ServerMsgCode.THREAD_CREATED;
|
|
2517
|
+
type THREAD_DELETED = typeof ServerMsgCode.THREAD_DELETED;
|
|
2518
|
+
type THREAD_METADATA_UPDATED = typeof ServerMsgCode.THREAD_METADATA_UPDATED;
|
|
2519
|
+
type THREAD_UPDATED = typeof ServerMsgCode.THREAD_UPDATED;
|
|
2520
|
+
type COMMENT_CREATED = typeof ServerMsgCode.COMMENT_CREATED;
|
|
2521
|
+
type COMMENT_EDITED = typeof ServerMsgCode.COMMENT_EDITED;
|
|
2522
|
+
type COMMENT_DELETED = typeof ServerMsgCode.COMMENT_DELETED;
|
|
2523
|
+
type COMMENT_REACTION_ADDED = typeof ServerMsgCode.COMMENT_REACTION_ADDED;
|
|
2524
|
+
type COMMENT_REACTION_REMOVED = typeof ServerMsgCode.COMMENT_REACTION_REMOVED;
|
|
2525
|
+
type REJECT_STORAGE_OP = typeof ServerMsgCode.REJECT_STORAGE_OP;
|
|
2490
2526
|
}
|
|
2491
2527
|
/**
|
|
2492
2528
|
* Messages that can be sent from the server to the client.
|
|
@@ -2676,9 +2712,9 @@ type RoomStateServerMsg<U extends BaseUserMeta> = {
|
|
|
2676
2712
|
};
|
|
2677
2713
|
};
|
|
2678
2714
|
/**
|
|
2679
|
-
*
|
|
2715
|
+
* Metadata sent from the server to the client.
|
|
2680
2716
|
*/
|
|
2681
|
-
readonly meta
|
|
2717
|
+
readonly meta: JsonObject;
|
|
2682
2718
|
};
|
|
2683
2719
|
/**
|
|
2684
2720
|
* Sent by the WebSocket server to a single client in response to the client
|
|
@@ -3564,7 +3600,7 @@ type DynamicSessionInfo = {
|
|
|
3564
3600
|
readonly actor: number;
|
|
3565
3601
|
readonly nonce: string;
|
|
3566
3602
|
readonly scopes: string[];
|
|
3567
|
-
readonly meta
|
|
3603
|
+
readonly meta: JsonObject;
|
|
3568
3604
|
};
|
|
3569
3605
|
type Polyfills = {
|
|
3570
3606
|
atob?: (data: string) => string;
|
|
@@ -5144,4 +5180,4 @@ type EnsureJson<T> = T extends Json ? T : T extends Array<infer I> ? (EnsureJson
|
|
|
5144
5180
|
[K in keyof T as EnsureJson<T[K]> extends never ? never : K]: EnsureJson<T[K]>;
|
|
5145
5181
|
};
|
|
5146
5182
|
|
|
5147
|
-
export { type
|
|
5183
|
+
export { type AckOpV7, type AckOpV8, type ActivityData, type AiAssistantContentPart, type AiAssistantMessage, type AiChat, type AiChatMessage, type AiChatsQuery, type AiKnowledgeRetrievalPart, type AiKnowledgeSource, type AiOpaqueToolDefinition, type AiOpaqueToolInvocationProps, type AiReasoningPart, type AiRetrievalPart, type AiSourcesPart, type AiTextPart, type AiToolDefinition, type AiToolExecuteCallback, type AiToolExecuteContext, type AiToolInvocationPart, type AiToolInvocationProps, type AiToolTypePack, type AiUrlSource, type AiUserMessage, type AiWebRetrievalPart, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, type BaseGroupInfo, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type CommentAttachment, type CommentBody, type CommentBodyBlockElement, type CommentBodyElement, type CommentBodyInlineElement, type CommentBodyLink, type CommentBodyLinkElementArgs, type CommentBodyMention, type CommentBodyMentionElementArgs, type CommentBodyParagraph, type CommentBodyParagraphElementArgs, type CommentBodyText, type CommentBodyTextElementArgs, type CommentData, type CommentDataPlain, type CommentLocalAttachment, type CommentMixedAttachment, type CommentReaction, type CommentUserReaction, type CommentUserReactionPlain, type CommentsEventServerMsg, type ContextualPromptContext, type ContextualPromptResponse, type CopilotId, CrdtType, type CreateListOp, type CreateManagedPoolOptions, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type Cursor, type CustomAuthenticationResult, type DAD, type DE, type DGI, type DM, type DP, type DRI, type DS, type DU, DefaultMap, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, Deque, DerivedSignal, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type DistributiveOmit, type EnsureJson, type EnterOptions, type EventSource, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type GroupData, type GroupDataPlain, type GroupMemberData, type GroupMentionData, type GroupScopes, type History, type HistoryVersion, HttpError, type ISODateString, type ISignal, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IYjsProvider, type IdTuple, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InferFromSchema, type InitialDocumentStateServerMsg, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, type LargeMessageStrategy, type LayerKey, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LiveblocksErrorContext, type LostConnectionEvent, type Lson, type LsonObject, MENTION_CHARACTER, type ManagedPool, type MentionData, type MessageId, MutableSignal, type NoInfr, type NodeMap, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, type Observable, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialNotificationSettings, type PartialUnless, type Patchable, Permission, type PlainLson, type PlainLsonFields, type PlainLsonList, type PlainLsonMap, type PlainLsonObject, type Poller, type PrivateClientApi, type PrivateRoomApi, Promise_withResolvers, type QueryMetadata, type QueryParams, type RejectedStorageOpServerMsg, type Relax, type RenderableToolResultResponse, type Resolve, type ResolveGroupsInfoArgs, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomStateServerMsg, type RoomSubscriptionSettings, type SearchCommentsResult, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type SetParentKeyOp, Signal, type SignalType, SortedList, type Status, type StorageStatus, type StorageUpdate, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type SubscriptionData, type SubscriptionDataPlain, type SubscriptionDeleteInfo, type SubscriptionDeleteInfoPlain, type SubscriptionKey, type SyncSource, type SyncStatus, TextEditorType, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToImmutable, type ToJson, type ToolResultResponse, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type UploadAttachmentOptions, type UrlMetadata, type User, type UserJoinServerMsg, type UserLeftServerMsg, type UserMentionData, type UserRoomSubscriptionSettings, type UserSubscriptionData, type UserSubscriptionDataPlain, WebsocketCloseCodes, type WithNavigation, type WithOptional, type WithRequired, type YDocUpdateServerMsg, type YjsSyncStatus, asPos, assert, assertNever, autoRetry, b64decode, batch, checkBounds, chunk, cloneLson, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToGroupData, convertToInboxNotificationData, convertToSubscriptionData, convertToThreadData, convertToUserSubscriptionData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createManagedPool, createNotificationSettings, createThreadId, defineAiTool, deprecate, deprecateIf, detectDupes, entries, errorIf, findLastIndex, freeze, generateUrl, getMentionsFromCommentBody, getSubscriptionKey, html, htmlSafe, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isNotificationChannelEnabled, isNumberOperator, isPlainObject, isStartsWithOperator, isUrl, kInternal, keys, legacy_patchImmutableObject, lsonToJson, makeAbortController, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, objectToQuery, patchLiveObjectKey, patchNotificationSettings, raise, resolveMentionsInCommentBody, sanitizeUrl, shallow, shallow2, stableStringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, url, urljoin, wait, warnOnce, warnOnceIf, withTimeout };
|