@liveblocks/node
Advanced tools
Comparing version 2.18.3 to 2.18.4-uns1
@@ -823,2 +823,7 @@ import { BaseUserMeta, DU, OptionalTupleUnless, PlainLsonObject, JsonObject, QueryMetadata, ThreadData, CommentData, CommentBody, Patchable, CommentUserReaction, InboxNotificationData, RoomNotificationSettings, KDAD, DAD, UserNotificationSettings, PartialUserNotificationSettings, LsonObject, ToImmutable, PartialUnless, BaseMetadata, DE, DM, DS, NotificationChannel } from '@liveblocks/core'; | ||
}; | ||
/** | ||
* When receiving an event we cannot define the `kind` | ||
* as member of the augmentation | ||
*/ | ||
type CustomKind = `$${string}`; | ||
type WebhookEvent = StorageUpdatedEvent | UserEnteredEvent | UserLeftEvent | RoomCreatedEvent | RoomDeletedEvent | CommentCreatedEvent | CommentEditedEvent | CommentDeletedEvent | CommentReactionAdded | CommentReactionRemoved | ThreadMetadataUpdatedEvent | NotificationEvent | ThreadCreatedEvent | ThreadDeletedEvent | ThreadMarkedAsResolvedEvent | ThreadMarkedAsUnresolvedEvent | YDocUpdatedEvent; | ||
@@ -825,0 +830,0 @@ type StorageUpdatedEvent = { |
@@ -1,23 +0,24 @@ | ||
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;// src/index.ts | ||
var _core = require('@liveblocks/core'); | ||
// src/index.ts | ||
import { detectDupes } from "@liveblocks/core"; | ||
// src/version.ts | ||
var PKG_NAME = "@liveblocks/node"; | ||
var PKG_VERSION = "2.18.3"; | ||
var PKG_FORMAT = "cjs"; | ||
var PKG_VERSION = "2.18.4-uns1"; | ||
var PKG_FORMAT = "esm"; | ||
// src/client.ts | ||
import { | ||
convertToCommentData, | ||
convertToCommentUserReaction, | ||
convertToInboxNotificationData, | ||
convertToThreadData, | ||
createUserNotificationSettings, | ||
objectToQuery, | ||
url as url2, | ||
urljoin | ||
} from "@liveblocks/core"; | ||
// src/Session.ts | ||
import { url } from "@liveblocks/core"; | ||
// src/utils.ts | ||
@@ -34,3 +35,3 @@ var DEFAULT_BASE_URL = "https://api.liveblocks.io"; | ||
async function fetchPolyfill() { | ||
return typeof globalThis.fetch !== "undefined" ? globalThis.fetch : (await Promise.resolve().then(() => _interopRequireWildcard(require("node-fetch")))).default; | ||
return typeof globalThis.fetch !== "undefined" ? globalThis.fetch : (await import("node-fetch")).default; | ||
} | ||
@@ -94,5 +95,5 @@ function isString(value) { | ||
var roomPatternRegex = /^([*]|[^*]{1,128}[*]?)$/; | ||
var Session = (_class = class { | ||
__init() {this.FULL_ACCESS = FULL_ACCESS} | ||
__init2() {this.READ_ACCESS = READ_ACCESS} | ||
var Session = class { | ||
FULL_ACCESS = FULL_ACCESS; | ||
READ_ACCESS = READ_ACCESS; | ||
#postFn; | ||
@@ -104,3 +105,3 @@ #userId; | ||
/** @internal */ | ||
constructor(postFn, userId, userInfo) {;_class.prototype.__init.call(this);_class.prototype.__init2.call(this); | ||
constructor(postFn, userId, userInfo) { | ||
assertNonEmpty(userId, "userId"); | ||
@@ -183,3 +184,3 @@ this.#postFn = postFn; | ||
try { | ||
const resp = await this.#postFn(_core.url`/v2/authorize-user`, { | ||
const resp = await this.#postFn(url`/v2/authorize-user`, { | ||
// Required | ||
@@ -203,3 +204,3 @@ userId: this.#userId, | ||
} | ||
}, _class); | ||
}; | ||
@@ -221,3 +222,3 @@ // src/client.ts | ||
async #post(path, json) { | ||
const url3 = _core.urljoin.call(void 0, this.#baseUrl, path); | ||
const url3 = urljoin(this.#baseUrl, path); | ||
const headers = { | ||
@@ -236,3 +237,3 @@ Authorization: `Bearer ${this.#secret}`, | ||
async #put(path, json) { | ||
const url3 = _core.urljoin.call(void 0, this.#baseUrl, path); | ||
const url3 = urljoin(this.#baseUrl, path); | ||
const headers = { | ||
@@ -250,3 +251,3 @@ Authorization: `Bearer ${this.#secret}`, | ||
async #putBinary(path, body, params) { | ||
const url3 = _core.urljoin.call(void 0, this.#baseUrl, path, params); | ||
const url3 = urljoin(this.#baseUrl, path, params); | ||
const headers = { | ||
@@ -260,3 +261,3 @@ Authorization: `Bearer ${this.#secret}`, | ||
async #delete(path) { | ||
const url3 = _core.urljoin.call(void 0, this.#baseUrl, path); | ||
const url3 = urljoin(this.#baseUrl, path); | ||
const headers = { | ||
@@ -270,3 +271,3 @@ Authorization: `Bearer ${this.#secret}` | ||
async #get(path, params) { | ||
const url3 = _core.urljoin.call(void 0, this.#baseUrl, path, params); | ||
const url3 = urljoin(this.#baseUrl, path, params); | ||
const headers = { | ||
@@ -300,3 +301,3 @@ Authorization: `Bearer ${this.#secret}` | ||
const options = rest[0]; | ||
return new Session(this.#post.bind(this), userId, _optionalChain([options, 'optionalAccess', _ => _.userInfo])); | ||
return new Session(this.#post.bind(this), userId, options?.userInfo); | ||
} | ||
@@ -338,3 +339,3 @@ /** | ||
const options = rest[0]; | ||
const path = _core.url`/v2/identify-user`; | ||
const path = url2`/v2/identify-user`; | ||
const userId = typeof identity === "string" ? identity : identity.userId; | ||
@@ -348,3 +349,3 @@ const groupIds = typeof identity === "string" ? void 0 : identity.groupIds; | ||
// Optional metadata | ||
userInfo: _optionalChain([options, 'optionalAccess', _2 => _2.userInfo]) | ||
userInfo: options?.userInfo | ||
}); | ||
@@ -358,3 +359,3 @@ return { | ||
status: 503, | ||
body: `Call to ${_core.urljoin.call(void 0, | ||
body: `Call to ${urljoin( | ||
this.#baseUrl, | ||
@@ -381,3 +382,3 @@ path | ||
async getRooms(params = {}) { | ||
const path = _core.url`/v2/rooms`; | ||
const path = url2`/v2/rooms`; | ||
let query; | ||
@@ -387,3 +388,3 @@ if (typeof params.query === "string") { | ||
} else if (typeof params.query === "object") { | ||
query = _core.objectToQuery.call(void 0, params.query); | ||
query = objectToQuery(params.query); | ||
} | ||
@@ -397,3 +398,3 @@ const queryParams = { | ||
...Object.fromEntries( | ||
Object.entries(_nullishCoalesce(params.metadata, () => ( {}))).map(([key, val]) => [ | ||
Object.entries(params.metadata ?? {}).map(([key, val]) => [ | ||
`metadata.${key}`, | ||
@@ -436,3 +437,3 @@ val | ||
const { defaultAccesses, groupsAccesses, usersAccesses, metadata } = params; | ||
const res = await this.#post(_core.url`/v2/rooms`, { | ||
const res = await this.#post(url2`/v2/rooms`, { | ||
id: roomId, | ||
@@ -463,3 +464,3 @@ defaultAccesses, | ||
async getRoom(roomId) { | ||
const res = await this.#get(_core.url`/v2/rooms/${roomId}`); | ||
const res = await this.#get(url2`/v2/rooms/${roomId}`); | ||
if (!res.ok) { | ||
@@ -490,3 +491,3 @@ const text = await res.text(); | ||
const { defaultAccesses, groupsAccesses, usersAccesses, metadata } = params; | ||
const res = await this.#post(_core.url`/v2/rooms/${roomId}`, { | ||
const res = await this.#post(url2`/v2/rooms/${roomId}`, { | ||
defaultAccesses, | ||
@@ -515,3 +516,3 @@ groupsAccesses, | ||
async deleteRoom(roomId) { | ||
const res = await this.#delete(_core.url`/v2/rooms/${roomId}`); | ||
const res = await this.#delete(url2`/v2/rooms/${roomId}`); | ||
if (!res.ok) { | ||
@@ -528,3 +529,3 @@ const text = await res.text(); | ||
async getActiveUsers(roomId) { | ||
const res = await this.#get(_core.url`/v2/rooms/${roomId}/active_users`); | ||
const res = await this.#get(url2`/v2/rooms/${roomId}/active_users`); | ||
if (!res.ok) { | ||
@@ -543,3 +544,3 @@ const text = await res.text(); | ||
const res = await this.#post( | ||
_core.url`/v2/rooms/${roomId}/broadcast_event`, | ||
url2`/v2/rooms/${roomId}/broadcast_event`, | ||
message | ||
@@ -553,3 +554,3 @@ ); | ||
async getStorageDocument(roomId, format = "plain-lson") { | ||
const res = await this.#get(_core.url`/v2/rooms/${roomId}/storage`, { format }); | ||
const res = await this.#get(url2`/v2/rooms/${roomId}/storage`, { format }); | ||
if (!res.ok) { | ||
@@ -570,3 +571,3 @@ const text = await res.text(); | ||
async initializeStorageDocument(roomId, document) { | ||
const res = await this.#post(_core.url`/v2/rooms/${roomId}/storage`, document); | ||
const res = await this.#post(url2`/v2/rooms/${roomId}/storage`, document); | ||
if (!res.ok) { | ||
@@ -583,3 +584,3 @@ const text = await res.text(); | ||
async deleteStorageDocument(roomId) { | ||
const res = await this.#delete(_core.url`/v2/rooms/${roomId}/storage`); | ||
const res = await this.#delete(url2`/v2/rooms/${roomId}/storage`); | ||
if (!res.ok) { | ||
@@ -603,3 +604,3 @@ const text = await res.text(); | ||
const { format, key, type } = params; | ||
const path = _core.url`v2/rooms/${roomId}/ydoc`; | ||
const path = url2`v2/rooms/${roomId}/ydoc`; | ||
const res = await this.#get(path, { | ||
@@ -623,3 +624,3 @@ formatting: format ? "true" : void 0, | ||
async sendYjsBinaryUpdate(roomId, update, params = {}) { | ||
const res = await this.#putBinary(_core.url`/v2/rooms/${roomId}/ydoc`, update, { | ||
const res = await this.#putBinary(url2`/v2/rooms/${roomId}/ydoc`, update, { | ||
guid: params.guid | ||
@@ -640,3 +641,3 @@ }); | ||
async getYjsDocumentAsBinaryUpdate(roomId, params = {}) { | ||
const res = await this.#get(_core.url`/v2/rooms/${roomId}/ydoc-binary`, { | ||
const res = await this.#get(url2`/v2/rooms/${roomId}/ydoc-binary`, { | ||
guid: params.guid | ||
@@ -660,3 +661,3 @@ }); | ||
async createSchema(name, body) { | ||
const res = await this.#post(_core.url`/v2/schemas`, { | ||
const res = await this.#post(url2`/v2/schemas`, { | ||
name, | ||
@@ -684,3 +685,3 @@ body | ||
async getSchema(schemaId) { | ||
const res = await this.#get(_core.url`/v2/schemas/${schemaId}`); | ||
const res = await this.#get(url2`/v2/schemas/${schemaId}`); | ||
if (!res.ok) { | ||
@@ -706,3 +707,3 @@ const text = await res.text(); | ||
async updateSchema(schemaId, body) { | ||
const res = await this.#put(_core.url`/v2/schemas/${schemaId}`, { | ||
const res = await this.#put(url2`/v2/schemas/${schemaId}`, { | ||
body | ||
@@ -728,3 +729,3 @@ }); | ||
async deleteSchema(schemaId) { | ||
const res = await this.#delete(_core.url`/v2/schemas/${schemaId}`); | ||
const res = await this.#delete(url2`/v2/schemas/${schemaId}`); | ||
if (!res.ok) { | ||
@@ -741,3 +742,3 @@ const text = await res.text(); | ||
async getSchemaByRoomId(roomId) { | ||
const res = await this.#get(_core.url`/v2/rooms/${roomId}/schema`); | ||
const res = await this.#get(url2`/v2/rooms/${roomId}/schema`); | ||
if (!res.ok) { | ||
@@ -764,3 +765,3 @@ const text = await res.text(); | ||
async attachSchemaToRoom(roomId, schemaId) { | ||
const res = await this.#post(_core.url`/v2/rooms/${roomId}/schema`, { | ||
const res = await this.#post(url2`/v2/rooms/${roomId}/schema`, { | ||
schema: schemaId | ||
@@ -779,3 +780,3 @@ }); | ||
async detachSchemaFromRoom(roomId) { | ||
const res = await this.#delete(_core.url`/v2/rooms/${roomId}/schema`); | ||
const res = await this.#delete(url2`/v2/rooms/${roomId}/schema`); | ||
if (!res.ok) { | ||
@@ -802,5 +803,5 @@ const text = await res.text(); | ||
} else if (typeof params.query === "object") { | ||
query = _core.objectToQuery.call(void 0, params.query); | ||
query = objectToQuery(params.query); | ||
} | ||
const res = await this.#get(_core.url`/v2/rooms/${roomId}/threads`, { | ||
const res = await this.#get(url2`/v2/rooms/${roomId}/threads`, { | ||
query | ||
@@ -814,3 +815,3 @@ }); | ||
return { | ||
data: data.map((thread) => _core.convertToThreadData.call(void 0, thread)) | ||
data: data.map((thread) => convertToThreadData(thread)) | ||
}; | ||
@@ -827,3 +828,3 @@ } | ||
const { roomId, threadId } = params; | ||
const res = await this.#get(_core.url`/v2/rooms/${roomId}/threads/${threadId}`); | ||
const res = await this.#get(url2`/v2/rooms/${roomId}/threads/${threadId}`); | ||
if (!res.ok) { | ||
@@ -833,3 +834,3 @@ const text = await res.text(); | ||
} | ||
return _core.convertToThreadData.call(void 0, await res.json()); | ||
return convertToThreadData(await res.json()); | ||
} | ||
@@ -849,3 +850,3 @@ /** | ||
const res = await this.#get( | ||
_core.url`/v2/rooms/${roomId}/threads/${threadId}/participants` | ||
url2`/v2/rooms/${roomId}/threads/${threadId}/participants` | ||
); | ||
@@ -869,3 +870,3 @@ if (!res.ok) { | ||
const res = await this.#get( | ||
_core.url`/v2/rooms/${roomId}/threads/${threadId}/comments/${commentId}` | ||
url2`/v2/rooms/${roomId}/threads/${threadId}/comments/${commentId}` | ||
); | ||
@@ -876,3 +877,3 @@ if (!res.ok) { | ||
} | ||
return _core.convertToCommentData.call(void 0, await res.json()); | ||
return convertToCommentData(await res.json()); | ||
} | ||
@@ -892,6 +893,6 @@ /** | ||
const res = await this.#post( | ||
_core.url`/v2/rooms/${roomId}/threads/${threadId}/comments`, | ||
url2`/v2/rooms/${roomId}/threads/${threadId}/comments`, | ||
{ | ||
...data, | ||
createdAt: _optionalChain([data, 'access', _3 => _3.createdAt, 'optionalAccess', _4 => _4.toISOString, 'call', _5 => _5()]) | ||
createdAt: data.createdAt?.toISOString() | ||
} | ||
@@ -903,3 +904,3 @@ ); | ||
} | ||
return _core.convertToCommentData.call(void 0, await res.json()); | ||
return convertToCommentData(await res.json()); | ||
} | ||
@@ -918,6 +919,6 @@ /** | ||
const res = await this.#post( | ||
_core.url`/v2/rooms/${roomId}/threads/${threadId}/comments/${commentId}`, | ||
url2`/v2/rooms/${roomId}/threads/${threadId}/comments/${commentId}`, | ||
{ | ||
...data, | ||
editedAt: _optionalChain([data, 'access', _6 => _6.editedAt, 'optionalAccess', _7 => _7.toISOString, 'call', _8 => _8()]) | ||
editedAt: data.editedAt?.toISOString() | ||
} | ||
@@ -929,3 +930,3 @@ ); | ||
} | ||
return _core.convertToCommentData.call(void 0, await res.json()); | ||
return convertToCommentData(await res.json()); | ||
} | ||
@@ -941,3 +942,3 @@ /** | ||
const res = await this.#delete( | ||
_core.url`/v2/rooms/${roomId}/threads/${threadId}/comments/${commentId}` | ||
url2`/v2/rooms/${roomId}/threads/${threadId}/comments/${commentId}` | ||
); | ||
@@ -961,7 +962,7 @@ if (!res.ok) { | ||
const { roomId, data } = params; | ||
const res = await this.#post(_core.url`/v2/rooms/${roomId}/threads`, { | ||
const res = await this.#post(url2`/v2/rooms/${roomId}/threads`, { | ||
...data, | ||
comment: { | ||
...data.comment, | ||
createdAt: _optionalChain([data, 'access', _9 => _9.comment, 'access', _10 => _10.createdAt, 'optionalAccess', _11 => _11.toISOString, 'call', _12 => _12()]) | ||
createdAt: data.comment.createdAt?.toISOString() | ||
} | ||
@@ -973,3 +974,3 @@ }); | ||
} | ||
return _core.convertToThreadData.call(void 0, await res.json()); | ||
return convertToThreadData(await res.json()); | ||
} | ||
@@ -984,3 +985,3 @@ /** | ||
const res = await this.#delete( | ||
_core.url`/v2/rooms/${roomId}/threads/${threadId}` | ||
url2`/v2/rooms/${roomId}/threads/${threadId}` | ||
); | ||
@@ -1002,3 +1003,3 @@ if (!res.ok) { | ||
const res = await this.#post( | ||
_core.url`/v2/rooms/${roomId}/threads/${threadId}/mark-as-resolved`, | ||
url2`/v2/rooms/${roomId}/threads/${threadId}/mark-as-resolved`, | ||
{} | ||
@@ -1010,3 +1011,3 @@ ); | ||
} | ||
return _core.convertToThreadData.call(void 0, await res.json()); | ||
return convertToThreadData(await res.json()); | ||
} | ||
@@ -1023,3 +1024,3 @@ /** | ||
const res = await this.#post( | ||
_core.url`/v2/rooms/${roomId}/threads/${threadId}/mark-as-unresolved`, | ||
url2`/v2/rooms/${roomId}/threads/${threadId}/mark-as-unresolved`, | ||
{} | ||
@@ -1031,3 +1032,3 @@ ); | ||
} | ||
return _core.convertToThreadData.call(void 0, await res.json()); | ||
return convertToThreadData(await res.json()); | ||
} | ||
@@ -1046,6 +1047,6 @@ /** | ||
const res = await this.#post( | ||
_core.url`/v2/rooms/${roomId}/threads/${threadId}/metadata`, | ||
url2`/v2/rooms/${roomId}/threads/${threadId}/metadata`, | ||
{ | ||
...data, | ||
updatedAt: _optionalChain([data, 'access', _13 => _13.updatedAt, 'optionalAccess', _14 => _14.toISOString, 'call', _15 => _15()]) | ||
updatedAt: data.updatedAt?.toISOString() | ||
} | ||
@@ -1072,6 +1073,6 @@ ); | ||
const res = await this.#post( | ||
_core.url`/v2/rooms/${roomId}/threads/${threadId}/comments/${commentId}/add-reaction`, | ||
url2`/v2/rooms/${roomId}/threads/${threadId}/comments/${commentId}/add-reaction`, | ||
{ | ||
...data, | ||
createdAt: _optionalChain([data, 'access', _16 => _16.createdAt, 'optionalAccess', _17 => _17.toISOString, 'call', _18 => _18()]) | ||
createdAt: data.createdAt?.toISOString() | ||
} | ||
@@ -1084,3 +1085,3 @@ ); | ||
const reaction = await res.json(); | ||
return _core.convertToCommentUserReaction.call(void 0, reaction); | ||
return convertToCommentUserReaction(reaction); | ||
} | ||
@@ -1099,6 +1100,6 @@ /** | ||
const res = await this.#post( | ||
_core.url`/v2/rooms/${roomId}/threads/${threadId}/comments/${params.commentId}/remove-reaction`, | ||
url2`/v2/rooms/${roomId}/threads/${threadId}/comments/${params.commentId}/remove-reaction`, | ||
{ | ||
...data, | ||
removedAt: _optionalChain([data, 'access', _19 => _19.removedAt, 'optionalAccess', _20 => _20.toISOString, 'call', _21 => _21()]) | ||
removedAt: data.removedAt?.toISOString() | ||
} | ||
@@ -1119,3 +1120,3 @@ ); | ||
const res = await this.#get( | ||
_core.url`/v2/users/${userId}/inbox-notifications/${inboxNotificationId}` | ||
url2`/v2/users/${userId}/inbox-notifications/${inboxNotificationId}` | ||
); | ||
@@ -1126,3 +1127,3 @@ if (!res.ok) { | ||
} | ||
return _core.convertToInboxNotificationData.call(void 0, | ||
return convertToInboxNotificationData( | ||
await res.json() | ||
@@ -1142,5 +1143,5 @@ ); | ||
} else if (typeof params.query === "object") { | ||
query = _core.objectToQuery.call(void 0, params.query); | ||
query = objectToQuery(params.query); | ||
} | ||
const res = await this.#get(_core.url`/v2/users/${userId}/inbox-notifications`, { | ||
const res = await this.#get(url2`/v2/users/${userId}/inbox-notifications`, { | ||
query | ||
@@ -1154,3 +1155,3 @@ }); | ||
return { | ||
data: data.map(_core.convertToInboxNotificationData) | ||
data: data.map(convertToInboxNotificationData) | ||
}; | ||
@@ -1166,3 +1167,3 @@ } | ||
const res = await this.#get( | ||
_core.url`/v2/rooms/${roomId}/users/${userId}/notification-settings` | ||
url2`/v2/rooms/${roomId}/users/${userId}/notification-settings` | ||
); | ||
@@ -1184,3 +1185,3 @@ if (!res.ok) { | ||
const res = await this.#post( | ||
_core.url`/v2/rooms/${roomId}/users/${userId}/notification-settings`, | ||
url2`/v2/rooms/${roomId}/users/${userId}/notification-settings`, | ||
data | ||
@@ -1202,3 +1203,3 @@ ); | ||
const res = await this.#delete( | ||
_core.url`/v2/rooms/${roomId}/users/${userId}/notification-settings` | ||
url2`/v2/rooms/${roomId}/users/${userId}/notification-settings` | ||
); | ||
@@ -1218,3 +1219,3 @@ if (!res.ok) { | ||
const res = await this.#post( | ||
_core.url`/v2/rooms/${currentRoomId}/update-room-id`, | ||
url2`/v2/rooms/${currentRoomId}/update-room-id`, | ||
{ | ||
@@ -1236,3 +1237,3 @@ newRoomId | ||
async triggerInboxNotification(params) { | ||
const res = await this.#post(_core.url`/v2/inbox-notifications/trigger`, params); | ||
const res = await this.#post(url2`/v2/inbox-notifications/trigger`, params); | ||
if (!res.ok) { | ||
@@ -1251,3 +1252,3 @@ const text = await res.text(); | ||
const res = await this.#delete( | ||
_core.url`/v2/users/${userId}/inbox-notifications/${inboxNotificationId}` | ||
url2`/v2/users/${userId}/inbox-notifications/${inboxNotificationId}` | ||
); | ||
@@ -1266,3 +1267,3 @@ if (!res.ok) { | ||
const res = await this.#delete( | ||
_core.url`/v2/users/${userId}/inbox-notifications` | ||
url2`/v2/users/${userId}/inbox-notifications` | ||
); | ||
@@ -1280,3 +1281,3 @@ if (!res.ok) { | ||
const { userId } = params; | ||
const res = await this.#get(_core.url`/v2/users/${userId}/notification-settings`); | ||
const res = await this.#get(url2`/v2/users/${userId}/notification-settings`); | ||
if (!res.ok) { | ||
@@ -1286,3 +1287,5 @@ const text = await res.text(); | ||
} | ||
return await res.json(); | ||
const plainSettings = await res.json(); | ||
const settings = createUserNotificationSettings(plainSettings); | ||
return settings; | ||
} | ||
@@ -1297,3 +1300,3 @@ /** | ||
const res = await this.#post( | ||
_core.url`/v2/users/${userId}/notification-settings`, | ||
url2`/v2/users/${userId}/notification-settings`, | ||
data | ||
@@ -1305,3 +1308,5 @@ ); | ||
} | ||
return await res.json(); | ||
const plainSettings = await res.json(); | ||
const settings = createUserNotificationSettings(plainSettings); | ||
return settings; | ||
} | ||
@@ -1315,3 +1320,3 @@ /** | ||
const res = await this.#delete( | ||
_core.url`/v2/users/${userId}/notification-settings` | ||
url2`/v2/users/${userId}/notification-settings` | ||
); | ||
@@ -1325,3 +1330,3 @@ if (!res.ok) { | ||
var LiveblocksError = class extends Error { | ||
status; | ||
constructor(status, message = "") { | ||
@@ -1335,4 +1340,4 @@ super(message); | ||
// src/webhooks.ts | ||
var _base64 = require('@stablelib/base64'); var base64 = _interopRequireWildcard(_base64); | ||
var _fastsha256 = require('fast-sha256'); var sha256 = _interopRequireWildcard(_fastsha256); | ||
import * as base64 from "@stablelib/base64"; | ||
import * as sha256 from "fast-sha256"; | ||
var WebhookHandler = class _WebhookHandler { | ||
@@ -1480,19 +1485,19 @@ #secretBuffer; | ||
// src/index.ts | ||
_core.detectDupes.call(void 0, PKG_NAME, PKG_VERSION, PKG_FORMAT); | ||
exports.Liveblocks = Liveblocks; exports.LiveblocksError = LiveblocksError; exports.WebhookHandler = WebhookHandler; exports.getMentionedIdsFromCommentBody = _core.getMentionedIdsFromCommentBody; exports.isCustomNotificationEvent = isCustomNotificationEvent; exports.isNotificationChannelEnabled = _core.isNotificationChannelEnabled; exports.isTextMentionNotificationEvent = isTextMentionNotificationEvent; exports.isThreadNotificationEvent = isThreadNotificationEvent; exports.stringifyCommentBody = _core.stringifyCommentBody; | ||
import { | ||
getMentionedIdsFromCommentBody, | ||
isNotificationChannelEnabled, | ||
stringifyCommentBody | ||
} from "@liveblocks/core"; | ||
detectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT); | ||
export { | ||
Liveblocks, | ||
LiveblocksError, | ||
WebhookHandler, | ||
getMentionedIdsFromCommentBody, | ||
isCustomNotificationEvent, | ||
isNotificationChannelEnabled, | ||
isTextMentionNotificationEvent, | ||
isThreadNotificationEvent, | ||
stringifyCommentBody | ||
}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@liveblocks/node", | ||
"version": "2.18.3", | ||
"version": "2.18.4-uns1", | ||
"description": "A server-side utility that lets you set up a Liveblocks authentication endpoint. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.", | ||
"license": "Apache-2.0", | ||
"type": "commonjs", | ||
"main": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"type": "module", | ||
"main": "./dist/index.cjs", | ||
"types": "./dist/index.d.cts", | ||
"exports": { | ||
".": { | ||
"import": { | ||
"types": "./dist/index.d.mts", | ||
"default": "./dist/index.mjs" | ||
"types": "./dist/index.d.ts", | ||
"default": "./dist/index.js" | ||
}, | ||
"require": { | ||
"types": "./dist/index.d.ts", | ||
"module": "./dist/index.mjs", | ||
"default": "./dist/index.js" | ||
"types": "./dist/index.d.cts", | ||
"module": "./dist/index.js", | ||
"default": "./dist/index.cjs" | ||
} | ||
@@ -37,3 +37,3 @@ } | ||
"dependencies": { | ||
"@liveblocks/core": "2.18.3", | ||
"@liveblocks/core": "2.18.4-uns1", | ||
"@stablelib/base64": "^1.0.1", | ||
@@ -40,0 +40,0 @@ "fast-sha256": "^1.3.0", |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
409795
3958
Yes
1
+ Added@liveblocks/core@2.18.4-uns1(transitive)
- Removed@liveblocks/core@2.18.3(transitive)
Updated@liveblocks/core@2.18.4-uns1