n8n-editor-ui 1.44.0 → 1.44.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/.turbo/turbo-build.log +77 -77
- package/dist/assets/{AuthView-1FRMwQ3r.js → AuthView-DfyvaM6i.js} +2 -2
- package/dist/assets/{AuthView-1FRMwQ3r.js.map → AuthView-DfyvaM6i.js.map} +1 -1
- package/dist/assets/{CanvasControls-FCzUEVOQ.js → CanvasControls-DFdnF5qb.js} +2 -2
- package/dist/assets/{CanvasControls-FCzUEVOQ.js.map → CanvasControls-DFdnF5qb.js.map} +1 -1
- package/dist/assets/{ChangePasswordView-DdWHauKg.js → ChangePasswordView-B4v8DwW9.js} +2 -2
- package/dist/assets/{ChangePasswordView-DdWHauKg.js.map → ChangePasswordView-B4v8DwW9.js.map} +1 -1
- package/dist/assets/{CollectionParameter-CiMzJaXg.js → CollectionParameter-5V5xJsjs.js} +2 -2
- package/dist/assets/CollectionParameter-5V5xJsjs.js.map +1 -0
- package/dist/assets/{CredentialsView-Bn6PVi9E.js → CredentialsView-tyjXlz4Z.js} +2 -2
- package/dist/assets/{CredentialsView-Bn6PVi9E.js.map → CredentialsView-tyjXlz4Z.js.map} +1 -1
- package/dist/assets/{ExecutionsFilter-nFboBzV2.js → ExecutionsFilter-0t_omffh.js} +2 -2
- package/dist/assets/{ExecutionsFilter-nFboBzV2.js.map → ExecutionsFilter-0t_omffh.js.map} +1 -1
- package/dist/assets/{ExecutionsView-CbkLSsSW.js → ExecutionsView-DzCvkqXG.js} +2 -2
- package/dist/assets/{ExecutionsView-CbkLSsSW.js.map → ExecutionsView-DzCvkqXG.js.map} +1 -1
- package/dist/assets/{ForgotMyPasswordView-vPMSx22g.js → ForgotMyPasswordView-D_90K80j.js} +2 -2
- package/dist/assets/{ForgotMyPasswordView-vPMSx22g.js.map → ForgotMyPasswordView-D_90K80j.js.map} +1 -1
- package/dist/assets/{MainHeader-DedFNVir.js → MainHeader-BYoa1H_e.js} +2 -2
- package/dist/assets/{MainHeader-DedFNVir.js.map → MainHeader-BYoa1H_e.js.map} +1 -1
- package/dist/assets/{MainSidebar-BNq07OnD.js → MainSidebar-BNsdraIv.js} +2 -2
- package/dist/assets/{MainSidebar-BNq07OnD.js.map → MainSidebar-BNsdraIv.js.map} +1 -1
- package/dist/assets/{NodeCreation-C0AAIhNs.js → NodeCreation-R9yLdNU1.js} +3 -3
- package/dist/assets/{NodeCreation-C0AAIhNs.js.map → NodeCreation-R9yLdNU1.js.map} +1 -1
- package/dist/assets/{NodeCreator-ESjCn1LZ.js → NodeCreator-CLzfNOJ5.js} +2 -2
- package/dist/assets/{NodeCreator-ESjCn1LZ.js.map → NodeCreator-CLzfNOJ5.js.map} +1 -1
- package/dist/assets/{NodeList-baCRAzNs.js → NodeList-B4yRfzDq.js} +2 -2
- package/dist/assets/{NodeList-baCRAzNs.js.map → NodeList-B4yRfzDq.js.map} +1 -1
- package/dist/assets/{NodeView-BucVYztm.js → NodeView-BGtpd_Bb.js} +4 -4
- package/dist/assets/{NodeView-BucVYztm.js.map → NodeView-BGtpd_Bb.js.map} +1 -1
- package/dist/assets/{NodeView.v2-Oz2vwdfG.js → NodeView.v2-DnTCsiDE.js} +3 -3
- package/dist/assets/{NodeView.v2-Oz2vwdfG.js.map → NodeView.v2-DnTCsiDE.js.map} +1 -1
- package/dist/assets/{ProjectCardBadge.vue_vue_type_script_setup_true_lang-BRGRmswR.js → ProjectCardBadge.vue_vue_type_script_setup_true_lang-CYFr8_zj.js} +2 -2
- package/dist/assets/{ProjectCardBadge.vue_vue_type_script_setup_true_lang-BRGRmswR.js.map → ProjectCardBadge.vue_vue_type_script_setup_true_lang-CYFr8_zj.js.map} +1 -1
- package/dist/assets/{ProjectSettings-D3FAGvAm.js → ProjectSettings-kayD4yS7.js} +2 -2
- package/dist/assets/{ProjectSettings-D3FAGvAm.js.map → ProjectSettings-kayD4yS7.js.map} +1 -1
- package/dist/assets/{ProjectTabs-B_U7Q16t.js → ProjectTabs-1jmisSQb.js} +2 -2
- package/dist/assets/{ProjectTabs-B_U7Q16t.js.map → ProjectTabs-1jmisSQb.js.map} +1 -1
- package/dist/assets/{PushConnectionTracker-DQVvJ6kh.js → PushConnectionTracker-Dfvjg1ts.js} +2 -2
- package/dist/assets/{PushConnectionTracker-DQVvJ6kh.js.map → PushConnectionTracker-Dfvjg1ts.js.map} +1 -1
- package/dist/assets/{ResourcesListLayout-CfzMCzp5.js → ResourcesListLayout-BOYOLez8.js} +2 -2
- package/dist/assets/{ResourcesListLayout-CfzMCzp5.js.map → ResourcesListLayout-BOYOLez8.js.map} +1 -1
- package/dist/assets/{RunDataAi-CwnKkFZ1.js → RunDataAi-CFKU0i2R.js} +2 -2
- package/dist/assets/{RunDataAi-CwnKkFZ1.js.map → RunDataAi-CFKU0i2R.js.map} +1 -1
- package/dist/assets/{RunDataJson-DTMT_R5P.js → RunDataJson-DHI409Ix.js} +3 -3
- package/dist/assets/{RunDataJson-DTMT_R5P.js.map → RunDataJson-DHI409Ix.js.map} +1 -1
- package/dist/assets/{RunDataJsonActions-dNlM_YO3.js → RunDataJsonActions-LAsoJBBD.js} +2 -2
- package/dist/assets/{RunDataJsonActions-dNlM_YO3.js.map → RunDataJsonActions-LAsoJBBD.js.map} +1 -1
- package/dist/assets/{RunDataSchema-D7rSFQ4v.js → RunDataSchema-CgYDgOLN.js} +2 -2
- package/dist/assets/{RunDataSchema-D7rSFQ4v.js.map → RunDataSchema-CgYDgOLN.js.map} +1 -1
- package/dist/assets/{RunDataSearch-BLxgvPWc.js → RunDataSearch-ZJd98FoH.js} +2 -2
- package/dist/assets/{RunDataSearch-BLxgvPWc.js.map → RunDataSearch-ZJd98FoH.js.map} +1 -1
- package/dist/assets/{RunDataTable-CTYOMGVf.js → RunDataTable-IMqti3UV.js} +2 -2
- package/dist/assets/{RunDataTable-CTYOMGVf.js.map → RunDataTable-IMqti3UV.js.map} +1 -1
- package/dist/assets/{SamlOnboarding-B0SKUJ7w.js → SamlOnboarding-6S1cZAZQ.js} +2 -2
- package/dist/assets/{SamlOnboarding-B0SKUJ7w.js.map → SamlOnboarding-6S1cZAZQ.js.map} +1 -1
- package/dist/assets/{SettingsApiView-04CpGWS3.js → SettingsApiView-DzACRdqO.js} +2 -2
- package/dist/assets/{SettingsApiView-04CpGWS3.js.map → SettingsApiView-DzACRdqO.js.map} +1 -1
- package/dist/assets/{SettingsCommunityNodesView-CNryAAn3.js → SettingsCommunityNodesView-DI8tm65K.js} +2 -2
- package/dist/assets/{SettingsCommunityNodesView-CNryAAn3.js.map → SettingsCommunityNodesView-DI8tm65K.js.map} +1 -1
- package/dist/assets/{SettingsExternalSecrets-B39P4p2-.js → SettingsExternalSecrets-DFb1WNlI.js} +2 -2
- package/dist/assets/{SettingsExternalSecrets-B39P4p2-.js.map → SettingsExternalSecrets-DFb1WNlI.js.map} +1 -1
- package/dist/assets/{SettingsFakeDoorView-BOQAY92v.js → SettingsFakeDoorView-CDAZibIu.js} +2 -2
- package/dist/assets/{SettingsFakeDoorView-BOQAY92v.js.map → SettingsFakeDoorView-CDAZibIu.js.map} +1 -1
- package/dist/assets/{SettingsLdapView-VTF-EB0a.js → SettingsLdapView-yXjpScE1.js} +2 -2
- package/dist/assets/{SettingsLdapView-VTF-EB0a.js.map → SettingsLdapView-yXjpScE1.js.map} +1 -1
- package/dist/assets/{SettingsLogStreamingView-JsodKkoJ.js → SettingsLogStreamingView-DQTUJczt.js} +2 -2
- package/dist/assets/{SettingsLogStreamingView-JsodKkoJ.js.map → SettingsLogStreamingView-DQTUJczt.js.map} +1 -1
- package/dist/assets/{SettingsPersonalView-DxQ-hHrk.js → SettingsPersonalView-CYfSdpu7.js} +2 -2
- package/dist/assets/{SettingsPersonalView-DxQ-hHrk.js.map → SettingsPersonalView-CYfSdpu7.js.map} +1 -1
- package/dist/assets/{SettingsSourceControl-aqaWVYCl.js → SettingsSourceControl-SrxQOR5H.js} +2 -2
- package/dist/assets/{SettingsSourceControl-aqaWVYCl.js.map → SettingsSourceControl-SrxQOR5H.js.map} +1 -1
- package/dist/assets/{SettingsSso-Chwn0xrx.js → SettingsSso-DrB162SI.js} +2 -2
- package/dist/assets/{SettingsSso-Chwn0xrx.js.map → SettingsSso-DrB162SI.js.map} +1 -1
- package/dist/assets/{SettingsUsageAndPlan-CIj5SQKn.js → SettingsUsageAndPlan-vOGNFMVq.js} +2 -2
- package/dist/assets/{SettingsUsageAndPlan-CIj5SQKn.js.map → SettingsUsageAndPlan-vOGNFMVq.js.map} +1 -1
- package/dist/assets/{SettingsUsersView-CY4kSRaG.js → SettingsUsersView-Tx1-g18F.js} +2 -2
- package/dist/assets/{SettingsUsersView-CY4kSRaG.js.map → SettingsUsersView-Tx1-g18F.js.map} +1 -1
- package/dist/assets/{SettingsView-jgK3_oOB.js → SettingsView-BOZ2SBsQ.js} +2 -2
- package/dist/assets/{SettingsView-jgK3_oOB.js.map → SettingsView-BOZ2SBsQ.js.map} +1 -1
- package/dist/assets/{SetupView-O6xv77jO.js → SetupView-DY7tVzgF.js} +2 -2
- package/dist/assets/{SetupView-O6xv77jO.js.map → SetupView-DY7tVzgF.js.map} +1 -1
- package/dist/assets/{SetupWorkflowCredentialsButton-oGzzXD7H.js → SetupWorkflowCredentialsButton-B9Acgowu.js} +2 -2
- package/dist/assets/{SetupWorkflowCredentialsButton-oGzzXD7H.js.map → SetupWorkflowCredentialsButton-B9Acgowu.js.map} +1 -1
- package/dist/assets/{SetupWorkflowFromTemplateView-BDUp9JWx.js → SetupWorkflowFromTemplateView-C2E8A8g4.js} +2 -2
- package/dist/assets/{SetupWorkflowFromTemplateView-BDUp9JWx.js.map → SetupWorkflowFromTemplateView-C2E8A8g4.js.map} +1 -1
- package/dist/assets/{SigninView-BLgTm7p4.js → SigninView-DlT1Bv9l.js} +2 -2
- package/dist/assets/{SigninView-BLgTm7p4.js.map → SigninView-DlT1Bv9l.js.map} +1 -1
- package/dist/assets/{SignoutView-DFSKFmE2.js → SignoutView-DisgJoQS.js} +2 -2
- package/dist/assets/{SignoutView-DFSKFmE2.js.map → SignoutView-DisgJoQS.js.map} +1 -1
- package/dist/assets/{SignupView-DSmDdbRA.js → SignupView-CQZSGNCi.js} +2 -2
- package/dist/assets/{SignupView-DSmDdbRA.js.map → SignupView-CQZSGNCi.js.map} +1 -1
- package/dist/assets/{TemplateDetails-DW6dTHAk.js → TemplateDetails-DZzMxROe.js} +2 -2
- package/dist/assets/{TemplateDetails-DW6dTHAk.js.map → TemplateDetails-DZzMxROe.js.map} +1 -1
- package/dist/assets/{TemplateList-DHLgDv5f.js → TemplateList-DS0lnbxA.js} +2 -2
- package/dist/assets/{TemplateList-DHLgDv5f.js.map → TemplateList-DS0lnbxA.js.map} +1 -1
- package/dist/assets/{TemplatesCollectionView-Bix3khnw.js → TemplatesCollectionView-BMck3jn9.js} +2 -2
- package/dist/assets/{TemplatesCollectionView-Bix3khnw.js.map → TemplatesCollectionView-BMck3jn9.js.map} +1 -1
- package/dist/assets/{TemplatesInfoCarousel-B3u16wII.js → TemplatesInfoCarousel-BYIB7MKZ.js} +2 -2
- package/dist/assets/{TemplatesInfoCarousel-B3u16wII.js.map → TemplatesInfoCarousel-BYIB7MKZ.js.map} +1 -1
- package/dist/assets/{TemplatesSearchView-CvtrqPXg.js → TemplatesSearchView-aVpZ2G9F.js} +2 -2
- package/dist/assets/{TemplatesSearchView-CvtrqPXg.js.map → TemplatesSearchView-aVpZ2G9F.js.map} +1 -1
- package/dist/assets/{TemplatesView-DuT3R1EI.js → TemplatesView-CuyRlzAM.js} +2 -2
- package/dist/assets/{TemplatesView-DuT3R1EI.js.map → TemplatesView-CuyRlzAM.js.map} +1 -1
- package/dist/assets/{TemplatesWorkflowView-C_-zPrQW.js → TemplatesWorkflowView-DAa2SCYE.js} +2 -2
- package/dist/assets/{TemplatesWorkflowView-C_-zPrQW.js.map → TemplatesWorkflowView-DAa2SCYE.js.map} +1 -1
- package/dist/assets/{VariablesView-CMrDg4Fx.js → VariablesView-57BdyEmO.js} +2 -2
- package/dist/assets/{VariablesView-CMrDg4Fx.js.map → VariablesView-57BdyEmO.js.map} +1 -1
- package/dist/assets/{WorkerView-BcfdfxOO.js → WorkerView-BLv_CYeM.js} +2 -2
- package/dist/assets/{WorkerView-BcfdfxOO.js.map → WorkerView-BLv_CYeM.js.map} +1 -1
- package/dist/assets/{WorkflowActivator-BiqeeeBc.js → WorkflowActivator-WjfZFpnK.js} +2 -2
- package/dist/assets/{WorkflowActivator-BiqeeeBc.js.map → WorkflowActivator-WjfZFpnK.js.map} +1 -1
- package/dist/assets/{WorkflowExecutionsInfoAccordion-CITQoihQ.js → WorkflowExecutionsInfoAccordion-Dv9rbNek.js} +2 -2
- package/dist/assets/{WorkflowExecutionsInfoAccordion-CITQoihQ.js.map → WorkflowExecutionsInfoAccordion-Dv9rbNek.js.map} +1 -1
- package/dist/assets/{WorkflowExecutionsLandingPage-CnHdLYgR.js → WorkflowExecutionsLandingPage-CsbJPayv.js} +2 -2
- package/dist/assets/{WorkflowExecutionsLandingPage-CnHdLYgR.js.map → WorkflowExecutionsLandingPage-CsbJPayv.js.map} +1 -1
- package/dist/assets/{WorkflowExecutionsPreview-By0_k6NX.js → WorkflowExecutionsPreview-xxP83pWI.js} +2 -2
- package/dist/assets/{WorkflowExecutionsPreview-By0_k6NX.js.map → WorkflowExecutionsPreview-xxP83pWI.js.map} +1 -1
- package/dist/assets/WorkflowExecutionsView-c7NCTwks.js +2 -0
- package/dist/assets/WorkflowExecutionsView-c7NCTwks.js.map +1 -0
- package/dist/assets/{WorkflowHistory-C5ALmvoB.js → WorkflowHistory-DI6sDGlZ.js} +2 -2
- package/dist/assets/{WorkflowHistory-C5ALmvoB.js.map → WorkflowHistory-DI6sDGlZ.js.map} +1 -1
- package/dist/assets/{WorkflowOnboardingView-hQxsQlm1.js → WorkflowOnboardingView-DVqrTjM4.js} +2 -2
- package/dist/assets/{WorkflowOnboardingView-hQxsQlm1.js.map → WorkflowOnboardingView-DVqrTjM4.js.map} +1 -1
- package/dist/assets/{WorkflowsView-TF6zcpi6.js → WorkflowsView-DpB66gWH.js} +2 -2
- package/dist/assets/{WorkflowsView-TF6zcpi6.js.map → WorkflowsView-DpB66gWH.js.map} +1 -1
- package/dist/assets/{cloud-CZc2nauc.js → cloud-bM1gshor.js} +2 -2
- package/dist/assets/{cloud-CZc2nauc.js.map → cloud-bM1gshor.js.map} +1 -1
- package/dist/assets/{collaboration.store-BkSXOsR4.js → collaboration.store-Ct7EpGqG.js} +2 -2
- package/dist/assets/{collaboration.store-BkSXOsR4.js.map → collaboration.store-Ct7EpGqG.js.map} +1 -1
- package/dist/assets/{index-CY2ZfL2U.js → index-BQ6Z7VRj.js} +4 -4
- package/dist/assets/{index-CY2ZfL2U.js.map → index-BQ6Z7VRj.js.map} +1 -1
- package/dist/assets/{nodeCreator.store-CmYeJsEL.js → nodeCreator.store-DAcGJEHy.js} +2 -2
- package/dist/assets/{nodeCreator.store-CmYeJsEL.js.map → nodeCreator.store-DAcGJEHy.js.map} +1 -1
- package/dist/assets/{templateActions-DvpFnju7.js → templateActions-F64sfZ3n.js} +2 -2
- package/dist/assets/{templateActions-DvpFnju7.js.map → templateActions-F64sfZ3n.js.map} +1 -1
- package/dist/assets/{useExecutionDebugging-6-sjTvWS.js → useExecutionDebugging-DuMp5DdQ.js} +2 -2
- package/dist/assets/{useExecutionDebugging-6-sjTvWS.js.map → useExecutionDebugging-DuMp5DdQ.js.map} +1 -1
- package/dist/assets/{useExecutionHelpers-BZpwMJs_.js → useExecutionHelpers-Dt-UJW97.js} +2 -2
- package/dist/assets/{useExecutionHelpers-BZpwMJs_.js.map → useExecutionHelpers-Dt-UJW97.js.map} +1 -1
- package/dist/assets/{usePushConnection-DI_JaC-X.js → usePushConnection-Kek6sJ0j.js} +2 -2
- package/dist/assets/{usePushConnection-DI_JaC-X.js.map → usePushConnection-Kek6sJ0j.js.map} +1 -1
- package/dist/assets/{useViewStacks-D-hnVv3F.js → useViewStacks-CSn_e3gA.js} +2 -2
- package/dist/assets/{useViewStacks-D-hnVv3F.js.map → useViewStacks-CSn_e3gA.js.map} +1 -1
- package/dist/assets/{useWorkflowActivate-lrYalAwm.js → useWorkflowActivate-Bl43vPgP.js} +2 -2
- package/dist/assets/{useWorkflowActivate-lrYalAwm.js.map → useWorkflowActivate-Bl43vPgP.js.map} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/CollectionParameter-CiMzJaXg.js.map +0 -1
- package/dist/assets/WorkflowExecutionsView-fiAM1R-f.js +0 -2
- package/dist/assets/WorkflowExecutionsView-fiAM1R-f.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as g}from"./pinia-Dh4cxKZ0.js";import{co as v,cp as O,cq as k,N as U,Q as b,bA as B}from"./index-
|
|
2
|
-
//# sourceMappingURL=nodeCreator.store-
|
|
1
|
+
import{d as g}from"./pinia-Dh4cxKZ0.js";import{co as v,cp as O,cq as k,N as U,Q as b,bA as B}from"./index-BQ6Z7VRj.js";import{v as D}from"./uuid-SoommWqA.js";import{r as p,e as G}from"./vendor-CUQSof8H.js";const M=60,z=30,I=30,Y=15,P=-20,_=-200,V=-5;function F(o,t){let s=0,r=0;for(;s<o.length&&r<t.length;){const n=o.charAt(s).toLowerCase(),e=t.charAt(r).toLowerCase();n===e&&s++,++r}return o.length!==0&&t.length!==0&&s===o.length}function H(o,t){return w(o,t,0,0,null,[],256,0,0,5)}function w(o,t,s,r,n,e,u,a,l,f){let c=0;if(++l>=f)return{matched:!1,outScore:c};if(s===o.length||r===t.length)return{matched:!1,outScore:c};let i=!1,S=[],m=0,A=!0;for(;s<o.length&&r<t.length;){if(o[s].toLowerCase()===t[r].toLowerCase()){if(a>=u)return{matched:!1,outScore:c};A&&n&&(e=[...n],A=!1);const d=[],y=w(o,t,s,r+1,e,d,u,a,l,f),h=y.outScore;y.matched&&((!i||h>m)&&(S=[...d],m=h),i=!0),e[a++]=r,++s}++r}const T=s===o.length;if(T){c=100;let d=P*e[0];d=d<_?_:d,c+=d;const y=t.length-a;c+=V*y;for(let h=0;h<a;h++){const N=e[h];if(h>0){const E=e[h-1];N===E+1&&(c+=M)}if(N>0){const E=t[N-1],R=t[N];E!==E.toUpperCase()&&R!==R.toLowerCase()&&(c+=I),(E==="_"||E===" ")&&(c+=z)}else c+=Y}return i&&(!T||m>c)?(e=[...S],c=m,{matched:!0,outScore:c}):T?{matched:!0,outScore:c}:{matched:!1,outScore:c}}return{matched:!1,outScore:c}}function Q(o,t){if(o.hasOwnProperty(t))return o[t];const s=t.split(".");let r=o,n=0;for(;r&&n<s.length;){const e=s[n];r=r[e],n++}return r}function W(o,t,s){const r=t.reduce((n,e)=>{let u=[];s.forEach(({key:l,weight:f})=>{const c=Q(e,l);Array.isArray(c)?u=u.concat(c.map(i=>({value:i,weight:f}))):typeof c=="string"&&u.push({value:c,weight:f})});const a=u.reduce((l,{value:f,weight:c})=>{if(!F(o,f))return l;const i=H(o,f);i.outScore*=c;const{matched:S,outScore:m}=i;return!l&&S||S&&l&&m>l.outScore?i:l},null);return a&&n.push({score:a.outScore,item:e}),n},[]);return r.sort((n,e)=>e.score-n.score),r}function C(o,t,s="node"){var n,e,u;const r={uuid:D(),key:o.name,subcategory:t??((u=(e=(n=o.codex)==null?void 0:n.subcategories)==null?void 0:e[v])==null?void 0:u[0])??O,properties:{...o},type:s};return r}function Z(o){const t=[v,k];return o.reduce((s,r)=>{let n=[O];return t.forEach(e=>{var u,a,l,f;(a=(u=r.codex)==null?void 0:u.categories)!=null&&a.includes(e)&&(n=((f=(l=r.codex)==null?void 0:l.subcategories)==null?void 0:f[e])??[])}),n.forEach(e=>{s[e]||(s[e]=[]),s[e].push(C(r,e))}),s},{})}function L(o){return o.sort((t,s)=>{var e,u,a,l;if(t.type!=="node"||s.type!=="node")return 0;const r=((u=(e=t.properties)==null?void 0:e.displayName)==null?void 0:u.toLowerCase())||t.key,n=((l=(a=s.properties)==null?void 0:a.displayName)==null?void 0:l.toLowerCase())||s.key;return r.localeCompare(n,void 0,{sensitivity:"base"})})}function $(o,t){const s=o.toLowerCase().replace("trigger","").trimEnd();return(W(s,t,[{key:"properties.displayName",weight:1.3},{key:"properties.codex.alias",weight:1}])||[]).map(({item:n})=>n)}function x(o){return o.map(t=>t.type==="section"?t.children:t).flat()}function ee(o,t){const s=t.filter(e=>typeof e=="object"),r=o.reduce((e,u)=>{const a=s.find(f=>f.items.includes(u.key)),l=(a==null?void 0:a.key)??"other";return e[l]=[...e[l]??[],u],e},{}),n=s.map(e=>({type:"section",key:e.key,title:e.title,children:L(r[e.key]??[])})).concat({type:"section",key:"other",title:U.baseText("nodeCreator.sectionNames.other"),children:L(r.other??[])}).filter(e=>e.children.length>0);return n.length<=1?o:n}const te=g(b.NODE_CREATOR,()=>{const o=p(B),t=p([]),s=p({}),r=p(!1),n=p(""),e=G(()=>Object.values(t.value).map(i=>C(i)));function u(i){t.value=i}function a(i){s.value=i}function l(i){r.value=i}function f(i){o.value=i}function c(i){n.value=i}return{openSource:n,selectedView:o,showScrim:r,mergedNodes:t,actions:s,setShowScrim:l,setSelectedView:f,setOpenSource:c,setActions:a,setMergeNodes:u,allNodeCreatorNodes:e}});export{Z as a,L as b,x as f,ee as g,$ as s,C as t,te as u};
|
|
2
|
+
//# sourceMappingURL=nodeCreator.store-DAcGJEHy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeCreator.store-CmYeJsEL.js","sources":["../../src/utils/sortUtils.ts","../../src/components/Node/NodeCreator/utils.ts","../../src/stores/nodeCreator.store.ts"],"sourcesContent":["/*\n\tConstants and utility functions used for searching for node types in node creator component\n*/\n\n// based on https://github.com/forrestthewoods/lib_fts/blob/master/code/fts_fuzzy_match.js\n\nconst SEQUENTIAL_BONUS = 60; // bonus for adjacent matches\nconst SEPARATOR_BONUS = 30; // bonus if match occurs after a separator\nconst CAMEL_BONUS = 30; // bonus if match is uppercase and prev is lower\nconst FIRST_LETTER_BONUS = 15; // bonus if the first letter is matched\n\nconst LEADING_LETTER_PENALTY = -20; // penalty applied for every letter in str before the first match\nconst MAX_LEADING_LETTER_PENALTY = -200; // maximum penalty for leading letters\nconst UNMATCHED_LETTER_PENALTY = -5;\n\n/**\n * Returns true if each character in pattern is found sequentially within target\n * @param {*} pattern string\n * @param {*} target string\n */\nfunction fuzzyMatchSimple(pattern: string, target: string): boolean {\n\tlet patternIdx = 0;\n\tlet strIdx = 0;\n\n\twhile (patternIdx < pattern.length && strIdx < target.length) {\n\t\tconst patternChar = pattern.charAt(patternIdx).toLowerCase();\n\t\tconst targetChar = target.charAt(strIdx).toLowerCase();\n\t\tif (patternChar === targetChar) {\n\t\t\tpatternIdx++;\n\t\t}\n\t\t++strIdx;\n\t}\n\n\treturn pattern.length !== 0 && target.length !== 0 && patternIdx === pattern.length;\n}\n\n/**\n * Does a fuzzy search to find pattern inside a string.\n * @param {*} pattern string pattern to search for\n * @param {*} target string string which is being searched\n * @returns [boolean, number] a boolean which tells if pattern was\n * found or not and a search score\n */\nfunction fuzzyMatch(pattern: string, target: string): { matched: boolean; outScore: number } {\n\tconst recursionCount = 0;\n\tconst recursionLimit = 5;\n\tconst matches: number[] = [];\n\tconst maxMatches = 256;\n\n\treturn fuzzyMatchRecursive(\n\t\tpattern,\n\t\ttarget,\n\t\t0 /* patternCurIndex */,\n\t\t0 /* strCurrIndex */,\n\t\tnull /* srcMatces */,\n\t\tmatches,\n\t\tmaxMatches,\n\t\t0 /* nextMatch */,\n\t\trecursionCount,\n\t\trecursionLimit,\n\t);\n}\n\nfunction fuzzyMatchRecursive(\n\tpattern: string,\n\ttarget: string,\n\tpatternCurIndex: number,\n\ttargetCurrIndex: number,\n\ttargetMatches: null | number[],\n\tmatches: number[],\n\tmaxMatches: number,\n\tnextMatch: number,\n\trecursionCount: number,\n\trecursionLimit: number,\n): { matched: boolean; outScore: number } {\n\tlet outScore = 0;\n\n\t// Return if recursion limit is reached.\n\tif (++recursionCount >= recursionLimit) {\n\t\treturn { matched: false, outScore };\n\t}\n\n\t// Return if we reached ends of strings.\n\tif (patternCurIndex === pattern.length || targetCurrIndex === target.length) {\n\t\treturn { matched: false, outScore };\n\t}\n\n\t// Recursion params\n\tlet recursiveMatch = false;\n\tlet bestRecursiveMatches: number[] = [];\n\tlet bestRecursiveScore = 0;\n\n\t// Loop through pattern and str looking for a match.\n\tlet firstMatch = true;\n\twhile (patternCurIndex < pattern.length && targetCurrIndex < target.length) {\n\t\t// Match found.\n\t\tif (pattern[patternCurIndex].toLowerCase() === target[targetCurrIndex].toLowerCase()) {\n\t\t\tif (nextMatch >= maxMatches) {\n\t\t\t\treturn { matched: false, outScore };\n\t\t\t}\n\n\t\t\tif (firstMatch && targetMatches) {\n\t\t\t\tmatches = [...targetMatches];\n\t\t\t\tfirstMatch = false;\n\t\t\t}\n\n\t\t\tconst recursiveMatches: number[] = [];\n\t\t\tconst recursiveResult = fuzzyMatchRecursive(\n\t\t\t\tpattern,\n\t\t\t\ttarget,\n\t\t\t\tpatternCurIndex,\n\t\t\t\ttargetCurrIndex + 1,\n\t\t\t\tmatches,\n\t\t\t\trecursiveMatches,\n\t\t\t\tmaxMatches,\n\t\t\t\tnextMatch,\n\t\t\t\trecursionCount,\n\t\t\t\trecursionLimit,\n\t\t\t);\n\n\t\t\tconst recursiveScore = recursiveResult.outScore;\n\t\t\tif (recursiveResult.matched) {\n\t\t\t\t// Pick best recursive score.\n\t\t\t\tif (!recursiveMatch || recursiveScore > bestRecursiveScore) {\n\t\t\t\t\tbestRecursiveMatches = [...recursiveMatches];\n\t\t\t\t\tbestRecursiveScore = recursiveScore;\n\t\t\t\t}\n\t\t\t\trecursiveMatch = true;\n\t\t\t}\n\n\t\t\tmatches[nextMatch++] = targetCurrIndex;\n\t\t\t++patternCurIndex;\n\t\t}\n\t\t++targetCurrIndex;\n\t}\n\n\tconst matched = patternCurIndex === pattern.length;\n\n\tif (matched) {\n\t\toutScore = 100;\n\n\t\t// Apply leading letter penalty\n\t\tlet penalty = LEADING_LETTER_PENALTY * matches[0];\n\t\tpenalty = penalty < MAX_LEADING_LETTER_PENALTY ? MAX_LEADING_LETTER_PENALTY : penalty;\n\t\toutScore += penalty;\n\n\t\t//Apply unmatched penalty\n\t\tconst unmatched = target.length - nextMatch;\n\t\toutScore += UNMATCHED_LETTER_PENALTY * unmatched;\n\n\t\t// Apply ordering bonuses\n\t\tfor (let i = 0; i < nextMatch; i++) {\n\t\t\tconst currIdx = matches[i];\n\n\t\t\tif (i > 0) {\n\t\t\t\tconst prevIdx = matches[i - 1];\n\t\t\t\tif (currIdx === prevIdx + 1) {\n\t\t\t\t\toutScore += SEQUENTIAL_BONUS;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check for bonuses based on neighbor character value.\n\t\t\tif (currIdx > 0) {\n\t\t\t\t// Camel case\n\t\t\t\tconst neighbor = target[currIdx - 1];\n\t\t\t\tconst curr = target[currIdx];\n\t\t\t\tif (neighbor !== neighbor.toUpperCase() && curr !== curr.toLowerCase()) {\n\t\t\t\t\toutScore += CAMEL_BONUS;\n\t\t\t\t}\n\t\t\t\tconst isNeighbourSeparator = neighbor === '_' || neighbor === ' ';\n\t\t\t\tif (isNeighbourSeparator) {\n\t\t\t\t\toutScore += SEPARATOR_BONUS;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// First letter\n\t\t\t\toutScore += FIRST_LETTER_BONUS;\n\t\t\t}\n\t\t}\n\n\t\t// Return best result\n\t\tif (recursiveMatch && (!matched || bestRecursiveScore > outScore)) {\n\t\t\t// Recursive score is better than \"this\"\n\t\t\tmatches = [...bestRecursiveMatches];\n\t\t\toutScore = bestRecursiveScore;\n\t\t\treturn { matched: true, outScore };\n\t\t} else if (matched) {\n\t\t\t// \"this\" score is better than recursive\n\t\t\treturn { matched: true, outScore };\n\t\t} else {\n\t\t\treturn { matched: false, outScore };\n\t\t}\n\t}\n\treturn { matched: false, outScore };\n}\n\n// prop = 'key'\n// prop = 'key1.key2'\n// prop = ['key1', 'key2']\nfunction getValue<T extends object>(obj: T, prop: string): unknown {\n\tif (obj.hasOwnProperty(prop)) {\n\t\treturn obj[prop as keyof T];\n\t}\n\n\tconst segments = prop.split('.');\n\n\tlet result = obj;\n\tlet i = 0;\n\twhile (result && i < segments.length) {\n\t\tconst key = segments[i] as keyof T;\n\t\tresult = result[key] as T;\n\t\ti++;\n\t}\n\treturn result;\n}\n\nexport function sublimeSearch<T extends object>(\n\tfilter: string,\n\tdata: Readonly<T[]>,\n\tkeys: Array<{ key: string; weight: number }>,\n): Array<{ score: number; item: T }> {\n\tconst results = data.reduce((accu: Array<{ score: number; item: T }>, item: T) => {\n\t\tlet values: Array<{ value: string; weight: number }> = [];\n\t\tkeys.forEach(({ key, weight }) => {\n\t\t\tconst value = getValue(item, key);\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\tvalues = values.concat(value.map((v) => ({ value: v, weight })));\n\t\t\t} else if (typeof value === 'string') {\n\t\t\t\tvalues.push({\n\t\t\t\t\tvalue,\n\t\t\t\t\tweight,\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\t// for each item, check every key and get maximum score\n\t\tconst itemMatch = values.reduce(\n\t\t\t(\n\t\t\t\taccu: null | { matched: boolean; outScore: number },\n\t\t\t\t{ value, weight }: { value: string; weight: number },\n\t\t\t) => {\n\t\t\t\tif (!fuzzyMatchSimple(filter, value)) {\n\t\t\t\t\treturn accu;\n\t\t\t\t}\n\n\t\t\t\tconst match = fuzzyMatch(filter, value);\n\t\t\t\tmatch.outScore *= weight;\n\n\t\t\t\tconst { matched, outScore } = match;\n\t\t\t\tif (!accu && matched) {\n\t\t\t\t\treturn match;\n\t\t\t\t}\n\t\t\t\tif (matched && accu && outScore > accu.outScore) {\n\t\t\t\t\treturn match;\n\t\t\t\t}\n\t\t\t\treturn accu;\n\t\t\t},\n\t\t\tnull,\n\t\t);\n\n\t\tif (itemMatch) {\n\t\t\taccu.push({\n\t\t\t\tscore: itemMatch.outScore,\n\t\t\t\titem,\n\t\t\t});\n\t\t}\n\n\t\treturn accu;\n\t}, []);\n\n\tresults.sort((a, b) => {\n\t\treturn b.score - a.score;\n\t});\n\n\treturn results;\n}\n","import type {\n\tNodeCreateElement,\n\tActionCreateElement,\n\tSubcategorizedNodeTypes,\n\tSimplifiedNodeType,\n\tINodeCreateElement,\n\tSectionCreateElement,\n} from '@/Interface';\nimport { AI_SUBCATEGORY, CORE_NODES_CATEGORY, DEFAULT_SUBCATEGORY } from '@/constants';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { sublimeSearch } from '@/utils/sortUtils';\nimport { i18n } from '@/plugins/i18n';\nimport type { NodeViewItemSection } from './viewsData';\n\nexport function transformNodeType(\n\tnode: SimplifiedNodeType,\n\tsubcategory?: string,\n\ttype: 'node' | 'action' = 'node',\n): NodeCreateElement | ActionCreateElement {\n\tconst createElement = {\n\t\tuuid: uuidv4(),\n\t\tkey: node.name,\n\t\tsubcategory:\n\t\t\tsubcategory ?? node.codex?.subcategories?.[CORE_NODES_CATEGORY]?.[0] ?? DEFAULT_SUBCATEGORY,\n\t\tproperties: {\n\t\t\t...node,\n\t\t},\n\t\ttype,\n\t};\n\n\treturn type === 'action'\n\t\t? (createElement as ActionCreateElement)\n\t\t: (createElement as NodeCreateElement);\n}\n\nexport function subcategorizeItems(items: SimplifiedNodeType[]) {\n\tconst WHITE_LISTED_SUBCATEGORIES = [CORE_NODES_CATEGORY, AI_SUBCATEGORY];\n\treturn items.reduce((acc: SubcategorizedNodeTypes, item) => {\n\t\t// Only some subcategories are allowed\n\t\tlet subcategories: string[] = [DEFAULT_SUBCATEGORY];\n\n\t\tWHITE_LISTED_SUBCATEGORIES.forEach((category) => {\n\t\t\tif (item.codex?.categories?.includes(category)) {\n\t\t\t\tsubcategories = item.codex?.subcategories?.[category] ?? [];\n\t\t\t}\n\t\t});\n\n\t\tsubcategories.forEach((subcategory: string) => {\n\t\t\tif (!acc[subcategory]) {\n\t\t\t\tacc[subcategory] = [];\n\t\t\t}\n\t\t\tacc[subcategory].push(transformNodeType(item, subcategory));\n\t\t});\n\n\t\treturn acc;\n\t}, {});\n}\n\nexport function sortNodeCreateElements(nodes: INodeCreateElement[]) {\n\treturn nodes.sort((a, b) => {\n\t\tif (a.type !== 'node' || b.type !== 'node') return 0;\n\t\tconst displayNameA = a.properties?.displayName?.toLowerCase() || a.key;\n\t\tconst displayNameB = b.properties?.displayName?.toLowerCase() || b.key;\n\n\t\treturn displayNameA.localeCompare(displayNameB, undefined, { sensitivity: 'base' });\n\t});\n}\n\nexport function searchNodes(searchFilter: string, items: INodeCreateElement[]) {\n\t// In order to support the old search we need to remove the 'trigger' part\n\tconst trimmedFilter = searchFilter.toLowerCase().replace('trigger', '').trimEnd();\n\tconst result = (\n\t\tsublimeSearch<INodeCreateElement>(trimmedFilter, items, [\n\t\t\t{ key: 'properties.displayName', weight: 1.3 },\n\t\t\t{ key: 'properties.codex.alias', weight: 1 },\n\t\t]) || []\n\t).map(({ item }) => item);\n\n\treturn result;\n}\n\nexport function flattenCreateElements(items: INodeCreateElement[]): INodeCreateElement[] {\n\treturn items.map((item) => (item.type === 'section' ? item.children : item)).flat();\n}\n\nexport function groupItemsInSections(\n\titems: INodeCreateElement[],\n\tsections: string[] | NodeViewItemSection[],\n): INodeCreateElement[] {\n\tconst filteredSections = sections.filter(\n\t\t(section): section is NodeViewItemSection => typeof section === 'object',\n\t);\n\n\tconst itemsBySection = items.reduce((acc: Record<string, INodeCreateElement[]>, item) => {\n\t\tconst section = filteredSections.find((s) => s.items.includes(item.key));\n\t\tconst key = section?.key ?? 'other';\n\t\tacc[key] = [...(acc[key] ?? []), item];\n\t\treturn acc;\n\t}, {});\n\n\tconst result: SectionCreateElement[] = filteredSections\n\t\t.map(\n\t\t\t(section): SectionCreateElement => ({\n\t\t\t\ttype: 'section',\n\t\t\t\tkey: section.key,\n\t\t\t\ttitle: section.title,\n\t\t\t\tchildren: sortNodeCreateElements(itemsBySection[section.key] ?? []),\n\t\t\t}),\n\t\t)\n\t\t.concat({\n\t\t\ttype: 'section',\n\t\t\tkey: 'other',\n\t\t\ttitle: i18n.baseText('nodeCreator.sectionNames.other'),\n\t\t\tchildren: sortNodeCreateElements(itemsBySection.other ?? []),\n\t\t})\n\t\t.filter((section) => section.children.length > 0);\n\n\tif (result.length <= 1) {\n\t\treturn items;\n\t}\n\n\treturn result;\n}\n","import { defineStore } from 'pinia';\nimport { STORES, TRIGGER_NODE_CREATOR_VIEW } from '@/constants';\nimport type {\n\tNodeFilterType,\n\tNodeCreatorOpenSource,\n\tSimplifiedNodeType,\n\tActionsRecord,\n} from '@/Interface';\n\nimport { computed, ref } from 'vue';\nimport { transformNodeType } from '@/components/Node/NodeCreator/utils';\n\nexport const useNodeCreatorStore = defineStore(STORES.NODE_CREATOR, () => {\n\tconst selectedView = ref<NodeFilterType>(TRIGGER_NODE_CREATOR_VIEW);\n\tconst mergedNodes = ref<SimplifiedNodeType[]>([]);\n\tconst actions = ref<ActionsRecord<typeof mergedNodes.value>>({});\n\n\tconst showScrim = ref(false);\n\tconst openSource = ref<NodeCreatorOpenSource>('');\n\n\tconst allNodeCreatorNodes = computed(() =>\n\t\tObject.values(mergedNodes.value).map((i) => transformNodeType(i)),\n\t);\n\n\tfunction setMergeNodes(nodes: SimplifiedNodeType[]) {\n\t\tmergedNodes.value = nodes;\n\t}\n\n\tfunction setActions(nodes: ActionsRecord<typeof mergedNodes.value>) {\n\t\tactions.value = nodes;\n\t}\n\n\tfunction setShowScrim(isVisible: boolean) {\n\t\tshowScrim.value = isVisible;\n\t}\n\n\tfunction setSelectedView(view: NodeFilterType) {\n\t\tselectedView.value = view;\n\t}\n\n\tfunction setOpenSource(view: NodeCreatorOpenSource) {\n\t\topenSource.value = view;\n\t}\n\n\treturn {\n\t\topenSource,\n\t\tselectedView,\n\t\tshowScrim,\n\t\tmergedNodes,\n\t\tactions,\n\t\tsetShowScrim,\n\t\tsetSelectedView,\n\t\tsetOpenSource,\n\t\tsetActions,\n\t\tsetMergeNodes,\n\t\tallNodeCreatorNodes,\n\t};\n});\n"],"names":["SEQUENTIAL_BONUS","SEPARATOR_BONUS","CAMEL_BONUS","FIRST_LETTER_BONUS","LEADING_LETTER_PENALTY","MAX_LEADING_LETTER_PENALTY","UNMATCHED_LETTER_PENALTY","fuzzyMatchSimple","pattern","target","patternIdx","strIdx","patternChar","targetChar","fuzzyMatch","fuzzyMatchRecursive","patternCurIndex","targetCurrIndex","targetMatches","matches","maxMatches","nextMatch","recursionCount","recursionLimit","outScore","recursiveMatch","bestRecursiveMatches","bestRecursiveScore","firstMatch","recursiveMatches","recursiveResult","recursiveScore","matched","penalty","unmatched","i","currIdx","prevIdx","neighbor","curr","getValue","obj","prop","segments","result","key","sublimeSearch","filter","data","keys","results","accu","item","values","weight","value","v","itemMatch","match","a","b","transformNodeType","node","subcategory","type","createElement","uuidv4","_c","_b","_a","CORE_NODES_CATEGORY","DEFAULT_SUBCATEGORY","subcategorizeItems","items","WHITE_LISTED_SUBCATEGORIES","AI_SUBCATEGORY","acc","subcategories","category","_d","sortNodeCreateElements","nodes","displayNameA","displayNameB","searchNodes","searchFilter","trimmedFilter","flattenCreateElements","groupItemsInSections","sections","filteredSections","section","itemsBySection","s","i18n","useNodeCreatorStore","defineStore","STORES","selectedView","ref","TRIGGER_NODE_CREATOR_VIEW","mergedNodes","actions","showScrim","openSource","allNodeCreatorNodes","computed","setMergeNodes","setActions","setShowScrim","isVisible","setSelectedView","view","setOpenSource"],"mappings":"8MAMA,MAAMA,EAAmB,GACnBC,EAAkB,GAClBC,EAAc,GACdC,EAAqB,GAErBC,EAAyB,IACzBC,EAA6B,KAC7BC,EAA2B,GAOjC,SAASC,EAAiBC,EAAiBC,EAAyB,CACnE,IAAIC,EAAa,EACbC,EAAS,EAEb,KAAOD,EAAaF,EAAQ,QAAUG,EAASF,EAAO,QAAQ,CAC7D,MAAMG,EAAcJ,EAAQ,OAAOE,CAAU,EAAE,YAAY,EACrDG,EAAaJ,EAAO,OAAOE,CAAM,EAAE,YAAY,EACjDC,IAAgBC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zCP,EAAU,MAAQO,CACnB,CAEA,SAASC,EAAgBC,EAAsB,CAC9Cd,EAAa,MAAQc,CACtB,CAEA,SAASC,EAAcD,EAA6B,CACnDR,EAAW,MAAQQ,CACpB,CAEO,MAAA,CACN,WAAAR,EACA,aAAAN,EACA,UAAAK,EACA,YAAAF,EACA,QAAAC,EACA,aAAAO,EACA,gBAAAE,EACA,cAAAE,EACA,WAAAL,EACA,cAAAD,EACA,oBAAAF,CAAA,CAEF,CAAC"}
|
|
1
|
+
{"version":3,"file":"nodeCreator.store-DAcGJEHy.js","sources":["../../src/utils/sortUtils.ts","../../src/components/Node/NodeCreator/utils.ts","../../src/stores/nodeCreator.store.ts"],"sourcesContent":["/*\n\tConstants and utility functions used for searching for node types in node creator component\n*/\n\n// based on https://github.com/forrestthewoods/lib_fts/blob/master/code/fts_fuzzy_match.js\n\nconst SEQUENTIAL_BONUS = 60; // bonus for adjacent matches\nconst SEPARATOR_BONUS = 30; // bonus if match occurs after a separator\nconst CAMEL_BONUS = 30; // bonus if match is uppercase and prev is lower\nconst FIRST_LETTER_BONUS = 15; // bonus if the first letter is matched\n\nconst LEADING_LETTER_PENALTY = -20; // penalty applied for every letter in str before the first match\nconst MAX_LEADING_LETTER_PENALTY = -200; // maximum penalty for leading letters\nconst UNMATCHED_LETTER_PENALTY = -5;\n\n/**\n * Returns true if each character in pattern is found sequentially within target\n * @param {*} pattern string\n * @param {*} target string\n */\nfunction fuzzyMatchSimple(pattern: string, target: string): boolean {\n\tlet patternIdx = 0;\n\tlet strIdx = 0;\n\n\twhile (patternIdx < pattern.length && strIdx < target.length) {\n\t\tconst patternChar = pattern.charAt(patternIdx).toLowerCase();\n\t\tconst targetChar = target.charAt(strIdx).toLowerCase();\n\t\tif (patternChar === targetChar) {\n\t\t\tpatternIdx++;\n\t\t}\n\t\t++strIdx;\n\t}\n\n\treturn pattern.length !== 0 && target.length !== 0 && patternIdx === pattern.length;\n}\n\n/**\n * Does a fuzzy search to find pattern inside a string.\n * @param {*} pattern string pattern to search for\n * @param {*} target string string which is being searched\n * @returns [boolean, number] a boolean which tells if pattern was\n * found or not and a search score\n */\nfunction fuzzyMatch(pattern: string, target: string): { matched: boolean; outScore: number } {\n\tconst recursionCount = 0;\n\tconst recursionLimit = 5;\n\tconst matches: number[] = [];\n\tconst maxMatches = 256;\n\n\treturn fuzzyMatchRecursive(\n\t\tpattern,\n\t\ttarget,\n\t\t0 /* patternCurIndex */,\n\t\t0 /* strCurrIndex */,\n\t\tnull /* srcMatces */,\n\t\tmatches,\n\t\tmaxMatches,\n\t\t0 /* nextMatch */,\n\t\trecursionCount,\n\t\trecursionLimit,\n\t);\n}\n\nfunction fuzzyMatchRecursive(\n\tpattern: string,\n\ttarget: string,\n\tpatternCurIndex: number,\n\ttargetCurrIndex: number,\n\ttargetMatches: null | number[],\n\tmatches: number[],\n\tmaxMatches: number,\n\tnextMatch: number,\n\trecursionCount: number,\n\trecursionLimit: number,\n): { matched: boolean; outScore: number } {\n\tlet outScore = 0;\n\n\t// Return if recursion limit is reached.\n\tif (++recursionCount >= recursionLimit) {\n\t\treturn { matched: false, outScore };\n\t}\n\n\t// Return if we reached ends of strings.\n\tif (patternCurIndex === pattern.length || targetCurrIndex === target.length) {\n\t\treturn { matched: false, outScore };\n\t}\n\n\t// Recursion params\n\tlet recursiveMatch = false;\n\tlet bestRecursiveMatches: number[] = [];\n\tlet bestRecursiveScore = 0;\n\n\t// Loop through pattern and str looking for a match.\n\tlet firstMatch = true;\n\twhile (patternCurIndex < pattern.length && targetCurrIndex < target.length) {\n\t\t// Match found.\n\t\tif (pattern[patternCurIndex].toLowerCase() === target[targetCurrIndex].toLowerCase()) {\n\t\t\tif (nextMatch >= maxMatches) {\n\t\t\t\treturn { matched: false, outScore };\n\t\t\t}\n\n\t\t\tif (firstMatch && targetMatches) {\n\t\t\t\tmatches = [...targetMatches];\n\t\t\t\tfirstMatch = false;\n\t\t\t}\n\n\t\t\tconst recursiveMatches: number[] = [];\n\t\t\tconst recursiveResult = fuzzyMatchRecursive(\n\t\t\t\tpattern,\n\t\t\t\ttarget,\n\t\t\t\tpatternCurIndex,\n\t\t\t\ttargetCurrIndex + 1,\n\t\t\t\tmatches,\n\t\t\t\trecursiveMatches,\n\t\t\t\tmaxMatches,\n\t\t\t\tnextMatch,\n\t\t\t\trecursionCount,\n\t\t\t\trecursionLimit,\n\t\t\t);\n\n\t\t\tconst recursiveScore = recursiveResult.outScore;\n\t\t\tif (recursiveResult.matched) {\n\t\t\t\t// Pick best recursive score.\n\t\t\t\tif (!recursiveMatch || recursiveScore > bestRecursiveScore) {\n\t\t\t\t\tbestRecursiveMatches = [...recursiveMatches];\n\t\t\t\t\tbestRecursiveScore = recursiveScore;\n\t\t\t\t}\n\t\t\t\trecursiveMatch = true;\n\t\t\t}\n\n\t\t\tmatches[nextMatch++] = targetCurrIndex;\n\t\t\t++patternCurIndex;\n\t\t}\n\t\t++targetCurrIndex;\n\t}\n\n\tconst matched = patternCurIndex === pattern.length;\n\n\tif (matched) {\n\t\toutScore = 100;\n\n\t\t// Apply leading letter penalty\n\t\tlet penalty = LEADING_LETTER_PENALTY * matches[0];\n\t\tpenalty = penalty < MAX_LEADING_LETTER_PENALTY ? MAX_LEADING_LETTER_PENALTY : penalty;\n\t\toutScore += penalty;\n\n\t\t//Apply unmatched penalty\n\t\tconst unmatched = target.length - nextMatch;\n\t\toutScore += UNMATCHED_LETTER_PENALTY * unmatched;\n\n\t\t// Apply ordering bonuses\n\t\tfor (let i = 0; i < nextMatch; i++) {\n\t\t\tconst currIdx = matches[i];\n\n\t\t\tif (i > 0) {\n\t\t\t\tconst prevIdx = matches[i - 1];\n\t\t\t\tif (currIdx === prevIdx + 1) {\n\t\t\t\t\toutScore += SEQUENTIAL_BONUS;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check for bonuses based on neighbor character value.\n\t\t\tif (currIdx > 0) {\n\t\t\t\t// Camel case\n\t\t\t\tconst neighbor = target[currIdx - 1];\n\t\t\t\tconst curr = target[currIdx];\n\t\t\t\tif (neighbor !== neighbor.toUpperCase() && curr !== curr.toLowerCase()) {\n\t\t\t\t\toutScore += CAMEL_BONUS;\n\t\t\t\t}\n\t\t\t\tconst isNeighbourSeparator = neighbor === '_' || neighbor === ' ';\n\t\t\t\tif (isNeighbourSeparator) {\n\t\t\t\t\toutScore += SEPARATOR_BONUS;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// First letter\n\t\t\t\toutScore += FIRST_LETTER_BONUS;\n\t\t\t}\n\t\t}\n\n\t\t// Return best result\n\t\tif (recursiveMatch && (!matched || bestRecursiveScore > outScore)) {\n\t\t\t// Recursive score is better than \"this\"\n\t\t\tmatches = [...bestRecursiveMatches];\n\t\t\toutScore = bestRecursiveScore;\n\t\t\treturn { matched: true, outScore };\n\t\t} else if (matched) {\n\t\t\t// \"this\" score is better than recursive\n\t\t\treturn { matched: true, outScore };\n\t\t} else {\n\t\t\treturn { matched: false, outScore };\n\t\t}\n\t}\n\treturn { matched: false, outScore };\n}\n\n// prop = 'key'\n// prop = 'key1.key2'\n// prop = ['key1', 'key2']\nfunction getValue<T extends object>(obj: T, prop: string): unknown {\n\tif (obj.hasOwnProperty(prop)) {\n\t\treturn obj[prop as keyof T];\n\t}\n\n\tconst segments = prop.split('.');\n\n\tlet result = obj;\n\tlet i = 0;\n\twhile (result && i < segments.length) {\n\t\tconst key = segments[i] as keyof T;\n\t\tresult = result[key] as T;\n\t\ti++;\n\t}\n\treturn result;\n}\n\nexport function sublimeSearch<T extends object>(\n\tfilter: string,\n\tdata: Readonly<T[]>,\n\tkeys: Array<{ key: string; weight: number }>,\n): Array<{ score: number; item: T }> {\n\tconst results = data.reduce((accu: Array<{ score: number; item: T }>, item: T) => {\n\t\tlet values: Array<{ value: string; weight: number }> = [];\n\t\tkeys.forEach(({ key, weight }) => {\n\t\t\tconst value = getValue(item, key);\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\tvalues = values.concat(value.map((v) => ({ value: v, weight })));\n\t\t\t} else if (typeof value === 'string') {\n\t\t\t\tvalues.push({\n\t\t\t\t\tvalue,\n\t\t\t\t\tweight,\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\t// for each item, check every key and get maximum score\n\t\tconst itemMatch = values.reduce(\n\t\t\t(\n\t\t\t\taccu: null | { matched: boolean; outScore: number },\n\t\t\t\t{ value, weight }: { value: string; weight: number },\n\t\t\t) => {\n\t\t\t\tif (!fuzzyMatchSimple(filter, value)) {\n\t\t\t\t\treturn accu;\n\t\t\t\t}\n\n\t\t\t\tconst match = fuzzyMatch(filter, value);\n\t\t\t\tmatch.outScore *= weight;\n\n\t\t\t\tconst { matched, outScore } = match;\n\t\t\t\tif (!accu && matched) {\n\t\t\t\t\treturn match;\n\t\t\t\t}\n\t\t\t\tif (matched && accu && outScore > accu.outScore) {\n\t\t\t\t\treturn match;\n\t\t\t\t}\n\t\t\t\treturn accu;\n\t\t\t},\n\t\t\tnull,\n\t\t);\n\n\t\tif (itemMatch) {\n\t\t\taccu.push({\n\t\t\t\tscore: itemMatch.outScore,\n\t\t\t\titem,\n\t\t\t});\n\t\t}\n\n\t\treturn accu;\n\t}, []);\n\n\tresults.sort((a, b) => {\n\t\treturn b.score - a.score;\n\t});\n\n\treturn results;\n}\n","import type {\n\tNodeCreateElement,\n\tActionCreateElement,\n\tSubcategorizedNodeTypes,\n\tSimplifiedNodeType,\n\tINodeCreateElement,\n\tSectionCreateElement,\n} from '@/Interface';\nimport { AI_SUBCATEGORY, CORE_NODES_CATEGORY, DEFAULT_SUBCATEGORY } from '@/constants';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { sublimeSearch } from '@/utils/sortUtils';\nimport { i18n } from '@/plugins/i18n';\nimport type { NodeViewItemSection } from './viewsData';\n\nexport function transformNodeType(\n\tnode: SimplifiedNodeType,\n\tsubcategory?: string,\n\ttype: 'node' | 'action' = 'node',\n): NodeCreateElement | ActionCreateElement {\n\tconst createElement = {\n\t\tuuid: uuidv4(),\n\t\tkey: node.name,\n\t\tsubcategory:\n\t\t\tsubcategory ?? node.codex?.subcategories?.[CORE_NODES_CATEGORY]?.[0] ?? DEFAULT_SUBCATEGORY,\n\t\tproperties: {\n\t\t\t...node,\n\t\t},\n\t\ttype,\n\t};\n\n\treturn type === 'action'\n\t\t? (createElement as ActionCreateElement)\n\t\t: (createElement as NodeCreateElement);\n}\n\nexport function subcategorizeItems(items: SimplifiedNodeType[]) {\n\tconst WHITE_LISTED_SUBCATEGORIES = [CORE_NODES_CATEGORY, AI_SUBCATEGORY];\n\treturn items.reduce((acc: SubcategorizedNodeTypes, item) => {\n\t\t// Only some subcategories are allowed\n\t\tlet subcategories: string[] = [DEFAULT_SUBCATEGORY];\n\n\t\tWHITE_LISTED_SUBCATEGORIES.forEach((category) => {\n\t\t\tif (item.codex?.categories?.includes(category)) {\n\t\t\t\tsubcategories = item.codex?.subcategories?.[category] ?? [];\n\t\t\t}\n\t\t});\n\n\t\tsubcategories.forEach((subcategory: string) => {\n\t\t\tif (!acc[subcategory]) {\n\t\t\t\tacc[subcategory] = [];\n\t\t\t}\n\t\t\tacc[subcategory].push(transformNodeType(item, subcategory));\n\t\t});\n\n\t\treturn acc;\n\t}, {});\n}\n\nexport function sortNodeCreateElements(nodes: INodeCreateElement[]) {\n\treturn nodes.sort((a, b) => {\n\t\tif (a.type !== 'node' || b.type !== 'node') return 0;\n\t\tconst displayNameA = a.properties?.displayName?.toLowerCase() || a.key;\n\t\tconst displayNameB = b.properties?.displayName?.toLowerCase() || b.key;\n\n\t\treturn displayNameA.localeCompare(displayNameB, undefined, { sensitivity: 'base' });\n\t});\n}\n\nexport function searchNodes(searchFilter: string, items: INodeCreateElement[]) {\n\t// In order to support the old search we need to remove the 'trigger' part\n\tconst trimmedFilter = searchFilter.toLowerCase().replace('trigger', '').trimEnd();\n\tconst result = (\n\t\tsublimeSearch<INodeCreateElement>(trimmedFilter, items, [\n\t\t\t{ key: 'properties.displayName', weight: 1.3 },\n\t\t\t{ key: 'properties.codex.alias', weight: 1 },\n\t\t]) || []\n\t).map(({ item }) => item);\n\n\treturn result;\n}\n\nexport function flattenCreateElements(items: INodeCreateElement[]): INodeCreateElement[] {\n\treturn items.map((item) => (item.type === 'section' ? item.children : item)).flat();\n}\n\nexport function groupItemsInSections(\n\titems: INodeCreateElement[],\n\tsections: string[] | NodeViewItemSection[],\n): INodeCreateElement[] {\n\tconst filteredSections = sections.filter(\n\t\t(section): section is NodeViewItemSection => typeof section === 'object',\n\t);\n\n\tconst itemsBySection = items.reduce((acc: Record<string, INodeCreateElement[]>, item) => {\n\t\tconst section = filteredSections.find((s) => s.items.includes(item.key));\n\t\tconst key = section?.key ?? 'other';\n\t\tacc[key] = [...(acc[key] ?? []), item];\n\t\treturn acc;\n\t}, {});\n\n\tconst result: SectionCreateElement[] = filteredSections\n\t\t.map(\n\t\t\t(section): SectionCreateElement => ({\n\t\t\t\ttype: 'section',\n\t\t\t\tkey: section.key,\n\t\t\t\ttitle: section.title,\n\t\t\t\tchildren: sortNodeCreateElements(itemsBySection[section.key] ?? []),\n\t\t\t}),\n\t\t)\n\t\t.concat({\n\t\t\ttype: 'section',\n\t\t\tkey: 'other',\n\t\t\ttitle: i18n.baseText('nodeCreator.sectionNames.other'),\n\t\t\tchildren: sortNodeCreateElements(itemsBySection.other ?? []),\n\t\t})\n\t\t.filter((section) => section.children.length > 0);\n\n\tif (result.length <= 1) {\n\t\treturn items;\n\t}\n\n\treturn result;\n}\n","import { defineStore } from 'pinia';\nimport { STORES, TRIGGER_NODE_CREATOR_VIEW } from '@/constants';\nimport type {\n\tNodeFilterType,\n\tNodeCreatorOpenSource,\n\tSimplifiedNodeType,\n\tActionsRecord,\n} from '@/Interface';\n\nimport { computed, ref } from 'vue';\nimport { transformNodeType } from '@/components/Node/NodeCreator/utils';\n\nexport const useNodeCreatorStore = defineStore(STORES.NODE_CREATOR, () => {\n\tconst selectedView = ref<NodeFilterType>(TRIGGER_NODE_CREATOR_VIEW);\n\tconst mergedNodes = ref<SimplifiedNodeType[]>([]);\n\tconst actions = ref<ActionsRecord<typeof mergedNodes.value>>({});\n\n\tconst showScrim = ref(false);\n\tconst openSource = ref<NodeCreatorOpenSource>('');\n\n\tconst allNodeCreatorNodes = computed(() =>\n\t\tObject.values(mergedNodes.value).map((i) => transformNodeType(i)),\n\t);\n\n\tfunction setMergeNodes(nodes: SimplifiedNodeType[]) {\n\t\tmergedNodes.value = nodes;\n\t}\n\n\tfunction setActions(nodes: ActionsRecord<typeof mergedNodes.value>) {\n\t\tactions.value = nodes;\n\t}\n\n\tfunction setShowScrim(isVisible: boolean) {\n\t\tshowScrim.value = isVisible;\n\t}\n\n\tfunction setSelectedView(view: NodeFilterType) {\n\t\tselectedView.value = view;\n\t}\n\n\tfunction setOpenSource(view: NodeCreatorOpenSource) {\n\t\topenSource.value = view;\n\t}\n\n\treturn {\n\t\topenSource,\n\t\tselectedView,\n\t\tshowScrim,\n\t\tmergedNodes,\n\t\tactions,\n\t\tsetShowScrim,\n\t\tsetSelectedView,\n\t\tsetOpenSource,\n\t\tsetActions,\n\t\tsetMergeNodes,\n\t\tallNodeCreatorNodes,\n\t};\n});\n"],"names":["SEQUENTIAL_BONUS","SEPARATOR_BONUS","CAMEL_BONUS","FIRST_LETTER_BONUS","LEADING_LETTER_PENALTY","MAX_LEADING_LETTER_PENALTY","UNMATCHED_LETTER_PENALTY","fuzzyMatchSimple","pattern","target","patternIdx","strIdx","patternChar","targetChar","fuzzyMatch","fuzzyMatchRecursive","patternCurIndex","targetCurrIndex","targetMatches","matches","maxMatches","nextMatch","recursionCount","recursionLimit","outScore","recursiveMatch","bestRecursiveMatches","bestRecursiveScore","firstMatch","recursiveMatches","recursiveResult","recursiveScore","matched","penalty","unmatched","i","currIdx","prevIdx","neighbor","curr","getValue","obj","prop","segments","result","key","sublimeSearch","filter","data","keys","results","accu","item","values","weight","value","v","itemMatch","match","a","b","transformNodeType","node","subcategory","type","createElement","uuidv4","_c","_b","_a","CORE_NODES_CATEGORY","DEFAULT_SUBCATEGORY","subcategorizeItems","items","WHITE_LISTED_SUBCATEGORIES","AI_SUBCATEGORY","acc","subcategories","category","_d","sortNodeCreateElements","nodes","displayNameA","displayNameB","searchNodes","searchFilter","trimmedFilter","flattenCreateElements","groupItemsInSections","sections","filteredSections","section","itemsBySection","s","i18n","useNodeCreatorStore","defineStore","STORES","selectedView","ref","TRIGGER_NODE_CREATOR_VIEW","mergedNodes","actions","showScrim","openSource","allNodeCreatorNodes","computed","setMergeNodes","setActions","setShowScrim","isVisible","setSelectedView","view","setOpenSource"],"mappings":"8MAMA,MAAMA,EAAmB,GACnBC,EAAkB,GAClBC,EAAc,GACdC,EAAqB,GAErBC,EAAyB,IACzBC,EAA6B,KAC7BC,EAA2B,GAOjC,SAASC,EAAiBC,EAAiBC,EAAyB,CACnE,IAAIC,EAAa,EACbC,EAAS,EAEb,KAAOD,EAAaF,EAAQ,QAAUG,EAASF,EAAO,QAAQ,CAC7D,MAAMG,EAAcJ,EAAQ,OAAOE,CAAU,EAAE,YAAY,EACrDG,EAAaJ,EAAO,OAAOE,CAAM,EAAE,YAAY,EACjDC,IAAgBC,GACnBH,IAEC,EAAAC,CACH,CAEA,OAAOH,EAAQ,SAAW,GAAKC,EAAO,SAAW,GAAKC,IAAeF,EAAQ,MAC9E,CASA,SAASM,EAAWN,EAAiBC,EAAwD,CAMrF,OAAAM,EACNP,EACAC,EACA,EACA,EACA,KARyB,CAAA,EAUzB,IACA,EACA,EACA,CAAA,CAEF,CAEA,SAASM,EACRP,EACAC,EACAO,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACyC,CACzC,IAAIC,EAAW,EAGX,GAAA,EAAEF,GAAkBC,EAChB,MAAA,CAAE,QAAS,GAAO,SAAAC,GAI1B,GAAIR,IAAoBR,EAAQ,QAAUS,IAAoBR,EAAO,OAC7D,MAAA,CAAE,QAAS,GAAO,SAAAe,GAI1B,IAAIC,EAAiB,GACjBC,EAAiC,CAAA,EACjCC,EAAqB,EAGrB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,CAAE,CAAA,IAGnE,OAAO,CACP,KAAM,UACN,IAAK,QACL,MAAOG,EAAK,SAAS,gCAAgC,EACrD,SAAUd,EAAuBY,EAAe,OAAS,CAAA,CAAE,CAAA,CAC3D,EACA,OAAQD,GAAYA,EAAQ,SAAS,OAAS,CAAC,EAE7C,OAAA/C,EAAO,QAAU,EACb6B,EAGD7B,CACR,CC/GO,MAAMmD,GAAsBC,EAAYC,EAAO,aAAc,IAAM,CACnE,MAAAC,EAAeC,EAAoBC,CAAyB,EAC5DC,EAAcF,EAA0B,CAAA,CAAE,EAC1CG,EAAUH,EAA6C,CAAA,CAAE,EAEzDI,EAAYJ,EAAI,EAAK,EACrBK,EAAaL,EAA2B,EAAE,EAE1CM,EAAsBC,EAAS,IACpC,OAAO,OAAOL,EAAY,KAAK,EAAE,IAAK,GAAMxC,EAAkB,CAAC,CAAC,CAAA,EAGjE,SAAS8C,EAAc1B,EAA6B,CACnDoB,EAAY,MAAQpB,CACrB,CAEA,SAAS2B,EAAW3B,EAAgD,CACnEqB,EAAQ,MAAQrB,CACjB,CAEA,SAAS4B,EAAaC,EAAoB,CACzCP,EAAU,MAAQO,CACnB,CAEA,SAASC,EAAgBC,EAAsB,CAC9Cd,EAAa,MAAQc,CACtB,CAEA,SAASC,EAAcD,EAA6B,CACnDR,EAAW,MAAQQ,CACpB,CAEO,MAAA,CACN,WAAAR,EACA,aAAAN,EACA,UAAAK,EACA,YAAAF,EACA,QAAAC,EACA,aAAAO,EACA,gBAAAE,EACA,cAAAE,EACA,WAAAL,EACA,cAAAD,EACA,oBAAAF,CAAA,CAEF,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{cW as f,cZ as m,V as w,bC as u,c_ as T,c$ as k,d0 as y,bB as E}from"./index-
|
|
2
|
-
//# sourceMappingURL=templateActions-
|
|
1
|
+
import{cW as f,cZ as m,V as w,bC as u,c_ as T,c$ as k,d0 as y,bB as E}from"./index-BQ6Z7VRj.js";async function C(e){const{credentialOverrides:t,nodeTypeProvider:o,rootStore:n,template:a,workflowsStore:s}=e,r=await k(n.getRestApiContext,{name:a.name}),l=y(o,a.workflow.nodes,t),i=E(l),d=a.workflow.connections,p={name:r.name,nodes:i,connections:d,active:!1,meta:{templateId:a.id.toString()}};return await s.createNewWorkflow(p)}async function N(e){const{router:t,templateId:o,inNewBrowserTab:n=!1,telemetry:a,source:s}=e;a.track("User opened cred setup",{source:s},{withPostHog:!0});const r={name:w.TEMPLATE_SETUP,params:{id:o}};if(n){const l=t.resolve(r);window.open(l.href,"_blank")}else await t.push(r)}async function c(e){const{externalHooks:t,templateId:o,templatesStore:n,inNewBrowserTab:a,router:s}=e,r={name:w.TEMPLATE_IMPORT,params:{id:o}},l={source:"workflow",template_id:u(o),wf_template_repo_session_id:n.currentSessionId};if(await t.run("templatesWorkflowView.openWorkflow",l),a){const i=s.resolve(r);window.open(i.href,"_blank")}else await s.push(r)}function _(e,t){return t.workflow.nodes.some(o=>T(e,o))}async function P(e,t){const o=e.getFullTemplateById(t);return o||(await e.fetchTemplateById(t),e.getFullTemplateById(t))}async function I(e){const{nodeTypesStore:t,posthogStore:o,templateId:n,templatesStore:a}=e;if(!o.isFeatureEnabled(f)){await c(e);return}const[r]=await Promise.all([P(a,n),t.loadNodeTypesIfNotLoaded()]);m(r),_(t,r)?await N(e):await c(e)}export{C as c,I as u};
|
|
2
|
+
//# sourceMappingURL=templateActions-F64sfZ3n.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templateActions-
|
|
1
|
+
{"version":3,"file":"templateActions-F64sfZ3n.js","sources":["../../src/utils/templates/templateActions.ts"],"sourcesContent":["import type {\n\tINodeUi,\n\tITemplatesWorkflowFull,\n\tIWorkflowData,\n\tIWorkflowTemplate,\n} from '@/Interface';\nimport { getNewWorkflow } from '@/api/workflows';\nimport { TEMPLATE_CREDENTIAL_SETUP_EXPERIMENT, VIEWS } from '@/constants';\nimport type { useRootStore } from '@/stores/n8nRoot.store';\nimport type { PosthogStore } from '@/stores/posthog.store';\nimport type { useWorkflowsStore } from '@/stores/workflows.store';\nimport { getFixedNodesList } from '@/utils/nodeViewUtils';\nimport type { NodeTypeProvider } from '@/utils/nodeTypes/nodeTypeTransforms';\nimport type { TemplateCredentialKey } from '@/utils/templates/templateTransforms';\nimport { replaceAllTemplateNodeCredentials } from '@/utils/templates/templateTransforms';\nimport type { INodeCredentialsDetails } from 'n8n-workflow';\nimport type { RouteLocationRaw, Router } from 'vue-router';\nimport type { TemplatesStore } from '@/stores/templates.store';\nimport type { NodeTypesStore } from '@/stores/nodeTypes.store';\nimport type { Telemetry } from '@/plugins/telemetry';\nimport type { useExternalHooks } from '@/composables/useExternalHooks';\nimport { assert } from '@/utils/assert';\nimport { doesNodeHaveCredentialsToFill } from '@/utils/nodes/nodeTransforms';\nimport { tryToParseNumber } from '@/utils/typesUtils';\n\ntype ExternalHooks = ReturnType<typeof useExternalHooks>;\n\n/**\n * Creates a new workflow from a template\n */\nexport async function createWorkflowFromTemplate(opts: {\n\ttemplate: IWorkflowTemplate;\n\tcredentialOverrides: Record<TemplateCredentialKey, INodeCredentialsDetails>;\n\trootStore: ReturnType<typeof useRootStore>;\n\tworkflowsStore: ReturnType<typeof useWorkflowsStore>;\n\tnodeTypeProvider: NodeTypeProvider;\n}) {\n\tconst { credentialOverrides, nodeTypeProvider, rootStore, template, workflowsStore } = opts;\n\n\tconst workflowData = await getNewWorkflow(rootStore.getRestApiContext, { name: template.name });\n\tconst nodesWithCreds = replaceAllTemplateNodeCredentials(\n\t\tnodeTypeProvider,\n\t\ttemplate.workflow.nodes,\n\t\tcredentialOverrides,\n\t);\n\tconst nodes = getFixedNodesList(nodesWithCreds) as INodeUi[];\n\tconst connections = template.workflow.connections;\n\n\tconst workflowToCreate: IWorkflowData = {\n\t\tname: workflowData.name,\n\t\tnodes,\n\t\tconnections,\n\t\tactive: false,\n\t\tmeta: {\n\t\t\ttemplateId: template.id.toString(),\n\t\t},\n\t\t// Ignored: pinData, settings, tags, versionId\n\t};\n\n\tconst createdWorkflow = await workflowsStore.createNewWorkflow(workflowToCreate);\n\n\treturn createdWorkflow;\n}\n\n/**\n * Opens the template credential setup view\n */\nasync function openTemplateCredentialSetup(opts: {\n\ttemplateId: string;\n\trouter: Router;\n\tinNewBrowserTab?: boolean;\n\ttelemetry: Telemetry;\n\tsource: string;\n}) {\n\tconst { router, templateId, inNewBrowserTab = false, telemetry, source } = opts;\n\n\ttelemetry.track('User opened cred setup', { source }, { withPostHog: true });\n\n\tconst routeLocation: RouteLocationRaw = {\n\t\tname: VIEWS.TEMPLATE_SETUP,\n\t\tparams: { id: templateId },\n\t};\n\n\tif (inNewBrowserTab) {\n\t\tconst route = router.resolve(routeLocation);\n\t\twindow.open(route.href, '_blank');\n\t} else {\n\t\tawait router.push(routeLocation);\n\t}\n}\n\n/**\n * Opens the given template's workflow on NodeView. Fires necessary\n * telemetry events.\n */\nasync function openTemplateWorkflowOnNodeView(opts: {\n\texternalHooks: ExternalHooks;\n\ttemplateId: string;\n\ttemplatesStore: TemplatesStore;\n\trouter: Router;\n\tinNewBrowserTab?: boolean;\n}) {\n\tconst { externalHooks, templateId, templatesStore, inNewBrowserTab, router } = opts;\n\tconst routeLocation: RouteLocationRaw = {\n\t\tname: VIEWS.TEMPLATE_IMPORT,\n\t\tparams: { id: templateId },\n\t};\n\tconst telemetryPayload = {\n\t\tsource: 'workflow',\n\t\ttemplate_id: tryToParseNumber(templateId),\n\t\twf_template_repo_session_id: templatesStore.currentSessionId,\n\t};\n\n\tawait externalHooks.run('templatesWorkflowView.openWorkflow', telemetryPayload);\n\n\tif (inNewBrowserTab) {\n\t\tconst route = router.resolve(routeLocation);\n\t\twindow.open(route.href, '_blank');\n\t} else {\n\t\tawait router.push(routeLocation);\n\t}\n}\n\nfunction hasTemplateCredentials(\n\tnodeTypeProvider: NodeTypeProvider,\n\ttemplate: ITemplatesWorkflowFull,\n) {\n\treturn template.workflow.nodes.some((node) =>\n\t\tdoesNodeHaveCredentialsToFill(nodeTypeProvider, node),\n\t);\n}\n\nasync function getFullTemplate(templatesStore: TemplatesStore, templateId: string) {\n\tconst template = templatesStore.getFullTemplateById(templateId);\n\tif (template) {\n\t\treturn template;\n\t}\n\n\tawait templatesStore.fetchTemplateById(templateId);\n\treturn templatesStore.getFullTemplateById(templateId);\n}\n\n/**\n * Uses the given template by opening the template workflow on NodeView\n * or the template credential setup view. Fires necessary telemetry events.\n */\nexport async function useTemplateWorkflow(opts: {\n\texternalHooks: ExternalHooks;\n\tnodeTypesStore: NodeTypesStore;\n\tposthogStore: PosthogStore;\n\ttemplateId: string;\n\ttemplatesStore: TemplatesStore;\n\trouter: Router;\n\tinNewBrowserTab?: boolean;\n\ttelemetry: Telemetry;\n\tsource: string;\n}) {\n\tconst { nodeTypesStore, posthogStore, templateId, templatesStore } = opts;\n\n\tconst openCredentialSetup = posthogStore.isFeatureEnabled(TEMPLATE_CREDENTIAL_SETUP_EXPERIMENT);\n\tif (!openCredentialSetup) {\n\t\tawait openTemplateWorkflowOnNodeView(opts);\n\t\treturn;\n\t}\n\n\tconst [template] = await Promise.all([\n\t\tgetFullTemplate(templatesStore, templateId),\n\t\tnodeTypesStore.loadNodeTypesIfNotLoaded(),\n\t]);\n\tassert(template);\n\n\tif (hasTemplateCredentials(nodeTypesStore, template)) {\n\t\tawait openTemplateCredentialSetup(opts);\n\t} else {\n\t\tawait openTemplateWorkflowOnNodeView(opts);\n\t}\n}\n"],"names":["createWorkflowFromTemplate","opts","credentialOverrides","nodeTypeProvider","rootStore","template","workflowsStore","workflowData","getNewWorkflow","nodesWithCreds","replaceAllTemplateNodeCredentials","nodes","getFixedNodesList","connections","workflowToCreate","openTemplateCredentialSetup","router","templateId","inNewBrowserTab","telemetry","source","routeLocation","VIEWS","route","openTemplateWorkflowOnNodeView","externalHooks","templatesStore","telemetryPayload","tryToParseNumber","hasTemplateCredentials","node","doesNodeHaveCredentialsToFill","getFullTemplate","useTemplateWorkflow","nodeTypesStore","posthogStore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BS,EAAe,gBAAA,EAK7C,GAFM,MAAAD,EAAc,IAAI,qCAAsCE,CAAgB,EAE1ET,EAAiB,CACd,MAAAK,EAAQP,EAAO,QAAQK,CAAa,EACnC,OAAA,KAAKE,EAAM,KAAM,QAAQ,CAAA,MAE1B,MAAAP,EAAO,KAAKK,CAAa,CAEjC,CAEA,SAASQ,EACR1B,EACAE,EACC,CACM,OAAAA,EAAS,SAAS,MAAM,KAAMyB,GACpCC,EAA8B5B,EAAkB2B,CAAI,CAAA,CAEtD,CAEA,eAAeE,EAAgBN,EAAgCT,EAAoB,CAC5E,MAAAZ,EAAWqB,EAAe,oBAAoBT,CAAU,EAC9D,OAAIZ,IAIE,MAAAqB,EAAe,kBAAkBT,CAAU,EAC1CS,EAAe,oBAAoBT,CAAU,EACrD,CAMA,eAAsBgB,EAAoBhC,EAUvC,CACF,KAAM,CAAE,eAAAiC,EAAgB,aAAAC,EAAc,WAAAlB,EAAY,eAAAS,GAAmBzB,EAGrE,GAAI,CADwBkC,EAAa,iBAAiBC,CAAoC,EACpE,CACzB,MAAMZ,EAA+BvB,CAAI,EACzC,MACD,CAEA,KAAM,CAACI,CAAQ,EAAI,MAAM,QAAQ,IAAI,CACpC2B,EAAgBN,EAAgBT,CAAU,EAC1CiB,EAAe,yBAAyB,CAAA,CACxC,EACDG,EAAOhC,CAAQ,EAEXwB,EAAuBK,EAAgB7B,CAAQ,EAClD,MAAMU,EAA4Bd,CAAI,EAEtC,MAAMuB,EAA+BvB,CAAI,CAE3C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{aH as _,e as V,af as l}from"./vendor-CUQSof8H.js";import{u as S,j as W,b as B,i as C,E as I,z as P,V as L,l as v,cu as h,F as O,w as U,G as A}from"./index-
|
|
2
|
-
//# sourceMappingURL=useExecutionDebugging-
|
|
1
|
+
import{aH as _,e as V,af as l}from"./vendor-CUQSof8H.js";import{u as S,j as W,b as B,i as C,E as I,z as P,V as L,l as v,cu as h,F as O,w as U,G as A}from"./index-BQ6Z7VRj.js";const H=()=>{const E=O(),T=_(),t=U(),N=A(),g=S(),s=W(),M=B(),c=C(),k=V(()=>M.isEnterpriseFeatureEnabled(I.DebugInEditor));return{applyExecutionData:async o=>{var x;const a=await s.getExecution(o),m=s.getCurrentWorkflow(),f=s.getNodes();if(!((x=a==null?void 0:a.data)!=null&&x.resultData))return;const{runData:b}=a.data.resultData,w=Object.keys(b),u=w.filter(e=>!f.some(i=>i.name===e)),y=Object.keys(s.workflow.pinData??{}),d=w.filter(e=>y.includes(e));if(d.length>0){const e=l("p",[t.baseText("nodeView.confirmMessage.debug.message"),l("ul",{class:"mt-l ml-l"},d.map(n=>l("li",n)))]);if(await N.confirm(e,t.baseText("nodeView.confirmMessage.debug.headline"),{type:"warning",confirmButtonText:t.baseText("nodeView.confirmMessage.debug.confirmButtonText"),cancelButtonText:t.baseText("nodeView.confirmMessage.debug.cancelButtonText"),dangerouslyUseHTMLString:!0,customClass:"matching-pinned-nodes-confirmation"})===P)d.forEach(n=>{const r=s.getNodeByName(n);r&&s.unpinData({node:r})});else{await T.push({name:L.EXECUTION_PREVIEW,params:{name:m.id,executionId:o}});return}}s.setWorkflowExecutionData(a);const p=f.filter(e=>!m.getParentNodes(e.name).length);let D=0;p.forEach(e=>{var n,r;const i=(r=(n=b[e.name])==null?void 0:n[0].data)==null?void 0:r.main[0];i&&(D++,s.pinData({node:e,data:i}))}),g.showToast({title:t.baseText("nodeView.showMessage.debug.title"),message:t.baseText("nodeView.showMessage.debug.content"),type:"info"}),u.length&&g.showToast({title:t.baseText("nodeView.showMessage.debug.missingNodes.title"),message:t.baseText("nodeView.showMessage.debug.missingNodes.content",{interpolate:{nodeNames:u.join(", ")}}),type:"warning"}),E.track("User clicked debug execution button",{instance_id:v().instanceId,exec_status:a.status,override_pinned_data:p.length===D,all_exec_data_imported:u.length===0})},handleDebugLinkClick:o=>{if(!k.value){c.openModalWithData({name:h,data:{title:t.baseText(c.contextBasedTranslationKeys.feature.unavailable.title),footerButtonAction:()=>{c.closeModal(h),c.goToUpgrade("debug","upgrade-debug")}}}),o.preventDefault(),o.stopPropagation();return}s.isInDebugMode=!1}}};export{H as u};
|
|
2
|
+
//# sourceMappingURL=useExecutionDebugging-DuMp5DdQ.js.map
|
package/dist/assets/{useExecutionDebugging-6-sjTvWS.js.map → useExecutionDebugging-DuMp5DdQ.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useExecutionDebugging-
|
|
1
|
+
{"version":3,"file":"useExecutionDebugging-DuMp5DdQ.js","sources":["../../src/composables/useExecutionDebugging.ts"],"sourcesContent":["import { h, computed } from 'vue';\nimport { useRouter } from 'vue-router';\nimport { useI18n } from '@/composables/useI18n';\nimport { useMessage } from '@/composables/useMessage';\nimport { useToast } from '@/composables/useToast';\nimport {\n\tDEBUG_PAYWALL_MODAL_KEY,\n\tEnterpriseEditionFeature,\n\tMODAL_CONFIRM,\n\tVIEWS,\n} from '@/constants';\nimport type { INodeUi } from '@/Interface';\nimport { useWorkflowsStore } from '@/stores/workflows.store';\nimport { useSettingsStore } from '@/stores/settings.store';\nimport { useUIStore } from '@/stores/ui.store';\nimport { useTelemetry } from './useTelemetry';\nimport { useRootStore } from '@/stores/n8nRoot.store';\n\nexport const useExecutionDebugging = () => {\n\tconst telemetry = useTelemetry();\n\n\tconst router = useRouter();\n\tconst i18n = useI18n();\n\tconst message = useMessage();\n\tconst toast = useToast();\n\tconst workflowsStore = useWorkflowsStore();\n\tconst settingsStore = useSettingsStore();\n\tconst uiStore = useUIStore();\n\n\tconst isDebugEnabled = computed(() =>\n\t\tsettingsStore.isEnterpriseFeatureEnabled(EnterpriseEditionFeature.DebugInEditor),\n\t);\n\n\tconst applyExecutionData = async (executionId: string): Promise<void> => {\n\t\tconst execution = await workflowsStore.getExecution(executionId);\n\t\tconst workflow = workflowsStore.getCurrentWorkflow();\n\t\tconst workflowNodes = workflowsStore.getNodes();\n\n\t\tif (!execution?.data?.resultData) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { runData } = execution.data.resultData;\n\n\t\tconst executionNodeNames = Object.keys(runData);\n\t\tconst missingNodeNames = executionNodeNames.filter(\n\t\t\t(name) => !workflowNodes.some((node) => node.name === name),\n\t\t);\n\n\t\t// Using the pinned data of the workflow to check if the node is pinned\n\t\t// because workflowsStore.getCurrentWorkflow() returns a cached workflow without the updated pinned data\n\t\tconst workflowPinnedNodeNames = Object.keys(workflowsStore.workflow.pinData ?? {});\n\t\tconst matchingPinnedNodeNames = executionNodeNames.filter((name) =>\n\t\t\tworkflowPinnedNodeNames.includes(name),\n\t\t);\n\n\t\tif (matchingPinnedNodeNames.length > 0) {\n\t\t\tconst confirmMessage = h('p', [\n\t\t\t\ti18n.baseText('nodeView.confirmMessage.debug.message'),\n\t\t\t\th(\n\t\t\t\t\t'ul',\n\t\t\t\t\t{ class: 'mt-l ml-l' },\n\t\t\t\t\tmatchingPinnedNodeNames.map((name) => h('li', name)),\n\t\t\t\t),\n\t\t\t]);\n\n\t\t\tconst overWritePinnedDataConfirm = await message.confirm(\n\t\t\t\tconfirmMessage,\n\t\t\t\ti18n.baseText('nodeView.confirmMessage.debug.headline'),\n\t\t\t\t{\n\t\t\t\t\ttype: 'warning',\n\t\t\t\t\tconfirmButtonText: i18n.baseText('nodeView.confirmMessage.debug.confirmButtonText'),\n\t\t\t\t\tcancelButtonText: i18n.baseText('nodeView.confirmMessage.debug.cancelButtonText'),\n\t\t\t\t\tdangerouslyUseHTMLString: true,\n\t\t\t\t\tcustomClass: 'matching-pinned-nodes-confirmation',\n\t\t\t\t},\n\t\t\t);\n\n\t\t\tif (overWritePinnedDataConfirm === MODAL_CONFIRM) {\n\t\t\t\tmatchingPinnedNodeNames.forEach((name) => {\n\t\t\t\t\tconst node = workflowsStore.getNodeByName(name);\n\t\t\t\t\tif (node) {\n\t\t\t\t\t\tworkflowsStore.unpinData({ node });\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tawait router.push({\n\t\t\t\t\tname: VIEWS.EXECUTION_PREVIEW,\n\t\t\t\t\tparams: { name: workflow.id, executionId },\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// Set execution data\n\t\tworkflowsStore.setWorkflowExecutionData(execution);\n\n\t\t// Pin data of all nodes which do not have a parent node\n\t\tconst pinnableNodes = workflowNodes.filter(\n\t\t\t(node: INodeUi) => !workflow.getParentNodes(node.name).length,\n\t\t);\n\n\t\tlet pinnings = 0;\n\n\t\tpinnableNodes.forEach((node: INodeUi) => {\n\t\t\tconst nodeData = runData[node.name]?.[0].data?.main[0];\n\t\t\tif (nodeData) {\n\t\t\t\tpinnings++;\n\t\t\t\tworkflowsStore.pinData({\n\t\t\t\t\tnode,\n\t\t\t\t\tdata: nodeData,\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\ttoast.showToast({\n\t\t\ttitle: i18n.baseText('nodeView.showMessage.debug.title'),\n\t\t\tmessage: i18n.baseText('nodeView.showMessage.debug.content'),\n\t\t\ttype: 'info',\n\t\t});\n\n\t\tif (missingNodeNames.length) {\n\t\t\ttoast.showToast({\n\t\t\t\ttitle: i18n.baseText('nodeView.showMessage.debug.missingNodes.title'),\n\t\t\t\tmessage: i18n.baseText('nodeView.showMessage.debug.missingNodes.content', {\n\t\t\t\t\tinterpolate: { nodeNames: missingNodeNames.join(', ') },\n\t\t\t\t}),\n\t\t\t\ttype: 'warning',\n\t\t\t});\n\t\t}\n\n\t\ttelemetry.track('User clicked debug execution button', {\n\t\t\tinstance_id: useRootStore().instanceId,\n\t\t\texec_status: execution.status,\n\t\t\toverride_pinned_data: pinnableNodes.length === pinnings,\n\t\t\tall_exec_data_imported: missingNodeNames.length === 0,\n\t\t});\n\t};\n\n\tconst handleDebugLinkClick = (event: Event): void => {\n\t\tif (!isDebugEnabled.value) {\n\t\t\tuiStore.openModalWithData({\n\t\t\t\tname: DEBUG_PAYWALL_MODAL_KEY,\n\t\t\t\tdata: {\n\t\t\t\t\ttitle: i18n.baseText(uiStore.contextBasedTranslationKeys.feature.unavailable.title),\n\t\t\t\t\tfooterButtonAction: () => {\n\t\t\t\t\t\tuiStore.closeModal(DEBUG_PAYWALL_MODAL_KEY);\n\t\t\t\t\t\tvoid uiStore.goToUpgrade('debug', 'upgrade-debug');\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t});\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t\treturn;\n\t\t}\n\t\tworkflowsStore.isInDebugMode = false;\n\t};\n\n\treturn {\n\t\tapplyExecutionData,\n\t\thandleDebugLinkClick,\n\t};\n};\n"],"names":["useExecutionDebugging","telemetry","useTelemetry","router","useRouter","i18n","useI18n","message","useMessage","toast","useToast","workflowsStore","useWorkflowsStore","settingsStore","useSettingsStore","uiStore","useUIStore","isDebugEnabled","computed","EnterpriseEditionFeature","executionId","execution","workflow","workflowNodes","_a","runData","executionNodeNames","missingNodeNames","name","node","workflowPinnedNodeNames","matchingPinnedNodeNames","confirmMessage","h","MODAL_CONFIRM","VIEWS","pinnableNodes","pinnings","nodeData","_b","useRootStore","event","DEBUG_PAYWALL_MODAL_KEY"],"mappings":"+KAkBO,MAAMA,EAAwB,IAAM,CAC1C,MAAMC,EAAYC,IAEZC,EAASC,IACTC,EAAOC,IACPC,EAAUC,IACVC,EAAQC,IACRC,EAAiBC,IACjBC,EAAgBC,IAChBC,EAAUC,IAEVC,EAAiBC,EAAS,IAC/BL,EAAc,2BAA2BM,EAAyB,aAAa,CAAA,EAgIzE,MAAA,CACN,mBA9H0B,MAAOC,GAAuC,OACxE,MAAMC,EAAY,MAAMV,EAAe,aAAaS,CAAW,EACzDE,EAAWX,EAAe,qBAC1BY,EAAgBZ,EAAe,WAEjC,GAAA,GAACa,EAAAH,GAAA,YAAAA,EAAW,OAAX,MAAAG,EAAiB,YACrB,OAGD,KAAM,CAAE,QAAAC,CAAY,EAAAJ,EAAU,KAAK,WAE7BK,EAAqB,OAAO,KAAKD,CA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A,EAED7B,EAAM,UAAU,CACf,MAAOJ,EAAK,SAAS,kCAAkC,EACvD,QAASA,EAAK,SAAS,oCAAoC,EAC3D,KAAM,MAAA,CACN,EAEGsB,EAAiB,QACpBlB,EAAM,UAAU,CACf,MAAOJ,EAAK,SAAS,+CAA+C,EACpE,QAASA,EAAK,SAAS,kDAAmD,CACzE,YAAa,CAAE,UAAWsB,EAAiB,KAAK,IAAI,CAAE,CAAA,CACtD,EACD,KAAM,SAAA,CACN,EAGF1B,EAAU,MAAM,sCAAuC,CACtD,YAAauC,IAAe,WAC5B,YAAanB,EAAU,OACvB,qBAAsBe,EAAc,SAAWC,EAC/C,uBAAwBV,EAAiB,SAAW,CAAA,CACpD,CAAA,EAwBD,qBArB6Bc,GAAuB,CAChD,GAAA,CAACxB,EAAe,MAAO,CAC1BF,EAAQ,kBAAkB,CACzB,KAAM2B,EACN,KAAM,CACL,MAAOrC,EAAK,SAASU,EAAQ,4BAA4B,QAAQ,YAAY,KAAK,EAClF,mBAAoB,IAAM,CACzBA,EAAQ,WAAW2B,CAAuB,EACrC3B,EAAQ,YAAY,QAAS,eAAe,CAClD,CACD,CAAA,CACA,EACD0B,EAAM,eAAe,EACrBA,EAAM,gBAAgB,EACtB,MACD,CACA9B,EAAe,cAAgB,EAAA,CAK/B,CAEF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./dateFormatter-SkPyTYT4.js";import{w as l}from"./index-
|
|
2
|
-
//# sourceMappingURL=useExecutionHelpers-
|
|
1
|
+
import{a as u}from"./dateFormatter-SkPyTYT4.js";import{w as l}from"./index-BQ6Z7VRj.js";function m(){const e=l();function r(t){const s={name:"unknown",startTime:n(t.startedAt),label:"Status unknown",runningTime:""};if(t.status==="waiting"?(s.name="waiting",s.label=e.baseText("executionsList.waiting")):t.status==="canceled"?s.label=e.baseText("executionsList.canceled"):t.status==="running"||t.status==="new"?(s.name="running",s.label=e.baseText("executionsList.running")):t.status==="success"?(s.name="success",s.label=e.baseText("executionsList.succeeded")):(t.status==="error"||t.status==="crashed")&&(s.name="error",s.label=e.baseText("executionsList.error")),t.status||(t.status="unknown"),t.startedAt&&t.stoppedAt){const a=t.stoppedAt?new Date(t.stoppedAt).getTime():Date.now();s.runningTime=e.displayTimer(a-new Date(t.startedAt).getTime(),!0)}return s}function n(t){const{date:s,time:a}=u(t);return e.baseText("executionsList.started",{interpolate:{time:a,date:s}})}function i(t){return["crashed","error"].includes(t.status??"")&&!t.retryOf&&!t.retrySuccessId}return{getUIDetails:r,formatDate:n,isExecutionRetriable:i}}export{m as u};
|
|
2
|
+
//# sourceMappingURL=useExecutionHelpers-Dt-UJW97.js.map
|
package/dist/assets/{useExecutionHelpers-BZpwMJs_.js.map → useExecutionHelpers-Dt-UJW97.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useExecutionHelpers-
|
|
1
|
+
{"version":3,"file":"useExecutionHelpers-Dt-UJW97.js","sources":["../../src/composables/useExecutionHelpers.ts"],"sourcesContent":["import type { ExecutionSummary } from 'n8n-workflow';\nimport { convertToDisplayDate } from '@/utils/formatters/dateFormatter';\nimport { useI18n } from '@/composables/useI18n';\n\nexport interface IExecutionUIData {\n\tname: string;\n\tlabel: string;\n\tstartTime: string;\n\trunningTime: string;\n}\n\nexport function useExecutionHelpers() {\n\tconst i18n = useI18n();\n\n\tfunction getUIDetails(execution: ExecutionSummary): IExecutionUIData {\n\t\tconst status = {\n\t\t\tname: 'unknown',\n\t\t\tstartTime: formatDate(execution.startedAt),\n\t\t\tlabel: 'Status unknown',\n\t\t\trunningTime: '',\n\t\t};\n\n\t\tif (execution.status === 'waiting') {\n\t\t\tstatus.name = 'waiting';\n\t\t\tstatus.label = i18n.baseText('executionsList.waiting');\n\t\t} else if (execution.status === 'canceled') {\n\t\t\tstatus.label = i18n.baseText('executionsList.canceled');\n\t\t} else if (execution.status === 'running' || execution.status === 'new') {\n\t\t\tstatus.name = 'running';\n\t\t\tstatus.label = i18n.baseText('executionsList.running');\n\t\t} else if (execution.status === 'success') {\n\t\t\tstatus.name = 'success';\n\t\t\tstatus.label = i18n.baseText('executionsList.succeeded');\n\t\t} else if (execution.status === 'error' || execution.status === 'crashed') {\n\t\t\tstatus.name = 'error';\n\t\t\tstatus.label = i18n.baseText('executionsList.error');\n\t\t}\n\n\t\tif (!execution.status) execution.status = 'unknown';\n\n\t\tif (execution.startedAt && execution.stoppedAt) {\n\t\t\tconst stoppedAt = execution.stoppedAt ? new Date(execution.stoppedAt).getTime() : Date.now();\n\t\t\tstatus.runningTime = i18n.displayTimer(\n\t\t\t\tstoppedAt - new Date(execution.startedAt).getTime(),\n\t\t\t\ttrue,\n\t\t\t);\n\t\t}\n\n\t\treturn status;\n\t}\n\n\tfunction formatDate(fullDate: Date | string | number) {\n\t\tconst { date, time } = convertToDisplayDate(fullDate);\n\t\treturn i18n.baseText('executionsList.started', { interpolate: { time, date } });\n\t}\n\n\tfunction isExecutionRetriable(execution: ExecutionSummary): boolean {\n\t\treturn (\n\t\t\t['crashed', 'error'].includes(execution.status ?? '') &&\n\t\t\t!execution.retryOf &&\n\t\t\t!execution.retrySuccessId\n\t\t);\n\t}\n\n\treturn {\n\t\tgetUIDetails,\n\t\tformatDate,\n\t\tisExecutionRetriable,\n\t};\n}\n"],"names":["useExecutionHelpers","i18n","useI18n","getUIDetails","execution","status","formatDate","stoppedAt","fullDate","date","time","convertToDisplayDate","isExecutionRetriable"],"mappings":"wFAWO,SAASA,GAAsB,CACrC,MAAMC,EAAOC,IAEb,SAASC,EAAaC,EAA+C,CACpE,MAAMC,EAAS,CACd,KAAM,UACN,UAAWC,EAAWF,EAAU,SAAS,EACzC,MAAO,iBACP,YAAa,EAAA,EAqBV,GAlBAA,EAAU,SAAW,WACxBC,EAAO,KAAO,UACPA,EAAA,MAAQJ,EAAK,SAAS,wBAAwB,GAC3CG,EAAU,SAAW,WACxBC,EAAA,MAAQJ,EAAK,SAAS,yBAAyB,EAC5CG,EAAU,SAAW,WAAaA,EAAU,SAAW,OACjEC,EAAO,KAAO,UACPA,EAAA,MAAQJ,EAAK,SAAS,wBAAwB,GAC3CG,EAAU,SAAW,WAC/BC,EAAO,KAAO,UACPA,EAAA,MAAQJ,EAAK,SAAS,0BAA0B,IAC7CG,EAAU,SAAW,SAAWA,EAAU,SAAW,aAC/DC,EAAO,KAAO,QACPA,EAAA,MAAQJ,EAAK,SAAS,sBAAsB,GAG/CG,EAAU,SAAQA,EAAU,OAAS,WAEtCA,EAAU,WAAaA,EAAU,UAAW,CACzC,MAAAG,EAAYH,EAAU,UAAY,IAAI,KAAKA,EAAU,SAAS,EAAE,QAAA,EAAY,KAAK,IAAI,EAC3FC,EAAO,YAAcJ,EAAK,aACzBM,EAAY,IAAI,KAAKH,EAAU,SAAS,EAAE,QAAQ,EAClD,EAAA,CAEF,CAEO,OAAAC,CACR,CAEA,SAASC,EAAWE,EAAkC,CACrD,KAAM,CAAE,KAAAC,EAAM,KAAAC,CAAK,EAAIC,EAAqBH,CAAQ,EAC7C,OAAAP,EAAK,SAAS,yBAA0B,CAAE,YAAa,CAAE,KAAAS,EAAM,KAAAD,CAAK,CAAA,CAAG,CAC/E,CAEA,SAASG,EAAqBR,EAAsC,CACnE,MACC,CAAC,UAAW,OAAO,EAAE,SAASA,EAAU,QAAU,EAAE,GACpD,CAACA,EAAU,SACX,CAACA,EAAU,cAEb,CAEO,MAAA,CACN,aAAAD,EACA,WAAAG,EACA,qBAAAM,CAAA,CAEF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d6 as ke,l as me,p as xe,aj as ye,u as Ee,ar as Se,a4 as ve,b as Ie,bL as Ne,i as Te,j as De,d7 as We,d8 as be,A as Ae,aU as ie,a3 as Me,H as Re,w as Ce,F as Le}from"./index-CY2ZfL2U.js";import{aq as _e}from"./n8n-DT_bOwuZ.js";import{p as He}from"./flatted-DN8lQ2XG.js";import{d as Oe}from"./pinia-Dh4cxKZ0.js";import{u as Pe,a as Ue}from"./collaboration.store-BkSXOsR4.js";import{r as A}from"./vendor-CUQSof8H.js";const Fe="/orchestration/worker/status",$e=async r=>{await ke(r,"POST",Fe)},Be=100,Ge=120*1e3,je=Oe("orchestrationManager",{state:()=>({initialStatusReceived:!1,workers:{},workersHistory:{},workersLastUpdated:{},statusInterval:null}),actions:{updateWorkerStatus(r){this.workers[r.workerId]=r,this.workersHistory[r.workerId]||(this.workersHistory[r.workerId]=[]),this.workersHistory[r.workerId].push({data:r,timestamp:Date.now()}),this.workersHistory[r.workerId].length>Be&&this.workersHistory[r.workerId].shift(),this.workersLastUpdated[r.workerId]=Date.now(),this.initialStatusReceived=!0},removeStaleWorkers(){for(const r in this.workersLastUpdated)this.workersLastUpdated[r]+Ge<Date.now()&&(delete this.workers[r],delete this.workersHistory[r],delete this.workersLastUpdated[r])},startWorkerStatusPolling(){const r=me();this.statusInterval||(this.statusInterval=setInterval(async()=>{await $e(r.getRestApiContext),this.removeStaleWorkers()},1e3))},stopWorkerStatusPolling(){this.statusInterval&&(clearInterval(this.statusInterval),this.statusInterval=null)},getWorkerLastUpdated(r){return this.workersLastUpdated[r]??0},getWorkerStatus(r){return this.workers[r]},getWorkerStatusHistory(r){return this.workersHistory[r]??[]}}});function Qe({router:r}){const S=xe({router:r}),ue=ye(),D=Re(),w=Ee(),l=Ce(),le=Le(),M=Pe(),R=Se(),E=ve(),de=je(),ce=Ue(),fe=Ie(),we=Ne(),x=Te(),a=De(),h=A(null),m=A([]),v=A(null);function pe(){v.value=ce.addEventListener(e=>{W(e)}),M.initialize()}function ge(){M.terminate(),typeof v.value=="function"&&v.value()}function I(e,n){m.value.push({message:e,retriesLeft:n}),h.value===null&&(h.value=setTimeout(N,20))}async function N(){h.value!==null&&(clearTimeout(h.value),h.value=null);const e=m.value.length;for(let n=0;n<e;n++){const c=m.value.shift();if(!await W(c.message,!0)){c.retriesLeft-=1,c.retriesLeft>0&&m.value.unshift(c);break}}m.value.length!==0&&h.value===null&&(h.value=setTimeout(N,25))}async function W(e,n){var T,C,L,_,H,O,P,U,F,$,B,G,j,q,K,V,z,Y,J,Q,X,Z,ee,te,oe,se,ae,re;if(e.type==="sendWorkerStatusMessage"){const s=e.data;return de.updateWorkerStatus(s.status),!0}if(e.type==="sendConsoleMessage"){const s=e.data;return console.log(s.source,...s.messages),!0}if(!["testWebhookReceived"].includes(e.type)&&n!==!0&&m.value.length)return I(e,5),!1;if(e.type==="nodeExecuteAfter"||e.type==="nodeExecuteBefore"){if(!x.isActionActive("workflowRunning"))return!1;const s=e.data;if(a.activeExecutionId!==s.executionId)return n!==!0&&I(event,5),!1}let k;if(e.type==="executionRecovered"){const s=(T=e.data)==null?void 0:T.executionId;if(x.isActionActive("workflowRunning")&&a.activeExecutionId===s){const t=await a.fetchExecutionDataById(a.activeExecutionId);if(t!=null&&t.data){t.data=He(t.data);const g={startData:(C=t.data)==null?void 0:C.startData,resultData:((L=t.data)==null?void 0:L.resultData)??{runData:{}},executionData:(_=t.data)==null?void 0:_.executionData};if(((H=a.workflowExecutionData)==null?void 0:H.workflowId)===t.workflowId){const f=(U=(P=(O=a.workflowExecutionData)==null?void 0:O.data)==null?void 0:P.resultData)==null?void 0:U.runData;if(f)for(const y of Object.keys(f))g.resultData.runData[y]=f[y]}const b={data:g,finished:t.finished,mode:t.mode,waitTill:(F=t.data)==null?void 0:F.waitTill,startedAt:t.startedAt,stoppedAt:t.stoppedAt,status:"crashed"};t.data&&(k={executionId:t.id,data:b})}}}if(e.type==="workflowFailedToActivate"&&a.workflowId===e.data.workflowId)return a.setWorkflowInactive(e.data.workflowId),a.setActive(!1),w.showError(new Error(e.data.errorMessage),l.baseText("workflowActivator.showError.title",{interpolate:{newStateName:"activated"}})+":"),!0;if(e.type==="workflowActivated")return a.setWorkflowActive(e.data.workflowId),!0;if(e.type==="workflowDeactivated")return a.setWorkflowInactive(e.data.workflowId),!0;if(e.type==="executionFinished"||e.type==="executionRecovered"){let s;e.type==="executionRecovered"&&k!==void 0?s=k:s=e.data;const{activeExecutionId:p}=a;if(p===s.executionId){const o=(G=(B=($=a.workflowExecutionData)==null?void 0:$.data)==null?void 0:B.resultData)==null?void 0:G.runData;if(o)for(const i of Object.keys(o))((J=(Y=(z=(V=(K=(q=(j=s.data.data.resultData.runData[i])==null?void 0:j[0])==null?void 0:q.data)==null?void 0:K.main)==null?void 0:V[0])==null?void 0:z[0])==null?void 0:Y.json)==null?void 0:J.isArtificialRecoveredEventItem)===!0&&o[i].length>0&&(s.data.data.resultData.runData[i]=o[i]);a.finishActiveExecution(s)}if(!x.isActionActive("workflowRunning"))return!1;if(p!==s.executionId)return n!==!0&&I(event,5),!1;const t=s.data;let g=he(t.data);t.status==="crashed"?g=l.baseText("pushConnection.executionFailed.message"):t.status==="canceled"&&(g=l.baseText("executionsList.showMessage.stopExecution.message",{interpolate:{activeExecutionId:p}}));const b=(Z=(X=(Q=t==null?void 0:t.data)==null?void 0:Q.resultData)==null?void 0:X.error)==null?void 0:Z.lineNumber;We.emit("error-line-number",b||"final");const f=S.getCurrentWorkflow();if(t.waitTill!==void 0){const o=a.workflowSettings,i=fe.saveManualExecutions,u=o.saveManualExecutions===void 0?i:o.saveManualExecutions;let d;u?d=`<a href="/workflow/${f.id}/executions/${p}">View the execution</a> to see what happened after this node.`:(be.emit("registerGlobalLinkAction",{key:"open-settings",action:async()=>{a.isNewWorkflow&&await S.saveAsNewWorkflow(),x.openModal(Ae)}}),d='<a data-action="open-settings">Turn on saving manual executions</a> and run again to see what happened after this node.'),D.titleSet(f.name,"IDLE"),w.showToast({title:"Workflow started waiting",message:`${d} <a href="https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.wait/" target="_blank">More info</a>`,type:"success",duration:0})}else if(t.finished!==!0){if(D.titleSet(f.name,"ERROR"),((ee=t.data.resultData.error)==null?void 0:ee.name)==="ExpressionError"&&t.data.resultData.error.context.functionality==="pairedItem"){const o=t.data.resultData.error;S.getWorkflowDataToSave().then(i=>{const u={caused_by_credential:!1,error_message:o.description,error_title:o.message,error_type:o.context.type,node_graph_string:JSON.stringify(_e(i,S.getNodeTypes()).nodeGraph),workflow_id:a.workflowId};if(o.context.nodeCause&&["paired_item_no_info","paired_item_invalid_info"].includes(o.context.type)){const d=f.getNode(o.context.nodeCause);d&&(u.is_pinned=!!f.getPinDataOfNode(d.name),u.mode=d.parameters.mode,u.node_type=d.type,u.operation=d.parameters.operation,u.resource=d.parameters.resource)}le.track("Instance FE emitted paired item error",u,{withPostHog:!0})})}if(((te=t.data.resultData.error)==null?void 0:te.name)==="SubworkflowOperationError"){const o=t.data.resultData.error;a.subWorkflowExecutionError=o,w.showMessage({title:o.message,message:o.description,type:"error",duration:0})}else if(((oe=t.data.resultData.error)==null?void 0:oe.name)==="NodeOperationError"&&t.data.resultData.error.functionality==="configuration-node"){let o;const i=t.data.resultData.error;i.node.name?o=`Error in sub-node ‘${i.node.name}‘`:o="Problem executing workflow",w.showMessage({title:o,message:((i==null?void 0:i.description)??g)+l.baseText("pushConnection.executionError.openNode",{interpolate:{node:i.node.name}}),type:"error",duration:0,dangerouslyUseHTMLString:!0})}else{let o;t.mode==="manual"&&t.status==="canceled"?w.showMessage({title:l.baseText("nodeView.showMessage.stopExecutionTry.title"),type:"success"}):(t.data.resultData.lastNodeExecuted?o=`Problem in node ‘${t.data.resultData.lastNodeExecuted}‘`:o="Problem executing workflow",w.showMessage({title:o,message:g,type:"error",duration:0,dangerouslyUseHTMLString:!0}))}}else{D.titleSet(f.name,"IDLE");const o=a.getWorkflowExecution;if(o!=null&&o.executedNode){const i=a.getNodeByName(o.executedNode),u=i&&E.getNodeType(i.type,i.typeVersion),d=o&&o.executedNode&&((re=(ae=(se=o.data)==null?void 0:se.resultData)==null?void 0:ae.runData)==null?void 0:re[o.executedNode]);u!=null&&u.polling&&!d?w.showMessage({title:l.baseText("pushConnection.pollingNode.dataNotFound",{interpolate:{service:ie(u)}}),message:l.baseText("pushConnection.pollingNode.dataNotFound.message",{interpolate:{service:ie(u)}}),type:"success"}):w.showMessage({title:l.baseText("pushConnection.nodeExecutedSuccessfully"),type:"success"})}else w.showMessage({title:l.baseText("pushConnection.workflowExecutedSuccessfully"),type:"success"})}a.getWorkflowRunData&&(t.data.resultData.runData=a.getWorkflowRunData),a.executingNode.length=0,a.setWorkflowExecutionData(t),x.removeActiveAction("workflowRunning"),ue.updateNodesExecutionIssues();const y=t.data.resultData.lastNodeExecuted;let ne=0;y&&t.data.resultData.runData[y]&&!g&&(ne=t.data.resultData.runData[y][0].data.main[0].length),Me().run("pushConnection.executionFinished",{itemsCount:ne,nodeName:t.data.resultData.lastNodeExecuted,errorMessage:g,runDataExecutedStartData:t.data.startData,resultDataError:t.data.resultData.error}),t.data.resultData.error||we.trackSuccessfulWorkflowExecution(t)}else if(e.type==="executionStarted"){const s=e.data,p={id:s.executionId,finished:!1,mode:s.mode,startedAt:s.startedAt,retryOf:s.retryOf,workflowId:s.workflowId,workflowName:s.workflowName};a.addActiveExecution(p)}else if(e.type==="nodeExecuteAfter"){const s=e.data;a.addNodeExecutionData(s),a.removeExecutingNode(s.nodeName)}else if(e.type==="nodeExecuteBefore"){const s=e.data;a.addExecutingNode(s.nodeName)}else if(e.type==="testWebhookDeleted")e.data.workflowId===a.workflowId&&(a.executionWaitingForWebhook=!1,x.removeActiveAction("workflowRunning"));else if(e.type==="testWebhookReceived"){const s=e.data;s.workflowId===a.workflowId&&(a.executionWaitingForWebhook=!1,a.activeExecutionId=s.executionId),N()}else if(e.type==="reloadNodeType")await E.getNodeTypes(),await E.getFullNodesProperties([e.data]);else if(e.type==="removeNodeType"){const p=[e.data];await R.fetchCredentialTypes(!1).then(()=>{E.removeNodeTypes(p)})}else e.type==="nodeDescriptionUpdated"&&(await E.getNodeTypes(),await R.fetchCredentialTypes(!0));return!0}function he(e){const n=e.resultData.error;let c;if(e.resultData.lastNodeExecuted&&n)c=n.message||n.description;else if(c=l.baseText("pushConnection.executionError",{interpolate:{error:"!"}}),n!=null&&n.message){let k;"node"in n&&(k=typeof n.node=="string"?n.node:n.node.name);const T=k?`${k}: ${n.message}`:n.message;c=l.baseText("pushConnection.executionError",{interpolate:{error:`.${l.baseText("pushConnection.executionError.details",{interpolate:{details:T}})}`}})}return c}return{initialize:pe,terminate:ge,pushMessageReceived:W,queuePushMessage:I,processWaitingPushMessages:N,pushMessageQueue:m,removeEventListener:v,retryTimeout:h}}export{Be as W,je as a,Qe as u};
|
|
2
|
-
//# sourceMappingURL=usePushConnection-
|
|
1
|
+
import{d6 as ke,l as me,p as xe,aj as ye,u as Ee,ar as Se,a4 as ve,b as Ie,bL as Ne,i as Te,j as De,d7 as We,d8 as be,A as Ae,aU as ie,a3 as Me,H as Re,w as Ce,F as Le}from"./index-BQ6Z7VRj.js";import{aq as _e}from"./n8n-DT_bOwuZ.js";import{p as He}from"./flatted-DN8lQ2XG.js";import{d as Oe}from"./pinia-Dh4cxKZ0.js";import{u as Pe,a as Ue}from"./collaboration.store-Ct7EpGqG.js";import{r as A}from"./vendor-CUQSof8H.js";const Fe="/orchestration/worker/status",$e=async r=>{await ke(r,"POST",Fe)},Be=100,Ge=120*1e3,je=Oe("orchestrationManager",{state:()=>({initialStatusReceived:!1,workers:{},workersHistory:{},workersLastUpdated:{},statusInterval:null}),actions:{updateWorkerStatus(r){this.workers[r.workerId]=r,this.workersHistory[r.workerId]||(this.workersHistory[r.workerId]=[]),this.workersHistory[r.workerId].push({data:r,timestamp:Date.now()}),this.workersHistory[r.workerId].length>Be&&this.workersHistory[r.workerId].shift(),this.workersLastUpdated[r.workerId]=Date.now(),this.initialStatusReceived=!0},removeStaleWorkers(){for(const r in this.workersLastUpdated)this.workersLastUpdated[r]+Ge<Date.now()&&(delete this.workers[r],delete this.workersHistory[r],delete this.workersLastUpdated[r])},startWorkerStatusPolling(){const r=me();this.statusInterval||(this.statusInterval=setInterval(async()=>{await $e(r.getRestApiContext),this.removeStaleWorkers()},1e3))},stopWorkerStatusPolling(){this.statusInterval&&(clearInterval(this.statusInterval),this.statusInterval=null)},getWorkerLastUpdated(r){return this.workersLastUpdated[r]??0},getWorkerStatus(r){return this.workers[r]},getWorkerStatusHistory(r){return this.workersHistory[r]??[]}}});function Qe({router:r}){const S=xe({router:r}),ue=ye(),D=Re(),w=Ee(),l=Ce(),le=Le(),M=Pe(),R=Se(),E=ve(),de=je(),ce=Ue(),fe=Ie(),we=Ne(),x=Te(),a=De(),h=A(null),m=A([]),v=A(null);function pe(){v.value=ce.addEventListener(e=>{W(e)}),M.initialize()}function ge(){M.terminate(),typeof v.value=="function"&&v.value()}function I(e,n){m.value.push({message:e,retriesLeft:n}),h.value===null&&(h.value=setTimeout(N,20))}async function N(){h.value!==null&&(clearTimeout(h.value),h.value=null);const e=m.value.length;for(let n=0;n<e;n++){const c=m.value.shift();if(!await W(c.message,!0)){c.retriesLeft-=1,c.retriesLeft>0&&m.value.unshift(c);break}}m.value.length!==0&&h.value===null&&(h.value=setTimeout(N,25))}async function W(e,n){var T,C,L,_,H,O,P,U,F,$,B,G,j,q,K,V,z,Y,J,Q,X,Z,ee,te,oe,se,ae,re;if(e.type==="sendWorkerStatusMessage"){const s=e.data;return de.updateWorkerStatus(s.status),!0}if(e.type==="sendConsoleMessage"){const s=e.data;return console.log(s.source,...s.messages),!0}if(!["testWebhookReceived"].includes(e.type)&&n!==!0&&m.value.length)return I(e,5),!1;if(e.type==="nodeExecuteAfter"||e.type==="nodeExecuteBefore"){if(!x.isActionActive("workflowRunning"))return!1;const s=e.data;if(a.activeExecutionId!==s.executionId)return n!==!0&&I(event,5),!1}let k;if(e.type==="executionRecovered"){const s=(T=e.data)==null?void 0:T.executionId;if(x.isActionActive("workflowRunning")&&a.activeExecutionId===s){const t=await a.fetchExecutionDataById(a.activeExecutionId);if(t!=null&&t.data){t.data=He(t.data);const g={startData:(C=t.data)==null?void 0:C.startData,resultData:((L=t.data)==null?void 0:L.resultData)??{runData:{}},executionData:(_=t.data)==null?void 0:_.executionData};if(((H=a.workflowExecutionData)==null?void 0:H.workflowId)===t.workflowId){const f=(U=(P=(O=a.workflowExecutionData)==null?void 0:O.data)==null?void 0:P.resultData)==null?void 0:U.runData;if(f)for(const y of Object.keys(f))g.resultData.runData[y]=f[y]}const b={data:g,finished:t.finished,mode:t.mode,waitTill:(F=t.data)==null?void 0:F.waitTill,startedAt:t.startedAt,stoppedAt:t.stoppedAt,status:"crashed"};t.data&&(k={executionId:t.id,data:b})}}}if(e.type==="workflowFailedToActivate"&&a.workflowId===e.data.workflowId)return a.setWorkflowInactive(e.data.workflowId),a.setActive(!1),w.showError(new Error(e.data.errorMessage),l.baseText("workflowActivator.showError.title",{interpolate:{newStateName:"activated"}})+":"),!0;if(e.type==="workflowActivated")return a.setWorkflowActive(e.data.workflowId),!0;if(e.type==="workflowDeactivated")return a.setWorkflowInactive(e.data.workflowId),!0;if(e.type==="executionFinished"||e.type==="executionRecovered"){let s;e.type==="executionRecovered"&&k!==void 0?s=k:s=e.data;const{activeExecutionId:p}=a;if(p===s.executionId){const o=(G=(B=($=a.workflowExecutionData)==null?void 0:$.data)==null?void 0:B.resultData)==null?void 0:G.runData;if(o)for(const i of Object.keys(o))((J=(Y=(z=(V=(K=(q=(j=s.data.data.resultData.runData[i])==null?void 0:j[0])==null?void 0:q.data)==null?void 0:K.main)==null?void 0:V[0])==null?void 0:z[0])==null?void 0:Y.json)==null?void 0:J.isArtificialRecoveredEventItem)===!0&&o[i].length>0&&(s.data.data.resultData.runData[i]=o[i]);a.finishActiveExecution(s)}if(!x.isActionActive("workflowRunning"))return!1;if(p!==s.executionId)return n!==!0&&I(event,5),!1;const t=s.data;let g=he(t.data);t.status==="crashed"?g=l.baseText("pushConnection.executionFailed.message"):t.status==="canceled"&&(g=l.baseText("executionsList.showMessage.stopExecution.message",{interpolate:{activeExecutionId:p}}));const b=(Z=(X=(Q=t==null?void 0:t.data)==null?void 0:Q.resultData)==null?void 0:X.error)==null?void 0:Z.lineNumber;We.emit("error-line-number",b||"final");const f=S.getCurrentWorkflow();if(t.waitTill!==void 0){const o=a.workflowSettings,i=fe.saveManualExecutions,u=o.saveManualExecutions===void 0?i:o.saveManualExecutions;let d;u?d=`<a href="/workflow/${f.id}/executions/${p}">View the execution</a> to see what happened after this node.`:(be.emit("registerGlobalLinkAction",{key:"open-settings",action:async()=>{a.isNewWorkflow&&await S.saveAsNewWorkflow(),x.openModal(Ae)}}),d='<a data-action="open-settings">Turn on saving manual executions</a> and run again to see what happened after this node.'),D.titleSet(f.name,"IDLE"),w.showToast({title:"Workflow started waiting",message:`${d} <a href="https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.wait/" target="_blank">More info</a>`,type:"success",duration:0})}else if(t.finished!==!0){if(D.titleSet(f.name,"ERROR"),((ee=t.data.resultData.error)==null?void 0:ee.name)==="ExpressionError"&&t.data.resultData.error.context.functionality==="pairedItem"){const o=t.data.resultData.error;S.getWorkflowDataToSave().then(i=>{const u={caused_by_credential:!1,error_message:o.description,error_title:o.message,error_type:o.context.type,node_graph_string:JSON.stringify(_e(i,S.getNodeTypes()).nodeGraph),workflow_id:a.workflowId};if(o.context.nodeCause&&["paired_item_no_info","paired_item_invalid_info"].includes(o.context.type)){const d=f.getNode(o.context.nodeCause);d&&(u.is_pinned=!!f.getPinDataOfNode(d.name),u.mode=d.parameters.mode,u.node_type=d.type,u.operation=d.parameters.operation,u.resource=d.parameters.resource)}le.track("Instance FE emitted paired item error",u,{withPostHog:!0})})}if(((te=t.data.resultData.error)==null?void 0:te.name)==="SubworkflowOperationError"){const o=t.data.resultData.error;a.subWorkflowExecutionError=o,w.showMessage({title:o.message,message:o.description,type:"error",duration:0})}else if(((oe=t.data.resultData.error)==null?void 0:oe.name)==="NodeOperationError"&&t.data.resultData.error.functionality==="configuration-node"){let o;const i=t.data.resultData.error;i.node.name?o=`Error in sub-node ‘${i.node.name}‘`:o="Problem executing workflow",w.showMessage({title:o,message:((i==null?void 0:i.description)??g)+l.baseText("pushConnection.executionError.openNode",{interpolate:{node:i.node.name}}),type:"error",duration:0,dangerouslyUseHTMLString:!0})}else{let o;t.mode==="manual"&&t.status==="canceled"?w.showMessage({title:l.baseText("nodeView.showMessage.stopExecutionTry.title"),type:"success"}):(t.data.resultData.lastNodeExecuted?o=`Problem in node ‘${t.data.resultData.lastNodeExecuted}‘`:o="Problem executing workflow",w.showMessage({title:o,message:g,type:"error",duration:0,dangerouslyUseHTMLString:!0}))}}else{D.titleSet(f.name,"IDLE");const o=a.getWorkflowExecution;if(o!=null&&o.executedNode){const i=a.getNodeByName(o.executedNode),u=i&&E.getNodeType(i.type,i.typeVersion),d=o&&o.executedNode&&((re=(ae=(se=o.data)==null?void 0:se.resultData)==null?void 0:ae.runData)==null?void 0:re[o.executedNode]);u!=null&&u.polling&&!d?w.showMessage({title:l.baseText("pushConnection.pollingNode.dataNotFound",{interpolate:{service:ie(u)}}),message:l.baseText("pushConnection.pollingNode.dataNotFound.message",{interpolate:{service:ie(u)}}),type:"success"}):w.showMessage({title:l.baseText("pushConnection.nodeExecutedSuccessfully"),type:"success"})}else w.showMessage({title:l.baseText("pushConnection.workflowExecutedSuccessfully"),type:"success"})}a.getWorkflowRunData&&(t.data.resultData.runData=a.getWorkflowRunData),a.executingNode.length=0,a.setWorkflowExecutionData(t),x.removeActiveAction("workflowRunning"),ue.updateNodesExecutionIssues();const y=t.data.resultData.lastNodeExecuted;let ne=0;y&&t.data.resultData.runData[y]&&!g&&(ne=t.data.resultData.runData[y][0].data.main[0].length),Me().run("pushConnection.executionFinished",{itemsCount:ne,nodeName:t.data.resultData.lastNodeExecuted,errorMessage:g,runDataExecutedStartData:t.data.startData,resultDataError:t.data.resultData.error}),t.data.resultData.error||we.trackSuccessfulWorkflowExecution(t)}else if(e.type==="executionStarted"){const s=e.data,p={id:s.executionId,finished:!1,mode:s.mode,startedAt:s.startedAt,retryOf:s.retryOf,workflowId:s.workflowId,workflowName:s.workflowName};a.addActiveExecution(p)}else if(e.type==="nodeExecuteAfter"){const s=e.data;a.addNodeExecutionData(s),a.removeExecutingNode(s.nodeName)}else if(e.type==="nodeExecuteBefore"){const s=e.data;a.addExecutingNode(s.nodeName)}else if(e.type==="testWebhookDeleted")e.data.workflowId===a.workflowId&&(a.executionWaitingForWebhook=!1,x.removeActiveAction("workflowRunning"));else if(e.type==="testWebhookReceived"){const s=e.data;s.workflowId===a.workflowId&&(a.executionWaitingForWebhook=!1,a.activeExecutionId=s.executionId),N()}else if(e.type==="reloadNodeType")await E.getNodeTypes(),await E.getFullNodesProperties([e.data]);else if(e.type==="removeNodeType"){const p=[e.data];await R.fetchCredentialTypes(!1).then(()=>{E.removeNodeTypes(p)})}else e.type==="nodeDescriptionUpdated"&&(await E.getNodeTypes(),await R.fetchCredentialTypes(!0));return!0}function he(e){const n=e.resultData.error;let c;if(e.resultData.lastNodeExecuted&&n)c=n.message||n.description;else if(c=l.baseText("pushConnection.executionError",{interpolate:{error:"!"}}),n!=null&&n.message){let k;"node"in n&&(k=typeof n.node=="string"?n.node:n.node.name);const T=k?`${k}: ${n.message}`:n.message;c=l.baseText("pushConnection.executionError",{interpolate:{error:`.${l.baseText("pushConnection.executionError.details",{interpolate:{details:T}})}`}})}return c}return{initialize:pe,terminate:ge,pushMessageReceived:W,queuePushMessage:I,processWaitingPushMessages:N,pushMessageQueue:m,removeEventListener:v,retryTimeout:h}}export{Be as W,je as a,Qe as u};
|
|
2
|
+
//# sourceMappingURL=usePushConnection-Kek6sJ0j.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePushConnection-DI_JaC-X.js","sources":["../../src/api/orchestration.ts","../../src/stores/orchestration.store.ts","../../src/composables/usePushConnection.ts"],"sourcesContent":["import type { IRestApiContext } from '@/Interface';\nimport { makeRestApiRequest } from '@/utils/apiUtils';\n\nconst GET_STATUS_ENDPOINT = '/orchestration/worker/status';\n\nexport const sendGetWorkerStatus = async (context: IRestApiContext): Promise<void> => {\n\tawait makeRestApiRequest(context, 'POST', GET_STATUS_ENDPOINT);\n};\n","import { defineStore } from 'pinia';\nimport type { IPushDataWorkerStatusPayload } from '../Interface';\nimport { useRootStore } from './n8nRoot.store';\nimport { sendGetWorkerStatus } from '../api/orchestration';\n\nexport const WORKER_HISTORY_LENGTH = 100;\nconst STALE_SECONDS = 120 * 1000;\n\nexport interface IOrchestrationStoreState {\n\tinitialStatusReceived: boolean;\n\tworkers: { [id: string]: IPushDataWorkerStatusPayload };\n\tworkersHistory: {\n\t\t[id: string]: IWorkerHistoryItem[];\n\t};\n\tworkersLastUpdated: { [id: string]: number };\n\tstatusInterval: NodeJS.Timer | null;\n}\n\nexport interface IWorkerHistoryItem {\n\ttimestamp: number;\n\tdata: IPushDataWorkerStatusPayload;\n}\n\nexport const useOrchestrationStore = defineStore('orchestrationManager', {\n\tstate: (): IOrchestrationStoreState => ({\n\t\tinitialStatusReceived: false,\n\t\tworkers: {},\n\t\tworkersHistory: {},\n\t\tworkersLastUpdated: {},\n\t\tstatusInterval: null,\n\t}),\n\tactions: {\n\t\tupdateWorkerStatus(data: IPushDataWorkerStatusPayload) {\n\t\t\tthis.workers[data.workerId] = data;\n\t\t\tif (!this.workersHistory[data.workerId]) {\n\t\t\t\tthis.workersHistory[data.workerId] = [];\n\t\t\t}\n\t\t\tthis.workersHistory[data.workerId].push({ data, timestamp: Date.now() });\n\t\t\tif (this.workersHistory[data.workerId].length > WORKER_HISTORY_LENGTH) {\n\t\t\t\tthis.workersHistory[data.workerId].shift();\n\t\t\t}\n\t\t\tthis.workersLastUpdated[data.workerId] = Date.now();\n\n\t\t\tthis.initialStatusReceived = true;\n\t\t},\n\t\tremoveStaleWorkers() {\n\t\t\tfor (const id in this.workersLastUpdated) {\n\t\t\t\tif (this.workersLastUpdated[id] + STALE_SECONDS < Date.now()) {\n\t\t\t\t\tdelete this.workers[id];\n\t\t\t\t\tdelete this.workersHistory[id];\n\t\t\t\t\tdelete this.workersLastUpdated[id];\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tstartWorkerStatusPolling() {\n\t\t\tconst rootStore = useRootStore();\n\t\t\tif (!this.statusInterval) {\n\t\t\t\tthis.statusInterval = setInterval(async () => {\n\t\t\t\t\tawait sendGetWorkerStatus(rootStore.getRestApiContext);\n\t\t\t\t\tthis.removeStaleWorkers();\n\t\t\t\t}, 1000);\n\t\t\t}\n\t\t},\n\t\tstopWorkerStatusPolling() {\n\t\t\tif (this.statusInterval) {\n\t\t\t\tclearInterval(this.statusInterval);\n\t\t\t\tthis.statusInterval = null;\n\t\t\t}\n\t\t},\n\t\tgetWorkerLastUpdated(workerId: string): number {\n\t\t\treturn this.workersLastUpdated[workerId] ?? 0;\n\t\t},\n\t\tgetWorkerStatus(workerId: string): IPushDataWorkerStatusPayload | undefined {\n\t\t\treturn this.workers[workerId];\n\t\t},\n\t\tgetWorkerStatusHistory(workerId: string): IWorkerHistoryItem[] {\n\t\t\treturn this.workersHistory[workerId] ?? [];\n\t\t},\n\t},\n});\n","import type {\n\tIExecutionResponse,\n\tIExecutionsCurrentSummaryExtended,\n\tIPushData,\n\tIPushDataExecutionFinished,\n} from '@/Interface';\n\nimport { useNodeHelpers } from '@/composables/useNodeHelpers';\nimport { useTitleChange } from '@/composables/useTitleChange';\nimport { useToast } from '@/composables/useToast';\n\nimport type {\n\tExpressionError,\n\tIDataObject,\n\tINodeTypeNameVersion,\n\tIRun,\n\tIRunExecutionData,\n\tIWorkflowBase,\n\tSubworkflowOperationError,\n\tIExecuteContextData,\n\tNodeOperationError,\n\tINodeTypeDescription,\n} from 'n8n-workflow';\nimport { TelemetryHelpers } from 'n8n-workflow';\n\nimport { WORKFLOW_SETTINGS_MODAL_KEY } from '@/constants';\nimport { getTriggerNodeServiceName } from '@/utils/nodeTypesUtils';\nimport { codeNodeEditorEventBus, globalLinkActionsEventBus } from '@/event-bus';\nimport { useUIStore } from '@/stores/ui.store';\nimport { useWorkflowsStore } from '@/stores/workflows.store';\nimport { useNodeTypesStore } from '@/stores/nodeTypes.store';\nimport { useCredentialsStore } from '@/stores/credentials.store';\nimport { useSettingsStore } from '@/stores/settings.store';\nimport { parse } from 'flatted';\nimport { useSegment } from '@/stores/segment.store';\nimport { ref } from 'vue';\nimport { useOrchestrationStore } from '@/stores/orchestration.store';\nimport { usePushConnectionStore } from '@/stores/pushConnection.store';\nimport { useCollaborationStore } from '@/stores/collaboration.store';\nimport { useExternalHooks } from '@/composables/useExternalHooks';\nimport type { useRouter } from 'vue-router';\nimport { useWorkflowHelpers } from '@/composables/useWorkflowHelpers';\nimport { useI18n } from '@/composables/useI18n';\nimport { useTelemetry } from '@/composables/useTelemetry';\nimport type { PushMessageQueueItem } from '@/types';\n\nexport function usePushConnection({ router }: { router: ReturnType<typeof useRouter> }) {\n\tconst workflowHelpers = useWorkflowHelpers({ router });\n\tconst nodeHelpers = useNodeHelpers();\n\tconst titleChange = useTitleChange();\n\tconst toast = useToast();\n\tconst i18n = useI18n();\n\tconst telemetry = useTelemetry();\n\n\tconst collaborationStore = useCollaborationStore();\n\tconst credentialsStore = useCredentialsStore();\n\tconst nodeTypesStore = useNodeTypesStore();\n\tconst orchestrationManagerStore = useOrchestrationStore();\n\tconst pushStore = usePushConnectionStore();\n\tconst settingsStore = useSettingsStore();\n\tconst segmentStore = useSegment();\n\tconst uiStore = useUIStore();\n\tconst workflowsStore = useWorkflowsStore();\n\n\tconst retryTimeout = ref<NodeJS.Timeout | null>(null);\n\tconst pushMessageQueue = ref<PushMessageQueueItem[]>([]);\n\tconst removeEventListener = ref<(() => void) | null>(null);\n\n\tfunction initialize() {\n\t\tremoveEventListener.value = pushStore.addEventListener((message) => {\n\t\t\tvoid pushMessageReceived(message);\n\t\t});\n\t\tcollaborationStore.initialize();\n\t}\n\n\tfunction terminate() {\n\t\tcollaborationStore.terminate();\n\t\tif (typeof removeEventListener.value === 'function') {\n\t\t\tremoveEventListener.value();\n\t\t}\n\t}\n\n\t/**\n\t * Sometimes the push message is faster as the result from\n\t * the REST API so we do not know yet what execution ID\n\t * is currently active. So internally resend the message\n\t * a few more times\n\t */\n\tfunction queuePushMessage(event: IPushData, retryAttempts: number) {\n\t\tpushMessageQueue.value.push({ message: event, retriesLeft: retryAttempts });\n\n\t\tif (retryTimeout.value === null) {\n\t\t\tretryTimeout.value = setTimeout(processWaitingPushMessages, 20);\n\t\t}\n\t}\n\n\t/**\n\t * Process the push messages which are waiting in the queue\n\t */\n\tasync function processWaitingPushMessages() {\n\t\tif (retryTimeout.value !== null) {\n\t\t\tclearTimeout(retryTimeout.value);\n\t\t\tretryTimeout.value = null;\n\t\t}\n\n\t\tconst queueLength = pushMessageQueue.value.length;\n\t\tfor (let i = 0; i < queueLength; i++) {\n\t\t\tconst messageData = pushMessageQueue.value.shift() as PushMessageQueueItem;\n\n\t\t\tconst result = await pushMessageReceived(messageData.message, true);\n\t\t\tif (!result) {\n\t\t\t\t// Was not successful\n\t\t\t\tmessageData.retriesLeft -= 1;\n\n\t\t\t\tif (messageData.retriesLeft > 0) {\n\t\t\t\t\t// If still retries are left add it back and stop execution\n\t\t\t\t\tpushMessageQueue.value.unshift(messageData);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (pushMessageQueue.value.length !== 0 && retryTimeout.value === null) {\n\t\t\tretryTimeout.value = setTimeout(processWaitingPushMessages, 25);\n\t\t}\n\t}\n\n\t/**\n\t * Process a newly received message\n\t */\n\tasync function pushMessageReceived(receivedData: IPushData, isRetry?: boolean): Promise<boolean> {\n\t\tconst retryAttempts = 5;\n\n\t\tif (receivedData.type === 'sendWorkerStatusMessage') {\n\t\t\tconst pushData = receivedData.data;\n\t\t\torchestrationManagerStore.updateWorkerStatus(pushData.status);\n\t\t\treturn true;\n\t\t}\n\n\t\tif (receivedData.type === 'sendConsoleMessage') {\n\t\t\tconst pushData = receivedData.data;\n\t\t\tconsole.log(pushData.source, ...pushData.messages);\n\t\t\treturn true;\n\t\t}\n\n\t\tif (\n\t\t\t!['testWebhookReceived'].includes(receivedData.type) &&\n\t\t\tisRetry !== true &&\n\t\t\tpushMessageQueue.value.length\n\t\t) {\n\t\t\t// If there are already messages in the queue add the new one that all of them\n\t\t\t// get executed in order\n\t\t\tqueuePushMessage(receivedData, retryAttempts);\n\t\t\treturn false;\n\t\t}\n\n\t\tif (receivedData.type === 'nodeExecuteAfter' || receivedData.type === 'nodeExecuteBefore') {\n\t\t\tif (!uiStore.isActionActive('workflowRunning')) {\n\t\t\t\t// No workflow is running so ignore the messages\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst pushData = receivedData.data;\n\t\t\tif (workflowsStore.activeExecutionId !== pushData.executionId) {\n\t\t\t\t// The data is not for the currently active execution or\n\t\t\t\t// we do not have the execution id yet.\n\t\t\t\tif (isRetry !== true) {\n\t\t\t\t\tqueuePushMessage(event as unknown as IPushData, retryAttempts);\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// recovered execution data is handled like executionFinished data, however for security reasons\n\t\t// we need to fetch the data from the server again rather than push it to all clients\n\t\tlet recoveredPushData: IPushDataExecutionFinished | undefined = undefined;\n\t\tif (receivedData.type === 'executionRecovered') {\n\t\t\tconst recoveredExecutionId = receivedData.data?.executionId;\n\t\t\tconst isWorkflowRunning = uiStore.isActionActive('workflowRunning');\n\t\t\tif (isWorkflowRunning && workflowsStore.activeExecutionId === recoveredExecutionId) {\n\t\t\t\t// pull execution data for the recovered execution from the server\n\t\t\t\tconst executionData = await workflowsStore.fetchExecutionDataById(\n\t\t\t\t\tworkflowsStore.activeExecutionId,\n\t\t\t\t);\n\t\t\t\tif (executionData?.data) {\n\t\t\t\t\t// data comes in as 'flatten' object, so we need to parse it\n\t\t\t\t\texecutionData.data = parse(executionData.data as unknown as string) as IRunExecutionData;\n\t\t\t\t\tconst iRunExecutionData: IRunExecutionData = {\n\t\t\t\t\t\tstartData: executionData.data?.startData,\n\t\t\t\t\t\tresultData: executionData.data?.resultData ?? { runData: {} },\n\t\t\t\t\t\texecutionData: executionData.data?.executionData,\n\t\t\t\t\t};\n\t\t\t\t\tif (workflowsStore.workflowExecutionData?.workflowId === executionData.workflowId) {\n\t\t\t\t\t\tconst activeRunData = workflowsStore.workflowExecutionData?.data?.resultData?.runData;\n\t\t\t\t\t\tif (activeRunData) {\n\t\t\t\t\t\t\tfor (const key of Object.keys(activeRunData)) {\n\t\t\t\t\t\t\t\tiRunExecutionData.resultData.runData[key] = activeRunData[key];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tconst iRun: IRun = {\n\t\t\t\t\t\tdata: iRunExecutionData,\n\t\t\t\t\t\tfinished: executionData.finished,\n\t\t\t\t\t\tmode: executionData.mode,\n\t\t\t\t\t\twaitTill: executionData.data?.waitTill,\n\t\t\t\t\t\tstartedAt: executionData.startedAt,\n\t\t\t\t\t\tstoppedAt: executionData.stoppedAt,\n\t\t\t\t\t\tstatus: 'crashed',\n\t\t\t\t\t};\n\t\t\t\t\tif (executionData.data) {\n\t\t\t\t\t\trecoveredPushData = {\n\t\t\t\t\t\t\texecutionId: executionData.id,\n\t\t\t\t\t\t\tdata: iRun,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\treceivedData.type === 'workflowFailedToActivate' &&\n\t\t\tworkflowsStore.workflowId === receivedData.data.workflowId\n\t\t) {\n\t\t\tworkflowsStore.setWorkflowInactive(receivedData.data.workflowId);\n\t\t\tworkflowsStore.setActive(false);\n\n\t\t\ttoast.showError(\n\t\t\t\tnew Error(receivedData.data.errorMessage),\n\t\t\t\ti18n.baseText('workflowActivator.showError.title', {\n\t\t\t\t\tinterpolate: { newStateName: 'activated' },\n\t\t\t\t}) + ':',\n\t\t\t);\n\n\t\t\treturn true;\n\t\t}\n\n\t\tif (receivedData.type === 'workflowActivated') {\n\t\t\tworkflowsStore.setWorkflowActive(receivedData.data.workflowId);\n\t\t\treturn true;\n\t\t}\n\n\t\tif (receivedData.type === 'workflowDeactivated') {\n\t\t\tworkflowsStore.setWorkflowInactive(receivedData.data.workflowId);\n\t\t\treturn true;\n\t\t}\n\n\t\tif (receivedData.type === 'executionFinished' || receivedData.type === 'executionRecovered') {\n\t\t\t// The workflow finished executing\n\t\t\tlet pushData: IPushDataExecutionFinished;\n\t\t\tif (receivedData.type === 'executionRecovered' && recoveredPushData !== undefined) {\n\t\t\t\tpushData = recoveredPushData;\n\t\t\t} else {\n\t\t\t\tpushData = receivedData.data as IPushDataExecutionFinished;\n\t\t\t}\n\n\t\t\tconst { activeExecutionId } = workflowsStore;\n\t\t\tif (activeExecutionId === pushData.executionId) {\n\t\t\t\tconst activeRunData = workflowsStore.workflowExecutionData?.data?.resultData?.runData;\n\t\t\t\tif (activeRunData) {\n\t\t\t\t\tfor (const key of Object.keys(activeRunData)) {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tpushData.data.data.resultData.runData[key]?.[0]?.data?.main?.[0]?.[0]?.json\n\t\t\t\t\t\t\t\t?.isArtificialRecoveredEventItem === true &&\n\t\t\t\t\t\t\tactiveRunData[key].length > 0\n\t\t\t\t\t\t)\n\t\t\t\t\t\t\tpushData.data.data.resultData.runData[key] = activeRunData[key];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tworkflowsStore.finishActiveExecution(pushData);\n\t\t\t}\n\n\t\t\tif (!uiStore.isActionActive('workflowRunning')) {\n\t\t\t\t// No workflow is running so ignore the messages\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (activeExecutionId !== pushData.executionId) {\n\t\t\t\t// The workflow which did finish execution did either not get started\n\t\t\t\t// by this session or we do not have the execution id yet.\n\t\t\t\tif (isRetry !== true) {\n\t\t\t\t\tqueuePushMessage(event as unknown as IPushData, retryAttempts);\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst runDataExecuted = pushData.data;\n\n\t\t\tlet runDataExecutedErrorMessage = getExecutionError(runDataExecuted.data);\n\n\t\t\tif (runDataExecuted.status === 'crashed') {\n\t\t\t\trunDataExecutedErrorMessage = i18n.baseText('pushConnection.executionFailed.message');\n\t\t\t} else if (runDataExecuted.status === 'canceled') {\n\t\t\t\trunDataExecutedErrorMessage = i18n.baseText(\n\t\t\t\t\t'executionsList.showMessage.stopExecution.message',\n\t\t\t\t\t{\n\t\t\t\t\t\tinterpolate: { activeExecutionId },\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst lineNumber = runDataExecuted?.data?.resultData?.error?.lineNumber;\n\n\t\t\tcodeNodeEditorEventBus.emit('error-line-number', lineNumber || 'final');\n\n\t\t\tconst workflow = workflowHelpers.getCurrentWorkflow();\n\t\t\tif (runDataExecuted.waitTill !== undefined) {\n\t\t\t\tconst workflowSettings = workflowsStore.workflowSettings;\n\t\t\t\tconst saveManualExecutions = settingsStore.saveManualExecutions;\n\n\t\t\t\tconst isSavingExecutions =\n\t\t\t\t\tworkflowSettings.saveManualExecutions === undefined\n\t\t\t\t\t\t? saveManualExecutions\n\t\t\t\t\t\t: workflowSettings.saveManualExecutions;\n\n\t\t\t\tlet action;\n\t\t\t\tif (!isSavingExecutions) {\n\t\t\t\t\tglobalLinkActionsEventBus.emit('registerGlobalLinkAction', {\n\t\t\t\t\t\tkey: 'open-settings',\n\t\t\t\t\t\taction: async () => {\n\t\t\t\t\t\t\tif (workflowsStore.isNewWorkflow) await workflowHelpers.saveAsNewWorkflow();\n\t\t\t\t\t\t\tuiStore.openModal(WORKFLOW_SETTINGS_MODAL_KEY);\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\n\t\t\t\t\taction =\n\t\t\t\t\t\t'<a data-action=\"open-settings\">Turn on saving manual executions</a> and run again to see what happened after this node.';\n\t\t\t\t} else {\n\t\t\t\t\taction = `<a href=\"/workflow/${workflow.id}/executions/${activeExecutionId}\">View the execution</a> to see what happened after this node.`;\n\t\t\t\t}\n\n\t\t\t\t// Workflow did start but had been put to wait\n\t\t\t\ttitleChange.titleSet(workflow.name as string, 'IDLE');\n\t\t\t\ttoast.showToast({\n\t\t\t\t\ttitle: 'Workflow started waiting',\n\t\t\t\t\tmessage: `${action} <a href=\"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.wait/\" target=\"_blank\">More info</a>`,\n\t\t\t\t\ttype: 'success',\n\t\t\t\t\tduration: 0,\n\t\t\t\t});\n\t\t\t} else if (runDataExecuted.finished !== true) {\n\t\t\t\ttitleChange.titleSet(workflow.name as string, 'ERROR');\n\n\t\t\t\tif (\n\t\t\t\t\trunDataExecuted.data.resultData.error?.name === 'ExpressionError' &&\n\t\t\t\t\t(runDataExecuted.data.resultData.error as ExpressionError).context.functionality ===\n\t\t\t\t\t\t'pairedItem'\n\t\t\t\t) {\n\t\t\t\t\tconst error = runDataExecuted.data.resultData.error as ExpressionError;\n\n\t\t\t\t\tvoid workflowHelpers.getWorkflowDataToSave().then((workflowData) => {\n\t\t\t\t\t\tconst eventData: IDataObject = {\n\t\t\t\t\t\t\tcaused_by_credential: false,\n\t\t\t\t\t\t\terror_message: error.description,\n\t\t\t\t\t\t\terror_title: error.message,\n\t\t\t\t\t\t\terror_type: error.context.type,\n\t\t\t\t\t\t\tnode_graph_string: JSON.stringify(\n\t\t\t\t\t\t\t\tTelemetryHelpers.generateNodesGraph(\n\t\t\t\t\t\t\t\t\tworkflowData as IWorkflowBase,\n\t\t\t\t\t\t\t\t\tworkflowHelpers.getNodeTypes(),\n\t\t\t\t\t\t\t\t).nodeGraph,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tworkflow_id: workflowsStore.workflowId,\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\terror.context.nodeCause &&\n\t\t\t\t\t\t\t['paired_item_no_info', 'paired_item_invalid_info'].includes(\n\t\t\t\t\t\t\t\terror.context.type as string,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tconst node = workflow.getNode(error.context.nodeCause as string);\n\n\t\t\t\t\t\t\tif (node) {\n\t\t\t\t\t\t\t\teventData.is_pinned = !!workflow.getPinDataOfNode(node.name);\n\t\t\t\t\t\t\t\teventData.mode = node.parameters.mode;\n\t\t\t\t\t\t\t\teventData.node_type = node.type;\n\t\t\t\t\t\t\t\teventData.operation = node.parameters.operation;\n\t\t\t\t\t\t\t\teventData.resource = node.parameters.resource;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttelemetry.track('Instance FE emitted paired item error', eventData, {\n\t\t\t\t\t\t\twithPostHog: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (runDataExecuted.data.resultData.error?.name === 'SubworkflowOperationError') {\n\t\t\t\t\tconst error = runDataExecuted.data.resultData.error as SubworkflowOperationError;\n\n\t\t\t\t\tworkflowsStore.subWorkflowExecutionError = error;\n\n\t\t\t\t\ttoast.showMessage({\n\t\t\t\t\t\ttitle: error.message,\n\t\t\t\t\t\tmessage: error.description,\n\t\t\t\t\t\ttype: 'error',\n\t\t\t\t\t\tduration: 0,\n\t\t\t\t\t});\n\t\t\t\t} else if (\n\t\t\t\t\trunDataExecuted.data.resultData.error?.name === 'NodeOperationError' &&\n\t\t\t\t\t(runDataExecuted.data.resultData.error as NodeOperationError).functionality ===\n\t\t\t\t\t\t'configuration-node'\n\t\t\t\t) {\n\t\t\t\t\t// If the error is a configuration error of the node itself doesn't get executed so we can't use lastNodeExecuted for the title\n\t\t\t\t\tlet title: string;\n\t\t\t\t\tconst nodeError = runDataExecuted.data.resultData.error as NodeOperationError;\n\t\t\t\t\tif (nodeError.node.name) {\n\t\t\t\t\t\ttitle = `Error in sub-node ‘${nodeError.node.name}‘`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttitle = 'Problem executing workflow';\n\t\t\t\t\t}\n\n\t\t\t\t\ttoast.showMessage({\n\t\t\t\t\t\ttitle,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t(nodeError?.description ?? runDataExecutedErrorMessage) +\n\t\t\t\t\t\t\ti18n.baseText('pushConnection.executionError.openNode', {\n\t\t\t\t\t\t\t\tinterpolate: {\n\t\t\t\t\t\t\t\t\tnode: nodeError.node.name,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\ttype: 'error',\n\t\t\t\t\t\tduration: 0,\n\t\t\t\t\t\tdangerouslyUseHTMLString: true,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tlet title: string;\n\t\t\t\t\tconst isManualExecutionCancelled =\n\t\t\t\t\t\trunDataExecuted.mode === 'manual' && runDataExecuted.status === 'canceled';\n\n\t\t\t\t\t// Do not show the error message if the workflow got canceled manually\n\t\t\t\t\tif (isManualExecutionCancelled) {\n\t\t\t\t\t\ttoast.showMessage({\n\t\t\t\t\t\t\ttitle: i18n.baseText('nodeView.showMessage.stopExecutionTry.title'),\n\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (runDataExecuted.data.resultData.lastNodeExecuted) {\n\t\t\t\t\t\t\ttitle = `Problem in node ‘${runDataExecuted.data.resultData.lastNodeExecuted}‘`;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttitle = 'Problem executing workflow';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttoast.showMessage({\n\t\t\t\t\t\t\ttitle,\n\t\t\t\t\t\t\tmessage: runDataExecutedErrorMessage,\n\t\t\t\t\t\t\ttype: 'error',\n\t\t\t\t\t\t\tduration: 0,\n\t\t\t\t\t\t\tdangerouslyUseHTMLString: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Workflow did execute without a problem\n\t\t\t\ttitleChange.titleSet(workflow.name as string, 'IDLE');\n\n\t\t\t\tconst execution = workflowsStore.getWorkflowExecution;\n\t\t\t\tif (execution?.executedNode) {\n\t\t\t\t\tconst node = workflowsStore.getNodeByName(execution.executedNode);\n\t\t\t\t\tconst nodeType = node && nodeTypesStore.getNodeType(node.type, node.typeVersion);\n\t\t\t\t\tconst nodeOutput =\n\t\t\t\t\t\texecution &&\n\t\t\t\t\t\texecution.executedNode &&\n\t\t\t\t\t\texecution.data?.resultData?.runData?.[execution.executedNode];\n\t\t\t\t\tif (nodeType?.polling && !nodeOutput) {\n\t\t\t\t\t\ttoast.showMessage({\n\t\t\t\t\t\t\ttitle: i18n.baseText('pushConnection.pollingNode.dataNotFound', {\n\t\t\t\t\t\t\t\tinterpolate: {\n\t\t\t\t\t\t\t\t\tservice: getTriggerNodeServiceName(nodeType),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tmessage: i18n.baseText('pushConnection.pollingNode.dataNotFound.message', {\n\t\t\t\t\t\t\t\tinterpolate: {\n\t\t\t\t\t\t\t\t\tservice: getTriggerNodeServiceName(nodeType),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttoast.showMessage({\n\t\t\t\t\t\t\ttitle: i18n.baseText('pushConnection.nodeExecutedSuccessfully'),\n\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttoast.showMessage({\n\t\t\t\t\t\ttitle: i18n.baseText('pushConnection.workflowExecutedSuccessfully'),\n\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// It does not push the runData as it got already pushed with each\n\t\t\t// node that did finish. For that reason copy in here the data\n\t\t\t// which we already have.\n\t\t\tif (workflowsStore.getWorkflowRunData) {\n\t\t\t\trunDataExecuted.data.resultData.runData = workflowsStore.getWorkflowRunData;\n\t\t\t}\n\n\t\t\tworkflowsStore.executingNode.length = 0;\n\t\t\tworkflowsStore.setWorkflowExecutionData(runDataExecuted as IExecutionResponse);\n\t\t\tuiStore.removeActiveAction('workflowRunning');\n\n\t\t\t// Set the node execution issues on all the nodes which produced an error so that\n\t\t\t// it can be displayed in the node-view\n\t\t\tnodeHelpers.updateNodesExecutionIssues();\n\n\t\t\tconst lastNodeExecuted: string | undefined = runDataExecuted.data.resultData.lastNodeExecuted;\n\t\t\tlet itemsCount = 0;\n\t\t\tif (\n\t\t\t\tlastNodeExecuted &&\n\t\t\t\trunDataExecuted.data.resultData.runData[lastNodeExecuted] &&\n\t\t\t\t!runDataExecutedErrorMessage\n\t\t\t) {\n\t\t\t\titemsCount =\n\t\t\t\t\trunDataExecuted.data.resultData.runData[lastNodeExecuted][0].data!.main[0]!.length;\n\t\t\t}\n\n\t\t\tvoid useExternalHooks().run('pushConnection.executionFinished', {\n\t\t\t\titemsCount,\n\t\t\t\tnodeName: runDataExecuted.data.resultData.lastNodeExecuted,\n\t\t\t\terrorMessage: runDataExecutedErrorMessage,\n\t\t\t\trunDataExecutedStartData: runDataExecuted.data.startData,\n\t\t\t\tresultDataError: runDataExecuted.data.resultData.error,\n\t\t\t});\n\t\t\tif (!runDataExecuted.data.resultData.error) {\n\t\t\t\tsegmentStore.trackSuccessfulWorkflowExecution(runDataExecuted);\n\t\t\t}\n\t\t} else if (receivedData.type === 'executionStarted') {\n\t\t\tconst pushData = receivedData.data;\n\n\t\t\tconst executionData: IExecutionsCurrentSummaryExtended = {\n\t\t\t\tid: pushData.executionId,\n\t\t\t\tfinished: false,\n\t\t\t\tmode: pushData.mode,\n\t\t\t\tstartedAt: pushData.startedAt,\n\t\t\t\tretryOf: pushData.retryOf,\n\t\t\t\tworkflowId: pushData.workflowId,\n\t\t\t\tworkflowName: pushData.workflowName,\n\t\t\t};\n\n\t\t\tworkflowsStore.addActiveExecution(executionData);\n\t\t} else if (receivedData.type === 'nodeExecuteAfter') {\n\t\t\t// A node finished to execute. Add its data\n\t\t\tconst pushData = receivedData.data;\n\t\t\tworkflowsStore.addNodeExecutionData(pushData);\n\t\t\tworkflowsStore.removeExecutingNode(pushData.nodeName);\n\t\t} else if (receivedData.type === 'nodeExecuteBefore') {\n\t\t\t// A node started to be executed. Set it as executing.\n\t\t\tconst pushData = receivedData.data;\n\t\t\tworkflowsStore.addExecutingNode(pushData.nodeName);\n\t\t} else if (receivedData.type === 'testWebhookDeleted') {\n\t\t\t// A test-webhook was deleted\n\t\t\tconst pushData = receivedData.data;\n\n\t\t\tif (pushData.workflowId === workflowsStore.workflowId) {\n\t\t\t\tworkflowsStore.executionWaitingForWebhook = false;\n\t\t\t\tuiStore.removeActiveAction('workflowRunning');\n\t\t\t}\n\t\t} else if (receivedData.type === 'testWebhookReceived') {\n\t\t\t// A test-webhook did get called\n\t\t\tconst pushData = receivedData.data;\n\n\t\t\tif (pushData.workflowId === workflowsStore.workflowId) {\n\t\t\t\tworkflowsStore.executionWaitingForWebhook = false;\n\t\t\t\tworkflowsStore.activeExecutionId = pushData.executionId;\n\t\t\t}\n\n\t\t\tvoid processWaitingPushMessages();\n\t\t} else if (receivedData.type === 'reloadNodeType') {\n\t\t\tawait nodeTypesStore.getNodeTypes();\n\t\t\tawait nodeTypesStore.getFullNodesProperties([receivedData.data]);\n\t\t} else if (receivedData.type === 'removeNodeType') {\n\t\t\tconst pushData = receivedData.data;\n\n\t\t\tconst nodesToBeRemoved: INodeTypeNameVersion[] = [pushData];\n\n\t\t\t// Force reload of all credential types\n\t\t\tawait credentialsStore.fetchCredentialTypes(false).then(() => {\n\t\t\t\tnodeTypesStore.removeNodeTypes(nodesToBeRemoved as INodeTypeDescription[]);\n\t\t\t});\n\t\t} else if (receivedData.type === 'nodeDescriptionUpdated') {\n\t\t\tawait nodeTypesStore.getNodeTypes();\n\t\t\tawait credentialsStore.fetchCredentialTypes(true);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfunction getExecutionError(data: IRunExecutionData | IExecuteContextData) {\n\t\tconst error = data.resultData.error;\n\n\t\tlet errorMessage: string;\n\n\t\tif (data.resultData.lastNodeExecuted && error) {\n\t\t\terrorMessage = error.message || error.description;\n\t\t} else {\n\t\t\terrorMessage = i18n.baseText('pushConnection.executionError', {\n\t\t\t\tinterpolate: { error: '!' },\n\t\t\t});\n\n\t\t\tif (error?.message) {\n\t\t\t\tlet nodeName: string | undefined;\n\t\t\t\tif ('node' in error) {\n\t\t\t\t\tnodeName = typeof error.node === 'string' ? error.node : error.node!.name;\n\t\t\t\t}\n\n\t\t\t\tconst receivedError = nodeName ? `${nodeName}: ${error.message}` : error.message;\n\t\t\t\terrorMessage = i18n.baseText('pushConnection.executionError', {\n\t\t\t\t\tinterpolate: {\n\t\t\t\t\t\terror: `.${i18n.baseText('pushConnection.executionError.details', {\n\t\t\t\t\t\t\tinterpolate: {\n\t\t\t\t\t\t\t\tdetails: receivedError,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t})}`,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn errorMessage;\n\t}\n\n\treturn {\n\t\tinitialize,\n\t\tterminate,\n\t\tpushMessageReceived,\n\t\tqueuePushMessage,\n\t\tprocessWaitingPushMessages,\n\t\tpushMessageQueue,\n\t\tremoveEventListener,\n\t\tretryTimeout,\n\t};\n}\n"],"names":["GET_STATUS_ENDPOINT","sendGetWorkerStatus","context","makeRestApiRequest","WORKER_HISTORY_LENGTH","STALE_SECONDS","useOrchestrationStore","defineStore","data","id","rootStore","useRootStore","workerId","usePushConnection","router","workflowHelpers","useWorkflowHelpers","nodeHelpers","useNodeHelpers","titleChange","useTitleChange","toast","useToast","i18n","useI18n","telemetry","useTelemetry","collaborationStore","useCollaborationStore","credentialsStore","useCredentialsStore","nodeTypesStore","useNodeTypesStore","orchestrationManagerStore","pushStore","usePushConnectionStore","settingsStore","useSettingsStore","segmentStore","useSegment","uiStore","useUIStore","workflowsStore","useWorkflowsStore","retryTimeout","ref","pushMessageQueue","removeEventListener","initialize","message","pushMessageReceived","terminate","queuePushMessage","event","retryAttempts","processWaitingPushMessages","queueLength","i","messageData","receivedData","isRetry","pushData","recoveredPushData","recoveredExecutionId","_a","executionData","parse","iRunExecutionData","_b","_c","_d","_e","activeRunData","_h","_g","_f","key","iRun","_i","activeExecutionId","_l","_k","_j","_s","_r","_q","_p","_o","_n","_m","runDataExecuted","runDataExecutedErrorMessage","getExecutionError","lineNumber","_v","_u","_t","codeNodeEditorEventBus","workflow","workflowSettings","saveManualExecutions","isSavingExecutions","action","globalLinkActionsEventBus","WORKFLOW_SETTINGS_MODAL_KEY","_w","error","workflowData","eventData","TelemetryHelpers.generateNodesGraph","node","_x","_y","title","nodeError","execution","nodeType","nodeOutput","_B","_A","_z","getTriggerNodeServiceName","lastNodeExecuted","itemsCount","useExternalHooks","nodesToBeRemoved","errorMessage","nodeName","receivedError"],"mappings":"saAGA,MAAMA,GAAsB,+BAEfC,GAAsB,MAAOC,GAA4C,CAC/E,MAAAC,GAAmBD,EAAS,OAAQF,EAAmB,CAC9D,ECFaI,GAAwB,IAC/BC,GAAgB,IAAM,IAiBfC,GAAwBC,GAAY,uBAAwB,CACxE,MAAO,KAAiC,CACvC,sBAAuB,GACvB,QAAS,CAAC,EACV,eAAgB,CAAC,EACjB,mBAAoB,CAAC,EACrB,eAAgB,IAAA,GAEjB,QAAS,CACR,mBAAmBC,EAAoC,CACjD,KAAA,QAAQA,EAAK,QAAQ,EAAIA,EACzB,KAAK,eAAeA,EAAK,QAAQ,IACrC,KAAK,eAAeA,EAAK,QAAQ,EAAI,CAAA,GAEjC,KAAA,eAAeA,EAAK,QAAQ,EAAE,KAAK,CAAE,KAAAA,EAAM,UAAW,KAAK,IAAI,CAAG,CAAA,EACnE,KAAK,eAAeA,EAAK,QAAQ,EAAE,OAASJ,IAC/C,KAAK,eAAeI,EAAK,QAAQ,EAAE,MAAM,EAE1C,KAAK,mBAAmBA,EAAK,QAAQ,EAAI,KAAK,MAE9C,KAAK,sBAAwB,EAC9B,EACA,oBAAqB,CACT,UAAAC,KAAM,KAAK,mBACjB,KAAK,mBAAmBA,CAAE,EAAIJ,GAAgB,KAAK,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0j.js","sources":["../../src/api/orchestration.ts","../../src/stores/orchestration.store.ts","../../src/composables/usePushConnection.ts"],"sourcesContent":["import type { IRestApiContext } from '@/Interface';\nimport { makeRestApiRequest } from '@/utils/apiUtils';\n\nconst GET_STATUS_ENDPOINT = '/orchestration/worker/status';\n\nexport const sendGetWorkerStatus = async (context: IRestApiContext): Promise<void> => {\n\tawait makeRestApiRequest(context, 'POST', GET_STATUS_ENDPOINT);\n};\n","import { defineStore } from 'pinia';\nimport type { IPushDataWorkerStatusPayload } from '../Interface';\nimport { useRootStore } from './n8nRoot.store';\nimport { sendGetWorkerStatus } from '../api/orchestration';\n\nexport const WORKER_HISTORY_LENGTH = 100;\nconst STALE_SECONDS = 120 * 1000;\n\nexport interface IOrchestrationStoreState {\n\tinitialStatusReceived: boolean;\n\tworkers: { [id: string]: IPushDataWorkerStatusPayload };\n\tworkersHistory: {\n\t\t[id: string]: IWorkerHistoryItem[];\n\t};\n\tworkersLastUpdated: { [id: string]: number };\n\tstatusInterval: NodeJS.Timer | null;\n}\n\nexport interface IWorkerHistoryItem {\n\ttimestamp: number;\n\tdata: IPushDataWorkerStatusPayload;\n}\n\nexport const useOrchestrationStore = defineStore('orchestrationManager', {\n\tstate: (): IOrchestrationStoreState => ({\n\t\tinitialStatusReceived: false,\n\t\tworkers: {},\n\t\tworkersHistory: {},\n\t\tworkersLastUpdated: {},\n\t\tstatusInterval: null,\n\t}),\n\tactions: {\n\t\tupdateWorkerStatus(data: IPushDataWorkerStatusPayload) {\n\t\t\tthis.workers[data.workerId] = data;\n\t\t\tif (!this.workersHistory[data.workerId]) {\n\t\t\t\tthis.workersHistory[data.workerId] = [];\n\t\t\t}\n\t\t\tthis.workersHistory[data.workerId].push({ data, timestamp: Date.now() });\n\t\t\tif (this.workersHistory[data.workerId].length > WORKER_HISTORY_LENGTH) {\n\t\t\t\tthis.workersHistory[data.workerId].shift();\n\t\t\t}\n\t\t\tthis.workersLastUpdated[data.workerId] = Date.now();\n\n\t\t\tthis.initialStatusReceived = true;\n\t\t},\n\t\tremoveStaleWorkers() {\n\t\t\tfor (const id in this.workersLastUpdated) {\n\t\t\t\tif (this.workersLastUpdated[id] + STALE_SECONDS < Date.now()) {\n\t\t\t\t\tdelete this.workers[id];\n\t\t\t\t\tdelete this.workersHistory[id];\n\t\t\t\t\tdelete this.workersLastUpdated[id];\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tstartWorkerStatusPolling() {\n\t\t\tconst rootStore = useRootStore();\n\t\t\tif (!this.statusInterval) {\n\t\t\t\tthis.statusInterval = setInterval(async () => {\n\t\t\t\t\tawait sendGetWorkerStatus(rootStore.getRestApiContext);\n\t\t\t\t\tthis.removeStaleWorkers();\n\t\t\t\t}, 1000);\n\t\t\t}\n\t\t},\n\t\tstopWorkerStatusPolling() {\n\t\t\tif (this.statusInterval) {\n\t\t\t\tclearInterval(this.statusInterval);\n\t\t\t\tthis.statusInterval = null;\n\t\t\t}\n\t\t},\n\t\tgetWorkerLastUpdated(workerId: string): number {\n\t\t\treturn this.workersLastUpdated[workerId] ?? 0;\n\t\t},\n\t\tgetWorkerStatus(workerId: string): IPushDataWorkerStatusPayload | undefined {\n\t\t\treturn this.workers[workerId];\n\t\t},\n\t\tgetWorkerStatusHistory(workerId: string): IWorkerHistoryItem[] {\n\t\t\treturn this.workersHistory[workerId] ?? [];\n\t\t},\n\t},\n});\n","import type {\n\tIExecutionResponse,\n\tIExecutionsCurrentSummaryExtended,\n\tIPushData,\n\tIPushDataExecutionFinished,\n} from '@/Interface';\n\nimport { useNodeHelpers } from '@/composables/useNodeHelpers';\nimport { useTitleChange } from '@/composables/useTitleChange';\nimport { useToast } from '@/composables/useToast';\n\nimport type {\n\tExpressionError,\n\tIDataObject,\n\tINodeTypeNameVersion,\n\tIRun,\n\tIRunExecutionData,\n\tIWorkflowBase,\n\tSubworkflowOperationError,\n\tIExecuteContextData,\n\tNodeOperationError,\n\tINodeTypeDescription,\n} from 'n8n-workflow';\nimport { TelemetryHelpers } from 'n8n-workflow';\n\nimport { WORKFLOW_SETTINGS_MODAL_KEY } from '@/constants';\nimport { getTriggerNodeServiceName } from '@/utils/nodeTypesUtils';\nimport { codeNodeEditorEventBus, globalLinkActionsEventBus } from '@/event-bus';\nimport { useUIStore } from '@/stores/ui.store';\nimport { useWorkflowsStore } from '@/stores/workflows.store';\nimport { useNodeTypesStore } from '@/stores/nodeTypes.store';\nimport { useCredentialsStore } from '@/stores/credentials.store';\nimport { useSettingsStore } from '@/stores/settings.store';\nimport { parse } from 'flatted';\nimport { useSegment } from '@/stores/segment.store';\nimport { ref } from 'vue';\nimport { useOrchestrationStore } from '@/stores/orchestration.store';\nimport { usePushConnectionStore } from '@/stores/pushConnection.store';\nimport { useCollaborationStore } from '@/stores/collaboration.store';\nimport { useExternalHooks } from '@/composables/useExternalHooks';\nimport type { useRouter } from 'vue-router';\nimport { useWorkflowHelpers } from '@/composables/useWorkflowHelpers';\nimport { useI18n } from '@/composables/useI18n';\nimport { useTelemetry } from '@/composables/useTelemetry';\nimport type { PushMessageQueueItem } from '@/types';\n\nexport function usePushConnection({ router }: { router: ReturnType<typeof useRouter> }) {\n\tconst workflowHelpers = useWorkflowHelpers({ router });\n\tconst nodeHelpers = useNodeHelpers();\n\tconst titleChange = useTitleChange();\n\tconst toast = useToast();\n\tconst i18n = useI18n();\n\tconst telemetry = useTelemetry();\n\n\tconst collaborationStore = useCollaborationStore();\n\tconst credentialsStore = useCredentialsStore();\n\tconst nodeTypesStore = useNodeTypesStore();\n\tconst orchestrationManagerStore = useOrchestrationStore();\n\tconst pushStore = usePushConnectionStore();\n\tconst settingsStore = useSettingsStore();\n\tconst segmentStore = useSegment();\n\tconst uiStore = useUIStore();\n\tconst workflowsStore = useWorkflowsStore();\n\n\tconst retryTimeout = ref<NodeJS.Timeout | null>(null);\n\tconst pushMessageQueue = ref<PushMessageQueueItem[]>([]);\n\tconst removeEventListener = ref<(() => void) | null>(null);\n\n\tfunction initialize() {\n\t\tremoveEventListener.value = pushStore.addEventListener((message) => {\n\t\t\tvoid pushMessageReceived(message);\n\t\t});\n\t\tcollaborationStore.initialize();\n\t}\n\n\tfunction terminate() {\n\t\tcollaborationStore.terminate();\n\t\tif (typeof removeEventListener.value === 'function') {\n\t\t\tremoveEventListener.value();\n\t\t}\n\t}\n\n\t/**\n\t * Sometimes the push message is faster as the result from\n\t * the REST API so we do not know yet what execution ID\n\t * is currently active. So internally resend the message\n\t * a few more times\n\t */\n\tfunction queuePushMessage(event: IPushData, retryAttempts: number) {\n\t\tpushMessageQueue.value.push({ message: event, retriesLeft: retryAttempts });\n\n\t\tif (retryTimeout.value === null) {\n\t\t\tretryTimeout.value = setTimeout(processWaitingPushMessages, 20);\n\t\t}\n\t}\n\n\t/**\n\t * Process the push messages which are waiting in the queue\n\t */\n\tasync function processWaitingPushMessages() {\n\t\tif (retryTimeout.value !== null) {\n\t\t\tclearTimeout(retryTimeout.value);\n\t\t\tretryTimeout.value = null;\n\t\t}\n\n\t\tconst queueLength = pushMessageQueue.value.length;\n\t\tfor (let i = 0; i < queueLength; i++) {\n\t\t\tconst messageData = pushMessageQueue.value.shift() as PushMessageQueueItem;\n\n\t\t\tconst result = await pushMessageReceived(messageData.message, true);\n\t\t\tif (!result) {\n\t\t\t\t// Was not successful\n\t\t\t\tmessageData.retriesLeft -= 1;\n\n\t\t\t\tif (messageData.retriesLeft > 0) {\n\t\t\t\t\t// If still retries are left add it back and stop execution\n\t\t\t\t\tpushMessageQueue.value.unshift(messageData);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (pushMessageQueue.value.length !== 0 && retryTimeout.value === null) {\n\t\t\tretryTimeout.value = setTimeout(processWaitingPushMessages, 25);\n\t\t}\n\t}\n\n\t/**\n\t * Process a newly received message\n\t */\n\tasync function pushMessageReceived(receivedData: IPushData, isRetry?: boolean): Promise<boolean> {\n\t\tconst retryAttempts = 5;\n\n\t\tif (receivedData.type === 'sendWorkerStatusMessage') {\n\t\t\tconst pushData = receivedData.data;\n\t\t\torchestrationManagerStore.updateWorkerStatus(pushData.status);\n\t\t\treturn true;\n\t\t}\n\n\t\tif (receivedData.type === 'sendConsoleMessage') {\n\t\t\tconst pushData = receivedData.data;\n\t\t\tconsole.log(pushData.source, ...pushData.messages);\n\t\t\treturn true;\n\t\t}\n\n\t\tif (\n\t\t\t!['testWebhookReceived'].includes(receivedData.type) &&\n\t\t\tisRetry !== true &&\n\t\t\tpushMessageQueue.value.length\n\t\t) {\n\t\t\t// If there are already messages in the queue add the new one that all of them\n\t\t\t// get executed in order\n\t\t\tqueuePushMessage(receivedData, retryAttempts);\n\t\t\treturn false;\n\t\t}\n\n\t\tif (receivedData.type === 'nodeExecuteAfter' || receivedData.type === 'nodeExecuteBefore') {\n\t\t\tif (!uiStore.isActionActive('workflowRunning')) {\n\t\t\t\t// No workflow is running so ignore the messages\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst pushData = receivedData.data;\n\t\t\tif (workflowsStore.activeExecutionId !== pushData.executionId) {\n\t\t\t\t// The data is not for the currently active execution or\n\t\t\t\t// we do not have the execution id yet.\n\t\t\t\tif (isRetry !== true) {\n\t\t\t\t\tqueuePushMessage(event as unknown as IPushData, retryAttempts);\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// recovered execution data is handled like executionFinished data, however for security reasons\n\t\t// we need to fetch the data from the server again rather than push it to all clients\n\t\tlet recoveredPushData: IPushDataExecutionFinished | undefined = undefined;\n\t\tif (receivedData.type === 'executionRecovered') {\n\t\t\tconst recoveredExecutionId = receivedData.data?.executionId;\n\t\t\tconst isWorkflowRunning = uiStore.isActionActive('workflowRunning');\n\t\t\tif (isWorkflowRunning && workflowsStore.activeExecutionId === recoveredExecutionId) {\n\t\t\t\t// pull execution data for the recovered execution from the server\n\t\t\t\tconst executionData = await workflowsStore.fetchExecutionDataById(\n\t\t\t\t\tworkflowsStore.activeExecutionId,\n\t\t\t\t);\n\t\t\t\tif (executionData?.data) {\n\t\t\t\t\t// data comes in as 'flatten' object, so we need to parse it\n\t\t\t\t\texecutionData.data = parse(executionData.data as unknown as string) as IRunExecutionData;\n\t\t\t\t\tconst iRunExecutionData: IRunExecutionData = {\n\t\t\t\t\t\tstartData: executionData.data?.startData,\n\t\t\t\t\t\tresultData: executionData.data?.resultData ?? { runData: {} },\n\t\t\t\t\t\texecutionData: executionData.data?.executionData,\n\t\t\t\t\t};\n\t\t\t\t\tif (workflowsStore.workflowExecutionData?.workflowId === executionData.workflowId) {\n\t\t\t\t\t\tconst activeRunData = workflowsStore.workflowExecutionData?.data?.resultData?.runData;\n\t\t\t\t\t\tif (activeRunData) {\n\t\t\t\t\t\t\tfor (const key of Object.keys(activeRunData)) {\n\t\t\t\t\t\t\t\tiRunExecutionData.resultData.runData[key] = activeRunData[key];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tconst iRun: IRun = {\n\t\t\t\t\t\tdata: iRunExecutionData,\n\t\t\t\t\t\tfinished: executionData.finished,\n\t\t\t\t\t\tmode: executionData.mode,\n\t\t\t\t\t\twaitTill: executionData.data?.waitTill,\n\t\t\t\t\t\tstartedAt: executionData.startedAt,\n\t\t\t\t\t\tstoppedAt: executionData.stoppedAt,\n\t\t\t\t\t\tstatus: 'crashed',\n\t\t\t\t\t};\n\t\t\t\t\tif (executionData.data) {\n\t\t\t\t\t\trecoveredPushData = {\n\t\t\t\t\t\t\texecutionId: executionData.id,\n\t\t\t\t\t\t\tdata: iRun,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\treceivedData.type === 'workflowFailedToActivate' &&\n\t\t\tworkflowsStore.workflowId === receivedData.data.workflowId\n\t\t) {\n\t\t\tworkflowsStore.setWorkflowInactive(receivedData.data.workflowId);\n\t\t\tworkflowsStore.setActive(false);\n\n\t\t\ttoast.showError(\n\t\t\t\tnew Error(receivedData.data.errorMessage),\n\t\t\t\ti18n.baseText('workflowActivator.showError.title', {\n\t\t\t\t\tinterpolate: { newStateName: 'activated' },\n\t\t\t\t}) + ':',\n\t\t\t);\n\n\t\t\treturn true;\n\t\t}\n\n\t\tif (receivedData.type === 'workflowActivated') {\n\t\t\tworkflowsStore.setWorkflowActive(receivedData.data.workflowId);\n\t\t\treturn true;\n\t\t}\n\n\t\tif (receivedData.type === 'workflowDeactivated') {\n\t\t\tworkflowsStore.setWorkflowInactive(receivedData.data.workflowId);\n\t\t\treturn true;\n\t\t}\n\n\t\tif (receivedData.type === 'executionFinished' || receivedData.type === 'executionRecovered') {\n\t\t\t// The workflow finished executing\n\t\t\tlet pushData: IPushDataExecutionFinished;\n\t\t\tif (receivedData.type === 'executionRecovered' && recoveredPushData !== undefined) {\n\t\t\t\tpushData = recoveredPushData;\n\t\t\t} else {\n\t\t\t\tpushData = receivedData.data as IPushDataExecutionFinished;\n\t\t\t}\n\n\t\t\tconst { activeExecutionId } = workflowsStore;\n\t\t\tif (activeExecutionId === pushData.executionId) {\n\t\t\t\tconst activeRunData = workflowsStore.workflowExecutionData?.data?.resultData?.runData;\n\t\t\t\tif (activeRunData) {\n\t\t\t\t\tfor (const key of Object.keys(activeRunData)) {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tpushData.data.data.resultData.runData[key]?.[0]?.data?.main?.[0]?.[0]?.json\n\t\t\t\t\t\t\t\t?.isArtificialRecoveredEventItem === true &&\n\t\t\t\t\t\t\tactiveRunData[key].length > 0\n\t\t\t\t\t\t)\n\t\t\t\t\t\t\tpushData.data.data.resultData.runData[key] = activeRunData[key];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tworkflowsStore.finishActiveExecution(pushData);\n\t\t\t}\n\n\t\t\tif (!uiStore.isActionActive('workflowRunning')) {\n\t\t\t\t// No workflow is running so ignore the messages\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (activeExecutionId !== pushData.executionId) {\n\t\t\t\t// The workflow which did finish execution did either not get started\n\t\t\t\t// by this session or we do not have the execution id yet.\n\t\t\t\tif (isRetry !== true) {\n\t\t\t\t\tqueuePushMessage(event as unknown as IPushData, retryAttempts);\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst runDataExecuted = pushData.data;\n\n\t\t\tlet runDataExecutedErrorMessage = getExecutionError(runDataExecuted.data);\n\n\t\t\tif (runDataExecuted.status === 'crashed') {\n\t\t\t\trunDataExecutedErrorMessage = i18n.baseText('pushConnection.executionFailed.message');\n\t\t\t} else if (runDataExecuted.status === 'canceled') {\n\t\t\t\trunDataExecutedErrorMessage = i18n.baseText(\n\t\t\t\t\t'executionsList.showMessage.stopExecution.message',\n\t\t\t\t\t{\n\t\t\t\t\t\tinterpolate: { activeExecutionId },\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst lineNumber = runDataExecuted?.data?.resultData?.error?.lineNumber;\n\n\t\t\tcodeNodeEditorEventBus.emit('error-line-number', lineNumber || 'final');\n\n\t\t\tconst workflow = workflowHelpers.getCurrentWorkflow();\n\t\t\tif (runDataExecuted.waitTill !== undefined) {\n\t\t\t\tconst workflowSettings = workflowsStore.workflowSettings;\n\t\t\t\tconst saveManualExecutions = settingsStore.saveManualExecutions;\n\n\t\t\t\tconst isSavingExecutions =\n\t\t\t\t\tworkflowSettings.saveManualExecutions === undefined\n\t\t\t\t\t\t? saveManualExecutions\n\t\t\t\t\t\t: workflowSettings.saveManualExecutions;\n\n\t\t\t\tlet action;\n\t\t\t\tif (!isSavingExecutions) {\n\t\t\t\t\tglobalLinkActionsEventBus.emit('registerGlobalLinkAction', {\n\t\t\t\t\t\tkey: 'open-settings',\n\t\t\t\t\t\taction: async () => {\n\t\t\t\t\t\t\tif (workflowsStore.isNewWorkflow) await workflowHelpers.saveAsNewWorkflow();\n\t\t\t\t\t\t\tuiStore.openModal(WORKFLOW_SETTINGS_MODAL_KEY);\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\n\t\t\t\t\taction =\n\t\t\t\t\t\t'<a data-action=\"open-settings\">Turn on saving manual executions</a> and run again to see what happened after this node.';\n\t\t\t\t} else {\n\t\t\t\t\taction = `<a href=\"/workflow/${workflow.id}/executions/${activeExecutionId}\">View the execution</a> to see what happened after this node.`;\n\t\t\t\t}\n\n\t\t\t\t// Workflow did start but had been put to wait\n\t\t\t\ttitleChange.titleSet(workflow.name as string, 'IDLE');\n\t\t\t\ttoast.showToast({\n\t\t\t\t\ttitle: 'Workflow started waiting',\n\t\t\t\t\tmessage: `${action} <a href=\"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.wait/\" target=\"_blank\">More info</a>`,\n\t\t\t\t\ttype: 'success',\n\t\t\t\t\tduration: 0,\n\t\t\t\t});\n\t\t\t} else if (runDataExecuted.finished !== true) {\n\t\t\t\ttitleChange.titleSet(workflow.name as string, 'ERROR');\n\n\t\t\t\tif (\n\t\t\t\t\trunDataExecuted.data.resultData.error?.name === 'ExpressionError' &&\n\t\t\t\t\t(runDataExecuted.data.resultData.error as ExpressionError).context.functionality ===\n\t\t\t\t\t\t'pairedItem'\n\t\t\t\t) {\n\t\t\t\t\tconst error = runDataExecuted.data.resultData.error as ExpressionError;\n\n\t\t\t\t\tvoid workflowHelpers.getWorkflowDataToSave().then((workflowData) => {\n\t\t\t\t\t\tconst eventData: IDataObject = {\n\t\t\t\t\t\t\tcaused_by_credential: false,\n\t\t\t\t\t\t\terror_message: error.description,\n\t\t\t\t\t\t\terror_title: error.message,\n\t\t\t\t\t\t\terror_type: error.context.type,\n\t\t\t\t\t\t\tnode_graph_string: JSON.stringify(\n\t\t\t\t\t\t\t\tTelemetryHelpers.generateNodesGraph(\n\t\t\t\t\t\t\t\t\tworkflowData as IWorkflowBase,\n\t\t\t\t\t\t\t\t\tworkflowHelpers.getNodeTypes(),\n\t\t\t\t\t\t\t\t).nodeGraph,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tworkflow_id: workflowsStore.workflowId,\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\terror.context.nodeCause &&\n\t\t\t\t\t\t\t['paired_item_no_info', 'paired_item_invalid_info'].includes(\n\t\t\t\t\t\t\t\terror.context.type as string,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tconst node = workflow.getNode(error.context.nodeCause as string);\n\n\t\t\t\t\t\t\tif (node) {\n\t\t\t\t\t\t\t\teventData.is_pinned = !!workflow.getPinDataOfNode(node.name);\n\t\t\t\t\t\t\t\teventData.mode = node.parameters.mode;\n\t\t\t\t\t\t\t\teventData.node_type = node.type;\n\t\t\t\t\t\t\t\teventData.operation = node.parameters.operation;\n\t\t\t\t\t\t\t\teventData.resource = node.parameters.resource;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttelemetry.track('Instance FE emitted paired item error', eventData, {\n\t\t\t\t\t\t\twithPostHog: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (runDataExecuted.data.resultData.error?.name === 'SubworkflowOperationError') {\n\t\t\t\t\tconst error = runDataExecuted.data.resultData.error as SubworkflowOperationError;\n\n\t\t\t\t\tworkflowsStore.subWorkflowExecutionError = error;\n\n\t\t\t\t\ttoast.showMessage({\n\t\t\t\t\t\ttitle: error.message,\n\t\t\t\t\t\tmessage: error.description,\n\t\t\t\t\t\ttype: 'error',\n\t\t\t\t\t\tduration: 0,\n\t\t\t\t\t});\n\t\t\t\t} else if (\n\t\t\t\t\trunDataExecuted.data.resultData.error?.name === 'NodeOperationError' &&\n\t\t\t\t\t(runDataExecuted.data.resultData.error as NodeOperationError).functionality ===\n\t\t\t\t\t\t'configuration-node'\n\t\t\t\t) {\n\t\t\t\t\t// If the error is a configuration error of the node itself doesn't get executed so we can't use lastNodeExecuted for the title\n\t\t\t\t\tlet title: string;\n\t\t\t\t\tconst nodeError = runDataExecuted.data.resultData.error as NodeOperationError;\n\t\t\t\t\tif (nodeError.node.name) {\n\t\t\t\t\t\ttitle = `Error in sub-node ‘${nodeError.node.name}‘`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttitle = 'Problem executing workflow';\n\t\t\t\t\t}\n\n\t\t\t\t\ttoast.showMessage({\n\t\t\t\t\t\ttitle,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t(nodeError?.description ?? runDataExecutedErrorMessage) +\n\t\t\t\t\t\t\ti18n.baseText('pushConnection.executionError.openNode', {\n\t\t\t\t\t\t\t\tinterpolate: {\n\t\t\t\t\t\t\t\t\tnode: nodeError.node.name,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\ttype: 'error',\n\t\t\t\t\t\tduration: 0,\n\t\t\t\t\t\tdangerouslyUseHTMLString: true,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tlet title: string;\n\t\t\t\t\tconst isManualExecutionCancelled =\n\t\t\t\t\t\trunDataExecuted.mode === 'manual' && runDataExecuted.status === 'canceled';\n\n\t\t\t\t\t// Do not show the error message if the workflow got canceled manually\n\t\t\t\t\tif (isManualExecutionCancelled) {\n\t\t\t\t\t\ttoast.showMessage({\n\t\t\t\t\t\t\ttitle: i18n.baseText('nodeView.showMessage.stopExecutionTry.title'),\n\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (runDataExecuted.data.resultData.lastNodeExecuted) {\n\t\t\t\t\t\t\ttitle = `Problem in node ‘${runDataExecuted.data.resultData.lastNodeExecuted}‘`;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttitle = 'Problem executing workflow';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttoast.showMessage({\n\t\t\t\t\t\t\ttitle,\n\t\t\t\t\t\t\tmessage: runDataExecutedErrorMessage,\n\t\t\t\t\t\t\ttype: 'error',\n\t\t\t\t\t\t\tduration: 0,\n\t\t\t\t\t\t\tdangerouslyUseHTMLString: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Workflow did execute without a problem\n\t\t\t\ttitleChange.titleSet(workflow.name as string, 'IDLE');\n\n\t\t\t\tconst execution = workflowsStore.getWorkflowExecution;\n\t\t\t\tif (execution?.executedNode) {\n\t\t\t\t\tconst node = workflowsStore.getNodeByName(execution.executedNode);\n\t\t\t\t\tconst nodeType = node && nodeTypesStore.getNodeType(node.type, node.typeVersion);\n\t\t\t\t\tconst nodeOutput =\n\t\t\t\t\t\texecution &&\n\t\t\t\t\t\texecution.executedNode &&\n\t\t\t\t\t\texecution.data?.resultData?.runData?.[execution.executedNode];\n\t\t\t\t\tif (nodeType?.polling && !nodeOutput) {\n\t\t\t\t\t\ttoast.showMessage({\n\t\t\t\t\t\t\ttitle: i18n.baseText('pushConnection.pollingNode.dataNotFound', {\n\t\t\t\t\t\t\t\tinterpolate: {\n\t\t\t\t\t\t\t\t\tservice: getTriggerNodeServiceName(nodeType),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tmessage: i18n.baseText('pushConnection.pollingNode.dataNotFound.message', {\n\t\t\t\t\t\t\t\tinterpolate: {\n\t\t\t\t\t\t\t\t\tservice: getTriggerNodeServiceName(nodeType),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttoast.showMessage({\n\t\t\t\t\t\t\ttitle: i18n.baseText('pushConnection.nodeExecutedSuccessfully'),\n\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttoast.showMessage({\n\t\t\t\t\t\ttitle: i18n.baseText('pushConnection.workflowExecutedSuccessfully'),\n\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// It does not push the runData as it got already pushed with each\n\t\t\t// node that did finish. For that reason copy in here the data\n\t\t\t// which we already have.\n\t\t\tif (workflowsStore.getWorkflowRunData) {\n\t\t\t\trunDataExecuted.data.resultData.runData = workflowsStore.getWorkflowRunData;\n\t\t\t}\n\n\t\t\tworkflowsStore.executingNode.length = 0;\n\t\t\tworkflowsStore.setWorkflowExecutionData(runDataExecuted as IExecutionResponse);\n\t\t\tuiStore.removeActiveAction('workflowRunning');\n\n\t\t\t// Set the node execution issues on all the nodes which produced an error so that\n\t\t\t// it can be displayed in the node-view\n\t\t\tnodeHelpers.updateNodesExecutionIssues();\n\n\t\t\tconst lastNodeExecuted: string | undefined = runDataExecuted.data.resultData.lastNodeExecuted;\n\t\t\tlet itemsCount = 0;\n\t\t\tif (\n\t\t\t\tlastNodeExecuted &&\n\t\t\t\trunDataExecuted.data.resultData.runData[lastNodeExecuted] &&\n\t\t\t\t!runDataExecutedErrorMessage\n\t\t\t) {\n\t\t\t\titemsCount =\n\t\t\t\t\trunDataExecuted.data.resultData.runData[lastNodeExecuted][0].data!.main[0]!.length;\n\t\t\t}\n\n\t\t\tvoid useExternalHooks().run('pushConnection.executionFinished', {\n\t\t\t\titemsCount,\n\t\t\t\tnodeName: runDataExecuted.data.resultData.lastNodeExecuted,\n\t\t\t\terrorMessage: runDataExecutedErrorMessage,\n\t\t\t\trunDataExecutedStartData: runDataExecuted.data.startData,\n\t\t\t\tresultDataError: runDataExecuted.data.resultData.error,\n\t\t\t});\n\t\t\tif (!runDataExecuted.data.resultData.error) {\n\t\t\t\tsegmentStore.trackSuccessfulWorkflowExecution(runDataExecuted);\n\t\t\t}\n\t\t} else if (receivedData.type === 'executionStarted') {\n\t\t\tconst pushData = receivedData.data;\n\n\t\t\tconst executionData: IExecutionsCurrentSummaryExtended = {\n\t\t\t\tid: pushData.executionId,\n\t\t\t\tfinished: false,\n\t\t\t\tmode: pushData.mode,\n\t\t\t\tstartedAt: pushData.startedAt,\n\t\t\t\tretryOf: pushData.retryOf,\n\t\t\t\tworkflowId: pushData.workflowId,\n\t\t\t\tworkflowName: pushData.workflowName,\n\t\t\t};\n\n\t\t\tworkflowsStore.addActiveExecution(executionData);\n\t\t} else if (receivedData.type === 'nodeExecuteAfter') {\n\t\t\t// A node finished to execute. Add its data\n\t\t\tconst pushData = receivedData.data;\n\t\t\tworkflowsStore.addNodeExecutionData(pushData);\n\t\t\tworkflowsStore.removeExecutingNode(pushData.nodeName);\n\t\t} else if (receivedData.type === 'nodeExecuteBefore') {\n\t\t\t// A node started to be executed. Set it as executing.\n\t\t\tconst pushData = receivedData.data;\n\t\t\tworkflowsStore.addExecutingNode(pushData.nodeName);\n\t\t} else if (receivedData.type === 'testWebhookDeleted') {\n\t\t\t// A test-webhook was deleted\n\t\t\tconst pushData = receivedData.data;\n\n\t\t\tif (pushData.workflowId === workflowsStore.workflowId) {\n\t\t\t\tworkflowsStore.executionWaitingForWebhook = false;\n\t\t\t\tuiStore.removeActiveAction('workflowRunning');\n\t\t\t}\n\t\t} else if (receivedData.type === 'testWebhookReceived') {\n\t\t\t// A test-webhook did get called\n\t\t\tconst pushData = receivedData.data;\n\n\t\t\tif (pushData.workflowId === workflowsStore.workflowId) {\n\t\t\t\tworkflowsStore.executionWaitingForWebhook = false;\n\t\t\t\tworkflowsStore.activeExecutionId = pushData.executionId;\n\t\t\t}\n\n\t\t\tvoid processWaitingPushMessages();\n\t\t} else if (receivedData.type === 'reloadNodeType') {\n\t\t\tawait nodeTypesStore.getNodeTypes();\n\t\t\tawait nodeTypesStore.getFullNodesProperties([receivedData.data]);\n\t\t} else if (receivedData.type === 'removeNodeType') {\n\t\t\tconst pushData = receivedData.data;\n\n\t\t\tconst nodesToBeRemoved: INodeTypeNameVersion[] = [pushData];\n\n\t\t\t// Force reload of all credential types\n\t\t\tawait credentialsStore.fetchCredentialTypes(false).then(() => {\n\t\t\t\tnodeTypesStore.removeNodeTypes(nodesToBeRemoved as INodeTypeDescription[]);\n\t\t\t});\n\t\t} else if (receivedData.type === 'nodeDescriptionUpdated') {\n\t\t\tawait nodeTypesStore.getNodeTypes();\n\t\t\tawait credentialsStore.fetchCredentialTypes(true);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfunction getExecutionError(data: IRunExecutionData | IExecuteContextData) {\n\t\tconst error = data.resultData.error;\n\n\t\tlet errorMessage: string;\n\n\t\tif (data.resultData.lastNodeExecuted && error) {\n\t\t\terrorMessage = error.message || error.description;\n\t\t} else {\n\t\t\terrorMessage = i18n.baseText('pushConnection.executionError', {\n\t\t\t\tinterpolate: { error: '!' },\n\t\t\t});\n\n\t\t\tif (error?.message) {\n\t\t\t\tlet nodeName: string | undefined;\n\t\t\t\tif ('node' in error) {\n\t\t\t\t\tnodeName = typeof error.node === 'string' ? error.node : error.node!.name;\n\t\t\t\t}\n\n\t\t\t\tconst receivedError = nodeName ? `${nodeName}: ${error.message}` : error.message;\n\t\t\t\terrorMessage = i18n.baseText('pushConnection.executionError', {\n\t\t\t\t\tinterpolate: {\n\t\t\t\t\t\terror: `.${i18n.baseText('pushConnection.executionError.details', {\n\t\t\t\t\t\t\tinterpolate: {\n\t\t\t\t\t\t\t\tdetails: receivedError,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t})}`,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn errorMessage;\n\t}\n\n\treturn {\n\t\tinitialize,\n\t\tterminate,\n\t\tpushMessageReceived,\n\t\tqueuePushMessage,\n\t\tprocessWaitingPushMessages,\n\t\tpushMessageQueue,\n\t\tremoveEventListener,\n\t\tretryTimeout,\n\t};\n}\n"],"names":["GET_STATUS_ENDPOINT","sendGetWorkerStatus","context","makeRestApiRequest","WORKER_HISTORY_LENGTH","STALE_SECONDS","useOrchestrationStore","defineStore","data","id","rootStore","useRootStore","workerId","usePushConnection","router","workflowHelpers","useWorkflowHelpers","nodeHelpers","useNodeHelpers","titleChange","useTitleChange","toast","useToast","i18n","useI18n","telemetry","useTelemetry","collaborationStore","useCollaborationStore","credentialsStore","useCredentialsStore","nodeTypesStore","useNodeTypesStore","orchestrationManagerStore","pushStore","usePushConnectionStore","settingsStore","useSettingsStore","segmentStore","useSegment","uiStore","useUIStore","workflowsStore","useWorkflowsStore","retryTimeout","ref","pushMessageQueue","removeEventListener","initialize","message","pushMessageReceived","terminate","queuePushMessage","event","retryAttempts","processWaitingPushMessages","queueLength","i","messageData","receivedData","isRetry","pushData","recoveredPushData","recoveredExecutionId","_a","executionData","parse","iRunExecutionData","_b","_c","_d","_e","activeRunData","_h","_g","_f","key","iRun","_i","activeExecutionId","_l","_k","_j","_s","_r","_q","_p","_o","_n","_m","runDataExecuted","runDataExecutedErrorMessage","getExecutionError","lineNumber","_v","_u","_t","codeNodeEditorEventBus","workflow","workflowSettings","saveManualExecutions","isSavingExecutions","action","globalLinkActionsEventBus","WORKFLOW_SETTINGS_MODAL_KEY","_w","error","workflowData","eventData","TelemetryHelpers.generateNodesGraph","node","_x","_y","title","nodeError","execution","nodeType","nodeOutput","_B","_A","_z","getTriggerNodeServiceName","lastNodeExecuted","itemsCount","useExternalHooks","nodesToBeRemoved","errorMessage","nodeName","receivedError"],"mappings":"saAGA,MAAMA,GAAsB,+BAEfC,GAAsB,MAAOC,GAA4C,CAC/E,MAAAC,GAAmBD,EAAS,OAAQF,EAAmB,CAC9D,ECFaI,GAAwB,IAC/BC,GAAgB,IAAM,IAiBfC,GAAwBC,GAAY,uBAAwB,CACxE,MAAO,KAAiC,CACvC,sBAAuB,GACvB,QAAS,CAAC,EACV,eAAgB,CAAC,EACjB,mBAAoB,CAAC,EACrB,eAAgB,IAAA,GAEjB,QAAS,CACR,mBAAmBC,EAAoC,CACjD,KAAA,QAAQA,EAAK,QAAQ,EAAIA,EACzB,KAAK,eAAeA,EAAK,QAAQ,IACrC,KAAK,eAAeA,EAAK,QAAQ,EAAI,CAAA,GAEjC,KAAA,eAAe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