@cherwell/emdash-shortlinks 0.0.0-stage → 0.1.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/CHANGELOG.md +18 -0
- package/LICENSE +21 -0
- package/README.md +198 -2
- package/assets/banner.png +0 -0
- package/assets/icon.png +0 -0
- package/assets/icon.svg +6 -0
- package/dist/helpers/astro.d.ts +43 -0
- package/dist/helpers/astro.js +95 -0
- package/dist/index.d.mts +5 -0
- package/dist/index.mjs +620 -0
- package/dist/manifest.json +617 -0
- package/dist/plugin.d.mts +8 -0
- package/dist/plugin.mjs +62 -0
- package/docs/faq.md +31 -0
- package/docs/install.md +49 -0
- package/docs/overview.md +13 -0
- package/docs/reference.md +223 -0
- package/docs/security.md +11 -0
- package/emdash-plugin.jsonc +98 -0
- package/llms.txt +20 -0
- package/package.json +79 -3
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
<!-- Generated by scripts/docs.mjs from emdash-plugin.jsonc and the build output. Do not edit; run `pnpm run docs`. -->
|
|
2
|
+
# Short Links: reference
|
|
3
|
+
|
|
4
|
+
Exact facts about `@cherwell/emdash-shortlinks` 0.1.0 (registry slug `shortlinks`), generated from its manifest and build. For what it does and how to set it up, read [the README](../README.md).
|
|
5
|
+
|
|
6
|
+
## Package
|
|
7
|
+
|
|
8
|
+
| Import | What it is |
|
|
9
|
+
| --- | --- |
|
|
10
|
+
| `@cherwell/emdash-shortlinks` | The plugin descriptor: pass it to `sandboxed` (or `plugins`) in `emdash()` in astro.config. |
|
|
11
|
+
| `@cherwell/emdash-shortlinks/sandbox` | The plugin's runtime bundle (what the sandbox loads). |
|
|
12
|
+
| `@cherwell/emdash-shortlinks/astro` | Site helpers for your Astro pages and middleware (see [Site helpers](#site-helpers)). |
|
|
13
|
+
|
|
14
|
+
Requires EmDash `>=1.0.0`. Licence: MIT.
|
|
15
|
+
|
|
16
|
+
## Capabilities
|
|
17
|
+
|
|
18
|
+
What the plugin asks permission for when you install it, and why.
|
|
19
|
+
|
|
20
|
+
| Capability | Why |
|
|
21
|
+
| --- | --- |
|
|
22
|
+
| `content:read` | resolves links that point at an entry, so they follow it when its address changes. |
|
|
23
|
+
| `network:request:unrestricted` | delivers webhooks to addresses the site owner enters. |
|
|
24
|
+
|
|
25
|
+
No fixed host allow-list (`allowedHosts` is empty).
|
|
26
|
+
|
|
27
|
+
## Settings
|
|
28
|
+
|
|
29
|
+
Set under **Admin ▸ Plugins ▸ Short Links ▸ Settings**. Keys are what the API and `ctx.kv` use.
|
|
30
|
+
|
|
31
|
+
| Key | Type | Default | Label |
|
|
32
|
+
| --- | --- | --- | --- |
|
|
33
|
+
| `prefix` | string | `/s/` | Path the site serves short links on |
|
|
34
|
+
| `fallback` | string | `/` | Where a missing, disabled or expired link goes |
|
|
35
|
+
| `passParams` | string | `ref,gclid,fbclid,msclkid,utm_content,utm_term` | Visitor query parameters passed through (comma-separated) |
|
|
36
|
+
| `publicOrigin` | url | | Public address for short links, if not the site's (e.g. a short domain) |
|
|
37
|
+
| `scopeOrigins` | string | | Per-site addresses as JSON, e.g. {"south": "https://sth.example"} |
|
|
38
|
+
| `serverKey` | secret | | Server key (the same value as SHORTLINKS_KEY in the site) |
|
|
39
|
+
| `webhookSecret` | secret | | Webhook signing secret |
|
|
40
|
+
| `statsMonths` | number (1–120) | `24` | Keep click statistics for (months) |
|
|
41
|
+
| `callBudget` | number (10–10000) | `28` | Host calls per background run (28 suits a Cloudflare sandbox; raise it when running in-process) |
|
|
42
|
+
| `auditDays` | number (30–3650) | `365` | Keep the audit trail for (days) |
|
|
43
|
+
| `linkFields` | string | | Custom fields on links (JSON; see the README) |
|
|
44
|
+
| `codeLength` | number (4–32) | `7` | Length of random codes |
|
|
45
|
+
| `codeAlphabet` | string | `abcdefghjkmnpqrstuvwxyz23456789` | Characters random codes use (a-z and 0-9, at least 10) |
|
|
46
|
+
| `reservedCodes` | string | | Codes nobody can use (comma-separated, e.g. admin,login) |
|
|
47
|
+
| `redirectStatus` | select (302, 307, 301, 308) | `302` | Redirect status for live links |
|
|
48
|
+
| `repeatSeconds` | number (0–86400) | `60` | Don't count the same address again on a link for (seconds; 0 counts every click) |
|
|
49
|
+
| `recordCountries` | boolean | `true` | Record visitors' countries |
|
|
50
|
+
| `recordReferrers` | boolean | `true` | Record referring sites (hostnames) |
|
|
51
|
+
| `timeZone` | string | `UTC` | Time zone for daily statistics and expiry dates (e.g. Europe/London) |
|
|
52
|
+
| `qrLevel` | select (L, M, Q, H) | `M` | QR error correction |
|
|
53
|
+
| `qrScale` | number (1–40) | `8` | QR pixels per module |
|
|
54
|
+
| `qrMargin` | number (0–16) | `4` | QR quiet zone (modules) |
|
|
55
|
+
|
|
56
|
+
## Storage
|
|
57
|
+
|
|
58
|
+
Plugin-owned collections (EmDash plugin storage), with their indexes.
|
|
59
|
+
|
|
60
|
+
| Collection | Indexes | Unique |
|
|
61
|
+
| --- | --- | --- |
|
|
62
|
+
| `links` | `status`, `createdAt`, `campaign`, `scope`, `scope+createdAt`, `campaign+createdAt`, `status+createdAt` | `key` |
|
|
63
|
+
| `stats` | `linkId`, `month`, `linkId+month` | |
|
|
64
|
+
| `audit` | `at`, `target`, `actor`, `target+at` | |
|
|
65
|
+
| `webhooks` | `createdAt` | |
|
|
66
|
+
| `deliveries` | `status`, `createdAt`, `status+nextAt` | |
|
|
67
|
+
| `rate_limits` | `expiresAt` | |
|
|
68
|
+
|
|
69
|
+
## Admin pages
|
|
70
|
+
|
|
71
|
+
| Path | Label | Group |
|
|
72
|
+
| --- | --- | --- |
|
|
73
|
+
| `/links` | Short links | Short links |
|
|
74
|
+
| `/import` | Import and export | Short links |
|
|
75
|
+
| `/webhooks` | Webhooks | Short links |
|
|
76
|
+
| `/audit` | Audit trail | Short links |
|
|
77
|
+
|
|
78
|
+
Dashboard widgets: Short links (`clicks`, third).
|
|
79
|
+
|
|
80
|
+
## Hooks
|
|
81
|
+
|
|
82
|
+
- `plugin:activate`
|
|
83
|
+
- `cron`
|
|
84
|
+
|
|
85
|
+
## Routes
|
|
86
|
+
|
|
87
|
+
Served at `/_emdash/api/plugins/shortlinks/<route>`. Public routes need no EmDash session; the others need the permission shown.
|
|
88
|
+
|
|
89
|
+
| Route | Methods | Access | Notes |
|
|
90
|
+
| --- | --- | --- | --- |
|
|
91
|
+
| `resolve` | POST | public (needs `x-server-key`) | json body |
|
|
92
|
+
| `qr` | GET | public | raw response; Cache-Control private, max-age=3600 |
|
|
93
|
+
| `export` | GET | public | raw response |
|
|
94
|
+
| `links/list` | POST | `content:edit_any` | |
|
|
95
|
+
| `links/get` | POST | `content:edit_any` | |
|
|
96
|
+
| `links/create` | POST | `content:edit_any` | |
|
|
97
|
+
| `links/update` | POST | `content:edit_any` | |
|
|
98
|
+
| `links/delete` | POST | `content:edit_any` | |
|
|
99
|
+
| `admin` | POST | `content:edit_any` | |
|
|
100
|
+
|
|
101
|
+
## MCP tools
|
|
102
|
+
|
|
103
|
+
Available to AI agents through EmDash's MCP server, with the same permissions as the route each calls.
|
|
104
|
+
|
|
105
|
+
### `shortlinks_list`
|
|
106
|
+
|
|
107
|
+
List short links, newest first, optionally by campaign, status or site. Pass the cursor to page.
|
|
108
|
+
|
|
109
|
+
Route `links/list`; needs `content:edit_any`.
|
|
110
|
+
|
|
111
|
+
| Input | Type | Required | Notes |
|
|
112
|
+
| --- | --- | --- | --- |
|
|
113
|
+
| `campaign` | string | | max length 80 |
|
|
114
|
+
| `status` | "active" \| "disabled" | | |
|
|
115
|
+
| `scope` | string | | max length 40 |
|
|
116
|
+
| `cursor` | string | | max length 500 |
|
|
117
|
+
| `limit` | integer | | ≥ 1, ≤ 100 |
|
|
118
|
+
|
|
119
|
+
### `shortlink_get`
|
|
120
|
+
|
|
121
|
+
Read one short link and its daily clicks, QR scans, top countries and referrers.
|
|
122
|
+
|
|
123
|
+
Route `links/get`; needs `content:edit_any`.
|
|
124
|
+
|
|
125
|
+
| Input | Type | Required | Notes |
|
|
126
|
+
| --- | --- | --- | --- |
|
|
127
|
+
| `code` | string | yes | max length 32 |
|
|
128
|
+
| `scope` | string | yes | max length 40, default "" |
|
|
129
|
+
| `days` | integer | | ≥ 1, ≤ 366 |
|
|
130
|
+
|
|
131
|
+
### `shortlink_create`
|
|
132
|
+
|
|
133
|
+
Create a live short link to a URL or an entry (collection:id), with optional code, campaign, UTM tags and expiry.
|
|
134
|
+
|
|
135
|
+
Route `links/create`; needs `content:edit_any`; **destructive**.
|
|
136
|
+
|
|
137
|
+
| Input | Type | Required | Notes |
|
|
138
|
+
| --- | --- | --- | --- |
|
|
139
|
+
| `target` | string | yes | min length 3, max length 2000 |
|
|
140
|
+
| `code` | string \| "" | | |
|
|
141
|
+
| `scope` | string \| "" | | |
|
|
142
|
+
| `title` | string | | max length 200 |
|
|
143
|
+
| `campaign` | string | | max length 80 |
|
|
144
|
+
| `utmSource` | string | | max length 80 |
|
|
145
|
+
| `utmMedium` | string | | max length 80 |
|
|
146
|
+
| `utmCampaign` | string | | max length 80 |
|
|
147
|
+
| `expiresOn` | string \| "" | | |
|
|
148
|
+
| `custom` | object | | |
|
|
149
|
+
|
|
150
|
+
### `shortlink_update`
|
|
151
|
+
|
|
152
|
+
Change where a short link goes, its UTM tags, expiry or status (active/disabled).
|
|
153
|
+
|
|
154
|
+
Route `links/update`; needs `content:edit_any`; **destructive**.
|
|
155
|
+
|
|
156
|
+
| Input | Type | Required | Notes |
|
|
157
|
+
| --- | --- | --- | --- |
|
|
158
|
+
| `code` | string | yes | max length 32 |
|
|
159
|
+
| `scope` | string | yes | max length 40, default "" |
|
|
160
|
+
| `changes` | object | yes | |
|
|
161
|
+
|
|
162
|
+
### `shortlink_delete`
|
|
163
|
+
|
|
164
|
+
Delete a short link and its statistics. Visitors then reach the fallback page.
|
|
165
|
+
|
|
166
|
+
Route `links/delete`; needs `content:edit_any`; **destructive**.
|
|
167
|
+
|
|
168
|
+
| Input | Type | Required | Notes |
|
|
169
|
+
| --- | --- | --- | --- |
|
|
170
|
+
| `code` | string | yes | max length 32 |
|
|
171
|
+
| `scope` | string | yes | max length 40, default "" |
|
|
172
|
+
|
|
173
|
+
## Site helpers
|
|
174
|
+
|
|
175
|
+
Type declarations of the site helpers, as published. Import them from the paths shown.
|
|
176
|
+
|
|
177
|
+
### `@cherwell/emdash-shortlinks/astro`
|
|
178
|
+
|
|
179
|
+
```ts
|
|
180
|
+
//#region src/astro.d.ts
|
|
181
|
+
/**
|
|
182
|
+
* Site side of Short Links: the /s/<code> route.
|
|
183
|
+
*
|
|
184
|
+
* // src/pages/s/[code].ts
|
|
185
|
+
* import { shortlinkRoute } from "@cherwell/emdash-shortlinks/astro";
|
|
186
|
+
* export const { GET, HEAD } = shortlinkRoute({ key: import.meta.env.SHORTLINKS_KEY });
|
|
187
|
+
*
|
|
188
|
+
* When one install serves several sites, pass the site so codes can be scoped per site:
|
|
189
|
+
* shortlinkRoute({ key, scope: (ctx) => ctx.locals.site?.key })
|
|
190
|
+
*
|
|
191
|
+
* EmDash won't let a plugin route redirect off-site, so this route asks the
|
|
192
|
+
* plugin (in-process, with a server key) and redirects itself.
|
|
193
|
+
*/
|
|
194
|
+
interface RouteContext {
|
|
195
|
+
params: Record<string, string | undefined>;
|
|
196
|
+
request: Request;
|
|
197
|
+
url: URL;
|
|
198
|
+
locals: Record<string, unknown> & {
|
|
199
|
+
emdash?: {
|
|
200
|
+
handlePublicPluginApiRoute?: (id: string, method: string, path: string, req: Request) => Promise<{
|
|
201
|
+
data?: unknown;
|
|
202
|
+
}>;
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
clientAddress?: string;
|
|
206
|
+
}
|
|
207
|
+
interface ShortlinkRouteOptions {
|
|
208
|
+
/** The plugin's server key (same value as its "Server key" setting). */
|
|
209
|
+
key: string | undefined;
|
|
210
|
+
/** Site key for per-site codes, when one install serves several sites. */
|
|
211
|
+
scope?: (ctx: RouteContext) => string | undefined | null;
|
|
212
|
+
/** Where to go if the plugin can't be reached. */
|
|
213
|
+
fallback?: string;
|
|
214
|
+
/** Plugin id, if installed under another one. */
|
|
215
|
+
pluginId?: string;
|
|
216
|
+
}
|
|
217
|
+
declare function shortlinkRoute(opts: ShortlinkRouteOptions): {
|
|
218
|
+
GET: (ctx: RouteContext) => Promise<Response>;
|
|
219
|
+
HEAD: (ctx: RouteContext) => Promise<Response>;
|
|
220
|
+
};
|
|
221
|
+
//#endregion
|
|
222
|
+
export { ShortlinkRouteOptions, shortlinkRoute };
|
|
223
|
+
```
|
package/docs/security.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!-- Generated by scripts/docs.mjs. Do not edit; run `pnpm run docs`. -->
|
|
2
|
+
Report a vulnerability privately through [GitHub security advisories](https://github.com/cherwell-studio/emdash-plugins/security/advisories/new), not a public issue. We reply within three working days. The latest minor release is supported.
|
|
3
|
+
|
|
4
|
+
**What it may do.** Short Links runs in EmDash's sandbox and can use only what it declares:
|
|
5
|
+
|
|
6
|
+
- `content:read`: resolves links that point at an entry, so they follow it when its address changes
|
|
7
|
+
- `network:request:unrestricted`: delivers webhooks to addresses the site owner enters
|
|
8
|
+
|
|
9
|
+
**What it stores.** Its own plugin-storage collections (`links`, `stats`, `audit`, `webhooks`, `deliveries`, `rate_limits`) and settings. Secrets are `secret` settings, encrypted by EmDash.
|
|
10
|
+
|
|
11
|
+
**Public routes.** `resolve`, `qr`, `export` answer without a session and validate their input. Everything else needs an EmDash login with the permission listed in the [reference](https://raw.githubusercontent.com/cherwell-studio/emdash-plugins/main/plugins/shortlinks/docs/reference.md).
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/@emdash-cms/plugin-cli/schemas/emdash-plugin.schema.json",
|
|
3
|
+
|
|
4
|
+
"slug": "shortlinks",
|
|
5
|
+
"publisher": "did:plc:aaaaaaaaaaaaaaaaaaaaaaaa",
|
|
6
|
+
"name": "Short Links",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"author": { "name": "Cherwell Studio", "url": "https://cherwell.studio" },
|
|
9
|
+
"security": { "url": "https://github.com/cherwell-studio/emdash-plugins/security/advisories/new" },
|
|
10
|
+
"description": "Short, trackable links and QR codes for print, social and email, with campaign reports and no tracking cookies.",
|
|
11
|
+
"keywords": ["short links", "qr codes", "utm", "campaigns", "redirects"],
|
|
12
|
+
"repo": "https://github.com/cherwell-studio/emdash-plugins",
|
|
13
|
+
|
|
14
|
+
// The registry listing: long-form pages (each at most 2,000 characters) and images.
|
|
15
|
+
"sections": {
|
|
16
|
+
"description": { "file": "docs/overview.md" },
|
|
17
|
+
"installation": { "file": "docs/install.md" },
|
|
18
|
+
"faq": { "file": "docs/faq.md" },
|
|
19
|
+
"changelog": { "file": "CHANGELOG.md" },
|
|
20
|
+
"security": { "file": "docs/security.md" }
|
|
21
|
+
},
|
|
22
|
+
"release": {
|
|
23
|
+
"requires": { "env:emdash": ">=1.0.0" },
|
|
24
|
+
"artifacts": {
|
|
25
|
+
"icon": { "file": "assets/icon.png" },
|
|
26
|
+
"banner": { "file": "assets/banner.png" }
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
// Why each capability:
|
|
31
|
+
// - content:read resolves links that point at an entry, so they follow it when its address changes.
|
|
32
|
+
// - network:request:unrestricted delivers webhooks to addresses the site owner enters.
|
|
33
|
+
"capabilities": ["content:read", "network:request:unrestricted"],
|
|
34
|
+
"allowedHosts": [],
|
|
35
|
+
|
|
36
|
+
"storage": {
|
|
37
|
+
"links": { "indexes": ["status", "createdAt", "campaign", "scope", ["scope", "createdAt"], ["campaign", "createdAt"], ["status", "createdAt"]], "uniqueIndexes": ["key"] },
|
|
38
|
+
"stats": { "indexes": ["linkId", "month", ["linkId", "month"]] },
|
|
39
|
+
"audit": { "indexes": ["at", "target", "actor", ["target", "at"]] },
|
|
40
|
+
"webhooks": { "indexes": ["createdAt"] },
|
|
41
|
+
"deliveries": { "indexes": ["status", "createdAt", ["status", "nextAt"]] },
|
|
42
|
+
"rate_limits": { "indexes": ["expiresAt"] }
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
"admin": {
|
|
46
|
+
"pages": [
|
|
47
|
+
{ "path": "/links", "label": "Short links", "icon": "link", "group": "Short links" },
|
|
48
|
+
{ "path": "/import", "label": "Import and export", "icon": "upload", "group": "Short links" },
|
|
49
|
+
{ "path": "/webhooks", "label": "Webhooks", "icon": "plugs", "group": "Short links" },
|
|
50
|
+
{ "path": "/audit", "label": "Audit trail", "icon": "clock-counter-clockwise", "group": "Short links" }
|
|
51
|
+
],
|
|
52
|
+
"widgets": [{ "id": "clicks", "title": "Short links", "size": "third" }],
|
|
53
|
+
"settingsSchema": {
|
|
54
|
+
"prefix": { "type": "string", "label": "Path the site serves short links on", "default": "/s/" },
|
|
55
|
+
"fallback": { "type": "string", "label": "Where a missing, disabled or expired link goes", "default": "/" },
|
|
56
|
+
"passParams": { "type": "string", "label": "Visitor query parameters passed through (comma-separated)", "default": "ref,gclid,fbclid,msclkid,utm_content,utm_term" },
|
|
57
|
+
"publicOrigin": { "type": "url", "label": "Public address for short links, if not the site's (e.g. a short domain)" },
|
|
58
|
+
"scopeOrigins": { "type": "string", "label": "Per-site addresses as JSON, e.g. {\"south\": \"https://sth.example\"}", "multiline": true },
|
|
59
|
+
"serverKey": { "type": "secret", "label": "Server key (the same value as SHORTLINKS_KEY in the site)" },
|
|
60
|
+
"webhookSecret": { "type": "secret", "label": "Webhook signing secret" },
|
|
61
|
+
"statsMonths": { "type": "number", "label": "Keep click statistics for (months)", "default": 24, "min": 1, "max": 120 },
|
|
62
|
+
"callBudget": { "type": "number", "label": "Host calls per background run (28 suits a Cloudflare sandbox; raise it when running in-process)", "default": 28, "min": 10, "max": 10000 },
|
|
63
|
+
"auditDays": { "type": "number", "label": "Keep the audit trail for (days)", "default": 365, "min": 30, "max": 3650 },
|
|
64
|
+
"linkFields": { "type": "string", "label": "Custom fields on links (JSON; see the README)", "multiline": true },
|
|
65
|
+
"codeLength": { "type": "number", "label": "Length of random codes", "default": 7, "min": 4, "max": 32 },
|
|
66
|
+
"codeAlphabet": { "type": "string", "label": "Characters random codes use (a-z and 0-9, at least 10)", "default": "abcdefghjkmnpqrstuvwxyz23456789" },
|
|
67
|
+
"reservedCodes": { "type": "string", "label": "Codes nobody can use (comma-separated, e.g. admin,login)" },
|
|
68
|
+
"redirectStatus": {
|
|
69
|
+
"type": "select",
|
|
70
|
+
"label": "Redirect status for live links",
|
|
71
|
+
"default": "302",
|
|
72
|
+
"options": [
|
|
73
|
+
{ "value": "302", "label": "302 Found (temporary)" },
|
|
74
|
+
{ "value": "307", "label": "307 Temporary Redirect" },
|
|
75
|
+
{ "value": "301", "label": "301 Moved Permanently" },
|
|
76
|
+
{ "value": "308", "label": "308 Permanent Redirect" }
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
"repeatSeconds": { "type": "number", "label": "Don't count the same address again on a link for (seconds; 0 counts every click)", "default": 60, "min": 0, "max": 86400 },
|
|
80
|
+
"recordCountries": { "type": "boolean", "label": "Record visitors' countries", "default": true },
|
|
81
|
+
"recordReferrers": { "type": "boolean", "label": "Record referring sites (hostnames)", "default": true },
|
|
82
|
+
"timeZone": { "type": "string", "label": "Time zone for daily statistics and expiry dates (e.g. Europe/London)", "default": "UTC" },
|
|
83
|
+
"qrLevel": {
|
|
84
|
+
"type": "select",
|
|
85
|
+
"label": "QR error correction",
|
|
86
|
+
"default": "M",
|
|
87
|
+
"options": [
|
|
88
|
+
{ "value": "L", "label": "Low (7%)" },
|
|
89
|
+
{ "value": "M", "label": "Medium (15%)" },
|
|
90
|
+
{ "value": "Q", "label": "Quartile (25%)" },
|
|
91
|
+
{ "value": "H", "label": "High (30%, for a logo over the code)" }
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
"qrScale": { "type": "number", "label": "QR pixels per module", "default": 8, "min": 1, "max": 40 },
|
|
95
|
+
"qrMargin": { "type": "number", "label": "QR quiet zone (modules)", "default": 4, "min": 0, "max": 16 }
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
package/llms.txt
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Short Links (EmDash plugin)
|
|
2
|
+
|
|
3
|
+
> Short, trackable links and QR codes for print, social and email, with campaign reports and no tracking cookies.
|
|
4
|
+
|
|
5
|
+
`@cherwell/emdash-shortlinks` is a sandboxed plugin for EmDash CMS (Astro, Cloudflare Workers). Registry slug: `shortlinks`. MIT licence. Requires EmDash >=1.0.0.
|
|
6
|
+
|
|
7
|
+
Install: Admin ▸ Plugins ▸ Browse in EmDash, or `npm install @cherwell/emdash-shortlinks` and add it to `emdash()` in astro.config. The site helpers are imported from `@cherwell/emdash-shortlinks/astro`.
|
|
8
|
+
|
|
9
|
+
## Docs
|
|
10
|
+
|
|
11
|
+
- [README](https://raw.githubusercontent.com/cherwell-studio/emdash-plugins/main/plugins/shortlinks/README.md): what it does, setup, site wiring, limits
|
|
12
|
+
- [Reference](https://raw.githubusercontent.com/cherwell-studio/emdash-plugins/main/plugins/shortlinks/docs/reference.md): every setting, capability, storage collection, route, MCP tool and site helper signature, generated from the code
|
|
13
|
+
- [Installation](https://raw.githubusercontent.com/cherwell-studio/emdash-plugins/main/plugins/shortlinks/docs/install.md): the shortest path to a working install
|
|
14
|
+
- [FAQ](https://raw.githubusercontent.com/cherwell-studio/emdash-plugins/main/plugins/shortlinks/docs/faq.md): common questions and troubleshooting
|
|
15
|
+
|
|
16
|
+
## Optional
|
|
17
|
+
|
|
18
|
+
- [Changelog](https://raw.githubusercontent.com/cherwell-studio/emdash-plugins/main/plugins/shortlinks/CHANGELOG.md)
|
|
19
|
+
- [Manifest](https://raw.githubusercontent.com/cherwell-studio/emdash-plugins/main/plugins/shortlinks/emdash-plugin.jsonc): the plugin's declared capabilities, storage and settings
|
|
20
|
+
- [Source](https://github.com/cherwell-studio/emdash-plugins/blob/main/plugins/shortlinks/src)
|
package/package.json
CHANGED
|
@@ -1,6 +1,82 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cherwell/emdash-shortlinks",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Short, trackable links and QR codes for EmDash, with campaign reports and no tracking cookies.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"emdash",
|
|
7
|
+
"emdash-plugin",
|
|
8
|
+
"short-links",
|
|
9
|
+
"qr-code",
|
|
10
|
+
"utm",
|
|
11
|
+
"redirects"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://github.com/cherwell-studio/emdash-plugins/tree/main/plugins/shortlinks#readme",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/cherwell-studio/emdash-plugins/issues"
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/cherwell-studio/emdash-plugins.git",
|
|
20
|
+
"directory": "plugins/shortlinks"
|
|
21
|
+
},
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"author": "Cherwell Studio (https://cherwell.studio)",
|
|
24
|
+
"type": "module",
|
|
25
|
+
"sideEffects": false,
|
|
26
|
+
"main": "./dist/index.mjs",
|
|
27
|
+
"types": "./dist/index.d.mts",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/index.d.mts",
|
|
31
|
+
"import": "./dist/index.mjs"
|
|
32
|
+
},
|
|
33
|
+
"./sandbox": "./dist/plugin.mjs",
|
|
34
|
+
"./astro": {
|
|
35
|
+
"types": "./dist/helpers/astro.d.ts",
|
|
36
|
+
"import": "./dist/helpers/astro.js"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist",
|
|
41
|
+
"emdash-plugin.jsonc",
|
|
42
|
+
"assets",
|
|
43
|
+
"docs",
|
|
44
|
+
"README.md",
|
|
45
|
+
"CHANGELOG.md",
|
|
46
|
+
"LICENSE",
|
|
47
|
+
"llms.txt"
|
|
48
|
+
],
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"emdash": ">=1.0.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@emdash-cms/blocks": "^1.6.0",
|
|
54
|
+
"@emdash-cms/plugin-cli": "0.13.7",
|
|
55
|
+
"@emdash-cms/plugin-test": "^0.2.6",
|
|
56
|
+
"@types/node": "^24.0.0",
|
|
57
|
+
"@vitest/coverage-v8": "^4.1.0",
|
|
58
|
+
"emdash": "^1.6.0",
|
|
59
|
+
"qrcode-generator": "^2.0.4",
|
|
60
|
+
"tsdown": "^0.20.0",
|
|
61
|
+
"typescript": "^5.9.0",
|
|
62
|
+
"vitest": "^4.1.0",
|
|
63
|
+
"zod": "4.6.7",
|
|
64
|
+
"@cherwell/emdash-kit": "0.1.0"
|
|
65
|
+
},
|
|
66
|
+
"publishConfig": {
|
|
67
|
+
"access": "public"
|
|
68
|
+
},
|
|
69
|
+
"engines": {
|
|
70
|
+
"node": ">=22"
|
|
71
|
+
},
|
|
72
|
+
"scripts": {
|
|
73
|
+
"build": "emdash-plugin build && tsdown",
|
|
74
|
+
"dev": "emdash-plugin dev",
|
|
75
|
+
"validate": "emdash-plugin validate",
|
|
76
|
+
"typecheck": "tsc --noEmit",
|
|
77
|
+
"test": "vitest run",
|
|
78
|
+
"bundle": "emdash-plugin bundle",
|
|
79
|
+
"test:unit": "vitest run --project unit",
|
|
80
|
+
"coverage": "vitest run --project unit --coverage"
|
|
81
|
+
}
|
|
6
82
|
}
|