logixia 1.1.5 → 1.2.0

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.
Files changed (68) hide show
  1. package/README.md +8 -0
  2. package/dist/{build-DIEB3doa.js → build-DOx-YxF1.js} +1 -1
  3. package/dist/{build-DIEB3doa.js.map → build-DOx-YxF1.js.map} +1 -1
  4. package/dist/{build-MmD3T4bV.mjs → build-DWmxA6A2.mjs} +1 -1
  5. package/dist/{build-MmD3T4bV.mjs.map → build-DWmxA6A2.mjs.map} +1 -1
  6. package/dist/{esm-BRY8ugtK.mjs → esm-1Ra90uql.mjs} +1 -1
  7. package/dist/{esm-BRY8ugtK.mjs.map → esm-1Ra90uql.mjs.map} +1 -1
  8. package/dist/{esm-CzjF801-.js → esm-FNhqFIqG.js} +1 -1
  9. package/dist/{esm-CzjF801-.js.map → esm-FNhqFIqG.js.map} +1 -1
  10. package/dist/index-BDRSTjUt.d.ts +247 -0
  11. package/dist/index-BDRSTjUt.d.ts.map +1 -0
  12. package/dist/index-Drrzn-Yg.d.mts +247 -0
  13. package/dist/index-Drrzn-Yg.d.mts.map +1 -0
  14. package/dist/index.d.mts +4 -1311
  15. package/dist/index.d.mts.map +1 -1
  16. package/dist/index.d.ts +4 -1311
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +177 -13898
  19. package/dist/index.js.map +1 -1
  20. package/dist/index.mjs +135 -13841
  21. package/dist/index.mjs.map +1 -1
  22. package/dist/{lib-BNWFXK2z.mjs → lib-8XKCHDOH.mjs} +1 -1
  23. package/dist/{lib-BNWFXK2z.mjs.map → lib-8XKCHDOH.mjs.map} +1 -1
  24. package/dist/{lib-Bb_wxP5g.js → lib-BNEYXXTQ.js} +1 -1
  25. package/dist/{lib-Bb_wxP5g.js.map → lib-BNEYXXTQ.js.map} +1 -1
  26. package/dist/logitron-logger.module-CY3t8yK6.d.mts +279 -0
  27. package/dist/logitron-logger.module-CY3t8yK6.d.mts.map +1 -0
  28. package/dist/logitron-logger.module-DgEldK9V.d.ts +279 -0
  29. package/dist/logitron-logger.module-DgEldK9V.d.ts.map +1 -0
  30. package/dist/logitron-logger.module-X6nGDVGC.js +10484 -0
  31. package/dist/logitron-logger.module-X6nGDVGC.js.map +1 -0
  32. package/dist/logitron-logger.module-iO8DPE7_.mjs +10307 -0
  33. package/dist/logitron-logger.module-iO8DPE7_.mjs.map +1 -0
  34. package/dist/nest.d.mts +63 -0
  35. package/dist/nest.d.mts.map +1 -0
  36. package/dist/nest.d.ts +63 -0
  37. package/dist/nest.d.ts.map +1 -0
  38. package/dist/nest.js +127 -0
  39. package/dist/nest.js.map +1 -0
  40. package/dist/nest.mjs +95 -0
  41. package/dist/nest.mjs.map +1 -0
  42. package/dist/{promise-O6_ARWpI.mjs → promise-C4pQPcK4.mjs} +1 -1
  43. package/dist/{promise-O6_ARWpI.mjs.map → promise-C4pQPcK4.mjs.map} +1 -1
  44. package/dist/{promise-DWsrbKAX.js → promise-DaiZ2BaH.js} +1 -1
  45. package/dist/{promise-DWsrbKAX.js.map → promise-DaiZ2BaH.js.map} +1 -1
  46. package/dist/search-1txemGPh.mjs +1 -0
  47. package/dist/search-Cg_OasF-.d.ts +1 -0
  48. package/dist/search-DanSf_yc.d.mts +1 -0
  49. package/dist/search-DeZHhWxB.js +0 -0
  50. package/dist/search.d.mts +1 -0
  51. package/dist/search.d.ts +1 -0
  52. package/dist/search.js +1 -0
  53. package/dist/search.mjs +3 -0
  54. package/dist/{sqlite3-DWYzFy5X.js → sqlite3-CSkpjC90.js} +1 -1
  55. package/dist/{sqlite3-DWYzFy5X.js.map → sqlite3-CSkpjC90.js.map} +1 -1
  56. package/dist/{sqlite3-BUpkBlte.mjs → sqlite3-DD2_nRRH.mjs} +1 -1
  57. package/dist/{sqlite3-BUpkBlte.mjs.map → sqlite3-DD2_nRRH.mjs.map} +1 -1
  58. package/dist/transport.manager-C3Xr7Tvi.js +1925 -0
  59. package/dist/transport.manager-C3Xr7Tvi.js.map +1 -0
  60. package/dist/transport.manager-Vi__pagn.mjs +1849 -0
  61. package/dist/transport.manager-Vi__pagn.mjs.map +1 -0
  62. package/dist/transports.d.mts +409 -0
  63. package/dist/transports.d.mts.map +1 -0
  64. package/dist/transports.d.ts +409 -0
  65. package/dist/transports.d.ts.map +1 -0
  66. package/dist/transports.js +11 -0
  67. package/dist/transports.mjs +3 -0
  68. package/package.json +19 -3
package/README.md CHANGED
@@ -12,6 +12,14 @@
12
12
  <a href="https://github.com/Logixia/logixia/actions/workflows/ci.yml"><img src="https://github.com/Logixia/logixia/actions/workflows/ci.yml/badge.svg" alt="CI"/></a>
13
13
  <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="MIT"/></a>
14
14
  <a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-5.0%2B-blue" alt="TypeScript"/></a>
15
+ <a href="https://logixia.github.io/logixia/"><img src="https://img.shields.io/badge/website-logixia.github.io-a855f7" alt="website"/></a>
16
+ </p>
17
+
18
+ <p align="center">
19
+ <a href="https://logixia.github.io/logixia/"><strong>Website</strong></a> &middot;
20
+ <a href="https://github.com/Logixia/logixia">GitHub</a> &middot;
21
+ <a href="https://www.npmjs.com/package/logixia">npm</a> &middot;
22
+ <a href="https://github.com/Logixia/logixia/issues">Issues</a>
15
23
  </p>
16
24
 
17
25
  ---
