@liveblocks/node 3.15.0-feeds2 → 3.15.0-rc1

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
@@ -1,8 +1,8 @@
1
- import { BaseUserMeta, DU, LiveObject, Awaitable, DS, Json, JsonObject, OptionalTupleUnless, PlainLsonObject, QueryMetadata, ThreadData, UserSubscriptionData, CommentData, CommentBody, Patchable, SubscriptionData, CommentUserReaction, InboxNotificationData, UserRoomSubscriptionSettings, RoomSubscriptionSettings, KDAD, DAD, NotificationSettings, PartialNotificationSettings, GroupScopes, GroupData, Feed, FeedMessage, LsonObject, ToImmutable, PartialUnless, BaseMetadata, DE, DTM, DCM, NotificationChannel } from '@liveblocks/core';
1
+ import { BaseUserMeta, DU, LiveObject, Awaitable, DS, JsonObject, Json, OptionalTupleUnless, PlainLsonObject, QueryMetadata, ThreadData, UserSubscriptionData, CommentData, CommentBody, Patchable, SubscriptionData, CommentUserReaction, InboxNotificationData, UserRoomSubscriptionSettings, RoomSubscriptionSettings, KDAD, DAD, NotificationSettings, PartialNotificationSettings, GroupScopes, GroupData, LsonObject, ToImmutable, PartialUnless, BaseMetadata, DE, DTM, DCM, NotificationChannel } from '@liveblocks/core';
2
2
  export { CommentBody, CommentBodyBlockElement, CommentBodyElement, CommentBodyInlineElement, CommentBodyLink, CommentBodyLinkElementArgs, CommentBodyMention, CommentBodyMentionElementArgs, CommentBodyParagraph, CommentBodyParagraphElementArgs, CommentBodyText, CommentBodyTextElementArgs, CommentData, CommentUserReaction, IUserInfo, Json, JsonArray, JsonObject, JsonScalar, LiveList, LiveMap, LiveObject, LiveStructure, Lson, LsonObject, PlainLsonObject, ResolveUsersArgs, StringifyCommentBodyElements, StringifyCommentBodyOptions, ThreadData, User, getMentionsFromCommentBody, isNotificationChannelEnabled, stringifyCommentBody } from '@liveblocks/core';
3
3
  import { IncomingHttpHeaders } from 'http';
4
4
 
5
- declare const ALL_PERMISSIONS: readonly ["room:write", "room:read", "room:presence:write", "comments:write", "comments:read", "feeds:write", "feeds:read"];
5
+ declare const ALL_PERMISSIONS: readonly ["room:write", "room:read", "room:presence:write", "comments:write", "comments:read"];
6
6
  type Permission = (typeof ALL_PERMISSIONS)[number];
7
7
  /**
8
8
  * Class to help you construct the exact permission set to grant a user, used
@@ -41,8 +41,8 @@ type Permission = (typeof ALL_PERMISSIONS)[number];
41
41
  */
