@liveblocks/node
Advanced tools
Comparing version 2.5.1 to 2.5.2
@@ -663,2 +663,35 @@ import { BaseUserMeta, DU, OptionalTupleUnless, PlainLsonObject, JsonObject, QueryMetadata, ThreadData, CommentData, CommentBody, Patchable, CommentUserReaction, InboxNotificationData, RoomNotificationSettings, KDAD, DAD, LsonObject, ToImmutable, PartialUnless, BaseMetadata, DE, DM, DS } from '@liveblocks/core'; | ||
/** | ||
* Returns the inbox notifications for a user. | ||
* @param params.userId The user ID to get the inbox notifications from. | ||
* @param params.query The query to filter inbox notifications by. It is based on our query language and can filter by unread. | ||
*/ | ||
getInboxNotifications(params: { | ||
userId: string; | ||
/** | ||
* The query to filter inbox notifications by. It is based on our query language. | ||
* | ||
* @example | ||
* ``` | ||
* { | ||
* query: "unread:true" | ||
* } | ||
* ``` | ||
* | ||
* @example | ||
* ``` | ||
* { | ||
* query: { | ||
* unread: true | ||
* } | ||
* } | ||
* ``` | ||
* | ||
*/ | ||
query?: string | { | ||
unread: boolean; | ||
}; | ||
}): Promise<{ | ||
data: InboxNotificationData[]; | ||
}>; | ||
/** | ||
* Gets the user's room notification settings. | ||
@@ -665,0 +698,0 @@ * @param params.userId The user ID to get the room notifications from. |
@@ -6,3 +6,3 @@ "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; }// src/index.ts | ||
var PKG_NAME = "@liveblocks/node"; | ||
var PKG_VERSION = "2.5.1"; | ||
var PKG_VERSION = "2.5.2"; | ||
var PKG_FORMAT = "cjs"; | ||
@@ -1077,2 +1077,27 @@ | ||
/** | ||
* Returns the inbox notifications for a user. | ||
* @param params.userId The user ID to get the inbox notifications from. | ||
* @param params.query The query to filter inbox notifications by. It is based on our query language and can filter by unread. | ||
*/ | ||
async getInboxNotifications(params) { | ||
const { userId } = params; | ||
let query; | ||
if (typeof params.query === "string") { | ||
query = params.query; | ||
} else if (typeof params.query === "object") { | ||
query = _core.objectToQuery.call(void 0, params.query); | ||
} | ||
const res = await this.get(url`/v2/users/${userId}/inbox-notifications`, { | ||
query | ||
}); | ||
if (!res.ok) { | ||
const text = await res.text(); | ||
throw new LiveblocksError(res.status, text); | ||
} | ||
const { data } = await res.json(); | ||
return { | ||
data: data.map(_core.convertToInboxNotificationData) | ||
}; | ||
} | ||
/** | ||
* Gets the user's room notification settings. | ||
@@ -1079,0 +1104,0 @@ * @param params.userId The user ID to get the room notifications from. |
{ | ||
"name": "@liveblocks/node", | ||
"version": "2.5.1", | ||
"version": "2.5.2", | ||
"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.", | ||
@@ -37,3 +37,3 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@liveblocks/core": "2.5.1", | ||
"@liveblocks/core": "2.5.2", | ||
"@stablelib/base64": "^1.0.1", | ||
@@ -40,0 +40,0 @@ "fast-sha256": "^1.3.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
403307
3798
+ Added@liveblocks/core@2.5.2(transitive)
- Removed@liveblocks/core@2.5.1(transitive)
Updated@liveblocks/core@2.5.2