@@ -533,4 +533,4 @@ async function open(config) {
533
533
 
534
534
  //#endregion
535
535
  exports.open = open;
536
- //# sourceMappingURL=build-DIEB3doa.js.map
536
+ //# sourceMappingURL=build-DOx-YxF1.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-DIEB3doa.js","names":["format_error_1","Database","path","Database"],"sources":["../node_modules/sqlite/build/utils/format-error.js","../node_modules/sqlite/build/Statement.js","../node_modules/sqlite/build/utils/migrate.js","../node_modules/sqlite/build/utils/strings.js","../node_modules/sqlite/build/Database.js","../node_modules/sqlite/build/index.mjs"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.formatError = void 0;\nfunction formatError(err) {\n if (err instanceof Error) {\n return err;\n }\n if (typeof err === 'object') {\n const newError = new Error();\n for (let prop in err) {\n newError[prop] = err[prop];\n }\n // message isn't part of the enumerable set\n if (err.message) {\n newError.message = err.message;\n }\n return newError;\n }\n if (typeof err === 'string') {\n return new Error(err);\n }\n return new Error(err);\n}\nexports.formatError = formatError;\n//# sourceMappingURL=format-error.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Statement = void 0;\nconst format_error_1 = require(\"./utils/format-error\");\n/**\n * Promisified wrapper for the sqlite3#Statement interface.\n */\nclass Statement {\n constructor(stmt) {\n this.stmt = stmt;\n }\n /**\n * Returns the underlying sqlite3 Statement instance\n */\n getStatementInstance() {\n return this.stmt;\n }\n /**\n * Binds parameters to the prepared statement.\n *\n * Binding parameters with this function completely resets the statement object and row cursor\n * and removes all previously bound parameters, if any.\n */\n bind(...params) {\n return new Promise((resolve, reject) => {\n this.stmt.bind(...params, err => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve();\n });\n });\n }\n /**\n * Resets the row cursor of the statement and preserves the parameter bindings.\n * Use this function to re-execute the same query with the same bindings.\n */\n reset() {\n return new Promise(resolve => {\n this.stmt.reset(() => {\n resolve();\n });\n });\n }\n /**\n * Finalizes the statement. This is typically optional, but if you experience long delays before\n * the next query is executed, explicitly finalizing your statement might be necessary.\n * This might be the case when you run an exclusive query (see section Control Flow).\n * After the statement is finalized, all further function calls on that statement object\n * will throw errors.\n */\n finalize() {\n return new Promise((resolve, reject) => {\n this.stmt.finalize(err => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve();\n });\n });\n }\n /**\n * Binds parameters and executes the statement.\n *\n * If you specify bind parameters, they will be bound to the statement before it is executed.\n * Note that the bindings and the row cursor are reset when you specify even a single bind parameter.\n *\n * The execution behavior is identical to the Database#run method with the difference that the\n * statement will not be finalized after it is run. This means you can run it multiple times.\n *\n * @param {any} [params, ...] When the SQL statement contains placeholders, you\n * can pass them in here. They will be bound to the statement before it is\n * executed. There are three ways of passing bind parameters: directly in\n * the function's arguments, as an array, and as an object for named\n * parameters. This automatically sanitizes inputs.\n */\n run(...params) {\n return new Promise((resolve, reject) => {\n const stmt = this;\n this.stmt.run(...params, function (err) {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve({\n stmt,\n lastID: this.lastID,\n changes: this.changes\n });\n });\n });\n }\n /**\n * Binds parameters, executes the statement and retrieves the first result row.\n * The parameters are the same as the Statement#run function, with the following differences:\n *\n * Using this method can leave the database locked, as the database awaits further\n * calls to Statement#get to retrieve subsequent rows. To inform the database that you\n * are finished retrieving rows, you should either finalize (with Statement#finalize)\n * or reset (with Statement#reset) the statement.\n *\n * @param {any} [params, ...] When the SQL statement contains placeholders, you\n * can pass them in here. They will be bound to the statement before it is\n * executed. There are three ways of passing bind parameters: directly in\n * the function's arguments, as an array, and as an object for named\n * parameters. This automatically sanitizes inputs.\n */\n get(...params) {\n return new Promise((resolve, reject) => {\n this.stmt.get(...params, (err, row) => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve(row);\n });\n });\n }\n /**\n * Binds parameters, executes the statement and calls the callback with all result rows.\n * The parameters are the same as the Statement#run function, with the following differences:\n *\n * If the result set is empty, it will resolve to an empty array, otherwise it contains an\n * object for each result row which in turn contains the values of that row.\n * Like with Statement#run, the statement will not be finalized after executing this function.\n *\n * @param {any} [params, ...] When the SQL statement contains placeholders, you\n * can pass them in here. They will be bound to the statement before it is\n * executed. There are three ways of passing bind parameters: directly in\n * the function's arguments, as an array, and as an object for named\n * parameters. This automatically sanitizes inputs.\n *\n * @see https://github.com/mapbox/node-sqlite3/wiki/API#databaseallsql-param--callback\n */\n all(...params) {\n return new Promise((resolve, reject) => {\n this.stmt.all(...params, (err, rows) => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve(rows);\n });\n });\n }\n each(...params) {\n return new Promise((resolve, reject) => {\n const callback = params.pop();\n if (!callback || typeof callback !== 'function') {\n throw new Error('sqlite: Last param of Statement#each() must be a callback function');\n }\n if (params.length > 0) {\n const positional = params.pop();\n if (typeof positional === 'function') {\n throw new Error('sqlite: Statement#each() should only have a single callback defined. See readme for usage.');\n }\n params.push(positional);\n }\n this.stmt.each(...params, (err, row) => {\n if (err) {\n return callback((0, format_error_1.formatError)(err), null);\n }\n callback(null, row);\n }, (err, count) => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve(count);\n });\n });\n }\n}\nexports.Statement = Statement;\n//# sourceMappingURL=Statement.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.migrate = exports.readMigrations = void 0;\nconst fs = require(\"fs\");\nconst path = require(\"path\");\nasync function readMigrations(migrationPath) {\n const migrationsPath = migrationPath || path.join(process.cwd(), 'migrations');\n const location = path.resolve(migrationsPath);\n // Get the list of migration files, for example:\n // { id: 1, name: 'initial', filename: '001-initial.sql' }\n // { id: 2, name: 'feature', filename: '002-feature.sql' }\n const migrationFiles = await new Promise((resolve, reject) => {\n fs.readdir(location, (err, files) => {\n if (err) {\n return reject(err);\n }\n resolve(files\n .map(x => x.match(/^(\\d+).(.*?)\\.sql$/))\n .filter(x => x !== null)\n .map(x => ({ id: Number(x[1]), name: x[2], filename: x[0] }))\n .sort((a, b) => Math.sign(a.id - b.id)));\n });\n });\n if (!migrationFiles.length) {\n throw new Error(`No migration files found in '${location}'.`);\n }\n // Get the list of migrations, for example:\n // { id: 1, name: 'initial', filename: '001-initial.sql', up: ..., down: ... }\n // { id: 2, name: 'feature', filename: '002-feature.sql', up: ..., down: ... }\n return Promise.all(migrationFiles.map(migration => new Promise((resolve, reject) => {\n const filename = path.join(location, migration.filename);\n fs.readFile(filename, 'utf-8', (err, data) => {\n if (err) {\n return reject(err);\n }\n const [up, down] = data.split(/^--\\s+?down\\b/im);\n const migrationData = migration;\n migrationData.up = up.replace(/^-- .*?$/gm, '').trim(); // Remove comments\n migrationData.down = down ? down.trim() : ''; // and trim whitespaces\n resolve(migrationData);\n });\n })));\n}\nexports.readMigrations = readMigrations;\n/**\n * Migrates database schema to the latest version\n */\nasync function migrate(db, config = {}) {\n config.force = config.force || false;\n config.table = config.table || 'migrations';\n const { force, table } = config;\n const migrations = config.migrations\n ? config.migrations\n : await readMigrations(config.migrationsPath);\n // Create a database table for migrations meta data if it doesn't exist\n await db.run(`CREATE TABLE IF NOT EXISTS \"${table}\" (\n id INTEGER PRIMARY KEY,\n name TEXT NOT NULL,\n up TEXT NOT NULL,\n down TEXT NOT NULL\n)`);\n // Get the list of already applied migrations\n let dbMigrations = await db.all(`SELECT id, name, up, down FROM \"${table}\" ORDER BY id ASC`);\n // Undo migrations that exist only in the database but not in files,\n // also undo the last migration if the `force` option is enabled.\n const lastMigration = migrations[migrations.length - 1];\n for (const migration of dbMigrations\n .slice()\n .sort((a, b) => Math.sign(b.id - a.id))) {\n if (!migrations.some(x => x.id === migration.id) ||\n (force && migration.id === lastMigration.id)) {\n await db.run('BEGIN');\n try {\n await db.exec(migration.down);\n await db.run(`DELETE FROM \"${table}\" WHERE id = ?`, migration.id);\n await db.run('COMMIT');\n dbMigrations = dbMigrations.filter(x => x.id !== migration.id);\n }\n catch (err) {\n await db.run('ROLLBACK');\n throw err;\n }\n }\n else {\n break;\n }\n }\n // Apply pending migrations\n const lastMigrationId = dbMigrations.length\n ? dbMigrations[dbMigrations.length - 1].id\n : 0;\n for (const migration of migrations) {\n if (migration.id > lastMigrationId) {\n await db.run('BEGIN');\n try {\n await db.exec(migration.up);\n await db.run(`INSERT INTO \"${table}\" (id, name, up, down) VALUES (?, ?, ?, ?)`, migration.id, migration.name, migration.up, migration.down);\n await db.run('COMMIT');\n }\n catch (err) {\n await db.run('ROLLBACK');\n throw err;\n }\n }\n }\n}\nexports.migrate = migrate;\n//# sourceMappingURL=migrate.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toSqlParams = void 0;\n/**\n * Allows for using strings and `sql-template-strings`. Converts both to a\n * format that's usable by the SQL methods\n *\n * @param sql A SQL string or `sql-template-strings` object\n * @param params An array of parameters\n */\nfunction toSqlParams(sql, params = []) {\n if (typeof sql === 'string') {\n return {\n sql,\n params\n };\n }\n return {\n sql: sql.sql,\n params: sql.values\n };\n}\nexports.toSqlParams = toSqlParams;\n//# sourceMappingURL=strings.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Database = void 0;\nconst Statement_1 = require(\"./Statement\");\nconst migrate_1 = require(\"./utils/migrate\");\nconst strings_1 = require(\"./utils/strings\");\nconst format_error_1 = require(\"./utils/format-error\");\n/**\n * Promisified wrapper for the sqlite3#Database interface.\n */\nclass Database {\n constructor(config) {\n this.config = config;\n this.db = null;\n }\n /**\n * Event handler when verbose mode is enabled.\n * @see https://github.com/mapbox/node-sqlite3/wiki/Debugging\n */\n on(event, listener) {\n this.db.on(event, listener);\n }\n /**\n * Returns the underlying sqlite3 Database instance\n */\n getDatabaseInstance() {\n return this.db;\n }\n /**\n * Opens the database\n */\n open() {\n return new Promise((resolve, reject) => {\n let { filename, mode, driver } = this.config;\n // https://github.com/mapbox/node-sqlite3/wiki/API#new-sqlite3databasefilename-mode-callback\n if (filename === null || filename === undefined) {\n throw new Error('sqlite: filename cannot be null / undefined');\n }\n if (!driver) {\n throw new Error('sqlite: driver is not defined');\n }\n if (mode) {\n this.db = new driver(filename, mode, err => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve();\n });\n }\n else {\n this.db = new driver(filename, err => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve();\n });\n }\n });\n }\n /**\n * Closes the database.\n */\n close() {\n return new Promise((resolve, reject) => {\n this.db.close(err => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve();\n });\n });\n }\n /**\n * @see https://github.com/mapbox/node-sqlite3/wiki/API#databaseconfigureoption-value\n */\n configure(option, value) {\n this.db.configure(option, value);\n }\n /**\n * Runs the SQL query with the specified parameters. It does not retrieve any result data.\n * The function returns the Database object for which it was called to allow for function chaining.\n *\n * @param {string} sql The SQL query to run.\n *\n * @param {any} [params, ...] When the SQL statement contains placeholders, you\n * can pass them in here. They will be bound to the statement before it is\n * executed. There are three ways of passing bind parameters: directly in\n * the function's arguments, as an array, and as an object for named\n * parameters. This automatically sanitizes inputs.\n *\n * @see https://github.com/mapbox/node-sqlite3/wiki/API#databaserunsql-param--callback\n */\n run(sql, ...params) {\n return new Promise((resolve, reject) => {\n const sqlObj = (0, strings_1.toSqlParams)(sql, params);\n this.db.run(sqlObj.sql, ...sqlObj.params, function (err) {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve({\n stmt: new Statement_1.Statement(this.stmt),\n lastID: this.lastID,\n changes: this.changes\n });\n });\n });\n }\n /**\n * Runs the SQL query with the specified parameters and resolves with\n * with the first result row afterwards. If the result set is empty, returns undefined.\n *\n * The property names correspond to the column names of the result set.\n * It is impossible to access them by column index; the only supported way is by column name.\n *\n * @param {string} sql The SQL query to run.\n *\n * @param {any} [params, ...] When the SQL statement contains placeholders, you\n * can pass them in here. They will be bound to the statement before it is\n * executed. There are three ways of passing bind parameters: directly in\n * the function's arguments, as an array, and as an object for named\n * parameters. This automatically sanitizes inputs.\n *\n * @see https://github.com/mapbox/node-sqlite3/wiki/API#databasegetsql-param--callback\n */\n get(sql, ...params) {\n return new Promise((resolve, reject) => {\n const sqlObj = (0, strings_1.toSqlParams)(sql, params);\n this.db.get(sqlObj.sql, ...sqlObj.params, (err, row) => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve(row);\n });\n });\n }\n each(sql, ...params) {\n return new Promise((resolve, reject) => {\n const callback = params.pop();\n if (!callback || typeof callback !== 'function') {\n throw new Error('sqlite: Last param of Database#each() must be a callback function');\n }\n if (params.length > 0) {\n const positional = params.pop();\n if (typeof positional === 'function') {\n throw new Error('sqlite: Database#each() should only have a single callback defined. See readme for usage.');\n }\n params.push(positional);\n }\n const sqlObj = (0, strings_1.toSqlParams)(sql, params);\n this.db.each(sqlObj.sql, ...sqlObj.params, (err, row) => {\n if (err) {\n return callback((0, format_error_1.formatError)(err), null);\n }\n callback(null, row);\n }, (err, count) => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve(count);\n });\n });\n }\n /**\n * Runs the SQL query with the specified parameters. The parameters are the same as the\n * Database#run function, with the following differences:\n *\n * If the result set is empty, it will be an empty array, otherwise it will\n * have an object for each result row which\n * in turn contains the values of that row, like the Database#get function.\n *\n * Note that it first retrieves all result rows and stores them in memory.\n * For queries that have potentially large result sets, use the Database#each\n * function to retrieve all rows or Database#prepare followed by multiple\n * Statement#get calls to retrieve a previously unknown amount of rows.\n *\n * @param {string} sql The SQL query to run.\n *\n * @param {any} [params, ...] When the SQL statement contains placeholders, you\n * can pass them in here. They will be bound to the statement before it is\n * executed. There are three ways of passing bind parameters: directly in\n * the function's arguments, as an array, and as an object for named\n * parameters. This automatically sanitizes inputs.\n *\n * @see https://github.com/mapbox/node-sqlite3/wiki/API#databaseallsql-param--callback\n */\n all(sql, ...params) {\n return new Promise((resolve, reject) => {\n const sqlObj = (0, strings_1.toSqlParams)(sql, params);\n this.db.all(sqlObj.sql, ...sqlObj.params, (err, rows) => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve(rows);\n });\n });\n }\n /**\n * Runs all SQL queries in the supplied string. No result rows are retrieved. If a query fails,\n * no subsequent statements will be executed (wrap it in a transaction if you want all\n * or none to be executed).\n *\n * Note: This function will only execute statements up to the first NULL byte.\n * Comments are not allowed and will lead to runtime errors.\n *\n * @param {string} sql The SQL query to run.\n * @see https://github.com/mapbox/node-sqlite3/wiki/API#databaseexecsql-callback\n */\n exec(sql) {\n return new Promise((resolve, reject) => {\n const sqlObj = (0, strings_1.toSqlParams)(sql);\n this.db.exec(sqlObj.sql, err => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve();\n });\n });\n }\n /**\n * Prepares the SQL statement and optionally binds the specified parameters.\n * When bind parameters are supplied, they are bound to the prepared statement.\n *\n * @param {string} sql The SQL query to run.\n * @param {any} [params, ...] When the SQL statement contains placeholders, you\n * can pass them in here. They will be bound to the statement before it is\n * executed. There are three ways of passing bind parameters: directly in\n * the function's arguments, as an array, and as an object for named\n * parameters. This automatically sanitizes inputs.\n * @returns Promise<Statement> Statement object\n */\n prepare(sql, ...params) {\n return new Promise((resolve, reject) => {\n const sqlObj = (0, strings_1.toSqlParams)(sql, params);\n const stmt = this.db.prepare(sqlObj.sql, ...sqlObj.params, err => {\n if (err) {\n return reject(err);\n }\n resolve(new Statement_1.Statement(stmt));\n });\n });\n }\n /**\n * Loads a compiled SQLite extension into the database connection object.\n *\n * @param {string} path Filename of the extension to load\n */\n loadExtension(path) {\n return new Promise((resolve, reject) => {\n this.db.loadExtension(path, err => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve();\n });\n });\n }\n /**\n * Performs a database migration.\n */\n async migrate(config) {\n await (0, migrate_1.migrate)(this, config);\n }\n /**\n * The methods underneath requires creative work to implement. PRs / proposals accepted!\n */\n /*\n * Unsure if serialize can be made into a promise.\n */\n serialize() {\n throw new Error('sqlite: Currently not implemented. Use getDatabaseInstance().serialize() instead.');\n }\n /*\n * Unsure if parallelize can be made into a promise.\n */\n parallelize() {\n throw new Error('sqlite: Currently not implemented. Use getDatabaseInstance().parallelize() instead.');\n }\n}\nexports.Database = Database;\n//# sourceMappingURL=Database.js.map","export * from \"./Statement.js\";\nexport * from \"./Database.js\";\nimport Database from \"./Database.js\";\n\n/**\n * Opens a database for manipulation. Most users will call this to get started.\n */\nexport async function open(config) {\n const db = new Database.Database(config);\n await db.open();\n return db;\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5],"mappings":";;;;AACA,QAAO,eAAe,SAAS,cAAc,EAAE,OAAO,MAAM,CAAC;AAC7D,SAAQ,cAAc,KAA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,QAAQ;CACjC,MAAM,KAAK,IAAIE,wBAAS,SAAS,OAAO;AACxC,OAAM,GAAG,MAAM;AACf,QAAO"}
1
+ {"version":3,"file":"build-DOx-YxF1.js","names":["format_error_1","Database","path","Database"],"sources":["../node_modules/sqlite/build/utils/format-error.js","../node_modules/sqlite/build/Statement.js","../node_modules/sqlite/build/utils/migrate.js","../node_modules/sqlite/build/utils/strings.js","../node_modules/sqlite/build/Database.js","../node_modules/sqlite/build/index.mjs"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.formatError = void 0;\nfunction formatError(err) {\n if (err instanceof Error) {\n return err;\n }\n if (typeof err === 'object') {\n const newError = new Error();\n for (let prop in err) {\n newError[prop] = err[prop];\n }\n // message isn't part of the enumerable set\n if (err.message) {\n newError.message = err.message;\n }\n return newError;\n }\n if (typeof err === 'string') {\n return new Error(err);\n }\n return new Error(err);\n}\nexports.formatError = formatError;\n//# sourceMappingURL=format-error.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Statement = void 0;\nconst format_error_1 = require(\"./utils/format-error\");\n/**\n * Promisified wrapper for the sqlite3#Statement interface.\n */\nclass Statement {\n constructor(stmt) {\n this.stmt = stmt;\n }\n /**\n * Returns the underlying sqlite3 Statement instance\n */\n getStatementInstance() {\n return this.stmt;\n }\n /**\n * Binds parameters to the prepared statement.\n *\n * Binding parameters with this function completely resets the statement object and row cursor\n * and removes all previously bound parameters, if any.\n */\n bind(...params) {\n return new Promise((resolve, reject) => {\n this.stmt.bind(...params, err => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve();\n });\n });\n }\n /**\n * Resets the row cursor of the statement and preserves the parameter bindings.\n * Use this function to re-execute the same query with the same bindings.\n */\n reset() {\n return new Promise(resolve => {\n this.stmt.reset(() => {\n resolve();\n });\n });\n }\n /**\n * Finalizes the statement. This is typically optional, but if you experience long delays before\n * the next query is executed, explicitly finalizing your statement might be necessary.\n * This might be the case when you run an exclusive query (see section Control Flow).\n * After the statement is finalized, all further function calls on that statement object\n * will throw errors.\n */\n finalize() {\n return new Promise((resolve, reject) => {\n this.stmt.finalize(err => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve();\n });\n });\n }\n /**\n * Binds parameters and executes the statement.\n *\n * If you specify bind parameters, they will be bound to the statement before it is executed.\n * Note that the bindings and the row cursor are reset when you specify even a single bind parameter.\n *\n * The execution behavior is identical to the Database#run method with the difference that the\n * statement will not be finalized after it is run. This means you can run it multiple times.\n *\n * @param {any} [params, ...] When the SQL statement contains placeholders, you\n * can pass them in here. They will be bound to the statement before it is\n * executed. There are three ways of passing bind parameters: directly in\n * the function's arguments, as an array, and as an object for named\n * parameters. This automatically sanitizes inputs.\n */\n run(...params) {\n return new Promise((resolve, reject) => {\n const stmt = this;\n this.stmt.run(...params, function (err) {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve({\n stmt,\n lastID: this.lastID,\n changes: this.changes\n });\n });\n });\n }\n /**\n * Binds parameters, executes the statement and retrieves the first result row.\n * The parameters are the same as the Statement#run function, with the following differences:\n *\n * Using this method can leave the database locked, as the database awaits further\n * calls to Statement#get to retrieve subsequent rows. To inform the database that you\n * are finished retrieving rows, you should either finalize (with Statement#finalize)\n * or reset (with Statement#reset) the statement.\n *\n * @param {any} [params, ...] When the SQL statement contains placeholders, you\n * can pass them in here. They will be bound to the statement before it is\n * executed. There are three ways of passing bind parameters: directly in\n * the function's arguments, as an array, and as an object for named\n * parameters. This automatically sanitizes inputs.\n */\n get(...params) {\n return new Promise((resolve, reject) => {\n this.stmt.get(...params, (err, row) => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve(row);\n });\n });\n }\n /**\n * Binds parameters, executes the statement and calls the callback with all result rows.\n * The parameters are the same as the Statement#run function, with the following differences:\n *\n * If the result set is empty, it will resolve to an empty array, otherwise it contains an\n * object for each result row which in turn contains the values of that row.\n * Like with Statement#run, the statement will not be finalized after executing this function.\n *\n * @param {any} [params, ...] When the SQL statement contains placeholders, you\n * can pass them in here. They will be bound to the statement before it is\n * executed. There are three ways of passing bind parameters: directly in\n * the function's arguments, as an array, and as an object for named\n * parameters. This automatically sanitizes inputs.\n *\n * @see https://github.com/mapbox/node-sqlite3/wiki/API#databaseallsql-param--callback\n */\n all(...params) {\n return new Promise((resolve, reject) => {\n this.stmt.all(...params, (err, rows) => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve(rows);\n });\n });\n }\n each(...params) {\n return new Promise((resolve, reject) => {\n const callback = params.pop();\n if (!callback || typeof callback !== 'function') {\n throw new Error('sqlite: Last param of Statement#each() must be a callback function');\n }\n if (params.length > 0) {\n const positional = params.pop();\n if (typeof positional === 'function') {\n throw new Error('sqlite: Statement#each() should only have a single callback defined. See readme for usage.');\n }\n params.push(positional);\n }\n this.stmt.each(...params, (err, row) => {\n if (err) {\n return callback((0, format_error_1.formatError)(err), null);\n }\n callback(null, row);\n }, (err, count) => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve(count);\n });\n });\n }\n}\nexports.Statement = Statement;\n//# sourceMappingURL=Statement.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.migrate = exports.readMigrations = void 0;\nconst fs = require(\"fs\");\nconst path = require(\"path\");\nasync function readMigrations(migrationPath) {\n const migrationsPath = migrationPath || path.join(process.cwd(), 'migrations');\n const location = path.resolve(migrationsPath);\n // Get the list of migration files, for example:\n // { id: 1, name: 'initial', filename: '001-initial.sql' }\n // { id: 2, name: 'feature', filename: '002-feature.sql' }\n const migrationFiles = await new Promise((resolve, reject) => {\n fs.readdir(location, (err, files) => {\n if (err) {\n return reject(err);\n }\n resolve(files\n .map(x => x.match(/^(\\d+).(.*?)\\.sql$/))\n .filter(x => x !== null)\n .map(x => ({ id: Number(x[1]), name: x[2], filename: x[0] }))\n .sort((a, b) => Math.sign(a.id - b.id)));\n });\n });\n if (!migrationFiles.length) {\n throw new Error(`No migration files found in '${location}'.`);\n }\n // Get the list of migrations, for example:\n // { id: 1, name: 'initial', filename: '001-initial.sql', up: ..., down: ... }\n // { id: 2, name: 'feature', filename: '002-feature.sql', up: ..., down: ... }\n return Promise.all(migrationFiles.map(migration => new Promise((resolve, reject) => {\n const filename = path.join(location, migration.filename);\n fs.readFile(filename, 'utf-8', (err, data) => {\n if (err) {\n return reject(err);\n }\n const [up, down] = data.split(/^--\\s+?down\\b/im);\n const migrationData = migration;\n migrationData.up = up.replace(/^-- .*?$/gm, '').trim(); // Remove comments\n migrationData.down = down ? down.trim() : ''; // and trim whitespaces\n resolve(migrationData);\n });\n })));\n}\nexports.readMigrations = readMigrations;\n/**\n * Migrates database schema to the latest version\n */\nasync function migrate(db, config = {}) {\n config.force = config.force || false;\n config.table = config.table || 'migrations';\n const { force, table } = config;\n const migrations = config.migrations\n ? config.migrations\n : await readMigrations(config.migrationsPath);\n // Create a database table for migrations meta data if it doesn't exist\n await db.run(`CREATE TABLE IF NOT EXISTS \"${table}\" (\n id INTEGER PRIMARY KEY,\n name TEXT NOT NULL,\n up TEXT NOT NULL,\n down TEXT NOT NULL\n)`);\n // Get the list of already applied migrations\n let dbMigrations = await db.all(`SELECT id, name, up, down FROM \"${table}\" ORDER BY id ASC`);\n // Undo migrations that exist only in the database but not in files,\n // also undo the last migration if the `force` option is enabled.\n const lastMigration = migrations[migrations.length - 1];\n for (const migration of dbMigrations\n .slice()\n .sort((a, b) => Math.sign(b.id - a.id))) {\n if (!migrations.some(x => x.id === migration.id) ||\n (force && migration.id === lastMigration.id)) {\n await db.run('BEGIN');\n try {\n await db.exec(migration.down);\n await db.run(`DELETE FROM \"${table}\" WHERE id = ?`, migration.id);\n await db.run('COMMIT');\n dbMigrations = dbMigrations.filter(x => x.id !== migration.id);\n }\n catch (err) {\n await db.run('ROLLBACK');\n throw err;\n }\n }\n else {\n break;\n }\n }\n // Apply pending migrations\n const lastMigrationId = dbMigrations.length\n ? dbMigrations[dbMigrations.length - 1].id\n : 0;\n for (const migration of migrations) {\n if (migration.id > lastMigrationId) {\n await db.run('BEGIN');\n try {\n await db.exec(migration.up);\n await db.run(`INSERT INTO \"${table}\" (id, name, up, down) VALUES (?, ?, ?, ?)`, migration.id, migration.name, migration.up, migration.down);\n await db.run('COMMIT');\n }\n catch (err) {\n await db.run('ROLLBACK');\n throw err;\n }\n }\n }\n}\nexports.migrate = migrate;\n//# sourceMappingURL=migrate.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toSqlParams = void 0;\n/**\n * Allows for using strings and `sql-template-strings`. Converts both to a\n * format that's usable by the SQL methods\n *\n * @param sql A SQL string or `sql-template-strings` object\n * @param params An array of parameters\n */\nfunction toSqlParams(sql, params = []) {\n if (typeof sql === 'string') {\n return {\n sql,\n params\n };\n }\n return {\n sql: sql.sql,\n params: sql.values\n };\n}\nexports.toSqlParams = toSqlParams;\n//# sourceMappingURL=strings.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Database = void 0;\nconst Statement_1 = require(\"./Statement\");\nconst migrate_1 = require(\"./utils/migrate\");\nconst strings_1 = require(\"./utils/strings\");\nconst format_error_1 = require(\"./utils/format-error\");\n/**\n * Promisified wrapper for the sqlite3#Database interface.\n */\nclass Database {\n constructor(config) {\n this.config = config;\n this.db = null;\n }\n /**\n * Event handler when verbose mode is enabled.\n * @see https://github.com/mapbox/node-sqlite3/wiki/Debugging\n */\n on(event, listener) {\n this.db.on(event, listener);\n }\n /**\n * Returns the underlying sqlite3 Database instance\n */\n getDatabaseInstance() {\n return this.db;\n }\n /**\n * Opens the database\n */\n open() {\n return new Promise((resolve, reject) => {\n let { filename, mode, driver } = this.config;\n // https://github.com/mapbox/node-sqlite3/wiki/API#new-sqlite3databasefilename-mode-callback\n if (filename === null || filename === undefined) {\n throw new Error('sqlite: filename cannot be null / undefined');\n }\n if (!driver) {\n throw new Error('sqlite: driver is not defined');\n }\n if (mode) {\n this.db = new driver(filename, mode, err => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve();\n });\n }\n else {\n this.db = new driver(filename, err => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve();\n });\n }\n });\n }\n /**\n * Closes the database.\n */\n close() {\n return new Promise((resolve, reject) => {\n this.db.close(err => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve();\n });\n });\n }\n /**\n * @see https://github.com/mapbox/node-sqlite3/wiki/API#databaseconfigureoption-value\n */\n configure(option, value) {\n this.db.configure(option, value);\n }\n /**\n * Runs the SQL query with the specified parameters. It does not retrieve any result data.\n * The function returns the Database object for which it was called to allow for function chaining.\n *\n * @param {string} sql The SQL query to run.\n *\n * @param {any} [params, ...] When the SQL statement contains placeholders, you\n * can pass them in here. They will be bound to the statement before it is\n * executed. There are three ways of passing bind parameters: directly in\n * the function's arguments, as an array, and as an object for named\n * parameters. This automatically sanitizes inputs.\n *\n * @see https://github.com/mapbox/node-sqlite3/wiki/API#databaserunsql-param--callback\n */\n run(sql, ...params) {\n return new Promise((resolve, reject) => {\n const sqlObj = (0, strings_1.toSqlParams)(sql, params);\n this.db.run(sqlObj.sql, ...sqlObj.params, function (err) {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve({\n stmt: new Statement_1.Statement(this.stmt),\n lastID: this.lastID,\n changes: this.changes\n });\n });\n });\n }\n /**\n * Runs the SQL query with the specified parameters and resolves with\n * with the first result row afterwards. If the result set is empty, returns undefined.\n *\n * The property names correspond to the column names of the result set.\n * It is impossible to access them by column index; the only supported way is by column name.\n *\n * @param {string} sql The SQL query to run.\n *\n * @param {any} [params, ...] When the SQL statement contains placeholders, you\n * can pass them in here. They will be bound to the statement before it is\n * executed. There are three ways of passing bind parameters: directly in\n * the function's arguments, as an array, and as an object for named\n * parameters. This automatically sanitizes inputs.\n *\n * @see https://github.com/mapbox/node-sqlite3/wiki/API#databasegetsql-param--callback\n */\n get(sql, ...params) {\n return new Promise((resolve, reject) => {\n const sqlObj = (0, strings_1.toSqlParams)(sql, params);\n this.db.get(sqlObj.sql, ...sqlObj.params, (err, row) => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve(row);\n });\n });\n }\n each(sql, ...params) {\n return new Promise((resolve, reject) => {\n const callback = params.pop();\n if (!callback || typeof callback !== 'function') {\n throw new Error('sqlite: Last param of Database#each() must be a callback function');\n }\n if (params.length > 0) {\n const positional = params.pop();\n if (typeof positional === 'function') {\n throw new Error('sqlite: Database#each() should only have a single callback defined. See readme for usage.');\n }\n params.push(positional);\n }\n const sqlObj = (0, strings_1.toSqlParams)(sql, params);\n this.db.each(sqlObj.sql, ...sqlObj.params, (err, row) => {\n if (err) {\n return callback((0, format_error_1.formatError)(err), null);\n }\n callback(null, row);\n }, (err, count) => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve(count);\n });\n });\n }\n /**\n * Runs the SQL query with the specified parameters. The parameters are the same as the\n * Database#run function, with the following differences:\n *\n * If the result set is empty, it will be an empty array, otherwise it will\n * have an object for each result row which\n * in turn contains the values of that row, like the Database#get function.\n *\n * Note that it first retrieves all result rows and stores them in memory.\n * For queries that have potentially large result sets, use the Database#each\n * function to retrieve all rows or Database#prepare followed by multiple\n * Statement#get calls to retrieve a previously unknown amount of rows.\n *\n * @param {string} sql The SQL query to run.\n *\n * @param {any} [params, ...] When the SQL statement contains placeholders, you\n * can pass them in here. They will be bound to the statement before it is\n * executed. There are three ways of passing bind parameters: directly in\n * the function's arguments, as an array, and as an object for named\n * parameters. This automatically sanitizes inputs.\n *\n * @see https://github.com/mapbox/node-sqlite3/wiki/API#databaseallsql-param--callback\n */\n all(sql, ...params) {\n return new Promise((resolve, reject) => {\n const sqlObj = (0, strings_1.toSqlParams)(sql, params);\n this.db.all(sqlObj.sql, ...sqlObj.params, (err, rows) => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve(rows);\n });\n });\n }\n /**\n * Runs all SQL queries in the supplied string. No result rows are retrieved. If a query fails,\n * no subsequent statements will be executed (wrap it in a transaction if you want all\n * or none to be executed).\n *\n * Note: This function will only execute statements up to the first NULL byte.\n * Comments are not allowed and will lead to runtime errors.\n *\n * @param {string} sql The SQL query to run.\n * @see https://github.com/mapbox/node-sqlite3/wiki/API#databaseexecsql-callback\n */\n exec(sql) {\n return new Promise((resolve, reject) => {\n const sqlObj = (0, strings_1.toSqlParams)(sql);\n this.db.exec(sqlObj.sql, err => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve();\n });\n });\n }\n /**\n * Prepares the SQL statement and optionally binds the specified parameters.\n * When bind parameters are supplied, they are bound to the prepared statement.\n *\n * @param {string} sql The SQL query to run.\n * @param {any} [params, ...] When the SQL statement contains placeholders, you\n * can pass them in here. They will be bound to the statement before it is\n * executed. There are three ways of passing bind parameters: directly in\n * the function's arguments, as an array, and as an object for named\n * parameters. This automatically sanitizes inputs.\n * @returns Promise<Statement> Statement object\n */\n prepare(sql, ...params) {\n return new Promise((resolve, reject) => {\n const sqlObj = (0, strings_1.toSqlParams)(sql, params);\n const stmt = this.db.prepare(sqlObj.sql, ...sqlObj.params, err => {\n if (err) {\n return reject(err);\n }\n resolve(new Statement_1.Statement(stmt));\n });\n });\n }\n /**\n * Loads a compiled SQLite extension into the database connection object.\n *\n * @param {string} path Filename of the extension to load\n */\n loadExtension(path) {\n return new Promise((resolve, reject) => {\n this.db.loadExtension(path, err => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve();\n });\n });\n }\n /**\n * Performs a database migration.\n */\n async migrate(config) {\n await (0, migrate_1.migrate)(this, config);\n }\n /**\n * The methods underneath requires creative work to implement. PRs / proposals accepted!\n */\n /*\n * Unsure if serialize can be made into a promise.\n */\n serialize() {\n throw new Error('sqlite: Currently not implemented. Use getDatabaseInstance().serialize() instead.');\n }\n /*\n * Unsure if parallelize can be made into a promise.\n */\n parallelize() {\n throw new Error('sqlite: Currently not implemented. Use getDatabaseInstance().parallelize() instead.');\n }\n}\nexports.Database = Database;\n//# sourceMappingURL=Database.js.map","export * from \"./Statement.js\";\nexport * from \"./Database.js\";\nimport Database from \"./Database.js\";\n\n/**\n * Opens a database for manipulation. Most users will call this to get started.\n */\nexport async function open(config) {\n const db = new Database.Database(config);\n await db.open();\n return db;\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5],"mappings":";;;;AACA,QAAO,eAAe,SAAS,cAAc,EAAE,OAAO,MAAM,CAAC;AAC7D,SAAQ,cAAc,KAAK;CAC3B,SAAS,YAAY,KAAK;AACtB,MAAI,eAAe,MACf,QAAO;AAEX,MAAI,OAAO,QAAQ,UAAU;GACzB,MAAM,2BAAW,IAAI,OAAO;AAC5B,QAAK,IAAI,QAAQ,IACb,UAAS,QAAQ,IAAI;AAGzB,OAAI,IAAI,QACJ,UAAS,UAAU,IAAI;AAE3B,UAAO;;AAEX,MAAI,OAAO,QAAQ,SACf,QAAO,IAAI,MAAM,IAAI;AAEzB,SAAO,IAAI,MAAM,IAAI;;AAEzB,SAAQ,cAAc;;;;;;ACtBtB,QAAO,eAAe,SAAS,cAAc,EAAE,OAAO,MAAM,CAAC;AAC7D,SAAQ,YAAY,KAAK;CACzB,MAAMA;;;;CAIN,IAAM,YAAN,MAAgB;EACZ,YAAY,MAAM;AACd,QAAK,OAAO;;;;;EAKhB,uBAAuB;AACnB,UAAO,KAAK;;;;;;;;EAQhB,KAAK,GAAG,QAAQ;AACZ,UAAO,IAAI,SAAS,SAAS,WAAW;AACpC,SAAK,KAAK,KAAK,GAAG,SAAQ,QAAO;AAC7B,SAAI,IACA,QAAO,QAAQ,GAAGA,iBAAe,aAAa,IAAI,CAAC;AAEvD,cAAS;MACX;KACJ;;;;;;EAMN,QAAQ;AACJ,UAAO,IAAI,SAAQ,YAAW;AAC1B,SAAK,KAAK,YAAY;AAClB,cAAS;MACX;KACJ;;;;;;;;;EASN,WAAW;AACP,UAAO,IAAI,SAAS,SAAS,WAAW;AACpC,SAAK,KAAK,U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M,QAAO;AAC/B,SAAI,IACA,QAAO,QAAQ,GAAG,eAAe,aAAa,IAAI,CAAC;AAEvD,cAAS;MACX;KACJ;;;;;EAKN,MAAM,QAAQ,QAAQ;AAClB,UAAO,GAAG,UAAU,SAAS,MAAM,OAAO;;;;;EAQ9C,YAAY;AACR,SAAM,IAAI,MAAM,oFAAoF;;EAKxG,cAAc;AACV,SAAM,IAAI,MAAM,sFAAsF;;;AAG9G,SAAQ,WAAWD;;;;;;;;;AC/QnB,eAAsB,KAAK,QAAQ;CACjC,MAAM,KAAK,IAAIE,wBAAS,SAAS,OAAO;AACxC,OAAM,GAAG,MAAM;AACf,QAAO"}
@@ -533,4 +533,4 @@ async function open(config) {
533
533
 
534
534
  //#endregion
535
535
  export { open };
536
- //# sourceMappingURL=build-MmD3T4bV.mjs.map
536
+ //# sourceMappingURL=build-DWmxA6A2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-MmD3T4bV.mjs","names":["format_error_1","Database","path","Database"],"sources":["../node_modules/sqlite/build/utils/format-error.js","../node_modules/sqlite/build/Statement.js","../node_modules/sqlite/build/utils/migrate.js","../node_modules/sqlite/build/utils/strings.js","../node_modules/sqlite/build/Database.js","../node_modules/sqlite/build/index.mjs"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.formatError = void 0;\nfunction formatError(err) {\n if (err instanceof Error) {\n return err;\n }\n if (typeof err === 'object') {\n const newError = new Error();\n for (let prop in err) {\n newError[prop] = err[prop];\n }\n // message isn't part of the enumerable set\n if (err.message) {\n newError.message = err.message;\n }\n return newError;\n }\n if (typeof err === 'string') {\n return new Error(err);\n }\n return new Error(err);\n}\nexports.formatError = formatError;\n//# sourceMappingURL=format-error.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Statement = void 0;\nconst format_error_1 = require(\"./utils/format-error\");\n/**\n * Promisified wrapper for the sqlite3#Statement interface.\n */\nclass Statement {\n constructor(stmt) {\n this.stmt = stmt;\n }\n /**\n * Returns the underlying sqlite3 Statement instance\n */\n getStatementInstance() {\n return this.stmt;\n }\n /**\n * Binds parameters to the prepared statement.\n *\n * Binding parameters with this function completely resets the statement object and row cursor\n * and removes all previously bound parameters, if any.\n */\n bind(...params) {\n return new Promise((resolve, reject) => {\n this.stmt.bind(...params, err => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve();\n });\n });\n }\n /**\n * Resets the row cursor of the statement and preserves the parameter bindings.\n * Use this function to re-execute the same query with the same bindings.\n */\n reset() {\n return new Promise(resolve => {\n this.stmt.reset(() => {\n resolve();\n });\n });\n }\n /**\n * Finalizes the statement. This is typically optional, but if you experience long delays before\n * the next query is executed, explicitly finalizing your statement might be necessary.\n * This might be the case when you run an exclusive query (see section Control Flow).\n * After the statement is finalized, all further function calls on that statement object\n * will throw errors.\n */\n finalize() {\n return new Promise((resolve, reject) => {\n this.stmt.finalize(err => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve();\n });\n });\n }\n /**\n * Binds parameters and executes the statement.\n *\n * If you specify bind parameters, they will be bound to the statement before it is executed.\n * Note that the bindings and the row cursor are reset when you specify even a single bind parameter.\n *\n * The execution behavior is identical to the Database#run method with the difference that the\n * statement will not be finalized after it is run. This means you can run it multiple times.\n *\n * @param {any} [params, ...] When the SQL statement contains placeholders, you\n * can pass them in here. They will be bound to the statement before it is\n * executed. There are three ways of passing bind parameters: directly in\n * the function's arguments, as an array, and as an object for named\n * parameters. This automatically sanitizes inputs.\n */\n run(...params) {\n return new Promise((resolve, reject) => {\n const stmt = this;\n this.stmt.run(...params, function (err) {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve({\n stmt,\n lastID: this.lastID,\n changes: this.changes\n });\n });\n });\n }\n /**\n * Binds parameters, executes the statement and retrieves the first result row.\n * The parameters are the same as the Statement#run function, with the following differences:\n *\n * Using this method can leave the database locked, as the database awaits further\n * calls to Statement#get to retrieve subsequent rows. To inform the database that you\n * are finished retrieving rows, you should either finalize (with Statement#finalize)\n * or reset (with Statement#reset) the statement.\n *\n * @param {any} [params, ...] When the SQL statement contains placeholders, you\n * can pass them in here. They will be bound to the statement before it is\n * executed. There are three ways of passing bind parameters: directly in\n * the function's arguments, as an array, and as an object for named\n * parameters. This automatically sanitizes inputs.\n */\n get(...params) {\n return new Promise((resolve, reject) => {\n this.stmt.get(...params, (err, row) => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve(row);\n });\n });\n }\n /**\n * Binds parameters, executes the statement and calls the callback with all result rows.\n * The parameters are the same as the Statement#run function, with the following differences:\n *\n * If the result set is empty, it will resolve to an empty array, otherwise it contains an\n * object for each result row which in turn contains the values of that row.\n * Like with Statement#run, the statement will not be finalized after executing this function.\n *\n * @param {any} [params, ...] When the SQL statement contains placeholders, you\n * can pass them in here. They will be bound to the statement before it is\n * executed. There are three ways of passing bind parameters: directly in\n * the function's arguments, as an array, and as an object for named\n * parameters. This automatically sanitizes inputs.\n *\n * @see https://github.com/mapbox/node-sqlite3/wiki/API#databaseallsql-param--callback\n */\n all(...params) {\n return new Promise((resolve, reject) => {\n this.stmt.all(...params, (err, rows) => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve(rows);\n });\n });\n }\n each(...params) {\n return new Promise((resolve, reject) => {\n const callback = params.pop();\n if (!callback || typeof callback !== 'function') {\n throw new Error('sqlite: Last param of Statement#each() must be a callback function');\n }\n if (params.length > 0) {\n const positional = params.pop();\n if (typeof positional === 'function') {\n throw new Error('sqlite: Statement#each() should only have a single callback defined. See readme for usage.');\n }\n params.push(positional);\n }\n this.stmt.each(...params, (err, row) => {\n if (err) {\n return callback((0, format_error_1.formatError)(err), null);\n }\n callback(null, row);\n }, (err, count) => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve(count);\n });\n });\n }\n}\nexports.Statement = Statement;\n//# sourceMappingURL=Statement.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.migrate = exports.readMigrations = void 0;\nconst fs = require(\"fs\");\nconst path = require(\"path\");\nasync function readMigrations(migrationPath) {\n const migrationsPath = migrationPath || path.join(process.cwd(), 'migrations');\n const location = path.resolve(migrationsPath);\n // Get the list of migration files, for example:\n // { id: 1, name: 'initial', filename: '001-initial.sql' }\n // { id: 2, name: 'feature', filename: '002-feature.sql' }\n const migrationFiles = await new Promise((resolve, reject) => {\n fs.readdir(location, (err, files) => {\n if (err) {\n return reject(err);\n }\n resolve(files\n .map(x => x.match(/^(\\d+).(.*?)\\.sql$/))\n .filter(x => x !== null)\n .map(x => ({ id: Number(x[1]), name: x[2], filename: x[0] }))\n .sort((a, b) => Math.sign(a.id - b.id)));\n });\n });\n if (!migrationFiles.length) {\n throw new Error(`No migration files found in '${location}'.`);\n }\n // Get the list of migrations, for example:\n // { id: 1, name: 'initial', filename: '001-initial.sql', up: ..., down: ... }\n // { id: 2, name: 'feature', filename: '002-feature.sql', up: ..., down: ... }\n return Promise.all(migrationFiles.map(migration => new Promise((resolve, reject) => {\n const filename = path.join(location, migration.filename);\n fs.readFile(filename, 'utf-8', (err, data) => {\n if (err) {\n return reject(err);\n }\n const [up, down] = data.split(/^--\\s+?down\\b/im);\n const migrationData = migration;\n migrationData.up = up.replace(/^-- .*?$/gm, '').trim(); // Remove comments\n migrationData.down = down ? down.trim() : ''; // and trim whitespaces\n resolve(migrationData);\n });\n })));\n}\nexports.readMigrations = readMigrations;\n/**\n * Migrates database schema to the latest version\n */\nasync function migrate(db, config = {}) {\n config.force = config.force || false;\n config.table = config.table || 'migrations';\n const { force, table } = config;\n const migrations = config.migrations\n ? config.migrations\n : await readMigrations(config.migrationsPath);\n // Create a database table for migrations meta data if it doesn't exist\n await db.run(`CREATE TABLE IF NOT EXISTS \"${table}\" (\n id INTEGER PRIMARY KEY,\n name TEXT NOT NULL,\n up TEXT NOT NULL,\n down TEXT NOT NULL\n)`);\n // Get the list of already applied migrations\n let dbMigrations = await db.all(`SELECT id, name, up, down FROM \"${table}\" ORDER BY id ASC`);\n // Undo migrations that exist only in the database but not in files,\n // also undo the last migration if the `force` option is enabled.\n const lastMigration = migrations[migrations.length - 1];\n for (const migration of dbMigrations\n .slice()\n .sort((a, b) => Math.sign(b.id - a.id))) {\n if (!migrations.some(x => x.id === migration.id) ||\n (force && migration.id === lastMigration.id)) {\n await db.run('BEGIN');\n try {\n await db.exec(migration.down);\n await db.run(`DELETE FROM \"${table}\" WHERE id = ?`, migration.id);\n await db.run('COMMIT');\n dbMigrations = dbMigrations.filter(x => x.id !== migration.id);\n }\n catch (err) {\n await db.run('ROLLBACK');\n throw err;\n }\n }\n else {\n break;\n }\n }\n // Apply pending migrations\n const lastMigrationId = dbMigrations.length\n ? dbMigrations[dbMigrations.length - 1].id\n : 0;\n for (const migration of migrations) {\n if (migration.id > lastMigrationId) {\n await db.run('BEGIN');\n try {\n await db.exec(migration.up);\n await db.run(`INSERT INTO \"${table}\" (id, name, up, down) VALUES (?, ?, ?, ?)`, migration.id, migration.name, migration.up, migration.down);\n await db.run('COMMIT');\n }\n catch (err) {\n await db.run('ROLLBACK');\n throw err;\n }\n }\n }\n}\nexports.migrate = migrate;\n//# sourceMappingURL=migrate.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toSqlParams = void 0;\n/**\n * Allows for using strings and `sql-template-strings`. Converts both to a\n * format that's usable by the SQL methods\n *\n * @param sql A SQL string or `sql-template-strings` object\n * @param params An array of parameters\n */\nfunction toSqlParams(sql, params = []) {\n if (typeof sql === 'string') {\n return {\n sql,\n params\n };\n }\n return {\n sql: sql.sql,\n params: sql.values\n };\n}\nexports.toSqlParams = toSqlParams;\n//# sourceMappingURL=strings.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Database = void 0;\nconst Statement_1 = require(\"./Statement\");\nconst migrate_1 = require(\"./utils/migrate\");\nconst strings_1 = require(\"./utils/strings\");\nconst format_error_1 = require(\"./utils/format-error\");\n/**\n * Promisified wrapper for the sqlite3#Database interface.\n */\nclass Database {\n constructor(config) {\n this.config = config;\n this.db = null;\n }\n /**\n * Event handler when verbose mode is enabled.\n * @see https://github.com/mapbox/node-sqlite3/wiki/Debugging\n */\n on(event, listener) {\n this.db.on(event, listener);\n }\n /**\n * Returns the underlying sqlite3 Database instance\n */\n getDatabaseInstance() {\n return this.db;\n }\n /**\n * Opens the database\n */\n open() {\n return new Promise((resolve, reject) => {\n let { filename, mode, driver } = this.config;\n // https://github.com/mapbox/node-sqlite3/wiki/API#new-sqlite3databasefilename-mode-callback\n if (filename === null || filename === undefined) {\n throw new Error('sqlite: filename cannot be null / undefined');\n }\n if (!driver) {\n throw new Error('sqlite: driver is not defined');\n }\n if (mode) {\n this.db = new driver(filename, mode, err => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve();\n });\n }\n else {\n this.db = new driver(filename, err => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve();\n });\n }\n });\n }\n /**\n * Closes the database.\n */\n close() {\n return new Promise((resolve, reject) => {\n this.db.close(err => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve();\n });\n });\n }\n /**\n * @see https://github.com/mapbox/node-sqlite3/wiki/API#databaseconfigureoption-value\n */\n configure(option, value) {\n this.db.configure(option, value);\n }\n /**\n * Runs the SQL query with the specified parameters. It does not retrieve any result data.\n * The function returns the Database object for which it was called to allow for function chaining.\n *\n * @param {string} sql The SQL query to run.\n *\n * @param {any} [params, ...] When the SQL statement contains placeholders, you\n * can pass them in here. They will be bound to the statement before it is\n * executed. There are three ways of passing bind parameters: directly in\n * the function's arguments, as an array, and as an object for named\n * parameters. This automatically sanitizes inputs.\n *\n * @see https://github.com/mapbox/node-sqlite3/wiki/API#databaserunsql-param--callback\n */\n run(sql, ...params) {\n return new Promise((resolve, reject) => {\n const sqlObj = (0, strings_1.toSqlParams)(sql, params);\n this.db.run(sqlObj.sql, ...sqlObj.params, function (err) {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve({\n stmt: new Statement_1.Statement(this.stmt),\n lastID: this.lastID,\n changes: this.changes\n });\n });\n });\n }\n /**\n * Runs the SQL query with the specified parameters and resolves with\n * with the first result row afterwards. If the result set is empty, returns undefined.\n *\n * The property names correspond to the column names of the result set.\n * It is impossible to access them by column index; the only supported way is by column name.\n *\n * @param {string} sql The SQL query to run.\n *\n * @param {any} [params, ...] When the SQL statement contains placeholders, you\n * can pass them in here. They will be bound to the statement before it is\n * executed. There are three ways of passing bind parameters: directly in\n * the function's arguments, as an array, and as an object for named\n * parameters. This automatically sanitizes inputs.\n *\n * @see https://github.com/mapbox/node-sqlite3/wiki/API#databasegetsql-param--callback\n */\n get(sql, ...params) {\n return new Promise((resolve, reject) => {\n const sqlObj = (0, strings_1.toSqlParams)(sql, params);\n this.db.get(sqlObj.sql, ...sqlObj.params, (err, row) => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve(row);\n });\n });\n }\n each(sql, ...params) {\n return new Promise((resolve, reject) => {\n const callback = params.pop();\n if (!callback || typeof callback !== 'function') {\n throw new Error('sqlite: Last param of Database#each() must be a callback function');\n }\n if (params.length > 0) {\n const positional = params.pop();\n if (typeof positional === 'function') {\n throw new Error('sqlite: Database#each() should only have a single callback defined. See readme for usage.');\n }\n params.push(positional);\n }\n const sqlObj = (0, strings_1.toSqlParams)(sql, params);\n this.db.each(sqlObj.sql, ...sqlObj.params, (err, row) => {\n if (err) {\n return callback((0, format_error_1.formatError)(err), null);\n }\n callback(null, row);\n }, (err, count) => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve(count);\n });\n });\n }\n /**\n * Runs the SQL query with the specified parameters. The parameters are the same as the\n * Database#run function, with the following differences:\n *\n * If the result set is empty, it will be an empty array, otherwise it will\n * have an object for each result row which\n * in turn contains the values of that row, like the Database#get function.\n *\n * Note that it first retrieves all result rows and stores them in memory.\n * For queries that have potentially large result sets, use the Database#each\n * function to retrieve all rows or Database#prepare followed by multiple\n * Statement#get calls to retrieve a previously unknown amount of rows.\n *\n * @param {string} sql The SQL query to run.\n *\n * @param {any} [params, ...] When the SQL statement contains placeholders, you\n * can pass them in here. They will be bound to the statement before it is\n * executed. There are three ways of passing bind parameters: directly in\n * the function's arguments, as an array, and as an object for named\n * parameters. This automatically sanitizes inputs.\n *\n * @see https://github.com/mapbox/node-sqlite3/wiki/API#databaseallsql-param--callback\n */\n all(sql, ...params) {\n return new Promise((resolve, reject) => {\n const sqlObj = (0, strings_1.toSqlParams)(sql, params);\n this.db.all(sqlObj.sql, ...sqlObj.params, (err, rows) => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve(rows);\n });\n });\n }\n /**\n * Runs all SQL queries in the supplied string. No result rows are retrieved. If a query fails,\n * no subsequent statements will be executed (wrap it in a transaction if you want all\n * or none to be executed).\n *\n * Note: This function will only execute statements up to the first NULL byte.\n * Comments are not allowed and will lead to runtime errors.\n *\n * @param {string} sql The SQL query to run.\n * @see https://github.com/mapbox/node-sqlite3/wiki/API#databaseexecsql-callback\n */\n exec(sql) {\n return new Promise((resolve, reject) => {\n const sqlObj = (0, strings_1.toSqlParams)(sql);\n this.db.exec(sqlObj.sql, err => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve();\n });\n });\n }\n /**\n * Prepares the SQL statement and optionally binds the specified parameters.\n * When bind parameters are supplied, they are bound to the prepared statement.\n *\n * @param {string} sql The SQL query to run.\n * @param {any} [params, ...] When the SQL statement contains placeholders, you\n * can pass them in here. They will be bound to the statement before it is\n * executed. There are three ways of passing bind parameters: directly in\n * the function's arguments, as an array, and as an object for named\n * parameters. This automatically sanitizes inputs.\n * @returns Promise<Statement> Statement object\n */\n prepare(sql, ...params) {\n return new Promise((resolve, reject) => {\n const sqlObj = (0, strings_1.toSqlParams)(sql, params);\n const stmt = this.db.prepare(sqlObj.sql, ...sqlObj.params, err => {\n if (err) {\n return reject(err);\n }\n resolve(new Statement_1.Statement(stmt));\n });\n });\n }\n /**\n * Loads a compiled SQLite extension into the database connection object.\n *\n * @param {string} path Filename of the extension to load\n */\n loadExtension(path) {\n return new Promise((resolve, reject) => {\n this.db.loadExtension(path, err => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve();\n });\n });\n }\n /**\n * Performs a database migration.\n */\n async migrate(config) {\n await (0, migrate_1.migrate)(this, config);\n }\n /**\n * The methods underneath requires creative work to implement. PRs / proposals accepted!\n */\n /*\n * Unsure if serialize can be made into a promise.\n */\n serialize() {\n throw new Error('sqlite: Currently not implemented. Use getDatabaseInstance().serialize() instead.');\n }\n /*\n * Unsure if parallelize can be made into a promise.\n */\n parallelize() {\n throw new Error('sqlite: Currently not implemented. Use getDatabaseInstance().parallelize() instead.');\n }\n}\nexports.Database = Database;\n//# sourceMappingURL=Database.js.map","export * from \"./Statement.js\";\nexport * from \"./Database.js\";\nimport Database from \"./Database.js\";\n\n/**\n * Opens a database for manipulation. Most users will call this to get started.\n */\nexport async function open(config) {\n const db = new Database.Database(config);\n await db.open();\n return db;\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5],"mappings":";;;;AACA,QAAO,eAAe,SAAS,cAAc,EAAE,OAAO,MAAM,CAAC;AAC7D,SAAQ,cAAc,KAAK;CAC3B,SAAS,YAAY,KAAK;AACtB,MAAI,eAAe,MACf,QAAO;AAEX,MAAI,OAAO,QAAQ,UAAU;GACzB,MAAM,2BAAW,IAAI,OAAO;AAC5B,QAAK,IAAI,QAAQ,IACb,UAAS,QAAQ,IAAI;AAGzB,OAAI,IAAI,QACJ,UAAS,UAAU,IAAI;AAE3B,UAAO;;AAEX,MAAI,OAAO,QAAQ,SACf,QAAO,IAAI,MAAM,IAAI;AAEzB,SAAO,IAAI,MAAM,IAAI;;AAEzB,SAAQ,cAAc;;;;;;ACtBtB,QAAO,eAAe,SAAS,cAAc,EAAE,OAAO,MAAM,CAAC;AAC7D,SAAQ,YAAY,KAAK;CACzB,MAAMA;;;;CAI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QAAO,QAAQ,GAAG,eAAe,aAAa,IAAI,CAAC;AAEvD,cAAS;MACX;KACJ;;;;;;;;;;;;;;EAcN,QAAQ,KAAK,GAAG,QAAQ;AACpB,UAAO,IAAI,SAAS,SAAS,WAAW;IACpC,MAAM,UAAU,GAAG,UAAU,aAAa,KAAK,OAAO;IACtD,MAAM,OAAO,KAAK,GAAG,QAAQ,OAAO,KAAK,GAAG,OAAO,SAAQ,QAAO;AAC9D,SAAI,IACA,QAAO,OAAO,IAAI;AAEtB,aAAQ,IAAI,YAAY,UAAU,KAAK,CAAC;MAC1C;KACJ;;;;;;;EAON,cAAc,QAAM;AAChB,UAAO,IAAI,SAAS,SAAS,WAAW;AACpC,SAAK,GAAG,cAAcC,SAAM,QAAO;AAC/B,SAAI,IACA,QAAO,QAAQ,GAAG,eAAe,aAAa,IAAI,CAAC;AAEvD,cAAS;MACX;KACJ;;;;;EAKN,MAAM,QAAQ,QAAQ;AAClB,UAAO,GAAG,UAAU,SAAS,MAAM,OAAO;;;;;EAQ9C,YAAY;AACR,SAAM,IAAI,MAAM,oFAAoF;;EAKxG,cAAc;AACV,SAAM,IAAI,MAAM,sFAAsF;;;AAG9G,SAAQ,WAAWD;;;;;;;;;AC/QnB,eAAsB,KAAK,QAAQ;CACjC,MAAM,KAAK,IAAIE,wBAAS,SAAS,OAAO;AACxC,OAAM,GAAG,MAAM;AACf,QAAO"}
1
+ {"version":3,"file":"build-DWmxA6A2.mjs","names":["format_error_1","Database","path","Database"],"sources":["../node_modules/sqlite/build/utils/format-error.js","../node_modules/sqlite/build/Statement.js","../node_modules/sqlite/build/utils/migrate.js","../node_modules/sqlite/build/utils/strings.js","../node_modules/sqlite/build/Database.js","../node_modules/sqlite/build/index.mjs"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.formatError = void 0;\nfunction formatError(err) {\n if (err instanceof Error) {\n return err;\n }\n if (typeof err === 'object') {\n const newError = new Error();\n for (let prop in err) {\n newError[prop] = err[prop];\n }\n // message isn't part of the enumerable set\n if (err.message) {\n newError.message = err.message;\n }\n return newError;\n }\n if (typeof err === 'string') {\n return new Error(err);\n }\n return new Error(err);\n}\nexports.formatError = formatError;\n//# sourceMappingURL=format-error.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Statement = void 0;\nconst format_error_1 = require(\"./utils/format-error\");\n/**\n * Promisified wrapper for the sqlite3#Statement interface.\n */\nclass Statement {\n constructor(stmt) {\n this.stmt = stmt;\n }\n /**\n * Returns the underlying sqlite3 Statement instance\n */\n getStatementInstance() {\n return this.stmt;\n }\n /**\n * Binds parameters to the prepared statement.\n *\n * Binding parameters with this function completely resets the statement object and row cursor\n * and removes all previously bound parameters, if any.\n */\n bind(...params) {\n return new Promise((resolve, reject) => {\n this.stmt.bind(...params, err => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve();\n });\n });\n }\n /**\n * Resets the row cursor of the statement and preserves the parameter bindings.\n * Use this function to re-execute the same query with the same bindings.\n */\n reset() {\n return new Promise(resolve => {\n this.stmt.reset(() => {\n resolve();\n });\n });\n }\n /**\n * Finalizes the statement. This is typically optional, but if you experience long delays before\n * the next query is executed, explicitly finalizing your statement might be necessary.\n * This might be the case when you run an exclusive query (see section Control Flow).\n * After the statement is finalized, all further function calls on that statement object\n * will throw errors.\n */\n finalize() {\n return new Promise((resolve, reject) => {\n this.stmt.finalize(err => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve();\n });\n });\n }\n /**\n * Binds parameters and executes the statement.\n *\n * If you specify bind parameters, they will be bound to the statement before it is executed.\n * Note that the bindings and the row cursor are reset when you specify even a single bind parameter.\n *\n * The execution behavior is identical to the Database#run method with the difference that the\n * statement will not be finalized after it is run. This means you can run it multiple times.\n *\n * @param {any} [params, ...] When the SQL statement contains placeholders, you\n * can pass them in here. They will be bound to the statement before it is\n * executed. There are three ways of passing bind parameters: directly in\n * the function's arguments, as an array, and as an object for named\n * parameters. This automatically sanitizes inputs.\n */\n run(...params) {\n return new Promise((resolve, reject) => {\n const stmt = this;\n this.stmt.run(...params, function (err) {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve({\n stmt,\n lastID: this.lastID,\n changes: this.changes\n });\n });\n });\n }\n /**\n * Binds parameters, executes the statement and retrieves the first result row.\n * The parameters are the same as the Statement#run function, with the following differences:\n *\n * Using this method can leave the database locked, as the database awaits further\n * calls to Statement#get to retrieve subsequent rows. To inform the database that you\n * are finished retrieving rows, you should either finalize (with Statement#finalize)\n * or reset (with Statement#reset) the statement.\n *\n * @param {any} [params, ...] When the SQL statement contains placeholders, you\n * can pass them in here. They will be bound to the statement before it is\n * executed. There are three ways of passing bind parameters: directly in\n * the function's arguments, as an array, and as an object for named\n * parameters. This automatically sanitizes inputs.\n */\n get(...params) {\n return new Promise((resolve, reject) => {\n this.stmt.get(...params, (err, row) => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve(row);\n });\n });\n }\n /**\n * Binds parameters, executes the statement and calls the callback with all result rows.\n * The parameters are the same as the Statement#run function, with the following differences:\n *\n * If the result set is empty, it will resolve to an empty array, otherwise it contains an\n * object for each result row which in turn contains the values of that row.\n * Like with Statement#run, the statement will not be finalized after executing this function.\n *\n * @param {any} [params, ...] When the SQL statement contains placeholders, you\n * can pass them in here. They will be bound to the statement before it is\n * executed. There are three ways of passing bind parameters: directly in\n * the function's arguments, as an array, and as an object for named\n * parameters. This automatically sanitizes inputs.\n *\n * @see https://github.com/mapbox/node-sqlite3/wiki/API#databaseallsql-param--callback\n */\n all(...params) {\n return new Promise((resolve, reject) => {\n this.stmt.all(...params, (err, rows) => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve(rows);\n });\n });\n }\n each(...params) {\n return new Promise((resolve, reject) => {\n const callback = params.pop();\n if (!callback || typeof callback !== 'function') {\n throw new Error('sqlite: Last param of Statement#each() must be a callback function');\n }\n if (params.length > 0) {\n const positional = params.pop();\n if (typeof positional === 'function') {\n throw new Error('sqlite: Statement#each() should only have a single callback defined. See readme for usage.');\n }\n params.push(positional);\n }\n this.stmt.each(...params, (err, row) => {\n if (err) {\n return callback((0, format_error_1.formatError)(err), null);\n }\n callback(null, row);\n }, (err, count) => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve(count);\n });\n });\n }\n}\nexports.Statement = Statement;\n//# sourceMappingURL=Statement.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.migrate = exports.readMigrations = void 0;\nconst fs = require(\"fs\");\nconst path = require(\"path\");\nasync function readMigrations(migrationPath) {\n const migrationsPath = migrationPath || path.join(process.cwd(), 'migrations');\n const location = path.resolve(migrationsPath);\n // Get the list of migration files, for example:\n // { id: 1, name: 'initial', filename: '001-initial.sql' }\n // { id: 2, name: 'feature', filename: '002-feature.sql' }\n const migrationFiles = await new Promise((resolve, reject) => {\n fs.readdir(location, (err, files) => {\n if (err) {\n return reject(err);\n }\n resolve(files\n .map(x => x.match(/^(\\d+).(.*?)\\.sql$/))\n .filter(x => x !== null)\n .map(x => ({ id: Number(x[1]), name: x[2], filename: x[0] }))\n .sort((a, b) => Math.sign(a.id - b.id)));\n });\n });\n if (!migrationFiles.length) {\n throw new Error(`No migration files found in '${location}'.`);\n }\n // Get the list of migrations, for example:\n // { id: 1, name: 'initial', filename: '001-initial.sql', up: ..., down: ... }\n // { id: 2, name: 'feature', filename: '002-feature.sql', up: ..., down: ... }\n return Promise.all(migrationFiles.map(migration => new Promise((resolve, reject) => {\n const filename = path.join(location, migration.filename);\n fs.readFile(filename, 'utf-8', (err, data) => {\n if (err) {\n return reject(err);\n }\n const [up, down] = data.split(/^--\\s+?down\\b/im);\n const migrationData = migration;\n migrationData.up = up.replace(/^-- .*?$/gm, '').trim(); // Remove comments\n migrationData.down = down ? down.trim() : ''; // and trim whitespaces\n resolve(migrationData);\n });\n })));\n}\nexports.readMigrations = readMigrations;\n/**\n * Migrates database schema to the latest version\n */\nasync function migrate(db, config = {}) {\n config.force = config.force || false;\n config.table = config.table || 'migrations';\n const { force, table } = config;\n const migrations = config.migrations\n ? config.migrations\n : await readMigrations(config.migrationsPath);\n // Create a database table for migrations meta data if it doesn't exist\n await db.run(`CREATE TABLE IF NOT EXISTS \"${table}\" (\n id INTEGER PRIMARY KEY,\n name TEXT NOT NULL,\n up TEXT NOT NULL,\n down TEXT NOT NULL\n)`);\n // Get the list of already applied migrations\n let dbMigrations = await db.all(`SELECT id, name, up, down FROM \"${table}\" ORDER BY id ASC`);\n // Undo migrations that exist only in the database but not in files,\n // also undo the last migration if the `force` option is enabled.\n const lastMigration = migrations[migrations.length - 1];\n for (const migration of dbMigrations\n .slice()\n .sort((a, b) => Math.sign(b.id - a.id))) {\n if (!migrations.some(x => x.id === migration.id) ||\n (force && migration.id === lastMigration.id)) {\n await db.run('BEGIN');\n try {\n await db.exec(migration.down);\n await db.run(`DELETE FROM \"${table}\" WHERE id = ?`, migration.id);\n await db.run('COMMIT');\n dbMigrations = dbMigrations.filter(x => x.id !== migration.id);\n }\n catch (err) {\n await db.run('ROLLBACK');\n throw err;\n }\n }\n else {\n break;\n }\n }\n // Apply pending migrations\n const lastMigrationId = dbMigrations.length\n ? dbMigrations[dbMigrations.length - 1].id\n : 0;\n for (const migration of migrations) {\n if (migration.id > lastMigrationId) {\n await db.run('BEGIN');\n try {\n await db.exec(migration.up);\n await db.run(`INSERT INTO \"${table}\" (id, name, up, down) VALUES (?, ?, ?, ?)`, migration.id, migration.name, migration.up, migration.down);\n await db.run('COMMIT');\n }\n catch (err) {\n await db.run('ROLLBACK');\n throw err;\n }\n }\n }\n}\nexports.migrate = migrate;\n//# sourceMappingURL=migrate.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toSqlParams = void 0;\n/**\n * Allows for using strings and `sql-template-strings`. Converts both to a\n * format that's usable by the SQL methods\n *\n * @param sql A SQL string or `sql-template-strings` object\n * @param params An array of parameters\n */\nfunction toSqlParams(sql, params = []) {\n if (typeof sql === 'string') {\n return {\n sql,\n params\n };\n }\n return {\n sql: sql.sql,\n params: sql.values\n };\n}\nexports.toSqlParams = toSqlParams;\n//# sourceMappingURL=strings.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Database = void 0;\nconst Statement_1 = require(\"./Statement\");\nconst migrate_1 = require(\"./utils/migrate\");\nconst strings_1 = require(\"./utils/strings\");\nconst format_error_1 = require(\"./utils/format-error\");\n/**\n * Promisified wrapper for the sqlite3#Database interface.\n */\nclass Database {\n constructor(config) {\n this.config = config;\n this.db = null;\n }\n /**\n * Event handler when verbose mode is enabled.\n * @see https://github.com/mapbox/node-sqlite3/wiki/Debugging\n */\n on(event, listener) {\n this.db.on(event, listener);\n }\n /**\n * Returns the underlying sqlite3 Database instance\n */\n getDatabaseInstance() {\n return this.db;\n }\n /**\n * Opens the database\n */\n open() {\n return new Promise((resolve, reject) => {\n let { filename, mode, driver } = this.config;\n // https://github.com/mapbox/node-sqlite3/wiki/API#new-sqlite3databasefilename-mode-callback\n if (filename === null || filename === undefined) {\n throw new Error('sqlite: filename cannot be null / undefined');\n }\n if (!driver) {\n throw new Error('sqlite: driver is not defined');\n }\n if (mode) {\n this.db = new driver(filename, mode, err => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve();\n });\n }\n else {\n this.db = new driver(filename, err => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve();\n });\n }\n });\n }\n /**\n * Closes the database.\n */\n close() {\n return new Promise((resolve, reject) => {\n this.db.close(err => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve();\n });\n });\n }\n /**\n * @see https://github.com/mapbox/node-sqlite3/wiki/API#databaseconfigureoption-value\n */\n configure(option, value) {\n this.db.configure(option, value);\n }\n /**\n * Runs the SQL query with the specified parameters. It does not retrieve any result data.\n * The function returns the Database object for which it was called to allow for function chaining.\n *\n * @param {string} sql The SQL query to run.\n *\n * @param {any} [params, ...] When the SQL statement contains placeholders, you\n * can pass them in here. They will be bound to the statement before it is\n * executed. There are three ways of passing bind parameters: directly in\n * the function's arguments, as an array, and as an object for named\n * parameters. This automatically sanitizes inputs.\n *\n * @see https://github.com/mapbox/node-sqlite3/wiki/API#databaserunsql-param--callback\n */\n run(sql, ...params) {\n return new Promise((resolve, reject) => {\n const sqlObj = (0, strings_1.toSqlParams)(sql, params);\n this.db.run(sqlObj.sql, ...sqlObj.params, function (err) {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve({\n stmt: new Statement_1.Statement(this.stmt),\n lastID: this.lastID,\n changes: this.changes\n });\n });\n });\n }\n /**\n * Runs the SQL query with the specified parameters and resolves with\n * with the first result row afterwards. If the result set is empty, returns undefined.\n *\n * The property names correspond to the column names of the result set.\n * It is impossible to access them by column index; the only supported way is by column name.\n *\n * @param {string} sql The SQL query to run.\n *\n * @param {any} [params, ...] When the SQL statement contains placeholders, you\n * can pass them in here. They will be bound to the statement before it is\n * executed. There are three ways of passing bind parameters: directly in\n * the function's arguments, as an array, and as an object for named\n * parameters. This automatically sanitizes inputs.\n *\n * @see https://github.com/mapbox/node-sqlite3/wiki/API#databasegetsql-param--callback\n */\n get(sql, ...params) {\n return new Promise((resolve, reject) => {\n const sqlObj = (0, strings_1.toSqlParams)(sql, params);\n this.db.get(sqlObj.sql, ...sqlObj.params, (err, row) => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve(row);\n });\n });\n }\n each(sql, ...params) {\n return new Promise((resolve, reject) => {\n const callback = params.pop();\n if (!callback || typeof callback !== 'function') {\n throw new Error('sqlite: Last param of Database#each() must be a callback function');\n }\n if (params.length > 0) {\n const positional = params.pop();\n if (typeof positional === 'function') {\n throw new Error('sqlite: Database#each() should only have a single callback defined. See readme for usage.');\n }\n params.push(positional);\n }\n const sqlObj = (0, strings_1.toSqlParams)(sql, params);\n this.db.each(sqlObj.sql, ...sqlObj.params, (err, row) => {\n if (err) {\n return callback((0, format_error_1.formatError)(err), null);\n }\n callback(null, row);\n }, (err, count) => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve(count);\n });\n });\n }\n /**\n * Runs the SQL query with the specified parameters. The parameters are the same as the\n * Database#run function, with the following differences:\n *\n * If the result set is empty, it will be an empty array, otherwise it will\n * have an object for each result row which\n * in turn contains the values of that row, like the Database#get function.\n *\n * Note that it first retrieves all result rows and stores them in memory.\n * For queries that have potentially large result sets, use the Database#each\n * function to retrieve all rows or Database#prepare followed by multiple\n * Statement#get calls to retrieve a previously unknown amount of rows.\n *\n * @param {string} sql The SQL query to run.\n *\n * @param {any} [params, ...] When the SQL statement contains placeholders, you\n * can pass them in here. They will be bound to the statement before it is\n * executed. There are three ways of passing bind parameters: directly in\n * the function's arguments, as an array, and as an object for named\n * parameters. This automatically sanitizes inputs.\n *\n * @see https://github.com/mapbox/node-sqlite3/wiki/API#databaseallsql-param--callback\n */\n all(sql, ...params) {\n return new Promise((resolve, reject) => {\n const sqlObj = (0, strings_1.toSqlParams)(sql, params);\n this.db.all(sqlObj.sql, ...sqlObj.params, (err, rows) => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve(rows);\n });\n });\n }\n /**\n * Runs all SQL queries in the supplied string. No result rows are retrieved. If a query fails,\n * no subsequent statements will be executed (wrap it in a transaction if you want all\n * or none to be executed).\n *\n * Note: This function will only execute statements up to the first NULL byte.\n * Comments are not allowed and will lead to runtime errors.\n *\n * @param {string} sql The SQL query to run.\n * @see https://github.com/mapbox/node-sqlite3/wiki/API#databaseexecsql-callback\n */\n exec(sql) {\n return new Promise((resolve, reject) => {\n const sqlObj = (0, strings_1.toSqlParams)(sql);\n this.db.exec(sqlObj.sql, err => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve();\n });\n });\n }\n /**\n * Prepares the SQL statement and optionally binds the specified parameters.\n * When bind parameters are supplied, they are bound to the prepared statement.\n *\n * @param {string} sql The SQL query to run.\n * @param {any} [params, ...] When the SQL statement contains placeholders, you\n * can pass them in here. They will be bound to the statement before it is\n * executed. There are three ways of passing bind parameters: directly in\n * the function's arguments, as an array, and as an object for named\n * parameters. This automatically sanitizes inputs.\n * @returns Promise<Statement> Statement object\n */\n prepare(sql, ...params) {\n return new Promise((resolve, reject) => {\n const sqlObj = (0, strings_1.toSqlParams)(sql, params);\n const stmt = this.db.prepare(sqlObj.sql, ...sqlObj.params, err => {\n if (err) {\n return reject(err);\n }\n resolve(new Statement_1.Statement(stmt));\n });\n });\n }\n /**\n * Loads a compiled SQLite extension into the database connection object.\n *\n * @param {string} path Filename of the extension to load\n */\n loadExtension(path) {\n return new Promise((resolve, reject) => {\n this.db.loadExtension(path, err => {\n if (err) {\n return reject((0, format_error_1.formatError)(err));\n }\n resolve();\n });\n });\n }\n /**\n * Performs a database migration.\n */\n async migrate(config) {\n await (0, migrate_1.migrate)(this, config);\n }\n /**\n * The methods underneath requires creative work to implement. PRs / proposals accepted!\n */\n /*\n * Unsure if serialize can be made into a promise.\n */\n serialize() {\n throw new Error('sqlite: Currently not implemented. Use getDatabaseInstance().serialize() instead.');\n }\n /*\n * Unsure if parallelize can be made into a promise.\n */\n parallelize() {\n throw new Error('sqlite: Currently not implemented. Use getDatabaseInstance().parallelize() instead.');\n }\n}\nexports.Database = Database;\n//# sourceMappingURL=Database.js.map","export * from \"./Statement.js\";\nexport * from \"./Database.js\";\nimport Database from \"./Database.js\";\n\n/**\n * Opens a database for manipulation. Most users will call this to get started.\n */\nexport async function open(config) {\n const db = new Database.Database(config);\n await db.open();\n return db;\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5],"mappings":";;;;AACA,QAAO,eAAe,SAAS,cAAc,EAAE,OAAO,MAAM,CAAC;AAC7D,SAAQ,cAAc,KAAK;CAC3B,SAAS,YAAY,KAAK;AACtB,MAAI,eAAe,MACf,QAAO;AAEX,MAAI,OAAO,QAAQ,UAAU;GACzB,MAAM,2BAAW,IAAI,OAAO;AAC5B,QAAK,IAAI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region
4255
4255
  export { Client, Connection, DatabaseError, Pool, Query, Result, TypeOverrides, esm_default as default, defaults, escapeIdentifier, escapeLiteral, types };
4256
- //# sourceMappingURL=esm-BRY8ugtK.mjs.map
4256
+ //# sourceMappingURL=esm-1Ra90uql.mjs.map