42
42
  declare class Session {
43
43
  #private;
44
- readonly FULL_ACCESS: readonly ["room:write", "comments:write", "feeds:write"];
45
- readonly READ_ACCESS: readonly ["room:read", "room:presence:write", "comments:read", "feeds:read"];
44
+ readonly FULL_ACCESS: readonly ["room:write", "comments:write"];
45
+ readonly READ_ACCESS: readonly ["room:read", "room:presence:write", "comments:read"];
46
46
  allow(roomIdOrPattern: string, newPerms: readonly Permission[]): this;
47
47
  /**
48
48
  * Call this to authorize the session to access Liveblocks. Note that this
@@ -444,22 +444,6 @@ type GetWebKnowledgeSourceLinksOptions = {
444
444
  copilotId: string;
445
445
  knowledgeSourceId: string;
446
446
  } & PaginationOptions;
447
- type CreateFeedOptions<FM extends Json = Json> = {
448
- feedId: string;
449
- metadata?: FM;
450
- timestamp?: number;
451
- };
452
- type UpdateFeedOptions<FM extends Json = Json> = {
453
- metadata: FM;
454
- };
455
- type CreateFeedMessageOptions<FMD extends Json = Json> = {
456
- id?: string;
457
- timestamp?: number;
458
- data: FMD;
459
- };
460
- type UpdateFeedMessageOptions<FMD extends Json = Json> = {
461
- data: FMD;
462
- };
463
447
  type KnowledgeSource = ({
464
448
  type: "ai-knowledge-web-source";
465
449
  link: {
@@ -1454,113 +1438,6 @@ declare class Liveblocks {
1454
1438
  * @returns A paginated list of web knowledge source links.
1455
1439
  */
1456
1440
  getWebKnowledgeSourceLinks(params: GetWebKnowledgeSourceLinksOptions, options?: RequestOptions): Promise<Page<WebKnowledgeSourceLink>>;
1457
- /**
1458
- * Returns a list of feeds in a room.
1459
- * @param params.roomId The room ID to get the feeds from.
1460
- * @param options.signal (optional) An abort signal to cancel the request.
1461
- * @returns A list of feeds.
1462
- */
1463
- getFeeds<FM extends Json = Json>(params: {
1464
- roomId: string;
1465
- }, options?: RequestOptions): Promise<{
1466
- data: Feed<FM>[];
1467
- }>;
1468
- /**
1469
- * Creates a new feed in a room.
1470
- * @param params.roomId The room ID to create the feed in.
1471
- * @param params.feedId The feed ID.
1472
- * @param params.metadata (optional) The metadata for the feed.
1473
- * @param params.timestamp (optional) The timestamp for the feed. If not provided, the current time will be used.
1474
- * @param options.signal (optional) An abort signal to cancel the request.
1475
- * @returns The created feed.
1476
- */
1477
- createFeed<FM extends Json = Json>(params: {
1478
- roomId: string;
1479
- } & CreateFeedOptions<FM>, options?: RequestOptions): Promise<Feed<FM>>;
1480
- /**
1481
- * Returns a feed with the given id.
1482
- * @param params.roomId The room ID to get the feed from.
1483
- * @param params.feedId The feed ID.
1484
- * @param options.signal (optional) An abort signal to cancel the request.
1485
- * @returns The feed.
1486
- */
1487
- getFeed<FM extends Json = Json>(params: {
1488
- roomId: string;
1489
- feedId: string;
1490
- }, options?: RequestOptions): Promise<Feed<FM>>;
1491
- /**
1492
- * Updates the metadata of a feed.
1493
- * @param params.roomId The room ID to update the feed in.
1494
- * @param params.feedId The feed ID to update.
1495
- * @param params.metadata The metadata for the feed.
1496
- * @param options.signal (optional) An abort signal to cancel the request.
1497
- */
1498
- updateFeed<FM extends Json = Json>(params: {
1499
- roomId: string;
1500
- feedId: string;
1501
- } & UpdateFeedOptions<FM>, options?: RequestOptions): Promise<void>;
1502
- /**
1503
- * Deletes a feed.
1504
- * @param params.roomId The room ID to delete the feed from.
1505
- * @param params.feedId The feed ID to delete.
1506
- * @param options.signal (optional) An abort signal to cancel the request.
1507
- */
1508
- deleteFeed(params: {
1509
- roomId: string;
1510
- feedId: string;
1511
- }, options?: RequestOptions): Promise<void>;
1512
- /**
1513
- * Returns a list of messages in a feed.
1514
- * @param params.roomId The room ID to get the feed messages from.
1515
- * @param params.feedId The feed ID to get the messages from.
1516
- * @param options.signal (optional) An abort signal to cancel the request.
1517
- * @returns A list of feed messages.
1518
- */
1519
- getFeedMessages<FMD extends Json = Json>(params: {
1520
- roomId: string;
1521
- feedId: string;
1522
- }, options?: RequestOptions): Promise<{
1523
- data: FeedMessage<FMD>[];
1524
- }>;
1525
- /**
1526
- * Creates a new message in a feed.
1527
- * @param params.roomId The room ID to create the feed message in.
1528
- * @param params.feedId The feed ID to create the message in.
1529
- * @param params.id (optional) The message ID. If not provided, one will be generated.
1530
- * @param params.timestamp (optional) The message timestamp. If not provided, the current time will be used.
1531
- * @param params.data The message data.
1532
- * @param options.signal (optional) An abort signal to cancel the request.
1533
- * @returns The created feed message.
1534
- */
1535
- createFeedMessage<FMD extends Json = Json>(params: {
1536
- roomId: string;
1537
- feedId: string;
1538
- } & CreateFeedMessageOptions<FMD>, options?: RequestOptions): Promise<FeedMessage<FMD>>;
1539
- /**
1540
- * Updates a feed message.
1541
- * @param params.roomId The room ID to update the feed message in.
1542
- * @param params.feedId The feed ID to update the message in.
1543
- * @param params.messageId The message ID to update.
1544
- * @param params.data The message data.
1545
- * @param options.signal (optional) An abort signal to cancel the request.
1546
- */
1547
- updateFeedMessage<FMD extends Json = Json>(params: {
1548
- roomId: string;
1549
- feedId: string;
1550
- messageId: string;
1551
- } & UpdateFeedMessageOptions<FMD>, options?: RequestOptions): Promise<void>;
1552
- /**
1553
- * Deletes a feed message.
1554
- * @param params.roomId The room ID to delete the feed message from.
1555
- * @param params.feedId The feed ID to delete the message from.
1556
- * @param params.messageId The message ID to delete.
1557
- * @param options.signal (optional) An abort signal to cancel the request.
1558
- */
1559
- deleteFeedMessage(params: {
1560
- roomId: string;
1561
- feedId: string;
1562
- messageId: string;
1563
- }, options?: RequestOptions): Promise<void>;
1564
1441
  }
