@liveblocks/core 3.20.0-rc1 → 3.20.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 +774 -413
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +193 -126
- package/dist/index.d.ts +193 -126
- package/dist/index.js +667 -306
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -64,6 +64,83 @@ type DistributiveRelax<T, Ks extends string | number | symbol> = T extends any ?
|
|
|
64
64
|
[K in Exclude<Ks, keyof T>]?: never;
|
|
65
65
|
}> : never;
|
|
66
66
|
|
|
67
|
+
declare const Permission: {
|
|
68
|
+
/**
|
|
69
|
+
* Default permission for a room.
|
|
70
|
+
*/
|
|
71
|
+
readonly Read: "*:read";
|
|
72
|
+
readonly Write: "*:write";
|
|
73
|
+
/**
|
|
74
|
+
* Legacy aliases for default room permissions.
|
|
75
|
+
*/
|
|
76
|
+
readonly RoomWrite: "room:write";
|
|
77
|
+
readonly RoomRead: "room:read";
|
|
78
|
+
/**
|
|
79
|
+
* Storage
|
|
80
|
+
*/
|
|
81
|
+
readonly StorageRead: "storage:read";
|
|
82
|
+
readonly StorageWrite: "storage:write";
|
|
83
|
+
readonly StorageNone: "storage:none";
|
|
84
|
+
/**
|
|
85
|
+
* Comments
|
|
86
|
+
*/
|
|
87
|
+
readonly CommentsWrite: "comments:write";
|
|
88
|
+
readonly CommentsRead: "comments:read";
|
|
89
|
+
readonly CommentsNone: "comments:none";
|
|
90
|
+
/**
|
|
91
|
+
* Feeds
|
|
92
|
+
*/
|
|
93
|
+
readonly FeedsRead: "feeds:read";
|
|
94
|
+
readonly FeedsWrite: "feeds:write";
|
|
95
|
+
readonly FeedsNone: "feeds:none";
|
|
96
|
+
/**
|
|
97
|
+
* Legacy
|
|
98
|
+
*/
|
|
99
|
+
readonly LegacyRoomPresenceWrite: "room:presence:write";
|
|
100
|
+
};
|
|
101
|
+
type Permission = (typeof Permission)[keyof typeof Permission];
|
|
102
|
+
declare const ACCESS_LEVELS: readonly ["none", "read", "write"];
|
|
103
|
+
type AccessLevel = (typeof ACCESS_LEVELS)[number];
|
|
104
|
+
type RequiredAccessLevel = "read" | "write";
|
|
105
|
+
type PermissionMatrix = {
|
|
106
|
+
room: AccessLevel;
|
|
107
|
+
storage: AccessLevel;
|
|
108
|
+
comments: AccessLevel;
|
|
109
|
+
feeds: AccessLevel;
|
|
110
|
+
personal: AccessLevel;
|
|
111
|
+
};
|
|
112
|
+
type PermissionResources = keyof PermissionMatrix;
|
|
113
|
+
type RoomPermissions = Permission[];
|
|
114
|
+
type RoomAccesses = Record<string, RoomPermissions>;
|
|
115
|
+
type UpdateRoomAccesses = Record<string, RoomPermissions | null>;
|
|
116
|
+
declare function permissionMatrixFromScopes(scopes: RoomPermissions): PermissionMatrix;
|
|
117
|
+
declare function hasPermissionAccess(matrix: Partial<PermissionMatrix>, resource: PermissionResources, requiredAccess: RequiredAccessLevel): boolean;
|
|
118
|
+
declare function normalizeRoomPermissions(permissions: string[] | readonly string[]): RoomPermissions;
|
|
119
|
+
declare function normalizeRoomAccesses(accesses: RoomAccesses | undefined): RoomAccesses | undefined;
|
|
120
|
+
declare function normalizeUpdateRoomAccesses(accesses: UpdateRoomAccesses | undefined): UpdateRoomAccesses | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* Merges permission scopes from multiple sources, by priority: explicit user
|
|
123
|
+
* accesses override group accesses, which override the room defaults. Groups
|
|
124
|
+
* all share the same priority, so they are first merged together by taking
|
|
125
|
+
* the highest access level per feature (and base).
|
|
126
|
+
*/
|
|
127
|
+
declare function mergeRoomPermissionScopes({ defaultAccesses, groupsAccesses, userAccesses, }: {
|
|
128
|
+
defaultAccesses: RoomPermissions;
|
|
129
|
+
groupsAccesses: RoomPermissions[];
|
|
130
|
+
userAccesses: RoomPermissions;
|
|
131
|
+
}): RoomPermissions;
|
|
132
|
+
/**
|
|
133
|
+
* Validates a set of permissions:
|
|
134
|
+
* - every scope must be a known permission scope,
|
|
135
|
+
* - exactly one base permission is required (*:read, *:write, or the legacy
|
|
136
|
+
* aliases room:read, room:write),
|
|
137
|
+
* - at most one scope per feature (storage, comments, feeds, ...),
|
|
138
|
+
* - room:presence:write is accepted as an extra legacy scope.
|
|
139
|
+
*
|
|
140
|
+
* Returns `true` when the set is valid, or an error message otherwise.
|
|
141
|
+
*/
|
|
142
|
+
declare function validatePermissionsSet(scopes: readonly string[]): true | string;
|
|
143
|
+
|
|
67
144
|
type CustomAuthenticationResult = Relax<{
|
|
68
145
|
token: string;
|
|
69
146
|
} | {
|
|
@@ -132,15 +209,6 @@ type BaseUserMeta = {
|
|
|
132
209
|
info?: IUserInfo;
|
|
133
210
|
};
|
|
134
211
|
|
|
135
|
-
declare enum Permission {
|
|
136
|
-
Read = "room:read",
|
|
137
|
-
Write = "room:write",
|
|
138
|
-
PresenceWrite = "room:presence:write",
|
|
139
|
-
CommentsWrite = "comments:write",
|
|
140
|
-
CommentsRead = "comments:read",
|
|
141
|
-
FeedsWrite = "feeds:write"
|
|
142
|
-
}
|
|
143
|
-
|
|
144
212
|
type RenameDataField<T, TFieldName extends string> = T extends any ? {
|
|
145
213
|
[K in keyof T as K extends "data" ? TFieldName : K]: T[K];
|
|
146
214
|
} : never;
|
|
@@ -242,90 +310,6 @@ type BatchStore<O, I> = {
|
|
|
242
310
|
invalidate: (inputs?: I[]) => void;
|
|
243
311
|
};
|
|
244
312
|
|
|
245
|
-
declare const kTrigger: unique symbol;
|
|
246
|
-
/**
|
|
247
|
-
* Runs a callback function that is allowed to change multiple signals. At the
|
|
248
|
-
* end of the batch, all changed signals will be notified (at most once).
|
|
249
|
-
*
|
|
250
|
-
* Nesting batches is supported.
|
|
251
|
-
*/
|
|
252
|
-
declare function batch(callback: Callback<void>): void;
|
|
253
|
-
type SignalType<S extends ISignal<any>> = S extends ISignal<infer T> ? T : never;
|
|
254
|
-
interface ISignal<T> {
|
|
255
|
-
get(): T;
|
|
256
|
-
subscribe(callback: Callback<void>): UnsubscribeCallback;
|
|
257
|
-
addSink(sink: DerivedSignal<unknown>): void;
|
|
258
|
-
removeSink(sink: DerivedSignal<unknown>): void;
|
|
259
|
-
}
|
|
260
|
-
/**
|
|
261
|
-
* Base functionality every Signal implementation needs.
|
|
262
|
-
*/
|
|
263
|
-
declare abstract class AbstractSignal<T> implements ISignal<T>, Observable<void> {
|
|
264
|
-
#private;
|
|
265
|
-
constructor(equals?: (a: T, b: T) => boolean);
|
|
266
|
-
dispose(): void;
|
|
267
|
-
abstract get(): T;
|
|
268
|
-
get hasWatchers(): boolean;
|
|
269
|
-
[kTrigger](): void;
|
|
270
|
-
subscribe(callback: Callback<void>): UnsubscribeCallback;
|
|
271
|
-
subscribeOnce(callback: Callback<void>): UnsubscribeCallback;
|
|
272
|
-
waitUntil(): never;
|
|
273
|
-
markSinksDirty(): void;
|
|
274
|
-
addSink(sink: DerivedSignal<unknown>): void;
|
|
275
|
-
removeSink(sink: DerivedSignal<unknown>): void;
|
|
276
|
-
asReadonly(): ISignal<T>;
|
|
277
|
-
}
|
|
278
|
-
declare class Signal<T> extends AbstractSignal<T> {
|
|
279
|
-
#private;
|
|
280
|
-
constructor(value: T, equals?: (a: T, b: T) => boolean);
|
|
281
|
-
dispose(): void;
|
|
282
|
-
get(): T;
|
|
283
|
-
set(newValue: T | ((oldValue: T) => T)): void;
|
|
284
|
-
}
|
|
285
|
-
declare class DerivedSignal<T> extends AbstractSignal<T> {
|
|
286
|
-
#private;
|
|
287
|
-
static from<Ts extends unknown[], V>(...args: [...signals: {
|
|
288
|
-
[K in keyof Ts]: ISignal<Ts[K]>;
|
|
289
|
-
}, transform: (...values: Ts) => V]): DerivedSignal<V>;
|
|
290
|
-
static from<Ts extends unknown[], V>(...args: [...signals: {
|
|
291
|
-
[K in keyof Ts]: ISignal<Ts[K]>;
|
|
292
|
-
}, transform: (...values: Ts) => V, equals: (a: V, b: V) => boolean]): DerivedSignal<V>;
|
|
293
|
-
private constructor();
|
|
294
|
-
dispose(): void;
|
|
295
|
-
get isDirty(): boolean;
|
|
296
|
-
markDirty(): void;
|
|
297
|
-
get(): T;
|
|
298
|
-
/**
|
|
299
|
-
* Called by the Signal system if one or more of the dependent signals have
|
|
300
|
-
* changed. In the case of a DerivedSignal, we'll only want to re-evaluate
|
|
301
|
-
* the actual value if it's being watched, or any of their sinks are being
|
|
302
|
-
* watched actively.
|
|
303
|
-
*/
|
|
304
|
-
[kTrigger](): void;
|
|
305
|
-
}
|
|
306
|
-
/**
|
|
307
|
-
* A MutableSignal is a bit like Signal, except its state is managed by
|
|
308
|
-
* a single value whose reference does not change but is mutated.
|
|
309
|
-
*
|
|
310
|
-
* Similar to how useSyncExternalState() works in React, there is a way to read
|
|
311
|
-
* the current state at any point in time synchronously, and a way to update
|
|
312
|
-
* its reference.
|
|
313
|
-
*/
|
|
314
|
-
declare class MutableSignal<T extends object> extends AbstractSignal<T> {
|
|
315
|
-
#private;
|
|
316
|
-
constructor(initialState: T);
|
|
317
|
-
dispose(): void;
|
|
318
|
-
get(): T;
|
|
319
|
-
/**
|
|
320
|
-
* Invokes a callback function that is allowed to mutate the given state
|
|
321
|
-
* value. Do not change the value outside of the callback.
|
|
322
|
-
*
|
|
323
|
-
* If the callback explicitly returns `false`, it's assumed that the state
|
|
324
|
-
* was not changed.
|
|
325
|
-
*/
|
|
326
|
-
mutate(callback?: (state: T) => void | boolean): void;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
313
|
type ContextualPromptResponse = Relax<{
|
|
330
314
|
type: "insert";
|
|
331
315
|
text: string;
|
|
@@ -745,6 +729,14 @@ type SyncMode = boolean | "atomic" | SyncConfig;
|
|
|
745
729
|
type SyncConfig = {
|
|
746
730
|
[key: string]: SyncMode | undefined;
|
|
747
731
|
};
|
|
732
|
+
/**
|
|
733
|
+
* Deeply converts all nested lists to LiveLists, and all nested objects to
|
|
734
|
+
* LiveObjects.
|
|
735
|
+
*
|
|
736
|
+
* As such, the returned result will not contain any Json arrays or Json
|
|
737
|
+
* objects anymore.
|
|
738
|
+
*/
|
|
739
|
+
declare function deepLiveify(value: Json, config?: SyncMode): Lson;
|
|
748
740
|
|
|
749
741
|
/**
|
|
750
742
|
* Optional keys of O whose non-undefined type is plain Json (not a
|
|
@@ -878,6 +870,15 @@ interface ReadonlyUnacknowledgedOps {
|
|
|
878
870
|
* the given ones (i.e. targeting one exact position).
|
|
879
871
|
*/
|
|
880
872
|
getByParentIdAndKey(parentId: string, parentKey: string): Iterable<ClientWireCreateOp>;
|
|
873
|
+
/**
|
|
874
|
+
* Whether the given pending op may already have been processed by the
|
|
875
|
+
* server. True for ops that were in flight when a connection died: the
|
|
876
|
+
* server may have stored them with the ack getting lost in the disconnect,
|
|
877
|
+
* or may never have received them. Until the (re-sent) op's ack arrives,
|
|
878
|
+
* the client cannot know which, so optimistic predictions that assume the
|
|
879
|
+
* op has not been processed yet are unsound for these ops.
|
|
880
|
+
*/
|
|
881
|
+
isPossiblyStored(opId: string): boolean;
|
|
881
882
|
}
|
|
882
883
|
|
|
883
884
|
/**
|
|
@@ -1677,7 +1678,7 @@ interface RoomHttpApi<TM extends BaseMetadata, CM extends BaseMetadata> {
|
|
|
1677
1678
|
subscriptions: SubscriptionData[];
|
|
1678
1679
|
requestedAt: Date;
|
|
1679
1680
|
nextCursor: string | null;
|
|
1680
|
-
permissionHints: Record<string,
|
|
1681
|
+
permissionHints: Record<string, RoomPermissions>;
|
|
1681
1682
|
}>;
|
|
1682
1683
|
getThreadsSince(options: {
|
|
1683
1684
|
roomId: string;
|
|
@@ -1697,7 +1698,7 @@ interface RoomHttpApi<TM extends BaseMetadata, CM extends BaseMetadata> {
|
|
|
1697
1698
|
deleted: SubscriptionDeleteInfo[];
|
|
1698
1699
|
};
|
|
1699
1700
|
requestedAt: Date;
|
|
1700
|
-
permissionHints: Record<string,
|
|
1701
|
+
permissionHints: Record<string, RoomPermissions>;
|
|
1701
1702
|
}>;
|
|
1702
1703
|
searchComments(options: {
|
|
1703
1704
|
roomId: string;
|
|
@@ -1816,18 +1817,6 @@ interface RoomHttpApi<TM extends BaseMetadata, CM extends BaseMetadata> {
|
|
|
1816
1817
|
signal?: AbortSignal;
|
|
1817
1818
|
}): Promise<CommentAttachment>;
|
|
1818
1819
|
getOrCreateAttachmentUrlsStore(roomId: string): BatchStore<string, string>;
|
|
1819
|
-
uploadChatAttachment({ chatId, attachment, signal, }: {
|
|
1820
|
-
chatId: string;
|
|
1821
|
-
attachment: {
|
|
1822
|
-
id: string;
|
|
1823
|
-
file: File;
|
|
1824
|
-
};
|
|
1825
|
-
signal?: AbortSignal;
|
|
1826
|
-
}): Promise<void>;
|
|
1827
|
-
getOrCreateChatAttachmentUrlsStore(chatId: string): BatchStore<string, string>;
|
|
1828
|
-
getChatAttachmentUrl(options: {
|
|
1829
|
-
attachmentId: string;
|
|
1830
|
-
}): Promise<string>;
|
|
1831
1820
|
createTextMention({ roomId, mentionId, mention, }: {
|
|
1832
1821
|
roomId: string;
|
|
1833
1822
|
mentionId: string;
|
|
@@ -1959,7 +1948,7 @@ interface LiveblocksHttpApi<TM extends BaseMetadata, CM extends BaseMetadata> ex
|
|
|
1959
1948
|
subscriptions: SubscriptionData[];
|
|
1960
1949
|
nextCursor: string | null;
|
|
1961
1950
|
requestedAt: Date;
|
|
1962
|
-
permissionHints: Record<string,
|
|
1951
|
+
permissionHints: Record<string, RoomPermissions>;
|
|
1963
1952
|
}>;
|
|
1964
1953
|
getUserThreadsSince_experimental(options: {
|
|
1965
1954
|
since: Date;
|
|
@@ -1978,7 +1967,7 @@ interface LiveblocksHttpApi<TM extends BaseMetadata, CM extends BaseMetadata> ex
|
|
|
1978
1967
|
deleted: SubscriptionDeleteInfo[];
|
|
1979
1968
|
};
|
|
1980
1969
|
requestedAt: Date;
|
|
1981
|
-
permissionHints: Record<string,
|
|
1970
|
+
permissionHints: Record<string, RoomPermissions>;
|
|
1982
1971
|
}>;
|
|
1983
1972
|
groupsStore: BatchStore<GroupData | undefined, string>;
|
|
1984
1973
|
getGroup(groupId: string): Promise<GroupData | undefined>;
|
|
@@ -2009,6 +1998,90 @@ declare const kInternal: unique symbol;
|
|
|
2009
1998
|
*/
|
|
2010
1999
|
type NoInfr<A> = [A][A extends any ? 0 : never];
|
|
2011
2000
|
|
|
2001
|
+
declare const kTrigger: unique symbol;
|
|
2002
|
+
/**
|
|
2003
|
+
* Runs a callback function that is allowed to change multiple signals. At the
|
|
2004
|
+
* end of the batch, all changed signals will be notified (at most once).
|
|
2005
|
+
*
|
|
2006
|
+
* Nesting batches is supported.
|
|
2007
|
+
*/
|
|
2008
|
+
declare function batch(callback: Callback<void>): void;
|
|
2009
|
+
type SignalType<S extends ISignal<any>> = S extends ISignal<infer T> ? T : never;
|
|
2010
|
+
interface ISignal<T> {
|
|
2011
|
+
get(): T;
|
|
2012
|
+
subscribe(callback: Callback<void>): UnsubscribeCallback;
|
|
2013
|
+
addSink(sink: DerivedSignal<unknown>): void;
|
|
2014
|
+
removeSink(sink: DerivedSignal<unknown>): void;
|
|
2015
|
+
}
|
|
2016
|
+
/**
|
|
2017
|
+
* Base functionality every Signal implementation needs.
|
|
2018
|
+
*/
|
|
2019
|
+
declare abstract class AbstractSignal<T> implements ISignal<T>, Observable<void> {
|
|
2020
|
+
#private;
|
|
2021
|
+
constructor(equals?: (a: T, b: T) => boolean);
|
|
2022
|
+
dispose(): void;
|
|
2023
|
+
abstract get(): T;
|
|
2024
|
+
get hasWatchers(): boolean;
|
|
2025
|
+
[kTrigger](): void;
|
|
2026
|
+
subscribe(callback: Callback<void>): UnsubscribeCallback;
|
|
2027
|
+
subscribeOnce(callback: Callback<void>): UnsubscribeCallback;
|
|
2028
|
+
waitUntil(): never;
|
|
2029
|
+
markSinksDirty(): void;
|
|
2030
|
+
addSink(sink: DerivedSignal<unknown>): void;
|
|
2031
|
+
removeSink(sink: DerivedSignal<unknown>): void;
|
|
2032
|
+
asReadonly(): ISignal<T>;
|
|
2033
|
+
}
|
|
2034
|
+
declare class Signal<T> extends AbstractSignal<T> {
|
|
2035
|
+
#private;
|
|
2036
|
+
constructor(value: T, equals?: (a: T, b: T) => boolean);
|
|
2037
|
+
dispose(): void;
|
|
2038
|
+
get(): T;
|
|
2039
|
+
set(newValue: T | ((oldValue: T) => T)): void;
|
|
2040
|
+
}
|
|
2041
|
+
declare class DerivedSignal<T> extends AbstractSignal<T> {
|
|
2042
|
+
#private;
|
|
2043
|
+
static from<Ts extends unknown[], V>(...args: [...signals: {
|
|
2044
|
+
[K in keyof Ts]: ISignal<Ts[K]>;
|
|
2045
|
+
}, transform: (...values: Ts) => V]): DerivedSignal<V>;
|
|
2046
|
+
static from<Ts extends unknown[], V>(...args: [...signals: {
|
|
2047
|
+
[K in keyof Ts]: ISignal<Ts[K]>;
|
|
2048
|
+
}, transform: (...values: Ts) => V, equals: (a: V, b: V) => boolean]): DerivedSignal<V>;
|
|
2049
|
+
private constructor();
|
|
2050
|
+
dispose(): void;
|
|
2051
|
+
get isDirty(): boolean;
|
|
2052
|
+
markDirty(): void;
|
|
2053
|
+
get(): T;
|
|
2054
|
+
/**
|
|
2055
|
+
* Called by the Signal system if one or more of the dependent signals have
|
|
2056
|
+
* changed. In the case of a DerivedSignal, we'll only want to re-evaluate
|
|
2057
|
+
* the actual value if it's being watched, or any of their sinks are being
|
|
2058
|
+
* watched actively.
|
|
2059
|
+
*/
|
|
2060
|
+
[kTrigger](): void;
|
|
2061
|
+
}
|
|
2062
|
+
/**
|
|
2063
|
+
* A MutableSignal is a bit like Signal, except its state is managed by
|
|
2064
|
+
* a single value whose reference does not change but is mutated.
|
|
2065
|
+
*
|
|
2066
|
+
* Similar to how useSyncExternalState() works in React, there is a way to read
|
|
2067
|
+
* the current state at any point in time synchronously, and a way to update
|
|
2068
|
+
* its reference.
|
|
2069
|
+
*/
|
|
2070
|
+
declare class MutableSignal<T extends object> extends AbstractSignal<T> {
|
|
2071
|
+
#private;
|
|
2072
|
+
constructor(initialState: T);
|
|
2073
|
+
dispose(): void;
|
|
2074
|
+
get(): T;
|
|
2075
|
+
/**
|
|
2076
|
+
* Invokes a callback function that is allowed to mutate the given state
|
|
2077
|
+
* value. Do not change the value outside of the callback.
|
|
2078
|
+
*
|
|
2079
|
+
* If the callback explicitly returns `false`, it's assumed that the state
|
|
2080
|
+
* was not changed.
|
|
2081
|
+
*/
|
|
2082
|
+
mutate(callback?: (state: T) => void | boolean): void;
|
|
2083
|
+
}
|
|
2084
|
+
|
|
2012
2085
|
type Awaitable<T> = T | PromiseLike<T>;
|
|
2013
2086
|
|
|
2014
2087
|
type AiConnectionErrorContext = {
|
|
@@ -2140,11 +2213,6 @@ type EnterOptions<P extends JsonObject = DP, S extends LsonObject = DS> = Resolv
|
|
|
2140
2213
|
* the authentication endpoint or connect via WebSocket.
|
|
2141
2214
|
*/
|
|
2142
2215
|
autoConnect?: boolean;
|
|
2143
|
-
/**
|
|
2144
|
-
* @deprecated This flag no longer has any effect and will be removed in
|
|
2145
|
-
* a future version. All rooms now use the v2 storage engine by default.
|
|
2146
|
-
*/
|
|
2147
|
-
engine?: 1 | 2;
|
|
2148
2216
|
} & PartialUnless<P, {
|
|
2149
2217
|
/**
|
|
2150
2218
|
* The initial Presence to use and announce when you enter the Room. The
|
|
@@ -2452,12 +2520,6 @@ type ClientOptions<U extends BaseUserMeta = DU> = {
|
|
|
2452
2520
|
lostConnectionTimeout?: number;
|
|
2453
2521
|
backgroundKeepAliveTimeout?: number;
|
|
2454
2522
|
polyfills?: Polyfills;
|
|
2455
|
-
/**
|
|
2456
|
-
* @deprecated All rooms will be migrated to the v2 storage engine in the
|
|
2457
|
-
* future, which has native support for streaming. After that migration, this
|
|
2458
|
-
* flag will no longer have any effect and will be removed in a future version.
|
|
2459
|
-
*/
|
|
2460
|
-
unstable_streamData?: boolean;
|
|
2461
2523
|
/**
|
|
2462
2524
|
* A function that returns a list of mention suggestions matching a string.
|
|
2463
2525
|
*/
|
|
@@ -3667,10 +3729,15 @@ type Room<P extends JsonObject = DP, S extends LsonObject = DS, U extends BaseUs
|
|
|
3667
3729
|
}>;
|
|
3668
3730
|
/**
|
|
3669
3731
|
* Get the room's storage synchronously.
|
|
3670
|
-
* The storage's root is a
|
|
3732
|
+
* The storage's root is a LiveObject.
|
|
3671
3733
|
*
|
|
3672
3734
|
* @example
|
|
3673
|
-
* const root = room.
|
|
3735
|
+
* const root = room.getStorageOrNull();
|
|
3736
|
+
*/
|
|
3737
|
+
getStorageOrNull(): LiveObject<S> | null;
|
|
3738
|
+
/**
|
|
3739
|
+
* @deprecated Renamed to `Room.getStorageOrNull`. This alias will be
|
|
3740
|
+
* removed in the future.
|
|
3674
3741
|
*/
|
|
3675
3742
|
getStorageSnapshot(): LiveObject<S> | null;
|
|
3676
3743
|
/**
|
|
@@ -3787,7 +3854,7 @@ type Room<P extends JsonObject = DP, S extends LsonObject = DS, U extends BaseUs
|
|
|
3787
3854
|
subscriptions: SubscriptionData[];
|
|
3788
3855
|
requestedAt: Date;
|
|
3789
3856
|
nextCursor: string | null;
|
|
3790
|
-
permissionHints: Record<string,
|
|
3857
|
+
permissionHints: Record<string, RoomPermissions>;
|
|
3791
3858
|
}>;
|
|
3792
3859
|
/**
|
|
3793
3860
|
* Returns the updated and deleted threads and their associated inbox notifications and subscriptions since the requested date.
|
|
@@ -3811,7 +3878,7 @@ type Room<P extends JsonObject = DP, S extends LsonObject = DS, U extends BaseUs
|
|
|
3811
3878
|
deleted: SubscriptionDeleteInfo[];
|
|
3812
3879
|
};
|
|
3813
3880
|
requestedAt: Date;
|
|
3814
|
-
permissionHints: Record<string,
|
|
3881
|
+
permissionHints: Record<string, RoomPermissions>;
|
|
3815
3882
|
}>;
|
|
3816
3883
|
/**
|
|
3817
3884
|
* Returns a thread and the associated inbox notification and subscription if it exists.
|
|
@@ -4103,7 +4170,7 @@ type StaticSessionInfo = {
|
|
|
4103
4170
|
type DynamicSessionInfo = {
|
|
4104
4171
|
readonly actor: number;
|
|
4105
4172
|
readonly nonce: string;
|
|
4106
|
-
readonly
|
|
4173
|
+
readonly permissionMatrix: PermissionMatrix;
|
|
4107
4174
|
readonly meta: JsonObject;
|
|
4108
4175
|
};
|
|
4109
4176
|
type Polyfills = {
|
|
@@ -5704,4 +5771,4 @@ type EnsureJson<T> = T extends Json ? T : T extends Array<infer I> ? (EnsureJson
|
|
|
5704
5771
|
[K in keyof T as EnsureJson<T[K]> extends never ? never : K]: EnsureJson<T[K]>;
|
|
5705
5772
|
};
|
|
5706
5773
|
|
|
5707
|
-
export { 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 ChildStorageNode, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type ClientWireOp, 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 CompactChildNode, type CompactListNode, type CompactMapNode, type CompactNode, type CompactObjectNode, type CompactRegisterNode, type CompactRootNode, 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 DCM, type DE, type DFM, type DFMD, type DGI, type DP, type DRI, type DS, type DTM, 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 Feed, type FeedCreateMetadata, type FeedDeletedServerMsg, type FeedFetchMetadataFilter, type FeedMessage, type FeedMessagesAddedServerMsg, type FeedMessagesDeletedServerMsg, type FeedMessagesListServerMsg, type FeedMessagesUpdatedServerMsg, type FeedRequestError, FeedRequestErrorCode, type FeedRequestFailedServerMsg, type FeedUpdateMetadata, type FeedsAddedServerMsg, type FeedsEventServerMsg, type FeedsListServerMsg, type FeedsUpdatedServerMsg, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type GroupData, type GroupDataPlain, type GroupMemberData, type GroupMentionData, type GroupScopes, type HasOpId, type History, type HistoryVersion, HttpError, type ISODateString, type ISignal, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IYjsProvider, type IgnoredOp, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InferFromSchema, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, type LayerKey, type ListStorageNode, 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 MapStorageNode, type MentionData, type MessageId, MutableSignal, type NoInfr, type NodeMap, type NodeStream, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, type ObjectStorageNode, 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 ReadonlyJson, type ReadonlyJsonObject, type RegisterStorageNode, 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 RootStorageNode, type SearchCommentsResult, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type ServerWireOp, type SetParentKeyOp, Signal, type SignalType, SortedList, type Status, type StorageChunkServerMsg, type StorageNode, type StorageStatus, type StorageUpdate, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type SubscriptionData, type SubscriptionDataPlain, type SubscriptionDeleteInfo, type SubscriptionDeleteInfoPlain, type SubscriptionKey, type SyncConfig, type SyncMode, type SyncSource, type SyncStatus, TextEditorType, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, 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, compactNodesToNodeStream, 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, isListStorageNode, isLiveNode, isMapStorageNode, isNotificationChannelEnabled, isNumberOperator, isObjectStorageNode, isPlainObject, isRegisterStorageNode, isRootStorageNode, isStartsWithOperator, isUrl, kInternal, keys, makeAbortController, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, nodeStreamToCompactNodes, objectToQuery, patchNotificationSettings, raise, resolveMentionsInCommentBody, sanitizeUrl, shallow, shallow2, stableStringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, url, urljoin, wait, warnOnce, warnOnceIf, withTimeout };
|
|
5774
|
+
export { type AccessLevel, 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 ChildStorageNode, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type ClientWireOp, 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 CompactChildNode, type CompactListNode, type CompactMapNode, type CompactNode, type CompactObjectNode, type CompactRegisterNode, type CompactRootNode, 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 DCM, type DE, type DFM, type DFMD, type DGI, type DP, type DRI, type DS, type DTM, 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 Feed, type FeedCreateMetadata, type FeedDeletedServerMsg, type FeedFetchMetadataFilter, type FeedMessage, type FeedMessagesAddedServerMsg, type FeedMessagesDeletedServerMsg, type FeedMessagesListServerMsg, type FeedMessagesUpdatedServerMsg, type FeedRequestError, FeedRequestErrorCode, type FeedRequestFailedServerMsg, type FeedUpdateMetadata, type FeedsAddedServerMsg, type FeedsEventServerMsg, type FeedsListServerMsg, type FeedsUpdatedServerMsg, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type GroupData, type GroupDataPlain, type GroupMemberData, type GroupMentionData, type GroupScopes, type HasOpId, type History, type HistoryVersion, HttpError, type ISODateString, type ISignal, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IYjsProvider, type IgnoredOp, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InferFromSchema, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, type LayerKey, type ListStorageNode, 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 MapStorageNode, type MentionData, type MessageId, MutableSignal, type NoInfr, type NodeMap, type NodeStream, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, type ObjectStorageNode, type Observable, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialNotificationSettings, type PartialUnless, type Patchable, Permission, type PermissionMatrix, type PermissionResources, type PlainLson, type PlainLsonFields, type PlainLsonList, type PlainLsonMap, type PlainLsonObject, type Poller, type PrivateClientApi, type PrivateRoomApi, Promise_withResolvers, type QueryMetadata, type QueryParams, type ReadonlyJson, type ReadonlyJsonObject, type RegisterStorageNode, type RejectedStorageOpServerMsg, type Relax, type RenderableToolResultResponse, type RequiredAccessLevel, type Resolve, type ResolveGroupsInfoArgs, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomAccesses, type RoomEventMessage, type RoomPermissions, type RoomStateServerMsg, type RoomSubscriptionSettings, type RootStorageNode, type SearchCommentsResult, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type ServerWireOp, type SetParentKeyOp, Signal, type SignalType, SortedList, type Status, type StorageChunkServerMsg, type StorageNode, type StorageStatus, type StorageUpdate, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type SubscriptionData, type SubscriptionDataPlain, type SubscriptionDeleteInfo, type SubscriptionDeleteInfoPlain, type SubscriptionKey, type SyncConfig, type SyncMode, type SyncSource, type SyncStatus, TextEditorType, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToJson, type ToolResultResponse, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateRoomAccesses, 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, compactNodesToNodeStream, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToGroupData, convertToInboxNotificationData, convertToSubscriptionData, convertToThreadData, convertToUserSubscriptionData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createManagedPool, createNotificationSettings, createThreadId, deepLiveify, defineAiTool, deprecate, deprecateIf, detectDupes, entries, errorIf, findLastIndex, freeze, generateUrl, getMentionsFromCommentBody, getSubscriptionKey, hasPermissionAccess, html, htmlSafe, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isListStorageNode, isLiveNode, isMapStorageNode, isNotificationChannelEnabled, isNumberOperator, isObjectStorageNode, isPlainObject, isRegisterStorageNode, isRootStorageNode, isStartsWithOperator, isUrl, kInternal, keys, makeAbortController, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, mergeRoomPermissionScopes, nanoid, nn, nodeStreamToCompactNodes, normalizeRoomAccesses, normalizeRoomPermissions, normalizeUpdateRoomAccesses, objectToQuery, patchNotificationSettings, permissionMatrixFromScopes, raise, resolveMentionsInCommentBody, sanitizeUrl, shallow, shallow2, stableStringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, url, urljoin, validatePermissionsSet, wait, warnOnce, warnOnceIf, withTimeout };
|