1 line
28 KiB
JSON
1 line
28 KiB
JSON
{"ast":null,"code":"\"use strict\";\n\nvar __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = {\n enumerable: true,\n get: function () {\n return m[k];\n }\n };\n }\n Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\nvar __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {\n Object.defineProperty(o, \"default\", {\n enumerable: true,\n value: v\n });\n} : function (o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = this && this.__importStar || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __exportStar = this && this.__exportStar || function (m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nvar __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n \"default\": mod\n };\n};\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.HttpTransaction = exports.HttpClient = exports._createClient = exports.createClient = void 0;\nconst hrana = __importStar(require(\"@libsql/hrana-client\"));\nconst api_1 = require(\"@libsql/core/api\");\nconst config_1 = require(\"@libsql/core/config\");\nconst hrana_js_1 = require(\"./hrana.js\");\nconst sql_cache_js_1 = require(\"./sql_cache.js\");\nconst uri_1 = require(\"@libsql/core/uri\");\nconst util_1 = require(\"@libsql/core/util\");\nconst promise_limit_1 = __importDefault(require(\"promise-limit\"));\n__exportStar(require(\"@libsql/core/api\"), exports);\nfunction createClient(config) {\n return _createClient((0, config_1.expandConfig)(config, true));\n}\nexports.createClient = createClient;\n/** @private */\nfunction _createClient(config) {\n if (config.scheme !== \"https\" && config.scheme !== \"http\") {\n throw new api_1.LibsqlError('The HTTP client supports only \"libsql:\", \"https:\" and \"http:\" URLs, ' + `got ${JSON.stringify(config.scheme + \":\")}. For more information, please read ${util_1.supportedUrlLink}`, \"URL_SCHEME_NOT_SUPPORTED\");\n }\n if (config.encryptionKey !== undefined) {\n throw new api_1.LibsqlError(\"Encryption key is not supported by the remote client.\", \"ENCRYPTION_KEY_NOT_SUPPORTED\");\n }\n if (config.scheme === \"http\" && config.tls) {\n throw new api_1.LibsqlError(`A \"http:\" URL cannot opt into TLS by using ?tls=1`, \"URL_INVALID\");\n } else if (config.scheme === \"https\" && !config.tls) {\n throw new api_1.LibsqlError(`A \"https:\" URL cannot opt out of TLS by using ?tls=0`, \"URL_INVALID\");\n }\n const url = (0, uri_1.encodeBaseUrl)(config.scheme, config.authority, config.path);\n return new HttpClient(url, config.authToken, config.intMode, config.fetch, config.concurrency);\n}\nexports._createClient = _createClient;\nconst sqlCacheCapacity = 30;\nclass HttpClient {\n #client;\n protocol;\n #authToken;\n #promiseLimitFunction;\n /** @private */\n constructor(url, authToken, intMode, customFetch, concurrency) {\n this.#client = hrana.openHttp(url, authToken, customFetch);\n this.#client.intMode = intMode;\n this.protocol = \"http\";\n this.#authToken = authToken;\n this.#promiseLimitFunction = (0, promise_limit_1.default)(concurrency);\n }\n async limit(fn) {\n return this.#promiseLimitFunction(fn);\n }\n async execute(stmtOrSql, args) {\n let stmt;\n if (typeof stmtOrSql === \"string\") {\n stmt = {\n sql: stmtOrSql,\n args: args || []\n };\n } else {\n stmt = stmtOrSql;\n }\n return this.limit(async () => {\n try {\n const hranaStmt = (0, hrana_js_1.stmtToHrana)(stmt);\n // Pipeline all operations, so `hrana.HttpClient` can open the stream, execute the statement and\n // close the stream in a single HTTP request.\n let rowsPromise;\n const stream = this.#client.openStream();\n try {\n rowsPromise = stream.query(hranaStmt);\n } finally {\n stream.closeGracefully();\n }\n const rowsResult = await rowsPromise;\n return (0, hrana_js_1.resultSetFromHrana)(rowsResult);\n } catch (e) {\n throw (0, hrana_js_1.mapHranaError)(e);\n }\n });\n }\n async batch(stmts, mode = \"deferred\") {\n return this.limit(async () => {\n try {\n const hranaStmts = stmts.map(hrana_js_1.stmtToHrana);\n const version = await this.#client.getVersion();\n // Pipeline all operations, so `hrana.HttpClient` can open the stream, execute the batch and\n // close the stream in a single HTTP request.\n let resultsPromise;\n const stream = this.#client.openStream();\n try {\n // It makes sense to use a SQL cache even for a single batch, because it may contain the same\n // statement repeated multiple times.\n const sqlCache = new sql_cache_js_1.SqlCache(stream, sqlCacheCapacity);\n sqlCache.apply(hranaStmts);\n // TODO: we do not use a cursor here, because it would cause three roundtrips:\n // 1. pipeline request to store SQL texts\n // 2. cursor request\n // 3. pipeline request to close the stream\n const batch = stream.batch(false);\n resultsPromise = (0, hrana_js_1.executeHranaBatch)(mode, version, batch, hranaStmts);\n } finally {\n stream.closeGracefully();\n }\n const results = await resultsPromise;\n return results;\n } catch (e) {\n throw (0, hrana_js_1.mapHranaError)(e);\n }\n });\n }\n async migrate(stmts) {\n return this.limit(async () => {\n try {\n const hranaStmts = stmts.map(hrana_js_1.stmtToHrana);\n const version = await this.#client.getVersion();\n // Pipeline all operations, so `hrana.HttpClient` can open the stream, execute the batch and\n // close the stream in a single HTTP request.\n let resultsPromise;\n const stream = this.#client.openStream();\n try {\n const batch = stream.batch(false);\n resultsPromise = (0, hrana_js_1.executeHranaBatch)(\"deferred\", version, batch, hranaStmts, true);\n } finally {\n stream.closeGracefully();\n }\n const results = await resultsPromise;\n return results;\n } catch (e) {\n throw (0, hrana_js_1.mapHranaError)(e);\n }\n });\n }\n async transaction(mode = \"write\") {\n return this.limit(async () => {\n try {\n const version = await this.#client.getVersion();\n return new HttpTransaction(this.#client.openStream(), mode, version);\n } catch (e) {\n throw (0, hrana_js_1.mapHranaError)(e);\n }\n });\n }\n async executeMultiple(sql) {\n return this.limit(async () => {\n try {\n // Pipeline all operations, so `hrana.HttpClient` can open the stream, execute the sequence and\n // close the stream in a single HTTP request.\n let promise;\n const stream = this.#client.openStream();\n try {\n promise = stream.sequence(sql);\n } finally {\n stream.closeGracefully();\n }\n await promise;\n } catch (e) {\n throw (0, hrana_js_1.mapHranaError)(e);\n }\n });\n }\n sync() {\n throw new api_1.LibsqlError(\"sync not supported in http mode\", \"SYNC_NOT_SUPPORTED\");\n }\n close() {\n this.#client.close();\n }\n get closed() {\n return this.#client.closed;\n }\n}\nexports.HttpClient = HttpClient;\nclass HttpTransaction extends hrana_js_1.HranaTransaction {\n #stream;\n #sqlCache;\n /** @private */\n constructor(stream, mode, version) {\n super(mode, version);\n this.#stream = stream;\n this.#sqlCache = new sql_cache_js_1.SqlCache(stream, sqlCacheCapacity);\n }\n /** @private */\n _getStream() {\n return this.#stream;\n }\n /** @private */\n _getSqlCache() {\n return this.#sqlCache;\n }\n close() {\n this.#stream.close();\n }\n get closed() {\n return this.#stream.closed;\n }\n}\nexports.HttpTransaction = HttpTransaction;","map":{"version":3,"names":["__createBinding","Object","create","o","m","k","k2","undefined","desc","getOwnPropertyDescriptor","__esModule","writable","configurable","enumerable","get","defineProperty","__setModuleDefault","v","value","__importStar","mod","result","prototype","hasOwnProperty","call","__exportStar","exports","p","__importDefault","HttpTransaction","HttpClient","_createClient","createClient","hrana","require","api_1","config_1","hrana_js_1","sql_cache_js_1","uri_1","util_1","promise_limit_1","config","expandConfig","scheme","LibsqlError","JSON","stringify","supportedUrlLink","encryptionKey","tls","url","encodeBaseUrl","authority","path","authToken","intMode","fetch","concurrency","sqlCacheCapacity","client","protocol","promiseLimitFunction","constructor","customFetch","openHttp","default","limit","fn","execute","stmtOrSql","args","stmt","sql","hranaStmt","stmtToHrana","rowsPromise","stream","openStream","query","closeGracefully","rowsResult","resultSetFromHrana","e","mapHranaError","batch","stmts","mode","hranaStmts","map","version","getVersion","resultsPromise","sqlCache","SqlCache","apply","executeHranaBatch","results","migrate","transaction","executeMultiple","promise","sequence","sync","close","closed","HranaTransaction","_getStream","_getSqlCache"],"sources":["/Users/shoofle/Projects/the-forest/node_modules/@libsql/client/lib-cjs/http.js"],"sourcesContent":["\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HttpTransaction = exports.HttpClient = exports._createClient = exports.createClient = void 0;\nconst hrana = __importStar(require(\"@libsql/hrana-client\"));\nconst api_1 = require(\"@libsql/core/api\");\nconst config_1 = require(\"@libsql/core/config\");\nconst hrana_js_1 = require(\"./hrana.js\");\nconst sql_cache_js_1 = require(\"./sql_cache.js\");\nconst uri_1 = require(\"@libsql/core/uri\");\nconst util_1 = require(\"@libsql/core/util\");\nconst promise_limit_1 = __importDefault(require(\"promise-limit\"));\n__exportStar(require(\"@libsql/core/api\"), exports);\nfunction createClient(config) {\n return _createClient((0, config_1.expandConfig)(config, true));\n}\nexports.createClient = createClient;\n/** @private */\nfunction _createClient(config) {\n if (config.scheme !== \"https\" && config.scheme !== \"http\") {\n throw new api_1.LibsqlError('The HTTP client supports only \"libsql:\", \"https:\" and \"http:\" URLs, ' +\n `got ${JSON.stringify(config.scheme + \":\")}. For more information, please read ${util_1.supportedUrlLink}`, \"URL_SCHEME_NOT_SUPPORTED\");\n }\n if (config.encryptionKey !== undefined) {\n throw new api_1.LibsqlError(\"Encryption key is not supported by the remote client.\", \"ENCRYPTION_KEY_NOT_SUPPORTED\");\n }\n if (config.scheme === \"http\" && config.tls) {\n throw new api_1.LibsqlError(`A \"http:\" URL cannot opt into TLS by using ?tls=1`, \"URL_INVALID\");\n }\n else if (config.scheme === \"https\" && !config.tls) {\n throw new api_1.LibsqlError(`A \"https:\" URL cannot opt out of TLS by using ?tls=0`, \"URL_INVALID\");\n }\n const url = (0, uri_1.encodeBaseUrl)(config.scheme, config.authority, config.path);\n return new HttpClient(url, config.authToken, config.intMode, config.fetch, config.concurrency);\n}\nexports._createClient = _createClient;\nconst sqlCacheCapacity = 30;\nclass HttpClient {\n #client;\n protocol;\n #authToken;\n #promiseLimitFunction;\n /** @private */\n constructor(url, authToken, intMode, customFetch, concurrency) {\n this.#client = hrana.openHttp(url, authToken, customFetch);\n this.#client.intMode = intMode;\n this.protocol = \"http\";\n this.#authToken = authToken;\n this.#promiseLimitFunction = (0, promise_limit_1.default)(concurrency);\n }\n async limit(fn) {\n return this.#promiseLimitFunction(fn);\n }\n async execute(stmtOrSql, args) {\n let stmt;\n if (typeof stmtOrSql === \"string\") {\n stmt = {\n sql: stmtOrSql,\n args: args || [],\n };\n }\n else {\n stmt = stmtOrSql;\n }\n return this.limit(async () => {\n try {\n const hranaStmt = (0, hrana_js_1.stmtToHrana)(stmt);\n // Pipeline all operations, so `hrana.HttpClient` can open the stream, execute the statement and\n // close the stream in a single HTTP request.\n let rowsPromise;\n const stream = this.#client.openStream();\n try {\n rowsPromise = stream.query(hranaStmt);\n }\n finally {\n stream.closeGracefully();\n }\n const rowsResult = await rowsPromise;\n return (0, hrana_js_1.resultSetFromHrana)(rowsResult);\n }\n catch (e) {\n throw (0, hrana_js_1.mapHranaError)(e);\n }\n });\n }\n async batch(stmts, mode = \"deferred\") {\n return this.limit(async () => {\n try {\n const hranaStmts = stmts.map(hrana_js_1.stmtToHrana);\n const version = await this.#client.getVersion();\n // Pipeline all operations, so `hrana.HttpClient` can open the stream, execute the batch and\n // close the stream in a single HTTP request.\n let resultsPromise;\n const stream = this.#client.openStream();\n try {\n // It makes sense to use a SQL cache even for a single batch, because it may contain the same\n // statement repeated multiple times.\n const sqlCache = new sql_cache_js_1.SqlCache(stream, sqlCacheCapacity);\n sqlCache.apply(hranaStmts);\n // TODO: we do not use a cursor here, because it would cause three roundtrips:\n // 1. pipeline request to store SQL texts\n // 2. cursor request\n // 3. pipeline request to close the stream\n const batch = stream.batch(false);\n resultsPromise = (0, hrana_js_1.executeHranaBatch)(mode, version, batch, hranaStmts);\n }\n finally {\n stream.closeGracefully();\n }\n const results = await resultsPromise;\n return results;\n }\n catch (e) {\n throw (0, hrana_js_1.mapHranaError)(e);\n }\n });\n }\n async migrate(stmts) {\n return this.limit(async () => {\n try {\n const hranaStmts = stmts.map(hrana_js_1.stmtToHrana);\n const version = await this.#client.getVersion();\n // Pipeline all operations, so `hrana.HttpClient` can open the stream, execute the batch and\n // close the stream in a single HTTP request.\n let resultsPromise;\n const stream = this.#client.openStream();\n try {\n const batch = stream.batch(false);\n resultsPromise = (0, hrana_js_1.executeHranaBatch)(\"deferred\", version, batch, hranaStmts, true);\n }\n finally {\n stream.closeGracefully();\n }\n const results = await resultsPromise;\n return results;\n }\n catch (e) {\n throw (0, hrana_js_1.mapHranaError)(e);\n }\n });\n }\n async transaction(mode = \"write\") {\n return this.limit(async () => {\n try {\n const version = await this.#client.getVersion();\n return new HttpTransaction(this.#client.openStream(), mode, version);\n }\n catch (e) {\n throw (0, hrana_js_1.mapHranaError)(e);\n }\n });\n }\n async executeMultiple(sql) {\n return this.limit(async () => {\n try {\n // Pipeline all operations, so `hrana.HttpClient` can open the stream, execute the sequence and\n // close the stream in a single HTTP request.\n let promise;\n const stream = this.#client.openStream();\n try {\n promise = stream.sequence(sql);\n }\n finally {\n stream.closeGracefully();\n }\n await promise;\n }\n catch (e) {\n throw (0, hrana_js_1.mapHranaError)(e);\n }\n });\n }\n sync() {\n throw new api_1.LibsqlError(\"sync not supported in http mode\", \"SYNC_NOT_SUPPORTED\");\n }\n close() {\n this.#client.close();\n }\n get closed() {\n return this.#client.closed;\n }\n}\nexports.HttpClient = HttpClient;\nclass HttpTransaction extends hrana_js_1.HranaTransaction {\n #stream;\n #sqlCache;\n /** @private */\n constructor(stream, mode, version) {\n super(mode, version);\n this.#stream = stream;\n this.#sqlCache = new sql_cache_js_1.SqlCache(stream, sqlCacheCapacity);\n }\n /** @private */\n _getStream() {\n return this.#stream;\n }\n /** @private */\n _getSqlCache() {\n return this.#sqlCache;\n }\n close() {\n this.#stream.close();\n }\n get closed() {\n return this.#stream.closed;\n }\n}\nexports.HttpTransaction = HttpTransaction;\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,eAAe,GAAI,IAAI,IAAI,IAAI,CAACA,eAAe,KAAMC,MAAM,CAACC,MAAM,GAAI,UAASC,CAAC,EAAEC,CAAC,EAAEC,CAAC,EAAEC,EAAE,EAAE;EAC5F,IAAIA,EAAE,KAAKC,SAAS,EAAED,EAAE,GAAGD,CAAC;EAC5B,IAAIG,IAAI,GAAGP,MAAM,CAACQ,wBAAwB,CAACL,CAAC,EAAEC,CAAC,CAAC;EAChD,IAAI,CAACG,IAAI,KAAK,KAAK,IAAIA,IAAI,GAAG,CAACJ,CAAC,CAACM,UAAU,GAAGF,IAAI,CAACG,QAAQ,IAAIH,IAAI,CAACI,YAAY,CAAC,EAAE;IACjFJ,IAAI,GAAG;MAAEK,UAAU,EAAE,IAAI;M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