@hasna/shortlinks 0.1.23 → 0.1.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,8 @@
1
+ /**
2
+ * OpenAPI 3 description of the shortlinks serve HTTP API.
3
+ *
4
+ * This is the single source of truth for the generated SDK
5
+ * (`@hasna/shortlinks-sdk`) — run `bun run sdk:generate` after changing it —
6
+ * and is also served live at `GET /openapi.json`.
7
+ */
8
+ export declare function buildOpenApiDocument(version: string): Record<string, unknown>;
package/dist/server.js CHANGED
@@ -1,4 +1,37 @@
1
1
  // @bun
2
+ var __create = Object.create;
3
+ var __getProtoOf = Object.getPrototypeOf;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ function __accessProp(key) {
8
+ return this[key];
9
+ }
10
+ var __toESMCache_node;
11
+ var __toESMCache_esm;
12
+ var __toESM = (mod, isNodeMode, target) => {
13
+ var canCache = mod != null && typeof mod === "object";
14
+ if (canCache) {
15
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
+ var cached = cache.get(mod);
17
+ if (cached)
18
+ return cached;
19
+ }
20
+ target = mod != null ? __create(__getProtoOf(mod)) : {};
21
+ const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
+ for (let key of __getOwnPropNames(mod))
23
+ if (!__hasOwnProp.call(to, key))
24
+ __defProp(to, key, {
25
+ get: __accessProp.bind(mod, key),
26
+ enumerable: true
27
+ });
28
+ if (canCache)
29
+ cache.set(mod, to);
30
+ return to;
31
+ };
32
+ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
33
+ var __require = import.meta.require;
34
+
2
35
  // src/store.ts
3
36
  import { createHash } from "crypto";
4
37
 
package/package.json CHANGED
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "name": "@hasna/shortlinks",
3
- "version": "0.1.23",
3
+ "version": "0.1.24",
4
4
  "description": "CLI-only shortlink manager for custom domains, click tracking, Cloudflare setup, and app-owned Postgres runtime support",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "bin": {
9
- "shortlinks": "dist/cli/index.js"
9
+ "shortlinks": "dist/cli/index.js",
10
+ "shortlinks-mcp": "dist/mcp/index.js",
11
+ "shortlinks-serve": "dist/serve/index.js"
10
12
  },
11
13
  "exports": {
12
14
  ".": {
@@ -28,6 +30,10 @@
28
30
  "./runtime": {
29
31
  "types": "./dist/runtime.d.ts",
30
32
  "import": "./dist/runtime.js"
33
+ },
34
+ "./sdk": {
35
+ "types": "./dist/sdk/index.d.ts",
36
+ "import": "./dist/sdk/index.js"
31
37
  }
32
38
  },
33
39
  "files": [
@@ -39,11 +45,15 @@
39
45
  "SECURITY.md"
40
46
  ],
41
47
  "scripts": {
42
- "build": "rm -rf dist && bun build src/cli/index.ts --outdir dist/cli --target bun && bun build src/index.ts --outdir dist --target bun && bun build src/server.ts --outdir dist --target bun && bun build src/cloudflare.ts --outdir dist --target bun && bun build src/runtime.ts --outdir dist --target bun && bun build src/pg-store.ts --outdir dist --target bun && tsc -p tsconfig.build.json --emitDeclarationOnly --outDir dist",
48
+ "build": "rm -rf dist && bun build src/cli/index.ts src/mcp/index.ts src/serve/index.ts src/sdk/index.ts src/index.ts src/server.ts src/cloudflare.ts src/runtime.ts src/pg-store.ts --root src --outdir dist --target bun --external @modelcontextprotocol/sdk && tsc -p tsconfig.build.json --emitDeclarationOnly --outDir dist",
49
+ "sdk:generate": "bun run scripts/generate-sdk.ts",
43
50
  "typecheck": "tsc --noEmit",
44
51
  "test": "bun test",
45
52
  "dev:cli": "bun run src/cli/index.ts",
46
- "prepublishOnly": "bun run typecheck && bun run test && bun run build"
53
+ "dev:mcp": "bun run src/mcp/index.ts",
54
+ "dev:serve": "bun run src/serve/index.ts",
55
+ "verify:release": "bun run typecheck && bun run test && bun run build",
56
+ "prepublishOnly": "bun run verify:release"
47
57
  },
48
58
  "keywords": [
49
59
  "shortlinks",
@@ -74,9 +84,12 @@
74
84
  "author": "Andrei Hasna <andrei@hasna.com>",
75
85
  "license": "Apache-2.0",
76
86
  "dependencies": {
87
+ "@hasna/contracts": "0.4.1",
77
88
  "@hasna/events": "^0.1.6",
89
+ "@modelcontextprotocol/sdk": "^1.27.1",
78
90
  "chalk": "^5.4.1",
79
91
  "commander": "^13.1.0",
92
+ "hono": "^4.12.7",
80
93
  "pg": "^8.13.3"
81
94
  },
82
95
  "devDependencies": {