diff --git a/package.json b/package.json index 126801a..6b6fa2b 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ }, "dependencies": { "@cloudflare/workers-types": "^4.20240502.0", - "hono": "^4.1.3", + "hono": "^4.5.11", "nanoid": "^4.0.0" } -} \ No newline at end of file +} diff --git a/src/index.ts b/src/index.ts index 7f3769f..2ef3ed1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -75,6 +75,7 @@ app.post('/api/create', async (c) => { expire: expire || 0, language: language || 'text', create_time: createTime, + edit_password: share_password || nanoid(8), metadata: { language: language || 'text', create_time: createTime, diff --git a/src/schema.sql b/src/schema.sql index f3ce316..3e696fa 100644 --- a/src/schema.sql +++ b/src/schema.sql @@ -3,6 +3,7 @@ DROP TABLE IF EXISTS files; CREATE TABLE IF NOT EXISTS pastes ( id text PRIMARY KEY, content text NOT NULL, + edit_password text DEFAULT "", expire integer DEFAULT 0 NOT NULL, language text DEFAULT "text" NOT NULL, create_time integer NOT NULL, diff --git a/yarn.lock b/yarn.lock index 068075f..5fc3436 100644 --- a/yarn.lock +++ b/yarn.lock @@ -368,10 +368,10 @@ hasown@^2.0.0: dependencies: function-bind "^1.1.2" -hono@^4.1.3: - version "4.1.3" - resolved "https://registry.yarnpkg.com/hono/-/hono-4.1.3.tgz#8fd8cb2fe52da139755891600ffc8fabf4079ca0" - integrity sha512-V0I6qCw0gn2MA4LLtyXe6oD3/7ToeQf5Zv98o7uSuLuViQgWHJeYoYrZ4NbXhOtg4SaZjNJJm1+XuFB3LN+j6A== +hono@^4.5.11: + version "4.5.11" + resolved "https://registry.yarnpkg.com/hono/-/hono-4.5.11.tgz#452743c4b372078001506e3ce315e878f030e369" + integrity sha512-62FcjLPtjAFwISVBUshryl+vbHOjg8rE4uIK/dxyR8GpLztunZpwFmfEvmJCUI7xoGh/Sr3CGCDPCmYxVw7wUQ== is-binary-path@~2.1.0: version "2.1.0"