{"ast":null,"code":"import { ClientError, ClosedError, InternalError } from \"../errors.js\";\nimport { Queue } from \"../queue.js\";\nimport { Stream } from \"../stream.js\";\nimport { WsCursor } from \"./cursor.js\";\nexport class WsStream extends Stream {\n #client;\n #streamId;\n #queue;\n #cursor;\n #closing;\n #closed;\n /** @private */\n static open(client) {\n const streamId = client._streamIdAlloc.alloc();\n const stream = new WsStream(client, streamId);\n const responseCallback = () => undefined;\n const errorCallback = e => stream.#setClosed(e);\n const request = {\n type: \"open_stream\",\n streamId\n };\n client._sendRequest(request, {\n responseCallback,\n errorCallback\n });\n return stream;\n }\n /** @private */\n constructor(client, streamId) {\n super(client.intMode);\n this.#client = client;\n this.#streamId = streamId;\n this.#queue = new Queue();\n this.#cursor = undefined;\n this.#closing = false;\n this.#closed = undefined;\n }\n /** Get the {@link WsClient} object that this stream belongs to. */\n client() {\n return this.#client;\n }\n /** @private */\n _sqlOwner() {\n return this.#client;\n }\n /** @private */\n _execute(stmt) {\n return this.#sendStreamRequest({\n type: \"execute\",\n streamId: this.#streamId,\n stmt\n }).then(response => {\n return response.result;\n });\n }\n /** @private */\n _batch(batch) {\n return this.#sendStreamRequest({\n type: \"batch\",\n streamId: this.#streamId,\n batch\n }).then(response => {\n return response.result;\n });\n }\n /** @private */\n _describe(protoSql) {\n this.#client._ensureVersion(2, \"describe()\");\n return this.#sendStreamRequest({\n type: \"describe\",\n streamId: this.#streamId,\n sql: protoSql.sql,\n sqlId: protoSql.sqlId\n }).then(response => {\n return response.result;\n });\n }\n /** @private */\n _sequence(protoSql) {\n this.#client._ensureVersion(2, \"sequence()\");\n return this.#sendStreamRequest({\n type: \"sequence\",\n streamId: this.#streamId,\n sql: protoSql.sql,\n sqlId: protoSql.sqlId\n }).then(_response => {\n return undefined;\n });\n }\n /** Check whether the SQL connection underlying this stream is in autocommit state (i.e., outside of an\n * explicit transaction). This requires protocol version 3 or higher.\n */\n getAutocommit() {\n this.#client._ensureVersion(3, \"getAutocommit()\");\n return this.#sendStreamRequest({\n type: \"get_autocommit\",\n streamId: this.#streamId\n }).then(response => {\n return response.isAutocommit;\n });\n }\n #sendStreamRequest(request) {\n return new Promise((responseCallback, errorCallback) => {\n this.#pushToQueue({\n type: \"request\",\n request,\n responseCallback,\n errorCallback\n });\n });\n }\n /** @private */\n _openCursor(batch) {\n this.#client._ensureVersion(3, \"cursor\");\n return new Promise((cursorCallback, errorCallback) => {\n this.#pushToQueue({\n type: \"cursor\",\n batch,\n cursorCallback,\n errorCallback\n });\n });\n }\n /** @private */\n _sendCursorRequest(cursor, request) {\n if (cursor !== this.#cursor) {\n throw new InternalError(\"Cursor not associated with the stream attempted to execute a request\");\n }\n return new Promise((responseCallback, errorCallback) => {\n if (this.#closed !== undefined) {\n errorCallback(new ClosedError(\"Stream is closed\", this.#closed));\n } else {\n this.#client._sendRequest(request, {\n responseCallback,\n errorCallback\n });\n }\n });\n }\n /** @private */\n _cursorClosed(cursor) {\n if (cursor !== this.#cursor) {\n throw new InternalError(\"Cursor was closed, but it was not associated with the stream\");\n }\n this.#cursor = undefined;\n this.#flushQueue();\n }\n #pushToQueue(entry) {\n if (this.#closed !== undefined) {\n entry.errorCallback(new ClosedError(\"Stream is closed\", this.#closed));\n } else if (this.#closing) {\n entry.errorCallback(new ClosedError(\"Stream is closing\", undefined));\n } else {\n this.#queue.push(entry);\n this.#flushQueue();\n }\n }\n #flushQueue() {\n for (;;) {\n const entry = this.#queue.first();\n if (entry === undefined && this.#cursor === undefined && this.#closing) {\n this.#setClosed(new ClientError(\"Stream was gracefully closed\"));\n break;\n } else if (entry?.type === \"request\" && this.#cursor === undefined) {\n const {\n request,\n responseCallback,\n errorCallback\n } = entry;\n this.#queue.shift();\n this.#client._sendRequest(request, {\n responseCallback,\n errorCallback\n });\n } else if (entry?.type === \"cursor\" && this.#cursor === undefined) {\n const {\n batch,\n cursorCallback\n } = entry;\n this.#queue.shift();\n const cursorId = this.#client._cursorIdAlloc.alloc();\n const cursor = new WsCursor(this.#client, this, cursorId);\n const request = {\n type: \"open_cursor\",\n streamId: this.#streamId,\n cursorId,\n batch\n };\n const responseCallback = () => undefined;\n const errorCallback = e => cursor._setClosed(e);\n this.#client._sendRequest(request, {\n responseCallback,\n errorCallback\n });\n this.#cursor = cursor;\n cursorCallback(cursor);\n } else {\n break;\n }\n }\n }\n #setClosed(error) {\n if (this.#closed !== undefined) {\n return;\n }\n this.#closed = error;\n if (this.#cursor !== undefined) {\n this.#cursor._setClosed(error);\n }\n for (;;) {\n const entry = this.#queue.shift();\n if (entry !== undefined) {\n entry.errorCallback(error);\n } else {\n break;\n }\n }\n const request = {\n type: \"close_stream\",\n streamId: this.#streamId\n };\n const responseCallback = () => this.#client._streamIdAlloc.free(this.#streamId);\n const errorCallback = () => undefined;\n this.#client._sendRequest(request, {\n responseCallback,\n errorCallback\n });\n }\n /** Immediately close the stream. */\n close() {\n this.#setClosed(new ClientError(\"Stream was manually closed\"));\n }\n /** Gracefully close the stream. */\n closeGracefully() {\n this.#closing = true;\n this.#flushQueue();\n }\n /** True if the stream is closed or closing. */\n get closed() {\n return this.#closed !== undefined || this.#closing;\n }\n}","map":{"version":3,"names":["ClientError","ClosedError","InternalError","Queue","Stream","WsCursor","WsStream","client","streamId","queue","cursor","closing","closed","open","_streamIdAlloc","alloc","stream","responseCallback","undefined","errorCallback","e","setClosed","request","type","_sendRequest","constructor","intMode","_sqlOwner","_execute","stmt","sendStreamRequest","then","response","result","_batch","batch","_describe","protoSql","_ensureVersion","sql","sqlId","_sequence","_response","getAutocommit","isAutocommit","#sendStreamRequest","Promise","pushToQueue","_openCursor","cursorCallback","_sendCursorRequest","_cursorClosed","flushQueue","#pushToQueue","entry","push","#flushQueue","first","shift","cursorId","_cursorIdAlloc","_setClosed","#setClosed","error","free","close","closeGracefully"],"sources":["/Users/shoofle/Projects/the-forest/node_modules/@libsql/hrana-client/lib-esm/ws/stream.js"],"sourcesContent":["import { ClientError, ClosedError, InternalError } from \"../errors.js\";\nimport { Queue } from \"../queue.js\";\nimport { Stream } from \"../stream.js\";\nimport { WsCursor } from \"./cursor.js\";\nexport class WsStream extends Stream {\n #client;\n #streamId;\n #queue;\n #cursor;\n #closing;\n #closed;\n /** @private */\n static open(client) {\n const streamId = client._streamIdAlloc.alloc();\n const stream = new WsStream(client, streamId);\n const responseCallback = () => undefined;\n const errorCallback = (e) => stream.#setClosed(e);\n const request = { type: \"open_stream\", streamId };\n client._sendRequest(request, { responseCallback, errorCallback });\n return stream;\n }\n /** @private */\n constructor(client, streamId) {\n super(client.intMode);\n this.#client = client;\n this.#streamId = streamId;\n this.#queue = new Queue();\n this.#cursor = undefined;\n this.#closing = false;\n this.#closed = undefined;\n }\n /** Get the {@link WsClient} object that this stream belongs to. */\n client() {\n return this.#client;\n }\n /** @private */\n _sqlOwner() {\n return this.#client;\n }\n /** @private */\n _execute(stmt) {\n return this.#sendStreamRequest({\n type: \"execute\",\n streamId: this.#streamId,\n stmt,\n }).then((response) => {\n return response.result;\n });\n }\n /** @private */\n _batch(batch) {\n return this.#sendStreamRequest({\n type: \"batch\",\n streamId: this.#streamId,\n batch,\n }).then((response) => {\n return response.result;\n });\n }\n /** @private */\n _describe(protoSql) {\n this.#client._ensureVersion(2, \"describe()\");\n return this.#sendStreamRequest({\n type: \"describe\",\n streamId: this.#streamId,\n sql: protoSql.sql,\n sqlId: protoSql.sqlId,\n }).then((response) => {\n return response.result;\n });\n }\n /** @private */\n _sequence(protoSql) {\n this.#client._ensureVersion(2, \"sequence()\");\n return this.#sendStreamRequest({\n type: \"sequence\",\n streamId: this.#streamId,\n sql: protoSql.sql,\n sqlId: protoSql.sqlId,\n }).then((_response) => {\n return undefined;\n });\n }\n /** Check whether the SQL connection underlying this stream is in autocommit state (i.e., outside of an\n * explicit transaction). This requires protocol version 3 or higher.\n */\n getAutocommit() {\n this.#client._ensureVersion(3, \"getAutocommit()\");\n return this.#sendStreamRequest({\n type: \"get_autocommit\",\n streamId: this.#streamId,\n }).then((response) => {\n return response.isAutocommit;\n });\n }\n #sendStreamRequest(request) {\n return new Promise((responseCallback, errorCallback) => {\n this.#pushToQueue({ type: \"request\", request, responseCallback, errorCallback });\n });\n }\n /** @private */\n _openCursor(batch) {\n this.#client._ensureVersion(3, \"cursor\");\n return new Promise((cursorCallback, errorCallback) => {\n this.#pushToQueue({ type: \"cursor\", batch, cursorCallback, errorCallback });\n });\n }\n /** @private */\n _sendCursorRequest(cursor, request) {\n if (cursor !== this.#cursor) {\n throw new InternalError(\"Cursor not associated with the stream attempted to execute a request\");\n }\n return new Promise((responseCallback, errorCallback) => {\n if (this.#closed !== undefined) {\n errorCallback(new ClosedError(\"Stream is closed\", this.#closed));\n }\n else {\n this.#client._sendRequest(request, { responseCallback, errorCallback });\n }\n });\n }\n /** @private */\n _cursorClosed(cursor) {\n if (cursor !== this.#cursor) {\n throw new InternalError(\"Cursor was closed, but it was not associated with the stream\");\n }\n this.#cursor = undefined;\n this.#flushQueue();\n }\n #pushToQueue(entry) {\n if (this.#closed !== undefined) {\n entry.errorCallback(new ClosedError(\"Stream is closed\", this.#closed));\n }\n else if (this.#closing) {\n entry.errorCallback(new ClosedError(\"Stream is closing\", undefined));\n }\n else {\n this.#queue.push(entry);\n this.#flushQueue();\n }\n }\n #flushQueue() {\n for (;;) {\n const entry = this.#queue.first();\n if (entry === undefined && this.#cursor === undefined && this.#closing) {\n this.#setClosed(new ClientError(\"Stream was gracefully closed\"));\n break;\n }\n else if (entry?.type === \"request\" && this.#cursor === undefined) {\n const { request, responseCallback, errorCallback } = entry;\n this.#queue.shift();\n this.#client._sendRequest(request, { responseCallback, errorCallback });\n }\n else if (entry?.type === \"cursor\" && this.#cursor === undefined) {\n const { batch, cursorCallback } = entry;\n this.#queue.shift();\n const cursorId = this.#client._cursorIdAlloc.alloc();\n const cursor = new WsCursor(this.#client, this, cursorId);\n const request = {\n type: \"open_cursor\",\n streamId: this.#streamId,\n cursorId,\n batch,\n };\n const responseCallback = () => undefined;\n const errorCallback = (e) => cursor._setClosed(e);\n this.#client._sendRequest(request, { responseCallback, errorCallback });\n this.#cursor = cursor;\n cursorCallback(cursor);\n }\n else {\n break;\n }\n }\n }\n #setClosed(error) {\n if (this.#closed !== undefined) {\n return;\n }\n this.#closed = error;\n if (this.#cursor !== undefined) {\n this.#cursor._setClosed(error);\n }\n for (;;) {\n const entry = this.#queue.shift();\n if (entry !== undefined) {\n entry.errorCallback(error);\n }\n else {\n break;\n }\n }\n const request = { type: \"close_stream\", streamId: this.#streamId };\n const responseCallback = () => this.#client._streamIdAlloc.free(this.#streamId);\n const errorCallback = () => undefined;\n this.#client._sendRequest(request, { responseCallback, errorCallback });\n }\n /** Immediately close the stream. */\n close() {\n this.#setClosed(new ClientError(\"Stream was manually closed\"));\n }\n /** Gracefully close the stream. */\n closeGracefully() {\n this.#closing = true;\n this.#flushQueue();\n }\n /** True if the stream is closed or closing. */\n get closed() {\n return this.#closed !== undefined || this.#closing;\n }\n}\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,WAAW,EAAEC,aAAa,QAAQ,cAAc;AACtE,SAASC,KAAK,QAAQ,aAAa;AACnC,SAASC,MAAM,QAAQ,cAAc;AACrC,SAASC,QAAQ,QAAQ,aAAa;AACtC,OAAO,MAAMC,QAAQ,SAASF,MAAM,CAAC;EACjC,CAACG,MAAM;EACP,CAACC,QAAQ;EACT,CAACC,KAAK;EACN,CAACC,MAAM;EACP,CAACC,OAAO;EACR,CAACC,MAAM;EACP;EACA,OAAOC,IAAIA,CAACN,MAAM,EAAE;IAChB,MAAMC,QAAQ,GAAGD,MAAM,CAACO,cAAc,CAACC,KAAK,CAAC,CAAC;IAC9C,MAAMC,MAAM,GAAG,IAAIV,QAAQ,CAACC,MAAM,EAAEC,QAAQ,CAAC;IAC7C,MAAMS,gBAAgB,GAAGA,CAAA,KAAMC,SAAS;IACxC,MAAMC,aAAa,GAAIC,CAAC,IAAKJ,MAAM,CAAC,CAACK,SAAS,CAACD,CAAC,CAAC;IACjD,MAAME,OAAO,GAAG;MAAEC,IAAI,EA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