@cherwell/emdash-plausible 0.0.0-stage → 0.1.1
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 +19 -0
- package/LICENSE +21 -0
- package/README.md +223 -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 +48 -0
- package/dist/helpers/astro.js +229 -0
- package/dist/index.d.mts +5 -0
- package/dist/index.mjs +154 -0
- package/dist/manifest.json +155 -0
- package/dist/plugin.d.mts +1698 -0
- package/dist/plugin.mjs +56 -0
- package/docs/faq.md +35 -0
- package/docs/install.md +41 -0
- package/docs/overview.md +14 -0
- package/docs/reference.md +142 -0
- package/docs/security.md +11 -0
- package/emdash-plugin.jsonc +64 -0
- package/llms.txt +20 -0
- package/package.json +78 -3
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
// Auto-generated by emdash-plugin build. Do not edit.
|
|
2
|
+
// Source: emdash-plugin.jsonc + package.json
|
|
3
|
+
//
|
|
4
|
+
// Default-exports a sandboxed plugin descriptor. Pass it directly into
|
|
5
|
+
// emdash's `plugins:` or `sandboxed:` array — no factory call needed.
|
|
6
|
+
|
|
7
|
+
/** @type {import("emdash").PluginDescriptor} */
|
|
8
|
+
const descriptor = Object.freeze({
|
|
9
|
+
"id": "plausible",
|
|
10
|
+
"displayName": "Plausible Analytics",
|
|
11
|
+
"description": "Plausible Analytics for EmDash: the tracking script served from your own domain, and visitor reports in the admin.",
|
|
12
|
+
"version": "0.1.1",
|
|
13
|
+
"format": "standard",
|
|
14
|
+
"entrypoint": "@cherwell/emdash-plausible/sandbox",
|
|
15
|
+
"capabilities": [
|
|
16
|
+
"network:request",
|
|
17
|
+
"hooks.page-fragments:register"
|
|
18
|
+
],
|
|
19
|
+
"allowedHosts": [
|
|
20
|
+
"plausible.io"
|
|
21
|
+
],
|
|
22
|
+
"storage": {},
|
|
23
|
+
"hooks": [
|
|
24
|
+
"page:fragments"
|
|
25
|
+
],
|
|
26
|
+
"routes": [
|
|
27
|
+
{
|
|
28
|
+
"name": "report",
|
|
29
|
+
"permission": "content:edit_any"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "admin",
|
|
33
|
+
"permission": "content:edit_any"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"mcp": {
|
|
37
|
+
"tools": [
|
|
38
|
+
{
|
|
39
|
+
"name": "plausible_report",
|
|
40
|
+
"description": "Read the site's Plausible statistics for the last 7 days, 30 days or 12 months: visitors, visits, pageviews, bounce rate, visit duration, visitors over time, top pages and top sources.",
|
|
41
|
+
"route": "report",
|
|
42
|
+
"permission": "content:edit_any",
|
|
43
|
+
"destructive": false,
|
|
44
|
+
"inputSchema": {
|
|
45
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
46
|
+
"type": "object",
|
|
47
|
+
"properties": {
|
|
48
|
+
"range": {
|
|
49
|
+
"default": "30d",
|
|
50
|
+
"type": "string",
|
|
51
|
+
"enum": [
|
|
52
|
+
"7d",
|
|
53
|
+
"30d",
|
|
54
|
+
"12mo"
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
"fresh": {
|
|
58
|
+
"default": false,
|
|
59
|
+
"type": "boolean"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"required": [
|
|
63
|
+
"range",
|
|
64
|
+
"fresh"
|
|
65
|
+
],
|
|
66
|
+
"additionalProperties": false
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
"adminPages": [
|
|
72
|
+
{
|
|
73
|
+
"path": "/reports",
|
|
74
|
+
"label": "Plausible Analytics",
|
|
75
|
+
"icon": "chart-line",
|
|
76
|
+
"group": "Plausible"
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"adminWidgets": [
|
|
80
|
+
{
|
|
81
|
+
"id": "visitors",
|
|
82
|
+
"title": "Plausible visitors",
|
|
83
|
+
"size": "third"
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
"settingsSchema": {
|
|
87
|
+
"domain": {
|
|
88
|
+
"label": "Site domain, as Plausible knows it (e.g. example.com)",
|
|
89
|
+
"type": "string"
|
|
90
|
+
},
|
|
91
|
+
"tracking": {
|
|
92
|
+
"label": "Tracking",
|
|
93
|
+
"type": "select",
|
|
94
|
+
"options": [
|
|
95
|
+
{
|
|
96
|
+
"value": "script",
|
|
97
|
+
"label": "Add Plausible's script to every public page"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"value": "off",
|
|
101
|
+
"label": "Off: the site sends its own events (reports only)"
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
"default": "script"
|
|
105
|
+
},
|
|
106
|
+
"scriptPath": {
|
|
107
|
+
"label": "Script file, from your Plausible snippet (e.g. /js/pa-AbC123.js or /js/script.js)",
|
|
108
|
+
"type": "string",
|
|
109
|
+
"default": "/js/script.js"
|
|
110
|
+
},
|
|
111
|
+
"proxyPath": {
|
|
112
|
+
"label": "Path your site proxies Plausible on (empty loads from plausible.io)",
|
|
113
|
+
"type": "string",
|
|
114
|
+
"default": "/p"
|
|
115
|
+
},
|
|
116
|
+
"skipPaths": {
|
|
117
|
+
"label": "Paths not tracked (comma-separated prefixes)",
|
|
118
|
+
"type": "string",
|
|
119
|
+
"default": "/_emdash"
|
|
120
|
+
},
|
|
121
|
+
"pageProps": {
|
|
122
|
+
"label": "Send the page type and collection with each pageview",
|
|
123
|
+
"type": "boolean",
|
|
124
|
+
"default": true
|
|
125
|
+
},
|
|
126
|
+
"outbound": {
|
|
127
|
+
"label": "Track outbound link clicks (legacy script.js only)",
|
|
128
|
+
"type": "boolean",
|
|
129
|
+
"default": true
|
|
130
|
+
},
|
|
131
|
+
"fileDownloads": {
|
|
132
|
+
"label": "Track file downloads (legacy script.js only)",
|
|
133
|
+
"type": "boolean",
|
|
134
|
+
"default": true
|
|
135
|
+
},
|
|
136
|
+
"apiKey": {
|
|
137
|
+
"label": "Stats API key, for reports in the admin",
|
|
138
|
+
"type": "secret"
|
|
139
|
+
},
|
|
140
|
+
"cacheMinutes": {
|
|
141
|
+
"label": "Keep reports for (minutes) before asking Plausible again",
|
|
142
|
+
"type": "number",
|
|
143
|
+
"default": 15,
|
|
144
|
+
"min": 1,
|
|
145
|
+
"max": 1440
|
|
146
|
+
},
|
|
147
|
+
"dashboardUrl": {
|
|
148
|
+
"label": "Your Plausible dashboard or shared link, linked from the reports",
|
|
149
|
+
"type": "url"
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
export default descriptor;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "plausible",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"declaredAccess": {
|
|
5
|
+
"network": {
|
|
6
|
+
"request": {
|
|
7
|
+
"allowedHosts": [
|
|
8
|
+
"plausible.io"
|
|
9
|
+
]
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"page": {
|
|
13
|
+
"fragments": {}
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"capabilities": [
|
|
17
|
+
"network:request",
|
|
18
|
+
"hooks.page-fragments:register"
|
|
19
|
+
],
|
|
20
|
+
"allowedHosts": [
|
|
21
|
+
"plausible.io"
|
|
22
|
+
],
|
|
23
|
+
"storage": {},
|
|
24
|
+
"hooks": [
|
|
25
|
+
"page:fragments"
|
|
26
|
+
],
|
|
27
|
+
"routes": [
|
|
28
|
+
{
|
|
29
|
+
"name": "report",
|
|
30
|
+
"permission": "content:edit_any"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "admin",
|
|
34
|
+
"permission": "content:edit_any"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"mcp": {
|
|
38
|
+
"tools": [
|
|
39
|
+
{
|
|
40
|
+
"name": "plausible_report",
|
|
41
|
+
"description": "Read the site's Plausible statistics for the last 7 days, 30 days or 12 months: visitors, visits, pageviews, bounce rate, visit duration, visitors over time, top pages and top sources.",
|
|
42
|
+
"route": "report",
|
|
43
|
+
"permission": "content:edit_any",
|
|
44
|
+
"destructive": false,
|
|
45
|
+
"inputSchema": {
|
|
46
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
47
|
+
"type": "object",
|
|
48
|
+
"properties": {
|
|
49
|
+
"range": {
|
|
50
|
+
"default": "30d",
|
|
51
|
+
"type": "string",
|
|
52
|
+
"enum": [
|
|
53
|
+
"7d",
|
|
54
|
+
"30d",
|
|
55
|
+
"12mo"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
"fresh": {
|
|
59
|
+
"default": false,
|
|
60
|
+
"type": "boolean"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"required": [
|
|
64
|
+
"range",
|
|
65
|
+
"fresh"
|
|
66
|
+
],
|
|
67
|
+
"additionalProperties": false
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"admin": {
|
|
73
|
+
"settingsSchema": {
|
|
74
|
+
"domain": {
|
|
75
|
+
"label": "Site domain, as Plausible knows it (e.g. example.com)",
|
|
76
|
+
"type": "string"
|
|
77
|
+
},
|
|
78
|
+
"tracking": {
|
|
79
|
+
"label": "Tracking",
|
|
80
|
+
"type": "select",
|
|
81
|
+
"options": [
|
|
82
|
+
{
|
|
83
|
+
"value": "script",
|
|
84
|
+
"label": "Add Plausible's script to every public page"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"value": "off",
|
|
88
|
+
"label": "Off: the site sends its own events (reports only)"
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"default": "script"
|
|
92
|
+
},
|
|
93
|
+
"scriptPath": {
|
|
94
|
+
"label": "Script file, from your Plausible snippet (e.g. /js/pa-AbC123.js or /js/script.js)",
|
|
95
|
+
"type": "string",
|
|
96
|
+
"default": "/js/script.js"
|
|
97
|
+
},
|
|
98
|
+
"proxyPath": {
|
|
99
|
+
"label": "Path your site proxies Plausible on (empty loads from plausible.io)",
|
|
100
|
+
"type": "string",
|
|
101
|
+
"default": "/p"
|
|
102
|
+
},
|
|
103
|
+
"skipPaths": {
|
|
104
|
+
"label": "Paths not tracked (comma-separated prefixes)",
|
|
105
|
+
"type": "string",
|
|
106
|
+
"default": "/_emdash"
|
|
107
|
+
},
|
|
108
|
+
"pageProps": {
|
|
109
|
+
"label": "Send the page type and collection with each pageview",
|
|
110
|
+
"type": "boolean",
|
|
111
|
+
"default": true
|
|
112
|
+
},
|
|
113
|
+
"outbound": {
|
|
114
|
+
"label": "Track outbound link clicks (legacy script.js only)",
|
|
115
|
+
"type": "boolean",
|
|
116
|
+
"default": true
|
|
117
|
+
},
|
|
118
|
+
"fileDownloads": {
|
|
119
|
+
"label": "Track file downloads (legacy script.js only)",
|
|
120
|
+
"type": "boolean",
|
|
121
|
+
"default": true
|
|
122
|
+
},
|
|
123
|
+
"apiKey": {
|
|
124
|
+
"label": "Stats API key, for reports in the admin",
|
|
125
|
+
"type": "secret"
|
|
126
|
+
},
|
|
127
|
+
"cacheMinutes": {
|
|
128
|
+
"label": "Keep reports for (minutes) before asking Plausible again",
|
|
129
|
+
"type": "number",
|
|
130
|
+
"default": 15,
|
|
131
|
+
"min": 1,
|
|
132
|
+
"max": 1440
|
|
133
|
+
},
|
|
134
|
+
"dashboardUrl": {
|
|
135
|
+
"label": "Your Plausible dashboard or shared link, linked from the reports",
|
|
136
|
+
"type": "url"
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"pages": [
|
|
140
|
+
{
|
|
141
|
+
"path": "/reports",
|
|
142
|
+
"label": "Plausible Analytics",
|
|
143
|
+
"icon": "chart-line",
|
|
144
|
+
"group": "Plausible"
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
"widgets": [
|
|
148
|
+
{
|
|
149
|
+
"id": "visitors",
|
|
150
|
+
"title": "Plausible visitors",
|
|
151
|
+
"size": "third"
|
|
152
|
+
}
|
|
153
|
+
]
|
|
154
|
+
}
|
|
155
|
+
}
|