@liveblocks/node 3.1.4 → 3.2.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.d.cts CHANGED
@@ -87,6 +87,7 @@ type AuthResponse = {
87
87
  type Identity = {
88
88
  userId: string;
89
89
  groupIds: string[];
90
+ tenantId?: string;
90
91
  };
91
92
  type ThreadParticipants = {
92
93
  participantIds: string[];
package/dist/index.d.ts CHANGED
@@ -87,6 +87,7 @@ type AuthResponse = {
87
87
  type Identity = {
88
88
  userId: string;
89
89
  groupIds: string[];
90
+ tenantId?: string;
90
91
  };
91
92
  type ThreadParticipants = {
92
93
  participantIds: string[];
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { detectDupes } from "@liveblocks/core";
3
3
 
4
4
  // src/version.ts
5
5
  var PKG_NAME = "@liveblocks/node";
6
- var PKG_VERSION = "3.1.4";
6
+ var PKG_VERSION = "3.2.1";
7
7
  var PKG_FORMAT = "esm";
8
8
 
9
9
  // src/client.ts
@@ -423,16 +423,16 @@ var Liveblocks = class {
423
423
  async identifyUser(identity, ...rest) {
424
424
  const options = rest[0];
425
425
  const path = url2`/v2/identify-user`;
426
- const userId = typeof identity === "string" ? identity : identity.userId;
427
- const groupIds = typeof identity === "string" ? void 0 : identity.groupIds;
426
+ const { userId, groupIds, tenantId } = typeof identity === "string" ? { userId: identity, groupIds: void 0, tenantId: void 0 } : identity;
428
427
  assertNonEmpty(userId, "userId");
428
+ const body = {
429
+ userId,
430
+ groupIds,
431
+ tenantId,
432
+ userInfo: options?.userInfo
433
+ };
429
434
  try {
430
- const resp = await this.#post(path, {
431
- userId,
432
- groupIds,
433
- // Optional metadata
434
- userInfo: options?.userInfo
435
- });
435
+ const resp = await this.#post(path, body);
436
436
  return {
437
437
  status: normalizeStatusCode(resp.status),
438
438
  body: await resp.text()