1565
1442
  declare class LiveblocksError extends Error {
1566
1443
  readonly status: number;
@@ -1971,4 +1848,4 @@ declare function isTextMentionNotificationEvent(event: WebhookEvent): event is T
1971
1848
  */
1972
1849
  declare function isCustomNotificationEvent(event: WebhookEvent): event is CustomNotificationEvent;
1973
1850
 
1974
- export { type AiCopilot, type CommentCreatedEvent, type CommentDeletedEvent, type CommentEditedEvent, type CommentReactionAdded, type CommentReactionRemoved, type CreateAiCopilotOptions, type CreateFeedMessageOptions, type CreateFeedOptions, type CreateFileKnowledgeSourceOptions, type CreateRoomOptions, type CreateWebKnowledgeSourceOptions, type CustomNotificationEvent, type GetAiCopilotsOptions, type GetInboxNotificationsOptions, type GetKnowledgeSourcesOptions, type GetRoomsOptions, type GetWebKnowledgeSourceLinksOptions, type InboxNotificationsQueryCriteria, type KnowledgeSource, Liveblocks, LiveblocksError, type LiveblocksOptions, type MassMutateStorageCallback, type MassMutateStorageOptions, type MutateStorageCallback, type MutateStorageOptions, type NotificationEvent, type Page, type PaginationOptions, type RoomAccesses, type RoomCreatedEvent, type RoomData, type RoomDeletedEvent, type RoomPermission, type RoomUser, type RoomsQueryCriteria, type SetPresenceOptions, type StorageUpdatedEvent, type TextMentionNotificationEvent, type ThreadCreatedEvent, type ThreadDeletedEvent, type ThreadMarkedAsResolvedEvent, type ThreadMarkedAsUnresolvedEvent, type ThreadMetadataUpdatedEvent, type ThreadNotificationEvent, type ThreadParticipants, type UpdateAiCopilotOptions, type UpdateFeedMessageOptions, type UpdateFeedOptions, type UpdateRoomOptions, type UpsertRoomOptions, type UserEnteredEvent, type UserLeftEvent, type WebKnowledgeSourceLink, type WebhookEvent, WebhookHandler, type WebhookRequest, type YDocUpdatedEvent, isCustomNotificationEvent, isTextMentionNotificationEvent, isThreadNotificationEvent };
1851
+ export { type AiCopilot, type CommentCreatedEvent, type CommentDeletedEvent, type CommentEditedEvent, type CommentReactionAdded, type CommentReactionRemoved, type CreateAiCopilotOptions, type CreateFileKnowledgeSourceOptions, type CreateRoomOptions, type CreateWebKnowledgeSourceOptions, type CustomNotificationEvent, type GetAiCopilotsOptions, type GetInboxNotificationsOptions, type GetKnowledgeSourcesOptions, type GetRoomsOptions, type GetWebKnowledgeSourceLinksOptions, type InboxNotificationsQueryCriteria, type KnowledgeSource, Liveblocks, LiveblocksError, type LiveblocksOptions, type MassMutateStorageCallback, type MassMutateStorageOptions, type MutateStorageCallback, type MutateStorageOptions, type NotificationEvent, type Page, type PaginationOptions, type RoomAccesses, type RoomCreatedEvent, type RoomData, type RoomDeletedEvent, type RoomPermission, type RoomUser, type RoomsQueryCriteria, type SetPresenceOptions, type StorageUpdatedEvent, type TextMentionNotificationEvent, type ThreadCreatedEvent, type ThreadDeletedEvent, type ThreadMarkedAsResolvedEvent, type ThreadMarkedAsUnresolvedEvent, type ThreadMetadataUpdatedEvent, type ThreadNotificationEvent, type ThreadParticipants, type UpdateAiCopilotOptions, type UpdateRoomOptions, type UpsertRoomOptions, type UserEnteredEvent, type UserLeftEvent, type WebKnowledgeSourceLink, type WebhookEvent, WebhookHandler, type WebhookRequest, type YDocUpdatedEvent, isCustomNotificationEvent, isTextMentionNotificationEvent, isThreadNotificationEvent };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { BaseUserMeta, DU, LiveObject, Awaitable, DS, Json, JsonObject, OptionalTupleUnless, PlainLsonObject, QueryMetadata, ThreadData, UserSubscriptionData, CommentData, CommentBody, Patchable, SubscriptionData, CommentUserReaction, InboxNotificationData, UserRoomSubscriptionSettings, RoomSubscriptionSettings, KDAD, DAD, NotificationSettings, PartialNotificationSettings, GroupScopes, GroupData, Feed, FeedMessage, LsonObject, ToImmutable, PartialUnless, BaseMetadata, DE, DTM, DCM, NotificationChannel } from '@liveblocks/core';
1
+ import { BaseUserMeta, DU, LiveObject, Awaitable, DS, JsonObject, Json, OptionalTupleUnless, PlainLsonObject, QueryMetadata, ThreadData, UserSubscriptionData, CommentData, CommentBody, Patchable, SubscriptionData, CommentUserReaction, InboxNotificationData, UserRoomSubscriptionSettings, RoomSubscriptionSettings, KDAD, DAD, NotificationSettings, PartialNotificationSettings, GroupScopes, GroupData, LsonObject, ToImmutable, PartialUnless, BaseMetadata, DE, DTM, DCM, NotificationChannel } from '@liveblocks/core';
2
2
  export { CommentBody, CommentBodyBlockElement, CommentBodyElement, CommentBodyInlineElement, CommentBodyLink, CommentBodyLinkElementArgs, CommentBodyMention, CommentBodyMentionElementArgs, CommentBodyParagraph, CommentBodyParagraphElementArgs, CommentBodyText, CommentBodyTextElementArgs, CommentData, CommentUserReaction, IUserInfo, Json, JsonArray, JsonObject, JsonScalar, LiveList, LiveMap, LiveObject, LiveStructure, Lson, LsonObject, PlainLsonObject, ResolveUsersArgs, StringifyCommentBodyElements, StringifyCommentBodyOptions, ThreadData, User, getMentionsFromCommentBody, isNotificationChannelEnabled, stringifyCommentBody } from '@liveblocks/core';
3
3
  import { IncomingHttpHeaders } from 'http';
4
4
 
5
- declare const ALL_PERMISSIONS: readonly ["room:write", "room:read", "room:presence:write", "comments:write", "comments:read", "feeds:write", "feeds:read"];
5
+ declare const ALL_PERMISSIONS: readonly ["room:write", "room:read", "room:presence:write", "comments:write", "comments:read"];
6
6
  type Permission = (typeof ALL_PERMISSIONS)[number];
7
7
  /**
8
8
  * Class to help you construct the exact permission set to grant a user, used
@@ -41,8 +41,8 @@ type Permission = (typeof ALL_PERMISSIONS)[number];
41
41
  */
42
42
  declare class Session {
43
43
  #private;
44
- readonly FULL_ACCESS: readonly ["room:write", "comments:write", "feeds:write"];
45
- readonly READ_ACCESS: readonly ["room:read", "room:presence:write", "comments:read", "feeds:read"];
44
+ readonly FULL_ACCESS: readonly ["room:write", "comments:write"];
45
+ readonly READ_ACCESS: readonly ["room:read", "room:presence:write", "comments:read"];
46
46
  allow(roomIdOrPattern: string, newPerms: readonly Permission[]): this;
47
47
  /**
48
48
  * Call this to authorize the session to access Liveblocks. Note that this
@@ -444,22 +444,6 @@ type GetWebKnowledgeSourceLinksOptions = {
444
444
  copilotId: string;
445
445
  knowledgeSourceId: string;
446
446
  } & PaginationOptions;
447
- type CreateFeedOptions<FM extends Json = Json> = {
448
- feedId: string;
449
- metadata?: FM;
450
- timestamp?: number;
451
- };
452
- type UpdateFeedOptions<FM extends Json = Json> = {
453
- metadata: FM;
454
- };
455
- type CreateFeedMessageOptions<FMD extends Json = Json> = {
456
- id?: string;
457
- timestamp?: number;
458
- data: FMD;
459
- };
460
- type UpdateFeedMessageOptions<FMD extends Json = Json> = {
461
- data: FMD;
462
- };
463
447
  type KnowledgeSource = ({
464
448
  type: "ai-knowledge-web-source";
465
449
  link: {
@@ -1454,113 +1438,6 @@ declare class Liveblocks {
1454
1438
  * @returns A paginated list of web knowledge source links.
1455
1439
  */
1456
1440
  getWebKnowledgeSourceLinks(params: GetWebKnowledgeSourceLinksOptions, options?: RequestOptions): Promise<Page<WebKnowledgeSourceLink>>;
1457
- /**
1458
- * Returns a list of feeds in a room.
1459
- * @param params.roomId The room ID to get the feeds from.
1460
- * @param options.signal (optional) An abort signal to cancel the request.
1461
- * @returns A list of feeds.
1462
- */
1463
- getFeeds<FM extends Json = Json>(params: {
1464
- roomId: string;
1465
- }, options?: RequestOptions): Promise<{
1466
- data: Feed<FM>[];
1467
- }>;
1468
- /**
1469
- * Creates a new feed in a room.
1470
- * @param params.roomId The room ID to create the feed in.
1471
- * @param params.feedId The feed ID.
1472
- * @param params.metadata (optional) The metadata for the feed.
1473
- * @param params.timestamp (optional) The timestamp for the feed. If not provided, the current time will be used.
1474
- * @param options.signal (optional) An abort signal to cancel the request.
1475
- * @returns The created feed.
1476
- */
1477
- createFeed<FM extends Json = Json>(params: {
1478
- roomId: string;
1479
- } & CreateFeedOptions<FM>, options?: RequestOptions): Promise<Feed<FM>>;
1480
- /**
1481
- * Returns a feed with the given id.
1482
- * @param params.roomId The room ID to get the feed from.
1483
- * @param params.feedId The feed ID.
1484
- * @param options.signal (optional) An abort signal to cancel the request.
1485
- * @returns The feed.
1486
- */
1487
- getFeed<FM extends Json = Json>(params: {
1488
- roomId: string;
1489
- feedId: string;
1490
- }, options?: RequestOptions): Promise<Feed<FM>>;
1491
- /**
1492
- * Updates the metadata of a feed.
1493
- * @param params.roomId The room ID to update the feed in.
1494
- * @param params.feedId The feed ID to update.
1495
- * @param params.metadata The metadata for the feed.
1496
- * @param options.signal (optional) An abort signal to cancel the request.
1497
- */
1498
- updateFeed<FM extends Json = Json>(params: {
1499
- roomId: string;
1500
- feedId: string;
1501
- } & UpdateFeedOptions<FM>, options?: RequestOptions): Promise<void>;
1502
- /**
1503
- * Deletes a feed.
1504
- * @param params.roomId The room ID to delete the feed from.
1505
- * @param params.feedId The feed ID to delete.
1506
- * @param options.signal (optional) An abort signal to cancel the request.
1507
- */
1508
- deleteFeed(params: {
1509
- roomId: string;
1510
- feedId: string;
1511
- }, options?: RequestOptions): Promise<void>;
1512
- /**
1513
- * Returns a list of messages in a feed.
1514
- * @param params.roomId The room ID to get the feed messages from.
1515
- * @param params.feedId The feed ID to get the messages from.
1516
- * @param options.signal (optional) An abort signal to cancel the request.
1517
- * @returns A list of feed messages.
1518
- */
1519
- getFeedMessages<FMD extends Json = Json>(params: {
1520
- roomId: string;
1521
- feedId: string;
1522
- }, options?: RequestOptions): Promise<{
1523
- data: FeedMessage<FMD>[];
1524
- }>;
1525
- /**
1526
- * Creates a new message in a feed.
1527
- * @param params.roomId The room ID to create the feed message in.
1528
- * @param params.feedId The feed ID to create the message in.
1529
- * @param params.id (optional) The message ID. If not provided, one will be generated.
1530
- * @param params.timestamp (optional) The message timestamp. If not provided, the current time will be used.
1531
- * @param params.data The message data.
1532
- * @param options.signal (optional) An abort signal to cancel the request.
1533
- * @returns The created feed message.
1534
- */
1535
- createFeedMessage<FMD extends Json = Json>(params: {
1536
- roomId: string;
1537
- feedId: string;
1538
- } & CreateFeedMessageOptions<FMD>, options?: RequestOptions): Promise<FeedMessage<FMD>>;
1539
- /**
1540
- * Updates a feed message.
1541
- * @param params.roomId The room ID to update the feed message in.
1542
- * @param params.feedId The feed ID to update the message in.
1543
- * @param params.messageId The message ID to update.
1544
- * @param params.data The message data.
1545
- * @param options.signal (optional) An abort signal to cancel the request.
1546
- */
1547
- updateFeedMessage<FMD extends Json = Json>(params: {
1548
- roomId: string;
1549
- feedId: string;
1550
- messageId: string;
1551
- } & UpdateFeedMessageOptions<FMD>, options?: RequestOptions): Promise<void>;
1552
- /**
1553
- * Deletes a feed message.
1554
- * @param params.roomId The room ID to delete the feed message from.
1555
- * @param params.feedId The feed ID to delete the message from.
1556
- * @param params.messageId The message ID to delete.
1557
- * @param options.signal (optional) An abort signal to cancel the request.
1558
- */
1559
- deleteFeedMessage(params: {
1560
- roomId: string;
1561
- feedId: string;
1562
- messageId: string;
1563
- }, options?: RequestOptions): Promise<void>;
1564
1441
  }
1565
1442
  declare class LiveblocksError extends Error {
1566
1443
  readonly status: number;
@@ -1971,4 +1848,4 @@ declare function isTextMentionNotificationEvent(event: WebhookEvent): event is T
1971
1848
  */
1972
1849
  declare function isCustomNotificationEvent(event: WebhookEvent): event is CustomNotificationEvent;
1973
1850
 
1974
- export { type AiCopilot, type CommentCreatedEvent, type CommentDeletedEvent, type CommentEditedEvent, type CommentReactionAdded, type CommentReactionRemoved, type CreateAiCopilotOptions, type CreateFeedMessageOptions, type CreateFeedOptions, type CreateFileKnowledgeSourceOptions, type CreateRoomOptions, type CreateWebKnowledgeSourceOptions, type CustomNotificationEvent, type GetAiCopilotsOptions, type GetInboxNotificationsOptions, type GetKnowledgeSourcesOptions, type GetRoomsOptions, type GetWebKnowledgeSourceLinksOptions, type InboxNotificationsQueryCriteria, type KnowledgeSource, Liveblocks, LiveblocksError, type LiveblocksOptions, type MassMutateStorageCallback, type MassMutateStorageOptions, type MutateStorageCallback, type MutateStorageOptions, type NotificationEvent, type Page, type PaginationOptions, type RoomAccesses, type RoomCreatedEvent, type RoomData, type RoomDeletedEvent, type RoomPermission, type RoomUser, type RoomsQueryCriteria, type SetPresenceOptions, type StorageUpdatedEvent, type TextMentionNotificationEvent, type ThreadCreatedEvent, type ThreadDeletedEvent, type ThreadMarkedAsResolvedEvent, type ThreadMarkedAsUnresolvedEvent, type ThreadMetadataUpdatedEvent, type ThreadNotificationEvent, type ThreadParticipants, type UpdateAiCopilotOptions, type UpdateFeedMessageOptions, type UpdateFeedOptions, type UpdateRoomOptions, type UpsertRoomOptions, type UserEnteredEvent, type UserLeftEvent, type WebKnowledgeSourceLink, type WebhookEvent, WebhookHandler, type WebhookRequest, type YDocUpdatedEvent, isCustomNotificationEvent, isTextMentionNotificationEvent, isThreadNotificationEvent };
1851
+ export { type AiCopilot, type CommentCreatedEvent, type CommentDeletedEvent, type CommentEditedEvent, type CommentReactionAdded, type CommentReactionRemoved, type CreateAiCopilotOptions, type CreateFileKnowledgeSourceOptions, type CreateRoomOptions, type CreateWebKnowledgeSourceOptions, type CustomNotificationEvent, type GetAiCopilotsOptions, type GetInboxNotificationsOptions, type GetKnowledgeSourcesOptions, type GetRoomsOptions, type GetWebKnowledgeSourceLinksOptions, type InboxNotificationsQueryCriteria, type KnowledgeSource, Liveblocks, LiveblocksError, type LiveblocksOptions, type MassMutateStorageCallback, type MassMutateStorageOptions, type MutateStorageCallback, type MutateStorageOptions, type NotificationEvent, type Page, type PaginationOptions, type RoomAccesses, type RoomCreatedEvent, type RoomData, type RoomDeletedEvent, type RoomPermission, type RoomUser, type RoomsQueryCriteria, type SetPresenceOptions, type StorageUpdatedEvent, type TextMentionNotificationEvent, type ThreadCreatedEvent, type ThreadDeletedEvent, type ThreadMarkedAsResolvedEvent, type ThreadMarkedAsUnresolvedEvent, type ThreadMetadataUpdatedEvent, type ThreadNotificationEvent, type ThreadParticipants, type UpdateAiCopilotOptions, type UpdateRoomOptions, type UpsertRoomOptions, type UserEnteredEvent, type UserLeftEvent, type WebKnowledgeSourceLink, type WebhookEvent, WebhookHandler, type WebhookRequest, type YDocUpdatedEvent, isCustomNotificationEvent, isTextMentionNotificationEvent, isThreadNotificationEvent };
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.15.0-feeds2";
6
+ var PKG_VERSION = "3.15.0-rc1";
7
7
  var PKG_FORMAT = "esm";
8
8
 
9
9
  // src/client.ts
@@ -165,9 +165,7 @@ var ALL_PERMISSIONS = Object.freeze([
165
165
  "room:read",
166
166
  "room:presence:write",
167
167
  "comments:write",
168
- "comments:read",
169
- "feeds:write",
170
- "feeds:read"
168
+ "comments:read"
171
169
  ]);
172
170
  function isPermission(value) {
173
171
  return ALL_PERMISSIONS.includes(value);
@@ -176,14 +174,9 @@ var MAX_PERMS_PER_SET = 10;
176
174
  var READ_ACCESS = Object.freeze([
177
175
  "room:read",
178
176
  "room:presence:write",
179
- "comments:read",
180
- "feeds:read"
181
- ]);
182
- var FULL_ACCESS = Object.freeze([
183
- "room:write",
184
- "comments:write",
185
- "feeds:write"
177
+ "comments:read"
186
178
  ]);
179
+ var FULL_ACCESS = Object.freeze(["room:write", "comments:write"]);
187
180
  var roomPatternRegex = /^([*]|[^*]{1,128}[*]?)$/;
188
181
  var Session = class {
189
182
  FULL_ACCESS = FULL_ACCESS;
@@ -367,22 +360,6 @@ var Liveblocks = class {
367
360
  xwarn(res, "POST", path);
368
361
  return res;
369
362
  }
370
- async #patch(path, json, options) {
371
- const url3 = urljoin(this.#baseUrl, path);
372
- const headers = {
373
- Authorization: `Bearer ${this.#secret}`,
374
- "Content-Type": "application/json"
375
- };
376
- const fetch = await fetchPolyfill();
377
- const res = await fetch(url3, {
378
- method: "PATCH",
379
- headers,
380
- body: JSON.stringify(json),
381
- signal: options?.signal
382
- });
383
- xwarn(res, "PATCH", path);
384
- return res;
385
- }
386
363
  async #putBinary(path, body, params, options) {
387
364
  const url3 = urljoin(this.#baseUrl, path, params);
388
365
  const headers = {
@@ -2213,180 +2190,6 @@ var Liveblocks = class {
2213
2190
  data: page.data.map(inflateWebKnowledgeSourceLink)
2214
2191
  };
2215
2192
  }
2216
- /* -------------------------------------------------------------------------------------------------
2217
- * Feeds
2218
- * -----------------------------------------------------------------------------------------------*/
2219
- /**
2220
- * Returns a list of feeds in a room.
2221
- * @param params.roomId The room ID to get the feeds from.
2222
- * @param options.signal (optional) An abort signal to cancel the request.
2223
- * @returns A list of feeds.
2224
- */
2225
- async getFeeds(params, options) {
2226
- const { roomId } = params;
2227
- const res = await this.#get(
2228
- url2`/v2/rooms/${roomId}/feeds`,
2229
- void 0,
2230
- options
2231
- );
2232
- if (!res.ok) {
2233
- throw await LiveblocksError.from(res);
2234
- }
2235
- return await res.json();
2236
- }
2237
- /**
2238
- * Creates a new feed in a room.
2239
- * @param params.roomId The room ID to create the feed in.
2240
- * @param params.feedId The feed ID.
2241
- * @param params.metadata (optional) The metadata for the feed.
2242
- * @param params.timestamp (optional) The timestamp for the feed. If not provided, the current time will be used.
2243
- * @param options.signal (optional) An abort signal to cancel the request.
2244
- * @returns The created feed.
2245
- */
2246
- async createFeed(params, options) {
2247
- const { roomId, feedId, metadata, timestamp } = params;
2248
- const res = await this.#post(
2249
- url2`/v2/rooms/${roomId}/feed`,
2250
- { feedId, metadata, timestamp },
2251
- options
2252
- );
2253
- if (!res.ok) {
2254
- throw await LiveblocksError.from(res);
2255
- }
2256
- return (await res.json()).data;
2257
- }
2258
- /**
2259
- * Returns a feed with the given id.
2260
- * @param params.roomId The room ID to get the feed from.
2261
- * @param params.feedId The feed ID.
2262
- * @param options.signal (optional) An abort signal to cancel the request.
2263
- * @returns The feed.
2264
- */
2265
- async getFeed(params, options) {
2266
- const { roomId, feedId } = params;
2267
- const res = await this.#get(
2268
- url2`/v2/rooms/${roomId}/feeds/${feedId}`,
2269
- void 0,
2270
- options
2271
- );
2272
- if (!res.ok) {
2273
- throw await LiveblocksError.from(res);
2274
- }
2275
- return (await res.json()).data;
2276
- }
2277
- /**
2278
- * Updates the metadata of a feed.
2279
- * @param params.roomId The room ID to update the feed in.
2280
- * @param params.feedId The feed ID to update.
2281
- * @param params.metadata The metadata for the feed.
2282
- * @param options.signal (optional) An abort signal to cancel the request.
2283
- */
2284
- async updateFeed(params, options) {
2285
- const { roomId, feedId, metadata } = params;
2286
- const res = await this.#patch(
2287
- url2`/v2/rooms/${roomId}/feeds/${feedId}`,
2288
- { metadata },
2289
- options
2290
- );
2291
- if (!res.ok) {
2292
- throw await LiveblocksError.from(res);
2293
- }
2294
- }
2295
- /**
2296
- * Deletes a feed.
2297
- * @param params.roomId The room ID to delete the feed from.
2298
- * @param params.feedId The feed ID to delete.
2299
- * @param options.signal (optional) An abort signal to cancel the request.
2300
- */
2301
- async deleteFeed(params, options) {
2302
- const { roomId, feedId } = params;
2303
- const res = await this.#delete(
2304
- url2`/v2/rooms/${roomId}/feeds/${feedId}`,
2305
- void 0,
2306
- options
2307
- );
2308
- if (!res.ok) {
2309
- throw await LiveblocksError.from(res);
2310
- }
2311
- }
2312
- /**
2313
- * Returns a list of messages in a feed.
2314
- * @param params.roomId The room ID to get the feed messages from.
2315
- * @param params.feedId The feed ID to get the messages from.
2316
- * @param options.signal (optional) An abort signal to cancel the request.
2317
- * @returns A list of feed messages.
2318
- */
2319
- async getFeedMessages(params, options) {
2320
- const { roomId, feedId } = params;
2321
- const res = await this.#get(
2322
- url2`/v2/rooms/${roomId}/feeds/${feedId}/messages`,
2323
- void 0,
2324
- options
2325
- );
2326
- if (!res.ok) {
2327
- throw await LiveblocksError.from(res);
2328
- }
2329
- return await res.json();
2330
- }
2331
- /**
2332
- * Creates a new message in a feed.
2333
- * @param params.roomId The room ID to create the feed message in.
2334
- * @param params.feedId The feed ID to create the message in.
2335
- * @param params.id (optional) The message ID. If not provided, one will be generated.
2336
- * @param params.timestamp (optional) The message timestamp. If not provided, the current time will be used.
2337
- * @param params.data The message data.
2338
- * @param options.signal (optional) An abort signal to cancel the request.
2339
- * @returns The created feed message.
2340
- */
2341
- async createFeedMessage(params, options) {
2342
- const { roomId, feedId, id, timestamp, data } = params;
2343
- const res = await this.#post(
2344
- url2`/v2/rooms/${roomId}/feeds/${feedId}/messages`,
2345
- { id, timestamp, data },
2346
- options
2347
- );
2348
- if (!res.ok) {
2349
- throw await LiveblocksError.from(res);
2350
- }
2351
- return (await res.json()).data;
2352
- }
2353
- /**
2354
- * Updates a feed message.
2355
- * @param params.roomId The room ID to update the feed message in.
2356
- * @param params.feedId The feed ID to update the message in.
2357
- * @param params.messageId The message ID to update.
2358
- * @param params.data The message data.
2359
- * @param options.signal (optional) An abort signal to cancel the request.
2360
- */
2361
- async updateFeedMessage(params, options) {
2362
- const { roomId, feedId, messageId, data } = params;
2363
- const res = await this.#patch(
2364
- url2`/v2/rooms/${roomId}/feeds/${feedId}/messages/${messageId}`,
2365
- { data },
2366
- options
2367
- );
2368
- if (!res.ok) {
2369
- throw await LiveblocksError.from(res);
2370
- }
2371
- }
2372
- /**
2373
- * Deletes a feed message.
2374
- * @param params.roomId The room ID to delete the feed message from.
2375
- * @param params.feedId The feed ID to delete the message from.
2376
- * @param params.messageId The message ID to delete.
2377
- * @param options.signal (optional) An abort signal to cancel the request.
2378
- */
2379
- async deleteFeedMessage(params, options) {
2380
- const { roomId, feedId, messageId } = params;
2381
- const res = await this.#delete(
2382
- url2`/v2/rooms/${roomId}/feeds/${feedId}/messages/${messageId}`,
2383
- void 0,
2384
- options
2385
- );
2386
- if (!res.ok) {
2387
- throw await LiveblocksError.from(res);
2388
- }
2389
- }
2390
2193
  };
2391
2194
  var LiveblocksError = class _LiveblocksError extends Error {
2392
2195
  status;