@liveblocks/core 3.14.0-pre1 → 3.14.0-pre2
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 +149 -76
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +69 -26
- package/dist/index.d.ts +69 -26
- package/dist/index.js +148 -75
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -6,7 +6,7 @@ var __export = (target, all) => {
|
|
|
6
6
|
|
|
7
7
|
// src/version.ts
|
|
8
8
|
var PKG_NAME = "@liveblocks/core";
|
|
9
|
-
var PKG_VERSION = "3.14.0-
|
|
9
|
+
var PKG_VERSION = "3.14.0-pre2";
|
|
10
10
|
var PKG_FORMAT = "cjs";
|
|
11
11
|
|
|
12
12
|
// src/dupe-detection.ts
|
|
@@ -3143,7 +3143,12 @@ var ServerMsgCode = Object.freeze({
|
|
|
3143
3143
|
BROADCASTED_EVENT: 103,
|
|
3144
3144
|
ROOM_STATE: 104,
|
|
3145
3145
|
// For Storage
|
|
3146
|
-
|
|
3146
|
+
STORAGE_STATE_V7: 200,
|
|
3147
|
+
// Only sent in V7
|
|
3148
|
+
STORAGE_CHUNK: 210,
|
|
3149
|
+
// Used in V8+
|
|
3150
|
+
STORAGE_STREAM_END: 211,
|
|
3151
|
+
// Used in V8+
|
|
3147
3152
|
UPDATE_STORAGE: 201,
|
|
3148
3153
|
// For Yjs Docs
|
|
3149
3154
|
UPDATE_YDOC: 300,
|
|
@@ -4167,41 +4172,6 @@ var TreePool = class {
|
|
|
4167
4172
|
}
|
|
4168
4173
|
};
|
|
4169
4174
|
|
|
4170
|
-
// src/protocol/AuthToken.ts
|
|
4171
|
-
var Permission = /* @__PURE__ */ ((Permission2) => {
|
|
4172
|
-
Permission2["Read"] = "room:read";
|
|
4173
|
-
Permission2["Write"] = "room:write";
|
|
4174
|
-
Permission2["PresenceWrite"] = "room:presence:write";
|
|
4175
|
-
Permission2["CommentsWrite"] = "comments:write";
|
|
4176
|
-
Permission2["CommentsRead"] = "comments:read";
|
|
4177
|
-
return Permission2;
|
|
4178
|
-
})(Permission || {});
|
|
4179
|
-
function canWriteStorage(scopes) {
|
|
4180
|
-
return scopes.includes("room:write" /* Write */);
|
|
4181
|
-
}
|
|
4182
|
-
function canComment(scopes) {
|
|
4183
|
-
return scopes.includes("comments:write" /* CommentsWrite */) || scopes.includes("room:write" /* Write */);
|
|
4184
|
-
}
|
|
4185
|
-
function isValidAuthTokenPayload(data) {
|
|
4186
|
-
return isPlainObject(data) && (data.k === "acc" /* ACCESS_TOKEN */ || data.k === "id" /* ID_TOKEN */ || data.k === "sec-legacy" /* SECRET_LEGACY */);
|
|
4187
|
-
}
|
|
4188
|
-
function parseAuthToken(rawTokenString) {
|
|
4189
|
-
const tokenParts = rawTokenString.split(".");
|
|
4190
|
-
if (tokenParts.length !== 3) {
|
|
4191
|
-
throw new Error("Authentication error: invalid JWT token");
|
|
4192
|
-
}
|
|
4193
|
-
const payload = tryParseJson(b64decode(tokenParts[1]));
|
|
4194
|
-
if (!(payload && isValidAuthTokenPayload(payload))) {
|
|
4195
|
-
throw new Error(
|
|
4196
|
-
"Authentication error: expected a valid token but did not get one. Hint: if you are using a callback, ensure the room is passed when creating the token. For more information: https://liveblocks.io/docs/api-reference/liveblocks-client#createClientCallback"
|
|
4197
|
-
);
|
|
4198
|
-
}
|
|
4199
|
-
return {
|
|
4200
|
-
raw: rawTokenString,
|
|
4201
|
-
parsed: payload
|
|
4202
|
-
};
|
|
4203
|
-
}
|
|
4204
|
-
|
|
4205
4175
|
// src/ai.ts
|
|
4206
4176
|
var DEFAULT_REQUEST_TIMEOUT = 4e3;
|
|
4207
4177
|
function defineAiTool() {
|
|
@@ -4730,8 +4700,8 @@ function createAi(config) {
|
|
|
4730
4700
|
if (authValue.type === "secret") {
|
|
4731
4701
|
const token = authValue.token.parsed;
|
|
4732
4702
|
context.staticSessionInfoSig.set({
|
|
4733
|
-
userId: token.
|
|
4734
|
-
userInfo: token.
|
|
4703
|
+
userId: token.uid,
|
|
4704
|
+
userInfo: token.ui
|
|
4735
4705
|
});
|
|
4736
4706
|
} else {
|
|
4737
4707
|
context.staticSessionInfoSig.set({
|
|
@@ -5153,6 +5123,41 @@ function createReceivingToolInvocation(invocationId, name, partialArgsText = "")
|
|
|
5153
5123
|
};
|
|
5154
5124
|
}
|
|
5155
5125
|
|
|
5126
|
+
// src/protocol/AuthToken.ts
|
|
5127
|
+
var Permission = /* @__PURE__ */ ((Permission2) => {
|
|
5128
|
+
Permission2["Read"] = "room:read";
|
|
5129
|
+
Permission2["Write"] = "room:write";
|
|
5130
|
+
Permission2["PresenceWrite"] = "room:presence:write";
|
|
5131
|
+
Permission2["CommentsWrite"] = "comments:write";
|
|
5132
|
+
Permission2["CommentsRead"] = "comments:read";
|
|
5133
|
+
return Permission2;
|
|
5134
|
+
})(Permission || {});
|
|
5135
|
+
function canWriteStorage(scopes) {
|
|
5136
|
+
return scopes.includes("room:write" /* Write */);
|
|
5137
|
+
}
|
|
5138
|
+
function canComment(scopes) {
|
|
5139
|
+
return scopes.includes("comments:write" /* CommentsWrite */) || scopes.includes("room:write" /* Write */);
|
|
5140
|
+
}
|
|
5141
|
+
function isValidAuthTokenPayload(data) {
|
|
5142
|
+
return isPlainObject(data) && (data.k === "acc" /* ACCESS_TOKEN */ || data.k === "id" /* ID_TOKEN */);
|
|
5143
|
+
}
|
|
5144
|
+
function parseAuthToken(rawTokenString) {
|
|
5145
|
+
const tokenParts = rawTokenString.split(".");
|
|
5146
|
+
if (tokenParts.length !== 3) {
|
|
5147
|
+
throw new Error("Authentication error: invalid JWT token");
|
|
5148
|
+
}
|
|
5149
|
+
const payload = tryParseJson(b64decode(tokenParts[1]));
|
|
5150
|
+
if (!(payload && isValidAuthTokenPayload(payload))) {
|
|
5151
|
+
throw new Error(
|
|
5152
|
+
"Authentication error: expected a valid token but did not get one. Hint: if you are using a callback, ensure the room is passed when creating the token. For more information: https://liveblocks.io/docs/api-reference/liveblocks-client#createClientCallback"
|
|
5153
|
+
);
|
|
5154
|
+
}
|
|
5155
|
+
return {
|
|
5156
|
+
raw: rawTokenString,
|
|
5157
|
+
parsed: payload
|
|
5158
|
+
};
|
|
5159
|
+
}
|
|
5160
|
+
|
|
5156
5161
|
// src/auth-manager.ts
|
|
5157
5162
|
var NON_RETRY_STATUS_CODES = [
|
|
5158
5163
|
400,
|
|
@@ -5287,10 +5292,8 @@ function createAuthManager(authOptions, onAuthenticate) {
|
|
|
5287
5292
|
const BUFFER = 30;
|
|
5288
5293
|
const expiresAt = Math.floor(Date.now() / 1e3) + (token.parsed.exp - token.parsed.iat) - BUFFER;
|
|
5289
5294
|
seenTokens.add(token.raw);
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
expiryTimes.push(expiresAt);
|
|
5293
|
-
}
|
|
5295
|
+
tokens.push(token);
|
|
5296
|
+
expiryTimes.push(expiresAt);
|
|
5294
5297
|
return { type: "secret", token };
|
|
5295
5298
|
} finally {
|
|
5296
5299
|
if (requestOptions.roomId) {
|
|
@@ -6219,6 +6222,57 @@ var CrdtType = Object.freeze({
|
|
|
6219
6222
|
MAP: 2,
|
|
6220
6223
|
REGISTER: 3
|
|
6221
6224
|
});
|
|
6225
|
+
function isRootNode(node) {
|
|
6226
|
+
return node[0] === "root";
|
|
6227
|
+
}
|
|
6228
|
+
function isRootCrdt(id, _) {
|
|
6229
|
+
return id === "root";
|
|
6230
|
+
}
|
|
6231
|
+
function* compactNodesToNodeStream(nodes) {
|
|
6232
|
+
for (const node of nodes) {
|
|
6233
|
+
const id = node[0];
|
|
6234
|
+
if (isRootNode(node)) {
|
|
6235
|
+
yield [id, { type: CrdtType.OBJECT, data: node[1] }];
|
|
6236
|
+
continue;
|
|
6237
|
+
}
|
|
6238
|
+
switch (node[1]) {
|
|
6239
|
+
case CrdtType.OBJECT:
|
|
6240
|
+
yield [id, { type: CrdtType.OBJECT, parentId: node[2], parentKey: node[3], data: node[4] }];
|
|
6241
|
+
break;
|
|
6242
|
+
case CrdtType.LIST:
|
|
6243
|
+
yield [id, { type: CrdtType.LIST, parentId: node[2], parentKey: node[3] }];
|
|
6244
|
+
break;
|
|
6245
|
+
case CrdtType.MAP:
|
|
6246
|
+
yield [id, { type: CrdtType.MAP, parentId: node[2], parentKey: node[3] }];
|
|
6247
|
+
break;
|
|
6248
|
+
case CrdtType.REGISTER:
|
|
6249
|
+
yield [id, { type: CrdtType.REGISTER, parentId: node[2], parentKey: node[3], data: node[4] }];
|
|
6250
|
+
break;
|
|
6251
|
+
}
|
|
6252
|
+
}
|
|
6253
|
+
}
|
|
6254
|
+
function* nodeStreamToCompactNodes(nodes) {
|
|
6255
|
+
for (const [id, node] of nodes) {
|
|
6256
|
+
switch (node.type) {
|
|
6257
|
+
case CrdtType.OBJECT:
|
|
6258
|
+
if (isRootCrdt(id, node)) {
|
|
6259
|
+
yield [id, node.data];
|
|
6260
|
+
} else {
|
|
6261
|
+
yield [id, CrdtType.OBJECT, node.parentId, node.parentKey, node.data];
|
|
6262
|
+
}
|
|
6263
|
+
break;
|
|
6264
|
+
case CrdtType.LIST:
|
|
6265
|
+
yield [id, CrdtType.LIST, node.parentId, node.parentKey];
|
|
6266
|
+
break;
|
|
6267
|
+
case CrdtType.MAP:
|
|
6268
|
+
yield [id, CrdtType.MAP, node.parentId, node.parentKey];
|
|
6269
|
+
break;
|
|
6270
|
+
case CrdtType.REGISTER:
|
|
6271
|
+
yield [id, CrdtType.REGISTER, node.parentId, node.parentKey, node.data];
|
|
6272
|
+
break;
|
|
6273
|
+
}
|
|
6274
|
+
}
|
|
6275
|
+
}
|
|
6222
6276
|
|
|
6223
6277
|
// src/crdts/LiveRegister.ts
|
|
6224
6278
|
var LiveRegister = class _LiveRegister extends AbstractCrdt {
|
|
@@ -7648,7 +7702,7 @@ var LiveMap = class _LiveMap extends AbstractCrdt {
|
|
|
7648
7702
|
|
|
7649
7703
|
// src/crdts/LiveObject.ts
|
|
7650
7704
|
var MAX_LIVE_OBJECT_SIZE = 128 * 1024;
|
|
7651
|
-
function
|
|
7705
|
+
function isRootCrdt2(id, _) {
|
|
7652
7706
|
return id === "root";
|
|
7653
7707
|
}
|
|
7654
7708
|
var LiveObject = (_class2 = class _LiveObject extends AbstractCrdt {
|
|
@@ -7677,11 +7731,11 @@ var LiveObject = (_class2 = class _LiveObject extends AbstractCrdt {
|
|
|
7677
7731
|
* @experimental
|
|
7678
7732
|
*/
|
|
7679
7733
|
static __initStatic() {this.detectLargeObjects = false}
|
|
7680
|
-
static #buildRootAndParentToChildren(
|
|
7734
|
+
static #buildRootAndParentToChildren(nodes) {
|
|
7681
7735
|
const parentToChildren = /* @__PURE__ */ new Map();
|
|
7682
7736
|
let root = null;
|
|
7683
|
-
for (const [id, crdt] of
|
|
7684
|
-
if (
|
|
7737
|
+
for (const [id, crdt] of nodes) {
|
|
7738
|
+
if (isRootCrdt2(id, crdt)) {
|
|
7685
7739
|
root = crdt;
|
|
7686
7740
|
} else {
|
|
7687
7741
|
const tuple = [id, crdt];
|
|
@@ -7699,8 +7753,8 @@ var LiveObject = (_class2 = class _LiveObject extends AbstractCrdt {
|
|
|
7699
7753
|
return [root, parentToChildren];
|
|
7700
7754
|
}
|
|
7701
7755
|
/** @private Do not use this API directly */
|
|
7702
|
-
static _fromItems(
|
|
7703
|
-
const [root, parentToChildren] = _LiveObject.#buildRootAndParentToChildren(
|
|
7756
|
+
static _fromItems(nodes, pool) {
|
|
7757
|
+
const [root, parentToChildren] = _LiveObject.#buildRootAndParentToChildren(nodes);
|
|
7704
7758
|
return _LiveObject._deserialize(
|
|
7705
7759
|
["root", root],
|
|
7706
7760
|
parentToChildren,
|
|
@@ -8321,10 +8375,7 @@ function getTreesDiffOperations(currentItems, newItems) {
|
|
|
8321
8375
|
const ops = [];
|
|
8322
8376
|
currentItems.forEach((_, id) => {
|
|
8323
8377
|
if (!newItems.get(id)) {
|
|
8324
|
-
ops.push({
|
|
8325
|
-
type: OpCode.DELETE_CRDT,
|
|
8326
|
-
id
|
|
8327
|
-
});
|
|
8378
|
+
ops.push({ type: OpCode.DELETE_CRDT, id });
|
|
8328
8379
|
}
|
|
8329
8380
|
});
|
|
8330
8381
|
newItems.forEach((crdt, id) => {
|
|
@@ -8824,6 +8875,23 @@ function installBackgroundTabSpy() {
|
|
|
8824
8875
|
};
|
|
8825
8876
|
return [inBackgroundSince, unsub];
|
|
8826
8877
|
}
|
|
8878
|
+
function makeNodeMapBuffer() {
|
|
8879
|
+
let map = /* @__PURE__ */ new Map();
|
|
8880
|
+
return {
|
|
8881
|
+
/** Append a "page" of nodes to the current NodeMap buffer. */
|
|
8882
|
+
append(chunk2) {
|
|
8883
|
+
for (const [id, node] of chunk2) {
|
|
8884
|
+
map.set(id, node);
|
|
8885
|
+
}
|
|
8886
|
+
},
|
|
8887
|
+
/** Return the contents of the current NodeMap buffer, and create a fresh new one. */
|
|
8888
|
+
take() {
|
|
8889
|
+
const result = map;
|
|
8890
|
+
map = /* @__PURE__ */ new Map();
|
|
8891
|
+
return result;
|
|
8892
|
+
}
|
|
8893
|
+
};
|
|
8894
|
+
}
|
|
8827
8895
|
function createRoom(options, config) {
|
|
8828
8896
|
const roomId = config.roomId;
|
|
8829
8897
|
const initialPresence = options.initialPresence;
|
|
@@ -8884,6 +8952,7 @@ function createRoom(options, config) {
|
|
|
8884
8952
|
activeBatch: null,
|
|
8885
8953
|
unacknowledgedOps: /* @__PURE__ */ new Map()
|
|
8886
8954
|
};
|
|
8955
|
+
const nodeMapBuffer = makeNodeMapBuffer();
|
|
8887
8956
|
let lastTokenKey;
|
|
8888
8957
|
function onStatusDidChange(newStatus) {
|
|
8889
8958
|
const authValue = managedSocket.authValue;
|
|
@@ -8894,8 +8963,8 @@ function createRoom(options, config) {
|
|
|
8894
8963
|
if (authValue.type === "secret") {
|
|
8895
8964
|
const token = authValue.token.parsed;
|
|
8896
8965
|
context.staticSessionInfoSig.set({
|
|
8897
|
-
userId: token.
|
|
8898
|
-
userInfo: token.
|
|
8966
|
+
userId: token.uid,
|
|
8967
|
+
userInfo: token.ui
|
|
8899
8968
|
});
|
|
8900
8969
|
} else {
|
|
8901
8970
|
context.staticSessionInfoSig.set({
|
|
@@ -9165,14 +9234,11 @@ function createRoom(options, config) {
|
|
|
9165
9234
|
self,
|
|
9166
9235
|
(me) => me !== null ? userToTreeNode("Me", me) : null
|
|
9167
9236
|
);
|
|
9168
|
-
function createOrUpdateRootFromMessage(
|
|
9169
|
-
if (message.items.length === 0) {
|
|
9170
|
-
throw new Error("Internal error: cannot load storage without items");
|
|
9171
|
-
}
|
|
9237
|
+
function createOrUpdateRootFromMessage(nodes) {
|
|
9172
9238
|
if (context.root !== void 0) {
|
|
9173
|
-
updateRoot(
|
|
9239
|
+
updateRoot(new Map(nodes));
|
|
9174
9240
|
} else {
|
|
9175
|
-
context.root = LiveObject._fromItems(
|
|
9241
|
+
context.root = LiveObject._fromItems(nodes, context.pool);
|
|
9176
9242
|
}
|
|
9177
9243
|
const canWrite = _nullishCoalesce(_optionalChain([self, 'access', _188 => _188.get, 'call', _189 => _189(), 'optionalAccess', _190 => _190.canWrite]), () => ( true));
|
|
9178
9244
|
const stackSizeBefore = context.undoStack.length;
|
|
@@ -9189,7 +9255,10 @@ function createRoom(options, config) {
|
|
|
9189
9255
|
}
|
|
9190
9256
|
context.undoStack.length = stackSizeBefore;
|
|
9191
9257
|
}
|
|
9192
|
-
function updateRoot(
|
|
9258
|
+
function updateRoot(nodes) {
|
|
9259
|
+
if (nodes.size === 0) {
|
|
9260
|
+
throw new Error("Internal error: cannot load storage without items");
|
|
9261
|
+
}
|
|
9193
9262
|
if (context.root === void 0) {
|
|
9194
9263
|
return;
|
|
9195
9264
|
}
|
|
@@ -9197,7 +9266,7 @@ function createRoom(options, config) {
|
|
|
9197
9266
|
for (const [id, node] of context.pool.nodes) {
|
|
9198
9267
|
currentItems.set(id, node._serialize());
|
|
9199
9268
|
}
|
|
9200
|
-
const ops = getTreesDiffOperations(currentItems,
|
|
9269
|
+
const ops = getTreesDiffOperations(currentItems, nodes);
|
|
9201
9270
|
const result = applyRemoteOps(ops);
|
|
9202
9271
|
notify(result.updates);
|
|
9203
9272
|
}
|
|
@@ -9572,10 +9641,12 @@ function createRoom(options, config) {
|
|
|
9572
9641
|
updates.others.push(onRoomStateMessage(message));
|
|
9573
9642
|
break;
|
|
9574
9643
|
}
|
|
9575
|
-
case ServerMsgCode.
|
|
9576
|
-
|
|
9644
|
+
case ServerMsgCode.STORAGE_CHUNK:
|
|
9645
|
+
nodeMapBuffer.append(compactNodesToNodeStream(message.nodes));
|
|
9646
|
+
break;
|
|
9647
|
+
case ServerMsgCode.STORAGE_STREAM_END:
|
|
9648
|
+
processInitialStorage(nodeMapBuffer.take());
|
|
9577
9649
|
break;
|
|
9578
|
-
}
|
|
9579
9650
|
case ServerMsgCode.UPDATE_STORAGE: {
|
|
9580
9651
|
const applyResult = applyRemoteOps(message.ops);
|
|
9581
9652
|
for (const [key, value] of applyResult.updates.storageUpdates) {
|
|
@@ -9615,6 +9686,8 @@ function createRoom(options, config) {
|
|
|
9615
9686
|
eventHub.comments.notify(message);
|
|
9616
9687
|
break;
|
|
9617
9688
|
}
|
|
9689
|
+
case ServerMsgCode.STORAGE_STATE_V7:
|
|
9690
|
+
// No longer used in V8
|
|
9618
9691
|
default:
|
|
9619
9692
|
break;
|
|
9620
9693
|
}
|
|
@@ -9716,9 +9789,9 @@ function createRoom(options, config) {
|
|
|
9716
9789
|
}
|
|
9717
9790
|
let _getStorage$ = null;
|
|
9718
9791
|
let _resolveStoragePromise = null;
|
|
9719
|
-
function processInitialStorage(
|
|
9792
|
+
function processInitialStorage(nodes) {
|
|
9720
9793
|
const unacknowledgedOps = new Map(context.unacknowledgedOps);
|
|
9721
|
-
createOrUpdateRootFromMessage(
|
|
9794
|
+
createOrUpdateRootFromMessage(nodes);
|
|
9722
9795
|
applyAndSendOfflineOps(unacknowledgedOps);
|
|
9723
9796
|
_optionalChain([_resolveStoragePromise, 'optionalCall', _193 => _193()]);
|
|
9724
9797
|
notifyStorageStatus();
|
|
@@ -9726,8 +9799,8 @@ function createRoom(options, config) {
|
|
|
9726
9799
|
}
|
|
9727
9800
|
async function streamStorage() {
|
|
9728
9801
|
if (!managedSocket.authValue) return;
|
|
9729
|
-
const
|
|
9730
|
-
processInitialStorage(
|
|
9802
|
+
const nodes = new Map(await httpClient.streamStorage({ roomId }));
|
|
9803
|
+
processInitialStorage(nodes);
|
|
9731
9804
|
}
|
|
9732
9805
|
function refreshStorage(options2) {
|
|
9733
9806
|
const messages = context.buffer.messages;
|
|
@@ -9735,6 +9808,7 @@ function createRoom(options, config) {
|
|
|
9735
9808
|
void streamStorage();
|
|
9736
9809
|
} else if (!messages.some((msg) => msg.type === ClientMsgCode.FETCH_STORAGE)) {
|
|
9737
9810
|
messages.push({ type: ClientMsgCode.FETCH_STORAGE });
|
|
9811
|
+
nodeMapBuffer.take();
|
|
9738
9812
|
}
|
|
9739
9813
|
if (options2.flush) {
|
|
9740
9814
|
flushNowOrSoon();
|
|
@@ -10328,7 +10402,7 @@ function makeCreateSocketDelegateForRoom(roomId, baseUrl, WebSocketPolyfill, eng
|
|
|
10328
10402
|
}
|
|
10329
10403
|
const url2 = new URL(baseUrl);
|
|
10330
10404
|
url2.protocol = url2.protocol === "http:" ? "ws" : "wss";
|
|
10331
|
-
url2.pathname = "/
|
|
10405
|
+
url2.pathname = "/v8";
|
|
10332
10406
|
url2.searchParams.set("roomId", roomId);
|
|
10333
10407
|
if (authValue.type === "secret") {
|
|
10334
10408
|
url2.searchParams.set("tok", authValue.token.raw);
|
|
@@ -10376,8 +10450,7 @@ function createClient(options) {
|
|
|
10376
10450
|
const baseUrl = getBaseUrl(clientOptions.baseUrl);
|
|
10377
10451
|
const currentUserId = new Signal(void 0);
|
|
10378
10452
|
const authManager = createAuthManager(options, (token) => {
|
|
10379
|
-
|
|
10380
|
-
currentUserId.set(() => userId);
|
|
10453
|
+
currentUserId.set(() => token.uid);
|
|
10381
10454
|
});
|
|
10382
10455
|
const fetchPolyfill = _optionalChain([clientOptions, 'access', _209 => _209.polyfills, 'optionalAccess', _210 => _210.fetch]) || /* istanbul ignore next */
|
|
10383
10456
|
_optionalChain([globalThis, 'access', _211 => _211.fetch, 'optionalAccess', _212 => _212.bind, 'call', _213 => _213(globalThis)]);
|
|
@@ -10408,8 +10481,6 @@ function createClient(options) {
|
|
|
10408
10481
|
throw new StopRetrying(
|
|
10409
10482
|
"Cannot use AI Copilots with a public API key"
|
|
10410
10483
|
);
|
|
10411
|
-
} else if (resp.token.parsed.k === "sec-legacy" /* SECRET_LEGACY */) {
|
|
10412
|
-
throw new StopRetrying("AI Copilots requires an ID or Access token");
|
|
10413
10484
|
}
|
|
10414
10485
|
return resp;
|
|
10415
10486
|
},
|
|
@@ -11646,5 +11717,7 @@ detectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);
|
|
|
11646
11717
|
|
|
11647
11718
|
|
|
11648
11719
|
|
|
11649
|
-
|
|
11720
|
+
|
|
11721
|
+
|
|
11722
|
+
exports.ClientMsgCode = ClientMsgCode; exports.CrdtType = CrdtType; exports.DefaultMap = DefaultMap; exports.Deque = Deque; exports.DerivedSignal = DerivedSignal; exports.HttpError = HttpError; exports.LiveList = LiveList; exports.LiveMap = LiveMap; exports.LiveObject = LiveObject; exports.LiveblocksError = LiveblocksError; exports.MENTION_CHARACTER = MENTION_CHARACTER; exports.MutableSignal = MutableSignal; exports.OpCode = OpCode; exports.Permission = Permission; exports.Promise_withResolvers = Promise_withResolvers; exports.ServerMsgCode = ServerMsgCode; exports.Signal = Signal; exports.SortedList = SortedList; exports.TextEditorType = TextEditorType; exports.WebsocketCloseCodes = WebsocketCloseCodes; exports.asPos = asPos; exports.assert = assert; exports.assertNever = assertNever; exports.autoRetry = autoRetry; exports.b64decode = b64decode; exports.batch = batch; exports.checkBounds = checkBounds; exports.chunk = chunk; exports.cloneLson = cloneLson; exports.compactNodesToNodeStream = compactNodesToNodeStream; exports.compactObject = compactObject; exports.console = fancy_console_exports; exports.convertToCommentData = convertToCommentData; exports.convertToCommentUserReaction = convertToCommentUserReaction; exports.convertToGroupData = convertToGroupData; exports.convertToInboxNotificationData = convertToInboxNotificationData; exports.convertToSubscriptionData = convertToSubscriptionData; exports.convertToThreadData = convertToThreadData; exports.convertToUserSubscriptionData = convertToUserSubscriptionData; exports.createClient = createClient; exports.createCommentAttachmentId = createCommentAttachmentId; exports.createCommentId = createCommentId; exports.createInboxNotificationId = createInboxNotificationId; exports.createManagedPool = createManagedPool; exports.createNotificationSettings = createNotificationSettings; exports.createThreadId = createThreadId; exports.defineAiTool = defineAiTool; exports.deprecate = deprecate; exports.deprecateIf = deprecateIf; exports.detectDupes = detectDupes; exports.entries = entries; exports.errorIf = errorIf; exports.findLastIndex = findLastIndex; exports.freeze = freeze; exports.generateUrl = generateUrl; exports.getMentionsFromCommentBody = getMentionsFromCommentBody; exports.getSubscriptionKey = getSubscriptionKey; exports.html = html; exports.htmlSafe = htmlSafe; exports.isCommentBodyLink = isCommentBodyLink; exports.isCommentBodyMention = isCommentBodyMention; exports.isCommentBodyText = isCommentBodyText; exports.isJsonArray = isJsonArray; exports.isJsonObject = isJsonObject; exports.isJsonScalar = isJsonScalar; exports.isLiveNode = isLiveNode; exports.isNotificationChannelEnabled = isNotificationChannelEnabled; exports.isNumberOperator = isNumberOperator; exports.isPlainObject = isPlainObject; exports.isStartsWithOperator = isStartsWithOperator; exports.isUrl = isUrl; exports.kInternal = kInternal; exports.keys = keys; exports.legacy_patchImmutableObject = legacy_patchImmutableObject; exports.lsonToJson = lsonToJson; exports.makeAbortController = makeAbortController; exports.makeEventSource = makeEventSource; exports.makePoller = makePoller; exports.makePosition = makePosition; exports.mapValues = mapValues; exports.memoizeOnSuccess = memoizeOnSuccess; exports.nanoid = nanoid; exports.nn = nn; exports.nodeStreamToCompactNodes = nodeStreamToCompactNodes; exports.objectToQuery = objectToQuery; exports.patchLiveObjectKey = patchLiveObjectKey; exports.patchNotificationSettings = patchNotificationSettings; exports.raise = raise; exports.resolveMentionsInCommentBody = resolveMentionsInCommentBody; exports.sanitizeUrl = sanitizeUrl; exports.shallow = shallow; exports.shallow2 = shallow2; exports.stableStringify = stableStringify; exports.stringifyCommentBody = stringifyCommentBody; exports.throwUsageError = throwUsageError; exports.toPlainLson = toPlainLson; exports.tryParseJson = tryParseJson; exports.url = url; exports.urljoin = urljoin; exports.wait = wait; exports.warnOnce = warnOnce; exports.warnOnceIf = warnOnceIf; exports.withTimeout = withTimeout;
|
|
11650
11723
|
//# sourceMappingURL=index.cjs.map
|