Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Merge branch 'main' into feature/custom-events-to-chart

Maksim Mrug69e2bdf766c0
diff --cc src/api/index.ts
index 5af44b425,caf57f788..90d2786c8
--- a/src/api/index.ts
+++ b/src/api/index.ts
@@@ -748,25 -750,39 +750,61 @@@ export const confirmSubscriberInvite =
? error.response.data
: error.response.data.message
})
--
++
+export const getProjectDataCustomEvents = (
+ pid: string,
+ tb: string = 'hour',
+ period: string = '3d',
+ filters: string[] = [],
+ from: string = '',
+ to: string = '',
+ timezone: string = '',
+ customEvents: string[] = [],
+) =>
+ api
+ .get(
+ `log/custom-events?pid=${pid}&timeBucket=${tb}&period=${period}&filters=${JSON.stringify(filters)}&from=${from}&to=${to}&timezone=${timezone}`,
+ )
+ .then((response) => response.data)
+ .catch((error) => {
+ debug('%s', error)
+ throw _isEmpty(error.response.data?.message)
+ ? error.response.data
+ : error.response.data.message
+ })
++
+ export const transferProject = (uuid: string, email: string) =>
+ api
+ .post('project/transfer', {
+ projectId: uuid,
+ email,
+ })
+ .then((response): unknown => response.data)
+ .catch((error) => {
+ debug('%s', error)
+ throw _isEmpty(error.response.data?.message)
+ ? error.response.data
+ : error.response.data.message
+ })
+
+ export const rejectTransferProject = (uuid: string) =>
+ api
+ .delete(`project/transfer?token=${uuid}`)
+ .then((response): unknown => response.data)
+ .catch((error) => {
+ debug('%s', error)
+ throw _isEmpty(error.response.data?.message)
+ ? error.response.data
+ : error.response.data.message
+ })
+
+ export const confirmTransferProject = (uuid: string) =>
+ api
+ .get(`project/transfer?token=${uuid}`)
+ .then((response): unknown => response.data)
+ .catch((error) => {
+ debug('%s', error)
+ throw _isEmpty(error.response.data?.message)
+ ? error.response.data
+ : error.response.data.message
+ })