@janus-idp/backstage-plugin-analytics-module-matomo
Advanced tools
Comparing version 1.2.11 to 1.3.0
@@ -40,2 +40,25 @@ { | ||
}, | ||
"search": { | ||
"description": "Configuration options for the search plugin", | ||
"type": "object", | ||
"properties": { | ||
"query": { | ||
"description": "An object representing the default search query configuration.\nBy configuring and modifying the values of this object,\nyou can customize the default values of the search queries\nand define how it behaves by default.", | ||
"type": "object", | ||
"properties": { | ||
"pageLimit": { | ||
"description": "A number indicating the maximum number of results to be returned\nper page during pagination.", | ||
"visibility": "frontend", | ||
"enum": [ | ||
10, | ||
100, | ||
25, | ||
50 | ||
], | ||
"type": "number" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"home": { | ||
@@ -119,27 +142,4 @@ "type": "object", | ||
} | ||
}, | ||
"search": { | ||
"description": "Configuration options for the search plugin", | ||
"type": "object", | ||
"properties": { | ||
"query": { | ||
"description": "An object representing the default search query configuration.\nBy configuring and modifying the values of this object,\nyou can customize the default values of the search queries\nand define how it behaves by default.", | ||
"type": "object", | ||
"properties": { | ||
"pageLimit": { | ||
"description": "A number indicating the maximum number of results to be returned\nper page during pagination.", | ||
"visibility": "frontend", | ||
"enum": [ | ||
10, | ||
100, | ||
25, | ||
50 | ||
], | ||
"type": "number" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
{ | ||
"name": "janus-idp.backstage-plugin-analytics-module-matomo", | ||
"version": "1.2.10", | ||
"version": "1.2.11", | ||
"extensions": [], | ||
@@ -5,0 +5,0 @@ "registrationMethod": "callback", |
@@ -1,67 +0,4 @@ | ||
import { createPlugin, createApiFactory, analyticsApiRef, configApiRef } from '@backstage/core-plugin-api'; | ||
const analyticsModuleMatomoPlugin = createPlugin({ | ||
id: "analytics-module-matomo" | ||
}); | ||
let isInitialized = false; | ||
const loadMatomo = (matomoUrl, siteId) => { | ||
if (isInitialized) | ||
return; | ||
const _paq = window._paq = window._paq || []; | ||
_paq.push(["trackPageView"]); | ||
_paq.push(["enableLinkTracking"]); | ||
(() => { | ||
var _a; | ||
const u = `//${matomoUrl}/`; | ||
_paq.push(["setTrackerUrl", `${u}matomo.php`]); | ||
_paq.push(["setSiteId", siteId]); | ||
const d = document; | ||
const g = d.createElement("script"); | ||
const s = d.getElementsByTagName("script")[0]; | ||
g.async = true; | ||
g.src = `${u}matomo.js`; | ||
(_a = s.parentNode) == null ? void 0 : _a.insertBefore(g, s); | ||
})(); | ||
isInitialized = true; | ||
}; | ||
var __defProp = Object.defineProperty; | ||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; | ||
var __publicField = (obj, key, value) => { | ||
__defNormalProp(obj, key + "" , value); | ||
return value; | ||
}; | ||
class MatomoAnalytics { | ||
constructor(options) { | ||
__publicField(this, "configApi"); | ||
this.configApi = options.configApi; | ||
const matomoUrl = this.configApi.getString("app.analytics.matomo.host"); | ||
const matomoSiteId = this.configApi.getNumber( | ||
"app.analytics.matomo.siteId" | ||
); | ||
loadMatomo(matomoUrl, matomoSiteId); | ||
} | ||
static fromConfig(config) { | ||
return new MatomoAnalytics({ configApi: config }); | ||
} | ||
captureEvent(event) { | ||
const { context, action, subject, value } = event; | ||
window._paq.push([ | ||
"trackEvent", | ||
context.extension || "App", | ||
action, | ||
subject, | ||
value | ||
]); | ||
} | ||
} | ||
const MatomoAnalyticsApi = createApiFactory({ | ||
api: analyticsApiRef, | ||
deps: { configApi: configApiRef }, | ||
factory: ({ configApi }) => MatomoAnalytics.fromConfig(configApi) | ||
}); | ||
export { MatomoAnalytics, MatomoAnalyticsApi, analyticsModuleMatomoPlugin }; | ||
export { analyticsModuleMatomoPlugin } from './plugin.esm.js'; | ||
export { MatomoAnalyticsApi } from './api/index.esm.js'; | ||
export { MatomoAnalytics } from './api/Matomo.esm.js'; | ||
//# sourceMappingURL=index.esm.js.map |
{ | ||
"name": "@janus-idp/backstage-plugin-analytics-module-matomo", | ||
"version": "1.2.11", | ||
"version": "1.3.0", | ||
"main": "dist/index.esm.js", | ||
@@ -34,7 +34,7 @@ "types": "dist/index.d.ts", | ||
"devDependencies": { | ||
"@backstage/cli": "0.26.4", | ||
"@backstage/core-app-api": "1.12.4", | ||
"@backstage/dev-utils": "1.0.31", | ||
"@backstage/test-utils": "1.5.4", | ||
"@janus-idp/cli": "1.10.1", | ||
"@backstage/cli": "0.26.6", | ||
"@backstage/core-app-api": "1.12.5", | ||
"@backstage/dev-utils": "1.0.32", | ||
"@backstage/test-utils": "1.5.5", | ||
"@janus-idp/cli": "1.11.0", | ||
"@redhat-developer/red-hat-developer-hub-theme": "0.0.54", | ||
@@ -41,0 +41,0 @@ "@testing-library/jest-dom": "6.4.2", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1277460
43
1321