@hasna/shortlinks 0.1.24 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -21
- package/dist/cli/index.js +7943 -2308
- package/dist/client-store.d.ts +47 -0
- package/dist/cloud-store.d.ts +46 -0
- package/dist/db/migrations.d.ts +2 -2
- package/dist/generated/storage-kit/index.d.ts +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +7213 -950
- package/dist/mcp/http.d.ts +15 -5
- package/dist/mcp/index.d.ts +3 -2
- package/dist/mcp/index.js +6801 -865
- package/dist/pg-store.d.ts +7 -11
- package/dist/pg-store.js +0 -258
- package/dist/serve/index.js +166 -462
- package/dist/store-interface.d.ts +37 -0
- package/package.json +5 -8
- package/dist/pg-migrations.d.ts +0 -1
- package/dist/runtime.d.ts +0 -65
- package/dist/runtime.js +0 -214
package/README.md
CHANGED
|
@@ -149,32 +149,28 @@ shortlinks domain buy new-short-domain.ai --dry-run
|
|
|
149
149
|
|
|
150
150
|
This package does not install or call any removed `connect-*` packages.
|
|
151
151
|
|
|
152
|
-
##
|
|
152
|
+
## Storage modes
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
The client resolves ONE `Store` from the environment — there is no DSN on any client:
|
|
155
155
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
156
|
+
- **local** (default): on-box SQLite. Every command, MCP tool, and SDK call reads
|
|
157
|
+
and writes the local database.
|
|
158
|
+
- **self_hosted / cloud**: set `HASNA_SHORTLINKS_API_URL` + `HASNA_SHORTLINKS_API_KEY`
|
|
159
|
+
(and optionally `HASNA_SHORTLINKS_STORAGE_MODE`) to route every call to the cloud
|
|
160
|
+
`/v1` HTTP API with a bearer key. `self_hosted` and `cloud` are identical client
|
|
161
|
+
code; only the URL/key differ.
|
|
160
162
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
shortlinks
|
|
164
|
-
|
|
163
|
+
```bash
|
|
164
|
+
# Route the client to the self-hosted cloud API (bearer key, never a DSN):
|
|
165
|
+
export HASNA_SHORTLINKS_API_URL=https://shortlinks.hasna.xyz
|
|
166
|
+
export HASNA_SHORTLINKS_API_KEY=hsk_...
|
|
167
|
+
export HASNA_SHORTLINKS_STORAGE_MODE=self_hosted
|
|
168
|
+
shortlinks doctor
|
|
165
169
|
```
|
|
166
170
|
|
|
167
|
-
The
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
For an apex domain that needs stable A records, `infra/aws-ec2-user-data.sh` bootstraps a small EC2 redirect origin with:
|
|
172
|
-
|
|
173
|
-
- `@hasna/shortlinks` installed through Bun
|
|
174
|
-
- direct reads and click writes against the app-owned `shortlinks` PostgreSQL database
|
|
175
|
-
- Caddy terminating HTTPS and proxying to `shortlinks serve`
|
|
176
|
-
|
|
177
|
-
The script reads the connection settings from AWS Secrets Manager through the instance role; it does not contain secret values.
|
|
171
|
+
The cloud server (`shortlinks-serve`, run on ECS Fargate) is the only component
|
|
172
|
+
that holds a Postgres connection, and it opens its pool server-side through the
|
|
173
|
+
sanctioned storage kit — the raw RDS DSN is never distributed to clients.
|
|
178
174
|
|
|
179
175
|
## Development
|
|
180
176
|
|