@liveblocks/node 3.15.3 → 3.15.4

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.cjs CHANGED
@@ -3,7 +3,7 @@ var _core = require('@liveblocks/core');
3
3
 
4
4
  // src/version.ts
5
5
  var PKG_NAME = "@liveblocks/node";
6
- var PKG_VERSION = "3.15.3";
6
+ var PKG_VERSION = "3.15.4";
7
7
  var PKG_FORMAT = "cjs";
8
8
 
9
9
  // src/client.ts
@@ -1126,6 +1126,26 @@ var Liveblocks = class {
1126
1126
  throw await LiveblocksError.from(res);
1127
1127
  }
1128
1128
  }
1129
+ /**
1130
+ * Gets an attachment's metadata and a presigned download URL.
1131
+ *
1132
+ * @param params.roomId The room ID the attachment belongs to.
1133
+ * @param params.attachmentId The attachment ID (starts with "at_").
1134
+ * @param options.signal (optional) An abort signal to cancel the request.
1135
+ * @returns The attachment metadata including a presigned download URL.
1136
+ */
1137
+ async getAttachment(params, options) {
1138
+ const { roomId, attachmentId } = params;
1139
+ const res = await this.#get(
1140
+ _core.url`/v2/rooms/${roomId}/attachments/${attachmentId}`,
1141
+ void 0,
1142
+ options
1143
+ );
1144
+ if (!res.ok) {
1145
+ throw await LiveblocksError.from(res);
1146
+ }
1147
+ return await res.json();
1148
+ }
1129
1149
  /**
1130
1150
  * Creates a new thread. The thread will be created with the specified comment as its first comment.
1131
1151
  * If the thread already exists, a `LiveblocksError` will be thrown with status code 409.