diff --git a/.node-version b/.node-version index 07533ba..8b0beab 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -v20.11 +20.11.0 diff --git a/README.md b/README.md index f51d1b2..14424b8 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,8 @@ We welcome your contributions and PRs. - [Sink Tool](https://github.com/zhuzhuyule/sink-extension) - [x] Raycast Extension - [Raycast-Sink](https://github.com/foru17/raycast-sink) -- [ ] Apple Shortcuts +- [x] Apple Shortcuts + - [Sink Shortcuts](https://s.search1api.com/sink001) - [ ] Enhanced Link Management (with Cloudflare D1) - [ ] Analytics Enhancements (Support for merging filter conditions) - [ ] Dashboard Performance Optimization (Infinite loading) diff --git a/app.config.ts b/app.config.ts index 915f0a2..d6419c0 100644 --- a/app.config.ts +++ b/app.config.ts @@ -1,11 +1,11 @@ export default defineAppConfig({ title: 'Sink', - twitter: 'https://x.com/0xKaiBi', - github: 'https://github.com/ccbikai/sink', email: 'sink.cool@miantiao.me', - telegram: 'https://t.me/htmlzone', - mastodon: 'https://c.im/@mt', - blog: 'https://mt.ci', + github: 'https://github.com/ccbikai/sink', + twitter: 'https://sink.cool/kai', + telegram: 'https://sink.cool/telegram', + mastodon: 'https://sink.cool/mastodon', + blog: 'https://sink.cool/blog', description: 'A Simple / Speedy / Secure Link Shortener with Analytics, 100% run on Cloudflare.', image: 'https://sink.cool/banner.png', previewTTL: 24 * 3600, // 24h diff --git a/package.json b/package.json index 0b0a947..9869c83 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "sink", "type": "module", - "version": "0.1.4", + "version": "0.1.5", "private": true, "packageManager": "pnpm@9.7.1", "engines": { diff --git a/server/api/link/create.post.ts b/server/api/link/create.post.ts index 77d7753..7734e67 100644 --- a/server/api/link/create.post.ts +++ b/server/api/link/create.post.ts @@ -23,6 +23,7 @@ export default eventHandler(async (event) => { }, }) setResponseStatus(event, 201) - return { link } + const shortLink = `${getRequestProtocol(event)}://${getRequestHost(event)}/${link.slug}` + return { link, shortLink } } }) diff --git a/server/api/link/edit.put.ts b/server/api/link/edit.put.ts index ca52465..2b05285 100644 --- a/server/api/link/edit.put.ts +++ b/server/api/link/edit.put.ts @@ -30,6 +30,7 @@ export default eventHandler(async (event) => { }, }) setResponseStatus(event, 201) - return { link: newLink } + const shortLink = `${getRequestProtocol(event)}://${getRequestHost(event)}/${link.slug}` + return { link: newLink, shortLink } } }) diff --git a/server/api/link/list.get.ts b/server/api/link/list.get.ts index f2ab7db..433029c 100644 --- a/server/api/link/list.get.ts +++ b/server/api/link/list.get.ts @@ -10,7 +10,7 @@ export default eventHandler(async (event) => { const list = await KV.list({ prefix: `link:`, limit, - cursor, + cursor: cursor || undefined, }) if (Array.isArray(list.keys)) { list.links = await Promise.all(list.keys.map(async (key: { name: string }) => {