n8n-editor-ui
Version:
Workflow Editor UI for n8n
2 lines • 2.01 kB
JavaScript
(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`n8n@2.13.4`}}catch{}})();try{(function(){var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`09384794-fc7b-470b-a4b9-e52aec3c5fd1`,e._sentryDebugIdIdentifier=`sentry-dbid-09384794-fc7b-470b-a4b9-e52aec3c5fd1`)})()}catch{}import{S as e}from"./vue.runtime.esm-bundler-D9KLAxvJ.js";import{x as t}from"./_MapCache-CUJwh2qp.js";import{As as n,t as r}from"./users.store-BHWXXawf.js";import{is as i}from"./constants-CIP7tKq1.js";import{d as a,j as o,r as s}from"./_baseOrderBy-CaKruttV.js";import{c}from"./insights.utils-BGXnT8rV.js";function l(e){if(!e)return;let{startDate:t,endDate:n,...r}=e,i={...r};return t&&(i.startDate=t.toISOString()),n&&(i.endDate=n.toISOString()),i}const u=async(e,t)=>await a(e,`GET`,`/insights/summary`,l(t)),d=async(e,t)=>await a(e,`GET`,`/insights/by-time`,l(t)),f=async(e,t)=>await a(e,`GET`,`/insights/by-time/time-saved`,l(t)),p=async(e,t)=>await a(e,`GET`,`/insights/by-workflow`,l(t)),m=o(`insights`,()=>{let a=s(),o=r(),l=n(),m=e(()=>i(o.currentUser?.globalScopes).insights),h=e(()=>l.isModuleActive(`insights`)),g=e(()=>!!l.moduleSettings.insights?.dashboard);return{globalInsightsPermissions:m,isInsightsEnabled:h,isSummaryEnabled:e(()=>m.value.list&&h.value),isDashboardEnabled:g,weeklySummary:t(async()=>c(await u(a.restApiContext)),[],{immediate:!1,resetOnExecute:!1}),summary:t(async e=>c(await u(a.restApiContext,e)),[],{immediate:!1,resetOnExecute:!1}),charts:t(async e=>await(g.value?d:f)(a.restApiContext,e),[],{immediate:!1,resetOnExecute:!1}),table:t(async e=>await p(a.restApiContext,e),{count:0,data:[]},{immediate:!1,resetOnExecute:!1}),dateRanges:e(()=>l.moduleSettings.insights?.dateRanges??[])}});export{m as t};
//# sourceMappingURL=insights.store-DoHmMCwa.js.map