├── .editorconfig ├── .gitignore ├── .prettierrc ├── README.md ├── apis_insomnia.json ├── package-lock.json ├── package.json ├── src ├── rls.ts └── worker.ts ├── tsconfig.json └── wrangler.toml /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = tab 6 | tab_width = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.yml] 13 | indent_style = space 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .dev.vars 2 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 140, 3 | "singleQuote": true, 4 | "semi": true, 5 | "useTabs": true 6 | } 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Row-level security for Turso 2 | 3 | This is a small Cloudflare Worker that provides an authorization wrapper over Turso database. Somewhat like PostgREST, it enforces access-control policies defined in the database. In a way, it provides the missing Row-level Security feature in SQLite while retaining SQL as the query interface. 4 | 5 | It connects to your Turso DB instance, reads two tables `_users` and `_policies` with a specific schema and enforces row-level security policy for all your other tables, allowing your to directly send SQL queries from the frontend. This makes it possible to create multi-user, backend-less apps without any servers, containers or lambdas. Cloudflare Worker and Turso DB make it extremely cheap for low-concurrency use-cases for which Turso/Sqlite is suitable. 6 | 7 | ## APIs 8 | 9 | There are the APIs: 10 | 11 | - `POST /register`: Takes an username and password and adds a new user account in db. 12 | - `POST /query` : Takes a SQL query (only SELECT/INSERT/UPDATE/DELETE) with the password in the `Authorization` header, looks at applicable policies and either modifies the query to account for restricted access or blocks it altogether. 13 | 14 | You can see full API definitions as well examples in the [Insomnia collection](/apis_insomnia.json) 15 | 16 | ## Tutorial: Let's build the backend for a multi-user To-Do list app 17 | 18 | First create your Turso DB instance.: 19 | `turso db create cloudflare-rls-demo --enable-extensions` 20 | We rely on [Crypto and UUID extensions](https://docs.turso.tech/reference/extensions). 21 | 22 | Get the database URL. This will be used as the `LIBSQL_DB_URL` env variable and needs to be updated in `wrangler.toml`: 23 | `turso db show cloudflare-rls-demo` 24 | 25 | Create an auth token for this db. This will be used as the `LIBSQL_DB_AUTH_TOKEN` env variable and needs to be updated in `.dev.vars` for local development: 26 | `turso db tokens create cloudflare-rls-demo` 27 | 28 | Now start a shell for this db: 29 | `turso db shell cloudflare-rls-demo` 30 | 31 | Create your `_users` table: 32 | 33 | ``` 34 | create table _users ( 35 | id varchar(255) primary key, 36 | username varchar(128) check(length(username) >= 4) not null, 37 | password_hash varchar(255) unique not null, 38 | role varchar(128) check (role in ('anon', 'admin', 'regular')) not null default 'regular', 39 | display_name varchar(255) 40 | -- add other columns needed for your app 41 | ); 42 | 43 | -- define your users. I like to create one for anonymous/public access and another for admin 44 | -- 45 | insert into _users (id, username, password_hash, role, display_name) values 46 | ('anon', 'anon', hex(sha256('dummy-password-for-anonymous')), 'anon', 'Anonymous'), 47 | ('admin', 'admin', hex(sha256('must-replace-this-with-a-securerandom')), 'admin', 'Administrator'); 48 | 49 | ``` 50 | 51 | Now create the `_policies` table: 52 | 53 | ``` 54 | -- Now we create a table where access policies for actions on tables are whitelisted 55 | create table _policies ( 56 | table_name varchar(255) not null, 57 | action varchar(255) not null CHECK (action IN ('select', 'insert', 'update', 'delete')), 58 | using_clause varchar(1024), 59 | withcheck_clause varchar(1024), 60 | primary key (table_name, action) 61 | ); 62 | ``` 63 | 64 | `using_clause_sql`` defines which rows are made visible for select, update, delete. 65 | `withcheck_clause_js`` defines javascript filter for incoming rows for insert, update. 66 | In both, `$$CURRENT_USER$$` will be replaced by the actual user_id who has sent the query. Similarly, `$$CURRENT_ROLE$$` will be replaced by the user's role (eg: "anon" / "admin" / "regular") 67 | 68 | For example, to allow users to read only their own tasks: 69 | ``` 70 | insert into _policies (table_name, action, using_clause, withcheck_clause) values 71 | ('tasks', 'select', 'user_id = $$CURRENT_USER$$', null), 72 | ('tasks', 'insert', 'true', 'user_id = $$CURRENT_USER$$'); 73 | ``` 74 | 75 | Now, create your tasks table: 76 | ``` 77 | create table tasks ( 78 | id serial primary key, 79 | todo text not null, 80 | user_id varchar(255) not null references _users(id) 81 | ); 82 | insert into tasks (id, todo, user_id) values (1, 'anon task', 'anon'), (2, 'admin task', 'admin'); 83 | ``` 84 | 85 | ## How It Works 86 | 87 | `worker.ts` implements the 2 API routes in a Cloudflare Worker. 88 | 89 | When `/query` is invoked, first it fetches the record from the `_users` table. We use [node-sql-parser](https://github.com/taozhi8833998/node-sql-parser) to parse the incoming SQL queries. Similar to PostgreSQL's `CREATE POLICY` statements, our policies too provide two kind of validations via SQL's boolean expressions that can use two special values (`$$CURRENT_USER$$` and `$$CURRENT_ROLE$$`): 90 | 91 | - `using_clause` that gets added to incoming queries' as a `WHERE` clause. This controls the visibility of existing rows for `SELECT`, `UPDATE`, and `DELETE` statements. 92 | - `withcheck_clause` validates new incoming values for `INSERT` and `UPDATE` statements. -------------------------------------------------------------------------------- /apis_insomnia.json: -------------------------------------------------------------------------------- 1 | {"_type":"export","__export_format":4,"__export_date":"2023-08-27T04:49:46.297Z","__export_source":"insomnia.desktop.app:v2023.5.6","resources":[{"_id":"req_d44cb8f719814536bdd70d6dbaaa4d3f","parentId":"wrk_7d104e526da048c59df87d24f9d74627","modified":1693110410978,"created":1693044168048,"url":"localhost:8787/register","name":"Register","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n\t\"email\": \"me@example.com\",\n\t\"password\": \"abcdabcdabcd\",\n\t\"display_name\": \"Developer\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1693044168048,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"wrk_7d104e526da048c59df87d24f9d74627","parentId":null,"modified":1693054757090,"created":1693038075665,"name":"APIs for Cloudflare Worker","description":"","scope":"collection","_type":"workspace"},{"_id":"req_067e0994ac2641a8ae2389ed3279736d","parentId":"wrk_7d104e526da048c59df87d24f9d74627","modified":1693110230665,"created":1693038082181,"url":"localhost:8787/query","name":"Select Tasks","description":"","method":"POST","body":{"mimeType":"text/plain","text":"select * from tasks"},"parameters":[],"headers":[{"name":"Content-Type","value":"text/plain"}],"authentication":{"type":"bearer","token":"abcdabcdabcd","disabled":false},"metaSortKey":-1693038082181,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_5fcbb122e8374277875d2479121cc7b0","parentId":"wrk_7d104e526da048c59df87d24f9d74627","modified":1693110865682,"created":1693066944344,"url":"localhost:8787/query","name":"Insert task","description":"","method":"POST","body":{"mimeType":"text/plain","text":"insert into tasks (id, todo, user_id) values (12, 'fail', 'a26a8b83-2bd0-4e5b-ad12-124b253067f0');"},"parameters":[],"headers":[{"name":"Content-Type","value":"text/plain"}],"authentication":{"type":"bearer","token":"abcdabcdabcd"},"metaSortKey":-1689935671973.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_bfd1291c918241a9a8c484139f6d0b21","parentId":"wrk_7d104e526da048c59df87d24f9d74627","modified":1693068749731,"created":1693068172403,"url":"localhost:8787/query","name":"Update task","description":"","method":"POST","body":{"mimeType":"text/plain","text":"update tasks set id = 9 where id = 1;"},"parameters":[],"headers":[{"name":"Content-Type","value":"text/plain"}],"authentication":{"type":"bearer","token":"abcdabcdabcd"},"metaSortKey":-1688384466869.75,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_fcc13c3da6264ae898fe9f527de97e92","parentId":"wrk_7d104e526da048c59df87d24f9d74627","modified":1693105864433,"created":1693105847508,"url":"localhost:8787/query","name":"Delete Tasks","description":"","method":"POST","body":{"mimeType":"text/plain","text":"delete from tasks where id = 2"},"parameters":[],"headers":[{"name":"Content-Type","value":"text/plain"}],"authentication":{"type":"bearer","token":"abcdabcdabcd","disabled":false},"metaSortKey":-1688384466769.75,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"env_ee3eadf3df388f2eb420da64e5ce08a92c723db2","parentId":"wrk_7d104e526da048c59df87d24f9d74627","modified":1693038075667,"created":1693038075667,"name":"Base Environment","data":{},"dataPropertyOrder":null,"color":null,"isPrivate":false,"metaSortKey":1693038075667,"_type":"environment"},{"_id":"jar_ee3eadf3df388f2eb420da64e5ce08a92c723db2","parentId":"wrk_7d104e526da048c59df87d24f9d74627","modified":1693038075668,"created":1693038075668,"name":"Default Jar","cookies":[],"_type":"cookie_jar"}]} -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "turso", 3 | "version": "0.0.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "turso", 9 | "version": "0.0.0", 10 | "dependencies": { 11 | "@libsql/client": "^0.3.1", 12 | "itty-router": "^4.0.22", 13 | "node-sql-parser": "^4.9.0" 14 | }, 15 | "devDependencies": { 16 | "@cloudflare/workers-types": "^4.20230419.0", 17 | "typescript": "^5.0.4", 18 | "wrangler": "^3.0.0" 19 | } 20 | }, 21 | "node_modules/@cloudflare/kv-asset-handler": { 22 | "version": "0.2.0", 23 | "resolved": "https://registry.npmjs.org/@cloudflare/kv-asset-handler/-/kv-asset-handler-0.2.0.tgz", 24 | "integrity": "sha512-MVbXLbTcAotOPUj0pAMhVtJ+3/kFkwJqc5qNOleOZTv6QkZZABDMS21dSrSlVswEHwrpWC03e4fWytjqKvuE2A==", 25 | "dev": true, 26 | "dependencies": { 27 | "mime": "^3.0.0" 28 | } 29 | }, 30 | "node_modules/@cloudflare/workerd-darwin-64": { 31 | "version": "1.20230814.1", 32 | "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20230814.1.tgz", 33 | "integrity": "sha512-aQUO7q7qXl+SVtOiMMlVKLNOSeL6GX43RKeflwzsD74dGgyHPiSfw5KCvXhkVbyN7u+yYF6HyFdaIvHLfn5jyA==", 34 | "cpu": [ 35 | "x64" 36 | ], 37 | "dev": true, 38 | "optional": true, 39 | "os": [ 40 | "darwin" 41 | ], 42 | "engines": { 43 | "node": ">=16" 44 | } 45 | }, 46 | "node_modules/@cloudflare/workerd-darwin-arm64": { 47 | "version": "1.20230814.1", 48 | "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20230814.1.tgz", 49 | "integrity": "sha512-U2mcgi+AiuI/4EY5Wk/GmygiNoCNw/V2mcHmxESqe4r6XbJYOzBdEsjnqJ05rqd0JlEM8m64jRtE6/qBnQHygg==", 50 | "cpu": [ 51 | "arm64" 52 | ], 53 | "dev": true, 54 | "optional": true, 55 | "os": [ 56 | "darwin" 57 | ], 58 | "engines": { 59 | "node": ">=16" 60 | } 61 | }, 62 | "node_modules/@cloudflare/workerd-linux-64": { 63 | "version": "1.20230814.1", 64 | "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20230814.1.tgz", 65 | "integrity": "sha512-Q4kITXLTCuG2i2Z01fbb5AjVRRIf3+lS4ZVsFbTbIwtcOOG4Ozcw7ee7tKsFES7hFqR4Eg9gMG4/aS0mmi+L2g==", 66 | "cpu": [ 67 | "x64" 68 | ], 69 | "dev": true, 70 | "optional": true, 71 | "os": [ 72 | "linux" 73 | ], 74 | "engines": { 75 | "node": ">=16" 76 | } 77 | }, 78 | "node_modules/@cloudflare/workerd-linux-arm64": { 79 | "version": "1.20230814.1", 80 | "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20230814.1.tgz", 81 | "integrity": "sha512-BX5SaksXw+pkREVw3Rw2eSNXplqZw+14CcwW/5x/4oq/C6yn5qCvKxJfM7pukJGMI4wkJPOYops7B3g27FB/HA==", 82 | "cpu": [ 83 | "arm64" 84 | ], 85 | "dev": true, 86 | "optional": true, 87 | "os": [ 88 | "linux" 89 | ], 90 | "engines": { 91 | "node": ">=16" 92 | } 93 | }, 94 | "node_modules/@cloudflare/workerd-windows-64": { 95 | "version": "1.20230814.1", 96 | "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20230814.1.tgz", 97 | "integrity": "sha512-GWHqfyhsG/1wm2W8afkYX3q3fWXUWWD8NGtHfAs6ZVTHdW3mmYyMhKR0lc6ptBwz5i5aXRlP2S+CxxxwwDbKpw==", 98 | "cpu": [ 99 | "x64" 100 | ], 101 | "dev": true, 102 | "optional": true, 103 | "os": [ 104 | "win32" 105 | ], 106 | "engines": { 107 | "node": ">=16" 108 | } 109 | }, 110 | "node_modules/@cloudflare/workers-types": { 111 | "version": "4.20230821.0", 112 | "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20230821.0.tgz", 113 | "integrity": "sha512-lVQSyr5E4CEkQw7WIdsrMTj+kHjsm28mJ0B5AhNFByKR+16KTFsU/RW/nGLKHHW2jxT5lvYI+HjNQMzC9QR8Ng==", 114 | "dev": true 115 | }, 116 | "node_modules/@esbuild-plugins/node-globals-polyfill": { 117 | "version": "0.1.1", 118 | "resolved": "https://registry.npmjs.org/@esbuild-plugins/node-globals-polyfill/-/node-globals-polyfill-0.1.1.tgz", 119 | "integrity": "sha512-MR0oAA+mlnJWrt1RQVQ+4VYuRJW/P2YmRTv1AsplObyvuBMnPHiizUF95HHYiSsMGLhyGtWufaq2XQg6+iurBg==", 120 | "dev": true, 121 | "peerDependencies": { 122 | "esbuild": "*" 123 | } 124 | }, 125 | "node_modules/@esbuild-plugins/node-modules-polyfill": { 126 | "version": "0.1.4", 127 | "resolved": "https://registry.npmjs.org/@esbuild-plugins/node-modules-polyfill/-/node-modules-polyfill-0.1.4.tgz", 128 | "integrity": "sha512-uZbcXi0zbmKC/050p3gJnne5Qdzw8vkXIv+c2BW0Lsc1ji1SkrxbKPUy5Efr0blbTu1SL8w4eyfpnSdPg3G0Qg==", 129 | "dev": true, 130 | "dependencies": { 131 | "escape-string-regexp": "^4.0.0", 132 | "rollup-plugin-node-polyfills": "^0.2.1" 133 | }, 134 | "peerDependencies": { 135 | "esbuild": "*" 136 | } 137 | }, 138 | "node_modules/@esbuild/android-arm": { 139 | "version": "0.16.3", 140 | "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.16.3.tgz", 141 | "integrity": "sha512-mueuEoh+s1eRbSJqq9KNBQwI4QhQV6sRXIfTyLXSHGMpyew61rOK4qY21uKbXl1iBoMb0AdL1deWFCQVlN2qHA==", 142 | "cpu": [ 143 | "arm" 144 | ], 145 | "dev": true, 146 | "optional": true, 147 | "os": [ 148 | "android" 149 | ], 150 | "engines": { 151 | "node": ">=12" 152 | } 153 | }, 154 | "node_modules/@esbuild/android-arm64": { 155 | "version": "0.16.3", 156 | "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.16.3.tgz", 157 | "integrity": "sha512-RolFVeinkeraDvN/OoRf1F/lP0KUfGNb5jxy/vkIMeRRChkrX/HTYN6TYZosRJs3a1+8wqpxAo5PI5hFmxyPRg==", 158 | "cpu": [ 159 | "arm64" 160 | ], 161 | "dev": true, 162 | "optional": true, 163 | "os": [ 164 | "android" 165 | ], 166 | "engines": { 167 | "node": ">=12" 168 | } 169 | }, 170 | "node_modules/@esbuild/android-x64": { 171 | "version": "0.16.3", 172 | "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.3.tgz", 173 | "integrity": "sha512-SFpTUcIT1bIJuCCBMCQWq1bL2gPTjWoLZdjmIhjdcQHaUfV41OQfho6Ici5uvvkMmZRXIUGpM3GxysP/EU7ifQ==", 174 | "cpu": [ 175 | "x64" 176 | ], 177 | "dev": true, 178 | "optional": true, 179 | "os": [ 180 | "android" 181 | ], 182 | "engines": { 183 | "node": ">=12" 184 | } 185 | }, 186 | "node_modules/@esbuild/darwin-arm64": { 187 | "version": "0.16.3", 188 | "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.16.3.tgz", 189 | "integrity": "sha512-DO8WykMyB+N9mIDfI/Hug70Dk1KipavlGAecxS3jDUwAbTpDXj0Lcwzw9svkhxfpCagDmpaTMgxWK8/C/XcXvw==", 190 | "cpu": [ 191 | "arm64" 192 | ], 193 | "dev": true, 194 | "optional": true, 195 | "os": [ 196 | "darwin" 197 | ], 198 | "engines": { 199 | "node": ">=12" 200 | } 201 | }, 202 | "node_modules/@esbuild/darwin-x64": { 203 | "version": "0.16.3", 204 | "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.16.3.tgz", 205 | "integrity": "sha512-uEqZQ2omc6BvWqdCiyZ5+XmxuHEi1SPzpVxXCSSV2+Sh7sbXbpeNhHIeFrIpRjAs0lI1FmA1iIOxFozKBhKgRQ==", 206 | "cpu": [ 207 | "x64" 208 | ], 209 | "dev": true, 210 | "optional": true, 211 | "os": [ 212 | "darwin" 213 | ], 214 | "engines": { 215 | "node": ">=12" 216 | } 217 | }, 218 | "node_modules/@esbuild/freebsd-arm64": { 219 | "version": "0.16.3", 220 | "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.16.3.tgz", 221 | "integrity": "sha512-nJansp3sSXakNkOD5i5mIz2Is/HjzIhFs49b1tjrPrpCmwgBmH9SSzhC/Z1UqlkivqMYkhfPwMw1dGFUuwmXhw==", 222 | "cpu": [ 223 | "arm64" 224 | ], 225 | "dev": true, 226 | "optional": true, 227 | "os": [ 228 | "freebsd" 229 | ], 230 | "engines": { 231 | "node": ">=12" 232 | } 233 | }, 234 | "node_modules/@esbuild/freebsd-x64": { 235 | "version": "0.16.3", 236 | "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.16.3.tgz", 237 | "integrity": "sha512-TfoDzLw+QHfc4a8aKtGSQ96Wa+6eimljjkq9HKR0rHlU83vw8aldMOUSJTUDxbcUdcgnJzPaX8/vGWm7vyV7ug==", 238 | "cpu": [ 239 | "x64" 240 | ], 241 | "dev": true, 242 | "optional": true, 243 | "os": [ 244 | "freebsd" 245 | ], 246 | "engines": { 247 | "node": ">=12" 248 | } 249 | }, 250 | "node_modules/@esbuild/linux-arm": { 251 | "version": "0.16.3", 252 | "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.16.3.tgz", 253 | "integrity": "sha512-VwswmSYwVAAq6LysV59Fyqk3UIjbhuc6wb3vEcJ7HEJUtFuLK9uXWuFoH1lulEbE4+5GjtHi3MHX+w1gNHdOWQ==", 254 | "cpu": [ 255 | "arm" 256 | ], 257 | "dev": true, 258 | "optional": true, 259 | "os": [ 260 | "linux" 261 | ], 262 | "engines": { 263 | "node": ">=12" 264 | } 265 | }, 266 | "node_modules/@esbuild/linux-arm64": { 267 | "version": "0.16.3", 268 | "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.16.3.tgz", 269 | "integrity": "sha512-7I3RlsnxEFCHVZNBLb2w7unamgZ5sVwO0/ikE2GaYvYuUQs9Qte/w7TqWcXHtCwxvZx/2+F97ndiUQAWs47ZfQ==", 270 | "cpu": [ 271 | "arm64" 272 | ], 273 | "dev": true, 274 | "optional": true, 275 | "os": [ 276 | "linux" 277 | ], 278 | "engines": { 279 | "node": ">=12" 280 | } 281 | }, 282 | "node_modules/@esbuild/linux-ia32": { 283 | "version": "0.16.3", 284 | "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.16.3.tgz", 285 | "integrity": "sha512-X8FDDxM9cqda2rJE+iblQhIMYY49LfvW4kaEjoFbTTQ4Go8G96Smj2w3BRTwA8IHGoi9dPOPGAX63dhuv19UqA==", 286 | "cpu": [ 287 | "ia32" 288 | ], 289 | "dev": true, 290 | "optional": true, 291 | "os": [ 292 | "linux" 293 | ], 294 | "engines": { 295 | "node": ">=12" 296 | } 297 | }, 298 | "node_modules/@esbuild/linux-loong64": { 299 | "version": "0.16.3", 300 | "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.16.3.tgz", 301 | "integrity": "sha512-hIbeejCOyO0X9ujfIIOKjBjNAs9XD/YdJ9JXAy1lHA+8UXuOqbFe4ErMCqMr8dhlMGBuvcQYGF7+kO7waj2KHw==", 302 | "cpu": [ 303 | "loong64" 304 | ], 305 | "dev": true, 306 | "optional": true, 307 | "os": [ 308 | "linux" 309 | ], 310 | "engines": { 311 | "node": ">=12" 312 | } 313 | }, 314 | "node_modules/@esbuild/linux-mips64el": { 315 | "version": "0.16.3", 316 | "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.16.3.tgz", 317 | "integrity": "sha512-znFRzICT/V8VZQMt6rjb21MtAVJv/3dmKRMlohlShrbVXdBuOdDrGb+C2cZGQAR8RFyRe7HS6klmHq103WpmVw==", 318 | "cpu": [ 319 | "mips64el" 320 | ], 321 | "dev": true, 322 | "optional": true, 323 | "os": [ 324 | "linux" 325 | ], 326 | "engines": { 327 | "node": ">=12" 328 | } 329 | }, 330 | "node_modules/@esbuild/linux-ppc64": { 331 | "version": "0.16.3", 332 | "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.16.3.tgz", 333 | "integrity": "sha512-EV7LuEybxhXrVTDpbqWF2yehYRNz5e5p+u3oQUS2+ZFpknyi1NXxr8URk4ykR8Efm7iu04//4sBg249yNOwy5Q==", 334 | "cpu": [ 335 | "ppc64" 336 | ], 337 | "dev": true, 338 | "optional": true, 339 | "os": [ 340 | "linux" 341 | ], 342 | "engines": { 343 | "node": ">=12" 344 | } 345 | }, 346 | "node_modules/@esbuild/linux-riscv64": { 347 | "version": "0.16.3", 348 | "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.16.3.tgz", 349 | "integrity": "sha512-uDxqFOcLzFIJ+r/pkTTSE9lsCEaV/Y6rMlQjUI9BkzASEChYL/aSQjZjchtEmdnVxDKETnUAmsaZ4pqK1eE5BQ==", 350 | "cpu": [ 351 | "riscv64" 352 | ], 353 | "dev": true, 354 | "optional": true, 355 | "os": [ 356 | "linux" 357 | ], 358 | "engines": { 359 | "node": ">=12" 360 | } 361 | }, 362 | "node_modules/@esbuild/linux-s390x": { 363 | "version": "0.16.3", 364 | "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.16.3.tgz", 365 | "integrity": "sha512-NbeREhzSxYwFhnCAQOQZmajsPYtX71Ufej3IQ8W2Gxskfz9DK58ENEju4SbpIj48VenktRASC52N5Fhyf/aliQ==", 366 | "cpu": [ 367 | "s390x" 368 | ], 369 | "dev": true, 370 | "optional": true, 371 | "os": [ 372 | "linux" 373 | ], 374 | "engines": { 375 | "node": ">=12" 376 | } 377 | }, 378 | "node_modules/@esbuild/linux-x64": { 379 | "version": "0.16.3", 380 | "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.16.3.tgz", 381 | "integrity": "sha512-SDiG0nCixYO9JgpehoKgScwic7vXXndfasjnD5DLbp1xltANzqZ425l7LSdHynt19UWOcDjG9wJJzSElsPvk0w==", 382 | "cpu": [ 383 | "x64" 384 | ], 385 | "dev": true, 386 | "optional": true, 387 | "os": [ 388 | "linux" 389 | ], 390 | "engines": { 391 | "node": ">=12" 392 | } 393 | }, 394 | "node_modules/@esbuild/netbsd-x64": { 395 | "version": "0.16.3", 396 | "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.16.3.tgz", 397 | "integrity": "sha512-AzbsJqiHEq1I/tUvOfAzCY15h4/7Ivp3ff/o1GpP16n48JMNAtbW0qui2WCgoIZArEHD0SUQ95gvR0oSO7ZbdA==", 398 | "cpu": [ 399 | "x64" 400 | ], 401 | "dev": true, 402 | "optional": true, 403 | "os": [ 404 | "netbsd" 405 | ], 406 | "engines": { 407 | "node": ">=12" 408 | } 409 | }, 410 | "node_modules/@esbuild/openbsd-x64": { 411 | "version": "0.16.3", 412 | "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.16.3.tgz", 413 | "integrity": "sha512-gSABi8qHl8k3Cbi/4toAzHiykuBuWLZs43JomTcXkjMZVkp0gj3gg9mO+9HJW/8GB5H89RX/V0QP4JGL7YEEVg==", 414 | "cpu": [ 415 | "x64" 416 | ], 417 | "dev": true, 418 | "optional": true, 419 | "os": [ 420 | "openbsd" 421 | ], 422 | "engines": { 423 | "node": ">=12" 424 | } 425 | }, 426 | "node_modules/@esbuild/sunos-x64": { 427 | "version": "0.16.3", 428 | "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.16.3.tgz", 429 | "integrity": "sha512-SF9Kch5Ete4reovvRO6yNjMxrvlfT0F0Flm+NPoUw5Z4Q3r1d23LFTgaLwm3Cp0iGbrU/MoUI+ZqwCv5XJijCw==", 430 | "cpu": [ 431 | "x64" 432 | ], 433 | "dev": true, 434 | "optional": true, 435 | "os": [ 436 | "sunos" 437 | ], 438 | "engines": { 439 | "node": ">=12" 440 | } 441 | }, 442 | "node_modules/@esbuild/win32-arm64": { 443 | "version": "0.16.3", 444 | "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.16.3.tgz", 445 | "integrity": "sha512-u5aBonZIyGopAZyOnoPAA6fGsDeHByZ9CnEzyML9NqntK6D/xl5jteZUKm/p6nD09+v3pTM6TuUIqSPcChk5gg==", 446 | "cpu": [ 447 | "arm64" 448 | ], 449 | "dev": true, 450 | "optional": true, 451 | "os": [ 452 | "win32" 453 | ], 454 | "engines": { 455 | "node": ">=12" 456 | } 457 | }, 458 | "node_modules/@esbuild/win32-ia32": { 459 | "version": "0.16.3", 460 | "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.16.3.tgz", 461 | "integrity": "sha512-GlgVq1WpvOEhNioh74TKelwla9KDuAaLZrdxuuUgsP2vayxeLgVc+rbpIv0IYF4+tlIzq2vRhofV+KGLD+37EQ==", 462 | "cpu": [ 463 | "ia32" 464 | ], 465 | "dev": true, 466 | "optional": true, 467 | "os": [ 468 | "win32" 469 | ], 470 | "engines": { 471 | "node": ">=12" 472 | } 473 | }, 474 | "node_modules/@esbuild/win32-x64": { 475 | "version": "0.16.3", 476 | "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.16.3.tgz", 477 | "integrity": "sha512-5/JuTd8OWW8UzEtyf19fbrtMJENza+C9JoPIkvItgTBQ1FO2ZLvjbPO6Xs54vk0s5JB5QsfieUEshRQfu7ZHow==", 478 | "cpu": [ 479 | "x64" 480 | ], 481 | "dev": true, 482 | "optional": true, 483 | "os": [ 484 | "win32" 485 | ], 486 | "engines": { 487 | "node": ">=12" 488 | } 489 | }, 490 | "node_modules/@libsql/client": { 491 | "version": "0.3.1", 492 | "resolved": "https://registry.npmjs.org/@libsql/client/-/client-0.3.1.tgz", 493 | "integrity": "sha512-43/zF8fJguXd6ENwYhddpbR05bDVx3BQQUZ/BsJ0b4zLJge+WFa2smC3ILVGqvVu4ZoixbC0sfLTdVPdd2NjDA==", 494 | "dependencies": { 495 | "@libsql/hrana-client": "^0.4.3", 496 | "better-sqlite3": "^8.0.1", 497 | "js-base64": "^3.7.5" 498 | } 499 | }, 500 | "node_modules/@libsql/hrana-client": { 501 | "version": "0.4.4", 502 | "resolved": "https://registry.npmjs.org/@libsql/hrana-client/-/hrana-client-0.4.4.tgz", 503 | "integrity": "sha512-BevUg0UBRLs5AEqn0fjrMcl49xCtwuFavgK4MzCb3PTtxpEbQ24oGXctspN9drBiUVmqSZr7go887aiLLzSO3A==", 504 | "dependencies": { 505 | "@libsql/isomorphic-fetch": "^0.1.1", 506 | "@libsql/isomorphic-ws": "^0.1.2", 507 | "js-base64": "^3.7.5" 508 | } 509 | }, 510 | "node_modules/@libsql/isomorphic-fetch": { 511 | "version": "0.1.6", 512 | "resolved": "https://registry.npmjs.org/@libsql/isomorphic-fetch/-/isomorphic-fetch-0.1.6.tgz", 513 | "integrity": "sha512-8qhxEDmVBDb54E9xdW1xqw3zLNShkMZpf5YQU3PvwjtKNLOPde59Oqez+RnZHsYkt9zQxxOF+7gSHVJeP/UWqg==", 514 | "dependencies": { 515 | "@types/node-fetch": "^2.2.6", 516 | "node-fetch": "^2.6.12" 517 | } 518 | }, 519 | "node_modules/@libsql/isomorphic-ws": { 520 | "version": "0.1.3", 521 | "resolved": "https://registry.npmjs.org/@libsql/isomorphic-ws/-/isomorphic-ws-0.1.3.tgz", 522 | "integrity": "sha512-54dZXgYwWDKsnfWv8GCVYvhn6RDlqFDGAc8EQMd941yvGMsGzo06Gn6Iyjw//nJ1iJO97FbXgoQ1apikoFD/WA==", 523 | "dependencies": { 524 | "@types/ws": "^8.5.4", 525 | "ws": "^8.13.0" 526 | } 527 | }, 528 | "node_modules/@types/node": { 529 | "version": "20.5.6", 530 | "resolved": "https://registry.npmjs.org/@types/node/-/node-20.5.6.tgz", 531 | "integrity": "sha512-Gi5wRGPbbyOTX+4Y2iULQ27oUPrefaB0PxGQJnfyWN3kvEDGM3mIB5M/gQLmitZf7A9FmLeaqxD3L1CXpm3VKQ==" 532 | }, 533 | "node_modules/@types/node-fetch": { 534 | "version": "2.6.4", 535 | "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.4.tgz", 536 | "integrity": "sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg==", 537 | "dependencies": { 538 | "@types/node": "*", 539 | "form-data": "^3.0.0" 540 | } 541 | }, 542 | "node_modules/@types/ws": { 543 | "version": "8.5.5", 544 | "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.5.tgz", 545 | "integrity": "sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg==", 546 | "dependencies": { 547 | "@types/node": "*" 548 | } 549 | }, 550 | "node_modules/acorn": { 551 | "version": "8.10.0", 552 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", 553 | "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", 554 | "dev": true, 555 | "bin": { 556 | "acorn": "bin/acorn" 557 | }, 558 | "engines": { 559 | "node": ">=0.4.0" 560 | } 561 | }, 562 | "node_modules/acorn-walk": { 563 | "version": "8.2.0", 564 | "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", 565 | "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", 566 | "dev": true, 567 | "engines": { 568 | "node": ">=0.4.0" 569 | } 570 | }, 571 | "node_modules/anymatch": { 572 | "version": "3.1.3", 573 | "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", 574 | "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", 575 | "dev": true, 576 | "dependencies": { 577 | "normalize-path": "^3.0.0", 578 | "picomatch": "^2.0.4" 579 | }, 580 | "engines": { 581 | "node": ">= 8" 582 | } 583 | }, 584 | "node_modules/as-table": { 585 | "version": "1.0.55", 586 | "resolved": "https://registry.npmjs.org/as-table/-/as-table-1.0.55.tgz", 587 | "integrity": "sha512-xvsWESUJn0JN421Xb9MQw6AsMHRCUknCe0Wjlxvjud80mU4E6hQf1A6NzQKcYNmYw62MfzEtXc+badstZP3JpQ==", 588 | "dev": true, 589 | "dependencies": { 590 | "printable-characters": "^1.0.42" 591 | } 592 | }, 593 | "node_modules/asynckit": { 594 | "version": "0.4.0", 595 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 596 | "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" 597 | }, 598 | "node_modules/base64-js": { 599 | "version": "1.5.1", 600 | "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", 601 | "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", 602 | "funding": [ 603 | { 604 | "type": "github", 605 | "url": "https://github.com/sponsors/feross" 606 | }, 607 | { 608 | "type": "patreon", 609 | "url": "https://www.patreon.com/feross" 610 | }, 611 | { 612 | "type": "consulting", 613 | "url": "https://feross.org/support" 614 | } 615 | ] 616 | }, 617 | "node_modules/better-sqlite3": { 618 | "version": "8.5.2", 619 | "resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-8.5.2.tgz", 620 | "integrity": "sha512-w/EZ/jwuZF+/47mAVC2+rhR2X/gwkZ+fd1pbX7Y90D5NRaRzDQcxrHY10t6ijGiYIonCVsBSF5v1cay07bP5sg==", 621 | "hasInstallScript": true, 622 | "dependencies": { 623 | "bindings": "^1.5.0", 624 | "prebuild-install": "^7.1.0" 625 | } 626 | }, 627 | "node_modules/big-integer": { 628 | "version": "1.6.51", 629 | "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", 630 | "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==", 631 | "engines": { 632 | "node": ">=0.6" 633 | } 634 | }, 635 | "node_modules/binary-extensions": { 636 | "version": "2.2.0", 637 | "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", 638 | "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", 639 | "dev": true, 640 | "engines": { 641 | "node": ">=8" 642 | } 643 | }, 644 | "node_modules/bindings": { 645 | "version": "1.5.0", 646 | "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", 647 | "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", 648 | "dependencies": { 649 | "file-uri-to-path": "1.0.0" 650 | } 651 | }, 652 | "node_modules/bl": { 653 | "version": "4.1.0", 654 | "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", 655 | "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", 656 | "dependencies": { 657 | "buffer": "^5.5.0", 658 | "inherits": "^2.0.4", 659 | "readable-stream": "^3.4.0" 660 | } 661 | }, 662 | "node_modules/blake3-wasm": { 663 | "version": "2.1.5", 664 | "resolved": "https://registry.npmjs.org/blake3-wasm/-/blake3-wasm-2.1.5.tgz", 665 | "integrity": "sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g==", 666 | "dev": true 667 | }, 668 | "node_modules/braces": { 669 | "version": "3.0.2", 670 | "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", 671 | "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", 672 | "dev": true, 673 | "dependencies": { 674 | "fill-range": "^7.0.1" 675 | }, 676 | "engines": { 677 | "node": ">=8" 678 | } 679 | }, 680 | "node_modules/buffer": { 681 | "version": "5.7.1", 682 | "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", 683 | "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", 684 | "funding": [ 685 | { 686 | "type": "github", 687 | "url": "https://github.com/sponsors/feross" 688 | }, 689 | { 690 | "type": "patreon", 691 | "url": "https://www.patreon.com/feross" 692 | }, 693 | { 694 | "type": "consulting", 695 | "url": "https://feross.org/support" 696 | } 697 | ], 698 | "dependencies": { 699 | "base64-js": "^1.3.1", 700 | "ieee754": "^1.1.13" 701 | } 702 | }, 703 | "node_modules/buffer-from": { 704 | "version": "1.1.2", 705 | "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", 706 | "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", 707 | "dev": true 708 | }, 709 | "node_modules/busboy": { 710 | "version": "1.6.0", 711 | "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", 712 | "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", 713 | "dev": true, 714 | "dependencies": { 715 | "streamsearch": "^1.1.0" 716 | }, 717 | "engines": { 718 | "node": ">=10.16.0" 719 | } 720 | }, 721 | "node_modules/capnp-ts": { 722 | "version": "0.7.0", 723 | "resolved": "https://registry.npmjs.org/capnp-ts/-/capnp-ts-0.7.0.tgz", 724 | "integrity": "sha512-XKxXAC3HVPv7r674zP0VC3RTXz+/JKhfyw94ljvF80yynK6VkTnqE3jMuN8b3dUVmmc43TjyxjW4KTsmB3c86g==", 725 | "dev": true, 726 | "dependencies": { 727 | "debug": "^4.3.1", 728 | "tslib": "^2.2.0" 729 | } 730 | }, 731 | "node_modules/chokidar": { 732 | "version": "3.5.3", 733 | "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", 734 | "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", 735 | "dev": true, 736 | "funding": [ 737 | { 738 | "type": "individual", 739 | "url": "https://paulmillr.com/funding/" 740 | } 741 | ], 742 | "dependencies": { 743 | "anymatch": "~3.1.2", 744 | "braces": "~3.0.2", 745 | "glob-parent": "~5.1.2", 746 | "is-binary-path": "~2.1.0", 747 | "is-glob": "~4.0.1", 748 | "normalize-path": "~3.0.0", 749 | "readdirp": "~3.6.0" 750 | }, 751 | "engines": { 752 | "node": ">= 8.10.0" 753 | }, 754 | "optionalDependencies": { 755 | "fsevents": "~2.3.2" 756 | } 757 | }, 758 | "node_modules/chownr": { 759 | "version": "1.1.4", 760 | "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", 761 | "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" 762 | }, 763 | "node_modules/combined-stream": { 764 | "version": "1.0.8", 765 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", 766 | "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", 767 | "dependencies": { 768 | "delayed-stream": "~1.0.0" 769 | }, 770 | "engines": { 771 | "node": ">= 0.8" 772 | } 773 | }, 774 | "node_modules/cookie": { 775 | "version": "0.5.0", 776 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", 777 | "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", 778 | "dev": true, 779 | "engines": { 780 | "node": ">= 0.6" 781 | } 782 | }, 783 | "node_modules/data-uri-to-buffer": { 784 | "version": "2.0.2", 785 | "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-2.0.2.tgz", 786 | "integrity": "sha512-ND9qDTLc6diwj+Xe5cdAgVTbLVdXbtxTJRXRhli8Mowuaan+0EJOtdqJ0QCHNSSPyoXGx9HX2/VMnKeC34AChA==", 787 | "dev": true 788 | }, 789 | "node_modules/debug": { 790 | "version": "4.3.4", 791 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", 792 | "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", 793 | "dev": true, 794 | "dependencies": { 795 | "ms": "2.1.2" 796 | }, 797 | "engines": { 798 | "node": ">=6.0" 799 | }, 800 | "peerDependenciesMeta": { 801 | "supports-color": { 802 | "optional": true 803 | } 804 | } 805 | }, 806 | "node_modules/decompress-response": { 807 | "version": "6.0.0", 808 | "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", 809 | "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", 810 | "dependencies": { 811 | "mimic-response": "^3.1.0" 812 | }, 813 | "engines": { 814 | "node": ">=10" 815 | }, 816 | "funding": { 817 | "url": "https://github.com/sponsors/sindresorhus" 818 | } 819 | }, 820 | "node_modules/deep-extend": { 821 | "version": "0.6.0", 822 | "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", 823 | "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", 824 | "engines": { 825 | "node": ">=4.0.0" 826 | } 827 | }, 828 | "node_modules/delayed-stream": { 829 | "version": "1.0.0", 830 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 831 | "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", 832 | "engines": { 833 | "node": ">=0.4.0" 834 | } 835 | }, 836 | "node_modules/detect-libc": { 837 | "version": "2.0.2", 838 | "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", 839 | "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", 840 | "engines": { 841 | "node": ">=8" 842 | } 843 | }, 844 | "node_modules/end-of-stream": { 845 | "version": "1.4.4", 846 | "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", 847 | "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", 848 | "dependencies": { 849 | "once": "^1.4.0" 850 | } 851 | }, 852 | "node_modules/esbuild": { 853 | "version": "0.16.3", 854 | "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.16.3.tgz", 855 | "integrity": "sha512-71f7EjPWTiSguen8X/kxEpkAS7BFHwtQKisCDDV3Y4GLGWBaoSCyD5uXkaUew6JDzA9FEN1W23mdnSwW9kqCeg==", 856 | "dev": true, 857 | "hasInstallScript": true, 858 | "bin": { 859 | "esbuild": "bin/esbuild" 860 | }, 861 | "engines": { 862 | "node": ">=12" 863 | }, 864 | "optionalDependencies": { 865 | "@esbuild/android-arm": "0.16.3", 866 | "@esbuild/android-arm64": "0.16.3", 867 | "@esbuild/android-x64": "0.16.3", 868 | "@esbuild/darwin-arm64": "0.16.3", 869 | "@esbuild/darwin-x64": "0.16.3", 870 | "@esbuild/freebsd-arm64": "0.16.3", 871 | "@esbuild/freebsd-x64": "0.16.3", 872 | "@esbuild/linux-arm": "0.16.3", 873 | "@esbuild/linux-arm64": "0.16.3", 874 | "@esbuild/linux-ia32": "0.16.3", 875 | "@esbuild/linux-loong64": "0.16.3", 876 | "@esbuild/linux-mips64el": "0.16.3", 877 | "@esbuild/linux-ppc64": "0.16.3", 878 | "@esbuild/linux-riscv64": "0.16.3", 879 | "@esbuild/linux-s390x": "0.16.3", 880 | "@esbuild/linux-x64": "0.16.3", 881 | "@esbuild/netbsd-x64": "0.16.3", 882 | "@esbuild/openbsd-x64": "0.16.3", 883 | "@esbuild/sunos-x64": "0.16.3", 884 | "@esbuild/win32-arm64": "0.16.3", 885 | "@esbuild/win32-ia32": "0.16.3", 886 | "@esbuild/win32-x64": "0.16.3" 887 | } 888 | }, 889 | "node_modules/escape-string-regexp": { 890 | "version": "4.0.0", 891 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", 892 | "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", 893 | "dev": true, 894 | "engines": { 895 | "node": ">=10" 896 | }, 897 | "funding": { 898 | "url": "https://github.com/sponsors/sindresorhus" 899 | } 900 | }, 901 | "node_modules/estree-walker": { 902 | "version": "0.6.1", 903 | "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", 904 | "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", 905 | "dev": true 906 | }, 907 | "node_modules/exit-hook": { 908 | "version": "2.2.1", 909 | "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-2.2.1.tgz", 910 | "integrity": "sha512-eNTPlAD67BmP31LDINZ3U7HSF8l57TxOY2PmBJ1shpCvpnxBF93mWCE8YHBnXs8qiUZJc9WDcWIeC3a2HIAMfw==", 911 | "dev": true, 912 | "engines": { 913 | "node": ">=6" 914 | }, 915 | "funding": { 916 | "url": "https://github.com/sponsors/sindresorhus" 917 | } 918 | }, 919 | "node_modules/expand-template": { 920 | "version": "2.0.3", 921 | "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", 922 | "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", 923 | "engines": { 924 | "node": ">=6" 925 | } 926 | }, 927 | "node_modules/file-uri-to-path": { 928 | "version": "1.0.0", 929 | "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", 930 | "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" 931 | }, 932 | "node_modules/fill-range": { 933 | "version": "7.0.1", 934 | "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", 935 | "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", 936 | "dev": true, 937 | "dependencies": { 938 | "to-regex-range": "^5.0.1" 939 | }, 940 | "engines": { 941 | "node": ">=8" 942 | } 943 | }, 944 | "node_modules/form-data": { 945 | "version": "3.0.1", 946 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", 947 | "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", 948 | "dependencies": { 949 | "asynckit": "^0.4.0", 950 | "combined-stream": "^1.0.8", 951 | "mime-types": "^2.1.12" 952 | }, 953 | "engines": { 954 | "node": ">= 6" 955 | } 956 | }, 957 | "node_modules/fs-constants": { 958 | "version": "1.0.0", 959 | "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", 960 | "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" 961 | }, 962 | "node_modules/fsevents": { 963 | "version": "2.3.3", 964 | "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", 965 | "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", 966 | "dev": true, 967 | "hasInstallScript": true, 968 | "optional": true, 969 | "os": [ 970 | "darwin" 971 | ], 972 | "engines": { 973 | "node": "^8.16.0 || ^10.6.0 || >=11.0.0" 974 | } 975 | }, 976 | "node_modules/get-source": { 977 | "version": "2.0.12", 978 | "resolved": "https://registry.npmjs.org/get-source/-/get-source-2.0.12.tgz", 979 | "integrity": "sha512-X5+4+iD+HoSeEED+uwrQ07BOQr0kEDFMVqqpBuI+RaZBpBpHCuXxo70bjar6f0b0u/DQJsJ7ssurpP0V60Az+w==", 980 | "dev": true, 981 | "dependencies": { 982 | "data-uri-to-buffer": "^2.0.0", 983 | "source-map": "^0.6.1" 984 | } 985 | }, 986 | "node_modules/get-source/node_modules/source-map": { 987 | "version": "0.6.1", 988 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", 989 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", 990 | "dev": true, 991 | "engines": { 992 | "node": ">=0.10.0" 993 | } 994 | }, 995 | "node_modules/github-from-package": { 996 | "version": "0.0.0", 997 | "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", 998 | "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==" 999 | }, 1000 | "node_modules/glob-parent": { 1001 | "version": "5.1.2", 1002 | "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", 1003 | "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", 1004 | "dev": true, 1005 | "dependencies": { 1006 | "is-glob": "^4.0.1" 1007 | }, 1008 | "engines": { 1009 | "node": ">= 6" 1010 | } 1011 | }, 1012 | "node_modules/glob-to-regexp": { 1013 | "version": "0.4.1", 1014 | "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", 1015 | "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", 1016 | "dev": true 1017 | }, 1018 | "node_modules/http-cache-semantics": { 1019 | "version": "4.1.1", 1020 | "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", 1021 | "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", 1022 | "dev": true 1023 | }, 1024 | "node_modules/ieee754": { 1025 | "version": "1.2.1", 1026 | "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", 1027 | "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", 1028 | "funding": [ 1029 | { 1030 | "type": "github", 1031 | "url": "https://github.com/sponsors/feross" 1032 | }, 1033 | { 1034 | "type": "patreon", 1035 | "url": "https://www.patreon.com/feross" 1036 | }, 1037 | { 1038 | "type": "consulting", 1039 | "url": "https://feross.org/support" 1040 | } 1041 | ] 1042 | }, 1043 | "node_modules/inherits": { 1044 | "version": "2.0.4", 1045 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 1046 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 1047 | }, 1048 | "node_modules/ini": { 1049 | "version": "1.3.8", 1050 | "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", 1051 | "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" 1052 | }, 1053 | "node_modules/is-binary-path": { 1054 | "version": "2.1.0", 1055 | "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", 1056 | "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", 1057 | "dev": true, 1058 | "dependencies": { 1059 | "binary-extensions": "^2.0.0" 1060 | }, 1061 | "engines": { 1062 | "node": ">=8" 1063 | } 1064 | }, 1065 | "node_modules/is-extglob": { 1066 | "version": "2.1.1", 1067 | "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", 1068 | "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", 1069 | "dev": true, 1070 | "engines": { 1071 | "node": ">=0.10.0" 1072 | } 1073 | }, 1074 | "node_modules/is-glob": { 1075 | "version": "4.0.3", 1076 | "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", 1077 | "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", 1078 | "dev": true, 1079 | "dependencies": { 1080 | "is-extglob": "^2.1.1" 1081 | }, 1082 | "engines": { 1083 | "node": ">=0.10.0" 1084 | } 1085 | }, 1086 | "node_modules/is-number": { 1087 | "version": "7.0.0", 1088 | "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", 1089 | "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", 1090 | "dev": true, 1091 | "engines": { 1092 | "node": ">=0.12.0" 1093 | } 1094 | }, 1095 | "node_modules/itty-router": { 1096 | "version": "4.0.22", 1097 | "resolved": "https://registry.npmjs.org/itty-router/-/itty-router-4.0.22.tgz", 1098 | "integrity": "sha512-FWK13vcITqld32NaOh+k2unRrR4qBZdzA9O1ctpqT1Q4lxKrHbtgaX1lLTv2VyXj3/8Waqk/NlDGNfxypJ8GKA==" 1099 | }, 1100 | "node_modules/js-base64": { 1101 | "version": "3.7.5", 1102 | "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.5.tgz", 1103 | "integrity": "sha512-3MEt5DTINKqfScXKfJFrRbxkrnk2AxPWGBL/ycjz4dK8iqiSJ06UxD8jh8xuh6p10TX4t2+7FsBYVxxQbMg+qA==" 1104 | }, 1105 | "node_modules/kleur": { 1106 | "version": "4.1.5", 1107 | "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", 1108 | "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", 1109 | "dev": true, 1110 | "engines": { 1111 | "node": ">=6" 1112 | } 1113 | }, 1114 | "node_modules/lru-cache": { 1115 | "version": "6.0.0", 1116 | "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", 1117 | "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", 1118 | "dependencies": { 1119 | "yallist": "^4.0.0" 1120 | }, 1121 | "engines": { 1122 | "node": ">=10" 1123 | } 1124 | }, 1125 | "node_modules/magic-string": { 1126 | "version": "0.25.9", 1127 | "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", 1128 | "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", 1129 | "dev": true, 1130 | "dependencies": { 1131 | "sourcemap-codec": "^1.4.8" 1132 | } 1133 | }, 1134 | "node_modules/mime": { 1135 | "version": "3.0.0", 1136 | "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", 1137 | "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", 1138 | "dev": true, 1139 | "bin": { 1140 | "mime": "cli.js" 1141 | }, 1142 | "engines": { 1143 | "node": ">=10.0.0" 1144 | } 1145 | }, 1146 | "node_modules/mime-db": { 1147 | "version": "1.52.0", 1148 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", 1149 | "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", 1150 | "engines": { 1151 | "node": ">= 0.6" 1152 | } 1153 | }, 1154 | "node_modules/mime-types": { 1155 | "version": "2.1.35", 1156 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", 1157 | "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", 1158 | "dependencies": { 1159 | "mime-db": "1.52.0" 1160 | }, 1161 | "engines": { 1162 | "node": ">= 0.6" 1163 | } 1164 | }, 1165 | "node_modules/mimic-response": { 1166 | "version": "3.1.0", 1167 | "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", 1168 | "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", 1169 | "engines": { 1170 | "node": ">=10" 1171 | }, 1172 | "funding": { 1173 | "url": "https://github.com/sponsors/sindresorhus" 1174 | } 1175 | }, 1176 | "node_modules/miniflare": { 1177 | "version": "3.20230814.1", 1178 | "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20230814.1.tgz", 1179 | "integrity": "sha512-LMgqd1Ut0+fnlvQepVbbBYQczQnyuuap8bgUwOyPETka0S9NR9NxMQSNaBgVZ0uOaG7xMJ/OVTRlz+TGB86PWA==", 1180 | "dev": true, 1181 | "dependencies": { 1182 | "acorn": "^8.8.0", 1183 | "acorn-walk": "^8.2.0", 1184 | "better-sqlite3": "^8.1.0", 1185 | "capnp-ts": "^0.7.0", 1186 | "exit-hook": "^2.2.1", 1187 | "glob-to-regexp": "^0.4.1", 1188 | "http-cache-semantics": "^4.1.0", 1189 | "kleur": "^4.1.5", 1190 | "set-cookie-parser": "^2.6.0", 1191 | "source-map-support": "0.5.21", 1192 | "stoppable": "^1.1.0", 1193 | "undici": "^5.13.0", 1194 | "workerd": "1.20230814.1", 1195 | "ws": "^8.11.0", 1196 | "youch": "^3.2.2", 1197 | "zod": "^3.20.6" 1198 | }, 1199 | "engines": { 1200 | "node": ">=16.13" 1201 | } 1202 | }, 1203 | "node_modules/minimist": { 1204 | "version": "1.2.8", 1205 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", 1206 | "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", 1207 | "funding": { 1208 | "url": "https://github.com/sponsors/ljharb" 1209 | } 1210 | }, 1211 | "node_modules/mkdirp-classic": { 1212 | "version": "0.5.3", 1213 | "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", 1214 | "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" 1215 | }, 1216 | "node_modules/ms": { 1217 | "version": "2.1.2", 1218 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 1219 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", 1220 | "dev": true 1221 | }, 1222 | "node_modules/mustache": { 1223 | "version": "4.2.0", 1224 | "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", 1225 | "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", 1226 | "dev": true, 1227 | "bin": { 1228 | "mustache": "bin/mustache" 1229 | } 1230 | }, 1231 | "node_modules/nanoid": { 1232 | "version": "3.3.6", 1233 | "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", 1234 | "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", 1235 | "dev": true, 1236 | "funding": [ 1237 | { 1238 | "type": "github", 1239 | "url": "https://github.com/sponsors/ai" 1240 | } 1241 | ], 1242 | "bin": { 1243 | "nanoid": "bin/nanoid.cjs" 1244 | }, 1245 | "engines": { 1246 | "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" 1247 | } 1248 | }, 1249 | "node_modules/napi-build-utils": { 1250 | "version": "1.0.2", 1251 | "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", 1252 | "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==" 1253 | }, 1254 | "node_modules/node-abi": { 1255 | "version": "3.47.0", 1256 | "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.47.0.tgz", 1257 | "integrity": "sha512-2s6B2CWZM//kPgwnuI0KrYwNjfdByE25zvAaEpq9IH4zcNsarH8Ihu/UuX6XMPEogDAxkuUFeZn60pXNHAqn3A==", 1258 | "dependencies": { 1259 | "semver": "^7.3.5" 1260 | }, 1261 | "engines": { 1262 | "node": ">=10" 1263 | } 1264 | }, 1265 | "node_modules/node-fetch": { 1266 | "version": "2.7.0", 1267 | "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", 1268 | "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", 1269 | "dependencies": { 1270 | "whatwg-url": "^5.0.0" 1271 | }, 1272 | "engines": { 1273 | "node": "4.x || >=6.0.0" 1274 | }, 1275 | "peerDependencies": { 1276 | "encoding": "^0.1.0" 1277 | }, 1278 | "peerDependenciesMeta": { 1279 | "encoding": { 1280 | "optional": true 1281 | } 1282 | } 1283 | }, 1284 | "node_modules/node-forge": { 1285 | "version": "1.3.1", 1286 | "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", 1287 | "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", 1288 | "dev": true, 1289 | "engines": { 1290 | "node": ">= 6.13.0" 1291 | } 1292 | }, 1293 | "node_modules/node-sql-parser": { 1294 | "version": "4.9.0", 1295 | "resolved": "https://registry.npmjs.org/node-sql-parser/-/node-sql-parser-4.9.0.tgz", 1296 | "integrity": "sha512-8Bob5oXkWdZ65CgIzMj8mHKsxkbKDdfm0FI7Tkm7J5Ar5Oo6BSyF4HBS+RQWJffzmdGBNWmjazPF9amdgUlUCA==", 1297 | "dependencies": { 1298 | "big-integer": "^1.6.48" 1299 | }, 1300 | "engines": { 1301 | "node": ">=8" 1302 | } 1303 | }, 1304 | "node_modules/normalize-path": { 1305 | "version": "3.0.0", 1306 | "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", 1307 | "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", 1308 | "dev": true, 1309 | "engines": { 1310 | "node": ">=0.10.0" 1311 | } 1312 | }, 1313 | "node_modules/once": { 1314 | "version": "1.4.0", 1315 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 1316 | "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", 1317 | "dependencies": { 1318 | "wrappy": "1" 1319 | } 1320 | }, 1321 | "node_modules/path-to-regexp": { 1322 | "version": "6.2.1", 1323 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz", 1324 | "integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==", 1325 | "dev": true 1326 | }, 1327 | "node_modules/picomatch": { 1328 | "version": "2.3.1", 1329 | "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", 1330 | "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", 1331 | "dev": true, 1332 | "engines": { 1333 | "node": ">=8.6" 1334 | }, 1335 | "funding": { 1336 | "url": "https://github.com/sponsors/jonschlinkert" 1337 | } 1338 | }, 1339 | "node_modules/prebuild-install": { 1340 | "version": "7.1.1", 1341 | "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz", 1342 | "integrity": "sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==", 1343 | "dependencies": { 1344 | "detect-libc": "^2.0.0", 1345 | "expand-template": "^2.0.3", 1346 | "github-from-package": "0.0.0", 1347 | "minimist": "^1.2.3", 1348 | "mkdirp-classic": "^0.5.3", 1349 | "napi-build-utils": "^1.0.1", 1350 | "node-abi": "^3.3.0", 1351 | "pump": "^3.0.0", 1352 | "rc": "^1.2.7", 1353 | "simple-get": "^4.0.0", 1354 | "tar-fs": "^2.0.0", 1355 | "tunnel-agent": "^0.6.0" 1356 | }, 1357 | "bin": { 1358 | "prebuild-install": "bin.js" 1359 | }, 1360 | "engines": { 1361 | "node": ">=10" 1362 | } 1363 | }, 1364 | "node_modules/printable-characters": { 1365 | "version": "1.0.42", 1366 | "resolved": "https://registry.npmjs.org/printable-characters/-/printable-characters-1.0.42.tgz", 1367 | "integrity": "sha512-dKp+C4iXWK4vVYZmYSd0KBH5F/h1HoZRsbJ82AVKRO3PEo8L4lBS/vLwhVtpwwuYcoIsVY+1JYKR268yn480uQ==", 1368 | "dev": true 1369 | }, 1370 | "node_modules/pump": { 1371 | "version": "3.0.0", 1372 | "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", 1373 | "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", 1374 | "dependencies": { 1375 | "end-of-stream": "^1.1.0", 1376 | "once": "^1.3.1" 1377 | } 1378 | }, 1379 | "node_modules/rc": { 1380 | "version": "1.2.8", 1381 | "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", 1382 | "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", 1383 | "dependencies": { 1384 | "deep-extend": "^0.6.0", 1385 | "ini": "~1.3.0", 1386 | "minimist": "^1.2.0", 1387 | "strip-json-comments": "~2.0.1" 1388 | }, 1389 | "bin": { 1390 | "rc": "cli.js" 1391 | } 1392 | }, 1393 | "node_modules/readable-stream": { 1394 | "version": "3.6.2", 1395 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", 1396 | "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", 1397 | "dependencies": { 1398 | "inherits": "^2.0.3", 1399 | "string_decoder": "^1.1.1", 1400 | "util-deprecate": "^1.0.1" 1401 | }, 1402 | "engines": { 1403 | "node": ">= 6" 1404 | } 1405 | }, 1406 | "node_modules/readdirp": { 1407 | "version": "3.6.0", 1408 | "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", 1409 | "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", 1410 | "dev": true, 1411 | "dependencies": { 1412 | "picomatch": "^2.2.1" 1413 | }, 1414 | "engines": { 1415 | "node": ">=8.10.0" 1416 | } 1417 | }, 1418 | "node_modules/rollup-plugin-inject": { 1419 | "version": "3.0.2", 1420 | "resolved": "https://registry.npmjs.org/rollup-plugin-inject/-/rollup-plugin-inject-3.0.2.tgz", 1421 | "integrity": "sha512-ptg9PQwzs3orn4jkgXJ74bfs5vYz1NCZlSQMBUA0wKcGp5i5pA1AO3fOUEte8enhGUC+iapTCzEWw2jEFFUO/w==", 1422 | "deprecated": "This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.", 1423 | "dev": true, 1424 | "dependencies": { 1425 | "estree-walker": "^0.6.1", 1426 | "magic-string": "^0.25.3", 1427 | "rollup-pluginutils": "^2.8.1" 1428 | } 1429 | }, 1430 | "node_modules/rollup-plugin-node-polyfills": { 1431 | "version": "0.2.1", 1432 | "resolved": "https://registry.npmjs.org/rollup-plugin-node-polyfills/-/rollup-plugin-node-polyfills-0.2.1.tgz", 1433 | "integrity": "sha512-4kCrKPTJ6sK4/gLL/U5QzVT8cxJcofO0OU74tnB19F40cmuAKSzH5/siithxlofFEjwvw1YAhPmbvGNA6jEroA==", 1434 | "dev": true, 1435 | "dependencies": { 1436 | "rollup-plugin-inject": "^3.0.0" 1437 | } 1438 | }, 1439 | "node_modules/rollup-pluginutils": { 1440 | "version": "2.8.2", 1441 | "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", 1442 | "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", 1443 | "dev": true, 1444 | "dependencies": { 1445 | "estree-walker": "^0.6.1" 1446 | } 1447 | }, 1448 | "node_modules/safe-buffer": { 1449 | "version": "5.2.1", 1450 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 1451 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", 1452 | "funding": [ 1453 | { 1454 | "type": "github", 1455 | "url": "https://github.com/sponsors/feross" 1456 | }, 1457 | { 1458 | "type": "patreon", 1459 | "url": "https://www.patreon.com/feross" 1460 | }, 1461 | { 1462 | "type": "consulting", 1463 | "url": "https://feross.org/support" 1464 | } 1465 | ] 1466 | }, 1467 | "node_modules/selfsigned": { 1468 | "version": "2.1.1", 1469 | "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-2.1.1.tgz", 1470 | "integrity": "sha512-GSL3aowiF7wa/WtSFwnUrludWFoNhftq8bUkH9pkzjpN2XSPOAYEgg6e0sS9s0rZwgJzJiQRPU18A6clnoW5wQ==", 1471 | "dev": true, 1472 | "dependencies": { 1473 | "node-forge": "^1" 1474 | }, 1475 | "engines": { 1476 | "node": ">=10" 1477 | } 1478 | }, 1479 | "node_modules/semver": { 1480 | "version": "7.5.4", 1481 | "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", 1482 | "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", 1483 | "dependencies": { 1484 | "lru-cache": "^6.0.0" 1485 | }, 1486 | "bin": { 1487 | "semver": "bin/semver.js" 1488 | }, 1489 | "engines": { 1490 | "node": ">=10" 1491 | } 1492 | }, 1493 | "node_modules/set-cookie-parser": { 1494 | "version": "2.6.0", 1495 | "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.6.0.tgz", 1496 | "integrity": "sha512-RVnVQxTXuerk653XfuliOxBP81Sf0+qfQE73LIYKcyMYHG94AuH0kgrQpRDuTZnSmjpysHmzxJXKNfa6PjFhyQ==", 1497 | "dev": true 1498 | }, 1499 | "node_modules/simple-concat": { 1500 | "version": "1.0.1", 1501 | "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", 1502 | "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", 1503 | "funding": [ 1504 | { 1505 | "type": "github", 1506 | "url": "https://github.com/sponsors/feross" 1507 | }, 1508 | { 1509 | "type": "patreon", 1510 | "url": "https://www.patreon.com/feross" 1511 | }, 1512 | { 1513 | "type": "consulting", 1514 | "url": "https://feross.org/support" 1515 | } 1516 | ] 1517 | }, 1518 | "node_modules/simple-get": { 1519 | "version": "4.0.1", 1520 | "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", 1521 | "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", 1522 | "funding": [ 1523 | { 1524 | "type": "github", 1525 | "url": "https://github.com/sponsors/feross" 1526 | }, 1527 | { 1528 | "type": "patreon", 1529 | "url": "https://www.patreon.com/feross" 1530 | }, 1531 | { 1532 | "type": "consulting", 1533 | "url": "https://feross.org/support" 1534 | } 1535 | ], 1536 | "dependencies": { 1537 | "decompress-response": "^6.0.0", 1538 | "once": "^1.3.1", 1539 | "simple-concat": "^1.0.0" 1540 | } 1541 | }, 1542 | "node_modules/source-map": { 1543 | "version": "0.7.4", 1544 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", 1545 | "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", 1546 | "dev": true, 1547 | "engines": { 1548 | "node": ">= 8" 1549 | } 1550 | }, 1551 | "node_modules/source-map-support": { 1552 | "version": "0.5.21", 1553 | "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", 1554 | "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", 1555 | "dev": true, 1556 | "dependencies": { 1557 | "buffer-from": "^1.0.0", 1558 | "source-map": "^0.6.0" 1559 | } 1560 | }, 1561 | "node_modules/source-map-support/node_modules/source-map": { 1562 | "version": "0.6.1", 1563 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", 1564 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", 1565 | "dev": true, 1566 | "engines": { 1567 | "node": ">=0.10.0" 1568 | } 1569 | }, 1570 | "node_modules/sourcemap-codec": { 1571 | "version": "1.4.8", 1572 | "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", 1573 | "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", 1574 | "deprecated": "Please use @jridgewell/sourcemap-codec instead", 1575 | "dev": true 1576 | }, 1577 | "node_modules/stacktracey": { 1578 | "version": "2.1.8", 1579 | "resolved": "https://registry.npmjs.org/stacktracey/-/stacktracey-2.1.8.tgz", 1580 | "integrity": "sha512-Kpij9riA+UNg7TnphqjH7/CzctQ/owJGNbFkfEeve4Z4uxT5+JapVLFXcsurIfN34gnTWZNJ/f7NMG0E8JDzTw==", 1581 | "dev": true, 1582 | "dependencies": { 1583 | "as-table": "^1.0.36", 1584 | "get-source": "^2.0.12" 1585 | } 1586 | }, 1587 | "node_modules/stoppable": { 1588 | "version": "1.1.0", 1589 | "resolved": "https://registry.npmjs.org/stoppable/-/stoppable-1.1.0.tgz", 1590 | "integrity": "sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw==", 1591 | "dev": true, 1592 | "engines": { 1593 | "node": ">=4", 1594 | "npm": ">=6" 1595 | } 1596 | }, 1597 | "node_modules/streamsearch": { 1598 | "version": "1.1.0", 1599 | "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", 1600 | "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", 1601 | "dev": true, 1602 | "engines": { 1603 | "node": ">=10.0.0" 1604 | } 1605 | }, 1606 | "node_modules/string_decoder": { 1607 | "version": "1.3.0", 1608 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", 1609 | "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", 1610 | "dependencies": { 1611 | "safe-buffer": "~5.2.0" 1612 | } 1613 | }, 1614 | "node_modules/strip-json-comments": { 1615 | "version": "2.0.1", 1616 | "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", 1617 | "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", 1618 | "engines": { 1619 | "node": ">=0.10.0" 1620 | } 1621 | }, 1622 | "node_modules/tar-fs": { 1623 | "version": "2.1.1", 1624 | "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", 1625 | "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", 1626 | "dependencies": { 1627 | "chownr": "^1.1.1", 1628 | "mkdirp-classic": "^0.5.2", 1629 | "pump": "^3.0.0", 1630 | "tar-stream": "^2.1.4" 1631 | } 1632 | }, 1633 | "node_modules/tar-stream": { 1634 | "version": "2.2.0", 1635 | "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", 1636 | "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", 1637 | "dependencies": { 1638 | "bl": "^4.0.3", 1639 | "end-of-stream": "^1.4.1", 1640 | "fs-constants": "^1.0.0", 1641 | "inherits": "^2.0.3", 1642 | "readable-stream": "^3.1.1" 1643 | }, 1644 | "engines": { 1645 | "node": ">=6" 1646 | } 1647 | }, 1648 | "node_modules/to-regex-range": { 1649 | "version": "5.0.1", 1650 | "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", 1651 | "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", 1652 | "dev": true, 1653 | "dependencies": { 1654 | "is-number": "^7.0.0" 1655 | }, 1656 | "engines": { 1657 | "node": ">=8.0" 1658 | } 1659 | }, 1660 | "node_modules/tr46": { 1661 | "version": "0.0.3", 1662 | "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", 1663 | "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" 1664 | }, 1665 | "node_modules/tslib": { 1666 | "version": "2.6.2", 1667 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", 1668 | "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", 1669 | "dev": true 1670 | }, 1671 | "node_modules/tunnel-agent": { 1672 | "version": "0.6.0", 1673 | "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", 1674 | "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", 1675 | "dependencies": { 1676 | "safe-buffer": "^5.0.1" 1677 | }, 1678 | "engines": { 1679 | "node": "*" 1680 | } 1681 | }, 1682 | "node_modules/typescript": { 1683 | "version": "5.2.2", 1684 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", 1685 | "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", 1686 | "dev": true, 1687 | "bin": { 1688 | "tsc": "bin/tsc", 1689 | "tsserver": "bin/tsserver" 1690 | }, 1691 | "engines": { 1692 | "node": ">=14.17" 1693 | } 1694 | }, 1695 | "node_modules/undici": { 1696 | "version": "5.23.0", 1697 | "resolved": "https://registry.npmjs.org/undici/-/undici-5.23.0.tgz", 1698 | "integrity": "sha512-1D7w+fvRsqlQ9GscLBwcAJinqcZGHUKjbOmXdlE/v8BvEGXjeWAax+341q44EuTcHXXnfyKNbKRq4Lg7OzhMmg==", 1699 | "dev": true, 1700 | "dependencies": { 1701 | "busboy": "^1.6.0" 1702 | }, 1703 | "engines": { 1704 | "node": ">=14.0" 1705 | } 1706 | }, 1707 | "node_modules/util-deprecate": { 1708 | "version": "1.0.2", 1709 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 1710 | "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" 1711 | }, 1712 | "node_modules/webidl-conversions": { 1713 | "version": "3.0.1", 1714 | "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", 1715 | "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" 1716 | }, 1717 | "node_modules/whatwg-url": { 1718 | "version": "5.0.0", 1719 | "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", 1720 | "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", 1721 | "dependencies": { 1722 | "tr46": "~0.0.3", 1723 | "webidl-conversions": "^3.0.0" 1724 | } 1725 | }, 1726 | "node_modules/workerd": { 1727 | "version": "1.20230814.1", 1728 | "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20230814.1.tgz", 1729 | "integrity": "sha512-zJeSEteXuAD+bpYJT8WvzTAHvIAkKPVxOV+Jy6zCLKz5e08N3OUbAF+wrvGWc8b2aB1sj+IYsdXfkv4puH+qXQ==", 1730 | "dev": true, 1731 | "hasInstallScript": true, 1732 | "bin": { 1733 | "workerd": "bin/workerd" 1734 | }, 1735 | "engines": { 1736 | "node": ">=16" 1737 | }, 1738 | "optionalDependencies": { 1739 | "@cloudflare/workerd-darwin-64": "1.20230814.1", 1740 | "@cloudflare/workerd-darwin-arm64": "1.20230814.1", 1741 | "@cloudflare/workerd-linux-64": "1.20230814.1", 1742 | "@cloudflare/workerd-linux-arm64": "1.20230814.1", 1743 | "@cloudflare/workerd-windows-64": "1.20230814.1" 1744 | } 1745 | }, 1746 | "node_modules/wrangler": { 1747 | "version": "3.6.0", 1748 | "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-3.6.0.tgz", 1749 | "integrity": "sha512-GWs4+gIUK+086svW/TgFhhxxrl/hdW2L7WASbdc10dJT7yFmCXse0SnHiqWUxbFu3ScP2t3a3LszJ08wwolWHg==", 1750 | "dev": true, 1751 | "dependencies": { 1752 | "@cloudflare/kv-asset-handler": "^0.2.0", 1753 | "@esbuild-plugins/node-globals-polyfill": "^0.1.1", 1754 | "@esbuild-plugins/node-modules-polyfill": "^0.1.4", 1755 | "blake3-wasm": "^2.1.5", 1756 | "chokidar": "^3.5.3", 1757 | "esbuild": "0.16.3", 1758 | "miniflare": "3.20230814.1", 1759 | "nanoid": "^3.3.3", 1760 | "path-to-regexp": "^6.2.0", 1761 | "selfsigned": "^2.0.1", 1762 | "source-map": "^0.7.4", 1763 | "xxhash-wasm": "^1.0.1" 1764 | }, 1765 | "bin": { 1766 | "wrangler": "bin/wrangler.js", 1767 | "wrangler2": "bin/wrangler.js" 1768 | }, 1769 | "engines": { 1770 | "node": ">=16.13.0" 1771 | }, 1772 | "optionalDependencies": { 1773 | "fsevents": "~2.3.2" 1774 | } 1775 | }, 1776 | "node_modules/wrappy": { 1777 | "version": "1.0.2", 1778 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 1779 | "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" 1780 | }, 1781 | "node_modules/ws": { 1782 | "version": "8.13.0", 1783 | "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", 1784 | "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", 1785 | "engines": { 1786 | "node": ">=10.0.0" 1787 | }, 1788 | "peerDependencies": { 1789 | "bufferutil": "^4.0.1", 1790 | "utf-8-validate": ">=5.0.2" 1791 | }, 1792 | "peerDependenciesMeta": { 1793 | "bufferutil": { 1794 | "optional": true 1795 | }, 1796 | "utf-8-validate": { 1797 | "optional": true 1798 | } 1799 | } 1800 | }, 1801 | "node_modules/xxhash-wasm": { 1802 | "version": "1.0.2", 1803 | "resolved": "https://registry.npmjs.org/xxhash-wasm/-/xxhash-wasm-1.0.2.tgz", 1804 | "integrity": "sha512-ibF0Or+FivM9lNrg+HGJfVX8WJqgo+kCLDc4vx6xMeTce7Aj+DLttKbxxRR/gNLSAelRc1omAPlJ77N/Jem07A==", 1805 | "dev": true 1806 | }, 1807 | "node_modules/yallist": { 1808 | "version": "4.0.0", 1809 | "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", 1810 | "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" 1811 | }, 1812 | "node_modules/youch": { 1813 | "version": "3.2.3", 1814 | "resolved": "https://registry.npmjs.org/youch/-/youch-3.2.3.tgz", 1815 | "integrity": "sha512-ZBcWz/uzZaQVdCvfV4uk616Bbpf2ee+F/AvuKDR5EwX/Y4v06xWdtMluqTD7+KlZdM93lLm9gMZYo0sKBS0pgw==", 1816 | "dev": true, 1817 | "dependencies": { 1818 | "cookie": "^0.5.0", 1819 | "mustache": "^4.2.0", 1820 | "stacktracey": "^2.1.8" 1821 | } 1822 | }, 1823 | "node_modules/zod": { 1824 | "version": "3.22.2", 1825 | "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.2.tgz", 1826 | "integrity": "sha512-wvWkphh5WQsJbVk1tbx1l1Ly4yg+XecD+Mq280uBGt9wa5BKSWf4Mhp6GmrkPixhMxmabYY7RbzlwVP32pbGCg==", 1827 | "dev": true, 1828 | "funding": { 1829 | "url": "https://github.com/sponsors/colinhacks" 1830 | } 1831 | } 1832 | } 1833 | } 1834 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "turso-auth", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "deploy": "wrangler deploy", 7 | "start": "wrangler dev" 8 | }, 9 | "devDependencies": { 10 | "@cloudflare/workers-types": "^4.20230419.0", 11 | "typescript": "^5.0.4", 12 | "wrangler": "^3.0.0" 13 | }, 14 | "dependencies": { 15 | "@libsql/client": "^0.3.1", 16 | "itty-router": "^4.0.22", 17 | "node-sql-parser": "^4.9.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/rls.ts: -------------------------------------------------------------------------------- 1 | import { Client as LibsqlClient, ResultSet, Row } from "@libsql/client/web"; 2 | import { Parser } from "node-sql-parser"; 3 | 4 | export async function secureQuery(client: LibsqlClient, query: string, user: Row, policies: ResultSet | undefined) : Promise{ 5 | // Check that this user is allowed to run this query 6 | // If necessary, this can add additional WHERE clauses and modify incoming/new values 7 | // If not allowed, throw error with message 8 | if(!user) throw new Error("user missing"); 9 | const parser = new Parser(); 10 | const opt = {database: 'sqlite'}; 11 | let { ast } = parser.parse(query, opt); 12 | 13 | if(Array.isArray(ast)) { 14 | if (ast.length != 1) throw new Error("Only one SQL statement per query is allowed"); 15 | ast = ast[0]; 16 | } 17 | // console.log(JSON.stringify(ast, null, 2)); 18 | if(ast.type == "alter" || ast.type == "create" || ast.type == "use" || ast.type == "replace") 19 | throw new Error("Operation disallowed"); 20 | 21 | if(ast.type == 'select') 22 | if (ast.from == null || ast.from.length != 1) 23 | throw new Error("SELECT only from one table for now"); 24 | 25 | let table_name = ast.type == 'select' ? ast.from![0].table : ast.table[0].table; 26 | 27 | let action: ("select" | "update" | "insert" | "delete") = ast.type; 28 | 29 | if(!policies) throw new Error("Policies not yet fetched"); 30 | let policy: Row | undefined = policies.rows.find(r => r["table_name"] == table_name && r["action"] == action); 31 | if(!policy) throw new Error("Operation disallowed by policy"); 32 | 33 | let using_clause = policy["using_clause"] as string; 34 | let with_check_clause = policy["withcheck_clause"] as string; 35 | 36 | // Apply with_check_clause to new values for insert and update 37 | // console.log("ast=", JSON.stringify((ast as any), null, 2), {with_check_clause}, {using_clause}); 38 | if(with_check_clause){ 39 | with_check_clause = with_check_clause 40 | .replaceAll('$$CURRENT_USER$$', `'${user.id as string}'`) 41 | .replaceAll('$$CURRENT_ROLE$$', `'${user.role as string}'`); 42 | if (ast.type == "insert"){ 43 | ast.values = ast.values.filter(val => { 44 | // check if new values satisfy the with_check_clause 45 | // column names might not be present!! 46 | let row : {[key: string]: any} = {}; 47 | (ast as any).columns.forEach((col: string, index: number) => { 48 | row[col] = val.value[index].value 49 | }); 50 | let result = evaluateSQLExpression(row, with_check_clause, parser); 51 | console.log({result}); 52 | return result; 53 | }); 54 | if(ast.values.length == 0) throw new Error("all inserts rejected by withcheck policy"); 55 | } else if (ast.type == "update"){ 56 | // check SET column_name = value for satisfying with_check_clause 57 | let row : {[key: string]: any} = {}; 58 | (ast as any).set.forEach((assignment: any, index: number) => { 59 | row[assignment.column] = assignment.value.value; 60 | }); 61 | let result = evaluateSQLExpression(row, with_check_clause, parser); 62 | console.log({result}); 63 | if(!result) throw new Error(`updates violate withcheck policy on ${table_name}`); 64 | } 65 | } 66 | 67 | if(using_clause){ 68 | if (ast.type == "select" || ast.type == "update" || ast.type == "delete"){ 69 | // Apply using clause as WHERE select, delete, update 70 | using_clause = using_clause 71 | .replaceAll('$$CURRENT_USER$$', `'${user.id as string}'`) 72 | .replaceAll('$$CURRENT_ROLE$$', `'${user.role as string}'`); 73 | let expr = parseSQLExpression(using_clause, parser); 74 | if((ast as any).where == null) { 75 | (ast as any).where = expr; 76 | } else { 77 | (ast as any).where = { 78 | type: "binary_expr", 79 | operator: "AND", 80 | left: expr, 81 | right: (ast as any).where 82 | } 83 | } 84 | } 85 | } 86 | 87 | // console.log("ast=", JSON.stringify(ast as any, null, 2)); 88 | return parser.sqlify(ast, opt); 89 | } 90 | 91 | function parseSQLExpression(clause: string, parser: Parser){ 92 | const sql = `SELECT (${clause}) AS result`; 93 | console.log({sql}); 94 | const { ast } = parser.parse(sql); 95 | // console.log({ast}); 96 | return (ast as any).columns[0].expr; 97 | } 98 | 99 | function evaluateSQLExpression(obj: any, clause: string, parser: Parser) { 100 | // evaluate boolean expressions as if running on object obj being the row 101 | console.log("evaluateSQLExpression", obj, clause); 102 | const sql = `SELECT (${clause}) AS result`; 103 | // console.log({sql}); 104 | const { ast } = parser.parse(sql); 105 | const result = evaluateAST((ast as any).columns[0].expr, obj); 106 | return !!result; // Convert result to boolean 107 | } 108 | 109 | function evaluateAST(ast: any, obj: { [key: string]: string }) { 110 | console.log("evaluateAST", ast, obj); 111 | if (ast.type === 'binary_expr') { 112 | const leftValue: any = evaluateAST(ast.left, obj); 113 | const rightValue: any = evaluateAST(ast.right, obj); 114 | console.log({leftValue}, {rightValue}, ast.operator); 115 | 116 | switch (ast.operator) { 117 | case '+': return leftValue + rightValue; 118 | case '-': return leftValue - rightValue; 119 | case '*': return leftValue * rightValue; 120 | case '/': return leftValue / rightValue; 121 | case '>': return leftValue > rightValue; 122 | case '>=': return leftValue >= rightValue; 123 | case '<': return leftValue < rightValue; 124 | case '<=': return leftValue <= rightValue; 125 | case '=': return leftValue === rightValue; 126 | case 'AND': return leftValue && rightValue; 127 | case 'OR': return leftValue || rightValue; 128 | // Add more cases for other operators as needed 129 | default: throw new Error(`unknown SQL operator: ${ast.operator}`); 130 | } 131 | } else if (ast.type === 'column_ref') { 132 | const columnName: string = ast.column; 133 | if (obj.hasOwnProperty(columnName)) { 134 | return obj[columnName]; 135 | } 136 | } else if (ast.type === 'number' || ast.type === 'single_quote_string') { 137 | return ast.value; 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /src/worker.ts: -------------------------------------------------------------------------------- 1 | import { Client as LibsqlClient, createClient } from "@libsql/client/web"; 2 | import { Router, RouterType } from "itty-router"; 3 | import { secureQuery } from "./rls"; 4 | export interface Env { 5 | LIBSQL_DB_URL?: string; // Turso DB's URL 6 | LIBSQL_DB_AUTH_TOKEN?: string; // Turso DB's auth token 7 | router?: RouterType; 8 | } 9 | 10 | export default { 11 | async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise { 12 | if(env.router === undefined) env.router = buildRouter(env); 13 | return env.router.handle(request); 14 | }, 15 | }; 16 | 17 | function buildLibsqlClient(env: Env): LibsqlClient { 18 | const url = env.LIBSQL_DB_URL?.trim(); 19 | if (url === undefined) throw new Error("LIBSQL_DB_URL env var is not defined"); 20 | 21 | const authToken = env.LIBSQL_DB_AUTH_TOKEN?.trim(); 22 | if (authToken === undefined) throw new Error("LIBSQL_DB_AUTH_TOKEN env var is not defined"); 23 | 24 | return createClient({ url, authToken }); 25 | } 26 | 27 | async function computePasswordHash(password: string){ 28 | const password_utf8 = new TextEncoder().encode(password); 29 | return Array.from(new Uint8Array(await crypto.subtle.digest('SHA-256', password_utf8))).map(b => b.toString(16).padStart(2, '0')).join(''); 30 | } 31 | 32 | function buildRouter(env: Env): RouterType { 33 | const router = Router(); 34 | 35 | router.post("/query", async (request) => { 36 | try { 37 | const client = buildLibsqlClient(env); 38 | const query = await request.text(); 39 | const auth_header = request.headers.get('Authorization') || 'dummy-password-for-anonymous'; 40 | const password = auth_header.replace('Bearer ', ''); 41 | 42 | // identify the user (could be anonymous) 43 | const current_user = (await client.execute({ 44 | sql: "select * from _users where password_hash = hex(sha256(?)) limit 1", 45 | args: [password] 46 | })).rows[0]; 47 | 48 | const policies = await client.execute({sql: "select * from _policies", args: []}); 49 | 50 | let safeSql = await secureQuery(client, query, current_user, policies); 51 | console.log("query = ", query); 52 | console.log("safeSql = ", safeSql); 53 | 54 | const rs = await client.execute({ sql: safeSql, args: [] }); 55 | return Response.json(rs); 56 | } catch (e) { 57 | throw e; 58 | // return new Response(`${e}`, {status: 500}); 59 | } 60 | }); 61 | 62 | router.post("/register", async (request) => { 63 | const client = buildLibsqlClient(env); 64 | const req: {email: string, password: string, display_name: string | null} = await request.json(); 65 | const email = req.email; 66 | const password = req.password; 67 | 68 | if (typeof email !== "string" || email.length < 6) 69 | return new Response("email length must be >= 6", { status: 400 }); 70 | 71 | if (typeof password !== "string" || password.length < 12) 72 | return new Response("password length must be >= 12", { status: 400 }); 73 | 74 | const uid = crypto.randomUUID(); 75 | 76 | try { 77 | await client.execute({ 78 | sql: "insert into _users (id, username, password_hash, role, display_name) values (?, ?, hex(sha256(?)), 'regular', ?)", 79 | args: [uid, email, password, req.display_name], 80 | }); 81 | } catch (e) { 82 | return new Response(`signup failed: ${e}`, {status: 500}); 83 | } 84 | 85 | return new Response("Success"); 86 | }); 87 | 88 | router.all("*", () => new Response("Not Found.", { status: 404 })); 89 | 90 | return router; 91 | } 92 | 93 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig.json to read more about this file */ 4 | 5 | /* Projects */ 6 | // "incremental": true, /* Enable incremental compilation */ 7 | // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ 8 | // "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */ 9 | // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */ 10 | // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ 11 | // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ 12 | 13 | /* Language and Environment */ 14 | "target": "es2021" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, 15 | "lib": ["es2021"] /* Specify a set of bundled library declaration files that describe the target runtime environment. */, 16 | "jsx": "react" /* Specify what JSX code is generated. */, 17 | // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ 18 | // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ 19 | // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */ 20 | // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ 21 | // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */ 22 | // "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */ 23 | // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ 24 | // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ 25 | 26 | /* Modules */ 27 | "module": "es2022" /* Specify what module code is generated. */, 28 | // "rootDir": "./", /* Specify the root folder within your source files. */ 29 | "moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */, 30 | // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ 31 | // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ 32 | // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ 33 | // "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */ 34 | "types": ["@cloudflare/workers-types"] /* Specify type package names to be included without being referenced in a source file. */, 35 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 36 | "resolveJsonModule": true /* Enable importing .json files */, 37 | // "noResolve": true, /* Disallow `import`s, `require`s or ``s from expanding the number of files TypeScript should add to a project. */ 38 | 39 | /* JavaScript Support */ 40 | "allowJs": true /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */, 41 | "checkJs": false /* Enable error reporting in type-checked JavaScript files. */, 42 | // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */ 43 | 44 | /* Emit */ 45 | // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ 46 | // "declarationMap": true, /* Create sourcemaps for d.ts files. */ 47 | // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ 48 | // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ 49 | // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */ 50 | // "outDir": "./", /* Specify an output folder for all emitted files. */ 51 | // "removeComments": true, /* Disable emitting comments. */ 52 | "noEmit": true /* Disable emitting files from a compilation. */, 53 | // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ 54 | // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */ 55 | // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ 56 | // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ 57 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 58 | // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ 59 | // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ 60 | // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ 61 | // "newLine": "crlf", /* Set the newline character for emitting files. */ 62 | // "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */ 63 | // "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */ 64 | // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ 65 | // "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */ 66 | // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ 67 | // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ 68 | 69 | /* Interop Constraints */ 70 | "isolatedModules": true /* Ensure that each file can be safely transpiled without relying on other imports. */, 71 | "allowSyntheticDefaultImports": true /* Allow 'import x from y' when a module doesn't have a default export. */, 72 | // "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */, 73 | // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ 74 | "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, 75 | 76 | /* Type Checking */ 77 | "strict": true /* Enable all strict type-checking options. */, 78 | // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */ 79 | // "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */ 80 | // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ 81 | // "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */ 82 | // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ 83 | // "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */ 84 | // "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */ 85 | // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ 86 | // "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */ 87 | // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */ 88 | // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ 89 | // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ 90 | // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ 91 | // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ 92 | // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ 93 | // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */ 94 | // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ 95 | // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ 96 | 97 | /* Completeness */ 98 | // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ 99 | "skipLibCheck": true /* Skip type checking all .d.ts files. */ 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /wrangler.toml: -------------------------------------------------------------------------------- 1 | name = "turso" 2 | main = "src/worker.ts" 3 | compatibility_date = "2023-08-21" 4 | node_compat = true 5 | 6 | # Variable bindings. These are arbitrary, plaintext strings (similar to environment variables) 7 | # Note: Use secrets to store sensitive data. 8 | # Docs: https://developers.cloudflare.com/workers/platform/environment-variables 9 | [vars] 10 | LIBSQL_DB_URL = "libsql://cloudflare-rls-demo-nileshtrivedi.turso.io" 11 | 12 | # Bind a KV Namespace. Use KV as persistent storage for small key-value pairs. 13 | # Docs: https://developers.cloudflare.com/workers/runtime-apis/kv 14 | # [[kv_namespaces]] 15 | # binding = "MY_KV_NAMESPACE" 16 | # id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 17 | 18 | # Bind an R2 Bucket. Use R2 to store arbitrarily large blobs of data, such as files. 19 | # Docs: https://developers.cloudflare.com/r2/api/workers/workers-api-usage/ 20 | # [[r2_buckets]] 21 | # binding = "MY_BUCKET" 22 | # bucket_name = "my-bucket" 23 | 24 | # Bind a Queue producer. Use this binding to schedule an arbitrary task that may be processed later by a Queue consumer. 25 | # Docs: https://developers.cloudflare.com/queues/get-started 26 | # [[queues.producers]] 27 | # binding = "MY_QUEUE" 28 | # queue = "my-queue" 29 | 30 | # Bind a Queue consumer. Queue Consumers can retrieve tasks scheduled by Producers to act on them. 31 | # Docs: https://developers.cloudflare.com/queues/get-started 32 | # [[queues.consumers]] 33 | # queue = "my-queue" 34 | 35 | # Bind another Worker service. Use this binding to call another Worker without network overhead. 36 | # Docs: https://developers.cloudflare.com/workers/platform/services 37 | # [[services]] 38 | # binding = "MY_SERVICE" 39 | # service = "/api/*" 40 | 41 | # Bind a Durable Object. Durable objects are a scale-to-zero compute primitive based on the actor model. 42 | # Durable Objects can live for as long as needed. Use these when you need a long-running "server", such as in realtime apps. 43 | # Docs: https://developers.cloudflare.com/workers/runtime-apis/durable-objects 44 | # [[durable_objects.bindings]] 45 | # name = "MY_DURABLE_OBJECT" 46 | # class_name = "MyDurableObject" 47 | 48 | # Durable Object migrations. 49 | # Docs: https://developers.cloudflare.com/workers/learning/using-durable-objects#configure-durable-object-classes-with-migrations 50 | # [[migrations]] 51 | # tag = "v1" 52 | # new_classes = ["MyDurableObject"] 53 | --------------------------------------------------------------------------------