@liveblocks/node 3.13.1-hackathon → 3.13.2

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.13.1-hackathon";
6
+ var PKG_VERSION = "3.13.2";
7
7
  var PKG_FORMAT = "cjs";
8
8
 
9
9
  // src/client.ts
@@ -2088,184 +2088,6 @@ var Liveblocks = class {
2088
2088
  data: page.data.map(inflateWebKnowledgeSourceLink)
2089
2089
  };
2090
2090
  }
2091
- /* -------------------------------------------------------------------------------------------------
2092
- * Agent Sessions
2093
- * -----------------------------------------------------------------------------------------------*/
2094
- /**
2095
- * Returns a list of agent sessions in a room.
2096
- * @param params.roomId The room ID to get the agent sessions from.
2097
- * @param options.signal (optional) An abort signal to cancel the request.
2098
- * @returns A list of agent sessions.
2099
- */
2100
- async getAgentSessions(params, options) {
2101
- const { roomId } = params;
2102
- const res = await this.#get(
2103
- _core.url`/v2/rooms/${roomId}/agent-sessions`,
2104
- void 0,
2105
- options
2106
- );
2107
- if (!res.ok) {
2108
- throw await LiveblocksError.from(res);
2109
- }
2110
- return await res.json();
2111
- }
2112
- /**
2113
- * Creates a new agent session in a room.
2114
- * @param params.roomId The room ID to create the agent session in.
2115
- * @param params.sessionId The session ID for the agent session.
2116
- * @param params.metadata (optional) The metadata for the agent session.
2117
- * @param params.timestamp (optional) The timestamp for the agent session. If not provided, the current time will be used.
2118
- * @param options.signal (optional) An abort signal to cancel the request.
2119
- * @returns The created agent session.
2120
- */
2121
- async createAgentSession(params, options) {
2122
- const { roomId, sessionId, metadata, timestamp } = params;
2123
- const res = await this.#post(
2124
- _core.url`/v2/rooms/${roomId}/agent-sessions`,
2125
- { sessionId, metadata, timestamp },
2126
- options
2127
- );
2128
- if (!res.ok) {
2129
- throw await LiveblocksError.from(res);
2130
- }
2131
- return await res.json();
2132
- }
2133
- /**
2134
- * Returns an agent session with the given id.
2135
- * @param params.roomId The room ID to get the agent session from.
2136
- * @param params.agentSessionId The agent session ID.
2137
- * @param options.signal (optional) An abort signal to cancel the request.
2138
- * @returns The agent session.
2139
- */
2140
- async getAgentSession(params, options) {
2141
- const { roomId, agentSessionId } = params;
2142
- const res = await this.#get(
2143
- _core.url`/v2/rooms/${roomId}/agent-sessions/${agentSessionId}`,
2144
- void 0,
2145
- options
2146
- );
2147
- if (!res.ok) {
2148
- throw await LiveblocksError.from(res);
2149
- }
2150
- return await res.json();
2151
- }
2152
- /**
2153
- * Updates the metadata of an agent session.
2154
- * @param params.roomId The room ID to update the agent session in.
2155
- * @param params.agentSessionId The agent session ID to update.
2156
- * @param params.metadata The metadata for the agent session.
2157
- * @param options.signal (optional) An abort signal to cancel the request.
2158
- * @returns The updated agent session.
2159
- */
2160
- async updateAgentSessionMetadata(params, options) {
2161
- const { roomId, agentSessionId, metadata } = params;
2162
- const res = await this.#post(
2163
- _core.url`/v2/rooms/${roomId}/agent-sessions/${agentSessionId}`,
2164
- { metadata },
2165
- options
2166
- );
2167
- if (!res.ok) {
2168
- throw await LiveblocksError.from(res);
2169
- }
2170
- return await res.json();
2171
- }
2172
- /**
2173
- * Deletes an agent session.
2174
- * @param params.roomId The room ID to delete the agent session from.
2175
- * @param params.agentSessionId The agent session ID to delete.
2176
- * @param options.signal (optional) An abort signal to cancel the request.
2177
- */
2178
- async deleteAgentSession(params, options) {
2179
- const { roomId, agentSessionId } = params;
2180
- const res = await this.#delete(
2181
- _core.url`/v2/rooms/${roomId}/agent-sessions/${agentSessionId}`,
2182
- void 0,
2183
- options
2184
- );
2185
- if (!res.ok) {
2186
- throw await LiveblocksError.from(res);
2187
- }
2188
- }
2189
- /**
2190
- * Returns a list of agent messages in an agent session.
2191
- * @param params.roomId The room ID to get the agent messages from.
2192
- * @param params.agentSessionId The agent session ID to get the messages from.
2193
- * @param options.signal (optional) An abort signal to cancel the request.
2194
- * @returns A list of agent messages.
2195
- */
2196
- async getAgentMessages(params, options) {
2197
- const { roomId, agentSessionId } = params;
2198
- const res = await this.#get(
2199
- _core.url`/v2/rooms/${roomId}/agent-sessions/${agentSessionId}/messages`,
2200
- void 0,
2201
- options
2202
- );
2203
- if (!res.ok) {
2204
- throw await LiveblocksError.from(res);
2205
- }
2206
- return await res.json();
2207
- }
2208
- /**
2209
- * Creates a new agent message in an agent session.
2210
- * @param params.roomId The room ID to create the agent message in.
2211
- * @param params.agentSessionId The agent session ID to create the message in.
2212
- * @param params.id (optional) The message ID. If not provided, one will be generated.
2213
- * @param params.timestamp (optional) The message timestamp. If not provided, the current time will be used.
2214
- * @param params.data The message data.
2215
- * @param options.signal (optional) An abort signal to cancel the request.
2216
- * @returns The created agent message.
2217
- */
2218
- async createAgentMessage(params, options) {
2219
- const { roomId, agentSessionId, id, timestamp, data } = params;
2220
- const res = await this.#post(
2221
- _core.url`/v2/rooms/${roomId}/agent-sessions/${agentSessionId}/messages`,
2222
- { id, timestamp, data },
2223
- options
2224
- );
2225
- if (!res.ok) {
2226
- throw await LiveblocksError.from(res);
2227
- }
2228
- return await res.json();
2229
- }
2230
- /**
2231
- * Updates an agent message.
2232
- * @param params.roomId The room ID to update the agent message in.
2233
- * @param params.agentSessionId The agent session ID to update the message in.
2234
- * @param params.messageId The message ID to update.
2235
- * @param params.data The message data.
2236
- * @param options.signal (optional) An abort signal to cancel the request.
2237
- * @returns The updated agent message.
2238
- */
2239
- async updateAgentMessage(params, options) {
2240
- const { roomId, agentSessionId, messageId, data } = params;
2241
- const res = await this.#post(
2242
- _core.url`/v2/rooms/${roomId}/agent-sessions/${agentSessionId}/messages/${messageId}`,
2243
- { data },
2244
- options
2245
- );
2246
- if (!res.ok) {
2247
- throw await LiveblocksError.from(res);
2248
- }
2249
- return await res.json();
2250
- }
2251
- /**
2252
- * Deletes an agent message.
2253
- * @param params.roomId The room ID to delete the agent message from.
2254
- * @param params.agentSessionId The agent session ID to delete the message from.
2255
- * @param params.messageId The message ID to delete.
2256
- * @param options.signal (optional) An abort signal to cancel the request.
2257
- */
2258
- async deleteAgentMessage(params, options) {
2259
- const { roomId, agentSessionId, messageId } = params;
2260
- const res = await this.#delete(
2261
- _core.url`/v2/rooms/${roomId}/agent-sessions/${agentSessionId}/messages/${messageId}`,
2262
- void 0,
2263
- options
2264
- );
2265
- if (!res.ok) {
2266
- throw await LiveblocksError.from(res);
2267
- }
2268
- }
2269
2091
  };
2270
2092
  var LiveblocksError = class _LiveblocksError extends Error {
2271
2093