n8n-editor-ui 1.22.0 → 1.22.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.
Files changed (126) hide show
  1. package/.turbo/turbo-build.log +62 -62
  2. package/dist/assets/{AuthView-_5lvIORY.js → AuthView--On8E3VP.js} +2 -2
  3. package/dist/assets/{AuthView-_5lvIORY.js.map → AuthView--On8E3VP.js.map} +1 -1
  4. package/dist/assets/{CanvasControls-_S6dAUFr.js → CanvasControls-ebFBI-_5.js} +2 -2
  5. package/dist/assets/{CanvasControls-_S6dAUFr.js.map → CanvasControls-ebFBI-_5.js.map} +1 -1
  6. package/dist/assets/{ChangePasswordView-Gto324pL.js → ChangePasswordView-gj93rkzc.js} +2 -2
  7. package/dist/assets/{ChangePasswordView-Gto324pL.js.map → ChangePasswordView-gj93rkzc.js.map} +1 -1
  8. package/dist/assets/{CollectionParameter-ThiBAc6J.js → CollectionParameter-V1n0L6ao.js} +2 -2
  9. package/dist/assets/CollectionParameter-V1n0L6ao.js.map +1 -0
  10. package/dist/assets/{CredentialsView-WF2GuXwX.js → CredentialsView-9Nq2fOpi.js} +2 -2
  11. package/dist/assets/{CredentialsView-WF2GuXwX.js.map → CredentialsView-9Nq2fOpi.js.map} +1 -1
  12. package/dist/assets/{ExecutionFilter-6e5m1hky.js → ExecutionFilter-dfrYJ_Rf.js} +2 -2
  13. package/dist/assets/{ExecutionFilter-6e5m1hky.js.map → ExecutionFilter-dfrYJ_Rf.js.map} +1 -1
  14. package/dist/assets/{ExecutionPreview-qQdwo4nO.js → ExecutionPreview-yFW7oTRf.js} +2 -2
  15. package/dist/assets/{ExecutionPreview-qQdwo4nO.js.map → ExecutionPreview-yFW7oTRf.js.map} +1 -1
  16. package/dist/assets/{ExecutionsInfoAccordion-HQZywboM.js → ExecutionsInfoAccordion-EztI4QOE.js} +2 -2
  17. package/dist/assets/{ExecutionsInfoAccordion-HQZywboM.js.map → ExecutionsInfoAccordion-EztI4QOE.js.map} +1 -1
  18. package/dist/assets/{ExecutionsLandingPage-FEiybFSK.js → ExecutionsLandingPage-ygQGHLu2.js} +2 -2
  19. package/dist/assets/{ExecutionsLandingPage-FEiybFSK.js.map → ExecutionsLandingPage-ygQGHLu2.js.map} +1 -1
  20. package/dist/assets/{ExecutionsList-9Pc2Zrql.js → ExecutionsList-H9VKc4jb.js} +2 -2
  21. package/dist/assets/{ExecutionsList-9Pc2Zrql.js.map → ExecutionsList-H9VKc4jb.js.map} +1 -1
  22. package/dist/assets/{ExecutionsView-Li55aBU0.js → ExecutionsView-NdkXn6EA.js} +2 -2
  23. package/dist/assets/{ExecutionsView-Li55aBU0.js.map → ExecutionsView-NdkXn6EA.js.map} +1 -1
  24. package/dist/assets/{FixedCollectionParameter-d68rB1aT.js → FixedCollectionParameter-tJFyljoK.js} +3 -3
  25. package/dist/assets/{FixedCollectionParameter-d68rB1aT.js.map → FixedCollectionParameter-tJFyljoK.js.map} +1 -1
  26. package/dist/assets/{ForgotMyPasswordView-3lTe1SvY.js → ForgotMyPasswordView-VxAVQQgB.js} +2 -2
  27. package/dist/assets/{ForgotMyPasswordView-3lTe1SvY.js.map → ForgotMyPasswordView-VxAVQQgB.js.map} +1 -1
  28. package/dist/assets/{MainHeader-wtrPt4Uz.js → MainHeader-luMJdQn2.js} +2 -2
  29. package/dist/assets/{MainHeader-wtrPt4Uz.js.map → MainHeader-luMJdQn2.js.map} +1 -1
  30. package/dist/assets/{MainSidebar-dKXNC9E9.js → MainSidebar-nf-k1wHF.js} +2 -2
  31. package/dist/assets/{MainSidebar-dKXNC9E9.js.map → MainSidebar-nf-k1wHF.js.map} +1 -1
  32. package/dist/assets/{NodeCreation-lpcdOti7.js → NodeCreation-RvlbocPg.js} +3 -3
  33. package/dist/assets/{NodeCreation-lpcdOti7.js.map → NodeCreation-RvlbocPg.js.map} +1 -1
  34. package/dist/assets/{NodeCreator-YAF-VpA5.js → NodeCreator-zDLKC62A.js} +2 -2
  35. package/dist/assets/{NodeCreator-YAF-VpA5.js.map → NodeCreator-zDLKC62A.js.map} +1 -1
  36. package/dist/assets/{NodeList-8URsrxUQ.js → NodeList-U4qs88M0.js} +2 -2
  37. package/dist/assets/{NodeList-8URsrxUQ.js.map → NodeList-U4qs88M0.js.map} +1 -1
  38. package/dist/assets/{NodeView-caDno-kw.js → NodeView-fUdpq96X.js} +3 -3
  39. package/dist/assets/{NodeView-caDno-kw.js.map → NodeView-fUdpq96X.js.map} +1 -1
  40. package/dist/assets/{ResourcesListLayout-N4zg03Vf.js → ResourcesListLayout-y5FSwJeu.js} +2 -2
  41. package/dist/assets/{ResourcesListLayout-N4zg03Vf.js.map → ResourcesListLayout-y5FSwJeu.js.map} +1 -1
  42. package/dist/assets/{RunDataAi-EdxjRrVc.js → RunDataAi-dgEyN_Yl.js} +2 -2
  43. package/dist/assets/{RunDataAi-EdxjRrVc.js.map → RunDataAi-dgEyN_Yl.js.map} +1 -1
  44. package/dist/assets/{RunDataJson-wqxHrAY5.js → RunDataJson-RuNn5FTw.js} +3 -3
  45. package/dist/assets/{RunDataJson-wqxHrAY5.js.map → RunDataJson-RuNn5FTw.js.map} +1 -1
  46. package/dist/assets/{RunDataJsonActions-MfJV4quL.js → RunDataJsonActions-wMN8ObC3.js} +2 -2
  47. package/dist/assets/{RunDataJsonActions-MfJV4quL.js.map → RunDataJsonActions-wMN8ObC3.js.map} +1 -1
  48. package/dist/assets/{RunDataSchema-rxgd4Q_M.js → RunDataSchema-NrdiV0Bv.js} +2 -2
  49. package/dist/assets/{RunDataSchema-rxgd4Q_M.js.map → RunDataSchema-NrdiV0Bv.js.map} +1 -1
  50. package/dist/assets/{RunDataTable-2IMpD8oi.js → RunDataTable-vThTeakV.js} +2 -2
  51. package/dist/assets/{RunDataTable-2IMpD8oi.js.map → RunDataTable-vThTeakV.js.map} +1 -1
  52. package/dist/assets/{SamlOnboarding-RIlvbmgY.js → SamlOnboarding-7ZeWtOoT.js} +2 -2
  53. package/dist/assets/{SamlOnboarding-RIlvbmgY.js.map → SamlOnboarding-7ZeWtOoT.js.map} +1 -1
  54. package/dist/assets/SettingsApiView-d7znGVgB.js +2 -0
  55. package/dist/assets/SettingsApiView-d7znGVgB.js.map +1 -0
  56. package/dist/assets/{SettingsCommunityNodesView-xqn73tJO.js → SettingsCommunityNodesView-U2OqH5_g.js} +2 -2
  57. package/dist/assets/{SettingsCommunityNodesView-xqn73tJO.js.map → SettingsCommunityNodesView-U2OqH5_g.js.map} +1 -1
  58. package/dist/assets/{SettingsExternalSecrets-yr_g8DWk.js → SettingsExternalSecrets-OK2zcF3w.js} +2 -2
  59. package/dist/assets/{SettingsExternalSecrets-yr_g8DWk.js.map → SettingsExternalSecrets-OK2zcF3w.js.map} +1 -1
  60. package/dist/assets/{SettingsFakeDoorView-ogkrrHSL.js → SettingsFakeDoorView-wbngwN3n.js} +2 -2
  61. package/dist/assets/{SettingsFakeDoorView-ogkrrHSL.js.map → SettingsFakeDoorView-wbngwN3n.js.map} +1 -1
  62. package/dist/assets/{SettingsLdapView-aWCvc1gM.js → SettingsLdapView-rYSjSdpv.js} +2 -2
  63. package/dist/assets/{SettingsLdapView-aWCvc1gM.js.map → SettingsLdapView-rYSjSdpv.js.map} +1 -1
  64. package/dist/assets/{SettingsLogStreamingView-IdWAQAEz.js → SettingsLogStreamingView-r4yJe9rt.js} +2 -2
  65. package/dist/assets/{SettingsLogStreamingView-IdWAQAEz.js.map → SettingsLogStreamingView-r4yJe9rt.js.map} +1 -1
  66. package/dist/assets/{SettingsSourceControl-s8B2f1Et.js → SettingsSourceControl-2sJrfiQZ.js} +2 -2
  67. package/dist/assets/{SettingsSourceControl-s8B2f1Et.js.map → SettingsSourceControl-2sJrfiQZ.js.map} +1 -1
  68. package/dist/assets/{SettingsSso-xhUlnU8v.js → SettingsSso-F08fTaoT.js} +2 -2
  69. package/dist/assets/{SettingsSso-xhUlnU8v.js.map → SettingsSso-F08fTaoT.js.map} +1 -1
  70. package/dist/assets/{SettingsUsageAndPlan-qguburG-.js → SettingsUsageAndPlan-P3NemeAe.js} +2 -2
  71. package/dist/assets/{SettingsUsageAndPlan-qguburG-.js.map → SettingsUsageAndPlan-P3NemeAe.js.map} +1 -1
  72. package/dist/assets/{SettingsUsersView-mRes9Qkr.js → SettingsUsersView-qkwybUvB.js} +2 -2
  73. package/dist/assets/{SettingsUsersView-mRes9Qkr.js.map → SettingsUsersView-qkwybUvB.js.map} +1 -1
  74. package/dist/assets/{SettingsView-3Vqg8kdv.js → SettingsView-9Bw0MXcT.js} +2 -2
  75. package/dist/assets/{SettingsView-3Vqg8kdv.js.map → SettingsView-9Bw0MXcT.js.map} +1 -1
  76. package/dist/assets/{SetupView-RR2VulZH.js → SetupView-s0yzV7Gm.js} +2 -2
  77. package/dist/assets/{SetupView-RR2VulZH.js.map → SetupView-s0yzV7Gm.js.map} +1 -1
  78. package/dist/assets/{SetupWorkflowFromTemplateView-BbMhs31Z.js → SetupWorkflowFromTemplateView-6De7ws36.js} +2 -2
  79. package/dist/assets/{SetupWorkflowFromTemplateView-BbMhs31Z.js.map → SetupWorkflowFromTemplateView-6De7ws36.js.map} +1 -1
  80. package/dist/assets/{SigninView-hIeIEews.js → SigninView-QvYhHXWz.js} +2 -2
  81. package/dist/assets/{SigninView-hIeIEews.js.map → SigninView-QvYhHXWz.js.map} +1 -1
  82. package/dist/assets/{SignupView-iaO_BXyp.js → SignupView-ZLqXA-fI.js} +2 -2
  83. package/dist/assets/{SignupView-iaO_BXyp.js.map → SignupView-ZLqXA-fI.js.map} +1 -1
  84. package/dist/assets/{TemplateDetails-HasVFCUO.js → TemplateDetails-qWnefMYx.js} +2 -2
  85. package/dist/assets/{TemplateDetails-HasVFCUO.js.map → TemplateDetails-qWnefMYx.js.map} +1 -1
  86. package/dist/assets/{TemplateList-uT0I7BC-.js → TemplateList-Ek8NkQLd.js} +2 -2
  87. package/dist/assets/{TemplateList-uT0I7BC-.js.map → TemplateList-Ek8NkQLd.js.map} +1 -1
  88. package/dist/assets/{TemplatesCollectionView-WwdzPK0w.js → TemplatesCollectionView-xoRz-QfG.js} +2 -2
  89. package/dist/assets/{TemplatesCollectionView-WwdzPK0w.js.map → TemplatesCollectionView-xoRz-QfG.js.map} +1 -1
  90. package/dist/assets/{TemplatesInfoCarousel-WUt6CUAt.js → TemplatesInfoCarousel-TKGxiVaR.js} +2 -2
  91. package/dist/assets/{TemplatesInfoCarousel-WUt6CUAt.js.map → TemplatesInfoCarousel-TKGxiVaR.js.map} +1 -1
  92. package/dist/assets/{TemplatesSearchView-pwVBF7_m.js → TemplatesSearchView-gwbhQE6_.js} +2 -2
  93. package/dist/assets/{TemplatesSearchView-pwVBF7_m.js.map → TemplatesSearchView-gwbhQE6_.js.map} +1 -1
  94. package/dist/assets/{TemplatesWorkflowView-OxfZO4yX.js → TemplatesWorkflowView-VbJuwYVl.js} +2 -2
  95. package/dist/assets/{TemplatesWorkflowView-OxfZO4yX.js.map → TemplatesWorkflowView-VbJuwYVl.js.map} +1 -1
  96. package/dist/assets/{VariablesView-O1dh47w6.js → VariablesView-ZNxPDs_G.js} +2 -2
  97. package/dist/assets/{VariablesView-O1dh47w6.js.map → VariablesView-ZNxPDs_G.js.map} +1 -1
  98. package/dist/assets/{WorkerView-ehe17h1Q.js → WorkerView-Rzm_p5Pv.js} +2 -2
  99. package/dist/assets/{WorkerView-ehe17h1Q.js.map → WorkerView-Rzm_p5Pv.js.map} +1 -1
  100. package/dist/assets/{WorkflowActivator-EK3d11st.js → WorkflowActivator-H10vhdIV.js} +2 -2
  101. package/dist/assets/{WorkflowActivator-EK3d11st.js.map → WorkflowActivator-H10vhdIV.js.map} +1 -1
  102. package/dist/assets/{WorkflowHistory-mqWH3nQZ.js → WorkflowHistory-diO3ekal.js} +2 -2
  103. package/dist/assets/{WorkflowHistory-mqWH3nQZ.js.map → WorkflowHistory-diO3ekal.js.map} +1 -1
  104. package/dist/assets/{WorkflowOnboardingView-LZfOfbX4.js → WorkflowOnboardingView-gUVzVQsZ.js} +2 -2
  105. package/dist/assets/{WorkflowOnboardingView-LZfOfbX4.js.map → WorkflowOnboardingView-gUVzVQsZ.js.map} +1 -1
  106. package/dist/assets/{WorkflowsView-NL0wKv4C.js → WorkflowsView-Qqq1sZTo.js} +2 -2
  107. package/dist/assets/{WorkflowsView-NL0wKv4C.js.map → WorkflowsView-Qqq1sZTo.js.map} +1 -1
  108. package/dist/assets/{cloud-JhkwKZAE.js → cloud-g7GqwUFZ.js} +2 -2
  109. package/dist/assets/{cloud-JhkwKZAE.js.map → cloud-g7GqwUFZ.js.map} +1 -1
  110. package/dist/assets/{executionsHelpers-Gkj6bYJi.js → executionsHelpers-gnbzcx5j.js} +2 -2
  111. package/dist/assets/{executionsHelpers-Gkj6bYJi.js.map → executionsHelpers-gnbzcx5j.js.map} +1 -1
  112. package/dist/assets/{index--RuZ5wHr.js → index-RXjMHIPR.js} +11 -11
  113. package/dist/assets/{index--RuZ5wHr.js.map → index-RXjMHIPR.js.map} +1 -1
  114. package/dist/assets/{pushConnection-UpdxMjHa.js → pushConnection-HdjAqr4R.js} +2 -2
  115. package/dist/assets/{pushConnection-UpdxMjHa.js.map → pushConnection-HdjAqr4R.js.map} +1 -1
  116. package/dist/assets/{templateActions-CZfTXoBx.js → templateActions-y8msVyEB.js} +2 -2
  117. package/dist/assets/{templateActions-CZfTXoBx.js.map → templateActions-y8msVyEB.js.map} +1 -1
  118. package/dist/assets/{useExecutionDebugging-FPo5qMF0.js → useExecutionDebugging-Yog1CJXv.js} +2 -2
  119. package/dist/assets/{useExecutionDebugging-FPo5qMF0.js.map → useExecutionDebugging-Yog1CJXv.js.map} +1 -1
  120. package/dist/assets/{workflowActivate-FltKJaAB.js → workflowActivate-IRvCsxq5.js} +2 -2
  121. package/dist/assets/{workflowActivate-FltKJaAB.js.map → workflowActivate-IRvCsxq5.js.map} +1 -1
  122. package/dist/index.html +1 -1
  123. package/package.json +1 -1
  124. package/dist/assets/CollectionParameter-ThiBAc6J.js.map +0 -1
  125. package/dist/assets/SettingsApiView-_7qUJ2zm.js +0 -2
  126. package/dist/assets/SettingsApiView-_7qUJ2zm.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{J as V,w as j,af as J}from"./index--RuZ5wHr.js";import{Q as K,v as Y,cT as z,o as X,t as Z,B as ee,u as te,z as se,y as oe,aD as re,dJ as ae,d5 as ie,cV as ne,d9 as q,ab as ue}from"./n8n-ZKR6bms9.js";import{d as le,m as de}from"./pinia-jX93eZRS.js";import{p as ce}from"./flatted-jPn12Tq4.js";import{u as he,a as we}from"./collaboration.store-ba_Vl3Ko.js";import{G as fe}from"./vendor-2CfOYFi2.js";const pe="/orchestration/worker/status",ke=async e=>{await K(e,"POST",pe)},ge=100,me=120*1e3,Se=le("orchestrationManager",{state:()=>({initialStatusReceived:!1,workers:{},workersHistory:{},workersLastUpdated:{},statusInterval:null}),actions:{updateWorkerStatus(e){this.workers[e.workerId]=e,this.workersHistory[e.workerId]||(this.workersHistory[e.workerId]=[]),this.workersHistory[e.workerId].push({data:e,timestamp:Date.now()}),this.workersHistory[e.workerId].length>ge&&this.workersHistory[e.workerId].shift(),this.workersLastUpdated[e.workerId]=Date.now(),this.initialStatusReceived=!0},removeStaleWorkers(){for(const e in this.workersLastUpdated)this.workersLastUpdated[e]+me<Date.now()&&(delete this.workers[e],delete this.workersHistory[e],delete this.workersLastUpdated[e])},startWorkerStatusPolling(){const e=Y();this.statusInterval||(this.statusInterval=setInterval(async()=>{await ke(e.getRestApiContext),this.removeStaleWorkers()},1e3))},stopWorkerStatusPolling(){this.statusInterval&&(clearInterval(this.statusInterval),this.statusInterval=null)},getWorkerLastUpdated(e){return this.workersLastUpdated[e]??0},getWorkerStatus(e){return this.workers[e]},getWorkerStatusHistory(e){return this.workersHistory[e]??[]}}}),De=fe({setup(){return{...z(),...X(),nodeHelpers:V()}},created(){this.pushStore.addEventListener(e=>{this.pushMessageReceived(e)})},mixins:[j],data(){return{retryTimeout:null,pushMessageQueue:[]}},computed:{...de(oe,se,te,ee,Z,J,Se,we,he),sessionId(){return this.rootStore.sessionId}},methods:{queuePushMessage(e,r){this.pushMessageQueue.push({message:e,retriesLeft:r}),this.retryTimeout===null&&(this.retryTimeout=setTimeout(this.processWaitingPushMessages,20))},async processWaitingPushMessages(){this.retryTimeout!==null&&(clearTimeout(this.retryTimeout),this.retryTimeout=null);const e=this.pushMessageQueue.length;for(let r=0;r<e;r++){const n=this.pushMessageQueue.shift();if(!await this.pushMessageReceived(n.message,!0)){n.retriesLeft-=1,n.retriesLeft>0&&this.pushMessageQueue.unshift(n);break}}this.pushMessageQueue.length!==0&&this.retryTimeout===null&&(this.retryTimeout=setTimeout(this.processWaitingPushMessages,25))},async pushMessageReceived(e,r){var f,g,m,S,x,y,E,T,I,N,D,v,M,W,A,b,R,C,L,$,P,H,O,_,U,F,B,G;if(e.type==="sendWorkerStatusMessage"){const s=e.data;return this.orchestrationManagerStore.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)&&r!==!0&&this.pushMessageQueue.length)return this.queuePushMessage(e,5),!1;if(e.type==="nodeExecuteAfter"||e.type==="nodeExecuteBefore"){if(!this.uiStore.isActionActive("workflowRunning"))return!1;const s=e.data;if(this.workflowsStore.activeExecutionId!==s.executionId)return r!==!0&&this.queuePushMessage(event,5),!1}let c;if(e.type==="executionRecovered"){const s=(f=e.data)==null?void 0:f.executionId;if(this.uiStore.isActionActive("workflowRunning")&&this.workflowsStore.activeExecutionId===s){const t=await this.workflowsStore.fetchExecutionDataById(this.workflowsStore.activeExecutionId);if(t!=null&&t.data){t.data=ce(t.data);const d={startData:(g=t.data)==null?void 0:g.startData,resultData:((m=t.data)==null?void 0:m.resultData)??{runData:{}},executionData:(S=t.data)==null?void 0:S.executionData};if(((x=this.workflowsStore.workflowExecutionData)==null?void 0:x.workflowId)===t.workflowId){const u=(T=(E=(y=this.workflowsStore.workflowExecutionData)==null?void 0:y.data)==null?void 0:E.resultData)==null?void 0:T.runData;if(u)for(const w of Object.keys(u))d.resultData.runData[w]=u[w]}const p={data:d,finished:t.finished,mode:t.mode,waitTill:(I=t.data)==null?void 0:I.waitTill,startedAt:t.startedAt,stoppedAt:t.stoppedAt,status:"crashed"};t.data&&(c={executionId:t.id,data:p})}}}if(e.type==="workflowFailedToActivate"&&this.workflowsStore.workflowId===e.data.workflowId)return this.workflowsStore.setWorkflowInactive(e.data.workflowId),this.workflowsStore.setActive(!1),this.showError(new Error(e.data.errorMessage),this.$locale.baseText("workflowActivator.showError.title",{interpolate:{newStateName:"activated"}})+":"),!0;if(e.type==="workflowActivated")return this.workflowsStore.setWorkflowActive(e.data.workflowId),!0;if(e.type==="workflowDeactivated")return this.workflowsStore.setWorkflowInactive(e.data.workflowId),!0;if(e.type==="executionFinished"||e.type==="executionRecovered"){let s;if(e.type==="executionRecovered"&&c!==void 0?s=c:s=e.data,this.workflowsStore.activeExecutionId===s.executionId){const o=(v=(D=(N=this.workflowsStore.workflowExecutionData)==null?void 0:N.data)==null?void 0:D.resultData)==null?void 0:v.runData;if(o)for(const a of Object.keys(o))((L=(C=(R=(b=(A=(W=(M=s.data.data.resultData.runData[a])==null?void 0:M[0])==null?void 0:W.data)==null?void 0:A.main)==null?void 0:b[0])==null?void 0:R[0])==null?void 0:C.json)==null?void 0:L.isArtificialRecoveredEventItem)===!0&&o[a].length>0&&(s.data.data.resultData.runData[a]=o[a]);this.workflowsStore.finishActiveExecution(s)}if(!this.uiStore.isActionActive("workflowRunning"))return!1;const{activeExecutionId:h}=this.workflowsStore;if(h!==s.executionId)return r!==!0&&this.queuePushMessage(event,5),!1;const t=s.data;let d=this.getExecutionError(t.data);t.status==="crashed"?d=this.$locale.baseText("pushConnection.executionFailed.message"):t.status==="canceled"&&(d=this.$locale.baseText("executionsList.showMessage.stopExecution.message",{interpolate:{activeExecutionId:h}}));const p=(H=(P=($=t==null?void 0:t.data)==null?void 0:$.resultData)==null?void 0:P.error)==null?void 0:H.lineNumber;re.emit("error-line-number",p||"final");const u=this.getCurrentWorkflow();if(t.waitTill!==void 0){const o=this.workflowsStore.activeExecutionId,a=this.workflowsStore.workflowSettings,i=this.rootStore.saveManualExecutions,l=a.saveManualExecutions===void 0?i:a.saveManualExecutions;let k;l?k=`<a href="/workflow/${u.id}/executions/${o}">View the execution</a> to see what happened after this node.`:(ae.emit("registerGlobalLinkAction",{key:"open-settings",action:async()=>{this.workflowsStore.isNewWorkflow&&await this.saveAsNewWorkflow(),this.uiStore.openModal(ie)}}),k='<a data-action="open-settings">Turn on saving manual executions</a> and run again to see what happened after this node.'),this.titleSet(u.name,"IDLE"),this.showToast({title:"Workflow started waiting",message:`${k} <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(this.titleSet(u.name,"ERROR"),((O=t.data.resultData.error)==null?void 0:O.name)==="ExpressionError"&&t.data.resultData.error.context.functionality==="pairedItem"){const o=t.data.resultData.error;this.getWorkflowDataToSave().then(a=>{const i={caused_by_credential:!1,error_message:o.description,error_title:o.message,error_type:o.context.type,node_graph_string:JSON.stringify(ne(a,this.getNodeTypes()).nodeGraph),workflow_id:this.workflowsStore.workflowId};if(o.context.nodeCause&&["no pairing info","invalid pairing info"].includes(o.context.type)){const l=u.getNode(o.context.nodeCause);l&&(i.is_pinned=!!u.getPinDataOfNode(l.name),i.mode=l.parameters.mode,i.node_type=l.type,i.operation=l.parameters.operation,i.resource=l.parameters.resource)}this.$telemetry.track("Instance FE emitted paired item error",i,{withPostHog:!0})})}if(((_=t.data.resultData.error)==null?void 0:_.name)==="SubworkflowOperationError"){const o=t.data.resultData.error;this.workflowsStore.subWorkflowExecutionError=o,this.showMessage({title:o.message,message:o.description,type:"error",duration:0})}else if(((U=t.data.resultData.error)==null?void 0:U.name)==="NodeOperationError"&&t.data.resultData.error.functionality==="configuration-node"){let o;const a=t.data.resultData.error;a.node.name?o=`Error in sub-node ‘${a.node.name}‘`:o="Problem executing workflow",this.showMessage({title:o,message:((a==null?void 0:a.description)??d)+this.$locale.baseText("pushConnection.executionError.openNode",{interpolate:{node:a.node.name}}),type:"error",duration:0,dangerouslyUseHTMLString:!0})}else{let o;t.mode==="manual"&&t.status==="canceled"?this.showMessage({title:this.$locale.baseText("nodeView.showMessage.stopExecutionTry.title"),type:"success"}):(t.data.resultData.lastNodeExecuted?o=`Problem in node ‘${t.data.resultData.lastNodeExecuted}‘`:o="Problem executing workflow",this.showMessage({title:o,message:d,type:"error",duration:0,dangerouslyUseHTMLString:!0}))}}else{this.titleSet(u.name,"IDLE");const o=this.workflowsStore.getWorkflowExecution;if(o!=null&&o.executedNode){const a=this.workflowsStore.getNodeByName(o.executedNode),i=a&&this.nodeTypesStore.getNodeType(a.type,a.typeVersion),l=o&&o.executedNode&&((G=(B=(F=o.data)==null?void 0:F.resultData)==null?void 0:B.runData)==null?void 0:G[o.executedNode]);i!=null&&i.polling&&!l?this.showMessage({title:this.$locale.baseText("pushConnection.pollingNode.dataNotFound",{interpolate:{service:q(i)}}),message:this.$locale.baseText("pushConnection.pollingNode.dataNotFound.message",{interpolate:{service:q(i)}}),type:"success"}):this.showMessage({title:this.$locale.baseText("pushConnection.nodeExecutedSuccessfully"),type:"success"})}else this.showMessage({title:this.$locale.baseText("pushConnection.workflowExecutedSuccessfully"),type:"success"})}this.workflowsStore.getWorkflowRunData&&(t.data.resultData.runData=this.workflowsStore.getWorkflowRunData),this.workflowsStore.executingNode.length=0,this.workflowsStore.setWorkflowExecutionData(t),this.uiStore.removeActiveAction("workflowRunning"),this.nodeHelpers.updateNodesExecutionIssues();const w=t.data.resultData.lastNodeExecuted;let Q=0;w&&t.data.resultData.runData[w]&&!d&&(Q=t.data.resultData.runData[w][0].data.main[0].length),ue().run("pushConnection.executionFinished",{itemsCount:Q,nodeName:t.data.resultData.lastNodeExecuted,errorMessage:d,runDataExecutedStartData:t.data.startData,resultDataError:t.data.resultData.error}),t.data.resultData.error||this.segmentStore.trackSuccessfulWorkflowExecution(t)}else if(e.type==="executionStarted"){const s=e.data,h={id:s.executionId,finished:!1,mode:s.mode,startedAt:s.startedAt,retryOf:s.retryOf,workflowId:s.workflowId,workflowName:s.workflowName};this.workflowsStore.addActiveExecution(h)}else if(e.type==="nodeExecuteAfter"){const s=e.data;this.workflowsStore.addNodeExecutionData(s),this.workflowsStore.removeExecutingNode(s.nodeName)}else if(e.type==="nodeExecuteBefore"){const s=e.data;this.workflowsStore.addExecutingNode(s.nodeName)}else if(e.type==="testWebhookDeleted")e.data.workflowId===this.workflowsStore.workflowId&&(this.workflowsStore.executionWaitingForWebhook=!1,this.uiStore.removeActiveAction("workflowRunning"));else if(e.type==="testWebhookReceived"){const s=e.data;s.workflowId===this.workflowsStore.workflowId&&(this.workflowsStore.executionWaitingForWebhook=!1,this.workflowsStore.activeExecutionId=s.executionId),this.processWaitingPushMessages()}else if(e.type==="reloadNodeType")await this.nodeTypesStore.getNodeTypes(),await this.nodeTypesStore.getFullNodesProperties([e.data]);else if(e.type==="removeNodeType"){const h=[e.data];await this.credentialsStore.fetchCredentialTypes(!1).then(()=>{this.nodeTypesStore.removeNodeTypes(h)})}else e.type==="nodeDescriptionUpdated"&&(await this.nodeTypesStore.getNodeTypes(),await this.credentialsStore.fetchCredentialTypes(!0));return!0},getExecutionError(e){const r=e.resultData.error;let n;if(e.resultData.lastNodeExecuted&&r)n=r.message||r.description;else if(n=this.$locale.baseText("pushConnection.executionError",{interpolate:{error:"!"}}),r!=null&&r.message){let c;"node"in r&&(c=typeof r.node=="string"?r.node:r.node.name);const f=c?`${c}: ${r.message}`:r.message;n=this.$locale.baseText("pushConnection.executionError",{interpolate:{error:`.${this.$locale.baseText("pushConnection.executionError.details",{interpolate:{details:f}})}`}})}return n}}});export{ge as W,De as p,Se as u};
2
- //# sourceMappingURL=pushConnection-UpdxMjHa.js.map
1
+ import{J as V,w as j,af as J}from"./index-RXjMHIPR.js";import{Q as K,v as Y,cT as z,o as X,t as Z,B as ee,u as te,z as se,y as oe,aD as re,dJ as ae,d5 as ie,cV as ne,d9 as q,ab as ue}from"./n8n-ZKR6bms9.js";import{d as le,m as de}from"./pinia-jX93eZRS.js";import{p as ce}from"./flatted-jPn12Tq4.js";import{u as he,a as we}from"./collaboration.store-ba_Vl3Ko.js";import{G as fe}from"./vendor-2CfOYFi2.js";const pe="/orchestration/worker/status",ke=async e=>{await K(e,"POST",pe)},ge=100,me=120*1e3,Se=le("orchestrationManager",{state:()=>({initialStatusReceived:!1,workers:{},workersHistory:{},workersLastUpdated:{},statusInterval:null}),actions:{updateWorkerStatus(e){this.workers[e.workerId]=e,this.workersHistory[e.workerId]||(this.workersHistory[e.workerId]=[]),this.workersHistory[e.workerId].push({data:e,timestamp:Date.now()}),this.workersHistory[e.workerId].length>ge&&this.workersHistory[e.workerId].shift(),this.workersLastUpdated[e.workerId]=Date.now(),this.initialStatusReceived=!0},removeStaleWorkers(){for(const e in this.workersLastUpdated)this.workersLastUpdated[e]+me<Date.now()&&(delete this.workers[e],delete this.workersHistory[e],delete this.workersLastUpdated[e])},startWorkerStatusPolling(){const e=Y();this.statusInterval||(this.statusInterval=setInterval(async()=>{await ke(e.getRestApiContext),this.removeStaleWorkers()},1e3))},stopWorkerStatusPolling(){this.statusInterval&&(clearInterval(this.statusInterval),this.statusInterval=null)},getWorkerLastUpdated(e){return this.workersLastUpdated[e]??0},getWorkerStatus(e){return this.workers[e]},getWorkerStatusHistory(e){return this.workersHistory[e]??[]}}}),De=fe({setup(){return{...z(),...X(),nodeHelpers:V()}},created(){this.pushStore.addEventListener(e=>{this.pushMessageReceived(e)})},mixins:[j],data(){return{retryTimeout:null,pushMessageQueue:[]}},computed:{...de(oe,se,te,ee,Z,J,Se,we,he),sessionId(){return this.rootStore.sessionId}},methods:{queuePushMessage(e,r){this.pushMessageQueue.push({message:e,retriesLeft:r}),this.retryTimeout===null&&(this.retryTimeout=setTimeout(this.processWaitingPushMessages,20))},async processWaitingPushMessages(){this.retryTimeout!==null&&(clearTimeout(this.retryTimeout),this.retryTimeout=null);const e=this.pushMessageQueue.length;for(let r=0;r<e;r++){const n=this.pushMessageQueue.shift();if(!await this.pushMessageReceived(n.message,!0)){n.retriesLeft-=1,n.retriesLeft>0&&this.pushMessageQueue.unshift(n);break}}this.pushMessageQueue.length!==0&&this.retryTimeout===null&&(this.retryTimeout=setTimeout(this.processWaitingPushMessages,25))},async pushMessageReceived(e,r){var f,g,m,S,x,y,E,T,I,N,D,v,M,W,A,b,R,C,L,$,P,H,O,_,U,F,B,G;if(e.type==="sendWorkerStatusMessage"){const s=e.data;return this.orchestrationManagerStore.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)&&r!==!0&&this.pushMessageQueue.length)return this.queuePushMessage(e,5),!1;if(e.type==="nodeExecuteAfter"||e.type==="nodeExecuteBefore"){if(!this.uiStore.isActionActive("workflowRunning"))return!1;const s=e.data;if(this.workflowsStore.activeExecutionId!==s.executionId)return r!==!0&&this.queuePushMessage(event,5),!1}let c;if(e.type==="executionRecovered"){const s=(f=e.data)==null?void 0:f.executionId;if(this.uiStore.isActionActive("workflowRunning")&&this.workflowsStore.activeExecutionId===s){const t=await this.workflowsStore.fetchExecutionDataById(this.workflowsStore.activeExecutionId);if(t!=null&&t.data){t.data=ce(t.data);const d={startData:(g=t.data)==null?void 0:g.startData,resultData:((m=t.data)==null?void 0:m.resultData)??{runData:{}},executionData:(S=t.data)==null?void 0:S.executionData};if(((x=this.workflowsStore.workflowExecutionData)==null?void 0:x.workflowId)===t.workflowId){const u=(T=(E=(y=this.workflowsStore.workflowExecutionData)==null?void 0:y.data)==null?void 0:E.resultData)==null?void 0:T.runData;if(u)for(const w of Object.keys(u))d.resultData.runData[w]=u[w]}const p={data:d,finished:t.finished,mode:t.mode,waitTill:(I=t.data)==null?void 0:I.waitTill,startedAt:t.startedAt,stoppedAt:t.stoppedAt,status:"crashed"};t.data&&(c={executionId:t.id,data:p})}}}if(e.type==="workflowFailedToActivate"&&this.workflowsStore.workflowId===e.data.workflowId)return this.workflowsStore.setWorkflowInactive(e.data.workflowId),this.workflowsStore.setActive(!1),this.showError(new Error(e.data.errorMessage),this.$locale.baseText("workflowActivator.showError.title",{interpolate:{newStateName:"activated"}})+":"),!0;if(e.type==="workflowActivated")return this.workflowsStore.setWorkflowActive(e.data.workflowId),!0;if(e.type==="workflowDeactivated")return this.workflowsStore.setWorkflowInactive(e.data.workflowId),!0;if(e.type==="executionFinished"||e.type==="executionRecovered"){let s;if(e.type==="executionRecovered"&&c!==void 0?s=c:s=e.data,this.workflowsStore.activeExecutionId===s.executionId){const o=(v=(D=(N=this.workflowsStore.workflowExecutionData)==null?void 0:N.data)==null?void 0:D.resultData)==null?void 0:v.runData;if(o)for(const a of Object.keys(o))((L=(C=(R=(b=(A=(W=(M=s.data.data.resultData.runData[a])==null?void 0:M[0])==null?void 0:W.data)==null?void 0:A.main)==null?void 0:b[0])==null?void 0:R[0])==null?void 0:C.json)==null?void 0:L.isArtificialRecoveredEventItem)===!0&&o[a].length>0&&(s.data.data.resultData.runData[a]=o[a]);this.workflowsStore.finishActiveExecution(s)}if(!this.uiStore.isActionActive("workflowRunning"))return!1;const{activeExecutionId:h}=this.workflowsStore;if(h!==s.executionId)return r!==!0&&this.queuePushMessage(event,5),!1;const t=s.data;let d=this.getExecutionError(t.data);t.status==="crashed"?d=this.$locale.baseText("pushConnection.executionFailed.message"):t.status==="canceled"&&(d=this.$locale.baseText("executionsList.showMessage.stopExecution.message",{interpolate:{activeExecutionId:h}}));const p=(H=(P=($=t==null?void 0:t.data)==null?void 0:$.resultData)==null?void 0:P.error)==null?void 0:H.lineNumber;re.emit("error-line-number",p||"final");const u=this.getCurrentWorkflow();if(t.waitTill!==void 0){const o=this.workflowsStore.activeExecutionId,a=this.workflowsStore.workflowSettings,i=this.rootStore.saveManualExecutions,l=a.saveManualExecutions===void 0?i:a.saveManualExecutions;let k;l?k=`<a href="/workflow/${u.id}/executions/${o}">View the execution</a> to see what happened after this node.`:(ae.emit("registerGlobalLinkAction",{key:"open-settings",action:async()=>{this.workflowsStore.isNewWorkflow&&await this.saveAsNewWorkflow(),this.uiStore.openModal(ie)}}),k='<a data-action="open-settings">Turn on saving manual executions</a> and run again to see what happened after this node.'),this.titleSet(u.name,"IDLE"),this.showToast({title:"Workflow started waiting",message:`${k} <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(this.titleSet(u.name,"ERROR"),((O=t.data.resultData.error)==null?void 0:O.name)==="ExpressionError"&&t.data.resultData.error.context.functionality==="pairedItem"){const o=t.data.resultData.error;this.getWorkflowDataToSave().then(a=>{const i={caused_by_credential:!1,error_message:o.description,error_title:o.message,error_type:o.context.type,node_graph_string:JSON.stringify(ne(a,this.getNodeTypes()).nodeGraph),workflow_id:this.workflowsStore.workflowId};if(o.context.nodeCause&&["no pairing info","invalid pairing info"].includes(o.context.type)){const l=u.getNode(o.context.nodeCause);l&&(i.is_pinned=!!u.getPinDataOfNode(l.name),i.mode=l.parameters.mode,i.node_type=l.type,i.operation=l.parameters.operation,i.resource=l.parameters.resource)}this.$telemetry.track("Instance FE emitted paired item error",i,{withPostHog:!0})})}if(((_=t.data.resultData.error)==null?void 0:_.name)==="SubworkflowOperationError"){const o=t.data.resultData.error;this.workflowsStore.subWorkflowExecutionError=o,this.showMessage({title:o.message,message:o.description,type:"error",duration:0})}else if(((U=t.data.resultData.error)==null?void 0:U.name)==="NodeOperationError"&&t.data.resultData.error.functionality==="configuration-node"){let o;const a=t.data.resultData.error;a.node.name?o=`Error in sub-node ‘${a.node.name}‘`:o="Problem executing workflow",this.showMessage({title:o,message:((a==null?void 0:a.description)??d)+this.$locale.baseText("pushConnection.executionError.openNode",{interpolate:{node:a.node.name}}),type:"error",duration:0,dangerouslyUseHTMLString:!0})}else{let o;t.mode==="manual"&&t.status==="canceled"?this.showMessage({title:this.$locale.baseText("nodeView.showMessage.stopExecutionTry.title"),type:"success"}):(t.data.resultData.lastNodeExecuted?o=`Problem in node ‘${t.data.resultData.lastNodeExecuted}‘`:o="Problem executing workflow",this.showMessage({title:o,message:d,type:"error",duration:0,dangerouslyUseHTMLString:!0}))}}else{this.titleSet(u.name,"IDLE");const o=this.workflowsStore.getWorkflowExecution;if(o!=null&&o.executedNode){const a=this.workflowsStore.getNodeByName(o.executedNode),i=a&&this.nodeTypesStore.getNodeType(a.type,a.typeVersion),l=o&&o.executedNode&&((G=(B=(F=o.data)==null?void 0:F.resultData)==null?void 0:B.runData)==null?void 0:G[o.executedNode]);i!=null&&i.polling&&!l?this.showMessage({title:this.$locale.baseText("pushConnection.pollingNode.dataNotFound",{interpolate:{service:q(i)}}),message:this.$locale.baseText("pushConnection.pollingNode.dataNotFound.message",{interpolate:{service:q(i)}}),type:"success"}):this.showMessage({title:this.$locale.baseText("pushConnection.nodeExecutedSuccessfully"),type:"success"})}else this.showMessage({title:this.$locale.baseText("pushConnection.workflowExecutedSuccessfully"),type:"success"})}this.workflowsStore.getWorkflowRunData&&(t.data.resultData.runData=this.workflowsStore.getWorkflowRunData),this.workflowsStore.executingNode.length=0,this.workflowsStore.setWorkflowExecutionData(t),this.uiStore.removeActiveAction("workflowRunning"),this.nodeHelpers.updateNodesExecutionIssues();const w=t.data.resultData.lastNodeExecuted;let Q=0;w&&t.data.resultData.runData[w]&&!d&&(Q=t.data.resultData.runData[w][0].data.main[0].length),ue().run("pushConnection.executionFinished",{itemsCount:Q,nodeName:t.data.resultData.lastNodeExecuted,errorMessage:d,runDataExecutedStartData:t.data.startData,resultDataError:t.data.resultData.error}),t.data.resultData.error||this.segmentStore.trackSuccessfulWorkflowExecution(t)}else if(e.type==="executionStarted"){const s=e.data,h={id:s.executionId,finished:!1,mode:s.mode,startedAt:s.startedAt,retryOf:s.retryOf,workflowId:s.workflowId,workflowName:s.workflowName};this.workflowsStore.addActiveExecution(h)}else if(e.type==="nodeExecuteAfter"){const s=e.data;this.workflowsStore.addNodeExecutionData(s),this.workflowsStore.removeExecutingNode(s.nodeName)}else if(e.type==="nodeExecuteBefore"){const s=e.data;this.workflowsStore.addExecutingNode(s.nodeName)}else if(e.type==="testWebhookDeleted")e.data.workflowId===this.workflowsStore.workflowId&&(this.workflowsStore.executionWaitingForWebhook=!1,this.uiStore.removeActiveAction("workflowRunning"));else if(e.type==="testWebhookReceived"){const s=e.data;s.workflowId===this.workflowsStore.workflowId&&(this.workflowsStore.executionWaitingForWebhook=!1,this.workflowsStore.activeExecutionId=s.executionId),this.processWaitingPushMessages()}else if(e.type==="reloadNodeType")await this.nodeTypesStore.getNodeTypes(),await this.nodeTypesStore.getFullNodesProperties([e.data]);else if(e.type==="removeNodeType"){const h=[e.data];await this.credentialsStore.fetchCredentialTypes(!1).then(()=>{this.nodeTypesStore.removeNodeTypes(h)})}else e.type==="nodeDescriptionUpdated"&&(await this.nodeTypesStore.getNodeTypes(),await this.credentialsStore.fetchCredentialTypes(!0));return!0},getExecutionError(e){const r=e.resultData.error;let n;if(e.resultData.lastNodeExecuted&&r)n=r.message||r.description;else if(n=this.$locale.baseText("pushConnection.executionError",{interpolate:{error:"!"}}),r!=null&&r.message){let c;"node"in r&&(c=typeof r.node=="string"?r.node:r.node.name);const f=c?`${c}: ${r.message}`:r.message;n=this.$locale.baseText("pushConnection.executionError",{interpolate:{error:`.${this.$locale.baseText("pushConnection.executionError.details",{interpolate:{details:f}})}`}})}return n}}});export{ge as W,De as p,Se as u};
2
+ //# sourceMappingURL=pushConnection-HdjAqr4R.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pushConnection-UpdxMjHa.js","sources":["../../src/api/orchestration.ts","../../src/stores/orchestration.store.ts","../../src/mixins/pushConnection.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';\nimport { workflowHelpers } from '@/mixins/workflowHelpers';\n\nimport type {\n\tExpressionError,\n\tIDataObject,\n\tINodeTypeNameVersion,\n\tIRun,\n\tIRunExecutionData,\n\tIWorkflowBase,\n\tSubworkflowOperationError,\n\tIExecuteContextData,\n\tNodeOperationError,\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 { mapStores } from 'pinia';\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 { defineComponent } 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';\n\nexport const pushConnection = defineComponent({\n\tsetup() {\n\t\treturn {\n\t\t\t...useTitleChange(),\n\t\t\t...useToast(),\n\t\t\tnodeHelpers: useNodeHelpers(),\n\t\t};\n\t},\n\tcreated() {\n\t\tthis.pushStore.addEventListener((message) => {\n\t\t\tvoid this.pushMessageReceived(message);\n\t\t});\n\t},\n\tmixins: [workflowHelpers],\n\tdata() {\n\t\treturn {\n\t\t\tretryTimeout: null as NodeJS.Timeout | null,\n\t\t\tpushMessageQueue: [] as Array<{ message: IPushData; retriesLeft: number }>,\n\t\t};\n\t},\n\tcomputed: {\n\t\t...mapStores(\n\t\t\tuseCredentialsStore,\n\t\t\tuseNodeTypesStore,\n\t\t\tuseUIStore,\n\t\t\tuseWorkflowsStore,\n\t\t\tuseSettingsStore,\n\t\t\tuseSegment,\n\t\t\tuseOrchestrationStore,\n\t\t\tusePushConnectionStore,\n\t\t\tuseCollaborationStore,\n\t\t),\n\t\tsessionId(): string {\n\t\t\treturn this.rootStore.sessionId;\n\t\t},\n\t},\n\tmethods: {\n\t\t/**\n\t\t * Sometimes the push message is faster as the result from\n\t\t * the REST API so we do not know yet what execution ID\n\t\t * is currently active. So internally resend the message\n\t\t * a few more times\n\t\t */\n\t\tqueuePushMessage(event: IPushData, retryAttempts: number) {\n\t\t\tthis.pushMessageQueue.push({ message: event, retriesLeft: retryAttempts });\n\n\t\t\tif (this.retryTimeout === null) {\n\t\t\t\tthis.retryTimeout = setTimeout(this.processWaitingPushMessages, 20);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Process the push messages which are waiting in the queue\n\t\t */\n\t\tasync processWaitingPushMessages() {\n\t\t\tif (this.retryTimeout !== null) {\n\t\t\t\tclearTimeout(this.retryTimeout);\n\t\t\t\tthis.retryTimeout = null;\n\t\t\t}\n\n\t\t\tconst queueLength = this.pushMessageQueue.length;\n\t\t\tfor (let i = 0; i < queueLength; i++) {\n\t\t\t\tconst messageData = this.pushMessageQueue.shift();\n\n\t\t\t\tconst result = await this.pushMessageReceived(messageData!.message, true);\n\t\t\t\tif (!result) {\n\t\t\t\t\t// Was not successful\n\t\t\t\t\tmessageData!.retriesLeft -= 1;\n\n\t\t\t\t\tif (messageData!.retriesLeft > 0) {\n\t\t\t\t\t\t// If still retries are left add it back and stop execution\n\t\t\t\t\t\tthis.pushMessageQueue.unshift(messageData!);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.pushMessageQueue.length !== 0 && this.retryTimeout === null) {\n\t\t\t\tthis.retryTimeout = setTimeout(this.processWaitingPushMessages, 25);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Process a newly received message\n\t\t */\n\t\tasync pushMessageReceived(receivedData: IPushData, isRetry?: boolean): Promise<boolean> {\n\t\t\tconst retryAttempts = 5;\n\n\t\t\tif (receivedData.type === 'sendWorkerStatusMessage') {\n\t\t\t\tconst pushData = receivedData.data;\n\t\t\t\tthis.orchestrationManagerStore.updateWorkerStatus(pushData.status);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (receivedData.type === 'sendConsoleMessage') {\n\t\t\t\tconst pushData = receivedData.data;\n\t\t\t\tconsole.log(pushData.source, ...pushData.messages);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t!['testWebhookReceived'].includes(receivedData.type) &&\n\t\t\t\tisRetry !== true &&\n\t\t\t\tthis.pushMessageQueue.length\n\t\t\t) {\n\t\t\t\t// If there are already messages in the queue add the new one that all of them\n\t\t\t\t// get executed in order\n\t\t\t\tthis.queuePushMessage(receivedData, retryAttempts);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (receivedData.type === 'nodeExecuteAfter' || receivedData.type === 'nodeExecuteBefore') {\n\t\t\t\tif (!this.uiStore.isActionActive('workflowRunning')) {\n\t\t\t\t\t// No workflow is running so ignore the messages\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tconst pushData = receivedData.data;\n\t\t\t\tif (this.workflowsStore.activeExecutionId !== pushData.executionId) {\n\t\t\t\t\t// The data is not for the currently active execution or\n\t\t\t\t\t// we do not have the execution id yet.\n\t\t\t\t\tif (isRetry !== true) {\n\t\t\t\t\t\tthis.queuePushMessage(event, retryAttempts);\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// recovered execution data is handled like executionFinished data, however for security reasons\n\t\t\t// we need to fetch the data from the server again rather than push it to all clients\n\t\t\tlet recoveredPushData: IPushDataExecutionFinished | undefined = undefined;\n\t\t\tif (receivedData.type === 'executionRecovered') {\n\t\t\t\tconst recoveredExecutionId = receivedData.data?.executionId;\n\t\t\t\tconst isWorkflowRunning = this.uiStore.isActionActive('workflowRunning');\n\t\t\t\tif (isWorkflowRunning && this.workflowsStore.activeExecutionId === recoveredExecutionId) {\n\t\t\t\t\t// pull execution data for the recovered execution from the server\n\t\t\t\t\tconst executionData = await this.workflowsStore.fetchExecutionDataById(\n\t\t\t\t\t\tthis.workflowsStore.activeExecutionId,\n\t\t\t\t\t);\n\t\t\t\t\tif (executionData?.data) {\n\t\t\t\t\t\t// data comes in as 'flatten' object, so we need to parse it\n\t\t\t\t\t\texecutionData.data = parse(\n\t\t\t\t\t\t\texecutionData.data as unknown as string,\n\t\t\t\t\t\t) as IRunExecutionData;\n\t\t\t\t\t\tconst iRunExecutionData: IRunExecutionData = {\n\t\t\t\t\t\t\tstartData: executionData.data?.startData,\n\t\t\t\t\t\t\tresultData: executionData.data?.resultData ?? { runData: {} },\n\t\t\t\t\t\t\texecutionData: executionData.data?.executionData,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tthis.workflowsStore.workflowExecutionData?.workflowId === executionData.workflowId\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tconst activeRunData =\n\t\t\t\t\t\t\t\tthis.workflowsStore.workflowExecutionData?.data?.resultData?.runData;\n\t\t\t\t\t\t\tif (activeRunData) {\n\t\t\t\t\t\t\t\tfor (const key of Object.keys(activeRunData)) {\n\t\t\t\t\t\t\t\t\tiRunExecutionData.resultData.runData[key] = activeRunData[key];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst iRun: IRun = {\n\t\t\t\t\t\t\tdata: iRunExecutionData,\n\t\t\t\t\t\t\tfinished: executionData.finished,\n\t\t\t\t\t\t\tmode: executionData.mode,\n\t\t\t\t\t\t\twaitTill: executionData.data?.waitTill,\n\t\t\t\t\t\t\tstartedAt: executionData.startedAt,\n\t\t\t\t\t\t\tstoppedAt: executionData.stoppedAt,\n\t\t\t\t\t\t\tstatus: 'crashed',\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (executionData.data) {\n\t\t\t\t\t\t\trecoveredPushData = {\n\t\t\t\t\t\t\t\texecutionId: executionData.id,\n\t\t\t\t\t\t\t\tdata: iRun,\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\n\t\t\tif (\n\t\t\t\treceivedData.type === 'workflowFailedToActivate' &&\n\t\t\t\tthis.workflowsStore.workflowId === receivedData.data.workflowId\n\t\t\t) {\n\t\t\t\tthis.workflowsStore.setWorkflowInactive(receivedData.data.workflowId);\n\t\t\t\tthis.workflowsStore.setActive(false);\n\n\t\t\t\tthis.showError(\n\t\t\t\t\tnew Error(receivedData.data.errorMessage),\n\t\t\t\t\tthis.$locale.baseText('workflowActivator.showError.title', {\n\t\t\t\t\t\tinterpolate: { newStateName: 'activated' },\n\t\t\t\t\t}) + ':',\n\t\t\t\t);\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (receivedData.type === 'workflowActivated') {\n\t\t\t\tthis.workflowsStore.setWorkflowActive(receivedData.data.workflowId);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (receivedData.type === 'workflowDeactivated') {\n\t\t\t\tthis.workflowsStore.setWorkflowInactive(receivedData.data.workflowId);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (receivedData.type === 'executionFinished' || receivedData.type === 'executionRecovered') {\n\t\t\t\t// The workflow finished executing\n\t\t\t\tlet pushData: IPushDataExecutionFinished;\n\t\t\t\tif (receivedData.type === 'executionRecovered' && recoveredPushData !== undefined) {\n\t\t\t\t\tpushData = recoveredPushData;\n\t\t\t\t} else {\n\t\t\t\t\tpushData = receivedData.data as IPushDataExecutionFinished;\n\t\t\t\t}\n\n\t\t\t\tif (this.workflowsStore.activeExecutionId === pushData.executionId) {\n\t\t\t\t\tconst activeRunData =\n\t\t\t\t\t\tthis.workflowsStore.workflowExecutionData?.data?.resultData?.runData;\n\t\t\t\t\tif (activeRunData) {\n\t\t\t\t\t\tfor (const key of Object.keys(activeRunData)) {\n\t\t\t\t\t\t\tif (\n\t\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\t?.isArtificialRecoveredEventItem === true &&\n\t\t\t\t\t\t\t\tactiveRunData[key].length > 0\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\tpushData.data.data.resultData.runData[key] = activeRunData[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.workflowsStore.finishActiveExecution(pushData);\n\t\t\t\t}\n\n\t\t\t\tif (!this.uiStore.isActionActive('workflowRunning')) {\n\t\t\t\t\t// No workflow is running so ignore the messages\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tconst { activeExecutionId } = this.workflowsStore;\n\t\t\t\tif (activeExecutionId !== pushData.executionId) {\n\t\t\t\t\t// The workflow which did finish execution did either not get started\n\t\t\t\t\t// by this session or we do not have the execution id yet.\n\t\t\t\t\tif (isRetry !== true) {\n\t\t\t\t\t\tthis.queuePushMessage(event, retryAttempts);\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tconst runDataExecuted = pushData.data;\n\n\t\t\t\tlet runDataExecutedErrorMessage = this.getExecutionError(runDataExecuted.data);\n\n\t\t\t\tif (runDataExecuted.status === 'crashed') {\n\t\t\t\t\trunDataExecutedErrorMessage = this.$locale.baseText(\n\t\t\t\t\t\t'pushConnection.executionFailed.message',\n\t\t\t\t\t);\n\t\t\t\t} else if (runDataExecuted.status === 'canceled') {\n\t\t\t\t\trunDataExecutedErrorMessage = this.$locale.baseText(\n\t\t\t\t\t\t'executionsList.showMessage.stopExecution.message',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinterpolate: { activeExecutionId },\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst lineNumber = runDataExecuted?.data?.resultData?.error?.lineNumber;\n\n\t\t\t\tcodeNodeEditorEventBus.emit('error-line-number', lineNumber || 'final');\n\n\t\t\t\tconst workflow = this.getCurrentWorkflow();\n\t\t\t\tif (runDataExecuted.waitTill !== undefined) {\n\t\t\t\t\tconst activeExecutionId = this.workflowsStore.activeExecutionId;\n\t\t\t\t\tconst workflowSettings = this.workflowsStore.workflowSettings;\n\t\t\t\t\tconst saveManualExecutions = this.rootStore.saveManualExecutions;\n\n\t\t\t\t\tconst isSavingExecutions =\n\t\t\t\t\t\tworkflowSettings.saveManualExecutions === undefined\n\t\t\t\t\t\t\t? saveManualExecutions\n\t\t\t\t\t\t\t: workflowSettings.saveManualExecutions;\n\n\t\t\t\t\tlet action;\n\t\t\t\t\tif (!isSavingExecutions) {\n\t\t\t\t\t\tglobalLinkActionsEventBus.emit('registerGlobalLinkAction', {\n\t\t\t\t\t\t\tkey: 'open-settings',\n\t\t\t\t\t\t\taction: async () => {\n\t\t\t\t\t\t\t\tif (this.workflowsStore.isNewWorkflow) await this.saveAsNewWorkflow();\n\t\t\t\t\t\t\t\tthis.uiStore.openModal(WORKFLOW_SETTINGS_MODAL_KEY);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\taction =\n\t\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\t} else {\n\t\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\t}\n\n\t\t\t\t\t// Workflow did start but had been put to wait\n\t\t\t\t\tthis.titleSet(workflow.name as string, 'IDLE');\n\t\t\t\t\tthis.showToast({\n\t\t\t\t\t\ttitle: 'Workflow started waiting',\n\t\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\t\ttype: 'success',\n\t\t\t\t\t\tduration: 0,\n\t\t\t\t\t});\n\t\t\t\t} else if (runDataExecuted.finished !== true) {\n\t\t\t\t\tthis.titleSet(workflow.name as string, 'ERROR');\n\n\t\t\t\t\tif (\n\t\t\t\t\t\trunDataExecuted.data.resultData.error?.name === 'ExpressionError' &&\n\t\t\t\t\t\t(runDataExecuted.data.resultData.error as ExpressionError).context.functionality ===\n\t\t\t\t\t\t\t'pairedItem'\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst error = runDataExecuted.data.resultData.error as ExpressionError;\n\n\t\t\t\t\t\tvoid this.getWorkflowDataToSave().then((workflowData) => {\n\t\t\t\t\t\t\tconst eventData: IDataObject = {\n\t\t\t\t\t\t\t\tcaused_by_credential: false,\n\t\t\t\t\t\t\t\terror_message: error.description,\n\t\t\t\t\t\t\t\terror_title: error.message,\n\t\t\t\t\t\t\t\terror_type: error.context.type,\n\t\t\t\t\t\t\t\tnode_graph_string: JSON.stringify(\n\t\t\t\t\t\t\t\t\tTelemetryHelpers.generateNodesGraph(\n\t\t\t\t\t\t\t\t\t\tworkflowData as IWorkflowBase,\n\t\t\t\t\t\t\t\t\t\tthis.getNodeTypes(),\n\t\t\t\t\t\t\t\t\t).nodeGraph,\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tworkflow_id: this.workflowsStore.workflowId,\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\terror.context.nodeCause &&\n\t\t\t\t\t\t\t\t['no pairing info', 'invalid pairing info'].includes(error.context.type as string)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tconst node = workflow.getNode(error.context.nodeCause as string);\n\n\t\t\t\t\t\t\t\tif (node) {\n\t\t\t\t\t\t\t\t\teventData.is_pinned = !!workflow.getPinDataOfNode(node.name);\n\t\t\t\t\t\t\t\t\teventData.mode = node.parameters.mode;\n\t\t\t\t\t\t\t\t\teventData.node_type = node.type;\n\t\t\t\t\t\t\t\t\teventData.operation = node.parameters.operation;\n\t\t\t\t\t\t\t\t\teventData.resource = node.parameters.resource;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tthis.$telemetry.track('Instance FE emitted paired item error', eventData, {\n\t\t\t\t\t\t\t\twithPostHog: true,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tif (runDataExecuted.data.resultData.error?.name === 'SubworkflowOperationError') {\n\t\t\t\t\t\tconst error = runDataExecuted.data.resultData.error as SubworkflowOperationError;\n\n\t\t\t\t\t\tthis.workflowsStore.subWorkflowExecutionError = error;\n\n\t\t\t\t\t\tthis.showMessage({\n\t\t\t\t\t\t\ttitle: error.message,\n\t\t\t\t\t\t\tmessage: error.description,\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});\n\t\t\t\t\t} else if (\n\t\t\t\t\t\trunDataExecuted.data.resultData.error?.name === 'NodeOperationError' &&\n\t\t\t\t\t\t(runDataExecuted.data.resultData.error as NodeOperationError).functionality ===\n\t\t\t\t\t\t\t'configuration-node'\n\t\t\t\t\t) {\n\t\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\t\tlet title: string;\n\t\t\t\t\t\tconst nodeError = runDataExecuted.data.resultData.error as NodeOperationError;\n\t\t\t\t\t\tif (nodeError.node.name) {\n\t\t\t\t\t\t\ttitle = `Error in sub-node ‘${nodeError.node.name}‘`;\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\tthis.showMessage({\n\t\t\t\t\t\t\ttitle,\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t(nodeError?.description ?? runDataExecutedErrorMessage) +\n\t\t\t\t\t\t\t\tthis.$locale.baseText('pushConnection.executionError.openNode', {\n\t\t\t\t\t\t\t\t\tinterpolate: {\n\t\t\t\t\t\t\t\t\t\tnode: nodeError.node.name,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}),\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} else {\n\t\t\t\t\t\tlet title: string;\n\t\t\t\t\t\tconst isManualExecutionCancelled =\n\t\t\t\t\t\t\trunDataExecuted.mode === 'manual' && runDataExecuted.status === 'canceled';\n\n\t\t\t\t\t\t// Do not show the error message if the workflow got canceled manually\n\t\t\t\t\t\tif (isManualExecutionCancelled) {\n\t\t\t\t\t\t\tthis.showMessage({\n\t\t\t\t\t\t\t\ttitle: this.$locale.baseText('nodeView.showMessage.stopExecutionTry.title'),\n\t\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (runDataExecuted.data.resultData.lastNodeExecuted) {\n\t\t\t\t\t\t\t\ttitle = `Problem in node ‘${runDataExecuted.data.resultData.lastNodeExecuted}‘`;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttitle = 'Problem executing workflow';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tthis.showMessage({\n\t\t\t\t\t\t\t\ttitle,\n\t\t\t\t\t\t\t\tmessage: runDataExecutedErrorMessage,\n\t\t\t\t\t\t\t\ttype: 'error',\n\t\t\t\t\t\t\t\tduration: 0,\n\t\t\t\t\t\t\t\tdangerouslyUseHTMLString: true,\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} else {\n\t\t\t\t\t// Workflow did execute without a problem\n\t\t\t\t\tthis.titleSet(workflow.name as string, 'IDLE');\n\n\t\t\t\t\tconst execution = this.workflowsStore.getWorkflowExecution;\n\t\t\t\t\tif (execution?.executedNode) {\n\t\t\t\t\t\tconst node = this.workflowsStore.getNodeByName(execution.executedNode);\n\t\t\t\t\t\tconst nodeType = node && this.nodeTypesStore.getNodeType(node.type, node.typeVersion);\n\t\t\t\t\t\tconst nodeOutput =\n\t\t\t\t\t\t\texecution &&\n\t\t\t\t\t\t\texecution.executedNode &&\n\t\t\t\t\t\t\texecution.data?.resultData?.runData?.[execution.executedNode];\n\t\t\t\t\t\tif (nodeType?.polling && !nodeOutput) {\n\t\t\t\t\t\t\tthis.showMessage({\n\t\t\t\t\t\t\t\ttitle: this.$locale.baseText('pushConnection.pollingNode.dataNotFound', {\n\t\t\t\t\t\t\t\t\tinterpolate: {\n\t\t\t\t\t\t\t\t\t\tservice: getTriggerNodeServiceName(nodeType),\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\tmessage: this.$locale.baseText('pushConnection.pollingNode.dataNotFound.message', {\n\t\t\t\t\t\t\t\t\tinterpolate: {\n\t\t\t\t\t\t\t\t\t\tservice: getTriggerNodeServiceName(nodeType),\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.showMessage({\n\t\t\t\t\t\t\t\ttitle: this.$locale.baseText('pushConnection.nodeExecutedSuccessfully'),\n\t\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.showMessage({\n\t\t\t\t\t\t\ttitle: this.$locale.baseText('pushConnection.workflowExecutedSuccessfully'),\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}\n\n\t\t\t\t// It does not push the runData as it got already pushed with each\n\t\t\t\t// node that did finish. For that reason copy in here the data\n\t\t\t\t// which we already have.\n\t\t\t\tif (this.workflowsStore.getWorkflowRunData) {\n\t\t\t\t\trunDataExecuted.data.resultData.runData = this.workflowsStore.getWorkflowRunData;\n\t\t\t\t}\n\n\t\t\t\tthis.workflowsStore.executingNode.length = 0;\n\t\t\t\tthis.workflowsStore.setWorkflowExecutionData(runDataExecuted as IExecutionResponse);\n\t\t\t\tthis.uiStore.removeActiveAction('workflowRunning');\n\n\t\t\t\t// Set the node execution issues on all the nodes which produced an error so that\n\t\t\t\t// it can be displayed in the node-view\n\t\t\t\tthis.nodeHelpers.updateNodesExecutionIssues();\n\n\t\t\t\tconst lastNodeExecuted: string | undefined =\n\t\t\t\t\trunDataExecuted.data.resultData.lastNodeExecuted;\n\t\t\t\tlet itemsCount = 0;\n\t\t\t\tif (\n\t\t\t\t\tlastNodeExecuted &&\n\t\t\t\t\trunDataExecuted.data.resultData.runData[lastNodeExecuted] &&\n\t\t\t\t\t!runDataExecutedErrorMessage\n\t\t\t\t) {\n\t\t\t\t\titemsCount =\n\t\t\t\t\t\trunDataExecuted.data.resultData.runData[lastNodeExecuted][0].data!.main[0]!.length;\n\t\t\t\t}\n\n\t\t\t\tvoid useExternalHooks().run('pushConnection.executionFinished', {\n\t\t\t\t\titemsCount,\n\t\t\t\t\tnodeName: runDataExecuted.data.resultData.lastNodeExecuted,\n\t\t\t\t\terrorMessage: runDataExecutedErrorMessage,\n\t\t\t\t\trunDataExecutedStartData: runDataExecuted.data.startData,\n\t\t\t\t\tresultDataError: runDataExecuted.data.resultData.error,\n\t\t\t\t});\n\t\t\t\tif (!runDataExecuted.data.resultData.error) {\n\t\t\t\t\tthis.segmentStore.trackSuccessfulWorkflowExecution(runDataExecuted);\n\t\t\t\t}\n\t\t\t} else if (receivedData.type === 'executionStarted') {\n\t\t\t\tconst pushData = receivedData.data;\n\n\t\t\t\tconst executionData: IExecutionsCurrentSummaryExtended = {\n\t\t\t\t\tid: pushData.executionId,\n\t\t\t\t\tfinished: false,\n\t\t\t\t\tmode: pushData.mode,\n\t\t\t\t\tstartedAt: pushData.startedAt,\n\t\t\t\t\tretryOf: pushData.retryOf,\n\t\t\t\t\tworkflowId: pushData.workflowId,\n\t\t\t\t\tworkflowName: pushData.workflowName,\n\t\t\t\t};\n\n\t\t\t\tthis.workflowsStore.addActiveExecution(executionData);\n\t\t\t} else if (receivedData.type === 'nodeExecuteAfter') {\n\t\t\t\t// A node finished to execute. Add its data\n\t\t\t\tconst pushData = receivedData.data;\n\t\t\t\tthis.workflowsStore.addNodeExecutionData(pushData);\n\t\t\t\tthis.workflowsStore.removeExecutingNode(pushData.nodeName);\n\t\t\t} else if (receivedData.type === 'nodeExecuteBefore') {\n\t\t\t\t// A node started to be executed. Set it as executing.\n\t\t\t\tconst pushData = receivedData.data;\n\t\t\t\tthis.workflowsStore.addExecutingNode(pushData.nodeName);\n\t\t\t} else if (receivedData.type === 'testWebhookDeleted') {\n\t\t\t\t// A test-webhook was deleted\n\t\t\t\tconst pushData = receivedData.data;\n\n\t\t\t\tif (pushData.workflowId === this.workflowsStore.workflowId) {\n\t\t\t\t\tthis.workflowsStore.executionWaitingForWebhook = false;\n\t\t\t\t\tthis.uiStore.removeActiveAction('workflowRunning');\n\t\t\t\t}\n\t\t\t} else if (receivedData.type === 'testWebhookReceived') {\n\t\t\t\t// A test-webhook did get called\n\t\t\t\tconst pushData = receivedData.data;\n\n\t\t\t\tif (pushData.workflowId === this.workflowsStore.workflowId) {\n\t\t\t\t\tthis.workflowsStore.executionWaitingForWebhook = false;\n\t\t\t\t\tthis.workflowsStore.activeExecutionId = pushData.executionId;\n\t\t\t\t}\n\n\t\t\t\tvoid this.processWaitingPushMessages();\n\t\t\t} else if (receivedData.type === 'reloadNodeType') {\n\t\t\t\tawait this.nodeTypesStore.getNodeTypes();\n\t\t\t\tawait this.nodeTypesStore.getFullNodesProperties([receivedData.data]);\n\t\t\t} else if (receivedData.type === 'removeNodeType') {\n\t\t\t\tconst pushData = receivedData.data;\n\n\t\t\t\tconst nodesToBeRemoved: INodeTypeNameVersion[] = [pushData];\n\n\t\t\t\t// Force reload of all credential types\n\t\t\t\tawait this.credentialsStore.fetchCredentialTypes(false).then(() => {\n\t\t\t\t\tthis.nodeTypesStore.removeNodeTypes(nodesToBeRemoved);\n\t\t\t\t});\n\t\t\t} else if (receivedData.type === 'nodeDescriptionUpdated') {\n\t\t\t\tawait this.nodeTypesStore.getNodeTypes();\n\t\t\t\tawait this.credentialsStore.fetchCredentialTypes(true);\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\t\tgetExecutionError(data: IRunExecutionData | IExecuteContextData) {\n\t\t\tconst error = data.resultData.error;\n\n\t\t\tlet errorMessage: string;\n\n\t\t\tif (data.resultData.lastNodeExecuted && error) {\n\t\t\t\terrorMessage = error.message || error.description;\n\t\t\t} else {\n\t\t\t\terrorMessage = this.$locale.baseText('pushConnection.executionError', {\n\t\t\t\t\tinterpolate: { error: '!' },\n\t\t\t\t});\n\n\t\t\t\tif (error?.message) {\n\t\t\t\t\tlet nodeName: string | undefined;\n\t\t\t\t\tif ('node' in error) {\n\t\t\t\t\t\tnodeName = typeof error.node === 'string' ? error.node : error.node!.name;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst receivedError = nodeName ? `${nodeName}: ${error.message}` : error.message;\n\t\t\t\t\terrorMessage = this.$locale.baseText('pushConnection.executionError', {\n\t\t\t\t\t\tinterpolate: {\n\t\t\t\t\t\t\terror: `.${this.$locale.baseText('pushConnection.executionError.details', {\n\t\t\t\t\t\t\t\tinterpolate: {\n\t\t\t\t\t\t\t\t\tdetails: receivedError,\n\t\t\t\t\t\t\t\t},\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\n\t\t\treturn errorMessage;\n\t\t},\n\t},\n});\n"],"names":["GET_STATUS_ENDPOINT","sendGetWorkerStatus","context","makeRestApiRequest","WORKER_HISTORY_LENGTH","STALE_SECONDS","useOrchestrationStore","defineStore","data","id","rootStore","useRootStore","workerId","pushConnection","defineComponent","useTitleChange","useToast","useNodeHelpers","message","workflowHelpers","mapStores","useCredentialsStore","useNodeTypesStore","useUIStore","useWorkflowsStore","useSettingsStore","useSegment","usePushConnectionStore","useCollaborationStore","event","retryAttempts","queueLength","i","messageData","receivedData","isRetry","pushData","recoveredPushData","recoveredExecutionId","_a","executionData","parse","iRunExecutionData","_b","_c","_d","_e","activeRunData","_h","_g","_f","key","iRun","_i","_l","_k","_j","_s","_r","_q","_p","_o","_n","_m","activeExecutionId","runDataExecuted","runDataExecutedErrorMessage","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":"oZAGA,MAAMA,GAAsB,+BAEfC,GAAsB,MAAOC,GAA4C,CAC/E,MAAAC,EAAmBD,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,QAC/C,OAAA,KAAK,QAAQI,CAAE,EACf,OAAA,KAAK,eAAeA,CAAE,EACtB,OAAA,KAAK,mBAAmBA,CAAE,EAGpC,EACA,0BAA2B,CAC1B,MAAMC,EAAYC,IACb,KAAK,iBACJ,KAAA,eAAiB,YAAY,SAAY,CACvC,MAAAV,GAAoBS,EAAU,iBAAiB,EACrD,KAAK,mBAAmB,GACtB,GAAI,EAET,EACA,yBAA0B,CACr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EAAK,EAAE,KAAK,IAAM,CAC7D,KAAA,eAAe,gBAAgBiE,CAAgB,CAAA,CACpD,CAAA,MACSjE,EAAa,OAAS,2BAC1B,MAAA,KAAK,eAAe,eACpB,MAAA,KAAK,iBAAiB,qBAAqB,EAAI,GAE/C,MAAA,EACR,EACA,kBAAkB1B,EAA+C,CAC1D,MAAAwE,EAAQxE,EAAK,WAAW,MAE1B,IAAA4F,EAEA,GAAA5F,EAAK,WAAW,kBAAoBwE,EACxBoB,EAAApB,EAAM,SAAWA,EAAM,oBAEvBoB,EAAA,KAAK,QAAQ,SAAS,gCAAiC,CACrE,YAAa,CAAE,MAAO,GAAI,CAAA,CAC1B,EAEGpB,GAAA,MAAAA,EAAO,QAAS,CACf,IAAAqB,EACA,SAAUrB,IACbqB,EAAW,OAAOrB,EAAM,MAAS,SAAWA,EAAM,KAAOA,EAAM,KAAM,MAGhE,MAAAsB,EAAgBD,EAAW,GAAGA,CAAQ,KAAKrB,EAAM,OAAO,GAAKA,EAAM,QAC1DoB,EAAA,KAAK,QAAQ,SAAS,gCAAiC,CACrE,YAAa,CACZ,MAAO,IAAI,KAAK,QAAQ,SAAS,wCAAyC,CACzE,YAAa,CACZ,QAASE,CACV,CACA,CAAA,CAAC,EACH,CAAA,CACA,CACF,CAGM,OAAAF,CACR,CACD,CACD,CAAC"}
1
+ {"version":3,"file":"pushConnection-HdjAqr4R.js","sources":["../../src/api/orchestration.ts","../../src/stores/orchestration.store.ts","../../src/mixins/pushConnection.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';\nimport { workflowHelpers } from '@/mixins/workflowHelpers';\n\nimport type {\n\tExpressionError,\n\tIDataObject,\n\tINodeTypeNameVersion,\n\tIRun,\n\tIRunExecutionData,\n\tIWorkflowBase,\n\tSubworkflowOperationError,\n\tIExecuteContextData,\n\tNodeOperationError,\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 { mapStores } from 'pinia';\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 { defineComponent } 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';\n\nexport const pushConnection = defineComponent({\n\tsetup() {\n\t\treturn {\n\t\t\t...useTitleChange(),\n\t\t\t...useToast(),\n\t\t\tnodeHelpers: useNodeHelpers(),\n\t\t};\n\t},\n\tcreated() {\n\t\tthis.pushStore.addEventListener((message) => {\n\t\t\tvoid this.pushMessageReceived(message);\n\t\t});\n\t},\n\tmixins: [workflowHelpers],\n\tdata() {\n\t\treturn {\n\t\t\tretryTimeout: null as NodeJS.Timeout | null,\n\t\t\tpushMessageQueue: [] as Array<{ message: IPushData; retriesLeft: number }>,\n\t\t};\n\t},\n\tcomputed: {\n\t\t...mapStores(\n\t\t\tuseCredentialsStore,\n\t\t\tuseNodeTypesStore,\n\t\t\tuseUIStore,\n\t\t\tuseWorkflowsStore,\n\t\t\tuseSettingsStore,\n\t\t\tuseSegment,\n\t\t\tuseOrchestrationStore,\n\t\t\tusePushConnectionStore,\n\t\t\tuseCollaborationStore,\n\t\t),\n\t\tsessionId(): string {\n\t\t\treturn this.rootStore.sessionId;\n\t\t},\n\t},\n\tmethods: {\n\t\t/**\n\t\t * Sometimes the push message is faster as the result from\n\t\t * the REST API so we do not know yet what execution ID\n\t\t * is currently active. So internally resend the message\n\t\t * a few more times\n\t\t */\n\t\tqueuePushMessage(event: IPushData, retryAttempts: number) {\n\t\t\tthis.pushMessageQueue.push({ message: event, retriesLeft: retryAttempts });\n\n\t\t\tif (this.retryTimeout === null) {\n\t\t\t\tthis.retryTimeout = setTimeout(this.processWaitingPushMessages, 20);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Process the push messages which are waiting in the queue\n\t\t */\n\t\tasync processWaitingPushMessages() {\n\t\t\tif (this.retryTimeout !== null) {\n\t\t\t\tclearTimeout(this.retryTimeout);\n\t\t\t\tthis.retryTimeout = null;\n\t\t\t}\n\n\t\t\tconst queueLength = this.pushMessageQueue.length;\n\t\t\tfor (let i = 0; i < queueLength; i++) {\n\t\t\t\tconst messageData = this.pushMessageQueue.shift();\n\n\t\t\t\tconst result = await this.pushMessageReceived(messageData!.message, true);\n\t\t\t\tif (!result) {\n\t\t\t\t\t// Was not successful\n\t\t\t\t\tmessageData!.retriesLeft -= 1;\n\n\t\t\t\t\tif (messageData!.retriesLeft > 0) {\n\t\t\t\t\t\t// If still retries are left add it back and stop execution\n\t\t\t\t\t\tthis.pushMessageQueue.unshift(messageData!);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.pushMessageQueue.length !== 0 && this.retryTimeout === null) {\n\t\t\t\tthis.retryTimeout = setTimeout(this.processWaitingPushMessages, 25);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Process a newly received message\n\t\t */\n\t\tasync pushMessageReceived(receivedData: IPushData, isRetry?: boolean): Promise<boolean> {\n\t\t\tconst retryAttempts = 5;\n\n\t\t\tif (receivedData.type === 'sendWorkerStatusMessage') {\n\t\t\t\tconst pushData = receivedData.data;\n\t\t\t\tthis.orchestrationManagerStore.updateWorkerStatus(pushData.status);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (receivedData.type === 'sendConsoleMessage') {\n\t\t\t\tconst pushData = receivedData.data;\n\t\t\t\tconsole.log(pushData.source, ...pushData.messages);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t!['testWebhookReceived'].includes(receivedData.type) &&\n\t\t\t\tisRetry !== true &&\n\t\t\t\tthis.pushMessageQueue.length\n\t\t\t) {\n\t\t\t\t// If there are already messages in the queue add the new one that all of them\n\t\t\t\t// get executed in order\n\t\t\t\tthis.queuePushMessage(receivedData, retryAttempts);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (receivedData.type === 'nodeExecuteAfter' || receivedData.type === 'nodeExecuteBefore') {\n\t\t\t\tif (!this.uiStore.isActionActive('workflowRunning')) {\n\t\t\t\t\t// No workflow is running so ignore the messages\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tconst pushData = receivedData.data;\n\t\t\t\tif (this.workflowsStore.activeExecutionId !== pushData.executionId) {\n\t\t\t\t\t// The data is not for the currently active execution or\n\t\t\t\t\t// we do not have the execution id yet.\n\t\t\t\t\tif (isRetry !== true) {\n\t\t\t\t\t\tthis.queuePushMessage(event, retryAttempts);\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// recovered execution data is handled like executionFinished data, however for security reasons\n\t\t\t// we need to fetch the data from the server again rather than push it to all clients\n\t\t\tlet recoveredPushData: IPushDataExecutionFinished | undefined = undefined;\n\t\t\tif (receivedData.type === 'executionRecovered') {\n\t\t\t\tconst recoveredExecutionId = receivedData.data?.executionId;\n\t\t\t\tconst isWorkflowRunning = this.uiStore.isActionActive('workflowRunning');\n\t\t\t\tif (isWorkflowRunning && this.workflowsStore.activeExecutionId === recoveredExecutionId) {\n\t\t\t\t\t// pull execution data for the recovered execution from the server\n\t\t\t\t\tconst executionData = await this.workflowsStore.fetchExecutionDataById(\n\t\t\t\t\t\tthis.workflowsStore.activeExecutionId,\n\t\t\t\t\t);\n\t\t\t\t\tif (executionData?.data) {\n\t\t\t\t\t\t// data comes in as 'flatten' object, so we need to parse it\n\t\t\t\t\t\texecutionData.data = parse(\n\t\t\t\t\t\t\texecutionData.data as unknown as string,\n\t\t\t\t\t\t) as IRunExecutionData;\n\t\t\t\t\t\tconst iRunExecutionData: IRunExecutionData = {\n\t\t\t\t\t\t\tstartData: executionData.data?.startData,\n\t\t\t\t\t\t\tresultData: executionData.data?.resultData ?? { runData: {} },\n\t\t\t\t\t\t\texecutionData: executionData.data?.executionData,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tthis.workflowsStore.workflowExecutionData?.workflowId === executionData.workflowId\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tconst activeRunData =\n\t\t\t\t\t\t\t\tthis.workflowsStore.workflowExecutionData?.data?.resultData?.runData;\n\t\t\t\t\t\t\tif (activeRunData) {\n\t\t\t\t\t\t\t\tfor (const key of Object.keys(activeRunData)) {\n\t\t\t\t\t\t\t\t\tiRunExecutionData.resultData.runData[key] = activeRunData[key];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst iRun: IRun = {\n\t\t\t\t\t\t\tdata: iRunExecutionData,\n\t\t\t\t\t\t\tfinished: executionData.finished,\n\t\t\t\t\t\t\tmode: executionData.mode,\n\t\t\t\t\t\t\twaitTill: executionData.data?.waitTill,\n\t\t\t\t\t\t\tstartedAt: executionData.startedAt,\n\t\t\t\t\t\t\tstoppedAt: executionData.stoppedAt,\n\t\t\t\t\t\t\tstatus: 'crashed',\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (executionData.data) {\n\t\t\t\t\t\t\trecoveredPushData = {\n\t\t\t\t\t\t\t\texecutionId: executionData.id,\n\t\t\t\t\t\t\t\tdata: iRun,\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\n\t\t\tif (\n\t\t\t\treceivedData.type === 'workflowFailedToActivate' &&\n\t\t\t\tthis.workflowsStore.workflowId === receivedData.data.workflowId\n\t\t\t) {\n\t\t\t\tthis.workflowsStore.setWorkflowInactive(receivedData.data.workflowId);\n\t\t\t\tthis.workflowsStore.setActive(false);\n\n\t\t\t\tthis.showError(\n\t\t\t\t\tnew Error(receivedData.data.errorMessage),\n\t\t\t\t\tthis.$locale.baseText('workflowActivator.showError.title', {\n\t\t\t\t\t\tinterpolate: { newStateName: 'activated' },\n\t\t\t\t\t}) + ':',\n\t\t\t\t);\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (receivedData.type === 'workflowActivated') {\n\t\t\t\tthis.workflowsStore.setWorkflowActive(receivedData.data.workflowId);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (receivedData.type === 'workflowDeactivated') {\n\t\t\t\tthis.workflowsStore.setWorkflowInactive(receivedData.data.workflowId);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (receivedData.type === 'executionFinished' || receivedData.type === 'executionRecovered') {\n\t\t\t\t// The workflow finished executing\n\t\t\t\tlet pushData: IPushDataExecutionFinished;\n\t\t\t\tif (receivedData.type === 'executionRecovered' && recoveredPushData !== undefined) {\n\t\t\t\t\tpushData = recoveredPushData;\n\t\t\t\t} else {\n\t\t\t\t\tpushData = receivedData.data as IPushDataExecutionFinished;\n\t\t\t\t}\n\n\t\t\t\tif (this.workflowsStore.activeExecutionId === pushData.executionId) {\n\t\t\t\t\tconst activeRunData =\n\t\t\t\t\t\tthis.workflowsStore.workflowExecutionData?.data?.resultData?.runData;\n\t\t\t\t\tif (activeRunData) {\n\t\t\t\t\t\tfor (const key of Object.keys(activeRunData)) {\n\t\t\t\t\t\t\tif (\n\t\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\t?.isArtificialRecoveredEventItem === true &&\n\t\t\t\t\t\t\t\tactiveRunData[key].length > 0\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\tpushData.data.data.resultData.runData[key] = activeRunData[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.workflowsStore.finishActiveExecution(pushData);\n\t\t\t\t}\n\n\t\t\t\tif (!this.uiStore.isActionActive('workflowRunning')) {\n\t\t\t\t\t// No workflow is running so ignore the messages\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tconst { activeExecutionId } = this.workflowsStore;\n\t\t\t\tif (activeExecutionId !== pushData.executionId) {\n\t\t\t\t\t// The workflow which did finish execution did either not get started\n\t\t\t\t\t// by this session or we do not have the execution id yet.\n\t\t\t\t\tif (isRetry !== true) {\n\t\t\t\t\t\tthis.queuePushMessage(event, retryAttempts);\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tconst runDataExecuted = pushData.data;\n\n\t\t\t\tlet runDataExecutedErrorMessage = this.getExecutionError(runDataExecuted.data);\n\n\t\t\t\tif (runDataExecuted.status === 'crashed') {\n\t\t\t\t\trunDataExecutedErrorMessage = this.$locale.baseText(\n\t\t\t\t\t\t'pushConnection.executionFailed.message',\n\t\t\t\t\t);\n\t\t\t\t} else if (runDataExecuted.status === 'canceled') {\n\t\t\t\t\trunDataExecutedErrorMessage = this.$locale.baseText(\n\t\t\t\t\t\t'executionsList.showMessage.stopExecution.message',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinterpolate: { activeExecutionId },\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst lineNumber = runDataExecuted?.data?.resultData?.error?.lineNumber;\n\n\t\t\t\tcodeNodeEditorEventBus.emit('error-line-number', lineNumber || 'final');\n\n\t\t\t\tconst workflow = this.getCurrentWorkflow();\n\t\t\t\tif (runDataExecuted.waitTill !== undefined) {\n\t\t\t\t\tconst activeExecutionId = this.workflowsStore.activeExecutionId;\n\t\t\t\t\tconst workflowSettings = this.workflowsStore.workflowSettings;\n\t\t\t\t\tconst saveManualExecutions = this.rootStore.saveManualExecutions;\n\n\t\t\t\t\tconst isSavingExecutions =\n\t\t\t\t\t\tworkflowSettings.saveManualExecutions === undefined\n\t\t\t\t\t\t\t? saveManualExecutions\n\t\t\t\t\t\t\t: workflowSettings.saveManualExecutions;\n\n\t\t\t\t\tlet action;\n\t\t\t\t\tif (!isSavingExecutions) {\n\t\t\t\t\t\tglobalLinkActionsEventBus.emit('registerGlobalLinkAction', {\n\t\t\t\t\t\t\tkey: 'open-settings',\n\t\t\t\t\t\t\taction: async () => {\n\t\t\t\t\t\t\t\tif (this.workflowsStore.isNewWorkflow) await this.saveAsNewWorkflow();\n\t\t\t\t\t\t\t\tthis.uiStore.openModal(WORKFLOW_SETTINGS_MODAL_KEY);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\taction =\n\t\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\t} else {\n\t\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\t}\n\n\t\t\t\t\t// Workflow did start but had been put to wait\n\t\t\t\t\tthis.titleSet(workflow.name as string, 'IDLE');\n\t\t\t\t\tthis.showToast({\n\t\t\t\t\t\ttitle: 'Workflow started waiting',\n\t\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\t\ttype: 'success',\n\t\t\t\t\t\tduration: 0,\n\t\t\t\t\t});\n\t\t\t\t} else if (runDataExecuted.finished !== true) {\n\t\t\t\t\tthis.titleSet(workflow.name as string, 'ERROR');\n\n\t\t\t\t\tif (\n\t\t\t\t\t\trunDataExecuted.data.resultData.error?.name === 'ExpressionError' &&\n\t\t\t\t\t\t(runDataExecuted.data.resultData.error as ExpressionError).context.functionality ===\n\t\t\t\t\t\t\t'pairedItem'\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst error = runDataExecuted.data.resultData.error as ExpressionError;\n\n\t\t\t\t\t\tvoid this.getWorkflowDataToSave().then((workflowData) => {\n\t\t\t\t\t\t\tconst eventData: IDataObject = {\n\t\t\t\t\t\t\t\tcaused_by_credential: false,\n\t\t\t\t\t\t\t\terror_message: error.description,\n\t\t\t\t\t\t\t\terror_title: error.message,\n\t\t\t\t\t\t\t\terror_type: error.context.type,\n\t\t\t\t\t\t\t\tnode_graph_string: JSON.stringify(\n\t\t\t\t\t\t\t\t\tTelemetryHelpers.generateNodesGraph(\n\t\t\t\t\t\t\t\t\t\tworkflowData as IWorkflowBase,\n\t\t\t\t\t\t\t\t\t\tthis.getNodeTypes(),\n\t\t\t\t\t\t\t\t\t).nodeGraph,\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tworkflow_id: this.workflowsStore.workflowId,\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\terror.context.nodeCause &&\n\t\t\t\t\t\t\t\t['no pairing info', 'invalid pairing info'].includes(error.context.type as string)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tconst node = workflow.getNode(error.context.nodeCause as string);\n\n\t\t\t\t\t\t\t\tif (node) {\n\t\t\t\t\t\t\t\t\teventData.is_pinned = !!workflow.getPinDataOfNode(node.name);\n\t\t\t\t\t\t\t\t\teventData.mode = node.parameters.mode;\n\t\t\t\t\t\t\t\t\teventData.node_type = node.type;\n\t\t\t\t\t\t\t\t\teventData.operation = node.parameters.operation;\n\t\t\t\t\t\t\t\t\teventData.resource = node.parameters.resource;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tthis.$telemetry.track('Instance FE emitted paired item error', eventData, {\n\t\t\t\t\t\t\t\twithPostHog: true,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tif (runDataExecuted.data.resultData.error?.name === 'SubworkflowOperationError') {\n\t\t\t\t\t\tconst error = runDataExecuted.data.resultData.error as SubworkflowOperationError;\n\n\t\t\t\t\t\tthis.workflowsStore.subWorkflowExecutionError = error;\n\n\t\t\t\t\t\tthis.showMessage({\n\t\t\t\t\t\t\ttitle: error.message,\n\t\t\t\t\t\t\tmessage: error.description,\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});\n\t\t\t\t\t} else if (\n\t\t\t\t\t\trunDataExecuted.data.resultData.error?.name === 'NodeOperationError' &&\n\t\t\t\t\t\t(runDataExecuted.data.resultData.error as NodeOperationError).functionality ===\n\t\t\t\t\t\t\t'configuration-node'\n\t\t\t\t\t) {\n\t\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\t\tlet title: string;\n\t\t\t\t\t\tconst nodeError = runDataExecuted.data.resultData.error as NodeOperationError;\n\t\t\t\t\t\tif (nodeError.node.name) {\n\t\t\t\t\t\t\ttitle = `Error in sub-node ‘${nodeError.node.name}‘`;\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\tthis.showMessage({\n\t\t\t\t\t\t\ttitle,\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t(nodeError?.description ?? runDataExecutedErrorMessage) +\n\t\t\t\t\t\t\t\tthis.$locale.baseText('pushConnection.executionError.openNode', {\n\t\t\t\t\t\t\t\t\tinterpolate: {\n\t\t\t\t\t\t\t\t\t\tnode: nodeError.node.name,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}),\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} else {\n\t\t\t\t\t\tlet title: string;\n\t\t\t\t\t\tconst isManualExecutionCancelled =\n\t\t\t\t\t\t\trunDataExecuted.mode === 'manual' && runDataExecuted.status === 'canceled';\n\n\t\t\t\t\t\t// Do not show the error message if the workflow got canceled manually\n\t\t\t\t\t\tif (isManualExecutionCancelled) {\n\t\t\t\t\t\t\tthis.showMessage({\n\t\t\t\t\t\t\t\ttitle: this.$locale.baseText('nodeView.showMessage.stopExecutionTry.title'),\n\t\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (runDataExecuted.data.resultData.lastNodeExecuted) {\n\t\t\t\t\t\t\t\ttitle = `Problem in node ‘${runDataExecuted.data.resultData.lastNodeExecuted}‘`;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttitle = 'Problem executing workflow';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tthis.showMessage({\n\t\t\t\t\t\t\t\ttitle,\n\t\t\t\t\t\t\t\tmessage: runDataExecutedErrorMessage,\n\t\t\t\t\t\t\t\ttype: 'error',\n\t\t\t\t\t\t\t\tduration: 0,\n\t\t\t\t\t\t\t\tdangerouslyUseHTMLString: true,\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} else {\n\t\t\t\t\t// Workflow did execute without a problem\n\t\t\t\t\tthis.titleSet(workflow.name as string, 'IDLE');\n\n\t\t\t\t\tconst execution = this.workflowsStore.getWorkflowExecution;\n\t\t\t\t\tif (execution?.executedNode) {\n\t\t\t\t\t\tconst node = this.workflowsStore.getNodeByName(execution.executedNode);\n\t\t\t\t\t\tconst nodeType = node && this.nodeTypesStore.getNodeType(node.type, node.typeVersion);\n\t\t\t\t\t\tconst nodeOutput =\n\t\t\t\t\t\t\texecution &&\n\t\t\t\t\t\t\texecution.executedNode &&\n\t\t\t\t\t\t\texecution.data?.resultData?.runData?.[execution.executedNode];\n\t\t\t\t\t\tif (nodeType?.polling && !nodeOutput) {\n\t\t\t\t\t\t\tthis.showMessage({\n\t\t\t\t\t\t\t\ttitle: this.$locale.baseText('pushConnection.pollingNode.dataNotFound', {\n\t\t\t\t\t\t\t\t\tinterpolate: {\n\t\t\t\t\t\t\t\t\t\tservice: getTriggerNodeServiceName(nodeType),\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\tmessage: this.$locale.baseText('pushConnection.pollingNode.dataNotFound.message', {\n\t\t\t\t\t\t\t\t\tinterpolate: {\n\t\t\t\t\t\t\t\t\t\tservice: getTriggerNodeServiceName(nodeType),\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.showMessage({\n\t\t\t\t\t\t\t\ttitle: this.$locale.baseText('pushConnection.nodeExecutedSuccessfully'),\n\t\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.showMessage({\n\t\t\t\t\t\t\ttitle: this.$locale.baseText('pushConnection.workflowExecutedSuccessfully'),\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}\n\n\t\t\t\t// It does not push the runData as it got already pushed with each\n\t\t\t\t// node that did finish. For that reason copy in here the data\n\t\t\t\t// which we already have.\n\t\t\t\tif (this.workflowsStore.getWorkflowRunData) {\n\t\t\t\t\trunDataExecuted.data.resultData.runData = this.workflowsStore.getWorkflowRunData;\n\t\t\t\t}\n\n\t\t\t\tthis.workflowsStore.executingNode.length = 0;\n\t\t\t\tthis.workflowsStore.setWorkflowExecutionData(runDataExecuted as IExecutionResponse);\n\t\t\t\tthis.uiStore.removeActiveAction('workflowRunning');\n\n\t\t\t\t// Set the node execution issues on all the nodes which produced an error so that\n\t\t\t\t// it can be displayed in the node-view\n\t\t\t\tthis.nodeHelpers.updateNodesExecutionIssues();\n\n\t\t\t\tconst lastNodeExecuted: string | undefined =\n\t\t\t\t\trunDataExecuted.data.resultData.lastNodeExecuted;\n\t\t\t\tlet itemsCount = 0;\n\t\t\t\tif (\n\t\t\t\t\tlastNodeExecuted &&\n\t\t\t\t\trunDataExecuted.data.resultData.runData[lastNodeExecuted] &&\n\t\t\t\t\t!runDataExecutedErrorMessage\n\t\t\t\t) {\n\t\t\t\t\titemsCount =\n\t\t\t\t\t\trunDataExecuted.data.resultData.runData[lastNodeExecuted][0].data!.main[0]!.length;\n\t\t\t\t}\n\n\t\t\t\tvoid useExternalHooks().run('pushConnection.executionFinished', {\n\t\t\t\t\titemsCount,\n\t\t\t\t\tnodeName: runDataExecuted.data.resultData.lastNodeExecuted,\n\t\t\t\t\terrorMessage: runDataExecutedErrorMessage,\n\t\t\t\t\trunDataExecutedStartData: runDataExecuted.data.startData,\n\t\t\t\t\tresultDataError: runDataExecuted.data.resultData.error,\n\t\t\t\t});\n\t\t\t\tif (!runDataExecuted.data.resultData.error) {\n\t\t\t\t\tthis.segmentStore.trackSuccessfulWorkflowExecution(runDataExecuted);\n\t\t\t\t}\n\t\t\t} else if (receivedData.type === 'executionStarted') {\n\t\t\t\tconst pushData = receivedData.data;\n\n\t\t\t\tconst executionData: IExecutionsCurrentSummaryExtended = {\n\t\t\t\t\tid: pushData.executionId,\n\t\t\t\t\tfinished: false,\n\t\t\t\t\tmode: pushData.mode,\n\t\t\t\t\tstartedAt: pushData.startedAt,\n\t\t\t\t\tretryOf: pushData.retryOf,\n\t\t\t\t\tworkflowId: pushData.workflowId,\n\t\t\t\t\tworkflowName: pushData.workflowName,\n\t\t\t\t};\n\n\t\t\t\tthis.workflowsStore.addActiveExecution(executionData);\n\t\t\t} else if (receivedData.type === 'nodeExecuteAfter') {\n\t\t\t\t// A node finished to execute. Add its data\n\t\t\t\tconst pushData = receivedData.data;\n\t\t\t\tthis.workflowsStore.addNodeExecutionData(pushData);\n\t\t\t\tthis.workflowsStore.removeExecutingNode(pushData.nodeName);\n\t\t\t} else if (receivedData.type === 'nodeExecuteBefore') {\n\t\t\t\t// A node started to be executed. Set it as executing.\n\t\t\t\tconst pushData = receivedData.data;\n\t\t\t\tthis.workflowsStore.addExecutingNode(pushData.nodeName);\n\t\t\t} else if (receivedData.type === 'testWebhookDeleted') {\n\t\t\t\t// A test-webhook was deleted\n\t\t\t\tconst pushData = receivedData.data;\n\n\t\t\t\tif (pushData.workflowId === this.workflowsStore.workflowId) {\n\t\t\t\t\tthis.workflowsStore.executionWaitingForWebhook = false;\n\t\t\t\t\tthis.uiStore.removeActiveAction('workflowRunning');\n\t\t\t\t}\n\t\t\t} else if (receivedData.type === 'testWebhookReceived') {\n\t\t\t\t// A test-webhook did get called\n\t\t\t\tconst pushData = receivedData.data;\n\n\t\t\t\tif (pushData.workflowId === this.workflowsStore.workflowId) {\n\t\t\t\t\tthis.workflowsStore.executionWaitingForWebhook = false;\n\t\t\t\t\tthis.workflowsStore.activeExecutionId = pushData.executionId;\n\t\t\t\t}\n\n\t\t\t\tvoid this.processWaitingPushMessages();\n\t\t\t} else if (receivedData.type === 'reloadNodeType') {\n\t\t\t\tawait this.nodeTypesStore.getNodeTypes();\n\t\t\t\tawait this.nodeTypesStore.getFullNodesProperties([receivedData.data]);\n\t\t\t} else if (receivedData.type === 'removeNodeType') {\n\t\t\t\tconst pushData = receivedData.data;\n\n\t\t\t\tconst nodesToBeRemoved: INodeTypeNameVersion[] = [pushData];\n\n\t\t\t\t// Force reload of all credential types\n\t\t\t\tawait this.credentialsStore.fetchCredentialTypes(false).then(() => {\n\t\t\t\t\tthis.nodeTypesStore.removeNodeTypes(nodesToBeRemoved);\n\t\t\t\t});\n\t\t\t} else if (receivedData.type === 'nodeDescriptionUpdated') {\n\t\t\t\tawait this.nodeTypesStore.getNodeTypes();\n\t\t\t\tawait this.credentialsStore.fetchCredentialTypes(true);\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\t\tgetExecutionError(data: IRunExecutionData | IExecuteContextData) {\n\t\t\tconst error = data.resultData.error;\n\n\t\t\tlet errorMessage: string;\n\n\t\t\tif (data.resultData.lastNodeExecuted && error) {\n\t\t\t\terrorMessage = error.message || error.description;\n\t\t\t} else {\n\t\t\t\terrorMessage = this.$locale.baseText('pushConnection.executionError', {\n\t\t\t\t\tinterpolate: { error: '!' },\n\t\t\t\t});\n\n\t\t\t\tif (error?.message) {\n\t\t\t\t\tlet nodeName: string | undefined;\n\t\t\t\t\tif ('node' in error) {\n\t\t\t\t\t\tnodeName = typeof error.node === 'string' ? error.node : error.node!.name;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst receivedError = nodeName ? `${nodeName}: ${error.message}` : error.message;\n\t\t\t\t\terrorMessage = this.$locale.baseText('pushConnection.executionError', {\n\t\t\t\t\t\tinterpolate: {\n\t\t\t\t\t\t\terror: `.${this.$locale.baseText('pushConnection.executionError.details', {\n\t\t\t\t\t\t\t\tinterpolate: {\n\t\t\t\t\t\t\t\t\tdetails: receivedError,\n\t\t\t\t\t\t\t\t},\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\n\t\t\treturn errorMessage;\n\t\t},\n\t},\n});\n"],"names":["GET_STATUS_ENDPOINT","sendGetWorkerStatus","context","makeRestApiRequest","WORKER_HISTORY_LENGTH","STALE_SECONDS","useOrchestrationStore","defineStore","data","id","rootStore","useRootStore","workerId","pushConnection","defineComponent","useTitleChange","useToast","useNodeHelpers","message","workflowHelpers","mapStores","useCredentialsStore","useNodeTypesStore","useUIStore","useWorkflowsStore","useSettingsStore","useSegment","usePushConnectionStore","useCollaborationStore","event","retryAttempts","queueLength","i","messageData","receivedData","isRetry","pushData","recoveredPushData","recoveredExecutionId","_a","executionData","parse","iRunExecutionData","_b","_c","_d","_e","activeRunData","_h","_g","_f","key","iRun","_i","_l","_k","_j","_s","_r","_q","_p","_o","_n","_m","activeExecutionId","runDataExecuted","runDataExecutedErrorMessage","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":"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,EACR,EACA,kBAAkB1B,EAA+C,CAC1D,MAAAwE,EAAQxE,EAAK,WAAW,MAE1B,IAAA4F,EAEA,GAAA5F,EAAK,WAAW,kBAAoBwE,EACxBoB,EAAApB,EAAM,SAAWA,EAAM,oBAEvBoB,EAAA,KAAK,QAAQ,SAAS,gCAAiC,CACrE,YAAa,CAAE,MAAO,GAAI,CAAA,CAC1B,EAEGpB,GAAA,MAAAA,EAAO,QAAS,CACf,IAAAqB,EACA,SAAUrB,IACbqB,EAAW,OAAOrB,EAAM,MAAS,SAAWA,EAAM,KAAOA,EAAM,KAAM,MAGhE,MAAAsB,EAAgBD,EAAW,GAAGA,CAAQ,KAAKrB,EAAM,OAAO,GAAKA,EAAM,QAC1DoB,EAAA,KAAK,QAAQ,SAAS,gCAAiC,CACrE,YAAa,CACZ,MAAO,IAAI,KAAK,QAAQ,SAAS,wCAAyC,CACzE,YAAa,CACZ,QAASE,CACV,CACA,CAAA,CAAC,EACH,CAAA,CACA,CACF,CAGM,OAAAF,CACR,CACD,CACD,CAAC"}
@@ -1,2 +1,2 @@
1
- import{fA as d,V as i,fI as m}from"./n8n-ZKR6bms9.js";import{aa as f}from"./index--RuZ5wHr.js";const p=(e,o)=>`${e}-${o}`,w=e=>!!e.credentials&&Object.keys(e.credentials).length>0,T=e=>Object.fromEntries(Object.entries(e).map(([o,t])=>typeof t=="string"?[o,t]:[o,t.name])),E=(e,o)=>{if(!e)return;const t={},r=T(e);for(const n in r){const a=r[n],s=p(n,a),c=o[s];c&&(t[n]=c)}return t},u=(e,o)=>e.map(t=>w(t)?{...t,credentials:E(t.credentials,o)}:t);async function h(e,o,t,r){const n=await m(t.getRestApiContext,e.name),a=u(e.workflow.nodes,o),s=f(a),c=e.workflow.connections,l={name:n.name,nodes:s,connections:c,active:!1};return await r.createNewWorkflow(l)}async function A(e){const{router:o,templateId:t,inNewBrowserTab:r=!1,posthogStore:n}=e,a=n.isFeatureEnabled(d)?{name:i.TEMPLATE_SETUP,params:{id:t}}:{name:i.TEMPLATE_IMPORT,params:{id:t}};if(r){const s=o.resolve(a);window.open(s.href,"_blank")}else await o.push(a)}export{h as c,w as h,p as k,T as n,A as o};
2
- //# sourceMappingURL=templateActions-CZfTXoBx.js.map
1
+ import{fA as d,V as i,fI as m}from"./n8n-ZKR6bms9.js";import{aa as f}from"./index-RXjMHIPR.js";const p=(e,o)=>`${e}-${o}`,w=e=>!!e.credentials&&Object.keys(e.credentials).length>0,T=e=>Object.fromEntries(Object.entries(e).map(([o,t])=>typeof t=="string"?[o,t]:[o,t.name])),E=(e,o)=>{if(!e)return;const t={},r=T(e);for(const n in r){const a=r[n],s=p(n,a),c=o[s];c&&(t[n]=c)}return t},u=(e,o)=>e.map(t=>w(t)?{...t,credentials:E(t.credentials,o)}:t);async function h(e,o,t,r){const n=await m(t.getRestApiContext,e.name),a=u(e.workflow.nodes,o),s=f(a),c=e.workflow.connections,l={name:n.name,nodes:s,connections:c,active:!1};return await r.createNewWorkflow(l)}async function A(e){const{router:o,templateId:t,inNewBrowserTab:r=!1,posthogStore:n}=e,a=n.isFeatureEnabled(d)?{name:i.TEMPLATE_SETUP,params:{id:t}}:{name:i.TEMPLATE_IMPORT,params:{id:t}};if(r){const s=o.resolve(a);window.open(s.href,"_blank")}else await o.push(a)}export{h as c,w as h,p as k,T as n,A as o};
2
+ //# sourceMappingURL=templateActions-y8msVyEB.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"templateActions-CZfTXoBx.js","sources":["../../src/utils/templates/templateTransforms.ts","../../src/utils/templates/templateActions.ts"],"sourcesContent":["import type { IWorkflowTemplateNode, IWorkflowTemplateNodeCredentials } from '@/Interface';\nimport type { NormalizedTemplateNodeCredentials } from '@/utils/templates/templateTypes';\nimport type { INodeCredentials, INodeCredentialsDetails } from 'n8n-workflow';\n\nexport type IWorkflowTemplateNodeWithCredentials = IWorkflowTemplateNode &\n\tRequired<Pick<IWorkflowTemplateNode, 'credentials'>>;\n\nconst credentialKeySymbol = Symbol('credentialKey');\n\n/**\n * A key that uniquely identifies a credential in a template node.\n * It encodes the credential type name and the credential name.\n * Uses a symbol typing trick to get nominal typing.\n * Use `keyFromCredentialTypeAndName` to create a key.\n */\nexport type TemplateCredentialKey = string & { [credentialKeySymbol]: never };\n\n/**\n * Forms a key from credential type name and credential name\n */\nexport const keyFromCredentialTypeAndName = (\n\tcredentialTypeName: string,\n\tcredentialName: string,\n): TemplateCredentialKey => `${credentialTypeName}-${credentialName}` as TemplateCredentialKey;\n\n/**\n * Checks if a template workflow node has credentials defined\n */\nexport const hasNodeCredentials = (\n\tnode: IWorkflowTemplateNode,\n): node is IWorkflowTemplateNodeWithCredentials =>\n\t!!node.credentials && Object.keys(node.credentials).length > 0;\n\n/**\n * Normalizes the credentials of a template node. Templates created with\n * different versions of n8n may have different credential formats.\n */\nexport const normalizeTemplateNodeCredentials = (\n\tcredentials: IWorkflowTemplateNodeCredentials,\n): NormalizedTemplateNodeCredentials => {\n\treturn Object.fromEntries(\n\t\tObject.entries(credentials).map(([key, value]) => {\n\t\t\treturn typeof value === 'string' ? [key, value] : [key, value.name];\n\t\t}),\n\t);\n};\n\n/**\n * Replaces the credentials of a node with the given replacements\n *\n * @example\n * const nodeCredentials = { twitterOAuth1Api: \"twitter\" };\n * const toReplaceByKey = { 'twitterOAuth1Api-twitter': {\n * id: \"BrEOZ5Cje6VYh9Pc\",\n * name: \"X OAuth account\"\n * }};\n * replaceTemplateNodeCredentials(nodeCredentials, toReplaceByKey);\n * // => { twitterOAuth1Api: { id: \"BrEOZ5Cje6VYh9Pc\", name: \"X OAuth account\" } }\n */\nexport const replaceTemplateNodeCredentials = (\n\tnodeCredentials: IWorkflowTemplateNodeCredentials,\n\ttoReplaceByKey: Record<TemplateCredentialKey, INodeCredentialsDetails>,\n) => {\n\tif (!nodeCredentials) {\n\t\treturn undefined;\n\t}\n\n\tconst newNodeCredentials: INodeCredentials = {};\n\tconst normalizedCredentials = normalizeTemplateNodeCredentials(nodeCredentials);\n\tfor (const credentialType in normalizedCredentials) {\n\t\tconst credentialNameInTemplate = normalizedCredentials[credentialType];\n\t\tconst key = keyFromCredentialTypeAndName(credentialType, credentialNameInTemplate);\n\t\tconst toReplaceWith = toReplaceByKey[key];\n\t\tif (toReplaceWith) {\n\t\t\tnewNodeCredentials[credentialType] = toReplaceWith;\n\t\t}\n\t}\n\n\treturn newNodeCredentials;\n};\n\n/**\n * Replaces the credentials of all template workflow nodes with the given\n * replacements\n */\nexport const replaceAllTemplateNodeCredentials = (\n\tnodes: IWorkflowTemplateNode[],\n\ttoReplaceWith: Record<TemplateCredentialKey, INodeCredentialsDetails>,\n) => {\n\treturn nodes.map((node) => {\n\t\tif (hasNodeCredentials(node)) {\n\t\t\treturn {\n\t\t\t\t...node,\n\t\t\t\tcredentials: replaceTemplateNodeCredentials(node.credentials, toReplaceWith),\n\t\t\t};\n\t\t}\n\n\t\treturn node;\n\t});\n};\n","import type { INodeUi, IWorkflowData, IWorkflowTemplate } 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 { TemplateCredentialKey } from '@/utils/templates/templateTransforms';\nimport { replaceAllTemplateNodeCredentials } from '@/utils/templates/templateTransforms';\nimport type { INodeCredentialsDetails } from 'n8n-workflow';\nimport type { RouteLocationRaw, Router } from 'vue-router';\n\n/**\n * Creates a new workflow from a template\n */\nexport async function createWorkflowFromTemplate(\n\ttemplate: IWorkflowTemplate,\n\tcredentialOverrides: Record<TemplateCredentialKey, INodeCredentialsDetails>,\n\trootStore: ReturnType<typeof useRootStore>,\n\tworkflowsStore: ReturnType<typeof useWorkflowsStore>,\n) {\n\tconst workflowData = await getNewWorkflow(rootStore.getRestApiContext, template.name);\n\tconst nodesWithCreds = replaceAllTemplateNodeCredentials(\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\t// Ignored: pinData, settings, tags, versionId, meta\n\t};\n\n\tconst createdWorkflow = await workflowsStore.createNewWorkflow(workflowToCreate);\n\n\treturn createdWorkflow;\n}\n\n/**\n * Opens the template credential setup view (or workflow view\n * if the feature flag is disabled)\n */\nexport async function openTemplateCredentialSetup(opts: {\n\tposthogStore: PosthogStore;\n\ttemplateId: string;\n\trouter: Router;\n\tinNewBrowserTab?: boolean;\n}) {\n\tconst { router, templateId, inNewBrowserTab = false, posthogStore } = opts;\n\n\tconst routeLocation: RouteLocationRaw = posthogStore.isFeatureEnabled(\n\t\tTEMPLATE_CREDENTIAL_SETUP_EXPERIMENT,\n\t)\n\t\t? {\n\t\t\t\tname: VIEWS.TEMPLATE_SETUP,\n\t\t\t\tparams: { id: templateId },\n\t\t }\n\t\t: {\n\t\t\t\tname: VIEWS.TEMPLATE_IMPORT,\n\t\t\t\tparams: { id: templateId },\n\t\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"],"names":["keyFromCredentialTypeAndName","credentialTypeName","credentialName","hasNodeCredentials","node","normalizeTemplateNodeCredentials","credentials","key","value","replaceTemplateNodeCredentials","nodeCredentials","toReplaceByKey","newNodeCredentials","normalizedCredentials","credentialType","credentialNameInTemplate","toReplaceWith","replaceAllTemplateNodeCredentials","nodes","createWorkflowFromTemplate","template","credentialOverrides","rootStore","workflowsStore","workflowData","getNewWorkflow","nodesWithCreds","getFixedNodesList","connections","workflowToCreate","openTemplateCredentialSetup","opts","router","templateId","inNewB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C,CACF,KAAM,CAAE,OAAAC,EAAQ,WAAAC,EAAY,gBAAAC,EAAkB,GAAO,aAAAC,CAAiB,EAAAJ,EAEhEK,EAAkCD,EAAa,iBACpDE,CAAA,EAEE,CACA,KAAMC,EAAM,eACZ,OAAQ,CAAE,GAAIL,CAAW,CAAA,EAEzB,CACA,KAAMK,EAAM,gBACZ,OAAQ,CAAE,GAAIL,CAAW,CAAA,EAG5B,GAAIC,EAAiB,CACd,MAAAK,EAAQP,EAAO,QAAQI,CAAa,EACnC,OAAA,KAAKG,EAAM,KAAM,QAAQ,CAAA,MAE1B,MAAAP,EAAO,KAAKI,CAAa,CAEjC"}
1
+ {"version":3,"file":"templateActions-y8msVyEB.js","sources":["../../src/utils/templates/templateTransforms.ts","../../src/utils/templates/templateActions.ts"],"sourcesContent":["import type { IWorkflowTemplateNode, IWorkflowTemplateNodeCredentials } from '@/Interface';\nimport type { NormalizedTemplateNodeCredentials } from '@/utils/templates/templateTypes';\nimport type { INodeCredentials, INodeCredentialsDetails } from 'n8n-workflow';\n\nexport type IWorkflowTemplateNodeWithCredentials = IWorkflowTemplateNode &\n\tRequired<Pick<IWorkflowTemplateNode, 'credentials'>>;\n\nconst credentialKeySymbol = Symbol('credentialKey');\n\n/**\n * A key that uniquely identifies a credential in a template node.\n * It encodes the credential type name and the credential name.\n * Uses a symbol typing trick to get nominal typing.\n * Use `keyFromCredentialTypeAndName` to create a key.\n */\nexport type TemplateCredentialKey = string & { [credentialKeySymbol]: never };\n\n/**\n * Forms a key from credential type name and credential name\n */\nexport const keyFromCredentialTypeAndName = (\n\tcredentialTypeName: string,\n\tcredentialName: string,\n): TemplateCredentialKey => `${credentialTypeName}-${credentialName}` as TemplateCredentialKey;\n\n/**\n * Checks if a template workflow node has credentials defined\n */\nexport const hasNodeCredentials = (\n\tnode: IWorkflowTemplateNode,\n): node is IWorkflowTemplateNodeWithCredentials =>\n\t!!node.credentials && Object.keys(node.credentials).length > 0;\n\n/**\n * Normalizes the credentials of a template node. Templates created with\n * different versions of n8n may have different credential formats.\n */\nexport const normalizeTemplateNodeCredentials = (\n\tcredentials: IWorkflowTemplateNodeCredentials,\n): NormalizedTemplateNodeCredentials => {\n\treturn Object.fromEntries(\n\t\tObject.entries(credentials).map(([key, value]) => {\n\t\t\treturn typeof value === 'string' ? [key, value] : [key, value.name];\n\t\t}),\n\t);\n};\n\n/**\n * Replaces the credentials of a node with the given replacements\n *\n * @example\n * const nodeCredentials = { twitterOAuth1Api: \"twitter\" };\n * const toReplaceByKey = { 'twitterOAuth1Api-twitter': {\n * id: \"BrEOZ5Cje6VYh9Pc\",\n * name: \"X OAuth account\"\n * }};\n * replaceTemplateNodeCredentials(nodeCredentials, toReplaceByKey);\n * // => { twitterOAuth1Api: { id: \"BrEOZ5Cje6VYh9Pc\", name: \"X OAuth account\" } }\n */\nexport const replaceTemplateNodeCredentials = (\n\tnodeCredentials: IWorkflowTemplateNodeCredentials,\n\ttoReplaceByKey: Record<TemplateCredentialKey, INodeCredentialsDetails>,\n) => {\n\tif (!nodeCredentials) {\n\t\treturn undefined;\n\t}\n\n\tconst newNodeCredentials: INodeCredentials = {};\n\tconst normalizedCredentials = normalizeTemplateNodeCredentials(nodeCredentials);\n\tfor (const credentialType in normalizedCredentials) {\n\t\tconst credentialNameInTemplate = normalizedCredentials[credentialType];\n\t\tconst key = keyFromCredentialTypeAndName(credentialType, credentialNameInTemplate);\n\t\tconst toReplaceWith = toReplaceByKey[key];\n\t\tif (toReplaceWith) {\n\t\t\tnewNodeCredentials[credentialType] = toReplaceWith;\n\t\t}\n\t}\n\n\treturn newNodeCredentials;\n};\n\n/**\n * Replaces the credentials of all template workflow nodes with the given\n * replacements\n */\nexport const replaceAllTemplateNodeCredentials = (\n\tnodes: IWorkflowTemplateNode[],\n\ttoReplaceWith: Record<TemplateCredentialKey, INodeCredentialsDetails>,\n) => {\n\treturn nodes.map((node) => {\n\t\tif (hasNodeCredentials(node)) {\n\t\t\treturn {\n\t\t\t\t...node,\n\t\t\t\tcredentials: replaceTemplateNodeCredentials(node.credentials, toReplaceWith),\n\t\t\t};\n\t\t}\n\n\t\treturn node;\n\t});\n};\n","import type { INodeUi, IWorkflowData, IWorkflowTemplate } 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 { TemplateCredentialKey } from '@/utils/templates/templateTransforms';\nimport { replaceAllTemplateNodeCredentials } from '@/utils/templates/templateTransforms';\nimport type { INodeCredentialsDetails } from 'n8n-workflow';\nimport type { RouteLocationRaw, Router } from 'vue-router';\n\n/**\n * Creates a new workflow from a template\n */\nexport async function createWorkflowFromTemplate(\n\ttemplate: IWorkflowTemplate,\n\tcredentialOverrides: Record<TemplateCredentialKey, INodeCredentialsDetails>,\n\trootStore: ReturnType<typeof useRootStore>,\n\tworkflowsStore: ReturnType<typeof useWorkflowsStore>,\n) {\n\tconst workflowData = await getNewWorkflow(rootStore.getRestApiContext, template.name);\n\tconst nodesWithCreds = replaceAllTemplateNodeCredentials(\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\t// Ignored: pinData, settings, tags, versionId, meta\n\t};\n\n\tconst createdWorkflow = await workflowsStore.createNewWorkflow(workflowToCreate);\n\n\treturn createdWorkflow;\n}\n\n/**\n * Opens the template credential setup view (or workflow view\n * if the feature flag is disabled)\n */\nexport async function openTemplateCredentialSetup(opts: {\n\tposthogStore: PosthogStore;\n\ttemplateId: string;\n\trouter: Router;\n\tinNewBrowserTab?: boolean;\n}) {\n\tconst { router, templateId, inNewBrowserTab = false, posthogStore } = opts;\n\n\tconst routeLocation: RouteLocationRaw = posthogStore.isFeatureEnabled(\n\t\tTEMPLATE_CREDENTIAL_SETUP_EXPERIMENT,\n\t)\n\t\t? {\n\t\t\t\tname: VIEWS.TEMPLATE_SETUP,\n\t\t\t\tparams: { id: templateId },\n\t\t }\n\t\t: {\n\t\t\t\tname: VIEWS.TEMPLATE_IMPORT,\n\t\t\t\tparams: { id: templateId },\n\t\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"],"names":["keyFromCredentialTypeAndName","credentialTypeName","credentialName","hasNodeCredentials","node","normalizeTemplateNodeCredentials","credentials","key","value","replaceTemplateNodeCredentials","nodeCredentials","toReplaceByKey","newNodeCredentials","normalizedCredentials","credentialType","credentialNameInTemplate","toReplaceWith","replaceAllTemplateNodeCredentials","nodes","createWorkflowFromTemplate","template","credentialOverrides","rootStore","workflowsStore","workflowData","getNewWorkflow","nodesWithCreds","getFixedNodesList","connections","workflowToCreate","openTemplateCredentialSetup","opts","router","templateId","inNewBrowserTab","posthogStore","routeLocation","TEMPLATE_CREDENTIAL_SETUP_EXPERIMENT","VIEWS","route"],"mappings":"+FAoBO,MAAMA,EAA+B,CAC3CC,EACAC,IAC2B,GAAGD,CAAkB,IAAIC,CAAc,GAKtDC,EACZC,GAEA,CAAC,CAACA,EAAK,aAAe,OAAO,KAAKA,EAAK,WAAW,EAAE,OAAS,EAMjDC,EACZC,GAEO,OAAO,YACb,OAAO,QAAQA,CAAW,EAAE,IAAI,CAAC,CAACC,EAAKC,CAAK,IACpC,OAAOA,GAAU,SAAW,CAACD,EAAKC,CAAK,EAAI,CAACD,EAAKC,EAAM,IAAI,CAClE,CAAA,EAgBUC,EAAiC,CAC7CC,EACAC,IACI,CACJ,GAAI,CAACD,EACG,OA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import{o as S,B,t as W,u as C,R as I,ac as P,V as v,v as L,dH as h,O,M as U}from"./n8n-ZKR6bms9.js";import{a as A}from"./index--RuZ5wHr.js";const Y=()=>{const T=O(),E=_(),t=U(),N=A(),g=S(),s=B(),M=W(),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,p=Object.keys(b),d=p.filter(e=>!f.some(i=>i.name===e)),y=Object.keys(s.workflow.pinData??{}),u=p.filter(e=>y.includes(e));if(u.length>0){const e=l("p",[t.baseText("nodeView.confirmMessage.debug.message"),l("ul",{class:"mt-l ml-l"},u.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)u.forEach(n=>{const r=s.getNodeByName(n);r&&s.unpinData({node:r})});else{await E.push({name:v.EXECUTION_PREVIEW,params:{name:m.id,executionId:o}});return}}s.setWorkflowExecutionData(a);const w=f.filter(e=>!m.getParentNodes(e.name).length);let D=0;w.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"}),d.length&&g.showToast({title:t.baseText("nodeView.showMessage.debug.missingNodes.title"),message:t.baseText("nodeView.showMessage.debug.missingNodes.content",{interpolate:{nodeNames:d.join(", ")}}),type:"warning"}),T.track("User clicked debug execution button",{instance_id:L().instanceId,exec_status:a.status,override_pinned_data:w.length===D,all_exec_data_imported:d.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{Y as u};
2
- //# sourceMappingURL=useExecutionDebugging-FPo5qMF0.js.map
1
+ import{aH as _,e as V,af as l}from"./vendor-2CfOYFi2.js";import{o as S,B,t as W,u as C,R as I,ac as P,V as v,v as L,dH as h,O,M as U}from"./n8n-ZKR6bms9.js";import{a as A}from"./index-RXjMHIPR.js";const Y=()=>{const T=O(),E=_(),t=U(),N=A(),g=S(),s=B(),M=W(),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,p=Object.keys(b),d=p.filter(e=>!f.some(i=>i.name===e)),y=Object.keys(s.workflow.pinData??{}),u=p.filter(e=>y.includes(e));if(u.length>0){const e=l("p",[t.baseText("nodeView.confirmMessage.debug.message"),l("ul",{class:"mt-l ml-l"},u.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)u.forEach(n=>{const r=s.getNodeByName(n);r&&s.unpinData({node:r})});else{await E.push({name:v.EXECUTION_PREVIEW,params:{name:m.id,executionId:o}});return}}s.setWorkflowExecutionData(a);const w=f.filter(e=>!m.getParentNodes(e.name).length);let D=0;w.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"}),d.length&&g.showToast({title:t.baseText("nodeView.showMessage.debug.missingNodes.title"),message:t.baseText("nodeView.showMessage.debug.missingNodes.content",{interpolate:{nodeNames:d.join(", ")}}),type:"warning"}),T.track("User clicked debug execution button",{instance_id:L().instanceId,exec_status:a.status,override_pinned_data:w.length===D,all_exec_data_imported:d.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{Y as u};
2
+ //# sourceMappingURL=useExecutionDebugging-Yog1CJXv.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useExecutionDebugging-FPo5qMF0.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":"qMAkBO,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,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EAAW,EAEDD,EAAA,QAASP,GAAkB,SAClC,MAAAS,GAAWC,GAAAf,EAAAC,EAAQI,EAAK,IAAI,IAAjB,YAAAL,EAAqB,GAAG,OAAxB,YAAAe,EAA8B,KAAK,GAChDD,IACHD,IACA1B,EAAe,QAAQ,CACtB,KAAAkB,EACA,KAAMS,CAAA,CACN,EACF,CACA,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
+ {"version":3,"file":"useExecutionDebugging-Yog1CJXv.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":"qMAkBO,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,CAAO,EACxCE,EAAmBD,EAAmB,OAC1CE,GAAS,CAACL,EAAc,KAAMM,GAASA,EAAK,OAASD,CAAI,CAAA,EAKrDE,EAA0B,OAAO,KAAKnB,EAAe,SAAS,SAAW,CAAA,CAAE,EAC3EoB,EAA0BL,EAAmB,OAAQE,GAC1DE,EAAwB,SAASF,CAAI,CAAA,EAGlC,GAAAG,EAAwB,OAAS,EAAG,CACjC,MAAAC,EAAiBC,EAAE,IAAK,CAC7B5B,EAAK,SAAS,uCAAuC,EACrD4B,EACC,KACA,CAAE,MAAO,WAAY,EACrBF,EAAwB,IAAKH,GAASK,EAAE,KAAML,CAAI,CAAC,CACpD,CAAA,CACA,EAcD,GAZmC,MAAMrB,EAAQ,QAChDyB,EACA3B,EAAK,SAAS,wCAAwC,EACtD,CACC,KAAM,UACN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C1BF,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{m as u}from"./pinia-jX93eZRS.js";import{o as d,B as k,u as h,t as v,a5 as p,ab as l,d7 as W,d6 as m,da as g}from"./n8n-ZKR6bms9.js";import{w as A}from"./index--RuZ5wHr.js";import{G as I}from"./vendor-2CfOYFi2.js";const y=I({mixins:[A],setup(){return{...d()}},data(){return{updatingWorkflowActivation:!1}},computed:{...u(v,h,k)},methods:{async activateCurrentWorkflow(s){const t=this.workflowsStore.workflowId;return this.updateWorkflowActivation(t,!0,s)},async updateWorkflowActivation(s,t,w){this.updatingWorkflowActivation=!0;const f=this.workflowsStore.nodesIssuesExist;let o=s;if(!o||o===p){if(!await this.saveCurrentWorkflow()){this.updatingWorkflowActivation=!1;return}o=this.workflowsStore.workflowId}const e=o===this.workflowsStore.workflowId,r=this.workflowsStore.activeWorkflows.includes(o),a={workflow_id:o,is_active:t,previous_status:r,ndv_input:w==="ndv"};this.$telemetry.track("User set workflow active status",a),l().run("workflowActivate.updateWorkflowActivation",a);try{if(r&&t){this.showMessage({title:this.$locale.baseText("workflowActivator.workflowIsActive"),type:"success"}),this.updatingWorkflowActivation=!1;return}if(e&&f&&t){this.showMessage({title:this.$locale.baseText("workflowActivator.showMessage.activeChangedNodesIssuesExistTrue.title"),message:this.$locale.baseText("workflowActivator.showMessage.activeChangedNodesIssuesExistTrue.message"),type:"error"}),this.updatingWorkflowActivation=!1;return}await this.updateWorkflow({workflowId:o,active:t},!this.uiStore.stateIsDirty)}catch(i){const c=t?"activated":"deactivated";this.showError(i,this.$locale.baseText("workflowActivator.showError.title",{interpolate:{newStateName:c}})+":"),this.updatingWorkflowActivation=!1;return}const n=e?"workflow.activeChangeCurrent":"workflow.activeChange";l().run(n,{workflowId:o,active:t}),this.$emit("workflowActiveChanged",{id:o,active:t}),this.updatingWorkflowActivation=!1,e&&(t&&W(g).value!=="true"?this.uiStore.openModal(m):await this.settingsStore.fetchPromptsData())}}});export{y as w};
2
- //# sourceMappingURL=workflowActivate-FltKJaAB.js.map
1
+ import{m as u}from"./pinia-jX93eZRS.js";import{o as d,B as k,u as h,t as v,a5 as p,ab as l,d7 as W,d6 as m,da as g}from"./n8n-ZKR6bms9.js";import{w as A}from"./index-RXjMHIPR.js";import{G as I}from"./vendor-2CfOYFi2.js";const y=I({mixins:[A],setup(){return{...d()}},data(){return{updatingWorkflowActivation:!1}},computed:{...u(v,h,k)},methods:{async activateCurrentWorkflow(s){const t=this.workflowsStore.workflowId;return this.updateWorkflowActivation(t,!0,s)},async updateWorkflowActivation(s,t,w){this.updatingWorkflowActivation=!0;const f=this.workflowsStore.nodesIssuesExist;let o=s;if(!o||o===p){if(!await this.saveCurrentWorkflow()){this.updatingWorkflowActivation=!1;return}o=this.workflowsStore.workflowId}const e=o===this.workflowsStore.workflowId,r=this.workflowsStore.activeWorkflows.includes(o),a={workflow_id:o,is_active:t,previous_status:r,ndv_input:w==="ndv"};this.$telemetry.track("User set workflow active status",a),l().run("workflowActivate.updateWorkflowActivation",a);try{if(r&&t){this.showMessage({title:this.$locale.baseText("workflowActivator.workflowIsActive"),type:"success"}),this.updatingWorkflowActivation=!1;return}if(e&&f&&t){this.showMessage({title:this.$locale.baseText("workflowActivator.showMessage.activeChangedNodesIssuesExistTrue.title"),message:this.$locale.baseText("workflowActivator.showMessage.activeChangedNodesIssuesExistTrue.message"),type:"error"}),this.updatingWorkflowActivation=!1;return}await this.updateWorkflow({workflowId:o,active:t},!this.uiStore.stateIsDirty)}catch(i){const c=t?"activated":"deactivated";this.showError(i,this.$locale.baseText("workflowActivator.showError.title",{interpolate:{newStateName:c}})+":"),this.updatingWorkflowActivation=!1;return}const n=e?"workflow.activeChangeCurrent":"workflow.activeChange";l().run(n,{workflowId:o,active:t}),this.$emit("workflowActiveChanged",{id:o,active:t}),this.updatingWorkflowActivation=!1,e&&(t&&W(g).value!=="true"?this.uiStore.openModal(m):await this.settingsStore.fetchPromptsData())}}});export{y as w};
2
+ //# sourceMappingURL=workflowActivate-IRvCsxq5.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"workflowActivate-FltKJaAB.js","sources":["../../src/mixins/workflowActivate.ts"],"sourcesContent":["import { defineComponent } from 'vue';\nimport { mapStores } from 'pinia';\nimport { useStorage } from '@/composables/useStorage';\n\nimport { workflowHelpers } from '@/mixins/workflowHelpers';\nimport { useToast } from '@/composables/useToast';\n\nimport {\n\tLOCAL_STORAGE_ACTIVATION_FLAG,\n\tPLACEHOLDER_EMPTY_WORKFLOW_ID,\n\tWORKFLOW_ACTIVE_MODAL_KEY,\n} from '@/constants';\nimport { useUIStore } from '@/stores/ui.store';\nimport { useSettingsStore } from '@/stores/settings.store';\nimport { useWorkflowsStore } from '@/stores/workflows.store';\nimport { useExternalHooks } from '@/composables/useExternalHooks';\n\nexport const workflowActivate = defineComponent({\n\tmixins: [workflowHelpers],\n\tsetup() {\n\t\treturn {\n\t\t\t...useToast(),\n\t\t};\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tupdatingWorkflowActivation: false,\n\t\t};\n\t},\n\tcomputed: {\n\t\t...mapStores(useSettingsStore, useUIStore, useWorkflowsStore),\n\t},\n\tmethods: {\n\t\tasync activateCurrentWorkflow(telemetrySource?: string) {\n\t\t\tconst workflowId = this.workflowsStore.workflowId;\n\t\t\treturn this.updateWorkflowActivation(workflowId, true, telemetrySource);\n\t\t},\n\t\tasync updateWorkflowActivation(\n\t\t\tworkflowId: string | undefined,\n\t\t\tnewActiveState: boolean,\n\t\t\ttelemetrySource?: string,\n\t\t) {\n\t\t\tthis.updatingWorkflowActivation = true;\n\t\t\tconst nodesIssuesExist = this.workflowsStore.nodesIssuesExist;\n\n\t\t\tlet currWorkflowId: string | undefined = workflowId;\n\t\t\tif (!currWorkflowId || currWorkflowId === PLACEHOLDER_EMPTY_WORKFLOW_ID) {\n\t\t\t\tconst saved = await this.saveCurrentWorkflow();\n\t\t\t\tif (!saved) {\n\t\t\t\t\tthis.updatingWorkflowActivation = false;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcurrWorkflowId = this.workflowsStore.workflowId;\n\t\t\t}\n\t\t\tconst isCurrentWorkflow = currWorkflowId === this.workflowsStore.workflowId;\n\n\t\t\tconst activeWorkflows = this.workflowsStore.activeWorkflows;\n\t\t\tconst isWorkflowActive = activeWorkflows.includes(currWorkflowId);\n\n\t\t\tconst telemetryPayload = {\n\t\t\t\tworkflow_id: currWorkflowId,\n\t\t\t\tis_active: newActiveState,\n\t\t\t\tprevious_status: isWorkflowActive,\n\t\t\t\tndv_input: telemetrySource === 'ndv',\n\t\t\t};\n\t\t\tthis.$telemetry.track('User set workflow active status', telemetryPayload);\n\t\t\tvoid useExternalHooks().run('workflowActivate.updateWorkflowActivation', telemetryPayload);\n\n\t\t\ttry {\n\t\t\t\tif (isWorkflowActive && newActiveState) {\n\t\t\t\t\tthis.showMessage({\n\t\t\t\t\t\ttitle: this.$locale.baseText('workflowActivator.workflowIsActive'),\n\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t});\n\t\t\t\t\tthis.updatingWorkflowActivation = false;\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (isCurrentWorkflow && nodesIssuesExist && newActiveState) {\n\t\t\t\t\tthis.showMessage({\n\t\t\t\t\t\ttitle: this.$locale.baseText(\n\t\t\t\t\t\t\t'workflowActivator.showMessage.activeChangedNodesIssuesExistTrue.title',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tmessage: this.$locale.baseText(\n\t\t\t\t\t\t\t'workflowActivator.showMessage.activeChangedNodesIssuesExistTrue.message',\n\t\t\t\t\t\t),\n\t\t\t\t\t\ttype: 'error',\n\t\t\t\t\t});\n\n\t\t\t\t\tthis.updatingWorkflowActivation = false;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tawait this.updateWorkflow(\n\t\t\t\t\t{ workflowId: currWorkflowId, active: newActiveState },\n\t\t\t\t\t!this.uiStore.stateIsDirty,\n\t\t\t\t);\n\t\t\t} catch (error) {\n\t\t\t\tconst newStateName = newActiveState ? 'activated' : 'deactivated';\n\t\t\t\tthis.showError(\n\t\t\t\t\terror,\n\t\t\t\t\tthis.$locale.baseText('workflowActivator.showError.title', {\n\t\t\t\t\t\tinterpolate: { newStateName },\n\t\t\t\t\t}) + ':',\n\t\t\t\t);\n\t\t\t\tthis.updatingWorkflowActivation = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst activationEventName = isCurrentWorkflow\n\t\t\t\t? 'workflow.activeChangeCurrent'\n\t\t\t\t: 'workflow.activeChange';\n\t\t\tvoid useExternalHooks().run(activationEventName, {\n\t\t\t\tworkflowId: currWorkflowId,\n\t\t\t\tactive: newActiveState,\n\t\t\t});\n\n\t\t\tthis.$emit('workflowActiveChanged', { id: currWorkflowId, active: newActiveState });\n\t\t\tthis.updatingWorkflowActivation = false;\n\n\t\t\tif (isCurrentWorkflow) {\n\t\t\t\tif (newActiveState && useStorage(LOCAL_STORAGE_ACTIVATION_FLAG).value !== 'true') {\n\t\t\t\t\tthis.uiStore.openModal(WORKFLOW_ACTIVE_MODAL_KEY);\n\t\t\t\t} else {\n\t\t\t\t\tawait this.settingsStore.fetchPromptsData();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t},\n});\n"],"names":["workflowActivate","defineComponent","workflowHelpers","useToast","mapStores","useSettingsStore","useUIStore","useWorkflowsStore","telemetrySource","workflowId","newActiveState","nodesIssuesExist","currWorkflowId","PLACEHOLDER_EMPTY_WORKFLOW_ID","isCurrentWorkflow","isWorkflowActive","telemetryPayload","useExternalHooks","error","newStateName","activationEventName","useStorage","LOCAL_STORAGE_ACTIVATION_FLAG","WORKFLOW_ACTIVE_MODAL_KEY"],"mappings":"4NAiBO,MAAMA,EAAmBC,EAAgB,CAC/C,OAAQ,CAACC,CAAe,EACxB,OAAQ,CACA,MAAA,CACN,GAAGC,EAAS,CAAA,CAEd,EACA,MAAO,CACC,MAAA,CACN,2BAA4B,EAAA,CAE9B,EACA,SAAU,CACT,GAAGC,EAAUC,EAAkBC,EAAYC,CAAiB,CAC7D,EACA,QAAS,CACR,MAAM,wBAAwBC,EAA0B,CACjD,MAAAC,EAAa,KAAK,eAAe,WACvC,OAAO,KAAK,yBAAyBA,EAAY,GAAMD,CAAe,CACvE,EACA,MAAM,yBACLC,EACAC,EACAF,EACC,CACD,KAAK,2BAA6B,GAC5B,MAAAG,EAAmB,KAAK,eAAe,iBAE7C,IAAIC,EAAqCH,EACrC,GAAA,CAACG,GAAkBA,IAAmBC,EAA+B,CAExE,GAAI,CADU,MAAM,KAAK,sBACb,CACX,KAAK,2BAA6B,GAClC,MACD,CACAD,EAAiB,KAAK,eAAe,UACtC,CACM,MAAAE,EAAoBF,IAAmB,KAAK,eAAe,WAG3DG,EADkB,KAAK,eAAe,gBACH,SAASH,CAAc,EAE1DI,EAAmB,CACxB,YAAaJ,EACb,UAAWF,EACX,gBAAiBK,EACjB,UAAWP,IAAoB,KAAA,EAE3B,KAAA,WAAW,MAAM,kCAAmCQ,CAAgB,EACpEC,EAAiB,EAAE,IAAI,4CAA6CD,CAAgB,EAErF,GAAA,CACH,GAAID,GAAoBL,EAAgB,CACvC,KAAK,YAAY,CAChB,MAAO,KAAK,QAAQ,SAAS,oCAAoC,EACjE,KAAM,SAAA,CACN,EACD,KAAK,2BAA6B,GAElC,MACD,CAEI,GAAAI,GAAqBH,GAAoBD,EAAgB,CAC5D,KAAK,YAAY,CAChB,MAAO,KAAK,QAAQ,SACnB,uEACD,EACA,QAAS,KAAK,QAAQ,SACrB,yEACD,EACA,KAAM,OAAA,CACN,EAED,KAAK,2BAA6B,GAClC,MACD,CAEA,MAAM,KAAK,eACV,CAAE,WAAYE,EAAgB,OAAQF,CAAe,EACrD,CAAC,KAAK,QAAQ,YAAA,QAEPQ,EAAO,CACT,MAAAC,EAAeT,EAAiB,YAAc,cAC/C,KAAA,UACJQ,EACA,KAAK,QAAQ,SAAS,oCAAqC,CAC1D,YAAa,CAAE,aAAAC,CAAa,CAC5B,CAAA,EAAI,GAAA,EAEN,KAAK,2BAA6B,GAClC,MACD,CAEM,MAAAC,EAAsBN,EACzB,+BACA,wBACEG,EAAA,EAAmB,IAAIG,EAAqB,CAChD,WAAYR,EACZ,OAAQF,CAAA,CACR,EAED,KAAK,MAAM,wBAAyB,CAAE,GAAIE,EAAgB,OAAQF,EAAgB,EAClF,KAAK,2BAA6B,GAE9BI,IACCJ,GAAkBW,EAAWC,CAA6B,EAAE,QAAU,OACpE,KAAA,QAAQ,UAAUC,CAAyB,EAE1C,MAAA,KAAK,cAAc,mBAG5B,CACD,CACD,CAAC"}
1
+ {"version":3,"file":"workflowActivate-IRvCsxq5.js","sources":["../../src/mixins/workflowActivate.ts"],"sourcesContent":["import { defineComponent } from 'vue';\nimport { mapStores } from 'pinia';\nimport { useStorage } from '@/composables/useStorage';\n\nimport { workflowHelpers } from '@/mixins/workflowHelpers';\nimport { useToast } from '@/composables/useToast';\n\nimport {\n\tLOCAL_STORAGE_ACTIVATION_FLAG,\n\tPLACEHOLDER_EMPTY_WORKFLOW_ID,\n\tWORKFLOW_ACTIVE_MODAL_KEY,\n} from '@/constants';\nimport { useUIStore } from '@/stores/ui.store';\nimport { useSettingsStore } from '@/stores/settings.store';\nimport { useWorkflowsStore } from '@/stores/workflows.store';\nimport { useExternalHooks } from '@/composables/useExternalHooks';\n\nexport const workflowActivate = defineComponent({\n\tmixins: [workflowHelpers],\n\tsetup() {\n\t\treturn {\n\t\t\t...useToast(),\n\t\t};\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tupdatingWorkflowActivation: false,\n\t\t};\n\t},\n\tcomputed: {\n\t\t...mapStores(useSettingsStore, useUIStore, useWorkflowsStore),\n\t},\n\tmethods: {\n\t\tasync activateCurrentWorkflow(telemetrySource?: string) {\n\t\t\tconst workflowId = this.workflowsStore.workflowId;\n\t\t\treturn this.updateWorkflowActivation(workflowId, true, telemetrySource);\n\t\t},\n\t\tasync updateWorkflowActivation(\n\t\t\tworkflowId: string | undefined,\n\t\t\tnewActiveState: boolean,\n\t\t\ttelemetrySource?: string,\n\t\t) {\n\t\t\tthis.updatingWorkflowActivation = true;\n\t\t\tconst nodesIssuesExist = this.workflowsStore.nodesIssuesExist;\n\n\t\t\tlet currWorkflowId: string | undefined = workflowId;\n\t\t\tif (!currWorkflowId || currWorkflowId === PLACEHOLDER_EMPTY_WORKFLOW_ID) {\n\t\t\t\tconst saved = await this.saveCurrentWorkflow();\n\t\t\t\tif (!saved) {\n\t\t\t\t\tthis.updatingWorkflowActivation = false;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcurrWorkflowId = this.workflowsStore.workflowId;\n\t\t\t}\n\t\t\tconst isCurrentWorkflow = currWorkflowId === this.workflowsStore.workflowId;\n\n\t\t\tconst activeWorkflows = this.workflowsStore.activeWorkflows;\n\t\t\tconst isWorkflowActive = activeWorkflows.includes(currWorkflowId);\n\n\t\t\tconst telemetryPayload = {\n\t\t\t\tworkflow_id: currWorkflowId,\n\t\t\t\tis_active: newActiveState,\n\t\t\t\tprevious_status: isWorkflowActive,\n\t\t\t\tndv_input: telemetrySource === 'ndv',\n\t\t\t};\n\t\t\tthis.$telemetry.track('User set workflow active status', telemetryPayload);\n\t\t\tvoid useExternalHooks().run('workflowActivate.updateWorkflowActivation', telemetryPayload);\n\n\t\t\ttry {\n\t\t\t\tif (isWorkflowActive && newActiveState) {\n\t\t\t\t\tthis.showMessage({\n\t\t\t\t\t\ttitle: this.$locale.baseText('workflowActivator.workflowIsActive'),\n\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t});\n\t\t\t\t\tthis.updatingWorkflowActivation = false;\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (isCurrentWorkflow && nodesIssuesExist && newActiveState) {\n\t\t\t\t\tthis.showMessage({\n\t\t\t\t\t\ttitle: this.$locale.baseText(\n\t\t\t\t\t\t\t'workflowActivator.showMessage.activeChangedNodesIssuesExistTrue.title',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tmessage: this.$locale.baseText(\n\t\t\t\t\t\t\t'workflowActivator.showMessage.activeChangedNodesIssuesExistTrue.message',\n\t\t\t\t\t\t),\n\t\t\t\t\t\ttype: 'error',\n\t\t\t\t\t});\n\n\t\t\t\t\tthis.updatingWorkflowActivation = false;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tawait this.updateWorkflow(\n\t\t\t\t\t{ workflowId: currWorkflowId, active: newActiveState },\n\t\t\t\t\t!this.uiStore.stateIsDirty,\n\t\t\t\t);\n\t\t\t} catch (error) {\n\t\t\t\tconst newStateName = newActiveState ? 'activated' : 'deactivated';\n\t\t\t\tthis.showError(\n\t\t\t\t\terror,\n\t\t\t\t\tthis.$locale.baseText('workflowActivator.showError.title', {\n\t\t\t\t\t\tinterpolate: { newStateName },\n\t\t\t\t\t}) + ':',\n\t\t\t\t);\n\t\t\t\tthis.updatingWorkflowActivation = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst activationEventName = isCurrentWorkflow\n\t\t\t\t? 'workflow.activeChangeCurrent'\n\t\t\t\t: 'workflow.activeChange';\n\t\t\tvoid useExternalHooks().run(activationEventName, {\n\t\t\t\tworkflowId: currWorkflowId,\n\t\t\t\tactive: newActiveState,\n\t\t\t});\n\n\t\t\tthis.$emit('workflowActiveChanged', { id: currWorkflowId, active: newActiveState });\n\t\t\tthis.updatingWorkflowActivation = false;\n\n\t\t\tif (isCurrentWorkflow) {\n\t\t\t\tif (newActiveState && useStorage(LOCAL_STORAGE_ACTIVATION_FLAG).value !== 'true') {\n\t\t\t\t\tthis.uiStore.openModal(WORKFLOW_ACTIVE_MODAL_KEY);\n\t\t\t\t} else {\n\t\t\t\t\tawait this.settingsStore.fetchPromptsData();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t},\n});\n"],"names":["workflowActivate","defineComponent","workflowHelpers","useToast","mapStores","useSettingsStore","useUIStore","useWorkflowsStore","telemetrySource","workflowId","newActiveState","nodesIssuesExist","currWorkflowId","PLACEHOLDER_EMPTY_WORKFLOW_ID","isCurrentWorkflow","isWorkflowActive","telemetryPayload","useExternalHooks","error","newStateName","activationEventName","useStorage","LOCAL_STORAGE_ACTIVATION_FLAG","WORKFLOW_ACTIVE_MODAL_KEY"],"mappings":"4NAiBO,MAAMA,EAAmBC,EAAgB,CAC/C,OAAQ,CAACC,CAAe,EACxB,OAAQ,CACA,MAAA,CACN,GAAGC,EAAS,CAAA,CAEd,EACA,MAAO,CACC,MAAA,CACN,2BAA4B,EAAA,CAE9B,EACA,SAAU,CACT,GAAGC,EAAUC,EAAkBC,EAAYC,CAAiB,CAC7D,EACA,QAAS,CACR,MAAM,wBAAwBC,EAA0B,CACjD,MAAAC,EAAa,KAAK,eAAe,WACvC,OAAO,KAAK,yBAAyBA,EAAY,GAAMD,CAAe,CACvE,EACA,MAAM,yBACLC,EACAC,EACAF,EACC,CACD,KAAK,2BAA6B,GAC5B,MAAAG,EAAmB,KAAK,eAAe,iBAE7C,IAAIC,EAAqCH,EACrC,GAAA,CAACG,GAAkBA,IAAmBC,EAA+B,CAExE,GAAI,CADU,MAAM,KAAK,sBACb,CACX,KAAK,2BAA6B,GAClC,MACD,CACAD,EAAiB,KAAK,eAAe,UACtC,CACM,MAAAE,EAAoBF,IAAmB,KAAK,eAAe,WAG3DG,EADkB,KAAK,eAAe,gBACH,SAASH,CAAc,EAE1DI,EAAmB,CACxB,YAAaJ,EACb,UAAWF,EACX,gBAAiBK,EACjB,UAAWP,IAAoB,KAAA,EAE3B,KAAA,WAAW,MAAM,kCAAmCQ,CAAgB,EACpEC,EAAiB,EAAE,IAAI,4CAA6CD,CAAgB,EAErF,GAAA,CACH,GAAID,GAAoBL,EAAgB,CACvC,KAAK,YAAY,CAChB,MAAO,KAAK,QAAQ,SAAS,oCAAoC,EACjE,KAAM,SAAA,CACN,EACD,KAAK,2BAA6B,GAElC,MACD,CAEI,GAAAI,GAAqBH,GAAoBD,EAAgB,CAC5D,KAAK,YAAY,CAChB,MAAO,KAAK,QAAQ,SACnB,uEACD,EACA,QAAS,KAAK,QAAQ,SACrB,yEACD,EACA,KAAM,OAAA,CACN,EAED,KAAK,2BAA6B,GAClC,MACD,CAEA,MAAM,KAAK,eACV,CAAE,WAAYE,EAAgB,OAAQF,CAAe,EACrD,CAAC,KAAK,QAAQ,YAAA,QAEPQ,EAAO,CACT,MAAAC,EAAeT,EAAiB,YAAc,cAC/C,KAAA,UACJQ,EACA,KAAK,QAAQ,SAAS,oCAAqC,CAC1D,YAAa,CAAE,aAAAC,CAAa,CAC5B,CAAA,EAAI,GAAA,EAEN,KAAK,2BAA6B,GAClC,MACD,CAEM,MAAAC,EAAsBN,EACzB,+BACA,wBACEG,EAAA,EAAmB,IAAIG,EAAqB,CAChD,WAAYR,EACZ,OAAQF,CAAA,CACR,EAED,KAAK,MAAM,wBAAyB,CAAE,GAAIE,EAAgB,OAAQF,EAAgB,EAClF,KAAK,2BAA6B,GAE9BI,IACCJ,GAAkBW,EAAWC,CAA6B,EAAE,QAAU,OACpE,KAAA,QAAQ,UAAUC,CAAyB,EAE1C,MAAA,KAAK,cAAc,mBAG5B,CACD,CACD,CAAC"}
package/dist/index.html CHANGED
@@ -12,7 +12,7 @@
12
12
  <script>!function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.async=!0,p.src=s.api_host+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],u.toString=function(t){var e="posthog";return"posthog"!==a&&(e+="."+a),t||(e+=" (stub)"),e},u.people.toString=function(){return u.toString(1)+".people (stub)"},o="capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled getFeatureFlag onFeatureFlags reloadFeatureFlags".split(" "),n=0;n<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1)}(document,window.posthog||[])</script>
13
13
 
14
14
  <title>n8n.io - Workflow Automation</title>
15
- <script type="module" crossorigin src="/%7B%7BBASE_PATH%7D%7D/assets/index--RuZ5wHr.js"></script>
15
+ <script type="module" crossorigin src="/%7B%7BBASE_PATH%7D%7D/assets/index-RXjMHIPR.js"></script>
16
16
  <link rel="modulepreload" crossorigin href="/%7B%7BBASE_PATH%7D%7D/assets/vendor-2CfOYFi2.js">
17
17
  <link rel="modulepreload" crossorigin href="/%7B%7BBASE_PATH%7D%7D/assets/lodash-es-s_m9YyW7.js">
18
18
  <link rel="modulepreload" crossorigin href="/%7B%7BBASE_PATH%7D%7D/assets/axios-QLjAsgXu.js">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-editor-ui",
3
- "version": "1.22.0",
3
+ "version": "1.22.1",
4
4
  "description": "Workflow Editor UI for n8n",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "homepage": "https://n8n.io",
@@ -1 +0,0 @@
1
- {"version":3,"file":"CollectionParameter-ThiBAc6J.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{o as w,u as g,bi as k,l as C,p as S,t as v,v as U,ac as A,_ as I}from"./n8n-ZKR6bms9.js";import{O as K,a as x}from"./index--RuZ5wHr.js";import{m as P}from"./pinia-jX93eZRS.js";import{G as E,ag as t,l,m as h,p as s,T as o,O as a,I as n,S as r,R as i,M as m,Q as M,J as D}from"./vendor-2CfOYFi2.js";import"./lodash-es-s_m9YyW7.js";import"./axios-QLjAsgXu.js";import"./flatted-jPn12Tq4.js";import"./esprima-next-ulPLCZ1Z.js";import"./luxon-ZRIU05qF.js";import"./@vueuse/core-viEZCtbZ.js";import"./uuid-McvpxQtQ.js";import"./vue-i18n-2T2QU_2c.js";import"./@n8n/permissions-8yMqUF1Y.js";import"./prettier-s3fE3Qyr.js";import"./codemirror-lang-html-n8n-qoVuUIQR.js";import"./@n8n/codemirror-lang-sql-zd5sOTQ9.js";import"./@lezer/common-aP6EPErF.js";import"./@jsplumb/util-DR0SB56A.js";import"./@jsplumb/core-MKwKlGip.js";import"./@jsplumb/common-Q5_tv_GT.js";import"./@jsplumb/connector-bezier-3dWY17R5.js";import"./@jsplumb/browser-ui-QL7QI0sV.js";import"./codemirror-lang-n8n-expression-qGXLqLTr.js";import"./fast-json-stable-stringify-RhDdw38P.js";import"./timeago.js--Bumj2r9.js";import"./qrcode.vue-f7Vn5Pkq.js";import"./vue3-touch-events-_RfbPMOD.js";import"./chart.js-JtqvIvkt.js";const V=E({name:"SettingsApiView",components:{CopyInput:K},setup(){return{...w(),...x(),...g()}},data(){return{loading:!1,mounted:!1,apiKey:"",swaggerUIEnabled:!1,apiDocsURL:""}},mounted(){this.getApiKey();const e=this.rootStore.baseUrl,p=this.settingsStore.publicApiPath,c=this.settingsStore.publicApiLatestVersion;this.swaggerUIEnabled=this.settingsStore.isSwaggerUIEnabled,this.apiDocsURL=this.swaggerUIEnabled?`${e}${p}/v${c}/docs`:`https://${k}/api/api-reference/`},computed:{...P(U,v,S,C,g),currentUser(){return this.usersStore.currentUser},isTrialing(){return this.cloudPlanStore.userIsTrialing},isLoadingCloudPlans(){return this.cloudPlanStore.state.loadingPlan}},methods:{onUpgrade(){this.uiStore.goToUpgrade("settings-n8n-api","upgrade-api","redirect")},async showDeleteModal(){await this.confirm(this.$locale.baseText("settings.api.delete.description"),this.$locale.baseText("settings.api.delete.title"),{confirmButtonText:this.$locale.baseText("settings.api.delete.button"),cancelButtonText:this.$locale.baseText("generic.cancel")})===A&&await this.deleteApiKey()},async getApiKey(){try{this.apiKey=await this.settingsStore.getApiKey()||""}catch(e){this.showError(e,this.$locale.baseText("settings.api.view.error"))}finally{this.mounted=!0}},async createApiKey(){this.loading=!0;try{this.apiKey=await this.settingsStore.createApiKey()||""}catch(e){this.showError(e,this.$locale.baseText("settings.api.create.error"))}finally{this.loading=!1,this.$telemetry.track("User clicked create API key button")}},async deleteApiKey(){try{await this.settingsStore.deleteApiKey(),this.showMessage({title:this.$locale.baseText("settings.api.delete.toast"),type:"success"}),this.apiKey=""}catch(e){this.showError(e,this.$locale.baseText("settings.api.delete.error"))}finally{this.$telemetry.track("User clicked delete API key button")}},onCopy(){this.$telemetry.track("User clicked copy API key button")}}}),z="_container_1teme_5",L="_header_1teme_9",B="_card_1teme_18",N="_hint_1teme_29",O={container:z,header:L,card:B,delete:"_delete_1teme_22",hint:N},R={key:0},F={class:"mb-s"},G=["textContent"],J=["textContent"];function Q(e,p,c,j,q,H){const b=t("n8n-heading"),y=t("i18n-t"),$=t("n8n-info-tip"),d=t("n8n-link"),f=t("CopyInput"),T=t("n8n-card"),_=t("n8n-text"),u=t("n8n-action-box");return l(),h("div",{class:n(e.$style.container)},[s("div",{class:n(e.$style.header)},[o(b,{size:"2xlarge"},{default:a(()=>[r(i(e.$locale.baseText("settings.api"))+" ",1),s("span",{style:D({fontSize:"var(--font-size-s)",color:"var(--color-text-light)"})}," ("+i(e.$locale.baseText("beta"))+") ",5)]),_:1})],2),e.apiKey?(l(),h("div",R,[s("p",F,[o($,{bold:!1},{default:a(()=>[o(y,{keypath:"settings.api.view.info",tag:"span"},{apiAction:a(()=>[s("a",{href:"https://docs.n8n.io/api",target:"_blank",textContent:i(e.$locale.baseText("settings.api.view.info.api"))},null,8,G)]),webhookAction:a(()=>[s("a",{href:"https://docs.n8n.io/integrations/core-nodes/n8n-nodes-base.webhook/",target:"_blank",textContent:i(e.$locale.baseText("settings.api.view.info.webhook"))},null,8,J)]),_:1})]),_:1})]),o(T,{class:n(["mb-4xs",e.$style.card])},{default:a(()=>[s("span",{class:n(e.$style.delete)},[o(d,{onClick:e.showDeleteModal,bold:!0},{default:a(()=>[r(i(e.$locale.baseText("generic.delete")),1)]),_:1},8,["onClick"])],2),s("div",null,[o(f,{label:e.$locale.baseText("settings.api.view.myKey"),value:e.apiKey,"copy-button-text":e.$locale.baseText("generic.clickToCopy"),"toast-title":e.$locale.baseText("settings.api.view.copy.toast"),redactValue:!0,onCopy:e.onCopy},null,8,["label","value","copy-button-text","toast-title","onCopy"])])]),_:1},8,["class"]),s("div",{class:n(e.$style.hint)},[o(_,{size:"small"},{default:a(()=>[r(i(e.$locale.baseText(`settings.api.view.${e.swaggerUIEnabled?"tryapi":"more-details"}`)),1)]),_:1}),r(" "+i(" ")+" "),o(d,{to:e.apiDocsURL,newWindow:!0,size:"small"},{default:a(()=>[r(i(e.$locale.baseText(`settings.api.view.${e.swaggerUIEnabled?"apiPlayground":"external-docs"}`)),1)]),_:1},8,["to"])],2)])):e.isTrialing?(l(),m(u,{key:1,heading:e.$locale.baseText("settings.api.trial.upgradePlan.title"),description:e.$locale.baseText("settings.api.trial.upgradePlan.description"),buttonText:e.$locale.baseText("settings.api.trial.upgradePlan.cta"),"onClick:button":e.onUpgrade},null,8,["heading","description","buttonText","onClick:button"])):e.mounted&&!e.isLoadingCloudPlans?(l(),m(u,{key:2,buttonText:e.$locale.baseText(e.loading?"settings.api.create.button.loading":"settings.api.create.button"),description:e.$locale.baseText("settings.api.create.description"),"onClick:button":e.createApiKey},null,8,["buttonText","description","onClick:button"])):M("",!0)],2)}const W={$style:O},Se=I(V,[["render",Q],["__cssModules",W]]);export{Se as default};
2
- //# sourceMappingURL=SettingsApiView-_7qUJ2zm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SettingsApiView-_7qUJ2zm.js","sources":["../../src/views/SettingsApiView.vue"],"sourcesContent":["<template>\n\t<div :class=\"$style.container\">\n\t\t<div :class=\"$style.header\">\n\t\t\t<n8n-heading size=\"2xlarge\">\n\t\t\t\t{{ $locale.baseText('settings.api') }}\n\t\t\t\t<span :style=\"{ fontSize: 'var(--font-size-s)', color: 'var(--color-text-light)' }\">\n\t\t\t\t\t({{ $locale.baseText('beta') }})\n\t\t\t\t</span>\n\t\t\t</n8n-heading>\n\t\t</div>\n\n\t\t<div v-if=\"apiKey\">\n\t\t\t<p class=\"mb-s\">\n\t\t\t\t<n8n-info-tip :bold=\"false\">\n\t\t\t\t\t<i18n-t keypath=\"settings.api.view.info\" tag=\"span\">\n\t\t\t\t\t\t<template #apiAction>\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\thref=\"https://docs.n8n.io/api\"\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\tv-text=\"$locale.baseText('settings.api.view.info.api')\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template #webhookAction>\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\thref=\"https://docs.n8n.io/integrations/core-nodes/n8n-nodes-base.webhook/\"\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\tv-text=\"$locale.baseText('settings.api.view.info.webhook')\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</i18n-t>\n\t\t\t\t</n8n-info-tip>\n\t\t\t</p>\n\t\t\t<n8n-card class=\"mb-4xs\" :class=\"$style.card\">\n\t\t\t\t<span :class=\"$style.delete\">\n\t\t\t\t\t<n8n-link @click=\"showDeleteModal\" :bold=\"true\">\n\t\t\t\t\t\t{{ $locale.baseText('generic.delete') }}\n\t\t\t\t\t</n8n-link>\n\t\t\t\t</span>\n\t\t\t\t<div>\n\t\t\t\t\t<CopyInput\n\t\t\t\t\t\t:label=\"$locale.baseText('settings.api.view.myKey')\"\n\t\t\t\t\t\t:value=\"apiKey\"\n\t\t\t\t\t\t:copy-button-text=\"$locale.baseText('generic.clickToCopy')\"\n\t\t\t\t\t\t:toast-title=\"$locale.baseText('settings.api.view.copy.toast')\"\n\t\t\t\t\t\t:redactValue=\"true\"\n\t\t\t\t\t\t@copy=\"onCopy\"\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</n8n-card>\n\t\t\t<div :class=\"$style.hint\">\n\t\t\t\t<n8n-text size=\"small\">\n\t\t\t\t\t{{\n\t\t\t\t\t\t$locale.baseText(`settings.api.view.${swaggerUIEnabled ? 'tryapi' : 'more-details'}`)\n\t\t\t\t\t}}\n\t\t\t\t</n8n-text>\n\t\t\t\t{{ ' ' }}\n\t\t\t\t<n8n-link :to=\"apiDocsURL\" :newWindow=\"true\" size=\"small\">\n\t\t\t\t\t{{\n\t\t\t\t\t\t$locale.baseText(\n\t\t\t\t\t\t\t`settings.api.view.${swaggerUIEnabled ? 'apiPlayground' : 'external-docs'}`,\n\t\t\t\t\t\t)\n\t\t\t\t\t}}\n\t\t\t\t</n8n-link>\n\t\t\t</div>\n\t\t</div>\n\t\t<n8n-action-box\n\t\t\tv-else-if=\"isTrialing\"\n\t\t\t:heading=\"$locale.baseText('settings.api.trial.upgradePlan.title')\"\n\t\t\t:description=\"$locale.baseText('settings.api.trial.upgradePlan.description')\"\n\t\t\t:buttonText=\"$locale.baseText('settings.api.trial.upgradePlan.cta')\"\n\t\t\t@click:button=\"onUpgrade\"\n\t\t/>\n\t\t<n8n-action-box\n\t\t\tv-else-if=\"mounted && !isLoadingCloudPlans\"\n\t\t\t:buttonText=\"\n\t\t\t\t$locale.baseText(\n\t\t\t\t\tloading ? 'settings.api.create.button.loading' : 'settings.api.create.button',\n\t\t\t\t)\n\t\t\t\"\n\t\t\t:description=\"$locale.baseText('settings.api.create.description')\"\n\t\t\t@click:button=\"createApiKey\"\n\t\t/>\n\t</div>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent } from 'vue';\nimport type { IUser } from '@/Interface';\nimport { useToast } from '@/composables/useToast';\nimport { useMessage } from '@/composables/useMessage';\n\nimport CopyInput from '@/components/CopyInput.vue';\nimport { mapStores } from 'pinia';\nimport { useSettingsStore } from '@/stores/settings.store';\nimport { useRootStore } from '@/stores/n8nRoot.store';\nimport { useUIStore } from '@/stores/ui.store';\nimport { useUsersStore } from '@/stores/users.store';\nimport { useCloudPlanStore } from '@/stores/cloudPlan.store';\nimport { DOCS_DOMAIN, MODAL_CONFIRM } from '@/constants';\n\nexport default defineComponent({\n\tname: 'SettingsApiView',\n\tcomponents: {\n\t\tCopyInput,\n\t},\n\tsetup() {\n\t\treturn {\n\t\t\t...useToast(),\n\t\t\t...useMessage(),\n\t\t\t...useUIStore(),\n\t\t};\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tloading: false,\n\t\t\tmounted: false,\n\t\t\tapiKey: '',\n\t\t\tswaggerUIEnabled: false,\n\t\t\tapiDocsURL: '',\n\t\t};\n\t},\n\tmounted() {\n\t\tvoid this.getApiKey();\n\t\tconst baseUrl = this.rootStore.baseUrl;\n\t\tconst apiPath = this.settingsStore.publicApiPath;\n\t\tconst latestVersion = this.settingsStore.publicApiLatestVersion;\n\t\tthis.swaggerUIEnabled = this.settingsStore.isSwaggerUIEnabled;\n\t\tthis.apiDocsURL = this.swaggerUIEnabled\n\t\t\t? `${baseUrl}${apiPath}/v${latestVersion}/docs`\n\t\t\t: `https://${DOCS_DOMAIN}/api/api-reference/`;\n\t},\n\tcomputed: {\n\t\t...mapStores(useRootStore, useSettingsStore, useUsersStore, useCloudPlanStore, useUIStore),\n\t\tcurrentUser(): IUser | null {\n\t\t\treturn this.usersStore.currentUser;\n\t\t},\n\t\tisTrialing(): boolean {\n\t\t\treturn this.cloudPlanStore.userIsTrialing;\n\t\t},\n\t\tisLoadingCloudPlans(): boolean {\n\t\t\treturn this.cloudPlanStore.state.loadingPlan;\n\t\t},\n\t},\n\tmethods: {\n\t\tonUpgrade() {\n\t\t\tvoid this.uiStore.goToUpgrade('settings-n8n-api', 'upgrade-api', 'redirect');\n\t\t},\n\t\tasync showDeleteModal() {\n\t\t\tconst confirmed = await this.confirm(\n\t\t\t\tthis.$locale.baseText('settings.api.delete.description'),\n\t\t\t\tthis.$locale.baseText('settings.api.delete.title'),\n\t\t\t\t{\n\t\t\t\t\tconfirmButtonText: this.$locale.baseText('settings.api.delete.button'),\n\t\t\t\t\tcancelButtonText: this.$locale.baseText('generic.cancel'),\n\t\t\t\t},\n\t\t\t);\n\t\t\tif (confirmed === MODAL_CONFIRM) {\n\t\t\t\tawait this.deleteApiKey();\n\t\t\t}\n\t\t},\n\t\tasync getApiKey() {\n\t\t\ttry {\n\t\t\t\tthis.apiKey = (await this.settingsStore.getApiKey()) || '';\n\t\t\t} catch (error) {\n\t\t\t\tthis.showError(error, this.$locale.baseText('settings.api.view.error'));\n\t\t\t} finally {\n\t\t\t\tthis.mounted = true;\n\t\t\t}\n\t\t},\n\t\tasync createApiKey() {\n\t\t\tthis.loading = true;\n\n\t\t\ttry {\n\t\t\t\tthis.apiKey = (await this.settingsStore.createApiKey()) || '';\n\t\t\t} catch (error) {\n\t\t\t\tthis.showError(error, this.$locale.baseText('settings.api.create.error'));\n\t\t\t} finally {\n\t\t\t\tthis.loading = false;\n\t\t\t\tthis.$telemetry.track('User clicked create API key button');\n\t\t\t}\n\t\t},\n\t\tasync deleteApiKey() {\n\t\t\ttry {\n\t\t\t\tawait this.settingsStore.deleteApiKey();\n\t\t\t\tthis.showMessage({\n\t\t\t\t\ttitle: this.$locale.baseText('settings.api.delete.toast'),\n\t\t\t\t\ttype: 'success',\n\t\t\t\t});\n\t\t\t\tthis.apiKey = '';\n\t\t\t} catch (error) {\n\t\t\t\tthis.showError(error, this.$locale.baseText('settings.api.delete.error'));\n\t\t\t} finally {\n\t\t\t\tthis.$telemetry.track('User clicked delete API key button');\n\t\t\t}\n\t\t},\n\t\tonCopy() {\n\t\t\tthis.$telemetry.track('User clicked copy API key button');\n\t\t},\n\t},\n});\n</script>\n\n<style lang=\"scss\" module>\n.container {\n\t> * {\n\t\tmargin-bottom: var(--spacing-2xl);\n\t}\n}\n\n.header {\n\tdisplay: flex;\n\talign-items: center;\n\twhite-space: nowrap;\n\n\t*:first-child {\n\t\tflex-grow: 1;\n\t}\n}\n\n.card {\n\tposition: relative;\n}\n\n.delete {\n\tposition: absolute;\n\tdisplay: inline-block;\n\ttop: var(--spacing-s);\n\tright: var(--spacing-s);\n}\n\n.hint {\n\tcolor: var(--color-text-light);\n}\n</style>\n"],"names":["_sfc_main","defineComponent","CopyInput","useToast","useMessage","useUIStore","baseUrl","apiPath","latestVersion","DOCS_DOMAIN","mapStores","useRootStore","useSettingsStore","useUsersStore","useCloudPlanStore","MODAL_CONFIRM","error","_resolveComponent","_normalizeClass","_ctx","_withCtx","_createTextVNode","_toDisplayString","_createElementVNode","_normalizeStyle","_openBlock","_hoisted_1","_hoisted_2","_createVNode","_component_n8n_info_tip","_component_i18n_t","_hoisted_3","_component_n8n_link","_component_CopyInput","_component_n8n_text","_component_n8n_action_box","_createBlock"],"mappings":"qqCAoGA,MAAAA,EAAeC,EAAgB,CAC9B,KAAM,kBACN,WAAY,CACX,UAAAC,CACD,EACA,OAAQ,CACA,MAAA,CACN,GAAGC,EAAS,EACZ,GAAGC,EAAW,EACd,GAAGC,EAAW,CAAA,CAEhB,EACA,MAAO,CACC,MAAA,CACN,QAAS,GACT,QAAS,GACT,OAAQ,GACR,iBAAkB,GAClB,WAAY,EAAA,CAEd,EACA,SAAU,CACJ,KAAK,YACJ,MAAAC,EAAU,KAAK,UAAU,QACzBC,EAAU,KAAK,cAAc,cAC7BC,EAAgB,KAAK,cAAc,uBACpC,KAAA,iBAAmB,KAAK,cAAc,mBACtC,KAAA,WAAa,KAAK,iBACpB,GAAGF,CAAO,GAAGC,CAAO,KAAKC,CAAa,QACtC,WAAWC,CAAW,qBAC1B,EACA,SAAU,CACT,GAAG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