@liveblocks/core 1.6.0 → 1.7.1-pre1
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.d.mts +18 -7
- package/dist/index.d.ts +18 -7
- package/dist/index.js +32 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -570,7 +570,12 @@ declare type CustomAuthenticationResult = {
|
|
|
570
570
|
reason: string;
|
|
571
571
|
};
|
|
572
572
|
|
|
573
|
-
|
|
573
|
+
/**
|
|
574
|
+
* Represents some constraints for user info. Basically read this as: "any JSON
|
|
575
|
+
* object is fine, but _if_ it has a name field, it _must_ be a string."
|
|
576
|
+
* (Ditto for avatar.)
|
|
577
|
+
*/
|
|
578
|
+
declare type IUserInfo = {
|
|
574
579
|
[key: string]: Json | undefined;
|
|
575
580
|
name?: string;
|
|
576
581
|
avatar?: string;
|
|
@@ -587,7 +592,7 @@ declare type BaseUserMeta = {
|
|
|
587
592
|
/**
|
|
588
593
|
* Additional user information that has been set in the authentication endpoint.
|
|
589
594
|
*/
|
|
590
|
-
info?:
|
|
595
|
+
info?: IUserInfo;
|
|
591
596
|
};
|
|
592
597
|
|
|
593
598
|
declare enum Permission {
|
|
@@ -615,7 +620,7 @@ declare type LegacySecretToken = {
|
|
|
615
620
|
roomId: string;
|
|
616
621
|
scopes: string[];
|
|
617
622
|
id?: string;
|
|
618
|
-
info?:
|
|
623
|
+
info?: IUserInfo;
|
|
619
624
|
[other: string]: Json | undefined;
|
|
620
625
|
} & JwtMeta;
|
|
621
626
|
/**
|
|
@@ -626,7 +631,7 @@ declare type AccessToken = {
|
|
|
626
631
|
pid: string;
|
|
627
632
|
uid: string;
|
|
628
633
|
perms: LiveblocksPermissions;
|
|
629
|
-
ui?:
|
|
634
|
+
ui?: IUserInfo;
|
|
630
635
|
} & JwtMeta;
|
|
631
636
|
/**
|
|
632
637
|
* New authorization ID Token.
|
|
@@ -636,7 +641,7 @@ declare type IDToken = {
|
|
|
636
641
|
pid: string;
|
|
637
642
|
uid: string;
|
|
638
643
|
gids?: string[];
|
|
639
|
-
ui?:
|
|
644
|
+
ui?: IUserInfo;
|
|
640
645
|
} & JwtMeta;
|
|
641
646
|
declare type AuthToken = AccessToken | IDToken | LegacySecretToken;
|
|
642
647
|
declare type ParsedAuthToken = {
|
|
@@ -765,6 +770,12 @@ declare type CommentsApi<TThreadMetadata extends BaseMetadata> = {
|
|
|
765
770
|
emoji: string;
|
|
766
771
|
}): Promise<CommentData>;
|
|
767
772
|
};
|
|
773
|
+
declare class CommentsApiError extends Error {
|
|
774
|
+
message: string;
|
|
775
|
+
status: number;
|
|
776
|
+
details?: JsonObject | undefined;
|
|
777
|
+
constructor(message: string, status: number, details?: JsonObject | undefined);
|
|
778
|
+
}
|
|
768
779
|
declare function createCommentsApi<TThreadMetadata extends BaseMetadata>(roomId: string, getAuthValue: () => Promise<AuthValue>, config: Options): CommentsApi<TThreadMetadata>;
|
|
769
780
|
|
|
770
781
|
declare type Callback<T> = (event: T) => void;
|
|
@@ -2167,7 +2178,7 @@ declare function b64decode(b64value: string): string;
|
|
|
2167
2178
|
* a "Timed out" error if the given promise does not return or reject within
|
|
2168
2179
|
* the given timeout period (in milliseconds).
|
|
2169
2180
|
*/
|
|
2170
|
-
declare function withTimeout<T>(promise: Promise<T>, millis: number, errmsg
|
|
2181
|
+
declare function withTimeout<T>(promise: Promise<T>, millis: number, errmsg: string): Promise<T>;
|
|
2171
2182
|
|
|
2172
2183
|
/**
|
|
2173
2184
|
* Positions, aka the Pos type, are efficient encodings of "positions" in
|
|
@@ -2436,4 +2447,4 @@ declare type EnsureJson<T> = [
|
|
|
2436
2447
|
[K in keyof T]: EnsureJson<T[K]>;
|
|
2437
2448
|
};
|
|
2438
2449
|
|
|
2439
|
-
export { AckOp, AsyncCache, AsyncState, AsyncStateError, AsyncStateInitial, AsyncStateLoading, AsyncStateResolved, AsyncStateSuccess, BaseAuthResult, BaseMetadata, BaseUserMeta, Brand, BroadcastEventClientMsg, BroadcastOptions, BroadcastedEventServerMsg, Client, ClientMsg, ClientMsgCode, CommentBody, CommentBodyBlockElement, CommentBodyElement, CommentBodyInlineElement, CommentBodyLink, CommentBodyMention, CommentBodyParagraph, CommentBodyText, CommentData, CommentReaction, CommentsApi, CrdtType, CreateListOp, CreateMapOp, CreateObjectOp, CreateOp, CreateRegisterOp, CustomAuthenticationResult, Delegates, DeleteCrdtOp, DeleteObjectKeyOp, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, EnsureJson, EnterOptions, EventSource, FetchStorageClientMsg, FetchYDocClientMsg, History, IWebSocket, IWebSocketCloseEvent, IWebSocketEvent, IWebSocketInstance, IWebSocketMessageEvent, IdTuple, Immutable, InitialDocumentStateServerMsg, Json, JsonArray, JsonObject, JsonScalar, LegacyConnectionStatus, LiveList, LiveListUpdate, LiveMap, LiveMapUpdate, LiveNode, LiveObject, LiveObjectUpdate, LiveStructure, LostConnectionEvent, Lson, LsonObject, NodeMap, Op, OpCode, Others, OthersEvent, ParentToChildNodeMap, PlainLson, PlainLsonFields, PlainLsonList, PlainLsonMap, PlainLsonObject, RejectedStorageOpServerMsg, Resolve, Room, RoomEventMessage, RoomInitializers, RoomStateServerMsg, SerializedChild, SerializedCrdt, SerializedList, SerializedMap, SerializedObject, SerializedRegister, SerializedRootObject, ServerMsg, ServerMsgCode, SetParentKeyOp, Status, StorageStatus, StorageUpdate, ThreadData, ToImmutable, ToJson, UnsubscribeCallback, UpdateObjectOp, UpdatePresenceClientMsg, UpdatePresenceServerMsg, UpdateStorageClientMsg, UpdateStorageServerMsg, UpdateYDocClientMsg, User, UserJoinServerMsg, UserLeftServerMsg, WebsocketCloseCodes, YDocUpdateServerMsg, asPos, assert, assertNever, b64decode, cloneLson, fancyConsole as console, createAsyncCache, createClient, createCommentsApi, deprecate, deprecateIf, detectDupes, errorIf, freeze, isChildCrdt, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isPlainObject, isRootCrdt, legacy_patchImmutableObject, lsonToJson, makeEventSource, makePoller, makePosition, nn, patchLiveObjectKey, raise, shallow, stringify, throwUsageError, toPlainLson, tryParseJson, withTimeout };
|
|
2450
|
+
export { AckOp, AsyncCache, AsyncState, AsyncStateError, AsyncStateInitial, AsyncStateLoading, AsyncStateResolved, AsyncStateSuccess, BaseAuthResult, BaseMetadata, BaseUserMeta, Brand, BroadcastEventClientMsg, BroadcastOptions, BroadcastedEventServerMsg, Client, ClientMsg, ClientMsgCode, CommentBody, CommentBodyBlockElement, CommentBodyElement, CommentBodyInlineElement, CommentBodyLink, CommentBodyMention, CommentBodyParagraph, CommentBodyText, CommentData, CommentReaction, CommentsApi, CommentsApiError, CrdtType, CreateListOp, CreateMapOp, CreateObjectOp, CreateOp, CreateRegisterOp, CustomAuthenticationResult, Delegates, DeleteCrdtOp, DeleteObjectKeyOp, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, EnsureJson, EnterOptions, EventSource, FetchStorageClientMsg, FetchYDocClientMsg, History, IUserInfo, IWebSocket, IWebSocketCloseEvent, IWebSocketEvent, IWebSocketInstance, IWebSocketMessageEvent, IdTuple, Immutable, InitialDocumentStateServerMsg, Json, JsonArray, JsonObject, JsonScalar, LegacyConnectionStatus, LiveList, LiveListUpdate, LiveMap, LiveMapUpdate, LiveNode, LiveObject, LiveObjectUpdate, LiveStructure, LostConnectionEvent, Lson, LsonObject, NodeMap, Op, OpCode, Others, OthersEvent, ParentToChildNodeMap, PlainLson, PlainLsonFields, PlainLsonList, PlainLsonMap, PlainLsonObject, RejectedStorageOpServerMsg, Resolve, Room, RoomEventMessage, RoomInitializers, RoomStateServerMsg, SerializedChild, SerializedCrdt, SerializedList, SerializedMap, SerializedObject, SerializedRegister, SerializedRootObject, ServerMsg, ServerMsgCode, SetParentKeyOp, Status, StorageStatus, StorageUpdate, ThreadData, ToImmutable, ToJson, UnsubscribeCallback, UpdateObjectOp, UpdatePresenceClientMsg, UpdatePresenceServerMsg, UpdateStorageClientMsg, UpdateStorageServerMsg, UpdateYDocClientMsg, User, UserJoinServerMsg, UserLeftServerMsg, WebsocketCloseCodes, YDocUpdateServerMsg, asPos, assert, assertNever, b64decode, cloneLson, fancyConsole as console, createAsyncCache, createClient, createCommentsApi, deprecate, deprecateIf, detectDupes, errorIf, freeze, isChildCrdt, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isPlainObject, isRootCrdt, legacy_patchImmutableObject, lsonToJson, makeEventSource, makePoller, makePosition, nn, patchLiveObjectKey, raise, shallow, stringify, throwUsageError, toPlainLson, tryParseJson, withTimeout };
|
package/dist/index.d.ts
CHANGED
|
@@ -570,7 +570,12 @@ declare type CustomAuthenticationResult = {
|
|
|
570
570
|
reason: string;
|
|
571
571
|
};
|
|
572
572
|
|
|
573
|
-
|
|
573
|
+
/**
|
|
574
|
+
* Represents some constraints for user info. Basically read this as: "any JSON
|
|
575
|
+
* object is fine, but _if_ it has a name field, it _must_ be a string."
|
|
576
|
+
* (Ditto for avatar.)
|
|
577
|
+
*/
|
|
578
|
+
declare type IUserInfo = {
|
|
574
579
|
[key: string]: Json | undefined;
|
|
575
580
|
name?: string;
|
|
576
581
|
avatar?: string;
|
|
@@ -587,7 +592,7 @@ declare type BaseUserMeta = {
|
|
|
587
592
|
/**
|
|
588
593
|
* Additional user information that has been set in the authentication endpoint.
|
|
589
594
|
*/
|
|
590
|
-
info?:
|
|
595
|
+
info?: IUserInfo;
|
|
591
596
|
};
|
|
592
597
|
|
|
593
598
|
declare enum Permission {
|
|
@@ -615,7 +620,7 @@ declare type LegacySecretToken = {
|
|
|
615
620
|
roomId: string;
|
|
616
621
|
scopes: string[];
|
|
617
622
|
id?: string;
|
|
618
|
-
info?:
|
|
623
|
+
info?: IUserInfo;
|
|
619
624
|
[other: string]: Json | undefined;
|
|
620
625
|
} & JwtMeta;
|
|
621
626
|
/**
|
|
@@ -626,7 +631,7 @@ declare type AccessToken = {
|
|
|
626
631
|
pid: string;
|
|
627
632
|
uid: string;
|
|
628
633
|
perms: LiveblocksPermissions;
|
|
629
|
-
ui?:
|
|
634
|
+
ui?: IUserInfo;
|
|
630
635
|
} & JwtMeta;
|
|
631
636
|
/**
|
|
632
637
|
* New authorization ID Token.
|
|
@@ -636,7 +641,7 @@ declare type IDToken = {
|
|
|
636
641
|
pid: string;
|
|
637
642
|
uid: string;
|
|
638
643
|
gids?: string[];
|
|
639
|
-
ui?:
|
|
644
|
+
ui?: IUserInfo;
|
|
640
645
|
} & JwtMeta;
|
|
641
646
|
declare type AuthToken = AccessToken | IDToken | LegacySecretToken;
|
|
642
647
|
declare type ParsedAuthToken = {
|
|
@@ -765,6 +770,12 @@ declare type CommentsApi<TThreadMetadata extends BaseMetadata> = {
|
|
|
765
770
|
emoji: string;
|
|
766
771
|
}): Promise<CommentData>;
|
|
767
772
|
};
|
|
773
|
+
declare class CommentsApiError extends Error {
|
|
774
|
+
message: string;
|
|
775
|
+
status: number;
|
|
776
|
+
details?: JsonObject | undefined;
|
|
777
|
+
constructor(message: string, status: number, details?: JsonObject | undefined);
|
|
778
|
+
}
|
|
768
779
|
declare function createCommentsApi<TThreadMetadata extends BaseMetadata>(roomId: string, getAuthValue: () => Promise<AuthValue>, config: Options): CommentsApi<TThreadMetadata>;
|
|
769
780
|
|
|
770
781
|
declare type Callback<T> = (event: T) => void;
|
|
@@ -2167,7 +2178,7 @@ declare function b64decode(b64value: string): string;
|
|
|
2167
2178
|
* a "Timed out" error if the given promise does not return or reject within
|
|
2168
2179
|
* the given timeout period (in milliseconds).
|
|
2169
2180
|
*/
|
|
2170
|
-
declare function withTimeout<T>(promise: Promise<T>, millis: number, errmsg
|
|
2181
|
+
declare function withTimeout<T>(promise: Promise<T>, millis: number, errmsg: string): Promise<T>;
|
|
2171
2182
|
|
|
2172
2183
|
/**
|
|
2173
2184
|
* Positions, aka the Pos type, are efficient encodings of "positions" in
|
|
@@ -2436,4 +2447,4 @@ declare type EnsureJson<T> = [
|
|
|
2436
2447
|
[K in keyof T]: EnsureJson<T[K]>;
|
|
2437
2448
|
};
|
|
2438
2449
|
|
|
2439
|
-
export { AckOp, AsyncCache, AsyncState, AsyncStateError, AsyncStateInitial, AsyncStateLoading, AsyncStateResolved, AsyncStateSuccess, BaseAuthResult, BaseMetadata, BaseUserMeta, Brand, BroadcastEventClientMsg, BroadcastOptions, BroadcastedEventServerMsg, Client, ClientMsg, ClientMsgCode, CommentBody, CommentBodyBlockElement, CommentBodyElement, CommentBodyInlineElement, CommentBodyLink, CommentBodyMention, CommentBodyParagraph, CommentBodyText, CommentData, CommentReaction, CommentsApi, CrdtType, CreateListOp, CreateMapOp, CreateObjectOp, CreateOp, CreateRegisterOp, CustomAuthenticationResult, Delegates, DeleteCrdtOp, DeleteObjectKeyOp, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, EnsureJson, EnterOptions, EventSource, FetchStorageClientMsg, FetchYDocClientMsg, History, IWebSocket, IWebSocketCloseEvent, IWebSocketEvent, IWebSocketInstance, IWebSocketMessageEvent, IdTuple, Immutable, InitialDocumentStateServerMsg, Json, JsonArray, JsonObject, JsonScalar, LegacyConnectionStatus, LiveList, LiveListUpdate, LiveMap, LiveMapUpdate, LiveNode, LiveObject, LiveObjectUpdate, LiveStructure, LostConnectionEvent, Lson, LsonObject, NodeMap, Op, OpCode, Others, OthersEvent, ParentToChildNodeMap, PlainLson, PlainLsonFields, PlainLsonList, PlainLsonMap, PlainLsonObject, RejectedStorageOpServerMsg, Resolve, Room, RoomEventMessage, RoomInitializers, RoomStateServerMsg, SerializedChild, SerializedCrdt, SerializedList, SerializedMap, SerializedObject, SerializedRegister, SerializedRootObject, ServerMsg, ServerMsgCode, SetParentKeyOp, Status, StorageStatus, StorageUpdate, ThreadData, ToImmutable, ToJson, UnsubscribeCallback, UpdateObjectOp, UpdatePresenceClientMsg, UpdatePresenceServerMsg, UpdateStorageClientMsg, UpdateStorageServerMsg, UpdateYDocClientMsg, User, UserJoinServerMsg, UserLeftServerMsg, WebsocketCloseCodes, YDocUpdateServerMsg, asPos, assert, assertNever, b64decode, cloneLson, fancyConsole as console, createAsyncCache, createClient, createCommentsApi, deprecate, deprecateIf, detectDupes, errorIf, freeze, isChildCrdt, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isPlainObject, isRootCrdt, legacy_patchImmutableObject, lsonToJson, makeEventSource, makePoller, makePosition, nn, patchLiveObjectKey, raise, shallow, stringify, throwUsageError, toPlainLson, tryParseJson, withTimeout };
|
|
2450
|
+
export { AckOp, AsyncCache, AsyncState, AsyncStateError, AsyncStateInitial, AsyncStateLoading, AsyncStateResolved, AsyncStateSuccess, BaseAuthResult, BaseMetadata, BaseUserMeta, Brand, BroadcastEventClientMsg, BroadcastOptions, BroadcastedEventServerMsg, Client, ClientMsg, ClientMsgCode, CommentBody, CommentBodyBlockElement, CommentBodyElement, CommentBodyInlineElement, CommentBodyLink, CommentBodyMention, CommentBodyParagraph, CommentBodyText, CommentData, CommentReaction, CommentsApi, CommentsApiError, CrdtType, CreateListOp, CreateMapOp, CreateObjectOp, CreateOp, CreateRegisterOp, CustomAuthenticationResult, Delegates, DeleteCrdtOp, DeleteObjectKeyOp, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, EnsureJson, EnterOptions, EventSource, FetchStorageClientMsg, FetchYDocClientMsg, History, IUserInfo, IWebSocket, IWebSocketCloseEvent, IWebSocketEvent, IWebSocketInstance, IWebSocketMessageEvent, IdTuple, Immutable, InitialDocumentStateServerMsg, Json, JsonArray, JsonObject, JsonScalar, LegacyConnectionStatus, LiveList, LiveListUpdate, LiveMap, LiveMapUpdate, LiveNode, LiveObject, LiveObjectUpdate, LiveStructure, LostConnectionEvent, Lson, LsonObject, NodeMap, Op, OpCode, Others, OthersEvent, ParentToChildNodeMap, PlainLson, PlainLsonFields, PlainLsonList, PlainLsonMap, PlainLsonObject, RejectedStorageOpServerMsg, Resolve, Room, RoomEventMessage, RoomInitializers, RoomStateServerMsg, SerializedChild, SerializedCrdt, SerializedList, SerializedMap, SerializedObject, SerializedRegister, SerializedRootObject, ServerMsg, ServerMsgCode, SetParentKeyOp, Status, StorageStatus, StorageUpdate, ThreadData, ToImmutable, ToJson, UnsubscribeCallback, UpdateObjectOp, UpdatePresenceClientMsg, UpdatePresenceServerMsg, UpdateStorageClientMsg, UpdateStorageServerMsg, UpdateYDocClientMsg, User, UserJoinServerMsg, UserLeftServerMsg, WebsocketCloseCodes, YDocUpdateServerMsg, asPos, assert, assertNever, b64decode, cloneLson, fancyConsole as console, createAsyncCache, createClient, createCommentsApi, deprecate, deprecateIf, detectDupes, errorIf, freeze, isChildCrdt, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isPlainObject, isRootCrdt, legacy_patchImmutableObject, lsonToJson, makeEventSource, makePoller, makePosition, nn, patchLiveObjectKey, raise, shallow, stringify, throwUsageError, toPlainLson, tryParseJson, withTimeout };
|
package/dist/index.js
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 = "1.
|
|
9
|
+
var PKG_VERSION = "1.7.1-pre1";
|
|
10
10
|
var PKG_FORMAT = "cjs";
|
|
11
11
|
|
|
12
12
|
// src/dupe-detection.ts
|
|
@@ -619,7 +619,7 @@ function compactObject(obj) {
|
|
|
619
619
|
});
|
|
620
620
|
return newObj;
|
|
621
621
|
}
|
|
622
|
-
async function withTimeout(promise, millis, errmsg
|
|
622
|
+
async function withTimeout(promise, millis, errmsg) {
|
|
623
623
|
let timerID;
|
|
624
624
|
const timer$ = new Promise((_, reject) => {
|
|
625
625
|
timerID = setTimeout(() => {
|
|
@@ -875,7 +875,11 @@ function createConnectionStateMachine(delegates, options) {
|
|
|
875
875
|
"@auth.busy"
|
|
876
876
|
).onEnterAsync(
|
|
877
877
|
"@auth.busy",
|
|
878
|
-
() => withTimeout(
|
|
878
|
+
() => withTimeout(
|
|
879
|
+
delegates.authenticate(),
|
|
880
|
+
AUTH_TIMEOUT,
|
|
881
|
+
"Timed out during auth"
|
|
882
|
+
),
|
|
879
883
|
// On successful authentication
|
|
880
884
|
(okEvent) => ({
|
|
881
885
|
target: "@connecting.busy",
|
|
@@ -981,7 +985,11 @@ function createConnectionStateMachine(delegates, options) {
|
|
|
981
985
|
});
|
|
982
986
|
}
|
|
983
987
|
);
|
|
984
|
-
return withTimeout(
|
|
988
|
+
return withTimeout(
|
|
989
|
+
connect$,
|
|
990
|
+
SOCKET_CONNECT_TIMEOUT,
|
|
991
|
+
"Timed out during websocket connection"
|
|
992
|
+
).then(
|
|
985
993
|
//
|
|
986
994
|
// Part 3:
|
|
987
995
|
// By now, our "open" event has fired, and the promise has been
|
|
@@ -1744,27 +1752,37 @@ function getAuthBearerHeaderFromAuthValue(authValue) {
|
|
|
1744
1752
|
return authValue.token.raw;
|
|
1745
1753
|
}
|
|
1746
1754
|
}
|
|
1755
|
+
var CommentsApiError = class extends Error {
|
|
1756
|
+
constructor(message, status, details) {
|
|
1757
|
+
super(message);
|
|
1758
|
+
this.message = message;
|
|
1759
|
+
this.status = status;
|
|
1760
|
+
this.details = details;
|
|
1761
|
+
}
|
|
1762
|
+
};
|
|
1747
1763
|
function createCommentsApi(roomId, getAuthValue, config) {
|
|
1748
1764
|
async function fetchJson(endpoint, options) {
|
|
1749
1765
|
const response = await fetchApi(roomId, endpoint, options);
|
|
1750
1766
|
if (!response.ok) {
|
|
1751
1767
|
if (response.status >= 400 && response.status < 600) {
|
|
1752
|
-
let
|
|
1768
|
+
let error3;
|
|
1753
1769
|
try {
|
|
1754
1770
|
const errorBody = await response.json();
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1771
|
+
error3 = new CommentsApiError(
|
|
1772
|
+
errorBody.message,
|
|
1773
|
+
response.status,
|
|
1774
|
+
errorBody
|
|
1775
|
+
);
|
|
1776
|
+
} catch (e3) {
|
|
1777
|
+
error3 = new CommentsApiError(response.statusText, response.status);
|
|
1758
1778
|
}
|
|
1759
|
-
throw
|
|
1760
|
-
`Request failed with status ${response.status}: ${errorMessage}`
|
|
1761
|
-
);
|
|
1779
|
+
throw error3;
|
|
1762
1780
|
}
|
|
1763
1781
|
}
|
|
1764
1782
|
let body;
|
|
1765
1783
|
try {
|
|
1766
1784
|
body = await response.json();
|
|
1767
|
-
} catch (
|
|
1785
|
+
} catch (e4) {
|
|
1768
1786
|
body = {};
|
|
1769
1787
|
}
|
|
1770
1788
|
return body;
|
|
@@ -6781,5 +6799,6 @@ detectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);
|
|
|
6781
6799
|
|
|
6782
6800
|
|
|
6783
6801
|
|
|
6784
|
-
|
|
6802
|
+
|
|
6803
|
+
exports.ClientMsgCode = ClientMsgCode; exports.CommentsApiError = CommentsApiError; exports.CrdtType = CrdtType; exports.LiveList = LiveList; exports.LiveMap = LiveMap; exports.LiveObject = LiveObject; exports.OpCode = OpCode; exports.ServerMsgCode = ServerMsgCode; exports.WebsocketCloseCodes = WebsocketCloseCodes; exports.asPos = asPos; exports.assert = assert; exports.assertNever = assertNever; exports.b64decode = b64decode; exports.cloneLson = cloneLson; exports.console = fancy_console_exports; exports.createAsyncCache = createAsyncCache; exports.createClient = createClient; exports.createCommentsApi = createCommentsApi; exports.deprecate = deprecate; exports.deprecateIf = deprecateIf; exports.detectDupes = detectDupes; exports.errorIf = errorIf; exports.freeze = freeze; exports.isChildCrdt = isChildCrdt; exports.isJsonArray = isJsonArray; exports.isJsonObject = isJsonObject; exports.isJsonScalar = isJsonScalar; exports.isLiveNode = isLiveNode; exports.isPlainObject = isPlainObject; exports.isRootCrdt = isRootCrdt; exports.legacy_patchImmutableObject = legacy_patchImmutableObject; exports.lsonToJson = lsonToJson; exports.makeEventSource = makeEventSource; exports.makePoller = makePoller; exports.makePosition = makePosition; exports.nn = nn; exports.patchLiveObjectKey = patchLiveObjectKey; exports.raise = raise; exports.shallow = shallow; exports.stringify = stringify; exports.throwUsageError = throwUsageError; exports.toPlainLson = toPlainLson; exports.tryParseJson = tryParseJson; exports.withTimeout = withTimeout;
|
|
6785
6804
|
//# sourceMappingURL=index.js.map
|