strapi-plugin-matomo 0.0.2

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.
Files changed (38) hide show
  1. package/README.md +1 -0
  2. package/dist/_chunks/App-BiVY-Oop.js +17 -0
  3. package/dist/_chunks/App-S_HgRhsg.mjs +17 -0
  4. package/dist/_chunks/Dashboard-C9FKj-j8.mjs +46 -0
  5. package/dist/_chunks/Dashboard-DdFVwM_o.js +46 -0
  6. package/dist/_chunks/en-B4KWt_jN.js +4 -0
  7. package/dist/_chunks/en-Byx4XI2L.mjs +4 -0
  8. package/dist/admin/index.js +117 -0
  9. package/dist/admin/index.mjs +118 -0
  10. package/dist/admin/src/components/Dashboard.d.ts +3 -0
  11. package/dist/admin/src/components/Initializer.d.ts +5 -0
  12. package/dist/admin/src/components/PluginIcon.d.ts +2 -0
  13. package/dist/admin/src/index.d.ts +10 -0
  14. package/dist/admin/src/pages/App.d.ts +2 -0
  15. package/dist/admin/src/pages/HomePage.d.ts +2 -0
  16. package/dist/admin/src/pluginId.d.ts +1 -0
  17. package/dist/admin/src/utils/getTranslation.d.ts +2 -0
  18. package/dist/server/index.js +61 -0
  19. package/dist/server/index.mjs +62 -0
  20. package/dist/server/src/bootstrap.d.ts +5 -0
  21. package/dist/server/src/config/index.d.ts +5 -0
  22. package/dist/server/src/config.d.ts +4 -0
  23. package/dist/server/src/constants.d.ts +1 -0
  24. package/dist/server/src/content-types/index.d.ts +2 -0
  25. package/dist/server/src/controllers/index.d.ts +6 -0
  26. package/dist/server/src/controllers/matomo.d.ts +4 -0
  27. package/dist/server/src/destroy.d.ts +5 -0
  28. package/dist/server/src/index.d.ts +43 -0
  29. package/dist/server/src/middlewares/index.d.ts +2 -0
  30. package/dist/server/src/policies/index.d.ts +2 -0
  31. package/dist/server/src/register.d.ts +5 -0
  32. package/dist/server/src/routes/adminApi.d.ts +12 -0
  33. package/dist/server/src/routes/index.d.ts +14 -0
  34. package/dist/server/src/services/config.d.ts +9 -0
  35. package/dist/server/src/services/index.d.ts +12 -0
  36. package/dist/server/src/utils/getService.d.ts +3 -0
  37. package/dist/server/src/utils/index.d.ts +1 -0
  38. package/package.json +69 -0
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # matomo-strapi
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const admin = require("@strapi/strapi/admin");
5
+ const reactRouterDom = require("react-router-dom");
6
+ const react = require("react");
7
+ const Dashboard = react.lazy(() => Promise.resolve().then(() => require("./Dashboard-DdFVwM_o.js")));
8
+ const HomePage = () => {
9
+ return /* @__PURE__ */ jsxRuntime.jsx(react.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(admin.Page.Loading, {}), children: /* @__PURE__ */ jsxRuntime.jsx(Dashboard, {}) });
10
+ };
11
+ const App = () => {
12
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.Routes, { children: [
13
+ /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { index: true, element: /* @__PURE__ */ jsxRuntime.jsx(HomePage, {}) }),
14
+ /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { path: "*", element: /* @__PURE__ */ jsxRuntime.jsx(admin.Page.Error, {}) })
15
+ ] });
16
+ };
17
+ exports.App = App;
@@ -0,0 +1,17 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Page } from "@strapi/strapi/admin";
3
+ import { Routes, Route } from "react-router-dom";
4
+ import { Suspense, lazy } from "react";
5
+ const Dashboard = lazy(() => import("./Dashboard-C9FKj-j8.mjs"));
6
+ const HomePage = () => {
7
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Page.Loading, {}), children: /* @__PURE__ */ jsx(Dashboard, {}) });
8
+ };
9
+ const App = () => {
10
+ return /* @__PURE__ */ jsxs(Routes, { children: [
11
+ /* @__PURE__ */ jsx(Route, { index: true, element: /* @__PURE__ */ jsx(HomePage, {}) }),
12
+ /* @__PURE__ */ jsx(Route, { path: "*", element: /* @__PURE__ */ jsx(Page.Error, {}) })
13
+ ] });
14
+ };
15
+ export {
16
+ App
17
+ };
@@ -0,0 +1,46 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useFetchClient } from "@strapi/strapi/admin";
3
+ import { memo, useState, useEffect } from "react";
4
+ const PLUGIN_ID = "matomo";
5
+ const Dashboard = () => {
6
+ const [url, setUrl] = useState(null);
7
+ const { get } = useFetchClient();
8
+ useEffect(() => {
9
+ (async () => {
10
+ const res = await get(`/${PLUGIN_ID}/config`);
11
+ const config = res.data;
12
+ console.log(config.config);
13
+ setUrl(config.config.widgetURL);
14
+ })();
15
+ }, []);
16
+ return url ? /* @__PURE__ */ jsxs("div", { children: [
17
+ /* @__PURE__ */ jsx(
18
+ "iframe",
19
+ {
20
+ src: url,
21
+ width: "100%",
22
+ height: "100%",
23
+ loading: "lazy",
24
+ frameBorder: "0",
25
+ style: { height: "calc(100vh - 2px)", width: "100%" }
26
+ }
27
+ ),
28
+ /* @__PURE__ */ jsxs("div", { style: { fontSize: 14, paddingBottom: 16 }, children: [
29
+ "Stats powered by",
30
+ " ",
31
+ /* @__PURE__ */ jsx(
32
+ "a",
33
+ {
34
+ target: "_blank",
35
+ style: { color: "#4F46E5", textDecoration: "underline" },
36
+ href: "https://matomo.org/",
37
+ children: "Matomo"
38
+ }
39
+ )
40
+ ] })
41
+ ] }) : null;
42
+ };
43
+ const Dashboard$1 = memo(Dashboard);
44
+ export {
45
+ Dashboard$1 as default
46
+ };
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const admin = require("@strapi/strapi/admin");
5
+ const react = require("react");
6
+ const PLUGIN_ID = "matomo";
7
+ const Dashboard = () => {
8
+ const [url, setUrl] = react.useState(null);
9
+ const { get } = admin.useFetchClient();
10
+ react.useEffect(() => {
11
+ (async () => {
12
+ const res = await get(`/${PLUGIN_ID}/config`);
13
+ const config = res.data;
14
+ console.log(config.config);
15
+ setUrl(config.config.widgetURL);
16
+ })();
17
+ }, []);
18
+ return url ? /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
19
+ /* @__PURE__ */ jsxRuntime.jsx(
20
+ "iframe",
21
+ {
22
+ src: url,
23
+ width: "100%",
24
+ height: "100%",
25
+ loading: "lazy",
26
+ frameBorder: "0",
27
+ style: { height: "calc(100vh - 2px)", width: "100%" }
28
+ }
29
+ ),
30
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: 14, paddingBottom: 16 }, children: [
31
+ "Stats powered by",
32
+ " ",
33
+ /* @__PURE__ */ jsxRuntime.jsx(
34
+ "a",
35
+ {
36
+ target: "_blank",
37
+ style: { color: "#4F46E5", textDecoration: "underline" },
38
+ href: "https://matomo.org/",
39
+ children: "Matomo"
40
+ }
41
+ )
42
+ ] })
43
+ ] }) : null;
44
+ };
45
+ const Dashboard$1 = react.memo(Dashboard);
46
+ exports.default = Dashboard$1;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const en = {};
4
+ exports.default = en;
@@ -0,0 +1,4 @@
1
+ const en = {};
2
+ export {
3
+ en as default
4
+ };
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ const react = require("react");
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
5
+ const v = glob[path];
6
+ if (v) {
7
+ return typeof v === "function" ? v() : Promise.resolve(v);
8
+ }
9
+ return new Promise((_, reject) => {
10
+ (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
11
+ reject.bind(
12
+ null,
13
+ new Error(
14
+ "Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
15
+ )
16
+ )
17
+ );
18
+ });
19
+ };
20
+ const PLUGIN_ID = "matomo-strapi";
21
+ const Initializer = ({ setPlugin }) => {
22
+ const ref = react.useRef(setPlugin);
23
+ react.useEffect(() => {
24
+ ref.current(PLUGIN_ID);
25
+ }, []);
26
+ return null;
27
+ };
28
+ const PluginIcon = () => /* @__PURE__ */ jsxRuntime.jsxs(
29
+ "svg",
30
+ {
31
+ xmlns: "http://www.w3.org/2000/svg",
32
+ xmlnsXlink: "http://www.w3.org/1999/xlink",
33
+ width: "100%",
34
+ height: "100%",
35
+ viewBox: "-30 0 150 50",
36
+ children: [
37
+ /* @__PURE__ */ jsxRuntime.jsxs("defs", { children: [
38
+ /* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "a", transform: "translate(-7.52 -22.83)", children: /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "none", d: "M0 0h360v99H0z" }) }),
39
+ /* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "b", transform: "translate(-7.52 -22.83)", children: /* @__PURE__ */ jsxRuntime.jsx(
40
+ "path",
41
+ {
42
+ d: "M54.17 39.63a11.74 11.74 0 0 0 3 7.86L71 68.71l.17.27.08.11a11.79 11.79 0 0 0 19.69-13l-.21-.33a.71.71 0 0 1-.1-.14L76 33.45a11.79 11.79 0 0 0-21.84 6.18",
43
+ fill: "none"
44
+ }
45
+ ) }),
46
+ /* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "c", transform: "translate(-7.52 -22.83)", children: /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "none", d: "M7.52 22.83h77.52v58.32H7.52z" }) })
47
+ ] }),
48
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { "clip-path": "url(#a)", "data-name": "Layer 1", style: { clipPath: "url(#clip-path)" }, children: [
49
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { "clip-path": "url(#a)", children: [
50
+ /* @__PURE__ */ jsxRuntime.jsx(
51
+ "path",
52
+ {
53
+ d: "M83.38 33.29l-.21-.33a.71.71 0 0 1-.1-.14l-14.59-22.2-18.85 14 13.85 21.26.17.27.08.11a11.8 11.8 0 0 0 19.69-13",
54
+ fill: "#95c748"
55
+ }
56
+ ),
57
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M26.83 39.47a11.8 11.8 0 1 0-11.8 11.8 11.8 11.8 0 0 0 11.8-11.8", fill: "#35bfc0" })
58
+ ] }),
59
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { "clip-path": "url(#b)", children: [
60
+ /* @__PURE__ */ jsxRuntime.jsx("g", { "clip-path": "url(#c)", style: { clipPath: "url(#clip-path-5)" }, opacity: ".5" }),
61
+ /* @__PURE__ */ jsxRuntime.jsx(
62
+ "path",
63
+ {
64
+ d: "M70.3 16.8a11.81 11.81 0 1 0-21.66 6.48l-9-12.66a11.78 11.78 0 0 0-20.08 0L5.3 32.86a11.79 11.79 0 0 1 19.87.51l9.31 13.09a11.77 11.77 0 0 0 19 0l.1-.15a10.53 10.53 0 0 0 .67-1.06l14-21.83a11.77 11.77 0 0 0 2-6.62m-19.84 8.58l.2.19-.2-.19m1 .88l.23.17-.16-.17m2.58 1.47l.31.11-.31-.11m1.28.43l.42.1-.42-.1m1.37.29l.42.06-.42-.06m9.57-2.77l.31-.29-.31.29m-6.39 2.84l.42-.07-.42.07m1.34-.24l.45-.12-.45.12m1.34-.41a3.57 3.57 0 0 0 .38-.14 3.57 3.57 0 0 1-.38.14m2.66-1.39l.25-.21-.29.22m2-1.77l.25-.27-.25.27M5.01 33.33c.09-.15.17-.29.27-.43l-.28.43z",
65
+ fill: "#3253a0"
66
+ }
67
+ )
68
+ ] }),
69
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { "clip-path": "url(#a)", children: [
70
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M70.25 16.8a11.8 11.8 0 1 0-11.77 11.8 11.8 11.8 0 0 0 11.8-11.8", fill: "#f38334" }),
71
+ /* @__PURE__ */ jsxRuntime.jsx(
72
+ "path",
73
+ {
74
+ d: "M58.48 28.6a11.78 11.78 0 0 1-9.86-5.32l-9-12.66a11.77 11.77 0 0 0-20.07 0L5.25 32.86a11.79 11.79 0 0 1 19.87.51l9.36 13.09a11.77 11.77 0 0 0 19 0l.09-.15.68-1 14-21.84a11.78 11.78 0 0 1-9.77 5.13M4.95 33.33l.26-.43z",
75
+ fill: "#3152a0"
76
+ }
77
+ )
78
+ ] })
79
+ ] })
80
+ ]
81
+ }
82
+ );
83
+ const index = {
84
+ register(app) {
85
+ app.addMenuLink({
86
+ to: `plugins/${PLUGIN_ID}`,
87
+ icon: PluginIcon,
88
+ intlLabel: {
89
+ id: `${PLUGIN_ID}.plugin.name`,
90
+ defaultMessage: "Matomo"
91
+ },
92
+ Component: async () => {
93
+ const { App } = await Promise.resolve().then(() => require("../_chunks/App-BiVY-Oop.js"));
94
+ return App;
95
+ }
96
+ });
97
+ app.registerPlugin({
98
+ id: PLUGIN_ID,
99
+ initializer: Initializer,
100
+ isReady: false,
101
+ name: PLUGIN_ID
102
+ });
103
+ },
104
+ async registerTrads({ locales }) {
105
+ return Promise.all(
106
+ locales.map(async (locale) => {
107
+ try {
108
+ const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => Promise.resolve().then(() => require("../_chunks/en-B4KWt_jN.js")) }), `./translations/${locale}.json`, 3);
109
+ return { data, locale };
110
+ } catch {
111
+ return { data: {}, locale };
112
+ }
113
+ })
114
+ );
115
+ }
116
+ };
117
+ module.exports = index;
@@ -0,0 +1,118 @@
1
+ import { useRef, useEffect } from "react";
2
+ import { jsxs, jsx } from "react/jsx-runtime";
3
+ const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
4
+ const v = glob[path];
5
+ if (v) {
6
+ return typeof v === "function" ? v() : Promise.resolve(v);
7
+ }
8
+ return new Promise((_, reject) => {
9
+ (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
10
+ reject.bind(
11
+ null,
12
+ new Error(
13
+ "Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
14
+ )
15
+ )
16
+ );
17
+ });
18
+ };
19
+ const PLUGIN_ID = "matomo-strapi";
20
+ const Initializer = ({ setPlugin }) => {
21
+ const ref = useRef(setPlugin);
22
+ useEffect(() => {
23
+ ref.current(PLUGIN_ID);
24
+ }, []);
25
+ return null;
26
+ };
27
+ const PluginIcon = () => /* @__PURE__ */ jsxs(
28
+ "svg",
29
+ {
30
+ xmlns: "http://www.w3.org/2000/svg",
31
+ xmlnsXlink: "http://www.w3.org/1999/xlink",
32
+ width: "100%",
33
+ height: "100%",
34
+ viewBox: "-30 0 150 50",
35
+ children: [
36
+ /* @__PURE__ */ jsxs("defs", { children: [
37
+ /* @__PURE__ */ jsx("clipPath", { id: "a", transform: "translate(-7.52 -22.83)", children: /* @__PURE__ */ jsx("path", { fill: "none", d: "M0 0h360v99H0z" }) }),
38
+ /* @__PURE__ */ jsx("clipPath", { id: "b", transform: "translate(-7.52 -22.83)", children: /* @__PURE__ */ jsx(
39
+ "path",
40
+ {
41
+ d: "M54.17 39.63a11.74 11.74 0 0 0 3 7.86L71 68.71l.17.27.08.11a11.79 11.79 0 0 0 19.69-13l-.21-.33a.71.71 0 0 1-.1-.14L76 33.45a11.79 11.79 0 0 0-21.84 6.18",
42
+ fill: "none"
43
+ }
44
+ ) }),
45
+ /* @__PURE__ */ jsx("clipPath", { id: "c", transform: "translate(-7.52 -22.83)", children: /* @__PURE__ */ jsx("path", { fill: "none", d: "M7.52 22.83h77.52v58.32H7.52z" }) })
46
+ ] }),
47
+ /* @__PURE__ */ jsxs("g", { "clip-path": "url(#a)", "data-name": "Layer 1", style: { clipPath: "url(#clip-path)" }, children: [
48
+ /* @__PURE__ */ jsxs("g", { "clip-path": "url(#a)", children: [
49
+ /* @__PURE__ */ jsx(
50
+ "path",
51
+ {
52
+ d: "M83.38 33.29l-.21-.33a.71.71 0 0 1-.1-.14l-14.59-22.2-18.85 14 13.85 21.26.17.27.08.11a11.8 11.8 0 0 0 19.69-13",
53
+ fill: "#95c748"
54
+ }
55
+ ),
56
+ /* @__PURE__ */ jsx("path", { d: "M26.83 39.47a11.8 11.8 0 1 0-11.8 11.8 11.8 11.8 0 0 0 11.8-11.8", fill: "#35bfc0" })
57
+ ] }),
58
+ /* @__PURE__ */ jsxs("g", { "clip-path": "url(#b)", children: [
59
+ /* @__PURE__ */ jsx("g", { "clip-path": "url(#c)", style: { clipPath: "url(#clip-path-5)" }, opacity: ".5" }),
60
+ /* @__PURE__ */ jsx(
61
+ "path",
62
+ {
63
+ d: "M70.3 16.8a11.81 11.81 0 1 0-21.66 6.48l-9-12.66a11.78 11.78 0 0 0-20.08 0L5.3 32.86a11.79 11.79 0 0 1 19.87.51l9.31 13.09a11.77 11.77 0 0 0 19 0l.1-.15a10.53 10.53 0 0 0 .67-1.06l14-21.83a11.77 11.77 0 0 0 2-6.62m-19.84 8.58l.2.19-.2-.19m1 .88l.23.17-.16-.17m2.58 1.47l.31.11-.31-.11m1.28.43l.42.1-.42-.1m1.37.29l.42.06-.42-.06m9.57-2.77l.31-.29-.31.29m-6.39 2.84l.42-.07-.42.07m1.34-.24l.45-.12-.45.12m1.34-.41a3.57 3.57 0 0 0 .38-.14 3.57 3.57 0 0 1-.38.14m2.66-1.39l.25-.21-.29.22m2-1.77l.25-.27-.25.27M5.01 33.33c.09-.15.17-.29.27-.43l-.28.43z",
64
+ fill: "#3253a0"
65
+ }
66
+ )
67
+ ] }),
68
+ /* @__PURE__ */ jsxs("g", { "clip-path": "url(#a)", children: [
69
+ /* @__PURE__ */ jsx("path", { d: "M70.25 16.8a11.8 11.8 0 1 0-11.77 11.8 11.8 11.8 0 0 0 11.8-11.8", fill: "#f38334" }),
70
+ /* @__PURE__ */ jsx(
71
+ "path",
72
+ {
73
+ d: "M58.48 28.6a11.78 11.78 0 0 1-9.86-5.32l-9-12.66a11.77 11.77 0 0 0-20.07 0L5.25 32.86a11.79 11.79 0 0 1 19.87.51l9.36 13.09a11.77 11.77 0 0 0 19 0l.09-.15.68-1 14-21.84a11.78 11.78 0 0 1-9.77 5.13M4.95 33.33l.26-.43z",
74
+ fill: "#3152a0"
75
+ }
76
+ )
77
+ ] })
78
+ ] })
79
+ ]
80
+ }
81
+ );
82
+ const index = {
83
+ register(app) {
84
+ app.addMenuLink({
85
+ to: `plugins/${PLUGIN_ID}`,
86
+ icon: PluginIcon,
87
+ intlLabel: {
88
+ id: `${PLUGIN_ID}.plugin.name`,
89
+ defaultMessage: "Matomo"
90
+ },
91
+ Component: async () => {
92
+ const { App } = await import("../_chunks/App-S_HgRhsg.mjs");
93
+ return App;
94
+ }
95
+ });
96
+ app.registerPlugin({
97
+ id: PLUGIN_ID,
98
+ initializer: Initializer,
99
+ isReady: false,
100
+ name: PLUGIN_ID
101
+ });
102
+ },
103
+ async registerTrads({ locales }) {
104
+ return Promise.all(
105
+ locales.map(async (locale) => {
106
+ try {
107
+ const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => import("../_chunks/en-Byx4XI2L.mjs") }), `./translations/${locale}.json`, 3);
108
+ return { data, locale };
109
+ } catch {
110
+ return { data: {}, locale };
111
+ }
112
+ })
113
+ );
114
+ }
115
+ };
116
+ export {
117
+ index as default
118
+ };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const _default: import("react").MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element | null>;
3
+ export default _default;
@@ -0,0 +1,5 @@
1
+ type InitializerProps = {
2
+ setPlugin: (id: string) => void;
3
+ };
4
+ declare const Initializer: ({ setPlugin }: InitializerProps) => null;
5
+ export { Initializer };
@@ -0,0 +1,2 @@
1
+ declare const PluginIcon: () => import("react/jsx-runtime").JSX.Element;
2
+ export { PluginIcon };
@@ -0,0 +1,10 @@
1
+ declare const _default: {
2
+ register(app: any): void;
3
+ registerTrads({ locales }: {
4
+ locales: string[];
5
+ }): Promise<{
6
+ data: any;
7
+ locale: string;
8
+ }[]>;
9
+ };
10
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const App: () => import("react/jsx-runtime").JSX.Element;
2
+ export { App };
@@ -0,0 +1,2 @@
1
+ declare const HomePage: () => import("react/jsx-runtime").JSX.Element;
2
+ export { HomePage };
@@ -0,0 +1 @@
1
+ export declare const PLUGIN_ID = "matomo-strapi";
@@ -0,0 +1,2 @@
1
+ declare const getTranslation: (id: string) => string;
2
+ export { getTranslation };
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ const bootstrap = ({ strapi }) => {
3
+ };
4
+ const destroy = ({ strapi }) => {
5
+ };
6
+ const register = ({ strapi }) => {
7
+ };
8
+ const contentTypes = {};
9
+ const PLUGIN_ID = "matomo";
10
+ const getService = (name) => global.strapi.plugin(PLUGIN_ID).service(name);
11
+ const matomoController = {
12
+ async config(ctx) {
13
+ const config = await getService("config").get();
14
+ ctx.send({ config });
15
+ }
16
+ };
17
+ const controllers = {
18
+ "matomo": matomoController
19
+ };
20
+ const middlewares = {};
21
+ const policies = {};
22
+ const adminApiRoutes = {
23
+ type: "admin",
24
+ routes: [
25
+ {
26
+ method: "GET",
27
+ path: "/config",
28
+ handler: "matomo.config",
29
+ config: {
30
+ policies: ["admin::isAuthenticatedAdmin"]
31
+ }
32
+ }
33
+ ]
34
+ };
35
+ const routes = {
36
+ "admin-api": adminApiRoutes
37
+ };
38
+ const defaultConfig = {
39
+ widgetURL: null
40
+ };
41
+ const configService = ({ strapi }) => ({
42
+ async get() {
43
+ const config = await strapi.config.get(`plugin::${PLUGIN_ID}`, defaultConfig);
44
+ return config;
45
+ }
46
+ });
47
+ const services = {
48
+ config: configService
49
+ };
50
+ const index = {
51
+ register,
52
+ bootstrap,
53
+ destroy,
54
+ controllers,
55
+ routes,
56
+ services,
57
+ contentTypes,
58
+ policies,
59
+ middlewares
60
+ };
61
+ module.exports = index;
@@ -0,0 +1,62 @@
1
+ const bootstrap = ({ strapi }) => {
2
+ };
3
+ const destroy = ({ strapi }) => {
4
+ };
5
+ const register = ({ strapi }) => {
6
+ };
7
+ const contentTypes = {};
8
+ const PLUGIN_ID = "matomo";
9
+ const getService = (name) => global.strapi.plugin(PLUGIN_ID).service(name);
10
+ const matomoController = {
11
+ async config(ctx) {
12
+ const config = await getService("config").get();
13
+ ctx.send({ config });
14
+ }
15
+ };
16
+ const controllers = {
17
+ "matomo": matomoController
18
+ };
19
+ const middlewares = {};
20
+ const policies = {};
21
+ const adminApiRoutes = {
22
+ type: "admin",
23
+ routes: [
24
+ {
25
+ method: "GET",
26
+ path: "/config",
27
+ handler: "matomo.config",
28
+ config: {
29
+ policies: ["admin::isAuthenticatedAdmin"]
30
+ }
31
+ }
32
+ ]
33
+ };
34
+ const routes = {
35
+ "admin-api": adminApiRoutes
36
+ };
37
+ const defaultConfig = {
38
+ widgetURL: null
39
+ };
40
+ const configService = ({ strapi }) => ({
41
+ async get() {
42
+ const config = await strapi.config.get(`plugin::${PLUGIN_ID}`, defaultConfig);
43
+ return config;
44
+ }
45
+ });
46
+ const services = {
47
+ config: configService
48
+ };
49
+ const index = {
50
+ register,
51
+ bootstrap,
52
+ destroy,
53
+ controllers,
54
+ routes,
55
+ services,
56
+ contentTypes,
57
+ policies,
58
+ middlewares
59
+ };
60
+ export {
61
+ index as default
62
+ };
@@ -0,0 +1,5 @@
1
+ import type { Core } from '@strapi/strapi';
2
+ declare const bootstrap: ({ strapi }: {
3
+ strapi: Core.Strapi;
4
+ }) => void;
5
+ export default bootstrap;
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ default: {};
3
+ validator(): void;
4
+ };
5
+ export default _default;
@@ -0,0 +1,4 @@
1
+ export interface MatomoPluginConfig {
2
+ widgetURL: string | null;
3
+ }
4
+ export declare const defaultConfig: MatomoPluginConfig;
@@ -0,0 +1 @@
1
+ export declare const PLUGIN_ID = "matomo";
@@ -0,0 +1,2 @@
1
+ declare const _default: {};
2
+ export default _default;
@@ -0,0 +1,6 @@
1
+ declare const _default: {
2
+ matomo: {
3
+ config(ctx: any): Promise<void>;
4
+ };
5
+ };
6
+ export default _default;
@@ -0,0 +1,4 @@
1
+ declare const matomoController: {
2
+ config(ctx: any): Promise<void>;
3
+ };
4
+ export default matomoController;
@@ -0,0 +1,5 @@
1
+ import type { Core } from '@strapi/strapi';
2
+ declare const destroy: ({ strapi }: {
3
+ strapi: Core.Strapi;
4
+ }) => void;
5
+ export default destroy;
@@ -0,0 +1,43 @@
1
+ declare const _default: {
2
+ register: ({ strapi }: {
3
+ strapi: import("@strapi/types/dist/core").Strapi;
4
+ }) => void;
5
+ bootstrap: ({ strapi }: {
6
+ strapi: import("@strapi/types/dist/core").Strapi;
7
+ }) => void;
8
+ destroy: ({ strapi }: {
9
+ strapi: import("@strapi/types/dist/core").Strapi;
10
+ }) => void;
11
+ controllers: {
12
+ matomo: {
13
+ config(ctx: any): Promise<void>;
14
+ };
15
+ };
16
+ routes: {
17
+ 'admin-api': {
18
+ type: string;
19
+ routes: {
20
+ method: string;
21
+ path: string;
22
+ handler: string;
23
+ /**
24
+ * Plugin server methods
25
+ */
26
+ config: {
27
+ policies: string[];
28
+ };
29
+ }[];
30
+ };
31
+ };
32
+ services: {
33
+ config: ({ strapi }: {
34
+ strapi: import("@strapi/types/dist/core").Strapi;
35
+ }) => {
36
+ get(): Promise<import("./config").MatomoPluginConfig>;
37
+ };
38
+ };
39
+ contentTypes: {};
40
+ policies: {};
41
+ middlewares: {};
42
+ };
43
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: {};
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: {};
2
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import type { Core } from '@strapi/strapi';
2
+ declare const register: ({ strapi }: {
3
+ strapi: Core.Strapi;
4
+ }) => void;
5
+ export default register;
@@ -0,0 +1,12 @@
1
+ declare const adminApiRoutes: {
2
+ type: string;
3
+ routes: {
4
+ method: string;
5
+ path: string;
6
+ handler: string;
7
+ config: {
8
+ policies: string[];
9
+ };
10
+ }[];
11
+ };
12
+ export default adminApiRoutes;
@@ -0,0 +1,14 @@
1
+ declare const _default: {
2
+ 'admin-api': {
3
+ type: string;
4
+ routes: {
5
+ method: string;
6
+ path: string;
7
+ handler: string;
8
+ config: {
9
+ policies: string[];
10
+ };
11
+ }[];
12
+ };
13
+ };
14
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import { type Core } from '@strapi/strapi';
2
+ import { type MatomoPluginConfig } from '../config';
3
+ export type ConfigService = ReturnType<typeof configService>;
4
+ declare const configService: ({ strapi }: {
5
+ strapi: Core.Strapi;
6
+ }) => {
7
+ get(): Promise<MatomoPluginConfig>;
8
+ };
9
+ export default configService;
@@ -0,0 +1,12 @@
1
+ import { type ConfigService } from './config';
2
+ export interface MatomoServices {
3
+ config: ConfigService;
4
+ }
5
+ declare const _default: {
6
+ config: ({ strapi }: {
7
+ strapi: import("@strapi/types/dist/core").Strapi;
8
+ }) => {
9
+ get(): Promise<import("../config").MatomoPluginConfig>;
10
+ };
11
+ };
12
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import { type MatomoServices } from '../services';
2
+ declare const getService: <TName extends "config">(name: TName) => MatomoServices[TName];
3
+ export default getService;
@@ -0,0 +1 @@
1
+ export { default as getService } from './getService';
package/package.json ADDED
@@ -0,0 +1,69 @@
1
+ {
2
+ "version": "0.0.2",
3
+ "keywords": [],
4
+ "type": "commonjs",
5
+ "exports": {
6
+ "./package.json": "./package.json",
7
+ "./strapi-admin": {
8
+ "types": "./dist/admin/src/index.d.ts",
9
+ "source": "./admin/src/index.ts",
10
+ "import": "./dist/admin/index.mjs",
11
+ "require": "./dist/admin/index.js",
12
+ "default": "./dist/admin/index.js"
13
+ },
14
+ "./strapi-server": {
15
+ "types": "./dist/server/src/index.d.ts",
16
+ "source": "./server/src/index.ts",
17
+ "import": "./dist/server/index.mjs",
18
+ "require": "./dist/server/index.js",
19
+ "default": "./dist/server/index.js"
20
+ }
21
+ },
22
+ "files": [
23
+ "dist"
24
+ ],
25
+ "scripts": {
26
+ "build": "strapi-plugin build",
27
+ "watch": "strapi-plugin watch",
28
+ "watch:link": "strapi-plugin watch:link",
29
+ "verify": "strapi-plugin verify",
30
+ "test:ts:front": "run -T tsc -p admin/tsconfig.json",
31
+ "test:ts:back": "run -T tsc -p server/tsconfig.json"
32
+ },
33
+ "dependencies": {
34
+ "@strapi/design-system": "^2.0.0-rc.18",
35
+ "@strapi/icons": "^2.0.0-rc.18",
36
+ "react-intl": "^7.1.6"
37
+ },
38
+ "devDependencies": {
39
+ "@strapi/strapi": "^5.11.1",
40
+ "@strapi/sdk-plugin": "^5.3.2",
41
+ "prettier": "^3.5.3",
42
+ "react": "^18.3.1",
43
+ "react-dom": "^18.3.1",
44
+ "react-router-dom": "^6.30.0",
45
+ "styled-components": "^6.1.15",
46
+ "@types/react": "^19.0.10",
47
+ "@types/react-dom": "^19.0.4",
48
+ "@strapi/typescript-utils": "^5.11.1",
49
+ "typescript": "^5.8.2"
50
+ },
51
+ "peerDependencies": {
52
+ "@strapi/strapi": "^5.11.1",
53
+ "@strapi/sdk-plugin": "^5.3.2",
54
+ "react": "^18.3.1",
55
+ "react-dom": "^18.3.1",
56
+ "react-router-dom": "^6.30.0",
57
+ "styled-components": "^6.1.15"
58
+ },
59
+ "strapi": {
60
+ "kind": "plugin",
61
+ "name": "matomo",
62
+ "displayName": "Matomo",
63
+ "description": "Add your Matomo analytics dahsboard to Strapi."
64
+ },
65
+ "name": "strapi-plugin-matomo",
66
+ "description": "Add your Matomo analytics dahsboard to Strapi.",
67
+ "license": "MIT",
68
+ "author": "Tobias Blättermann <tobias.blaettermann1@gmail.com>"
69
+ }