n8n-editor-ui 1.47.0 → 1.47.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 (160) hide show
  1. package/.turbo/turbo-build.log +78 -78
  2. package/dist/assets/{AuthView-BgFWzBDm.js → AuthView-CMxdNKZJ.js} +2 -2
  3. package/dist/assets/{AuthView-BgFWzBDm.js.map → AuthView-CMxdNKZJ.js.map} +1 -1
  4. package/dist/assets/{CanvasControls-m_3acPPd.js → CanvasControls-3FMjwMqA.js} +2 -2
  5. package/dist/assets/{CanvasControls-m_3acPPd.js.map → CanvasControls-3FMjwMqA.js.map} +1 -1
  6. package/dist/assets/{ChangePasswordView-CN6JWR-N.js → ChangePasswordView-_NkkcUVb.js} +2 -2
  7. package/dist/assets/{ChangePasswordView-CN6JWR-N.js.map → ChangePasswordView-_NkkcUVb.js.map} +1 -1
  8. package/dist/assets/{CollectionParameter-DHmcKhO-.js → CollectionParameter-BXMOfisf.js} +2 -2
  9. package/dist/assets/CollectionParameter-BXMOfisf.js.map +1 -0
  10. package/dist/assets/{CredentialsView-D9TXjOnK.js → CredentialsView-B2UF3tK_.js} +2 -2
  11. package/dist/assets/{CredentialsView-D9TXjOnK.js.map → CredentialsView-B2UF3tK_.js.map} +1 -1
  12. package/dist/assets/{ErrorView-CYag8fsg.js → ErrorView-B_lpOlen.js} +2 -2
  13. package/dist/assets/{ErrorView-CYag8fsg.js.map → ErrorView-B_lpOlen.js.map} +1 -1
  14. package/dist/assets/{ExecutionsFilter-Cf35yNfd.js → ExecutionsFilter-dNFZor7l.js} +2 -2
  15. package/dist/assets/{ExecutionsFilter-Cf35yNfd.js.map → ExecutionsFilter-dNFZor7l.js.map} +1 -1
  16. package/dist/assets/{ExecutionsView-ztrgLYNP.js → ExecutionsView-BYe-KERG.js} +2 -2
  17. package/dist/assets/{ExecutionsView-ztrgLYNP.js.map → ExecutionsView-BYe-KERG.js.map} +1 -1
  18. package/dist/assets/{ForgotMyPasswordView-C-0yB-bx.js → ForgotMyPasswordView-D97J06wc.js} +2 -2
  19. package/dist/assets/{ForgotMyPasswordView-C-0yB-bx.js.map → ForgotMyPasswordView-D97J06wc.js.map} +1 -1
  20. package/dist/assets/MainHeader-CT4nF2mY.js +2 -0
  21. package/dist/assets/{MainHeader-CMxbwL4C.js.map → MainHeader-CT4nF2mY.js.map} +1 -1
  22. package/dist/assets/{MainSidebar-BuwaBgG9.js → MainSidebar-CTg5wPzP.js} +2 -2
  23. package/dist/assets/{MainSidebar-BuwaBgG9.js.map → MainSidebar-CTg5wPzP.js.map} +1 -1
  24. package/dist/assets/{NodeCreation-B7Uimsok.js → NodeCreation-BF_L2-99.js} +3 -3
  25. package/dist/assets/{NodeCreation-B7Uimsok.js.map → NodeCreation-BF_L2-99.js.map} +1 -1
  26. package/dist/assets/{NodeCreator-IRjqf3_R.js → NodeCreator-B_yCtSu6.js} +2 -2
  27. package/dist/assets/{NodeCreator-IRjqf3_R.js.map → NodeCreator-B_yCtSu6.js.map} +1 -1
  28. package/dist/assets/{NodeDetailsView-CSnjluIR.js → NodeDetailsView-ggolOsHM.js} +4 -4
  29. package/dist/assets/{NodeDetailsView-CSnjluIR.js.map → NodeDetailsView-ggolOsHM.js.map} +1 -1
  30. package/dist/assets/{NodeView-DMzj-gox.css → NodeView--67hs6V6.css} +1 -1
  31. package/dist/assets/NodeView-B2MlTl6g.js +3 -0
  32. package/dist/assets/NodeView-B2MlTl6g.js.map +1 -0
  33. package/dist/assets/{NodeView.v2-DyU_S0rY.js → NodeView.v2-D_CKj9CS.js} +3 -3
  34. package/dist/assets/{NodeView.v2-DyU_S0rY.js.map → NodeView.v2-D_CKj9CS.js.map} +1 -1
  35. package/dist/assets/{ProjectCardBadge.vue_vue_type_script_setup_true_lang-C1N0EZCM.js → ProjectCardBadge.vue_vue_type_script_setup_true_lang-DdHOM703.js} +2 -2
  36. package/dist/assets/{ProjectCardBadge.vue_vue_type_script_setup_true_lang-C1N0EZCM.js.map → ProjectCardBadge.vue_vue_type_script_setup_true_lang-DdHOM703.js.map} +1 -1
  37. package/dist/assets/{ProjectSettings-CbNlX27g.js → ProjectSettings-DpJesEZX.js} +2 -2
  38. package/dist/assets/{ProjectSettings-CbNlX27g.js.map → ProjectSettings-DpJesEZX.js.map} +1 -1
  39. package/dist/assets/{ProjectTabs-Cx2VWeba.js → ProjectTabs-D7nNxtFO.js} +2 -2
  40. package/dist/assets/{ProjectTabs-Cx2VWeba.js.map → ProjectTabs-D7nNxtFO.js.map} +1 -1
  41. package/dist/assets/{PushConnectionTracker-C_r8Zv-p.js → PushConnectionTracker-YJuy57g2.js} +2 -2
  42. package/dist/assets/{PushConnectionTracker-C_r8Zv-p.js.map → PushConnectionTracker-YJuy57g2.js.map} +1 -1
  43. package/dist/assets/{ResourcesListLayout-CKSHiUAP.js → ResourcesListLayout-mZ4ijKRB.js} +2 -2
  44. package/dist/assets/{ResourcesListLayout-CKSHiUAP.js.map → ResourcesListLayout-mZ4ijKRB.js.map} +1 -1
  45. package/dist/assets/{RunDataAi-BVqsN7UN.js → RunDataAi-D0m0Vg_p.js} +2 -2
  46. package/dist/assets/{RunDataAi-BVqsN7UN.js.map → RunDataAi-D0m0Vg_p.js.map} +1 -1
  47. package/dist/assets/{RunDataJson-6Yfwd78r.js → RunDataJson-DkHNIqVj.js} +3 -3
  48. package/dist/assets/{RunDataJson-6Yfwd78r.js.map → RunDataJson-DkHNIqVj.js.map} +1 -1
  49. package/dist/assets/{RunDataJsonActions-5ig3g4km.js → RunDataJsonActions-Cgxcpw8t.js} +2 -2
  50. package/dist/assets/{RunDataJsonActions-5ig3g4km.js.map → RunDataJsonActions-Cgxcpw8t.js.map} +1 -1
  51. package/dist/assets/{RunDataSchema-CrW957BW.js → RunDataSchema-C6aZoC0a.js} +3 -3
  52. package/dist/assets/{RunDataSchema-CrW957BW.js.map → RunDataSchema-C6aZoC0a.js.map} +1 -1
  53. package/dist/assets/{RunDataSearch-BrIWOZXO.js → RunDataSearch-D2CDg21N.js} +2 -2
  54. package/dist/assets/{RunDataSearch-BrIWOZXO.js.map → RunDataSearch-D2CDg21N.js.map} +1 -1
  55. package/dist/assets/RunDataTable-D597NRFD.js +2 -0
  56. package/dist/assets/{RunDataTable-B01U16vv.js.map → RunDataTable-D597NRFD.js.map} +1 -1
  57. package/dist/assets/{SamlOnboarding-CfbBlTNm.js → SamlOnboarding-Me669myi.js} +2 -2
  58. package/dist/assets/{SamlOnboarding-CfbBlTNm.js.map → SamlOnboarding-Me669myi.js.map} +1 -1
  59. package/dist/assets/{SettingsApiView-CuliNEKo.js → SettingsApiView-DV8pIHDw.js} +2 -2
  60. package/dist/assets/{SettingsApiView-CuliNEKo.js.map → SettingsApiView-DV8pIHDw.js.map} +1 -1
  61. package/dist/assets/{SettingsCommunityNodesView-CeY4uqH-.js → SettingsCommunityNodesView-D_gtSdk3.js} +2 -2
  62. package/dist/assets/{SettingsCommunityNodesView-CeY4uqH-.js.map → SettingsCommunityNodesView-D_gtSdk3.js.map} +1 -1
  63. package/dist/assets/{SettingsExternalSecrets-CE7ObFx_.js → SettingsExternalSecrets-xprYKjAW.js} +2 -2
  64. package/dist/assets/{SettingsExternalSecrets-CE7ObFx_.js.map → SettingsExternalSecrets-xprYKjAW.js.map} +1 -1
  65. package/dist/assets/{SettingsFakeDoorView-DQqNf_Q9.js → SettingsFakeDoorView-CKaSOYh5.js} +2 -2
  66. package/dist/assets/{SettingsFakeDoorView-DQqNf_Q9.js.map → SettingsFakeDoorView-CKaSOYh5.js.map} +1 -1
  67. package/dist/assets/{SettingsLdapView-9hy5C87y.js → SettingsLdapView-BBCv2tmk.js} +2 -2
  68. package/dist/assets/{SettingsLdapView-9hy5C87y.js.map → SettingsLdapView-BBCv2tmk.js.map} +1 -1
  69. package/dist/assets/{SettingsLogStreamingView-Cc0h5DhT.js → SettingsLogStreamingView-HRIp8kyL.js} +2 -2
  70. package/dist/assets/{SettingsLogStreamingView-Cc0h5DhT.js.map → SettingsLogStreamingView-HRIp8kyL.js.map} +1 -1
  71. package/dist/assets/{SettingsPersonalView-Cs82ezMX.js → SettingsPersonalView-CsUb3SvK.js} +2 -2
  72. package/dist/assets/{SettingsPersonalView-Cs82ezMX.js.map → SettingsPersonalView-CsUb3SvK.js.map} +1 -1
  73. package/dist/assets/{SettingsSourceControl-Dr7R-QpH.js → SettingsSourceControl-BkPpVGsk.js} +2 -2
  74. package/dist/assets/{SettingsSourceControl-Dr7R-QpH.js.map → SettingsSourceControl-BkPpVGsk.js.map} +1 -1
  75. package/dist/assets/{SettingsSso-Di6lHXV2.js → SettingsSso-BueUV3RH.js} +2 -2
  76. package/dist/assets/{SettingsSso-Di6lHXV2.js.map → SettingsSso-BueUV3RH.js.map} +1 -1
  77. package/dist/assets/{SettingsUsageAndPlan-g86Q7EQY.js → SettingsUsageAndPlan-DzDC9m54.js} +2 -2
  78. package/dist/assets/{SettingsUsageAndPlan-g86Q7EQY.js.map → SettingsUsageAndPlan-DzDC9m54.js.map} +1 -1
  79. package/dist/assets/{SettingsUsersView-dOWjUJTW.js → SettingsUsersView-CTd5MQLw.js} +2 -2
  80. package/dist/assets/{SettingsUsersView-dOWjUJTW.js.map → SettingsUsersView-CTd5MQLw.js.map} +1 -1
  81. package/dist/assets/{SettingsView-DQ0hQWFt.js → SettingsView-DMxqsNh0.js} +2 -2
  82. package/dist/assets/{SettingsView-DQ0hQWFt.js.map → SettingsView-DMxqsNh0.js.map} +1 -1
  83. package/dist/assets/{SetupView-CqT8d0D8.js → SetupView-tkyttChl.js} +2 -2
  84. package/dist/assets/{SetupView-CqT8d0D8.js.map → SetupView-tkyttChl.js.map} +1 -1
  85. package/dist/assets/{SetupWorkflowCredentialsButton-BR-ObOqw.js → SetupWorkflowCredentialsButton-B3HZvKQp.js} +2 -2
  86. package/dist/assets/{SetupWorkflowCredentialsButton-BR-ObOqw.js.map → SetupWorkflowCredentialsButton-B3HZvKQp.js.map} +1 -1
  87. package/dist/assets/{SetupWorkflowFromTemplateView-DHHtk6_-.js → SetupWorkflowFromTemplateView-DL3b-TZS.js} +2 -2
  88. package/dist/assets/{SetupWorkflowFromTemplateView-DHHtk6_-.js.map → SetupWorkflowFromTemplateView-DL3b-TZS.js.map} +1 -1
  89. package/dist/assets/{SigninView-2eLLF8DU.js → SigninView-BPLGsvzz.js} +2 -2
  90. package/dist/assets/{SigninView-2eLLF8DU.js.map → SigninView-BPLGsvzz.js.map} +1 -1
  91. package/dist/assets/{SignoutView-BQyCyjsK.js → SignoutView-BySf9D7k.js} +2 -2
  92. package/dist/assets/{SignoutView-BQyCyjsK.js.map → SignoutView-BySf9D7k.js.map} +1 -1
  93. package/dist/assets/{SignupView-ByYEkUpW.js → SignupView-EU3JWt4T.js} +2 -2
  94. package/dist/assets/{SignupView-ByYEkUpW.js.map → SignupView-EU3JWt4T.js.map} +1 -1
  95. package/dist/assets/{TemplateDetails-I6WMCxGm.js → TemplateDetails-Cemx-ozB.js} +2 -2
  96. package/dist/assets/{TemplateDetails-I6WMCxGm.js.map → TemplateDetails-Cemx-ozB.js.map} +1 -1
  97. package/dist/assets/{TemplateList-DRf0Cbhg.js → TemplateList-h3b91b7e.js} +2 -2
  98. package/dist/assets/{TemplateList-DRf0Cbhg.js.map → TemplateList-h3b91b7e.js.map} +1 -1
  99. package/dist/assets/{TemplatesCollectionView-BYkDe49v.js → TemplatesCollectionView-aBX3f7Pp.js} +2 -2
  100. package/dist/assets/{TemplatesCollectionView-BYkDe49v.js.map → TemplatesCollectionView-aBX3f7Pp.js.map} +1 -1
  101. package/dist/assets/{TemplatesSearchView-CiZ7aZcy.js → TemplatesSearchView-DyoC9WUR.js} +2 -2
  102. package/dist/assets/{TemplatesSearchView-CiZ7aZcy.js.map → TemplatesSearchView-DyoC9WUR.js.map} +1 -1
  103. package/dist/assets/{TemplatesView-zULLoEwu.js → TemplatesView-GQmC_sY8.js} +2 -2
  104. package/dist/assets/{TemplatesView-zULLoEwu.js.map → TemplatesView-GQmC_sY8.js.map} +1 -1
  105. package/dist/assets/{TemplatesWorkflowView-DptRLbdX.js → TemplatesWorkflowView-C-0pXdDh.js} +2 -2
  106. package/dist/assets/{TemplatesWorkflowView-DptRLbdX.js.map → TemplatesWorkflowView-C-0pXdDh.js.map} +1 -1
  107. package/dist/assets/{VariablesView-NcNcsjHY.js → VariablesView-BO5fdkwt.js} +2 -2
  108. package/dist/assets/{VariablesView-NcNcsjHY.js.map → VariablesView-BO5fdkwt.js.map} +1 -1
  109. package/dist/assets/{WorkerView-dtJzfgCM.js → WorkerView-C3Rdbsfq.js} +2 -2
  110. package/dist/assets/{WorkerView-dtJzfgCM.js.map → WorkerView-C3Rdbsfq.js.map} +1 -1
  111. package/dist/assets/{WorkflowActivator-D6Zad1X2.js → WorkflowActivator-DQXSsw0V.js} +2 -2
  112. package/dist/assets/{WorkflowActivator-D6Zad1X2.js.map → WorkflowActivator-DQXSsw0V.js.map} +1 -1
  113. package/dist/assets/{WorkflowExecutionsInfoAccordion-C86A1CHv.js → WorkflowExecutionsInfoAccordion-DJPF47om.js} +2 -2
  114. package/dist/assets/{WorkflowExecutionsInfoAccordion-C86A1CHv.js.map → WorkflowExecutionsInfoAccordion-DJPF47om.js.map} +1 -1
  115. package/dist/assets/{WorkflowExecutionsLandingPage-DAfHDMth.js → WorkflowExecutionsLandingPage-DoSsHWxH.js} +2 -2
  116. package/dist/assets/{WorkflowExecutionsLandingPage-DAfHDMth.js.map → WorkflowExecutionsLandingPage-DoSsHWxH.js.map} +1 -1
  117. package/dist/assets/{WorkflowExecutionsPreview-C_EBlNX6.js → WorkflowExecutionsPreview-Dt23N5A4.js} +2 -2
  118. package/dist/assets/WorkflowExecutionsPreview-Dt23N5A4.js.map +1 -0
  119. package/dist/assets/WorkflowExecutionsView-CpAIVxYQ.js +2 -0
  120. package/dist/assets/WorkflowExecutionsView-CpAIVxYQ.js.map +1 -0
  121. package/dist/assets/{WorkflowHistory-DkdQ1koF.js → WorkflowHistory-D1-E_J_s.js} +2 -2
  122. package/dist/assets/{WorkflowHistory-DkdQ1koF.js.map → WorkflowHistory-D1-E_J_s.js.map} +1 -1
  123. package/dist/assets/{WorkflowOnboardingView-BPMBW_hz.js → WorkflowOnboardingView-fzAZuVh5.js} +2 -2
  124. package/dist/assets/{WorkflowOnboardingView-BPMBW_hz.js.map → WorkflowOnboardingView-fzAZuVh5.js.map} +1 -1
  125. package/dist/assets/{WorkflowPreview-CLzyAzmJ.js → WorkflowPreview-BkL2jDRm.js} +2 -2
  126. package/dist/assets/{WorkflowPreview-CLzyAzmJ.js.map → WorkflowPreview-BkL2jDRm.js.map} +1 -1
  127. package/dist/assets/{WorkflowsView-CzJx_-P5.js → WorkflowsView-rbygROmM.js} +2 -2
  128. package/dist/assets/{WorkflowsView-CzJx_-P5.js.map → WorkflowsView-rbygROmM.js.map} +1 -1
  129. package/dist/assets/{cloud-CRMEbZfJ.js → cloud-B90x0-JC.js} +2 -2
  130. package/dist/assets/{cloud-CRMEbZfJ.js.map → cloud-B90x0-JC.js.map} +1 -1
  131. package/dist/assets/{collaboration.store-Co5wlk8y.js → collaboration.store-ElxCV91F.js} +2 -2
  132. package/dist/assets/{collaboration.store-Co5wlk8y.js.map → collaboration.store-ElxCV91F.js.map} +1 -1
  133. package/dist/assets/index-BE0Xl-jy.js +341 -0
  134. package/dist/assets/index-BE0Xl-jy.js.map +1 -0
  135. package/dist/assets/{nodeCreator.store-CTXKjjQB.js → nodeCreator.store-Q1T99YCl.js} +2 -2
  136. package/dist/assets/{nodeCreator.store-CTXKjjQB.js.map → nodeCreator.store-Q1T99YCl.js.map} +1 -1
  137. package/dist/assets/{templateActions-CIRsIG2W.js → templateActions-B7R6qRak.js} +2 -2
  138. package/dist/assets/{templateActions-CIRsIG2W.js.map → templateActions-B7R6qRak.js.map} +1 -1
  139. package/dist/assets/{useExecutionDebugging-BzC-1xF-.js → useExecutionDebugging-BJ0CgMh8.js} +2 -2
  140. package/dist/assets/{useExecutionDebugging-BzC-1xF-.js.map → useExecutionDebugging-BJ0CgMh8.js.map} +1 -1
  141. package/dist/assets/{useExecutionHelpers-C2K8pfbF.js → useExecutionHelpers-D3294Pbg.js} +2 -2
  142. package/dist/assets/{useExecutionHelpers-C2K8pfbF.js.map → useExecutionHelpers-D3294Pbg.js.map} +1 -1
  143. package/dist/assets/{usePushConnection-EMXpPhl-.js → usePushConnection-CsYeEXN4.js} +2 -2
  144. package/dist/assets/{usePushConnection-EMXpPhl-.js.map → usePushConnection-CsYeEXN4.js.map} +1 -1
  145. package/dist/assets/{useUserHelpers-Bn_ZV9Jv.js → useUserHelpers-CzNhI0vP.js} +2 -2
  146. package/dist/assets/{useUserHelpers-Bn_ZV9Jv.js.map → useUserHelpers-CzNhI0vP.js.map} +1 -1
  147. package/dist/assets/{useWorkflowActivate-BwVActuc.js → useWorkflowActivate-D8iK20ua.js} +2 -2
  148. package/dist/assets/{useWorkflowActivate-BwVActuc.js.map → useWorkflowActivate-D8iK20ua.js.map} +1 -1
  149. package/dist/index.html +1 -1
  150. package/package.json +1 -1
  151. package/dist/assets/CollectionParameter-DHmcKhO-.js.map +0 -1
  152. package/dist/assets/MainHeader-CMxbwL4C.js +0 -2
  153. package/dist/assets/NodeView-C-hQ3_xD.js +0 -3
  154. package/dist/assets/NodeView-C-hQ3_xD.js.map +0 -1
  155. package/dist/assets/RunDataTable-B01U16vv.js +0 -2
  156. package/dist/assets/WorkflowExecutionsPreview-C_EBlNX6.js.map +0 -1
  157. package/dist/assets/WorkflowExecutionsView-Nm1Oo9El.js +0 -2
  158. package/dist/assets/WorkflowExecutionsView-Nm1Oo9El.js.map +0 -1
  159. package/dist/assets/index-Dtri_pSJ.js +0 -341
  160. package/dist/assets/index-Dtri_pSJ.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"WorkflowsView-CzJx_-P5.js","sources":["../../src/components/WorkflowCard.vue","../../src/views/WorkflowsView.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport type { IWorkflowDb, IUser } from '@/Interface';\nimport {\n\tDUPLICATE_MODAL_KEY,\n\tMODAL_CONFIRM,\n\tPROJECT_MOVE_RESOURCE_MODAL,\n\tVIEWS,\n\tWORKFLOW_SHARE_MODAL_KEY,\n} from '@/constants';\nimport { useMessage } from '@/composables/useMessage';\nimport { useToast } from '@/composables/useToast';\nimport { getWorkflowPermissions } from '@/permissions';\nimport dateformat from 'dateformat';\nimport WorkflowActivator from '@/components/WorkflowActivator.vue';\nimport { useUIStore } from '@/stores/ui.store';\nimport { useSettingsStore } from '@/stores/settings.store';\nimport { useUsersStore } from '@/stores/users.store';\nimport { useWorkflowsStore } from '@/stores/workflows.store';\nimport TimeAgo from '@/components/TimeAgo.vue';\nimport type { ProjectSharingData } from '@/types/projects.types';\nimport { useProjectsStore } from '@/stores/projects.store';\nimport ProjectCardBadge from '@/components/Projects/ProjectCardBadge.vue';\nimport { useI18n } from '@/composables/useI18n';\nimport { useRouter } from 'vue-router';\nimport { useTelemetry } from '@/composables/useTelemetry';\n\nconst WORKFLOW_LIST_ITEM_ACTIONS = {\n\tOPEN: 'open',\n\tSHARE: 'share',\n\tDUPLICATE: 'duplicate',\n\tDELETE: 'delete',\n\tMOVE: 'move',\n};\n\nconst props = withDefaults(\n\tdefineProps<{\n\t\tdata: IWorkflowDb;\n\t\treadOnly?: boolean;\n\t}>(),\n\t{\n\t\tdata: () => ({\n\t\t\tid: '',\n\t\t\tcreatedAt: '',\n\t\t\tupdatedAt: '',\n\t\t\tactive: false,\n\t\t\tconnections: {},\n\t\t\tnodes: [],\n\t\t\tname: '',\n\t\t\tsharedWithProjects: [],\n\t\t\thomeProject: {} as ProjectSharingData,\n\t\t\tversionId: '',\n\t\t}),\n\t\treadOnly: false,\n\t},\n);\n\nconst emit = defineEmits<{\n\t(event: 'expand:tags'): void;\n\t(event: 'click:tag', tagId: string, e: PointerEvent): void;\n}>();\n\nconst toast = useToast();\nconst message = useMessage();\nconst locale = useI18n();\nconst router = useRouter();\nconst telemetry = useTelemetry();\n\nconst settingsStore = useSettingsStore();\nconst uiStore = useUIStore();\nconst usersStore = useUsersStore();\nconst workflowsStore = useWorkflowsStore();\nconst projectsStore = useProjectsStore();\n\nconst currentUser = computed(() => usersStore.currentUser ?? ({} as IUser));\nconst workflowPermissions = computed(() => getWorkflowPermissions(props.data));\nconst actions = computed(() => {\n\tconst items = [\n\t\t{\n\t\t\tlabel: locale.baseText('workflows.item.open'),\n\t\t\tvalue: WORKFLOW_LIST_ITEM_ACTIONS.OPEN,\n\t\t},\n\t\t{\n\t\t\tlabel: locale.baseText('workflows.item.share'),\n\t\t\tvalue: WORKFLOW_LIST_ITEM_ACTIONS.SHARE,\n\t\t},\n\t];\n\n\tif (!props.readOnly) {\n\t\titems.push({\n\t\t\tlabel: locale.baseText('workflows.item.duplicate'),\n\t\t\tvalue: WORKFLOW_LIST_ITEM_ACTIONS.DUPLICATE,\n\t\t});\n\t}\n\n\tif (workflowPermissions.value.move) {\n\t\titems.push({\n\t\t\tlabel: locale.baseText('workflows.item.move'),\n\t\t\tvalue: WORKFLOW_LIST_ITEM_ACTIONS.MOVE,\n\t\t});\n\t}\n\n\tif (workflowPermissions.value.delete && !props.readOnly) {\n\t\titems.push({\n\t\t\tlabel: locale.baseText('workflows.item.delete'),\n\t\t\tvalue: WORKFLOW_LIST_ITEM_ACTIONS.DELETE,\n\t\t});\n\t}\n\n\treturn items;\n});\nconst formattedCreatedAtDate = computed(() => {\n\tconst currentYear = new Date().getFullYear().toString();\n\n\treturn dateformat(\n\t\tprops.data.createdAt,\n\t\t`d mmmm${String(props.data.createdAt).startsWith(currentYear) ? '' : ', yyyy'}`,\n\t);\n});\n\nasync function onClick(event?: KeyboardEvent | PointerEvent) {\n\tif (event?.ctrlKey || event?.metaKey) {\n\t\tconst route = router.resolve({\n\t\t\tname: VIEWS.WORKFLOW,\n\t\t\tparams: { name: props.data.id },\n\t\t});\n\t\twindow.open(route.href, '_blank');\n\n\t\treturn;\n\t}\n\n\tawait router.push({\n\t\tname: VIEWS.WORKFLOW,\n\t\tparams: { name: props.data.id },\n\t});\n}\n\nfunction onClickTag(tagId: string, event: PointerEvent) {\n\tevent.stopPropagation();\n\temit('click:tag', tagId, event);\n}\n\nfunction onExpandTags() {\n\temit('expand:tags');\n}\n\nasync function onAction(action: string) {\n\tswitch (action) {\n\t\tcase WORKFLOW_LIST_ITEM_ACTIONS.OPEN:\n\t\t\tawait onClick();\n\t\t\tbreak;\n\t\tcase WORKFLOW_LIST_ITEM_ACTIONS.DUPLICATE:\n\t\t\tuiStore.openModalWithData({\n\t\t\t\tname: DUPLICATE_MODAL_KEY,\n\t\t\t\tdata: {\n\t\t\t\t\tid: props.data.id,\n\t\t\t\t\tname: props.data.name,\n\t\t\t\t\ttags: (props.data.tags ?? []).map((tag) =>\n\t\t\t\t\t\ttypeof tag !== 'string' && 'id' in tag ? tag.id : tag,\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t});\n\t\t\tbreak;\n\t\tcase WORKFLOW_LIST_ITEM_ACTIONS.SHARE:\n\t\t\tuiStore.openModalWithData({\n\t\t\t\tname: WORKFLOW_SHARE_MODAL_KEY,\n\t\t\t\tdata: { id: props.data.id },\n\t\t\t});\n\n\t\t\ttelemetry.track('User opened sharing modal', {\n\t\t\t\tworkflow_id: props.data.id,\n\t\t\t\tuser_id_sharer: currentUser.value.id,\n\t\t\t\tsub_view: 'Workflows listing',\n\t\t\t});\n\t\t\tbreak;\n\t\tcase WORKFLOW_LIST_ITEM_ACTIONS.DELETE:\n\t\t\tawait deleteWorkflow();\n\t\t\tbreak;\n\t\tcase WORKFLOW_LIST_ITEM_ACTIONS.MOVE:\n\t\t\tmoveResource();\n\t\t\tbreak;\n\t}\n}\n\nasync function deleteWorkflow() {\n\tconst deleteConfirmed = await message.confirm(\n\t\tlocale.baseText('mainSidebar.confirmMessage.workflowDelete.message', {\n\t\t\tinterpolate: { workflowName: props.data.name },\n\t\t}),\n\t\tlocale.baseText('mainSidebar.confirmMessage.workflowDelete.headline'),\n\t\t{\n\t\t\ttype: 'warning',\n\t\t\tconfirmButtonText: locale.baseText(\n\t\t\t\t'mainSidebar.confirmMessage.workflowDelete.confirmButtonText',\n\t\t\t),\n\t\t\tcancelButtonText: locale.baseText(\n\t\t\t\t'mainSidebar.confirmMessage.workflowDelete.cancelButtonText',\n\t\t\t),\n\t\t},\n\t);\n\n\tif (deleteConfirmed !== MODAL_CONFIRM) {\n\t\treturn;\n\t}\n\n\ttry {\n\t\tawait workflowsStore.deleteWorkflow(props.data.id);\n\t} catch (error) {\n\t\ttoast.showError(error, locale.baseText('generic.deleteWorkflowError'));\n\t\treturn;\n\t}\n\n\t// Reset tab title since workflow is deleted.\n\ttoast.showMessage({\n\t\ttitle: locale.baseText('mainSidebar.showMessage.handleSelect1.title'),\n\t\ttype: 'success',\n\t});\n}\n\nfunction moveResource() {\n\tuiStore.openModalWithData({\n\t\tname: PROJECT_MOVE_RESOURCE_MODAL,\n\t\tdata: {\n\t\t\tresource: props.data,\n\t\t\tresourceType: locale.baseText('generic.workflow').toLocaleLowerCase(),\n\t\t},\n\t});\n}\n</script>\n\n<template>\n\t<n8n-card :class=\"$style.cardLink\" @click=\"onClick\">\n\t\t<template #header>\n\t\t\t<n8n-heading tag=\"h2\" bold :class=\"$style.cardHeading\" data-test-id=\"workflow-card-name\">\n\t\t\t\t{{ data.name }}\n\t\t\t</n8n-heading>\n\t\t</template>\n\t\t<div :class=\"$style.cardDescription\">\n\t\t\t<n8n-text color=\"text-light\" size=\"small\">\n\t\t\t\t<span v-show=\"data\"\n\t\t\t\t\t>{{ $locale.baseText('workflows.item.updated') }}\n\t\t\t\t\t<TimeAgo :date=\"String(data.updatedAt)\" /> |\n\t\t\t\t</span>\n\t\t\t\t<span v-show=\"data\" class=\"mr-2xs\"\n\t\t\t\t\t>{{ $locale.baseText('workflows.item.created') }} {{ formattedCreatedAtDate }}\n\t\t\t\t</span>\n\t\t\t\t<span\n\t\t\t\t\tv-if=\"settingsStore.areTagsEnabled && data.tags && data.tags.length > 0\"\n\t\t\t\t\tv-show=\"data\"\n\t\t\t\t>\n\t\t\t\t\t<n8n-tags\n\t\t\t\t\t\t:tags=\"data.tags\"\n\t\t\t\t\t\t:truncate-at=\"3\"\n\t\t\t\t\t\ttruncate\n\t\t\t\t\t\tdata-test-id=\"workflow-card-tags\"\n\t\t\t\t\t\t@click:tag=\"onClickTag\"\n\t\t\t\t\t\t@expand=\"onExpandTags\"\n\t\t\t\t\t/>\n\t\t\t\t</span>\n\t\t\t</n8n-text>\n\t\t</div>\n\t\t<template #append>\n\t\t\t<div :class=\"$style.cardActions\" @click.stop>\n\t\t\t\t<ProjectCardBadge :resource=\"data\" :personal-project=\"projectsStore.personalProject\" />\n\t\t\t\t<WorkflowActivator\n\t\t\t\t\tclass=\"mr-s\"\n\t\t\t\t\t:workflow-active=\"data.active\"\n\t\t\t\t\t:workflow-id=\"data.id\"\n\t\t\t\t\tdata-test-id=\"workflow-card-activator\"\n\t\t\t\t/>\n\n\t\t\t\t<n8n-action-toggle\n\t\t\t\t\t:actions=\"actions\"\n\t\t\t\t\ttheme=\"dark\"\n\t\t\t\t\tdata-test-id=\"workflow-card-actions\"\n\t\t\t\t\t@action=\"onAction\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</template>\n\t</n8n-card>\n</template>\n\n<style lang=\"scss\" module>\n.cardLink {\n\ttransition: box-shadow 0.3s ease;\n\tcursor: pointer;\n\tpadding: 0;\n\talign-items: stretch;\n\n\t&:hover {\n\t\tbox-shadow: 0 2px 8px rgba(#441c17, 0.1);\n\t}\n}\n\n.cardHeading {\n\tfont-size: var(--font-size-s);\n\tword-break: break-word;\n\tpadding: var(--spacing-s) 0 0 var(--spacing-s);\n\n\tspan {\n\t\tcolor: var(--color-text-light);\n\t}\n}\n\n.cardDescription {\n\tmin-height: 19px;\n\tdisplay: flex;\n\talign-items: center;\n\tpadding: 0 0 var(--spacing-s) var(--spacing-s);\n}\n\n.cardActions {\n\tdisplay: flex;\n\tflex-direction: row;\n\tjustify-content: center;\n\talign-items: center;\n\talign-self: stretch;\n\tpadding: 0 var(--spacing-s) 0 0;\n\tcursor: default;\n}\n</style>\n","<template>\n\t<ResourcesListLayout\n\t\tref=\"layout\"\n\t\tresource-key=\"workflows\"\n\t\t:resources=\"allWorkflows\"\n\t\t:filters=\"filters\"\n\t\t:additional-filters-handler=\"onFilter\"\n\t\t:type-props=\"{ itemSize: 80 }\"\n\t\t:shareable=\"isShareable\"\n\t\t:initialize=\"initialize\"\n\t\t:disabled=\"readOnlyEnv\"\n\t\t@click:add=\"addWorkflow\"\n\t\t@update:filters=\"onFiltersUpdated\"\n\t>\n\t\t<template #header>\n\t\t\t<ProjectTabs v-if=\"showProjectTabs\" />\n\t\t</template>\n\t\t<template #add-button=\"{ disabled }\">\n\t\t\t<n8n-tooltip :disabled=\"!readOnlyEnv\">\n\t\t\t\t<div>\n\t\t\t\t\t<n8n-button\n\t\t\t\t\t\tsize=\"large\"\n\t\t\t\t\t\tblock\n\t\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t\tdata-test-id=\"resources-list-add\"\n\t\t\t\t\t\t@click=\"addWorkflow\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{{ addWorkflowButtonText }}\n\t\t\t\t\t</n8n-button>\n\t\t\t\t</div>\n\t\t\t\t<template #content>\n\t\t\t\t\t<i18n-t tag=\"span\" keypath=\"mainSidebar.workflows.readOnlyEnv.tooltip\">\n\t\t\t\t\t\t<template #link>\n\t\t\t\t\t\t\t<a target=\"_blank\" href=\"https://docs.n8n.io/source-control-environments/\">\n\t\t\t\t\t\t\t\t{{ $locale.baseText('mainSidebar.workflows.readOnlyEnv.tooltip.link') }}\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</i18n-t>\n\t\t\t\t</template>\n\t\t\t</n8n-tooltip>\n\t\t</template>\n\t\t<template #default=\"{ data, updateItemSize }\">\n\t\t\t<WorkflowCard\n\t\t\t\tdata-test-id=\"resources-list-item\"\n\t\t\t\tclass=\"mb-2xs\"\n\t\t\t\t:data=\"data\"\n\t\t\t\t:read-only=\"readOnlyEnv\"\n\t\t\t\t@expand:tags=\"updateItemSize(data)\"\n\t\t\t\t@click:tag=\"onClickTag\"\n\t\t\t/>\n\t\t</template>\n\t\t<template #empty>\n\t\t\t<div class=\"text-center mt-s\">\n\t\t\t\t<n8n-heading tag=\"h2\" size=\"xlarge\" class=\"mb-2xs\">\n\t\t\t\t\t{{\n\t\t\t\t\t\tcurrentUser.firstName\n\t\t\t\t\t\t\t? $locale.baseText('workflows.empty.heading', {\n\t\t\t\t\t\t\t\t\tinterpolate: { name: currentUser.firstName },\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t: $locale.baseText('workflows.empty.heading.userNotSetup')\n\t\t\t\t\t}}\n\t\t\t\t</n8n-heading>\n\t\t\t\t<n8n-text size=\"large\" color=\"text-base\">\n\t\t\t\t\t{{\n\t\t\t\t\t\t$locale.baseText(\n\t\t\t\t\t\t\treadOnlyEnv\n\t\t\t\t\t\t\t\t? 'workflows.empty.description.readOnlyEnv'\n\t\t\t\t\t\t\t\t: 'workflows.empty.description',\n\t\t\t\t\t\t)\n\t\t\t\t\t}}\n\t\t\t\t</n8n-text>\n\t\t\t</div>\n\t\t\t<div v-if=\"!readOnlyEnv\" :class=\"['text-center', 'mt-2xl', $style.actionsContainer]\">\n\t\t\t\t<a\n\t\t\t\t\tv-if=\"isSalesUser\"\n\t\t\t\t\t:href=\"getTemplateRepositoryURL()\"\n\t\t\t\t\t:class=\"$style.emptyStateCard\"\n\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t>\n\t\t\t\t\t<n8n-card\n\t\t\t\t\t\thoverable\n\t\t\t\t\t\tdata-test-id=\"browse-sales-templates-card\"\n\t\t\t\t\t\t@click=\"trackCategoryLinkClick('Sales')\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<n8n-icon :class=\"$style.emptyStateCardIcon\" icon=\"box-open\" />\n\t\t\t\t\t\t<n8n-text size=\"large\" class=\"mt-xs\" color=\"text-base\">\n\t\t\t\t\t\t\t{{ $locale.baseText('workflows.empty.browseTemplates') }}\n\t\t\t\t\t\t</n8n-text>\n\t\t\t\t\t</n8n-card>\n\t\t\t\t</a>\n\t\t\t\t<n8n-card\n\t\t\t\t\t:class=\"$style.emptyStateCard\"\n\t\t\t\t\thoverable\n\t\t\t\t\tdata-test-id=\"new-workflow-card\"\n\t\t\t\t\t@click=\"addWorkflow\"\n\t\t\t\t>\n\t\t\t\t\t<n8n-icon :class=\"$style.emptyStateCardIcon\" icon=\"file\" />\n\t\t\t\t\t<n8n-text size=\"large\" class=\"mt-xs\" color=\"text-base\">\n\t\t\t\t\t\t{{ $locale.baseText('workflows.empty.startFromScratch') }}\n\t\t\t\t\t</n8n-text>\n\t\t\t\t</n8n-card>\n\t\t\t</div>\n\t\t</template>\n\t\t<template #filters=\"{ setKeyValue }\">\n\t\t\t<div v-if=\"settingsStore.areTagsEnabled\" class=\"mb-s\">\n\t\t\t\t<n8n-input-label\n\t\t\t\t\t:label=\"$locale.baseText('workflows.filters.tags')\"\n\t\t\t\t\t:bold=\"false\"\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\tcolor=\"text-base\"\n\t\t\t\t\tclass=\"mb-3xs\"\n\t\t\t\t/>\n\t\t\t\t<TagsDropdown\n\t\t\t\t\t:placeholder=\"$locale.baseText('workflowOpen.filterWorkflows')\"\n\t\t\t\t\t:model-value=\"filters.tags\"\n\t\t\t\t\t:create-enabled=\"false\"\n\t\t\t\t\t@update:model-value=\"setKeyValue('tags', $event)\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div class=\"mb-s\">\n\t\t\t\t<n8n-input-label\n\t\t\t\t\t:label=\"$locale.baseText('workflows.filters.status')\"\n\t\t\t\t\t:bold=\"false\"\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\tcolor=\"text-base\"\n\t\t\t\t\tclass=\"mb-3xs\"\n\t\t\t\t/>\n\t\t\t\t<n8n-select\n\t\t\t\t\tdata-test-id=\"status-dropdown\"\n\t\t\t\t\t:model-value=\"filters.status\"\n\t\t\t\t\t@update:model-value=\"setKeyValue('status', $event)\"\n\t\t\t\t>\n\t\t\t\t\t<n8n-option\n\t\t\t\t\t\tv-for=\"option in statusFilterOptions\"\n\t\t\t\t\t\t:key=\"option.label\"\n\t\t\t\t\t\t:label=\"option.label\"\n\t\t\t\t\t\t:value=\"option.value\"\n\t\t\t\t\t\tdata-test-id=\"status\"\n\t\t\t\t\t>\n\t\t\t\t\t</n8n-option>\n\t\t\t\t</n8n-select>\n\t\t\t</div>\n\t\t</template>\n\t</ResourcesListLayout>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent } from 'vue';\nimport ResourcesListLayout from '@/components/layouts/ResourcesListLayout.vue';\nimport WorkflowCard from '@/components/WorkflowCard.vue';\nimport { EnterpriseEditionFeature, VIEWS } from '@/constants';\nimport type { ITag, IUser, IWorkflowDb } from '@/Interface';\nimport TagsDropdown from '@/components/TagsDropdown.vue';\nimport { mapStores } from 'pinia';\nimport { useUIStore } from '@/stores/ui.store';\nimport { useSettingsStore } from '@/stores/settings.store';\nimport { useUsersStore } from '@/stores/users.store';\nimport { useWorkflowsStore } from '@/stores/workflows.store';\nimport { useSourceControlStore } from '@/stores/sourceControl.store';\nimport { useTagsStore } from '@/stores/tags.store';\nimport { useProjectsStore } from '@/stores/projects.store';\nimport ProjectTabs from '@/components/Projects/ProjectTabs.vue';\nimport { useTemplatesStore } from '@/stores/templates.store';\n\ntype IResourcesListLayoutInstance = InstanceType<typeof ResourcesListLayout>;\n\ninterface Filters {\n\tsearch: string;\n\thomeProject: string;\n\tstatus: string | boolean;\n\ttags: string[];\n}\n\nconst StatusFilter = {\n\tACTIVE: true,\n\tDEACTIVATED: false,\n\tALL: '',\n};\n\nconst WorkflowsView = defineComponent({\n\tname: 'WorkflowsView',\n\tcomponents: {\n\t\tResourcesListLayout,\n\t\tWorkflowCard,\n\t\tTagsDropdown,\n\t\tProjectTabs,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tfilters: {\n\t\t\t\tsearch: '',\n\t\t\t\thomeProject: '',\n\t\t\t\tstatus: StatusFilter.ALL,\n\t\t\t\ttags: [],\n\t\t\t} as Filters,\n\t\t\tsourceControlStoreUnsubscribe: () => {},\n\t\t};\n\t},\n\tcomputed: {\n\t\t...mapStores(\n\t\t\tuseSettingsStore,\n\t\t\tuseUIStore,\n\t\t\tuseUsersStore,\n\t\t\tuseWorkflowsStore,\n\t\t\tuseSourceControlStore,\n\t\t\tuseTagsStore,\n\t\t\tuseProjectsStore,\n\t\t\tuseTemplatesStore,\n\t\t),\n\t\treadOnlyEnv(): boolean {\n\t\t\treturn this.sourceControlStore.preferences.branchReadOnly;\n\t\t},\n\t\tcurrentUser(): IUser {\n\t\t\treturn this.usersStore.currentUser || ({} as IUser);\n\t\t},\n\t\tallWorkflows(): IWorkflowDb[] {\n\t\t\treturn this.workflowsStore.allWorkflows;\n\t\t},\n\t\tisShareable(): boolean {\n\t\t\treturn this.settingsStore.isEnterpriseFeatureEnabled(EnterpriseEditionFeature.Sharing);\n\t\t},\n\t\tstatusFilterOptions(): Array<{ label: string; value: string | boolean }> {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tlabel: this.$locale.baseText('workflows.filters.status.all'),\n\t\t\t\t\tvalue: StatusFilter.ALL,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: this.$locale.baseText('workflows.filters.status.active'),\n\t\t\t\t\tvalue: StatusFilter.ACTIVE,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: this.$locale.baseText('workflows.filters.status.deactivated'),\n\t\t\t\t\tvalue: StatusFilter.DEACTIVATED,\n\t\t\t\t},\n\t\t\t];\n\t\t},\n\t\tuserRole() {\n\t\t\tconst role = this.usersStore.currentUserCloudInfo?.role;\n\n\t\t\tif (role) {\n\t\t\t\treturn role;\n\t\t\t}\n\n\t\t\tconst answers = this.usersStore.currentUser?.personalizationAnswers;\n\t\t\tif (answers && 'role' in answers) {\n\t\t\t\treturn answers.role;\n\t\t\t}\n\n\t\t\treturn undefined;\n\t\t},\n\t\tisSalesUser() {\n\t\t\tif (!this.userRole) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn ['Sales', 'sales-and-marketing'].includes(this.userRole);\n\t\t},\n\t\tshowProjectTabs() {\n\t\t\treturn (\n\t\t\t\t!!this.$route.params.projectId ||\n\t\t\t\t!!this.allWorkflows.length ||\n\t\t\t\tthis.projectsStore.myProjects.length > 1\n\t\t\t);\n\t\t},\n\t\taddWorkflowButtonText() {\n\t\t\treturn this.projectsStore.currentProject\n\t\t\t\t? this.$locale.baseText('workflows.project.add')\n\t\t\t\t: this.$locale.baseText('workflows.add');\n\t\t},\n\t},\n\twatch: {\n\t\tfilters: {\n\t\t\tdeep: true,\n\t\t\thandler() {\n\t\t\t\tthis.saveFiltersOnQueryString();\n\t\t\t},\n\t\t},\n\t\t'filters.tags'() {\n\t\t\tthis.sendFiltersTelemetry('tags');\n\t\t},\n\t\t'$route.params.projectId'() {\n\t\t\tvoid this.initialize();\n\t\t},\n\t},\n\tasync mounted() {\n\t\tawait this.setFiltersFromQueryString();\n\n\t\tvoid this.usersStore.showPersonalizationSurvey();\n\n\t\tthis.sourceControlStoreUnsubscribe = this.sourceControlStore.$onAction(({ name, after }) => {\n\t\t\tif (name === 'pullWorkfolder' && after) {\n\t\t\t\tafter(() => {\n\t\t\t\t\tvoid this.initialize();\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t},\n\tbeforeUnmount() {\n\t\tthis.sourceControlStoreUnsubscribe();\n\t},\n\tmethods: {\n\t\tonFiltersUpdated(filters: Filters) {\n\t\t\tthis.filters = filters;\n\t\t},\n\t\taddWorkflow() {\n\t\t\tthis.uiStore.nodeViewInitialized = false;\n\t\t\tvoid this.$router.push({\n\t\t\t\tname: VIEWS.NEW_WORKFLOW,\n\t\t\t\tquery: { projectId: this.$route?.params?.projectId },\n\t\t\t});\n\n\t\t\tthis.$telemetry.track('User clicked add workflow button', {\n\t\t\t\tsource: 'Workflows list',\n\t\t\t});\n\t\t},\n\t\tgetTemplateRepositoryURL() {\n\t\t\treturn this.templatesStore.websiteTemplateRepositoryURL;\n\t\t},\n\t\ttrackCategoryLinkClick(category: string) {\n\t\t\tthis.$telemetry.track(`User clicked Browse ${category} Templates`, {\n\t\t\t\trole: this.usersStore.currentUserCloudInfo?.role,\n\t\t\t\tactive_workflow_count: this.workflowsStore.activeWorkflows.length,\n\t\t\t});\n\t\t},\n\t\tasync initialize() {\n\t\t\tawait Promise.all([\n\t\t\t\tthis.usersStore.fetchUsers(),\n\t\t\t\tthis.workflowsStore.fetchAllWorkflows(this.$route?.params?.projectId as string | undefined),\n\t\t\t\tthis.workflowsStore.fetchActiveWorkflows(),\n\t\t\t]);\n\t\t},\n\t\tonClickTag(tagId: string) {\n\t\t\tif (!this.filters.tags.includes(tagId)) {\n\t\t\t\tthis.filters.tags.push(tagId);\n\t\t\t}\n\t\t},\n\t\tonFilter(\n\t\t\tresource: IWorkflowDb,\n\t\t\tfilters: { tags: string[]; search: string; status: string | boolean },\n\t\t\tmatches: boolean,\n\t\t): boolean {\n\t\t\tif (this.settingsStore.areTagsEnabled && filters.tags.length > 0) {\n\t\t\t\tmatches =\n\t\t\t\t\tmatches &&\n\t\t\t\t\tfilters.tags.every((tag) =>\n\t\t\t\t\t\t(resource.tags as ITag[])?.find((resourceTag) =>\n\t\t\t\t\t\t\ttypeof resourceTag === 'object'\n\t\t\t\t\t\t\t\t? `${resourceTag.id}` === `${tag}`\n\t\t\t\t\t\t\t\t: `${resourceTag}` === `${tag}`,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (filters.status !== '') {\n\t\t\t\tmatches = matches && resource.active === filters.status;\n\t\t\t}\n\n\t\t\treturn matches;\n\t\t},\n\t\tsendFiltersTelemetry(source: string) {\n\t\t\t(this.$refs.layout as IResourcesListLayoutInstance).sendFiltersTelemetry(source);\n\t\t},\n\t\tsaveFiltersOnQueryString() {\n\t\t\tconst query: { [key: string]: string } = {};\n\n\t\t\tif (this.filters.search) {\n\t\t\t\tquery.search = this.filters.search;\n\t\t\t}\n\n\t\t\tif (typeof this.filters.status !== 'string') {\n\t\t\t\tquery.status = this.filters.status.toString();\n\t\t\t}\n\n\t\t\tif (this.filters.tags.length) {\n\t\t\t\tquery.tags = this.filters.tags.join(',');\n\t\t\t}\n\n\t\t\tif (this.filters.homeProject) {\n\t\t\t\tquery.homeProject = this.filters.homeProject;\n\t\t\t}\n\n\t\t\tvoid this.$router.replace({\n\t\t\t\tquery: Object.keys(query).length ? query : undefined,\n\t\t\t});\n\t\t},\n\t\tisValidProjectId(projectId: string) {\n\t\t\treturn this.projectsStore.projects.some((project) => project.id === projectId);\n\t\t},\n\t\tasync setFiltersFromQueryString() {\n\t\t\tconst { tags, status, search, homeProject } = this.$route.query;\n\n\t\t\tconst filtersToApply: { [key: string]: string | string[] | boolean } = {};\n\n\t\t\tif (homeProject && typeof homeProject === 'string') {\n\t\t\t\tawait this.projectsStore.getAllProjects();\n\t\t\t\tif (this.isValidProjectId(homeProject)) {\n\t\t\t\t\tfiltersToApply.homeProject = homeProject;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (search && typeof search === 'string') {\n\t\t\t\tfiltersToApply.search = search;\n\t\t\t}\n\n\t\t\tif (tags && typeof tags === 'string') {\n\t\t\t\tconst currentTags = this.tagsStore.allTags.map((tag) => tag.id);\n\t\t\t\tconst savedTags = tags.split(',').filter((tag) => currentTags.includes(tag));\n\t\t\t\tif (savedTags.length) {\n\t\t\t\t\tfiltersToApply.tags = savedTags;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tstatus &&\n\t\t\t\ttypeof status === 'string' &&\n\t\t\t\t[StatusFilter.ACTIVE.toString(), StatusFilter.DEACTIVATED.toString()].includes(status)\n\t\t\t) {\n\t\t\t\tfiltersToApply.status = status === 'true';\n\t\t\t}\n\n\t\t\tif (Object.keys(filtersToApply).length) {\n\t\t\t\tthis.filters = {\n\t\t\t\t\t...this.filters,\n\t\t\t\t\t...filtersToApply,\n\t\t\t\t};\n\t\t\t}\n\t\t},\n\t},\n});\n\nexport default WorkflowsView;\n</script>\n\n<style lang=\"scss\" module>\n.actionsContainer {\n\tdisplay: flex;\n\tjustify-content: center;\n}\n\n.emptyStateCard {\n\twidth: 192px;\n\ttext-align: center;\n\tdisplay: inline-flex;\n\theight: 230px;\n\n\t& + & {\n\t\tmargin-left: var(--spacing-s);\n\t}\n\n\t&:hover {\n\t\tsvg {\n\t\t\tcolor: var(--color-primary);\n\t\t}\n\t}\n}\n\n.emptyStateCardIcon {\n\tfont-size: 48px;\n\n\tsvg {\n\t\twidth: 48px !important;\n\t\tcolor: var(--color-foreground-dark);\n\t\ttransition: color 0.3s ease;\n\t}\n}\n</style>\n"],"names":["WORKFLOW_LIST_ITEM_ACTIONS","props","__props","emit","__emit","toast","useToast","message","useMessage","locale","useI18n","router","useRouter","telemetry","useTelemetry","settingsStore","useSettingsStore","uiStore","useUIStore","usersStore","useUsersStore","workflowsStore","useWorkflowsStore","projectsStore","useProjectsStore","currentUser","computed","workflowPermissions","getWorkflowPermissions","actions","items","formattedCreatedAtDate","currentYear","dateformat","onClick","event","route","VIEWS","onClickTag","tagId","onExpandTags","onAction","action","DUPLICATE_MODAL_KEY","tag","WORKFLOW_SHARE_MODAL_KEY","deleteWorkflow","moveResource","MODAL_CONFIRM","error","PROJECT_MOVE_RESOURCE_MODAL","StatusFilter","WorkflowsView","defineComponent","ResourcesListLayout","WorkflowCard","TagsDropdown","ProjectTabs","mapStores","useSourceControlStore","useTagsStore","useTemplatesStore","EnterpriseEditionFeature","role","_a","answers","_b","name","after","filters","category","resource","matches","resourceTag","source","query","projectId","project","tags","status","search","homeProject","filtersToApply","currentTags","savedTags","_sfc_main","_hoisted_1","_hoisted_3","_hoisted_4","_component_ResourcesListLayout","_resolveComponent","_openBlock","_createBlock","_ctx","initialize","readOnlyEnv","addWorkflow","_withCtx","_component_ProjectTabs","_createCommentVNode","disabled","_createVNode","_component_n8n_tooltip","_component_i18n_t","_createElementVNode","_toDisplayString","_component_n8n_button","_createTextVNode","data","updateItemSize","_component_WorkflowCard","_hoisted_2","_component_n8n_heading","$locale","_component_n8n_text","_createElementBlock","isSalesUser","_normalizeClass","_component_n8n_card","_cache","$event","_component_n8n_icon","$style","setKeyValue","_component_n8n_input_label","_component_TagsDropdown","_hoisted_5","_component_n8n_select","_Fragment","_renderList","option","_component_n8n_option"],"mappings":"+5DA2BA,MAAMA,EAA6B,CAClC,KAAM,OACN,MAAO,QACP,UAAW,YACX,OAAQ,SACR,KAAM,MAAA,EAGDC,EAAQC,EAsBRC,EAAOC,EAKPC,EAAQC,KACRC,EAAUC,KACVC,EAASC,KACTC,EAASC,KACTC,EAAYC,KAEZC,EAAgBC,IAChBC,EAAUC,IACVC,EAAaC,IACbC,EAAiBC,IACjBC,EAAgBC,IAEhBC,EAAcC,EAAS,IAAMP,EAAW,aAAgB,CAAY,CAAA,EACpEQ,EAAsBD,EAAS,IAAME,GAAuB3B,EAAM,IAAI,CAAC,EACvE4B,EAAUH,EAAS,IAAM,CAC9B,MAAMI,EAAQ,CACb,CACC,MAAOrB,EAAO,SAAS,qBAAqB,EAC5C,MAAOT,EAA2B,IACnC,EACA,CACC,MAAOS,EAAO,SAAS,sBAAsB,EAC7C,MAAOT,EAA2B,KACnC,CAAA,EAGG,OAACC,EAAM,UACV6B,EAAM,KAAK,CACV,MAAOrB,EAAO,SAAS,0BAA0B,EACjD,MAAOT,EAA2B,SAAA,CAClC,EAGE2B,EAAoB,MAAM,MAC7BG,EAAM,KAAK,CACV,MAAOrB,EAAO,SAAS,qBAAqB,EAC5C,MAAOT,EAA2B,IAAA,CAClC,EAGE2B,EAAoB,MAAM,QAAU,CAAC1B,EAAM,UAC9C6B,EAAM,KAAK,CACV,MAAOrB,EAAO,SAAS,uBAAuB,EAC9C,MAAOT,E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N,MAAA,QAAA,EACE,QAAW,OAAEoB,CAAAA,EAAAA,EACbY,EAAyB,CACzB,cAAgB,QAAK,SAAA,8BAAA,EACrB,cAAkBhC,EAAA,QAAA,KAAA,iBAAA,uCApHxB,EAAA,KAAA,EAAA,CAAA,cAAA,cAAA,qBAAA,CAAA,CAAA,IAwHIM,EAME,GAAA,EAAA,EAAAK,EALOS,MAAQa,GAAQ,CACZzB,EAAAuB,EAAA,CACZ,MAAK/B,EAAO,QAAA,SAAA,0BAAA,EACZ,KAAK,GACL,KAAK,QAAA,MAAA,YAEN,MAAA,QAAA,EACC,KAAa,EAAA,CAAA,OAAA,CAAA,EAAAQ,EACZ0B,EAA2B,CAC3B,eAAA,kBAAA,cAAAlC,EAAA,QAAA,OAlIN,sBAqI2C2B,GAAAG,EAAA,SAAAH,CAAA,CAAA,EAAA,iBAC/B7B,EAAA,EAAO,EAAKwB,EAAAa,GAAA,KAAAC,GAAApC,EAAA,oBAAAqC,IACZvC,EAAA,EAAcC,EAAAuC,EAAA,CACnB,IAAKD,EAAE,MACR,MAAYA,EAAA,MAAA,MAAAA,EAAA,yDAzIlB,EAAA,GAAA,EAAA,CAAA,kDAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"WorkflowsView-rbygROmM.js","sources":["../../src/components/WorkflowCard.vue","../../src/views/WorkflowsView.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport type { IWorkflowDb, IUser } from '@/Interface';\nimport {\n\tDUPLICATE_MODAL_KEY,\n\tMODAL_CONFIRM,\n\tPROJECT_MOVE_RESOURCE_MODAL,\n\tVIEWS,\n\tWORKFLOW_SHARE_MODAL_KEY,\n} from '@/constants';\nimport { useMessage } from '@/composables/useMessage';\nimport { useToast } from '@/composables/useToast';\nimport { getWorkflowPermissions } from '@/permissions';\nimport dateformat from 'dateformat';\nimport WorkflowActivator from '@/components/WorkflowActivator.vue';\nimport { useUIStore } from '@/stores/ui.store';\nimport { useSettingsStore } from '@/stores/settings.store';\nimport { useUsersStore } from '@/stores/users.store';\nimport { useWorkflowsStore } from '@/stores/workflows.store';\nimport TimeAgo from '@/components/TimeAgo.vue';\nimport type { ProjectSharingData } from '@/types/projects.types';\nimport { useProjectsStore } from '@/stores/projects.store';\nimport ProjectCardBadge from '@/components/Projects/ProjectCardBadge.vue';\nimport { useI18n } from '@/composables/useI18n';\nimport { useRouter } from 'vue-router';\nimport { useTelemetry } from '@/composables/useTelemetry';\n\nconst WORKFLOW_LIST_ITEM_ACTIONS = {\n\tOPEN: 'open',\n\tSHARE: 'share',\n\tDUPLICATE: 'duplicate',\n\tDELETE: 'delete',\n\tMOVE: 'move',\n};\n\nconst props = withDefaults(\n\tdefineProps<{\n\t\tdata: IWorkflowDb;\n\t\treadOnly?: boolean;\n\t}>(),\n\t{\n\t\tdata: () => ({\n\t\t\tid: '',\n\t\t\tcreatedAt: '',\n\t\t\tupdatedAt: '',\n\t\t\tactive: false,\n\t\t\tconnections: {},\n\t\t\tnodes: [],\n\t\t\tname: '',\n\t\t\tsharedWithProjects: [],\n\t\t\thomeProject: {} as ProjectSharingData,\n\t\t\tversionId: '',\n\t\t}),\n\t\treadOnly: false,\n\t},\n);\n\nconst emit = defineEmits<{\n\t(event: 'expand:tags'): void;\n\t(event: 'click:tag', tagId: string, e: PointerEvent): void;\n}>();\n\nconst toast = useToast();\nconst message = useMessage();\nconst locale = useI18n();\nconst router = useRouter();\nconst telemetry = useTelemetry();\n\nconst settingsStore = useSettingsStore();\nconst uiStore = useUIStore();\nconst usersStore = useUsersStore();\nconst workflowsStore = useWorkflowsStore();\nconst projectsStore = useProjectsStore();\n\nconst currentUser = computed(() => usersStore.currentUser ?? ({} as IUser));\nconst workflowPermissions = computed(() => getWorkflowPermissions(props.data));\nconst actions = computed(() => {\n\tconst items = [\n\t\t{\n\t\t\tlabel: locale.baseText('workflows.item.open'),\n\t\t\tvalue: WORKFLOW_LIST_ITEM_ACTIONS.OPEN,\n\t\t},\n\t\t{\n\t\t\tlabel: locale.baseText('workflows.item.share'),\n\t\t\tvalue: WORKFLOW_LIST_ITEM_ACTIONS.SHARE,\n\t\t},\n\t];\n\n\tif (!props.readOnly) {\n\t\titems.push({\n\t\t\tlabel: locale.baseText('workflows.item.duplicate'),\n\t\t\tvalue: WORKFLOW_LIST_ITEM_ACTIONS.DUPLICATE,\n\t\t});\n\t}\n\n\tif (workflowPermissions.value.move) {\n\t\titems.push({\n\t\t\tlabel: locale.baseText('workflows.item.move'),\n\t\t\tvalue: WORKFLOW_LIST_ITEM_ACTIONS.MOVE,\n\t\t});\n\t}\n\n\tif (workflowPermissions.value.delete && !props.readOnly) {\n\t\titems.push({\n\t\t\tlabel: locale.baseText('workflows.item.delete'),\n\t\t\tvalue: WORKFLOW_LIST_ITEM_ACTIONS.DELETE,\n\t\t});\n\t}\n\n\treturn items;\n});\nconst formattedCreatedAtDate = computed(() => {\n\tconst currentYear = new Date().getFullYear().toString();\n\n\treturn dateformat(\n\t\tprops.data.createdAt,\n\t\t`d mmmm${String(props.data.createdAt).startsWith(currentYear) ? '' : ', yyyy'}`,\n\t);\n});\n\nasync function onClick(event?: KeyboardEvent | PointerEvent) {\n\tif (event?.ctrlKey || event?.metaKey) {\n\t\tconst route = router.resolve({\n\t\t\tname: VIEWS.WORKFLOW,\n\t\t\tparams: { name: props.data.id },\n\t\t});\n\t\twindow.open(route.href, '_blank');\n\n\t\treturn;\n\t}\n\n\tawait router.push({\n\t\tname: VIEWS.WORKFLOW,\n\t\tparams: { name: props.data.id },\n\t});\n}\n\nfunction onClickTag(tagId: string, event: PointerEvent) {\n\tevent.stopPropagation();\n\temit('click:tag', tagId, event);\n}\n\nfunction onExpandTags() {\n\temit('expand:tags');\n}\n\nasync function onAction(action: string) {\n\tswitch (action) {\n\t\tcase WORKFLOW_LIST_ITEM_ACTIONS.OPEN:\n\t\t\tawait onClick();\n\t\t\tbreak;\n\t\tcase WORKFLOW_LIST_ITEM_ACTIONS.DUPLICATE:\n\t\t\tuiStore.openModalWithData({\n\t\t\t\tname: DUPLICATE_MODAL_KEY,\n\t\t\t\tdata: {\n\t\t\t\t\tid: props.data.id,\n\t\t\t\t\tname: props.data.name,\n\t\t\t\t\ttags: (props.data.tags ?? []).map((tag) =>\n\t\t\t\t\t\ttypeof tag !== 'string' && 'id' in tag ? tag.id : tag,\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t});\n\t\t\tbreak;\n\t\tcase WORKFLOW_LIST_ITEM_ACTIONS.SHARE:\n\t\t\tuiStore.openModalWithData({\n\t\t\t\tname: WORKFLOW_SHARE_MODAL_KEY,\n\t\t\t\tdata: { id: props.data.id },\n\t\t\t});\n\n\t\t\ttelemetry.track('User opened sharing modal', {\n\t\t\t\tworkflow_id: props.data.id,\n\t\t\t\tuser_id_sharer: currentUser.value.id,\n\t\t\t\tsub_view: 'Workflows listing',\n\t\t\t});\n\t\t\tbreak;\n\t\tcase WORKFLOW_LIST_ITEM_ACTIONS.DELETE:\n\t\t\tawait deleteWorkflow();\n\t\t\tbreak;\n\t\tcase WORKFLOW_LIST_ITEM_ACTIONS.MOVE:\n\t\t\tmoveResource();\n\t\t\tbreak;\n\t}\n}\n\nasync function deleteWorkflow() {\n\tconst deleteConfirmed = await message.confirm(\n\t\tlocale.baseText('mainSidebar.confirmMessage.workflowDelete.message', {\n\t\t\tinterpolate: { workflowName: props.data.name },\n\t\t}),\n\t\tlocale.baseText('mainSidebar.confirmMessage.workflowDelete.headline'),\n\t\t{\n\t\t\ttype: 'warning',\n\t\t\tconfirmButtonText: locale.baseText(\n\t\t\t\t'mainSidebar.confirmMessage.workflowDelete.confirmButtonText',\n\t\t\t),\n\t\t\tcancelButtonText: locale.baseText(\n\t\t\t\t'mainSidebar.confirmMessage.workflowDelete.cancelButtonText',\n\t\t\t),\n\t\t},\n\t);\n\n\tif (deleteConfirmed !== MODAL_CONFIRM) {\n\t\treturn;\n\t}\n\n\ttry {\n\t\tawait workflowsStore.deleteWorkflow(props.data.id);\n\t} catch (error) {\n\t\ttoast.showError(error, locale.baseText('generic.deleteWorkflowError'));\n\t\treturn;\n\t}\n\n\t// Reset tab title since workflow is deleted.\n\ttoast.showMessage({\n\t\ttitle: locale.baseText('mainSidebar.showMessage.handleSelect1.title'),\n\t\ttype: 'success',\n\t});\n}\n\nfunction moveResource() {\n\tuiStore.openModalWithData({\n\t\tname: PROJECT_MOVE_RESOURCE_MODAL,\n\t\tdata: {\n\t\t\tresource: props.data,\n\t\t\tresourceType: locale.baseText('generic.workflow').toLocaleLowerCase(),\n\t\t},\n\t});\n}\n</script>\n\n<template>\n\t<n8n-card :class=\"$style.cardLink\" @click=\"onClick\">\n\t\t<template #header>\n\t\t\t<n8n-heading tag=\"h2\" bold :class=\"$style.cardHeading\" data-test-id=\"workflow-card-name\">\n\t\t\t\t{{ data.name }}\n\t\t\t</n8n-heading>\n\t\t</template>\n\t\t<div :class=\"$style.cardDescription\">\n\t\t\t<n8n-text color=\"text-light\" size=\"small\">\n\t\t\t\t<span v-show=\"data\"\n\t\t\t\t\t>{{ $locale.baseText('workflows.item.updated') }}\n\t\t\t\t\t<TimeAgo :date=\"String(data.updatedAt)\" /> |\n\t\t\t\t</span>\n\t\t\t\t<span v-show=\"data\" class=\"mr-2xs\"\n\t\t\t\t\t>{{ $locale.baseText('workflows.item.created') }} {{ formattedCreatedAtDate }}\n\t\t\t\t</span>\n\t\t\t\t<span\n\t\t\t\t\tv-if=\"settingsStore.areTagsEnabled && data.tags && data.tags.length > 0\"\n\t\t\t\t\tv-show=\"data\"\n\t\t\t\t>\n\t\t\t\t\t<n8n-tags\n\t\t\t\t\t\t:tags=\"data.tags\"\n\t\t\t\t\t\t:truncate-at=\"3\"\n\t\t\t\t\t\ttruncate\n\t\t\t\t\t\tdata-test-id=\"workflow-card-tags\"\n\t\t\t\t\t\t@click:tag=\"onClickTag\"\n\t\t\t\t\t\t@expand=\"onExpandTags\"\n\t\t\t\t\t/>\n\t\t\t\t</span>\n\t\t\t</n8n-text>\n\t\t</div>\n\t\t<template #append>\n\t\t\t<div :class=\"$style.cardActions\" @click.stop>\n\t\t\t\t<ProjectCardBadge :resource=\"data\" :personal-project=\"projectsStore.personalProject\" />\n\t\t\t\t<WorkflowActivator\n\t\t\t\t\tclass=\"mr-s\"\n\t\t\t\t\t:workflow-active=\"data.active\"\n\t\t\t\t\t:workflow-id=\"data.id\"\n\t\t\t\t\tdata-test-id=\"workflow-card-activator\"\n\t\t\t\t/>\n\n\t\t\t\t<n8n-action-toggle\n\t\t\t\t\t:actions=\"actions\"\n\t\t\t\t\ttheme=\"dark\"\n\t\t\t\t\tdata-test-id=\"workflow-card-actions\"\n\t\t\t\t\t@action=\"onAction\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</template>\n\t</n8n-card>\n</template>\n\n<style lang=\"scss\" module>\n.cardLink {\n\ttransition: box-shadow 0.3s ease;\n\tcursor: pointer;\n\tpadding: 0;\n\talign-items: stretch;\n\n\t&:hover {\n\t\tbox-shadow: 0 2px 8px rgba(#441c17, 0.1);\n\t}\n}\n\n.cardHeading {\n\tfont-size: var(--font-size-s);\n\tword-break: break-word;\n\tpadding: var(--spacing-s) 0 0 var(--spacing-s);\n\n\tspan {\n\t\tcolor: var(--color-text-light);\n\t}\n}\n\n.cardDescription {\n\tmin-height: 19px;\n\tdisplay: flex;\n\talign-items: center;\n\tpadding: 0 0 var(--spacing-s) var(--spacing-s);\n}\n\n.cardActions {\n\tdisplay: flex;\n\tflex-direction: row;\n\tjustify-content: center;\n\talign-items: center;\n\talign-self: stretch;\n\tpadding: 0 var(--spacing-s) 0 0;\n\tcursor: default;\n}\n</style>\n","<template>\n\t<ResourcesListLayout\n\t\tref=\"layout\"\n\t\tresource-key=\"workflows\"\n\t\t:resources=\"allWorkflows\"\n\t\t:filters=\"filters\"\n\t\t:additional-filters-handler=\"onFilter\"\n\t\t:type-props=\"{ itemSize: 80 }\"\n\t\t:shareable=\"isShareable\"\n\t\t:initialize=\"initialize\"\n\t\t:disabled=\"readOnlyEnv\"\n\t\t@click:add=\"addWorkflow\"\n\t\t@update:filters=\"onFiltersUpdated\"\n\t>\n\t\t<template #header>\n\t\t\t<ProjectTabs v-if=\"showProjectTabs\" />\n\t\t</template>\n\t\t<template #add-button=\"{ disabled }\">\n\t\t\t<n8n-tooltip :disabled=\"!readOnlyEnv\">\n\t\t\t\t<div>\n\t\t\t\t\t<n8n-button\n\t\t\t\t\t\tsize=\"large\"\n\t\t\t\t\t\tblock\n\t\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t\tdata-test-id=\"resources-list-add\"\n\t\t\t\t\t\t@click=\"addWorkflow\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{{ addWorkflowButtonText }}\n\t\t\t\t\t</n8n-button>\n\t\t\t\t</div>\n\t\t\t\t<template #content>\n\t\t\t\t\t<i18n-t tag=\"span\" keypath=\"mainSidebar.workflows.readOnlyEnv.tooltip\">\n\t\t\t\t\t\t<template #link>\n\t\t\t\t\t\t\t<a target=\"_blank\" href=\"https://docs.n8n.io/source-control-environments/\">\n\t\t\t\t\t\t\t\t{{ $locale.baseText('mainSidebar.workflows.readOnlyEnv.tooltip.link') }}\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</i18n-t>\n\t\t\t\t</template>\n\t\t\t</n8n-tooltip>\n\t\t</template>\n\t\t<template #default=\"{ data, updateItemSize }\">\n\t\t\t<WorkflowCard\n\t\t\t\tdata-test-id=\"resources-list-item\"\n\t\t\t\tclass=\"mb-2xs\"\n\t\t\t\t:data=\"data\"\n\t\t\t\t:read-only=\"readOnlyEnv\"\n\t\t\t\t@expand:tags=\"updateItemSize(data)\"\n\t\t\t\t@click:tag=\"onClickTag\"\n\t\t\t/>\n\t\t</template>\n\t\t<template #empty>\n\t\t\t<div class=\"text-center mt-s\">\n\t\t\t\t<n8n-heading tag=\"h2\" size=\"xlarge\" class=\"mb-2xs\">\n\t\t\t\t\t{{\n\t\t\t\t\t\tcurrentUser.firstName\n\t\t\t\t\t\t\t? $locale.baseText('workflows.empty.heading', {\n\t\t\t\t\t\t\t\t\tinterpolate: { name: currentUser.firstName },\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t: $locale.baseText('workflows.empty.heading.userNotSetup')\n\t\t\t\t\t}}\n\t\t\t\t</n8n-heading>\n\t\t\t\t<n8n-text size=\"large\" color=\"text-base\">\n\t\t\t\t\t{{\n\t\t\t\t\t\t$locale.baseText(\n\t\t\t\t\t\t\treadOnlyEnv\n\t\t\t\t\t\t\t\t? 'workflows.empty.description.readOnlyEnv'\n\t\t\t\t\t\t\t\t: 'workflows.empty.description',\n\t\t\t\t\t\t)\n\t\t\t\t\t}}\n\t\t\t\t</n8n-text>\n\t\t\t</div>\n\t\t\t<div v-if=\"!readOnlyEnv\" :class=\"['text-center', 'mt-2xl', $style.actionsContainer]\">\n\t\t\t\t<a\n\t\t\t\t\tv-if=\"isSalesUser\"\n\t\t\t\t\t:href=\"getTemplateRepositoryURL()\"\n\t\t\t\t\t:class=\"$style.emptyStateCard\"\n\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t>\n\t\t\t\t\t<n8n-card\n\t\t\t\t\t\thoverable\n\t\t\t\t\t\tdata-test-id=\"browse-sales-templates-card\"\n\t\t\t\t\t\t@click=\"trackCategoryLinkClick('Sales')\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<n8n-icon :class=\"$style.emptyStateCardIcon\" icon=\"box-open\" />\n\t\t\t\t\t\t<n8n-text size=\"large\" class=\"mt-xs\" color=\"text-base\">\n\t\t\t\t\t\t\t{{ $locale.baseText('workflows.empty.browseTemplates') }}\n\t\t\t\t\t\t</n8n-text>\n\t\t\t\t\t</n8n-card>\n\t\t\t\t</a>\n\t\t\t\t<n8n-card\n\t\t\t\t\t:class=\"$style.emptyStateCard\"\n\t\t\t\t\thoverable\n\t\t\t\t\tdata-test-id=\"new-workflow-card\"\n\t\t\t\t\t@click=\"addWorkflow\"\n\t\t\t\t>\n\t\t\t\t\t<n8n-icon :class=\"$style.emptyStateCardIcon\" icon=\"file\" />\n\t\t\t\t\t<n8n-text size=\"large\" class=\"mt-xs\" color=\"text-base\">\n\t\t\t\t\t\t{{ $locale.baseText('workflows.empty.startFromScratch') }}\n\t\t\t\t\t</n8n-text>\n\t\t\t\t</n8n-card>\n\t\t\t</div>\n\t\t</template>\n\t\t<template #filters=\"{ setKeyValue }\">\n\t\t\t<div v-if=\"settingsStore.areTagsEnabled\" class=\"mb-s\">\n\t\t\t\t<n8n-input-label\n\t\t\t\t\t:label=\"$locale.baseText('workflows.filters.tags')\"\n\t\t\t\t\t:bold=\"false\"\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\tcolor=\"text-base\"\n\t\t\t\t\tclass=\"mb-3xs\"\n\t\t\t\t/>\n\t\t\t\t<TagsDropdown\n\t\t\t\t\t:placeholder=\"$locale.baseText('workflowOpen.filterWorkflows')\"\n\t\t\t\t\t:model-value=\"filters.tags\"\n\t\t\t\t\t:create-enabled=\"false\"\n\t\t\t\t\t@update:model-value=\"setKeyValue('tags', $event)\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div class=\"mb-s\">\n\t\t\t\t<n8n-input-label\n\t\t\t\t\t:label=\"$locale.baseText('workflows.filters.status')\"\n\t\t\t\t\t:bold=\"false\"\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\tcolor=\"text-base\"\n\t\t\t\t\tclass=\"mb-3xs\"\n\t\t\t\t/>\n\t\t\t\t<n8n-select\n\t\t\t\t\tdata-test-id=\"status-dropdown\"\n\t\t\t\t\t:model-value=\"filters.status\"\n\t\t\t\t\t@update:model-value=\"setKeyValue('status', $event)\"\n\t\t\t\t>\n\t\t\t\t\t<n8n-option\n\t\t\t\t\t\tv-for=\"option in statusFilterOptions\"\n\t\t\t\t\t\t:key=\"option.label\"\n\t\t\t\t\t\t:label=\"option.label\"\n\t\t\t\t\t\t:value=\"option.value\"\n\t\t\t\t\t\tdata-test-id=\"status\"\n\t\t\t\t\t>\n\t\t\t\t\t</n8n-option>\n\t\t\t\t</n8n-select>\n\t\t\t</div>\n\t\t</template>\n\t</ResourcesListLayout>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent } from 'vue';\nimport ResourcesListLayout from '@/components/layouts/ResourcesListLayout.vue';\nimport WorkflowCard from '@/components/WorkflowCard.vue';\nimport { EnterpriseEditionFeature, VIEWS } from '@/constants';\nimport type { ITag, IUser, IWorkflowDb } from '@/Interface';\nimport TagsDropdown from '@/components/TagsDropdown.vue';\nimport { mapStores } from 'pinia';\nimport { useUIStore } from '@/stores/ui.store';\nimport { useSettingsStore } from '@/stores/settings.store';\nimport { useUsersStore } from '@/stores/users.store';\nimport { useWorkflowsStore } from '@/stores/workflows.store';\nimport { useSourceControlStore } from '@/stores/sourceControl.store';\nimport { useTagsStore } from '@/stores/tags.store';\nimport { useProjectsStore } from '@/stores/projects.store';\nimport ProjectTabs from '@/components/Projects/ProjectTabs.vue';\nimport { useTemplatesStore } from '@/stores/templates.store';\n\ntype IResourcesListLayoutInstance = InstanceType<typeof ResourcesListLayout>;\n\ninterface Filters {\n\tsearch: string;\n\thomeProject: string;\n\tstatus: string | boolean;\n\ttags: string[];\n}\n\nconst StatusFilter = {\n\tACTIVE: true,\n\tDEACTIVATED: false,\n\tALL: '',\n};\n\nconst WorkflowsView = defineComponent({\n\tname: 'WorkflowsView',\n\tcomponents: {\n\t\tResourcesListLayout,\n\t\tWorkflowCard,\n\t\tTagsDropdown,\n\t\tProjectTabs,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tfilters: {\n\t\t\t\tsearch: '',\n\t\t\t\thomeProject: '',\n\t\t\t\tstatus: StatusFilter.ALL,\n\t\t\t\ttags: [],\n\t\t\t} as Filters,\n\t\t\tsourceControlStoreUnsubscribe: () => {},\n\t\t};\n\t},\n\tcomputed: {\n\t\t...mapStores(\n\t\t\tuseSettingsStore,\n\t\t\tuseUIStore,\n\t\t\tuseUsersStore,\n\t\t\tuseWorkflowsStore,\n\t\t\tuseSourceControlStore,\n\t\t\tuseTagsStore,\n\t\t\tuseProjectsStore,\n\t\t\tuseTemplatesStore,\n\t\t),\n\t\treadOnlyEnv(): boolean {\n\t\t\treturn this.sourceControlStore.preferences.branchReadOnly;\n\t\t},\n\t\tcurrentUser(): IUser {\n\t\t\treturn this.usersStore.currentUser || ({} as IUser);\n\t\t},\n\t\tallWorkflows(): IWorkflowDb[] {\n\t\t\treturn this.workflowsStore.allWorkflows;\n\t\t},\n\t\tisShareable(): boolean {\n\t\t\treturn this.settingsStore.isEnterpriseFeatureEnabled(EnterpriseEditionFeature.Sharing);\n\t\t},\n\t\tstatusFilterOptions(): Array<{ label: string; value: string | boolean }> {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tlabel: this.$locale.baseText('workflows.filters.status.all'),\n\t\t\t\t\tvalue: StatusFilter.ALL,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: this.$locale.baseText('workflows.filters.status.active'),\n\t\t\t\t\tvalue: StatusFilter.ACTIVE,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: this.$locale.baseText('workflows.filters.status.deactivated'),\n\t\t\t\t\tvalue: StatusFilter.DEACTIVATED,\n\t\t\t\t},\n\t\t\t];\n\t\t},\n\t\tuserRole() {\n\t\t\tconst role = this.usersStore.currentUserCloudInfo?.role;\n\n\t\t\tif (role) {\n\t\t\t\treturn role;\n\t\t\t}\n\n\t\t\tconst answers = this.usersStore.currentUser?.personalizationAnswers;\n\t\t\tif (answers && 'role' in answers) {\n\t\t\t\treturn answers.role;\n\t\t\t}\n\n\t\t\treturn undefined;\n\t\t},\n\t\tisSalesUser() {\n\t\t\tif (!this.userRole) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn ['Sales', 'sales-and-marketing'].includes(this.userRole);\n\t\t},\n\t\tshowProjectTabs() {\n\t\t\treturn (\n\t\t\t\t!!this.$route.params.projectId ||\n\t\t\t\t!!this.allWorkflows.length ||\n\t\t\t\tthis.projectsStore.myProjects.length > 1\n\t\t\t);\n\t\t},\n\t\taddWorkflowButtonText() {\n\t\t\treturn this.projectsStore.currentProject\n\t\t\t\t? this.$locale.baseText('workflows.project.add')\n\t\t\t\t: this.$locale.baseText('workflows.add');\n\t\t},\n\t},\n\twatch: {\n\t\tfilters: {\n\t\t\tdeep: true,\n\t\t\thandler() {\n\t\t\t\tthis.saveFiltersOnQueryString();\n\t\t\t},\n\t\t},\n\t\t'filters.tags'() {\n\t\t\tthis.sendFiltersTelemetry('tags');\n\t\t},\n\t\t'$route.params.projectId'() {\n\t\t\tvoid this.initialize();\n\t\t},\n\t},\n\tasync mounted() {\n\t\tawait this.setFiltersFromQueryString();\n\n\t\tvoid this.usersStore.showPersonalizationSurvey();\n\n\t\tthis.sourceControlStoreUnsubscribe = this.sourceControlStore.$onAction(({ name, after }) => {\n\t\t\tif (name === 'pullWorkfolder' && after) {\n\t\t\t\tafter(() => {\n\t\t\t\t\tvoid this.initialize();\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t},\n\tbeforeUnmount() {\n\t\tthis.sourceControlStoreUnsubscribe();\n\t},\n\tmethods: {\n\t\tonFiltersUpdated(filters: Filters) {\n\t\t\tthis.filters = filters;\n\t\t},\n\t\taddWorkflow() {\n\t\t\tthis.uiStore.nodeViewInitialized = false;\n\t\t\tvoid this.$router.push({\n\t\t\t\tname: VIEWS.NEW_WORKFLOW,\n\t\t\t\tquery: { projectId: this.$route?.params?.projectId },\n\t\t\t});\n\n\t\t\tthis.$telemetry.track('User clicked add workflow button', {\n\t\t\t\tsource: 'Workflows list',\n\t\t\t});\n\t\t},\n\t\tgetTemplateRepositoryURL() {\n\t\t\treturn this.templatesStore.websiteTemplateRepositoryURL;\n\t\t},\n\t\ttrackCategoryLinkClick(category: string) {\n\t\t\tthis.$telemetry.track(`User clicked Browse ${category} Templates`, {\n\t\t\t\trole: this.usersStore.currentUserCloudInfo?.role,\n\t\t\t\tactive_workflow_count: this.workflowsStore.activeWorkflows.length,\n\t\t\t});\n\t\t},\n\t\tasync initialize() {\n\t\t\tawait Promise.all([\n\t\t\t\tthis.usersStore.fetchUsers(),\n\t\t\t\tthis.workflowsStore.fetchAllWorkflows(this.$route?.params?.projectId as string | undefined),\n\t\t\t\tthis.workflowsStore.fetchActiveWorkflows(),\n\t\t\t]);\n\t\t},\n\t\tonClickTag(tagId: string) {\n\t\t\tif (!this.filters.tags.includes(tagId)) {\n\t\t\t\tthis.filters.tags.push(tagId);\n\t\t\t}\n\t\t},\n\t\tonFilter(\n\t\t\tresource: IWorkflowDb,\n\t\t\tfilters: { tags: string[]; search: string; status: string | boolean },\n\t\t\tmatches: boolean,\n\t\t): boolean {\n\t\t\tif (this.settingsStore.areTagsEnabled && filters.tags.length > 0) {\n\t\t\t\tmatches =\n\t\t\t\t\tmatches &&\n\t\t\t\t\tfilters.tags.every((tag) =>\n\t\t\t\t\t\t(resource.tags as ITag[])?.find((resourceTag) =>\n\t\t\t\t\t\t\ttypeof resourceTag === 'object'\n\t\t\t\t\t\t\t\t? `${resourceTag.id}` === `${tag}`\n\t\t\t\t\t\t\t\t: `${resourceTag}` === `${tag}`,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (filters.status !== '') {\n\t\t\t\tmatches = matches && resource.active === filters.status;\n\t\t\t}\n\n\t\t\treturn matches;\n\t\t},\n\t\tsendFiltersTelemetry(source: string) {\n\t\t\t(this.$refs.layout as IResourcesListLayoutInstance).sendFiltersTelemetry(source);\n\t\t},\n\t\tsaveFiltersOnQueryString() {\n\t\t\tconst query: { [key: string]: string } = {};\n\n\t\t\tif (this.filters.search) {\n\t\t\t\tquery.search = this.filters.search;\n\t\t\t}\n\n\t\t\tif (typeof this.filters.status !== 'string') {\n\t\t\t\tquery.status = this.filters.status.toString();\n\t\t\t}\n\n\t\t\tif (this.filters.tags.length) {\n\t\t\t\tquery.tags = this.filters.tags.join(',');\n\t\t\t}\n\n\t\t\tif (this.filters.homeProject) {\n\t\t\t\tquery.homeProject = this.filters.homeProject;\n\t\t\t}\n\n\t\t\tvoid this.$router.replace({\n\t\t\t\tquery: Object.keys(query).length ? query : undefined,\n\t\t\t});\n\t\t},\n\t\tisValidProjectId(projectId: string) {\n\t\t\treturn this.projectsStore.projects.some((project) => project.id === projectId);\n\t\t},\n\t\tasync setFiltersFromQueryString() {\n\t\t\tconst { tags, status, search, homeProject } = this.$route.query;\n\n\t\t\tconst filtersToApply: { [key: string]: string | string[] | boolean } = {};\n\n\t\t\tif (homeProject && typeof homeProject === 'string') {\n\t\t\t\tawait this.projectsStore.getAllProjects();\n\t\t\t\tif (this.isValidProjectId(homeProject)) {\n\t\t\t\t\tfiltersToApply.homeProject = homeProject;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (search && typeof search === 'string') {\n\t\t\t\tfiltersToApply.search = search;\n\t\t\t}\n\n\t\t\tif (tags && typeof tags === 'string') {\n\t\t\t\tconst currentTags = this.tagsStore.allTags.map((tag) => tag.id);\n\t\t\t\tconst savedTags = tags.split(',').filter((tag) => currentTags.includes(tag));\n\t\t\t\tif (savedTags.length) {\n\t\t\t\t\tfiltersToApply.tags = savedTags;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tstatus &&\n\t\t\t\ttypeof status === 'string' &&\n\t\t\t\t[StatusFilter.ACTIVE.toString(), StatusFilter.DEACTIVATED.toString()].includes(status)\n\t\t\t) {\n\t\t\t\tfiltersToApply.status = status === 'true';\n\t\t\t}\n\n\t\t\tif (Object.keys(filtersToApply).length) {\n\t\t\t\tthis.filters = {\n\t\t\t\t\t...this.filters,\n\t\t\t\t\t...filtersToApply,\n\t\t\t\t};\n\t\t\t}\n\t\t},\n\t},\n});\n\nexport default WorkflowsView;\n</script>\n\n<style lang=\"scss\" module>\n.actionsContainer {\n\tdisplay: flex;\n\tjustify-content: center;\n}\n\n.emptyStateCard {\n\twidth: 192px;\n\ttext-align: center;\n\tdisplay: inline-flex;\n\theight: 230px;\n\n\t& + & {\n\t\tmargin-left: var(--spacing-s);\n\t}\n\n\t&:hover {\n\t\tsvg {\n\t\t\tcolor: var(--color-primary);\n\t\t}\n\t}\n}\n\n.emptyStateCardIcon {\n\tfont-size: 48px;\n\n\tsvg {\n\t\twidth: 48px !important;\n\t\tcolor: var(--color-foreground-dark);\n\t\ttransition: color 0.3s ease;\n\t}\n}\n</style>\n"],"names":["WORKFLOW_LIST_ITEM_ACTIONS","props","__props","emit","__emit","toast","useToast","message","useMessage","locale","useI18n","router","useRouter","telemetry","useTelemetry","settingsStore","useSettingsStore","uiStore","useUIStore","usersStore","useUsersStore","workflowsStore","useWorkflowsStore","projectsStore","useProjectsStore","currentUser","computed","workflowPermissions","getWorkflowPermissions","actions","items","formattedCreatedAtDate","currentYear","dateformat","onClick","event","route","VIEWS","onClickTag","tagId","onExpandTags","onAction","action","DUPLICATE_MODAL_KEY","tag","WORKFLOW_SHARE_MODAL_KEY","deleteWorkflow","moveResource","MODAL_CONFIRM","error","PROJECT_MOVE_RESOURCE_MODAL","StatusFilter","WorkflowsView","defineComponent","ResourcesListLayout","WorkflowCard","TagsDropdown","ProjectTabs","mapStores","useSourceControlStore","useTagsStore","useTemplatesStore","EnterpriseEditionFeature","role","_a","answers","_b","name","after","filters","category","resource","matches","resourceTag","source","query","projectId","project","tags","status","search","homeProject","filtersToApply","currentTags","savedTags","_sfc_main","_hoisted_1","_hoisted_3","_hoisted_4","_component_ResourcesListLayout","_resolveComponent","_openBlock","_createBlock","_ctx","initialize","readOnlyEnv","addWorkflow","_withCtx","_component_ProjectTabs","_createCommentVNode","disabled","_createVNode","_component_n8n_tooltip","_component_i18n_t","_createElementVNode","_toDisplayString","_component_n8n_button","_createTextVNode","data","updateItemSize","_component_WorkflowCard","_hoisted_2","_component_n8n_heading","$locale","_component_n8n_text","_createElementBlock","isSalesUser","_normalizeClass","_component_n8n_card","_cache","$event","_component_n8n_icon","$style","setKeyValue","_component_n8n_input_label","_component_TagsDropdown","_hoisted_5","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AAA,EACZ,KAAK,GACL,KAAK,QAAA,MAAA,YAEN,MAAA,QAAA,EACC,KAAa,EAAA,CAAA,OAAA,CAAA,EAAAQ,EACZ0B,EAA2B,CAC3B,eAAA,kBAAA,cAAAlC,EAAA,QAAA,OAlIN,sBAqI2C2B,GAAAG,EAAA,SAAAH,CAAA,CAAA,EAAA,iBAC/B7B,EAAA,EAAO,EAAKwB,EAAAa,GAAA,KAAAC,GAAApC,EAAA,oBAAAqC,IACZvC,EAAA,EAAcC,EAAAuC,EAAA,CACnB,IAAKD,EAAE,MACR,MAAYA,EAAA,MAAA,MAAAA,EAAA,yDAzIlB,EAAA,GAAA,EAAA,CAAA,kDAAA,CAAA,CAAA,CAAA"}
@@ -1,2 +1,2 @@
1
- import{e as k,eh as _,l as D,j as d,L as p,bd as n}from"./index-Dtri_pSJ.js";import{h as N}from"./n8n-4UEsHtUL.js";import"./vendor-Dv5OeN6t.js";import"./pinia-sugP77Im.js";import"./axios-Mm4CS0gO.js";import"./flatted-DN8lQ2XG.js";import"./@vueuse/core-BBHtM40w.js";import"./lodash-es-CZ1inz46.js";import"./@n8n/permissions-BxxteU-C.js";import"./dateformat-CIxnBJXX.js";import"./vue-i18n-Delvyc9x.js";import"./uuid-SoommWqA.js";import"./luxon-CLwAIbs0.js";import"./@n8n/codemirror-lang-sql-DBO6T13I.js";import"./@lezer/common-B6ct0j_v.js";import"./prettier-bS6l4Vb1.js";import"./@jsplumb/util-DS-9vq_E.js";import"./@jsplumb/core-CVBraiyY.js";import"./@jsplumb/common-CF-b-6-M.js";import"./@jsplumb/connector-bezier-BGU0Ovbw.js";import"./@jsplumb/browser-ui-BVF2KoJK.js";import"./codemirror-lang-html-n8n-CWDO6_kP.js";import"./@n8n/codemirror-lang-Dl0FW_KM.js";import"./esprima-next-nhoSXAeq.js";import"./fast-json-stable-stringify-BOfzoJX1.js";import"./timeago.js-CiyKClrF.js";import"./qrcode.vue-BGkPba5A.js";import"./vue3-touch-events-mV0oX_Sl.js";import"./chart.js-343vZi4M.js";function h(){const e=k().fakeDoorFeatures.map(s=>({...s})),o=e.find(s=>s.id===_.ENVIRONMENTS);o&&(o.actionBoxTitle+=".cloud",o.linkURL+="&edition=cloud");const t=e.find(s=>s.id===_.LOGGING);return t&&(t.actionBoxTitle+=".cloud",t.linkURL+="&edition=cloud",t.infoText=""),e}const S=()=>{const r=k();r.fakeDoorFeatures=h()},a={pushRef:"",data:{nodeFilter:"",resultsNodes:[],filterMode:"Regular"}},g=()=>({eventName:"User entered nodes panel search term",properties:{search_string:a.data.nodeFilter,results_count:a.data.resultsNodes.length,results_nodes:a.data.resultsNodes,filter_mode:a.data.filterMode,nodes_panel_session_id:a.pushRef}}),y=()=>{a.pushRef=`nodes_panel_session_${new Date().valueOf()}`,a.data={nodeFilter:"",resultsNodes:[],filterMode:"Regular"}},E=r=>{var t;const e=D(),o=d();return{eventName:"User saved credentials",properties:{instance_id:e.instanceId,credential_type:r.credential_type,credential_id:r.credential_id,workflow_id:o.workflowId,node_type:(t=o.activeNode)==null?void 0:t.name,is_new:r.is_new}}},C=()=>{const r=d();return{eventName:"User opened workflow settings",properties:{workflow_id:r.workflowId,workflow_name:r.workflowName,current_settings:N(r.workflowSettings)}}},U=r=>{const e=d();return{eventName:"User updated workflow settings",properties:{workflow_id:e.workflowId,workflow_name:e.workflowName,new_settings:N(e.workflowSettings),old_settings:r.oldSettings}}},x=r=>{var o;return{eventName:"User opened node modal",properties:{node_name:(o=p().activeNode)==null?void 0:o.name,node_subtitle:r.nodeSubtitle}}},b=r=>{var o,t;const e=p();return{eventName:"User inserted item from Expression Editor variable selector",properties:{node_name:(o=e.activeNode)==null?void 0:o.name,node_type:(t=e.activeNode)==null?void 0:t.type.split(".")[1],parameter_name:r.parameter.displayName,variable_expression:r.selectedItem.variable}}},I=(r,e)=>{var s,i;const o=p(),t={eventName:"",properties:{}};return r.dialogVisible?(t.eventName="User opened Expression Editor",t.properties={node_name:(s=o.activeNode)==null?void 0:s.name,node_type:(i=o.activeNode)==null?void 0:i.type.split(".")[1],parameter_name:r.parameter.displayName,parameter_field_type:r.parameter.type,new_expression:e}):(t.eventName="User closed Expression Editor",t.properties={empty_expression:e,expression_value:r.value,expression_result:r.resolvedExpressionValue.slice(1)}),t},F=r=>{var o,t;const e=p();return{eventName:"User changed Authentication type from node modal",properties:{node_name:(o=e.activeNode)==null?void 0:o.name,node_type:(t=e.activeNode)==null?void 0:t.type.split(".")[1],old_mode:r.oldNodeParameters.authentication||(r.parameters.find(s=>s.name==="authentication")||{default:"default"}).default,new_mode:r.newValue}}},V=r=>{var o,t;const e=p();return{eventName:"User changed node output view mode",properties:{old_mode:r.oldValue,new_mode:r.newValue,node_name:(o=e.activeNode)==null?void 0:o.name,node_type:(t=e.activeNode)==null?void 0:t.type.split(".")[1]}}},R=r=>{var t,s,i,l,c,m,u,w,f,v;const e=d(),o={eventName:"",properties:{execution_id:e.activeExecutionId}};return(t=r.runDataExecutedStartData)!=null&&t.destinationNode?(o.eventName="Node execution finished",o.properties.node_type=(s=e.getNodeByName(r.nodeName||""))==null?void 0:s.type.split(".")[1],o.properties.node_name=r.nodeName):(o.eventName="Manual workflow execution finished",o.properties.workflow_id=e.workflowId,o.properties.workflow_name=e.workflowName),r.errorMessage||r.resultDataError?(o.properties.status="failed",o.properties.error_message=((i=r.resultDataError)==null?void 0:i.message)||"",o.properties.error_stack=((l=r.resultDataError)==null?void 0:l.stack)||"",o.properties.error_ui_message=r.errorMessage||"",o.properties.error_timestamp=new Date,r.resultDataError&&((c=r.resultDataError)!=null&&c.node)?o.properties.error_node=typeof((m=r.resultDataError)==null?void 0:m.node)=="string"?(u=r.resultDataError)==null?void 0:u.node:(f=(w=r.resultDataError)==null?void 0:w.node)==null?void 0:f.name:o.properties.error_node=r.nodeName):(o.properties.status="success",(v=r.runDataExecutedStartData)!=null&&v.destinationNode&&(o.properties.items_count=r.itemsCount||0)),o},M=r=>{const e=d();return{eventName:"User removed node from workflow canvas",properties:{node_name:r.node.name,node_type:r.node.type,node_disabled:r.node.disabled,workflow_id:e.workflowId}}},T=r=>{switch(r==null?void 0:r.type){case"n8n-nodes-base.httpRequest":const e=r.parameters.url.split("/")[2];return{eventName:"User finished httpRequest node editing",properties:{method:r.parameters.method,domain:e}};case"n8n-nodes-base.function":return{eventName:"User finished function node editing",properties:{node_name:r.name,code:r.parameters.functionCode}};case"n8n-nodes-base.functionItem":return{eventName:"User finished functionItem node editing",properties:{node_name:r.name,code:r.parameters.functionCode}};default:return}},O=r=>{var t;const e=d(),o={eventName:"",properties:{execution_id:e.activeExecutionId}};return r.nodeName?(o.eventName="User started node execution",o.properties.source="unknown",o.properties.node_type=(t=e.getNodeByName(r.nodeName))==null?void 0:t.type.split(".")[1],o.properties.node_name=r.nodeName,r.source==="RunData.ExecuteNodeButton"?o.properties.source="node_modal":r.source==="Node.executeNode"&&(o.properties.source="workflow_canvas")):(o.eventName="User started manual workflow execution",o.properties.workflow_id=e.workflowId,o.properties.workflow_name=e.workflowName),o},me={app:{mount:[()=>{S()}]},nodeView:{mount:[()=>{n().identify()}],createNodeActiveChanged:[(r,e)=>{const o=n(),t={source:e.source,nodes_panel_session_id:a.pushRef};y(),o.track("User opened nodes panel",t),o.page("Cloud instance","Nodes panel",t)}],addNodeButton:[(r,e)=>{const o=n(),t={eventName:"User added node to workflow canvas",properties:{node_type:e.nodeTypeName.split(".")[1],nodes_panel_session_id:a.pushRef}};o.track(t.eventName,t.properties)}]},main:{routeChange:[(r,e)=>{const o=n(),t=e.to.path.split("/");if(e.from.path!=="/"&&t[1]==="workflow"){const s={workflow_id:t[2]};o.page("Cloud instance","Workflow editor",s)}}]},credential:{saved:[(r,e)=>{const o=n(),t=E(e);o.track(t.eventName,t.properties)}]},credentialsEdit:{credentialTypeChanged:[(r,e)=>{const o=n();if(e.newValue){const t={eventName:"User opened Credentials modal",properties:{source:e.setCredentialType===e.credentialType?"node":"primary_menu",new_credential:!e.editCredentials,credential_type:e.credentialType}};o.track(t.eventName,t.properties),o.page("Cloud instance","Credentials modal",t.properties)}}],credentialModalOpened:[(r,e)=>{const o=n(),t={eventName:"User opened Credentials modal",properties:{source:e.activeNode?"node":"primary_menu",new_credential:!e.isEditingCredential,credential_type:e.credentialType}};o.track(t.eventName,t.properties),o.page("Cloud instance","Credentials modal",t.properties)}]},credentialsList:{mounted:[()=>{const r=n(),e={eventName:"User opened global Credentials panel"};r.track(e.eventName),r.page("Cloud instance","Credentials panel")}],dialogVisibleChanged:[(r,e)=>{const o=n();if(e.dialogVisible){const t={eventName:"User opened global Credentials panel"};o.track(t.eventName),o.page("Cloud instance","Credentials panel")}}]},workflowSettings:{dialogVisibleChanged:[(r,e)=>{const o=n();if(e.dialogVisible){const t=C();o.track(t.eventName,t.properties)}}],saveSettings:[(r,e)=>{const o=n(),t=U(e);o.track(t.eventName,t.properties)}]},dataDisplay:{onDocumentationUrlClick:[(r,e)=>{const o=n(),t={eventName:"User clicked node modal docs link",properties:{node_type:e.nodeType.name.split(".")[1],docs_link:e.documentationUrl}};o.track(t.eventName,t.properties)}],nodeTypeChanged:[(r,e)=>{var i;const o=n(),t=p(),s=x(e);o.track(s.eventName,s.properties),o.page("Cloud instance","Node modal",{node:(i=t.activeNode)==null?void 0:i.name})}],nodeEditingFinished:[()=>{const r=n(),e=p(),o=d(),t=T(e.activeNode);t&&(t.properties.workflow_id=o.workflowId),t&&r.track(t.eventName,t.properties)}]},executionsList:{openDialog:[()=>{const r=n(),e={eventName:"User opened Executions log"};r.track(e.eventName),r.page("Cloud instance","Executions log")}]},showMessage:{showError:[(r,e)=>{const o=n(),t={eventName:"Instance FE emitted error",properties:{error_title:e.title,error_description:e.message,error_message:e.errorMessage}};o.track(t.eventName,t.properties)}]},expressionEdit:{itemSelected:[(r,e)=>{const o=n(),t=b(e);e.selectedItem.variable.startsWith("Object.keys")?t.properties.variable_type="Keys":e.selectedItem.variable.startsWith("Object.values")?t.properties.variable_type="Values":t.properties.variable_type="Raw value",o.track(t.eventName,t.properties)}],dialogVisibleChanged:[(r,e)=>{var l;const o=n(),t=((l=e.value)==null?void 0:l.slice(1))??"";let s=!1;switch(typeof e.parameter.default){case"boolean":s=t==="true"&&e.parameter.default||t==="false"&&!e.parameter.default;break;case"string":s=t===e.parameter.default;break;case"number":s=t===e.parameter.default.toString();break}const i=I(e,s);o.track(i.eventName,i.properties)}]},nodeSettings:{valueChanged:[(r,e)=>{const o=n();if(e.parameterPath!=="authentication")return;const t=F(e);o.track(t.eventName,t.properties)}],credentialSelected:[(r,e)=>{const o=n(),t=Object.keys(e.updateInformation.properties.credentials||{});if(t.length<1)return;const s={eventName:"User selected credential from node modal",properties:{credential_name:e.updateInformation.properties.credentials[t[0]],credential_type:t[0]}};o.track(s.eventName,s.properties)}]},workflowRun:{runWorkflow:[(r,e)=>{const o=n(),t=O(e);o.track(t.eventName,t.properties)}],runError:[(r,e)=>{const o=n(),t={eventName:e.nodeName?"Node execution finished":"Manual workflow execution finished",properties:{preflight:"true",status:"failed",error_message:e.errorMessages.join("<br />&nbsp;&nbsp;- "),error_timestamp:new Date,node_name:e.nodeName}};o.track(t.eventName,t.properties)}]},runData:{displayModeChanged:[(r,e)=>{const o=n(),t=V(e);o.track(t.eventName,t.properties)}]},pushConnection:{executionFinished:[(r,e)=>{const o=n(),t=R(e);o.track(t.eventName,t.properties)}]},node:{deleteNode:[(r,e)=>{const o=n(),t=M(e);o.track(t.eventName,t.properties)}]},workflow:{activeChange:[(r,e)=>{const o=n(),t={eventName:e.active&&"User activated workflow"||"User deactivated workflow",properties:{workflow_id:e.workflowId,source:"workflow_modal"}};o.track(t.eventName,t.properties)}],activeChangeCurrent:[(r,e)=>{const o=n(),t=d(),s={eventName:e.active&&"User activated workflow"||"User deactivated workflow",properties:{source:"main nav",workflow_id:e.workflowId,workflow_name:t.workflowName,workflow_nodes:t.allNodes.map(i=>i.type.split(".")[1])}};o.track(s.eventName,s.properties)}],afterUpdate:[(r,e)=>{const o=n(),t={eventName:"User saved workflow",properties:{workflow_id:e.workflowData.id,workflow_name:e.workflowData.name,workflow_nodes:e.workflowData.nodes.map(s=>s.type.split(".")[1])}};o.track(t.eventName,t.properties)}]},execution:{open:[(r,e)=>{const o=n(),t={eventName:"User opened read-only execution",properties:{workflow_id:e.workflowId,workflow_name:e.workflowName,execution_id:e.executionId}};o.track(t.eventName,t.properties)}]},nodeCreateList:{destroyed:[()=>{const r=n();if(a.data.nodeFilter.length>0&&a.data.nodeFilter!==""){const e=g();r.track(e.eventName,e.properties)}}],selectedTypeChanged:[(r,e)=>{const o=n(),t={eventName:"User changed nodes panel filter",properties:{old_filter:e.oldValue,new_filter:e.newValue,nodes_panel_session_id:a.pushRef}};a.data.filterMode=e.newValue,o.track(t.eventName,t.properties)}],nodeFilterChanged:[(r,e)=>{const o=n();if(e.newValue.length===0&&a.data.nodeFilter.length>0){const t=g();o.track(t.eventName,t.properties)}e.newValue.length>e.oldValue.length&&(a.data.nodeFilter=e.newValue,a.data.resultsNodes=e.filteredNodes.map(t=>t.name?t.name.split(".")[1]:t.key?t.key.split(".")[1]:""))}]}};export{me as n8nCloudHooks};
2
- //# sourceMappingURL=cloud-CRMEbZfJ.js.map
1
+ import{e as k,ef as _,l as D,j as d,K as p,bd as n}from"./index-BE0Xl-jy.js";import{h as N}from"./n8n-4UEsHtUL.js";import"./vendor-Dv5OeN6t.js";import"./pinia-sugP77Im.js";import"./axios-Mm4CS0gO.js";import"./flatted-DN8lQ2XG.js";import"./@vueuse/core-BBHtM40w.js";import"./lodash-es-CZ1inz46.js";import"./@n8n/permissions-BxxteU-C.js";import"./dateformat-CIxnBJXX.js";import"./vue-i18n-Delvyc9x.js";import"./uuid-SoommWqA.js";import"./luxon-CLwAIbs0.js";import"./@n8n/codemirror-lang-sql-DBO6T13I.js";import"./@lezer/common-B6ct0j_v.js";import"./prettier-bS6l4Vb1.js";import"./@jsplumb/util-DS-9vq_E.js";import"./@jsplumb/core-CVBraiyY.js";import"./@jsplumb/common-CF-b-6-M.js";import"./@jsplumb/connector-bezier-BGU0Ovbw.js";import"./@jsplumb/browser-ui-BVF2KoJK.js";import"./codemirror-lang-html-n8n-CWDO6_kP.js";import"./@n8n/codemirror-lang-Dl0FW_KM.js";import"./esprima-next-nhoSXAeq.js";import"./fast-json-stable-stringify-BOfzoJX1.js";import"./timeago.js-CiyKClrF.js";import"./qrcode.vue-BGkPba5A.js";import"./vue3-touch-events-mV0oX_Sl.js";import"./chart.js-343vZi4M.js";function h(){const e=k().fakeDoorFeatures.map(s=>({...s})),o=e.find(s=>s.id===_.ENVIRONMENTS);o&&(o.actionBoxTitle+=".cloud",o.linkURL+="&edition=cloud");const t=e.find(s=>s.id===_.LOGGING);return t&&(t.actionBoxTitle+=".cloud",t.linkURL+="&edition=cloud",t.infoText=""),e}const S=()=>{const r=k();r.fakeDoorFeatures=h()},a={pushRef:"",data:{nodeFilter:"",resultsNodes:[],filterMode:"Regular"}},g=()=>({eventName:"User entered nodes panel search term",properties:{search_string:a.data.nodeFilter,results_count:a.data.resultsNodes.length,results_nodes:a.data.resultsNodes,filter_mode:a.data.filterMode,nodes_panel_session_id:a.pushRef}}),y=()=>{a.pushRef=`nodes_panel_session_${new Date().valueOf()}`,a.data={nodeFilter:"",resultsNodes:[],filterMode:"Regular"}},E=r=>{var t;const e=D(),o=d();return{eventName:"User saved credentials",properties:{instance_id:e.instanceId,credential_type:r.credential_type,credential_id:r.credential_id,workflow_id:o.workflowId,node_type:(t=o.activeNode)==null?void 0:t.name,is_new:r.is_new}}},C=()=>{const r=d();return{eventName:"User opened workflow settings",properties:{workflow_id:r.workflowId,workflow_name:r.workflowName,current_settings:N(r.workflowSettings)}}},U=r=>{const e=d();return{eventName:"User updated workflow settings",properties:{workflow_id:e.workflowId,workflow_name:e.workflowName,new_settings:N(e.workflowSettings),old_settings:r.oldSettings}}},x=r=>{var o;return{eventName:"User opened node modal",properties:{node_name:(o=p().activeNode)==null?void 0:o.name,node_subtitle:r.nodeSubtitle}}},b=r=>{var o,t;const e=p();return{eventName:"User inserted item from Expression Editor variable selector",properties:{node_name:(o=e.activeNode)==null?void 0:o.name,node_type:(t=e.activeNode)==null?void 0:t.type.split(".")[1],parameter_name:r.parameter.displayName,variable_expression:r.selectedItem.variable}}},I=(r,e)=>{var s,i;const o=p(),t={eventName:"",properties:{}};return r.dialogVisible?(t.eventName="User opened Expression Editor",t.properties={node_name:(s=o.activeNode)==null?void 0:s.name,node_type:(i=o.activeNode)==null?void 0:i.type.split(".")[1],parameter_name:r.parameter.displayName,parameter_field_type:r.parameter.type,new_expression:e}):(t.eventName="User closed Expression Editor",t.properties={empty_expression:e,expression_value:r.value,expression_result:r.resolvedExpressionValue.slice(1)}),t},F=r=>{var o,t;const e=p();return{eventName:"User changed Authentication type from node modal",properties:{node_name:(o=e.activeNode)==null?void 0:o.name,node_type:(t=e.activeNode)==null?void 0:t.type.split(".")[1],old_mode:r.oldNodeParameters.authentication||(r.parameters.find(s=>s.name==="authentication")||{default:"default"}).default,new_mode:r.newValue}}},V=r=>{var o,t;const e=p();return{eventName:"User changed node output view mode",properties:{old_mode:r.oldValue,new_mode:r.newValue,node_name:(o=e.activeNode)==null?void 0:o.name,node_type:(t=e.activeNode)==null?void 0:t.type.split(".")[1]}}},R=r=>{var t,s,i,l,c,m,u,w,f,v;const e=d(),o={eventName:"",properties:{execution_id:e.activeExecutionId}};return(t=r.runDataExecutedStartData)!=null&&t.destinationNode?(o.eventName="Node execution finished",o.properties.node_type=(s=e.getNodeByName(r.nodeName||""))==null?void 0:s.type.split(".")[1],o.properties.node_name=r.nodeName):(o.eventName="Manual workflow execution finished",o.properties.workflow_id=e.workflowId,o.properties.workflow_name=e.workflowName),r.errorMessage||r.resultDataError?(o.properties.status="failed",o.properties.error_message=((i=r.resultDataError)==null?void 0:i.message)||"",o.properties.error_stack=((l=r.resultDataError)==null?void 0:l.stack)||"",o.properties.error_ui_message=r.errorMessage||"",o.properties.error_timestamp=new Date,r.resultDataError&&((c=r.resultDataError)!=null&&c.node)?o.properties.error_node=typeof((m=r.resultDataError)==null?void 0:m.node)=="string"?(u=r.resultDataError)==null?void 0:u.node:(f=(w=r.resultDataError)==null?void 0:w.node)==null?void 0:f.name:o.properties.error_node=r.nodeName):(o.properties.status="success",(v=r.runDataExecutedStartData)!=null&&v.destinationNode&&(o.properties.items_count=r.itemsCount||0)),o},M=r=>{const e=d();return{eventName:"User removed node from workflow canvas",properties:{node_name:r.node.name,node_type:r.node.type,node_disabled:r.node.disabled,workflow_id:e.workflowId}}},T=r=>{switch(r==null?void 0:r.type){case"n8n-nodes-base.httpRequest":const e=r.parameters.url.split("/")[2];return{eventName:"User finished httpRequest node editing",properties:{method:r.parameters.method,domain:e}};case"n8n-nodes-base.function":return{eventName:"User finished function node editing",properties:{node_name:r.name,code:r.parameters.functionCode}};case"n8n-nodes-base.functionItem":return{eventName:"User finished functionItem node editing",properties:{node_name:r.name,code:r.parameters.functionCode}};default:return}},O=r=>{var t;const e=d(),o={eventName:"",properties:{execution_id:e.activeExecutionId}};return r.nodeName?(o.eventName="User started node execution",o.properties.source="unknown",o.properties.node_type=(t=e.getNodeByName(r.nodeName))==null?void 0:t.type.split(".")[1],o.properties.node_name=r.nodeName,r.source==="RunData.ExecuteNodeButton"?o.properties.source="node_modal":r.source==="Node.executeNode"&&(o.properties.source="workflow_canvas")):(o.eventName="User started manual workflow execution",o.properties.workflow_id=e.workflowId,o.properties.workflow_name=e.workflowName),o},me={app:{mount:[()=>{S()}]},nodeView:{mount:[()=>{n().identify()}],createNodeActiveChanged:[(r,e)=>{const o=n(),t={source:e.source,nodes_panel_session_id:a.pushRef};y(),o.track("User opened nodes panel",t),o.page("Cloud instance","Nodes panel",t)}],addNodeButton:[(r,e)=>{const o=n(),t={eventName:"User added node to workflow canvas",properties:{node_type:e.nodeTypeName.split(".")[1],nodes_panel_session_id:a.pushRef}};o.track(t.eventName,t.properties)}]},main:{routeChange:[(r,e)=>{const o=n(),t=e.to.path.split("/");if(e.from.path!=="/"&&t[1]==="workflow"){const s={workflow_id:t[2]};o.page("Cloud instance","Workflow editor",s)}}]},credential:{saved:[(r,e)=>{const o=n(),t=E(e);o.track(t.eventName,t.properties)}]},credentialsEdit:{credentialTypeChanged:[(r,e)=>{const o=n();if(e.newValue){const t={eventName:"User opened Credentials modal",properties:{source:e.setCredentialType===e.credentialType?"node":"primary_menu",new_credential:!e.editCredentials,credential_type:e.credentialType}};o.track(t.eventName,t.properties),o.page("Cloud instance","Credentials modal",t.properties)}}],credentialModalOpened:[(r,e)=>{const o=n(),t={eventName:"User opened Credentials modal",properties:{source:e.activeNode?"node":"primary_menu",new_credential:!e.isEditingCredential,credential_type:e.credentialType}};o.track(t.eventName,t.properties),o.page("Cloud instance","Credentials modal",t.properties)}]},credentialsList:{mounted:[()=>{const r=n(),e={eventName:"User opened global Credentials panel"};r.track(e.eventName),r.page("Cloud instance","Credentials panel")}],dialogVisibleChanged:[(r,e)=>{const o=n();if(e.dialogVisible){const t={eventName:"User opened global Credentials panel"};o.track(t.eventName),o.page("Cloud instance","Credentials panel")}}]},workflowSettings:{dialogVisibleChanged:[(r,e)=>{const o=n();if(e.dialogVisible){const t=C();o.track(t.eventName,t.properties)}}],saveSettings:[(r,e)=>{const o=n(),t=U(e);o.track(t.eventName,t.properties)}]},dataDisplay:{onDocumentationUrlClick:[(r,e)=>{const o=n(),t={eventName:"User clicked node modal docs link",properties:{node_type:e.nodeType.name.split(".")[1],docs_link:e.documentationUrl}};o.track(t.eventName,t.properties)}],nodeTypeChanged:[(r,e)=>{var i;const o=n(),t=p(),s=x(e);o.track(s.eventName,s.properties),o.page("Cloud instance","Node modal",{node:(i=t.activeNode)==null?void 0:i.name})}],nodeEditingFinished:[()=>{const r=n(),e=p(),o=d(),t=T(e.activeNode);t&&(t.properties.workflow_id=o.workflowId),t&&r.track(t.eventName,t.properties)}]},executionsList:{openDialog:[()=>{const r=n(),e={eventName:"User opened Executions log"};r.track(e.eventName),r.page("Cloud instance","Executions log")}]},showMessage:{showError:[(r,e)=>{const o=n(),t={eventName:"Instance FE emitted error",properties:{error_title:e.title,error_description:e.message,error_message:e.errorMessage}};o.track(t.eventName,t.properties)}]},expressionEdit:{itemSelected:[(r,e)=>{const o=n(),t=b(e);e.selectedItem.variable.startsWith("Object.keys")?t.properties.variable_type="Keys":e.selectedItem.variable.startsWith("Object.values")?t.properties.variable_type="Values":t.properties.variable_type="Raw value",o.track(t.eventName,t.properties)}],dialogVisibleChanged:[(r,e)=>{var l;const o=n(),t=((l=e.value)==null?void 0:l.slice(1))??"";let s=!1;switch(typeof e.parameter.default){case"boolean":s=t==="true"&&e.parameter.default||t==="false"&&!e.parameter.default;break;case"string":s=t===e.parameter.default;break;case"number":s=t===e.parameter.default.toString();break}const i=I(e,s);o.track(i.eventName,i.properties)}]},nodeSettings:{valueChanged:[(r,e)=>{const o=n();if(e.parameterPath!=="authentication")return;const t=F(e);o.track(t.eventName,t.properties)}],credentialSelected:[(r,e)=>{const o=n(),t=Object.keys(e.updateInformation.properties.credentials||{});if(t.length<1)return;const s={eventName:"User selected credential from node modal",properties:{credential_name:e.updateInformation.properties.credentials[t[0]],credential_type:t[0]}};o.track(s.eventName,s.properties)}]},workflowRun:{runWorkflow:[(r,e)=>{const o=n(),t=O(e);o.track(t.eventName,t.properties)}],runError:[(r,e)=>{const o=n(),t={eventName:e.nodeName?"Node execution finished":"Manual workflow execution finished",properties:{preflight:"true",status:"failed",error_message:e.errorMessages.join("<br />&nbsp;&nbsp;- "),error_timestamp:new Date,node_name:e.nodeName}};o.track(t.eventName,t.properties)}]},runData:{displayModeChanged:[(r,e)=>{const o=n(),t=V(e);o.track(t.eventName,t.properties)}]},pushConnection:{executionFinished:[(r,e)=>{const o=n(),t=R(e);o.track(t.eventName,t.properties)}]},node:{deleteNode:[(r,e)=>{const o=n(),t=M(e);o.track(t.eventName,t.properties)}]},workflow:{activeChange:[(r,e)=>{const o=n(),t={eventName:e.active&&"User activated workflow"||"User deactivated workflow",properties:{workflow_id:e.workflowId,source:"workflow_modal"}};o.track(t.eventName,t.properties)}],activeChangeCurrent:[(r,e)=>{const o=n(),t=d(),s={eventName:e.active&&"User activated workflow"||"User deactivated workflow",properties:{source:"main nav",workflow_id:e.workflowId,workflow_name:t.workflowName,workflow_nodes:t.allNodes.map(i=>i.type.split(".")[1])}};o.track(s.eventName,s.properties)}],afterUpdate:[(r,e)=>{const o=n(),t={eventName:"User saved workflow",properties:{workflow_id:e.workflowData.id,workflow_name:e.workflowData.name,workflow_nodes:e.workflowData.nodes.map(s=>s.type.split(".")[1])}};o.track(t.eventName,t.properties)}]},execution:{open:[(r,e)=>{const o=n(),t={eventName:"User opened read-only execution",properties:{workflow_id:e.workflowId,workflow_name:e.workflowName,execution_id:e.executionId}};o.track(t.eventName,t.properties)}]},nodeCreateList:{destroyed:[()=>{const r=n();if(a.data.nodeFilter.length>0&&a.data.nodeFilter!==""){const e=g();r.track(e.eventName,e.properties)}}],selectedTypeChanged:[(r,e)=>{const o=n(),t={eventName:"User changed nodes panel filter",properties:{old_filter:e.oldValue,new_filter:e.newValue,nodes_panel_session_id:a.pushRef}};a.data.filterMode=e.newValue,o.track(t.eventName,t.properties)}],nodeFilterChanged:[(r,e)=>{const o=n();if(e.newValue.length===0&&a.data.nodeFilter.length>0){const t=g();o.track(t.eventName,t.properties)}e.newValue.length>e.oldValue.length&&(a.data.nodeFilter=e.newValue,a.data.resultsNodes=e.filteredNodes.map(t=>t.name?t.name.split(".")[1]:t.key?t.key.split(".")[1]:""))}]}};export{me as n8nCloudHooks};
2
+ //# sourceMappingURL=cloud-B90x0-JC.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cloud-CRMEbZfJ.js","sources":["../../src/hooks/utils/hooksAddFakeDoorFeatures.ts","../../src/hooks/utils/hooksNodesPanel.ts","../../src/hooks/segment/getters.ts","../../src/hooks/cloud.ts"],"sourcesContent":["import { useUIStore } from '@/stores/ui.store';\nimport type { IFakeDoor } from '@/Interface';\nimport { FAKE_DOOR_FEATURES } from '@/constants';\nimport type { BaseTextKey } from '@/plugins/i18n';\n\nexport function compileFakeDoorFeatures(): IFakeDoor[] {\n\tconst store = useUIStore();\n\tconst fakeDoorFeatures: IFakeDoor[] = store.fakeDoorFeatures.map((feature) => ({ ...feature }));\n\n\tconst environmentsFeature = fakeDoorFeatures.find(\n\t\t(feature) => feature.id === FAKE_DOOR_FEATURES.ENVIRONMENTS,\n\t);\n\tif (environmentsFeature) {\n\t\tenvironmentsFeature.actionBoxTitle += '.cloud';\n\t\tenvironmentsFeature.linkURL += '&edition=cloud';\n\t}\n\n\tconst loggingFeature = fakeDoorFeatures.find(\n\t\t(feature) => feature.id === FAKE_DOOR_FEATURES.LOGGING,\n\t);\n\tif (loggingFeature) {\n\t\tloggingFeature.actionBoxTitle += '.cloud';\n\t\tloggingFeature.linkURL += '&edition=cloud';\n\t\tloggingFeature.infoText = '' as BaseTextKey;\n\t}\n\n\treturn fakeDoorFeatures;\n}\n\nexport const hooksAddFakeDoorFeatures = () => {\n\tconst store = useUIStore();\n\n\tstore.fakeDoorFeatures = compileFakeDoorFeatures();\n};\n","export const nodesPanelSession = {\n\tpushRef: '',\n\tdata: {\n\t\tnodeFilter: '',\n\t\tresultsNodes: [] as string[],\n\t\tfilterMode: 'Regular',\n\t},\n};\n\nexport const hooksGenerateNodesPanelEvent = () => {\n\treturn {\n\t\teventName: 'User entered nodes panel search term',\n\t\tproperties: {\n\t\t\tsearch_string: nodesPanelSession.data.nodeFilter,\n\t\t\tresults_count: nodesPanelSession.data.resultsNodes.length,\n\t\t\tresults_nodes: nodesPanelSession.data.resultsNodes,\n\t\t\tfilter_mode: nodesPanelSession.data.filterMode,\n\t\t\tnodes_panel_session_id: nodesPanelSession.pushRef,\n\t\t},\n\t};\n};\n\nexport const hooksResetNodesPanelSession = () => {\n\tnodesPanelSession.pushRef = `nodes_panel_session_${new Date().valueOf()}`;\n\tnodesPanelSession.data = {\n\t\tnodeFilter: '',\n\t\tresultsNodes: [],\n\t\tfilterMode: 'Regular',\n\t};\n};\n","import { deepCopy } from 'n8n-workflow';\nimport type {\n\tExecutionError,\n\tGenericValue,\n\tINodeProperties,\n\tITelemetryTrackProperties,\n\tNodeParameterValue,\n\tINode,\n} from 'n8n-workflow';\nimport { useNDVStore } from '@/stores/ndv.store';\nimport type { TelemetryEventData } from '@/hooks/types';\nimport type { INodeUi } from '@/Interface';\nimport { useWorkflowsStore } from '@/stores/workflows.store';\nimport { useRootStore } from '@/stores/root.store';\n\nexport interface UserSavedCredentialsEventData {\n\tcredential_type: string;\n\tcredential_id: string;\n\tis_new: boolean;\n}\n\nexport const getUserSavedCredentialsEventData = (meta: UserSavedCredentialsEventData) => {\n\tconst rootStore = useRootStore();\n\tconst workflowsStore = useWorkflowsStore();\n\n\treturn {\n\t\teventName: 'User saved credentials',\n\t\tproperties: {\n\t\t\tinstance_id: rootStore.instanceId,\n\t\t\tcredential_type: meta.credential_type,\n\t\t\tcredential_id: meta.credential_id,\n\t\t\tworkflow_id: workflowsStore.workflowId,\n\t\t\tnode_type: workflowsStore.activeNode?.name,\n\t\t\tis_new: meta.is_new,\n\t\t\t// is_complete: true,\n\t\t\t// is_valid: true,\n\t\t\t// error_message: ''\n\t\t},\n\t};\n};\n\nexport const getOpenWorkflowSettingsEventData = (): TelemetryEventData => {\n\tconst workflowsStore = useWorkflowsStore();\n\n\treturn {\n\t\teventName: 'User opened workflow settings',\n\t\tproperties: {\n\t\t\tworkflow_id: workflowsStore.workflowId,\n\t\t\tworkflow_name: workflowsStore.workflowName,\n\t\t\tcurrent_settings: deepCopy(workflowsStore.workflowSettings),\n\t\t},\n\t};\n};\n\nexport interface UpdatedWorkflowSettingsEventData {\n\toldSettings: Record<string, unknown>;\n}\n\nexport const getUpdatedWorkflowSettingsEventData = (\n\tmeta: UpdatedWorkflowSettingsEventData,\n): TelemetryEventData => {\n\tconst workflowsStore = useWorkflowsStore();\n\n\treturn {\n\t\teventName: 'User updated workflow settings',\n\t\tproperties: {\n\t\t\tworkflow_id: workflowsStore.workflowId,\n\t\t\tworkflow_name: workflowsStore.workflowName,\n\t\t\tnew_settings: deepCopy(workflowsStore.workflowSettings),\n\t\t\told_settings: meta.oldSettings,\n\t\t},\n\t};\n};\n\nexport interface NodeTypeChangedEventData {\n\tnodeSubtitle?: string;\n}\n\nexport const getNodeTypeChangedEventData = (meta: NodeTypeChangedEventData): TelemetryEventData => {\n\tconst store = useNDVStore();\n\n\treturn {\n\t\teventName: 'User opened node modal',\n\t\tproperties: {\n\t\t\tnode_name: store.activeNode?.name,\n\t\t\tnode_subtitle: meta.nodeSubtitle,\n\t\t},\n\t};\n};\n\nexport interface InsertedItemFromExpEditorEventData {\n\tparameter: {\n\t\tdisplayName: string;\n\t};\n\tvalue: string;\n\tselectedItem: {\n\t\tvariable: string;\n\t};\n}\n\nexport const getInsertedItemFromExpEditorEventData = (\n\tmeta: InsertedItemFromExpEditorEventData,\n): TelemetryEventData => {\n\tconst store = useNDVStore();\n\n\treturn {\n\t\teventName: 'User inserted item from Expression Editor variable selector',\n\t\tproperties: {\n\t\t\tnode_name: store.activeNode?.name,\n\t\t\tnode_type: store.activeNode?.type.split('.')[1],\n\t\t\tparameter_name: meta.parameter.displayName,\n\t\t\tvariable_expression: meta.selectedItem.variable,\n\t\t} as ITelemetryTrackProperties,\n\t};\n};\n\nexport interface ExpressionEditorEventsData {\n\tdialogVisible: boolean;\n\tvalue: string;\n\tresolvedExpressionValue: string;\n\tparameter: INodeProperties;\n}\n\nexport const getExpressionEditorEventsData = (\n\tmeta: ExpressionEditorEventsData,\n\tisValueDefault: boolean,\n): TelemetryEventData => {\n\tconst store = useNDVStore();\n\tconst eventData: TelemetryEventData = {\n\t\teventName: '',\n\t\tproperties: {},\n\t};\n\n\tif (!meta.dialogVisible) {\n\t\teventData.eventName = 'User closed Expression Editor';\n\t\teventData.properties = {\n\t\t\tempty_expression: isValueDefault,\n\t\t\texpression_value: meta.value,\n\t\t\texpression_result: meta.resolvedExpressionValue.slice(1),\n\t\t};\n\t} else {\n\t\teventData.eventName = 'User opened Expression Editor';\n\t\teventData.properties = {\n\t\t\tnode_name: store.activeNode?.name,\n\t\t\tnode_type: store.activeNode?.type.split('.')[1],\n\t\t\tparameter_name: meta.parameter.displayName,\n\t\t\tparameter_field_type: meta.parameter.type,\n\t\t\tnew_expression: isValueDefault,\n\t\t};\n\t}\n\treturn eventData;\n};\n\nexport interface AuthenticationModalEventData {\n\tparameterPath: string;\n\toldNodeParameters: Record<string, GenericValue>;\n\tparameters: INodeProperties[];\n\tnewValue: NodeParameterValue;\n}\nexport const getAuthenticationModalEventData = (\n\tmeta: AuthenticationModalEventData,\n): TelemetryEventData => {\n\tconst store = useNDVStore();\n\n\treturn {\n\t\teventName: 'User changed Authentication type from node modal',\n\t\tproperties: {\n\t\t\tnode_name: store.activeNode?.name,\n\t\t\tnode_type: store.activeNode?.type.split('.')[1],\n\t\t\told_mode:\n\t\t\t\tmeta.oldNodeParameters.authentication ||\n\t\t\t\t(\n\t\t\t\t\tmeta.parameters.find((param) => param.name === 'authentication') || {\n\t\t\t\t\t\tdefault: 'default',\n\t\t\t\t\t}\n\t\t\t\t).default,\n\t\t\tnew_mode: meta.newValue,\n\t\t},\n\t};\n};\n\nexport interface OutputModeChangedEventData {\n\toldValue: string;\n\tnewValue: string;\n}\n\nexport const getOutputModeChangedEventData = (\n\tmeta: OutputModeChangedEventData,\n): TelemetryEventData => {\n\tconst store = useNDVStore();\n\n\treturn {\n\t\teventName: 'User changed node output view mode',\n\t\tproperties: {\n\t\t\told_mode: meta.oldValue,\n\t\t\tnew_mode: meta.newValue,\n\t\t\tnode_name: store.activeNode?.name,\n\t\t\tnode_type: store.activeNode?.type.split('.')[1],\n\t\t},\n\t};\n};\n\nexport interface ExecutionFinishedEventData {\n\trunDataExecutedStartData:\n\t\t| { destinationNode?: string | undefined; runNodeFilter?: string[] | undefined }\n\t\t| undefined;\n\tnodeName?: string;\n\terrorMessage: string;\n\tresultDataError: ExecutionError | undefined;\n\titemsCount: number;\n}\n\nexport const getExecutionFinishedEventData = (\n\tmeta: ExecutionFinishedEventData,\n): TelemetryEventData => {\n\tconst store = useWorkflowsStore();\n\n\tconst eventData: TelemetryEventData = {\n\t\teventName: '',\n\t\tproperties: {\n\t\t\texecution_id: store.activeExecutionId,\n\t\t},\n\t};\n\n\tif (meta.runDataExecutedStartData?.destinationNode) {\n\t\teventData.eventName = 'Node execution finished';\n\t\teventData.properties!.node_type = store.getNodeByName(meta.nodeName || '')?.type.split('.')[1];\n\t\teventData.properties!.node_name = meta.nodeName;\n\t} else {\n\t\teventData.eventName = 'Manual workflow execution finished';\n\t\teventData.properties!.workflow_id = store.workflowId;\n\t\teventData.properties!.workflow_name = store.workflowName;\n\t}\n\n\tif (meta.errorMessage || meta.resultDataError) {\n\t\teventData.properties!.status = 'failed';\n\t\teventData.properties!.error_message = meta.resultDataError?.message || '';\n\t\teventData.properties!.error_stack = meta.resultDataError?.stack || '';\n\t\teventData.properties!.error_ui_message = meta.errorMessage || '';\n\t\teventData.properties!.error_timestamp = new Date();\n\n\t\tif (meta.resultDataError && (meta.resultDataError as unknown as { node: INodeUi })?.node) {\n\t\t\teventData.properties!.error_node =\n\t\t\t\ttypeof (meta.resultDataError as unknown as { node: string })?.node === 'string'\n\t\t\t\t\t? (meta.resultDataError as unknown as { node: string })?.node\n\t\t\t\t\t: (meta.resultDataError as unknown as { node: INodeUi })?.node?.name;\n\t\t} else {\n\t\t\teventData.properties!.error_node = meta.nodeName;\n\t\t}\n\t} else {\n\t\teventData.properties!.status = 'success';\n\t\tif (meta.runDataExecutedStartData?.destinationNode) {\n\t\t\t// Node execution finished\n\t\t\teventData.properties!.items_count = meta.itemsCount || 0;\n\t\t}\n\t}\n\treturn eventData;\n};\n\nexport interface NodeRemovedEventData {\n\tnode: INodeUi;\n}\n\nexport const getNodeRemovedEventData = (meta: NodeRemovedEventData): TelemetryEventData => {\n\tconst workflowsStore = useWorkflowsStore();\n\n\treturn {\n\t\teventName: 'User removed node from workflow canvas',\n\t\tproperties: {\n\t\t\tnode_name: meta.node.name,\n\t\t\tnode_type: meta.node.type,\n\t\t\tnode_disabled: meta.node.disabled,\n\t\t\tworkflow_id: workflowsStore.workflowId,\n\t\t},\n\t};\n};\n\nexport const getNodeEditingFinishedEventData = (\n\tactiveNode: INode | null,\n): TelemetryEventData | undefined => {\n\tswitch (activeNode?.type) {\n\t\tcase 'n8n-nodes-base.httpRequest':\n\t\t\tconst domain = (activeNode.parameters.url as string).split('/')[2];\n\t\t\treturn {\n\t\t\t\teventName: 'User finished httpRequest node editing',\n\t\t\t\tproperties: {\n\t\t\t\t\tmethod: activeNode.parameters.method,\n\t\t\t\t\tdomain,\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'n8n-nodes-base.function':\n\t\t\treturn {\n\t\t\t\teventName: 'User finished function node editing',\n\t\t\t\tproperties: {\n\t\t\t\t\tnode_name: activeNode.name,\n\t\t\t\t\tcode: activeNode.parameters.functionCode,\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'n8n-nodes-base.functionItem':\n\t\t\treturn {\n\t\t\t\teventName: 'User finished functionItem node editing',\n\t\t\t\tproperties: {\n\t\t\t\t\tnode_name: activeNode.name,\n\t\t\t\t\tcode: activeNode.parameters.functionCode,\n\t\t\t\t},\n\t\t\t};\n\t\tdefault:\n\t\t\treturn;\n\t}\n};\n\nexport interface ExecutionStartedEventData {\n\tnodeName?: string;\n\tsource?: string;\n}\n\nexport const getExecutionStartedEventData = (\n\tmeta: ExecutionStartedEventData,\n): TelemetryEventData => {\n\tconst store = useWorkflowsStore();\n\n\tconst eventData: TelemetryEventData = {\n\t\teventName: '',\n\t\tproperties: {\n\t\t\texecution_id: store.activeExecutionId,\n\t\t},\n\t};\n\n\t// node execution\n\tif (meta.nodeName) {\n\t\teventData.eventName = 'User started node execution';\n\t\teventData.properties!.source = 'unknown';\n\t\teventData.properties!.node_type = store.getNodeByName(meta.nodeName)?.type.split('.')[1];\n\t\teventData.properties!.node_name = meta.nodeName;\n\n\t\tif (meta.source === 'RunData.ExecuteNodeButton') {\n\t\t\teventData.properties!.source = 'node_modal';\n\t\t} else if (meta.source === 'Node.executeNode') {\n\t\t\teventData.properties!.source = 'workflow_canvas';\n\t\t}\n\t} else {\n\t\t// workflow execution\n\t\teventData.eventName = 'User started manual workflow execution';\n\t\teventData.properties!.workflow_id = store.workflowId;\n\t\teventData.properties!.workflow_name = store.workflowName;\n\t}\n\n\treturn eventData;\n};\n","import { hooksAddFakeDoorFeatures } from '@/hooks/utils';\nimport {\n\tgetAuthenticationModalEventData,\n\tgetExpressionEditorEventsData,\n\tgetInsertedItemFromExpEditorEventData,\n\tgetNodeTypeChangedEventData,\n\tgetOpenWorkflowSettingsEventData,\n\tgetOutputModeChangedEventData,\n\tgetUpdatedWorkflowSettingsEventData,\n\tgetUserSavedCredentialsEventData,\n\tgetExecutionFinishedEventData,\n\tgetNodeRemovedEventData,\n\tgetNodeEditingFinishedEventData,\n\tgetExecutionStartedEventData,\n} from '@/hooks/segment';\nimport { useNDVStore } from '@/stores/ndv.store';\nimport { useWorkflowsStore } from '@/stores/workflows.store';\nimport {\n\thooksGenerateNodesPanelEvent,\n\thooksResetNodesPanelSession,\n\tnodesPanelSession,\n} from '@/hooks/utils/hooksNodesPanel';\nimport { useSegment } from '@/stores/segment.store';\nimport type { PartialDeep } from 'type-fest';\nimport type { IDataObject } from 'n8n-workflow';\nimport type { INodeUi } from '@/Interface';\nimport type { ExternalHooks } from '@/types';\n\nexport const n8nCloudHooks: PartialDeep<ExternalHooks> = {\n\tapp: {\n\t\tmount: [\n\t\t\t() => {\n\t\t\t\thooksAddFakeDoorFeatures();\n\t\t\t},\n\t\t],\n\t},\n\tnodeView: {\n\t\tmount: [\n\t\t\t() => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tsegmentStore.identify();\n\t\t\t},\n\t\t],\n\t\tcreateNodeActiveChanged: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = {\n\t\t\t\t\tsource: meta.source,\n\t\t\t\t\tnodes_panel_session_id: nodesPanelSession.pushRef,\n\t\t\t\t};\n\n\t\t\t\thooksResetNodesPanelSession();\n\t\t\t\tsegmentStore.track('User opened nodes panel', eventData);\n\t\t\t\tsegmentStore.page('Cloud instance', 'Nodes panel', eventData);\n\t\t\t},\n\t\t],\n\t\taddNodeButton: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = {\n\t\t\t\t\teventName: 'User added node to workflow canvas',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tnode_type: meta.nodeTypeName.split('.')[1],\n\t\t\t\t\t\tnodes_panel_session_id: nodesPanelSession.pushRef,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t},\n\tmain: {\n\t\trouteChange: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst splitPath = meta.to.path.split('/');\n\t\t\t\tif (meta.from.path !== '/' && splitPath[1] === 'workflow') {\n\t\t\t\t\tconst eventData = {\n\t\t\t\t\t\tworkflow_id: splitPath[2],\n\t\t\t\t\t};\n\n\t\t\t\t\tsegmentStore.page('Cloud instance', 'Workflow editor', eventData);\n\t\t\t\t}\n\t\t\t},\n\t\t],\n\t},\n\tcredential: {\n\t\tsaved: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = getUserSavedCredentialsEventData(meta);\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t},\n\tcredentialsEdit: {\n\t\tcredentialTypeChanged: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tif (meta.newValue) {\n\t\t\t\t\tconst eventData = {\n\t\t\t\t\t\teventName: 'User opened Credentials modal',\n\t\t\t\t\t\tproperties: {\n\t\t\t\t\t\t\tsource: meta.setCredentialType === meta.credentialType ? 'node' : 'primary_menu',\n\t\t\t\t\t\t\tnew_credential: !meta.editCredentials,\n\t\t\t\t\t\t\tcredential_type: meta.credentialType,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\n\t\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t\t\tsegmentStore.page('Cloud instance', 'Credentials modal', eventData.properties);\n\t\t\t\t}\n\t\t\t},\n\t\t],\n\t\tcredentialModalOpened: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = {\n\t\t\t\t\teventName: 'User opened Credentials modal',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tsource: meta.activeNode ? 'node' : 'primary_menu',\n\t\t\t\t\t\tnew_credential: !meta.isEditingCredential,\n\t\t\t\t\t\tcredential_type: meta.credentialType,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t\tsegmentStore.page('Cloud instance', 'Credentials modal', eventData.properties);\n\t\t\t},\n\t\t],\n\t},\n\tcredentialsList: {\n\t\tmounted: [\n\t\t\t() => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = {\n\t\t\t\t\teventName: 'User opened global Credentials panel',\n\t\t\t\t};\n\n\t\t\t\tsegmentStore.track(eventData.eventName);\n\t\t\t\tsegmentStore.page('Cloud instance', 'Credentials panel');\n\t\t\t},\n\t\t],\n\t\tdialogVisibleChanged: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tif (meta.dialogVisible) {\n\t\t\t\t\tconst eventData = {\n\t\t\t\t\t\teventName: 'User opened global Credentials panel',\n\t\t\t\t\t};\n\n\t\t\t\t\tsegmentStore.track(eventData.eventName);\n\t\t\t\t\tsegmentStore.page('Cloud instance', 'Credentials panel');\n\t\t\t\t}\n\t\t\t},\n\t\t],\n\t},\n\tworkflowSettings: {\n\t\tdialogVisibleChanged: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tif (meta.dialogVisible) {\n\t\t\t\t\tconst eventData = getOpenWorkflowSettingsEventData();\n\t\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t\t}\n\t\t\t},\n\t\t],\n\t\tsaveSettings: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = getUpdatedWorkflowSettingsEventData(meta);\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t},\n\tdataDisplay: {\n\t\tonDocumentationUrlClick: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = {\n\t\t\t\t\teventName: 'User clicked node modal docs link',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tnode_type: meta.nodeType.name.split('.')[1],\n\t\t\t\t\t\tdocs_link: meta.documentationUrl,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t\tnodeTypeChanged: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst ndvStore = useNDVStore();\n\t\t\t\tconst eventData = getNodeTypeChangedEventData(meta);\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t\tsegmentStore.page('Cloud instance', 'Node modal', {\n\t\t\t\t\tnode: ndvStore.activeNode?.name,\n\t\t\t\t});\n\t\t\t},\n\t\t],\n\t\tnodeEditingFinished: [\n\t\t\t() => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst ndvStore = useNDVStore();\n\t\t\t\tconst workflowsStore = useWorkflowsStore();\n\n\t\t\t\tconst eventData = getNodeEditingFinishedEventData(ndvStore.activeNode);\n\t\t\t\tif (eventData) {\n\t\t\t\t\teventData.properties!.workflow_id = workflowsStore.workflowId;\n\t\t\t\t}\n\n\t\t\t\tif (eventData) {\n\t\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t\t}\n\t\t\t},\n\t\t],\n\t},\n\texecutionsList: {\n\t\topenDialog: [\n\t\t\t() => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = {\n\t\t\t\t\teventName: 'User opened Executions log',\n\t\t\t\t};\n\n\t\t\t\tsegmentStore.track(eventData.eventName);\n\t\t\t\tsegmentStore.page('Cloud instance', 'Executions log');\n\t\t\t},\n\t\t],\n\t},\n\tshowMessage: {\n\t\tshowError: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = {\n\t\t\t\t\teventName: 'Instance FE emitted error',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\terror_title: meta.title,\n\t\t\t\t\t\terror_description: meta.message,\n\t\t\t\t\t\terror_message: meta.errorMessage,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t},\n\texpressionEdit: {\n\t\titemSelected: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = getInsertedItemFromExpEditorEventData(meta);\n\n\t\t\t\tif (meta.selectedItem.variable.startsWith('Object.keys')) {\n\t\t\t\t\teventData.properties!.variable_type = 'Keys';\n\t\t\t\t} else if (meta.selectedItem.variable.startsWith('Object.values')) {\n\t\t\t\t\teventData.properties!.variable_type = 'Values';\n\t\t\t\t} else {\n\t\t\t\t\teventData.properties!.variable_type = 'Raw value';\n\t\t\t\t}\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t\tdialogVisibleChanged: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst currentValue = meta.value?.slice(1) ?? '';\n\t\t\t\tlet isValueDefault = false;\n\n\t\t\t\tswitch (typeof meta.parameter.default) {\n\t\t\t\t\tcase 'boolean':\n\t\t\t\t\t\tisValueDefault =\n\t\t\t\t\t\t\t(currentValue === 'true' && meta.parameter.default) ||\n\t\t\t\t\t\t\t(currentValue === 'false' && !meta.parameter.default);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'string':\n\t\t\t\t\t\tisValueDefault = currentValue === meta.parameter.default;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'number':\n\t\t\t\t\t\tisValueDefault = currentValue === meta.parameter.default.toString();\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tconst eventData = getExpressionEditorEventsData(meta, isValueDefault);\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t},\n\tnodeSettings: {\n\t\tvalueChanged: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tif (meta.parameterPath !== 'authentication') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst eventData = getAuthenticationModalEventData(meta);\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t\tcredentialSelected: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst creds = Object.keys(meta.updateInformation.properties.credentials || {});\n\t\t\t\tif (creds.length < 1) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst eventData = {\n\t\t\t\t\teventName: 'User selected credential from node modal',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tcredential_name: (meta.updateInformation.properties.credentials as IDataObject)[\n\t\t\t\t\t\t\tcreds[0]\n\t\t\t\t\t\t],\n\t\t\t\t\t\tcredential_type: creds[0],\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t},\n\tworkflowRun: {\n\t\trunWorkflow: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = getExecutionStartedEventData(meta);\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t\trunError: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = {\n\t\t\t\t\teventName: meta.nodeName\n\t\t\t\t\t\t? 'Node execution finished'\n\t\t\t\t\t\t: 'Manual workflow execution finished',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tpreflight: 'true',\n\t\t\t\t\t\tstatus: 'failed',\n\t\t\t\t\t\terror_message: meta.errorMessages.join('<br />&nbsp;&nbsp;- '),\n\t\t\t\t\t\terror_timestamp: new Date(),\n\t\t\t\t\t\tnode_name: meta.nodeName,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t},\n\trunData: {\n\t\tdisplayModeChanged: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = getOutputModeChangedEventData(meta);\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t},\n\tpushConnection: {\n\t\texecutionFinished: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = getExecutionFinishedEventData(meta);\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t},\n\tnode: {\n\t\tdeleteNode: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = getNodeRemovedEventData(meta);\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t},\n\tworkflow: {\n\t\tactiveChange: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = {\n\t\t\t\t\teventName: (meta.active && 'User activated workflow') || 'User deactivated workflow',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tworkflow_id: meta.workflowId,\n\t\t\t\t\t\tsource: 'workflow_modal',\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t\tactiveChangeCurrent: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst workflowsStore = useWorkflowsStore();\n\n\t\t\t\tconst eventData = {\n\t\t\t\t\teventName: (meta.active && 'User activated workflow') || 'User deactivated workflow',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tsource: 'main nav',\n\t\t\t\t\t\tworkflow_id: meta.workflowId,\n\t\t\t\t\t\tworkflow_name: workflowsStore.workflowName,\n\t\t\t\t\t\tworkflow_nodes: workflowsStore.allNodes.map((n) => n.type.split('.')[1]),\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t\tafterUpdate: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = {\n\t\t\t\t\teventName: 'User saved workflow',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tworkflow_id: meta.workflowData.id,\n\t\t\t\t\t\tworkflow_name: meta.workflowData.name,\n\t\t\t\t\t\tworkflow_nodes: meta.workflowData.nodes.map((n) => n.type.split('.')[1]),\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t},\n\texecution: {\n\t\topen: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = {\n\t\t\t\t\teventName: 'User opened read-only execution',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tworkflow_id: meta.workflowId,\n\t\t\t\t\t\tworkflow_name: meta.workflowName,\n\t\t\t\t\t\texecution_id: meta.executionId,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t},\n\tnodeCreateList: {\n\t\tdestroyed: [\n\t\t\t() => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tif (\n\t\t\t\t\tnodesPanelSession.data.nodeFilter.length > 0 &&\n\t\t\t\t\tnodesPanelSession.data.nodeFilter !== ''\n\t\t\t\t) {\n\t\t\t\t\tconst eventData = hooksGenerateNodesPanelEvent();\n\n\t\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t\t}\n\t\t\t},\n\t\t],\n\t\tselectedTypeChanged: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = {\n\t\t\t\t\teventName: 'User changed nodes panel filter',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\told_filter: meta.oldValue,\n\t\t\t\t\t\tnew_filter: meta.newValue,\n\t\t\t\t\t\tnodes_panel_session_id: nodesPanelSession.pushRef,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\tnodesPanelSession.data.filterMode = meta.newValue;\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t\tnodeFilterChanged: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tif (meta.newValue.length === 0 && nodesPanelSession.data.nodeFilter.length > 0) {\n\t\t\t\t\tconst eventData = hooksGenerateNodesPanelEvent();\n\n\t\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t\t}\n\n\t\t\t\tif (meta.newValue.length > meta.oldValue.length) {\n\t\t\t\t\tnodesPanelSession.data.nodeFilter = meta.newValue;\n\t\t\t\t\tnodesPanelSession.data.resultsNodes = meta.filteredNodes.map((node) => {\n\t\t\t\t\t\tif ((node as unknown as INodeUi).name) {\n\t\t\t\t\t\t\treturn (node as unknown as INodeUi).name.split('.')[1];\n\t\t\t\t\t\t} else if (node.key) {\n\t\t\t\t\t\t\treturn node.key.split('.')[1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t],\n\t},\n};\n"],"names":["compileFakeDoorFeatures","fakeDoorFeatures","useUIStore","feature","environmentsFeature","FAKE_DOOR_FEATURES","loggingFeature","hooksAddFakeDoorFeatures","store","nodesPanelSession","hooksGenerateNodesPanelEvent","hooksResetNodesPanelSession","getUserSavedCredentialsEventData","meta","rootStore","useRootStore","workflowsStore","useWorkflowsStore","_a","getOpenWorkflowSettingsEventData","deepCopy","getUpdatedWorkflowSettingsEventData","getNodeTypeChangedEventData","useNDVStore","getInsertedItemFromExpEditorEventData","_b","getExpressionEditorEventsData","isValueDefault","eventData","getAuthenticationModalEventData","param","getOutputModeChangedEventData","getExecutionFinishedEventData","_c","_d","_e","_f","_g","_i","_h","_j","getNodeRemovedEventData","getNodeEditingFinishedEventData","activeNode","domain","getExecutionStartedEventData","n8nCloudHooks","useSegment","_","segmentStore","splitPath","ndvStore","currentValue","creds","n","node"],"mappings":"wjCAKO,SAASA,GAAuC,CAEhD,MAAAC,EADQC,IAC8B,iBAAiB,IAAKC,IAAa,CAAE,GAAGA,CAAU,EAAA,EAExFC,EAAsBH,EAAiB,KAC3CE,GAAYA,EAAQ,KAAOE,EAAmB,YAAA,EAE5CD,IACHA,EAAoB,gBAAkB,SACtCA,EAAoB,SAAW,kBAGhC,MAAME,EAAiBL,EAAiB,KACtCE,GAAYA,EAAQ,KAAOE,EAAmB,OAAA,EAEhD,OAAIC,IACHA,EAAe,gBAAkB,SACjCA,EAAe,SAAW,iBAC1BA,EAAe,SAAW,IAGpBL,CACR,CAEO,MAAMM,EAA2B,IAAM,CAC7C,MAAMC,EAAQN,IAEdM,EAAM,iBAA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CAAA,EAEiBA,EAAA,KAAK,WAAaI,EAAK,SAEzCoC,EAAa,MAAMrB,EAAU,UAAWA,EAAU,UAAU,CAC7D,CACD,EACA,kBAAmB,CAClB,CAACoB,EAAGnC,IAAS,CACZ,MAAMoC,EAAeF,IACjB,GAAAlC,EAAK,SAAS,SAAW,GAAKJ,EAAkB,KAAK,WAAW,OAAS,EAAG,CAC/E,MAAMmB,EAAYlB,IAElBuC,EAAa,MAAMrB,EAAU,UAAWA,EAAU,UAAU,CAC7D,CAEIf,EAAK,SAAS,OAASA,EAAK,SAAS,SACtBJ,EAAA,KAAK,WAAaI,EAAK,SACzCJ,EAAkB,KAAK,aAAeI,EAAK,cAAc,IAAK0C,GACxDA,EAA4B,KACxBA,EAA4B,KAAK,MAAM,GAAG,EAAE,CAAC,EAC3CA,EAAK,IACRA,EAAK,IAAI,MAAM,GAAG,EAAE,CAAC,EAEtB,EACP,EAEH,CACD,CACD,CACD"}
1
+ {"version":3,"file":"cloud-B90x0-JC.js","sources":["../../src/hooks/utils/hooksAddFakeDoorFeatures.ts","../../src/hooks/utils/hooksNodesPanel.ts","../../src/hooks/segment/getters.ts","../../src/hooks/cloud.ts"],"sourcesContent":["import { useUIStore } from '@/stores/ui.store';\nimport type { IFakeDoor } from '@/Interface';\nimport { FAKE_DOOR_FEATURES } from '@/constants';\nimport type { BaseTextKey } from '@/plugins/i18n';\n\nexport function compileFakeDoorFeatures(): IFakeDoor[] {\n\tconst store = useUIStore();\n\tconst fakeDoorFeatures: IFakeDoor[] = store.fakeDoorFeatures.map((feature) => ({ ...feature }));\n\n\tconst environmentsFeature = fakeDoorFeatures.find(\n\t\t(feature) => feature.id === FAKE_DOOR_FEATURES.ENVIRONMENTS,\n\t);\n\tif (environmentsFeature) {\n\t\tenvironmentsFeature.actionBoxTitle += '.cloud';\n\t\tenvironmentsFeature.linkURL += '&edition=cloud';\n\t}\n\n\tconst loggingFeature = fakeDoorFeatures.find(\n\t\t(feature) => feature.id === FAKE_DOOR_FEATURES.LOGGING,\n\t);\n\tif (loggingFeature) {\n\t\tloggingFeature.actionBoxTitle += '.cloud';\n\t\tloggingFeature.linkURL += '&edition=cloud';\n\t\tloggingFeature.infoText = '' as BaseTextKey;\n\t}\n\n\treturn fakeDoorFeatures;\n}\n\nexport const hooksAddFakeDoorFeatures = () => {\n\tconst store = useUIStore();\n\n\tstore.fakeDoorFeatures = compileFakeDoorFeatures();\n};\n","export const nodesPanelSession = {\n\tpushRef: '',\n\tdata: {\n\t\tnodeFilter: '',\n\t\tresultsNodes: [] as string[],\n\t\tfilterMode: 'Regular',\n\t},\n};\n\nexport const hooksGenerateNodesPanelEvent = () => {\n\treturn {\n\t\teventName: 'User entered nodes panel search term',\n\t\tproperties: {\n\t\t\tsearch_string: nodesPanelSession.data.nodeFilter,\n\t\t\tresults_count: nodesPanelSession.data.resultsNodes.length,\n\t\t\tresults_nodes: nodesPanelSession.data.resultsNodes,\n\t\t\tfilter_mode: nodesPanelSession.data.filterMode,\n\t\t\tnodes_panel_session_id: nodesPanelSession.pushRef,\n\t\t},\n\t};\n};\n\nexport const hooksResetNodesPanelSession = () => {\n\tnodesPanelSession.pushRef = `nodes_panel_session_${new Date().valueOf()}`;\n\tnodesPanelSession.data = {\n\t\tnodeFilter: '',\n\t\tresultsNodes: [],\n\t\tfilterMode: 'Regular',\n\t};\n};\n","import { deepCopy } from 'n8n-workflow';\nimport type {\n\tExecutionError,\n\tGenericValue,\n\tINodeProperties,\n\tITelemetryTrackProperties,\n\tNodeParameterValue,\n\tINode,\n} from 'n8n-workflow';\nimport { useNDVStore } from '@/stores/ndv.store';\nimport type { TelemetryEventData } from '@/hooks/types';\nimport type { INodeUi } from '@/Interface';\nimport { useWorkflowsStore } from '@/stores/workflows.store';\nimport { useRootStore } from '@/stores/root.store';\n\nexport interface UserSavedCredentialsEventData {\n\tcredential_type: string;\n\tcredential_id: string;\n\tis_new: boolean;\n}\n\nexport const getUserSavedCredentialsEventData = (meta: UserSavedCredentialsEventData) => {\n\tconst rootStore = useRootStore();\n\tconst workflowsStore = useWorkflowsStore();\n\n\treturn {\n\t\teventName: 'User saved credentials',\n\t\tproperties: {\n\t\t\tinstance_id: rootStore.instanceId,\n\t\t\tcredential_type: meta.credential_type,\n\t\t\tcredential_id: meta.credential_id,\n\t\t\tworkflow_id: workflowsStore.workflowId,\n\t\t\tnode_type: workflowsStore.activeNode?.name,\n\t\t\tis_new: meta.is_new,\n\t\t\t// is_complete: true,\n\t\t\t// is_valid: true,\n\t\t\t// error_message: ''\n\t\t},\n\t};\n};\n\nexport const getOpenWorkflowSettingsEventData = (): TelemetryEventData => {\n\tconst workflowsStore = useWorkflowsStore();\n\n\treturn {\n\t\teventName: 'User opened workflow settings',\n\t\tproperties: {\n\t\t\tworkflow_id: workflowsStore.workflowId,\n\t\t\tworkflow_name: workflowsStore.workflowName,\n\t\t\tcurrent_settings: deepCopy(workflowsStore.workflowSettings),\n\t\t},\n\t};\n};\n\nexport interface UpdatedWorkflowSettingsEventData {\n\toldSettings: Record<string, unknown>;\n}\n\nexport const getUpdatedWorkflowSettingsEventData = (\n\tmeta: UpdatedWorkflowSettingsEventData,\n): TelemetryEventData => {\n\tconst workflowsStore = useWorkflowsStore();\n\n\treturn {\n\t\teventName: 'User updated workflow settings',\n\t\tproperties: {\n\t\t\tworkflow_id: workflowsStore.workflowId,\n\t\t\tworkflow_name: workflowsStore.workflowName,\n\t\t\tnew_settings: deepCopy(workflowsStore.workflowSettings),\n\t\t\told_settings: meta.oldSettings,\n\t\t},\n\t};\n};\n\nexport interface NodeTypeChangedEventData {\n\tnodeSubtitle?: string;\n}\n\nexport const getNodeTypeChangedEventData = (meta: NodeTypeChangedEventData): TelemetryEventData => {\n\tconst store = useNDVStore();\n\n\treturn {\n\t\teventName: 'User opened node modal',\n\t\tproperties: {\n\t\t\tnode_name: store.activeNode?.name,\n\t\t\tnode_subtitle: meta.nodeSubtitle,\n\t\t},\n\t};\n};\n\nexport interface InsertedItemFromExpEditorEventData {\n\tparameter: {\n\t\tdisplayName: string;\n\t};\n\tvalue: string;\n\tselectedItem: {\n\t\tvariable: string;\n\t};\n}\n\nexport const getInsertedItemFromExpEditorEventData = (\n\tmeta: InsertedItemFromExpEditorEventData,\n): TelemetryEventData => {\n\tconst store = useNDVStore();\n\n\treturn {\n\t\teventName: 'User inserted item from Expression Editor variable selector',\n\t\tproperties: {\n\t\t\tnode_name: store.activeNode?.name,\n\t\t\tnode_type: store.activeNode?.type.split('.')[1],\n\t\t\tparameter_name: meta.parameter.displayName,\n\t\t\tvariable_expression: meta.selectedItem.variable,\n\t\t} as ITelemetryTrackProperties,\n\t};\n};\n\nexport interface ExpressionEditorEventsData {\n\tdialogVisible: boolean;\n\tvalue: string;\n\tresolvedExpressionValue: string;\n\tparameter: INodeProperties;\n}\n\nexport const getExpressionEditorEventsData = (\n\tmeta: ExpressionEditorEventsData,\n\tisValueDefault: boolean,\n): TelemetryEventData => {\n\tconst store = useNDVStore();\n\tconst eventData: TelemetryEventData = {\n\t\teventName: '',\n\t\tproperties: {},\n\t};\n\n\tif (!meta.dialogVisible) {\n\t\teventData.eventName = 'User closed Expression Editor';\n\t\teventData.properties = {\n\t\t\tempty_expression: isValueDefault,\n\t\t\texpression_value: meta.value,\n\t\t\texpression_result: meta.resolvedExpressionValue.slice(1),\n\t\t};\n\t} else {\n\t\teventData.eventName = 'User opened Expression Editor';\n\t\teventData.properties = {\n\t\t\tnode_name: store.activeNode?.name,\n\t\t\tnode_type: store.activeNode?.type.split('.')[1],\n\t\t\tparameter_name: meta.parameter.displayName,\n\t\t\tparameter_field_type: meta.parameter.type,\n\t\t\tnew_expression: isValueDefault,\n\t\t};\n\t}\n\treturn eventData;\n};\n\nexport interface AuthenticationModalEventData {\n\tparameterPath: string;\n\toldNodeParameters: Record<string, GenericValue>;\n\tparameters: INodeProperties[];\n\tnewValue: NodeParameterValue;\n}\nexport const getAuthenticationModalEventData = (\n\tmeta: AuthenticationModalEventData,\n): TelemetryEventData => {\n\tconst store = useNDVStore();\n\n\treturn {\n\t\teventName: 'User changed Authentication type from node modal',\n\t\tproperties: {\n\t\t\tnode_name: store.activeNode?.name,\n\t\t\tnode_type: store.activeNode?.type.split('.')[1],\n\t\t\told_mode:\n\t\t\t\tmeta.oldNodeParameters.authentication ||\n\t\t\t\t(\n\t\t\t\t\tmeta.parameters.find((param) => param.name === 'authentication') || {\n\t\t\t\t\t\tdefault: 'default',\n\t\t\t\t\t}\n\t\t\t\t).default,\n\t\t\tnew_mode: meta.newValue,\n\t\t},\n\t};\n};\n\nexport interface OutputModeChangedEventData {\n\toldValue: string;\n\tnewValue: string;\n}\n\nexport const getOutputModeChangedEventData = (\n\tmeta: OutputModeChangedEventData,\n): TelemetryEventData => {\n\tconst store = useNDVStore();\n\n\treturn {\n\t\teventName: 'User changed node output view mode',\n\t\tproperties: {\n\t\t\told_mode: meta.oldValue,\n\t\t\tnew_mode: meta.newValue,\n\t\t\tnode_name: store.activeNode?.name,\n\t\t\tnode_type: store.activeNode?.type.split('.')[1],\n\t\t},\n\t};\n};\n\nexport interface ExecutionFinishedEventData {\n\trunDataExecutedStartData:\n\t\t| { destinationNode?: string | undefined; runNodeFilter?: string[] | undefined }\n\t\t| undefined;\n\tnodeName?: string;\n\terrorMessage: string;\n\tresultDataError: ExecutionError | undefined;\n\titemsCount: number;\n}\n\nexport const getExecutionFinishedEventData = (\n\tmeta: ExecutionFinishedEventData,\n): TelemetryEventData => {\n\tconst store = useWorkflowsStore();\n\n\tconst eventData: TelemetryEventData = {\n\t\teventName: '',\n\t\tproperties: {\n\t\t\texecution_id: store.activeExecutionId,\n\t\t},\n\t};\n\n\tif (meta.runDataExecutedStartData?.destinationNode) {\n\t\teventData.eventName = 'Node execution finished';\n\t\teventData.properties!.node_type = store.getNodeByName(meta.nodeName || '')?.type.split('.')[1];\n\t\teventData.properties!.node_name = meta.nodeName;\n\t} else {\n\t\teventData.eventName = 'Manual workflow execution finished';\n\t\teventData.properties!.workflow_id = store.workflowId;\n\t\teventData.properties!.workflow_name = store.workflowName;\n\t}\n\n\tif (meta.errorMessage || meta.resultDataError) {\n\t\teventData.properties!.status = 'failed';\n\t\teventData.properties!.error_message = meta.resultDataError?.message || '';\n\t\teventData.properties!.error_stack = meta.resultDataError?.stack || '';\n\t\teventData.properties!.error_ui_message = meta.errorMessage || '';\n\t\teventData.properties!.error_timestamp = new Date();\n\n\t\tif (meta.resultDataError && (meta.resultDataError as unknown as { node: INodeUi })?.node) {\n\t\t\teventData.properties!.error_node =\n\t\t\t\ttypeof (meta.resultDataError as unknown as { node: string })?.node === 'string'\n\t\t\t\t\t? (meta.resultDataError as unknown as { node: string })?.node\n\t\t\t\t\t: (meta.resultDataError as unknown as { node: INodeUi })?.node?.name;\n\t\t} else {\n\t\t\teventData.properties!.error_node = meta.nodeName;\n\t\t}\n\t} else {\n\t\teventData.properties!.status = 'success';\n\t\tif (meta.runDataExecutedStartData?.destinationNode) {\n\t\t\t// Node execution finished\n\t\t\teventData.properties!.items_count = meta.itemsCount || 0;\n\t\t}\n\t}\n\treturn eventData;\n};\n\nexport interface NodeRemovedEventData {\n\tnode: INodeUi;\n}\n\nexport const getNodeRemovedEventData = (meta: NodeRemovedEventData): TelemetryEventData => {\n\tconst workflowsStore = useWorkflowsStore();\n\n\treturn {\n\t\teventName: 'User removed node from workflow canvas',\n\t\tproperties: {\n\t\t\tnode_name: meta.node.name,\n\t\t\tnode_type: meta.node.type,\n\t\t\tnode_disabled: meta.node.disabled,\n\t\t\tworkflow_id: workflowsStore.workflowId,\n\t\t},\n\t};\n};\n\nexport const getNodeEditingFinishedEventData = (\n\tactiveNode: INode | null,\n): TelemetryEventData | undefined => {\n\tswitch (activeNode?.type) {\n\t\tcase 'n8n-nodes-base.httpRequest':\n\t\t\tconst domain = (activeNode.parameters.url as string).split('/')[2];\n\t\t\treturn {\n\t\t\t\teventName: 'User finished httpRequest node editing',\n\t\t\t\tproperties: {\n\t\t\t\t\tmethod: activeNode.parameters.method,\n\t\t\t\t\tdomain,\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'n8n-nodes-base.function':\n\t\t\treturn {\n\t\t\t\teventName: 'User finished function node editing',\n\t\t\t\tproperties: {\n\t\t\t\t\tnode_name: activeNode.name,\n\t\t\t\t\tcode: activeNode.parameters.functionCode,\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'n8n-nodes-base.functionItem':\n\t\t\treturn {\n\t\t\t\teventName: 'User finished functionItem node editing',\n\t\t\t\tproperties: {\n\t\t\t\t\tnode_name: activeNode.name,\n\t\t\t\t\tcode: activeNode.parameters.functionCode,\n\t\t\t\t},\n\t\t\t};\n\t\tdefault:\n\t\t\treturn;\n\t}\n};\n\nexport interface ExecutionStartedEventData {\n\tnodeName?: string;\n\tsource?: string;\n}\n\nexport const getExecutionStartedEventData = (\n\tmeta: ExecutionStartedEventData,\n): TelemetryEventData => {\n\tconst store = useWorkflowsStore();\n\n\tconst eventData: TelemetryEventData = {\n\t\teventName: '',\n\t\tproperties: {\n\t\t\texecution_id: store.activeExecutionId,\n\t\t},\n\t};\n\n\t// node execution\n\tif (meta.nodeName) {\n\t\teventData.eventName = 'User started node execution';\n\t\teventData.properties!.source = 'unknown';\n\t\teventData.properties!.node_type = store.getNodeByName(meta.nodeName)?.type.split('.')[1];\n\t\teventData.properties!.node_name = meta.nodeName;\n\n\t\tif (meta.source === 'RunData.ExecuteNodeButton') {\n\t\t\teventData.properties!.source = 'node_modal';\n\t\t} else if (meta.source === 'Node.executeNode') {\n\t\t\teventData.properties!.source = 'workflow_canvas';\n\t\t}\n\t} else {\n\t\t// workflow execution\n\t\teventData.eventName = 'User started manual workflow execution';\n\t\teventData.properties!.workflow_id = store.workflowId;\n\t\teventData.properties!.workflow_name = store.workflowName;\n\t}\n\n\treturn eventData;\n};\n","import { hooksAddFakeDoorFeatures } from '@/hooks/utils';\nimport {\n\tgetAuthenticationModalEventData,\n\tgetExpressionEditorEventsData,\n\tgetInsertedItemFromExpEditorEventData,\n\tgetNodeTypeChangedEventData,\n\tgetOpenWorkflowSettingsEventData,\n\tgetOutputModeChangedEventData,\n\tgetUpdatedWorkflowSettingsEventData,\n\tgetUserSavedCredentialsEventData,\n\tgetExecutionFinishedEventData,\n\tgetNodeRemovedEventData,\n\tgetNodeEditingFinishedEventData,\n\tgetExecutionStartedEventData,\n} from '@/hooks/segment';\nimport { useNDVStore } from '@/stores/ndv.store';\nimport { useWorkflowsStore } from '@/stores/workflows.store';\nimport {\n\thooksGenerateNodesPanelEvent,\n\thooksResetNodesPanelSession,\n\tnodesPanelSession,\n} from '@/hooks/utils/hooksNodesPanel';\nimport { useSegment } from '@/stores/segment.store';\nimport type { PartialDeep } from 'type-fest';\nimport type { IDataObject } from 'n8n-workflow';\nimport type { INodeUi } from '@/Interface';\nimport type { ExternalHooks } from '@/types';\n\nexport const n8nCloudHooks: PartialDeep<ExternalHooks> = {\n\tapp: {\n\t\tmount: [\n\t\t\t() => {\n\t\t\t\thooksAddFakeDoorFeatures();\n\t\t\t},\n\t\t],\n\t},\n\tnodeView: {\n\t\tmount: [\n\t\t\t() => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tsegmentStore.identify();\n\t\t\t},\n\t\t],\n\t\tcreateNodeActiveChanged: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = {\n\t\t\t\t\tsource: meta.source,\n\t\t\t\t\tnodes_panel_session_id: nodesPanelSession.pushRef,\n\t\t\t\t};\n\n\t\t\t\thooksResetNodesPanelSession();\n\t\t\t\tsegmentStore.track('User opened nodes panel', eventData);\n\t\t\t\tsegmentStore.page('Cloud instance', 'Nodes panel', eventData);\n\t\t\t},\n\t\t],\n\t\taddNodeButton: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = {\n\t\t\t\t\teventName: 'User added node to workflow canvas',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tnode_type: meta.nodeTypeName.split('.')[1],\n\t\t\t\t\t\tnodes_panel_session_id: nodesPanelSession.pushRef,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t},\n\tmain: {\n\t\trouteChange: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst splitPath = meta.to.path.split('/');\n\t\t\t\tif (meta.from.path !== '/' && splitPath[1] === 'workflow') {\n\t\t\t\t\tconst eventData = {\n\t\t\t\t\t\tworkflow_id: splitPath[2],\n\t\t\t\t\t};\n\n\t\t\t\t\tsegmentStore.page('Cloud instance', 'Workflow editor', eventData);\n\t\t\t\t}\n\t\t\t},\n\t\t],\n\t},\n\tcredential: {\n\t\tsaved: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = getUserSavedCredentialsEventData(meta);\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t},\n\tcredentialsEdit: {\n\t\tcredentialTypeChanged: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tif (meta.newValue) {\n\t\t\t\t\tconst eventData = {\n\t\t\t\t\t\teventName: 'User opened Credentials modal',\n\t\t\t\t\t\tproperties: {\n\t\t\t\t\t\t\tsource: meta.setCredentialType === meta.credentialType ? 'node' : 'primary_menu',\n\t\t\t\t\t\t\tnew_credential: !meta.editCredentials,\n\t\t\t\t\t\t\tcredential_type: meta.credentialType,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\n\t\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t\t\tsegmentStore.page('Cloud instance', 'Credentials modal', eventData.properties);\n\t\t\t\t}\n\t\t\t},\n\t\t],\n\t\tcredentialModalOpened: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = {\n\t\t\t\t\teventName: 'User opened Credentials modal',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tsource: meta.activeNode ? 'node' : 'primary_menu',\n\t\t\t\t\t\tnew_credential: !meta.isEditingCredential,\n\t\t\t\t\t\tcredential_type: meta.credentialType,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t\tsegmentStore.page('Cloud instance', 'Credentials modal', eventData.properties);\n\t\t\t},\n\t\t],\n\t},\n\tcredentialsList: {\n\t\tmounted: [\n\t\t\t() => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = {\n\t\t\t\t\teventName: 'User opened global Credentials panel',\n\t\t\t\t};\n\n\t\t\t\tsegmentStore.track(eventData.eventName);\n\t\t\t\tsegmentStore.page('Cloud instance', 'Credentials panel');\n\t\t\t},\n\t\t],\n\t\tdialogVisibleChanged: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tif (meta.dialogVisible) {\n\t\t\t\t\tconst eventData = {\n\t\t\t\t\t\teventName: 'User opened global Credentials panel',\n\t\t\t\t\t};\n\n\t\t\t\t\tsegmentStore.track(eventData.eventName);\n\t\t\t\t\tsegmentStore.page('Cloud instance', 'Credentials panel');\n\t\t\t\t}\n\t\t\t},\n\t\t],\n\t},\n\tworkflowSettings: {\n\t\tdialogVisibleChanged: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tif (meta.dialogVisible) {\n\t\t\t\t\tconst eventData = getOpenWorkflowSettingsEventData();\n\t\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t\t}\n\t\t\t},\n\t\t],\n\t\tsaveSettings: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = getUpdatedWorkflowSettingsEventData(meta);\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t},\n\tdataDisplay: {\n\t\tonDocumentationUrlClick: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = {\n\t\t\t\t\teventName: 'User clicked node modal docs link',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tnode_type: meta.nodeType.name.split('.')[1],\n\t\t\t\t\t\tdocs_link: meta.documentationUrl,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t\tnodeTypeChanged: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst ndvStore = useNDVStore();\n\t\t\t\tconst eventData = getNodeTypeChangedEventData(meta);\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t\tsegmentStore.page('Cloud instance', 'Node modal', {\n\t\t\t\t\tnode: ndvStore.activeNode?.name,\n\t\t\t\t});\n\t\t\t},\n\t\t],\n\t\tnodeEditingFinished: [\n\t\t\t() => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst ndvStore = useNDVStore();\n\t\t\t\tconst workflowsStore = useWorkflowsStore();\n\n\t\t\t\tconst eventData = getNodeEditingFinishedEventData(ndvStore.activeNode);\n\t\t\t\tif (eventData) {\n\t\t\t\t\teventData.properties!.workflow_id = workflowsStore.workflowId;\n\t\t\t\t}\n\n\t\t\t\tif (eventData) {\n\t\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t\t}\n\t\t\t},\n\t\t],\n\t},\n\texecutionsList: {\n\t\topenDialog: [\n\t\t\t() => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = {\n\t\t\t\t\teventName: 'User opened Executions log',\n\t\t\t\t};\n\n\t\t\t\tsegmentStore.track(eventData.eventName);\n\t\t\t\tsegmentStore.page('Cloud instance', 'Executions log');\n\t\t\t},\n\t\t],\n\t},\n\tshowMessage: {\n\t\tshowError: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = {\n\t\t\t\t\teventName: 'Instance FE emitted error',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\terror_title: meta.title,\n\t\t\t\t\t\terror_description: meta.message,\n\t\t\t\t\t\terror_message: meta.errorMessage,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t},\n\texpressionEdit: {\n\t\titemSelected: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = getInsertedItemFromExpEditorEventData(meta);\n\n\t\t\t\tif (meta.selectedItem.variable.startsWith('Object.keys')) {\n\t\t\t\t\teventData.properties!.variable_type = 'Keys';\n\t\t\t\t} else if (meta.selectedItem.variable.startsWith('Object.values')) {\n\t\t\t\t\teventData.properties!.variable_type = 'Values';\n\t\t\t\t} else {\n\t\t\t\t\teventData.properties!.variable_type = 'Raw value';\n\t\t\t\t}\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t\tdialogVisibleChanged: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst currentValue = meta.value?.slice(1) ?? '';\n\t\t\t\tlet isValueDefault = false;\n\n\t\t\t\tswitch (typeof meta.parameter.default) {\n\t\t\t\t\tcase 'boolean':\n\t\t\t\t\t\tisValueDefault =\n\t\t\t\t\t\t\t(currentValue === 'true' && meta.parameter.default) ||\n\t\t\t\t\t\t\t(currentValue === 'false' && !meta.parameter.default);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'string':\n\t\t\t\t\t\tisValueDefault = currentValue === meta.parameter.default;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'number':\n\t\t\t\t\t\tisValueDefault = currentValue === meta.parameter.default.toString();\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tconst eventData = getExpressionEditorEventsData(meta, isValueDefault);\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t},\n\tnodeSettings: {\n\t\tvalueChanged: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tif (meta.parameterPath !== 'authentication') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst eventData = getAuthenticationModalEventData(meta);\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t\tcredentialSelected: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst creds = Object.keys(meta.updateInformation.properties.credentials || {});\n\t\t\t\tif (creds.length < 1) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst eventData = {\n\t\t\t\t\teventName: 'User selected credential from node modal',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tcredential_name: (meta.updateInformation.properties.credentials as IDataObject)[\n\t\t\t\t\t\t\tcreds[0]\n\t\t\t\t\t\t],\n\t\t\t\t\t\tcredential_type: creds[0],\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t},\n\tworkflowRun: {\n\t\trunWorkflow: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = getExecutionStartedEventData(meta);\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t\trunError: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = {\n\t\t\t\t\teventName: meta.nodeName\n\t\t\t\t\t\t? 'Node execution finished'\n\t\t\t\t\t\t: 'Manual workflow execution finished',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tpreflight: 'true',\n\t\t\t\t\t\tstatus: 'failed',\n\t\t\t\t\t\terror_message: meta.errorMessages.join('<br />&nbsp;&nbsp;- '),\n\t\t\t\t\t\terror_timestamp: new Date(),\n\t\t\t\t\t\tnode_name: meta.nodeName,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t},\n\trunData: {\n\t\tdisplayModeChanged: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = getOutputModeChangedEventData(meta);\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t},\n\tpushConnection: {\n\t\texecutionFinished: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = getExecutionFinishedEventData(meta);\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t},\n\tnode: {\n\t\tdeleteNode: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = getNodeRemovedEventData(meta);\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t},\n\tworkflow: {\n\t\tactiveChange: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = {\n\t\t\t\t\teventName: (meta.active && 'User activated workflow') || 'User deactivated workflow',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tworkflow_id: meta.workflowId,\n\t\t\t\t\t\tsource: 'workflow_modal',\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t\tactiveChangeCurrent: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst workflowsStore = useWorkflowsStore();\n\n\t\t\t\tconst eventData = {\n\t\t\t\t\teventName: (meta.active && 'User activated workflow') || 'User deactivated workflow',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tsource: 'main nav',\n\t\t\t\t\t\tworkflow_id: meta.workflowId,\n\t\t\t\t\t\tworkflow_name: workflowsStore.workflowName,\n\t\t\t\t\t\tworkflow_nodes: workflowsStore.allNodes.map((n) => n.type.split('.')[1]),\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t\tafterUpdate: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = {\n\t\t\t\t\teventName: 'User saved workflow',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tworkflow_id: meta.workflowData.id,\n\t\t\t\t\t\tworkflow_name: meta.workflowData.name,\n\t\t\t\t\t\tworkflow_nodes: meta.workflowData.nodes.map((n) => n.type.split('.')[1]),\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t},\n\texecution: {\n\t\topen: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = {\n\t\t\t\t\teventName: 'User opened read-only execution',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tworkflow_id: meta.workflowId,\n\t\t\t\t\t\tworkflow_name: meta.workflowName,\n\t\t\t\t\t\texecution_id: meta.executionId,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t},\n\tnodeCreateList: {\n\t\tdestroyed: [\n\t\t\t() => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tif (\n\t\t\t\t\tnodesPanelSession.data.nodeFilter.length > 0 &&\n\t\t\t\t\tnodesPanelSession.data.nodeFilter !== ''\n\t\t\t\t) {\n\t\t\t\t\tconst eventData = hooksGenerateNodesPanelEvent();\n\n\t\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t\t}\n\t\t\t},\n\t\t],\n\t\tselectedTypeChanged: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tconst eventData = {\n\t\t\t\t\teventName: 'User changed nodes panel filter',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\told_filter: meta.oldValue,\n\t\t\t\t\t\tnew_filter: meta.newValue,\n\t\t\t\t\t\tnodes_panel_session_id: nodesPanelSession.pushRef,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\tnodesPanelSession.data.filterMode = meta.newValue;\n\n\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t},\n\t\t],\n\t\tnodeFilterChanged: [\n\t\t\t(_, meta) => {\n\t\t\t\tconst segmentStore = useSegment();\n\t\t\t\tif (meta.newValue.length === 0 && nodesPanelSession.data.nodeFilter.length > 0) {\n\t\t\t\t\tconst eventData = hooksGenerateNodesPanelEvent();\n\n\t\t\t\t\tsegmentStore.track(eventData.eventName, eventData.properties);\n\t\t\t\t}\n\n\t\t\t\tif (meta.newValue.length > meta.oldValue.length) {\n\t\t\t\t\tnodesPanelSession.data.nodeFilter = meta.newValue;\n\t\t\t\t\tnodesPanelSession.data.resultsNodes = meta.filteredNodes.map((node) => {\n\t\t\t\t\t\tif ((node as unknown as INodeUi).name) {\n\t\t\t\t\t\t\treturn (node as unknown as INodeUi).name.split('.')[1];\n\t\t\t\t\t\t} else if (node.key) {\n\t\t\t\t\t\t\treturn node.key.split('.')[1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t],\n\t},\n};\n"],"names":["compileFakeDoorFeatures","fakeDoorFeatures","useUIStore","feature","environmentsFeature","FAKE_DOOR_FEATURES","loggingFeature","hooksAddFakeDoorFeatures","store","nodesPanelSession","hooksGenerateNodesPanelEvent","hooksResetNodesPanelSession","getUserSavedCredentialsEventData","meta","rootStore","useRootStore","workflowsStore","useWorkflowsStore","_a","getOpenWorkflowSettingsEventData","deepCopy","getUpdatedWorkflowSettingsEventData","getNodeTypeChangedEventData","useNDVStore","getInsertedItemFromExpEditorEventData","_b","getExpressionEditorEventsData","isValueDefault","eventData","getAuthenticationModalEventData","param","getOutputModeChangedEventData","getExecutionFinishedEventData","_c","_d","_e","_f","_g","_i","_h","_j","getNodeRemovedEventData","getNodeEditingFinishedEventData","activeNode","domain","getExecutionStartedEventData","n8nCloudHooks","useSegment","_","segmentStore","splitPath","ndvStore","currentValue","creds","n","node"],"mappings":"wjCAKO,SAASA,GAAuC,CAEhD,MAAAC,EADQC,IAC8B,iBAAiB,IAAKC,IAAa,CAAE,GAAGA,CAAU,EAAA,EAExFC,EAAsBH,EAAiB,KAC3CE,GAAYA,EAAQ,KAAOE,EAAmB,YAAA,EAE5CD,IACHA,EAAoB,gBAAkB,SACtCA,EAAoB,SAAW,kBAGhC,MAAME,EAAiBL,EAAiB,KACtCE,GAAYA,EAAQ,KAAOE,EAAmB,OAAA,EAEhD,OAAIC,IACHA,EAAe,gBAAkB,SACjCA,EAAe,SAAW,iBAC1BA,EAAe,SAAW,IAGpBL,CACR,CAEO,MAAMM,EAA2B,IAAM,CAC7C,MAAMC,EAAQN,IAEdM,EAAM,iBAAmBR,GAC1B,ECjCaS,EAAoB,CAChC,QAAS,GACT,KAAM,CACL,WAAY,GACZ,aAAc,CAAC,EACf,WAAY,SACb,CACD,EAEaC,EAA+B,KACpC,CACN,UAAW,uCACX,WAAY,CACX,cAAeD,EAAkB,KAAK,WACtC,cAAeA,EAAkB,KAAK,aAAa,OACnD,cAAeA,EAAkB,KAAK,aACtC,YAAaA,EAAkB,KAAK,WACpC,uBAAwBA,EAAkB,OAC3C,CAAA,GAIWE,EAA8B,IAAM,CAChDF,EAAkB,QAAU,uBAAuB,IAAI,OAAO,QAAS,CAAA,GACvE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AAK,WAAaI,EAAK,SACzCJ,EAAkB,KAAK,aAAeI,EAAK,cAAc,IAAK0C,GACxDA,EAA4B,KACxBA,EAA4B,KAAK,MAAM,GAAG,EAAE,CAAC,EAC3CA,EAAK,IACRA,EAAK,IAAI,MAAM,GAAG,EAAE,CAAC,EAEtB,EACP,EAEH,CACD,CACD,CACD"}
@@ -1,2 +1,2 @@
1
- import{d as C}from"./pinia-sugP77Im.js";import{R as g,l as T,b as $,T as b,j as I}from"./index-Dtri_pSJ.js";import{e as L,r as s}from"./vendor-Dv5OeN6t.js";const A=C(g.PUSH,()=>{const r=T(),p=$(),u=L(()=>r.pushRef),e=s(null),l=s(null),f=s(0),w=s(!1),c=s([]),i=s(!1),a=s([]),n=t=>(a.value.push(t),()=>{const o=a.value.indexOf(t);o!==-1&&a.value.splice(o,1)});function v(){h(),f.value++,l.value=setTimeout(R,Math.min(f.value*2e3,8*b.SECOND))}function h(){e.value!==null&&(e.value.removeEventListener("error",v),e.value.removeEventListener("close",v),e.value.removeEventListener("message",E),e.value.readyState<2&&e.value.close(),e.value=null),i.value=!1}function S(){h(),l.value&&(clearTimeout(l.value),l.value=null);const t=p.pushBackend==="websocket",o=r.restUrl,d=`/push?pushRef=${u.value}`;if(t){const{protocol:y,host:W}=window.location,U=o.startsWith("http")?o.replace(/^http/,"ws"):`${y==="https:"?"wss":"ws"}://${W+o}`;e.value=new WebSocket(`${U}${d}`)}else e.value=new EventSource(`${o}${d}`,{withCredentials:!0});e.value.addEventListener("open",k,!1),e.value.addEventListener("message",E,!1),e.value.addEventListener(t?"close":"error",v,!1)}function R(){S()}function m(t){e.value&&"send"in e.value&&e.value.send(JSON.stringify(t))}function k(){var t;if(i.value=!0,f.value=0,w.value=!1,r.setPushConnectionActive(),(t=e.value)==null||t.removeEventListener("open",k),c.value.length){for(const o of c.value)m(o);c.value=[]}}function O(t){if(!i.value){c.value.push(t);return}m(t)}async function E(t){let o;try{o=JSON.parse(t.data)}catch{return}a.value.forEach(d=>d(o))}return{pushRef:u,pushSource:e,isConnectionOpen:i,onMessageReceivedHandlers:a,addEventListener:n,pushConnect:S,pushDisconnect:h,send:O}}),D=C(g.COLLABORATION,()=>{const r=A(),p=I(),u=s({}),e=s(null),l=L(()=>u.value[p.workflowId]??[]);function f(){e.value=r.addEventListener(n=>{if(n.type==="activeWorkflowUsersChanged"){const v=p.workflowId;n.data.workflowId===v&&(u.value[v]=n.data.activeUsers)}})}function w(){typeof e.value=="function"&&e.value()}function c(n){u.value=n}function i(n){r.send({type:"workflowOpened",workflowId:n})}function a(n){r.send({type:"workflowClosed",workflowId:n})}return{usersForWorkflows:u,initialize:f,terminate:w,notifyWorkflowOpened:i,notifyWorkflowClosed:a,workflowUsersUpdated:c,getUsersForCurrentWorkflow:l}});export{A as a,D as u};
2
- //# sourceMappingURL=collaboration.store-Co5wlk8y.js.map
1
+ import{d as C}from"./pinia-sugP77Im.js";import{R as g,l as T,b as $,T as b,j as I}from"./index-BE0Xl-jy.js";import{e as L,r as s}from"./vendor-Dv5OeN6t.js";const A=C(g.PUSH,()=>{const r=T(),p=$(),u=L(()=>r.pushRef),e=s(null),l=s(null),f=s(0),w=s(!1),c=s([]),i=s(!1),a=s([]),n=t=>(a.value.push(t),()=>{const o=a.value.indexOf(t);o!==-1&&a.value.splice(o,1)});function v(){h(),f.value++,l.value=setTimeout(R,Math.min(f.value*2e3,8*b.SECOND))}function h(){e.value!==null&&(e.value.removeEventListener("error",v),e.value.removeEventListener("close",v),e.value.removeEventListener("message",E),e.value.readyState<2&&e.value.close(),e.value=null),i.value=!1}function S(){h(),l.value&&(clearTimeout(l.value),l.value=null);const t=p.pushBackend==="websocket",o=r.restUrl,d=`/push?pushRef=${u.value}`;if(t){const{protocol:y,host:W}=window.location,U=o.startsWith("http")?o.replace(/^http/,"ws"):`${y==="https:"?"wss":"ws"}://${W+o}`;e.value=new WebSocket(`${U}${d}`)}else e.value=new EventSource(`${o}${d}`,{withCredentials:!0});e.value.addEventListener("open",k,!1),e.value.addEventListener("message",E,!1),e.value.addEventListener(t?"close":"error",v,!1)}function R(){S()}function m(t){e.value&&"send"in e.value&&e.value.send(JSON.stringify(t))}function k(){var t;if(i.value=!0,f.value=0,w.value=!1,r.setPushConnectionActive(),(t=e.value)==null||t.removeEventListener("open",k),c.value.length){for(const o of c.value)m(o);c.value=[]}}function O(t){if(!i.value){c.value.push(t);return}m(t)}async function E(t){let o;try{o=JSON.parse(t.data)}catch{return}a.value.forEach(d=>d(o))}return{pushRef:u,pushSource:e,isConnectionOpen:i,onMessageReceivedHandlers:a,addEventListener:n,pushConnect:S,pushDisconnect:h,send:O}}),D=C(g.COLLABORATION,()=>{const r=A(),p=I(),u=s({}),e=s(null),l=L(()=>u.value[p.workflowId]??[]);function f(){e.value=r.addEventListener(n=>{if(n.type==="activeWorkflowUsersChanged"){const v=p.workflowId;n.data.workflowId===v&&(u.value[v]=n.data.activeUsers)}})}function w(){typeof e.value=="function"&&e.value()}function c(n){u.value=n}function i(n){r.send({type:"workflowOpened",workflowId:n})}function a(n){r.send({type:"workflowClosed",workflowId:n})}return{usersForWorkflows:u,initialize:f,terminate:w,notifyWorkflowOpened:i,notifyWorkflowClosed:a,workflowUsersUpdated:c,getUsersForCurrentWorkflow:l}});export{A as a,D as u};
2
+ //# sourceMappingURL=collaboration.store-ElxCV91F.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"collaboration.store-Co5wlk8y.js","sources":["../../src/stores/pushConnection.store.ts","../../src/stores/collaboration.store.ts"],"sourcesContent":["import { defineStore } from 'pinia';\nimport { STORES, TIME } from '@/constants';\nimport { ref, computed } from 'vue';\nimport { useSettingsStore } from './settings.store';\nimport { useRootStore } from './root.store';\nimport type { IPushData } from '../Interface';\n\nexport interface PushState {\n\tpushRef: string;\n\tpushSource: WebSocket | EventSource | null;\n\treconnectTimeout: NodeJS.Timeout | null;\n\tretryTimeout: NodeJS.Timeout | null;\n\tpushMessageQueue: Array<{ event: Event; retriesLeft: number }>;\n\tconnectRetries: number;\n\tlostConnection: boolean;\n\toutgoingQueue: unknown[];\n\tisConnectionOpen: boolean;\n}\n\nexport type OnPushMessageHandler = (event: IPushData) => void;\n\n/**\n * Store for managing a push connection to the server\n */\nexport const usePushConnectionStore = defineStore(STORES.PUSH, () => {\n\tconst rootStore = useRootStore();\n\tconst settingsStore = useSettingsStore();\n\n\tconst pushRef = computed(() => rootStore.pushRef);\n\tconst pushSource = ref<WebSocket | EventSource | null>(null);\n\tconst reconnectTimeout = ref<NodeJS.Timeout | null>(null);\n\tconst connectRetries = ref(0);\n\tconst lostConnection = ref(false);\n\tconst outgoingQueue = ref<unknown[]>([]);\n\tconst isConnectionOpen = ref(false);\n\n\tconst onMessageReceivedHandlers = ref<OnPushMessageHandler[]>([]);\n\n\tconst addEventListener = (handler: OnPushMessageHandler) => {\n\t\tonMessageReceivedHandlers.value.push(handler);\n\t\treturn () => {\n\t\t\tconst index = onMessageReceivedHandlers.value.indexOf(handler);\n\t\t\tif (index !== -1) {\n\t\t\t\tonMessageReceivedHandlers.value.splice(index, 1);\n\t\t\t}\n\t\t};\n\t};\n\n\tfunction onConnectionError() {\n\t\tpushDisconnect();\n\t\tconnectRetries.value++;\n\t\treconnectTimeout.value = setTimeout(\n\t\t\tattemptReconnect,\n\t\t\tMath.min(connectRetries.value * 2000, 8 * TIME.SECOND), // maximum 8 seconds backoff\n\t\t);\n\t}\n\n\t/**\n\t * Close connection to server\n\t */\n\tfunction pushDisconnect() {\n\t\tif (pushSource.value !== null) {\n\t\t\tpushSource.value.removeEventListener('error', onConnectionError);\n\t\t\tpushSource.value.removeEventListener('close', onConnectionError);\n\t\t\tpushSource.value.removeEventListener('message', pushMessageReceived);\n\t\t\tif (pushSource.value.readyState < 2) pushSource.value.close();\n\t\t\tpushSource.value = null;\n\t\t}\n\n\t\tisConnectionOpen.value = false;\n\t}\n\n\t/**\n\t * Connect to server to receive data via a WebSocket or EventSource\n\t */\n\tfunction pushConnect() {\n\t\t// always close the previous connection so that we do not end up with multiple connections\n\t\tpushDisconnect();\n\n\t\tif (reconnectTimeout.value) {\n\t\t\tclearTimeout(reconnectTimeout.value);\n\t\t\treconnectTimeout.value = null;\n\t\t}\n\n\t\tconst useWebSockets = settingsStore.pushBackend === 'websocket';\n\n\t\tconst restUrl = rootStore.restUrl;\n\t\tconst url = `/push?pushRef=${pushRef.value}`;\n\n\t\tif (useWebSockets) {\n\t\t\tconst { protocol, host } = window.location;\n\t\t\tconst baseUrl = restUrl.startsWith('http')\n\t\t\t\t? restUrl.replace(/^http/, 'ws')\n\t\t\t\t: `${protocol === 'https:' ? 'wss' : 'ws'}://${host + restUrl}`;\n\t\t\tpushSource.value = new WebSocket(`${baseUrl}${url}`);\n\t\t} else {\n\t\t\tpushSource.value = new EventSource(`${restUrl}${url}`, { withCredentials: true });\n\t\t}\n\n\t\tpushSource.value.addEventListener('open', onConnectionSuccess, false);\n\t\tpushSource.value.addEventListener('message', pushMessageReceived, false);\n\t\tpushSource.value.addEventListener(useWebSockets ? 'close' : 'error', onConnectionError, false);\n\t}\n\n\tfunction attemptReconnect() {\n\t\tpushConnect();\n\t}\n\n\tfunction serializeAndSend(message: unknown) {\n\t\tif (pushSource.value && 'send' in pushSource.value) {\n\t\t\tpushSource.value.send(JSON.stringify(message));\n\t\t}\n\t}\n\n\tfunction onConnectionSuccess() {\n\t\tisConnectionOpen.value = true;\n\t\tconnectRetries.value = 0;\n\t\tlostConnection.value = false;\n\t\trootStore.setPushConnectionActive();\n\t\tpushSource.value?.removeEventListener('open', onConnectionSuccess);\n\n\t\tif (outgoingQueue.value.length) {\n\t\t\tfor (const message of outgoingQueue.value) {\n\t\t\t\tserializeAndSend(message);\n\t\t\t}\n\t\t\toutgoingQueue.value = [];\n\t\t}\n\t}\n\n\tfunction send(message: unknown) {\n\t\tif (!isConnectionOpen.value) {\n\t\t\toutgoingQueue.value.push(message);\n\t\t\treturn;\n\t\t}\n\t\tserializeAndSend(message);\n\t}\n\n\t/**\n\t * Process a newly received message\n\t */\n\tasync function pushMessageReceived(event: Event) {\n\t\tlet receivedData: IPushData;\n\t\ttry {\n\t\t\t// @ts-ignore\n\t\t\treceivedData = JSON.parse(event.data);\n\t\t} catch (error) {\n\t\t\treturn;\n\t\t}\n\n\t\tonMessageReceivedHandlers.value.forEach((handler) => handler(receivedData));\n\t}\n\n\treturn {\n\t\tpushRef,\n\t\tpushSource,\n\t\tisConnectionOpen,\n\t\tonMessageReceivedHandlers,\n\t\taddEventListener,\n\t\tpushConnect,\n\t\tpushDisconnect,\n\t\tsend,\n\t};\n});\n","import { defineStore } from 'pinia';\nimport { computed, ref } from 'vue';\nimport { useWorkflowsStore } from '@/stores/workflows.store';\nimport { usePushConnectionStore } from '@/stores/pushConnection.store';\nimport { STORES } from '@/constants';\nimport type { IUser } from '@/Interface';\n\ntype ActiveUsersForWorkflows = {\n\t[workflowId: string]: Array<{ user: IUser; lastSeen: string }>;\n};\n\nexport const useCollaborationStore = defineStore(STORES.COLLABORATION, () => {\n\tconst pushStore = usePushConnectionStore();\n\tconst workflowStore = useWorkflowsStore();\n\n\tconst usersForWorkflows = ref<ActiveUsersForWorkflows>({});\n\tconst pushStoreEventListenerRemovalFn = ref<(() => void) | null>(null);\n\n\tconst getUsersForCurrentWorkflow = computed(() => {\n\t\treturn usersForWorkflows.value[workflowStore.workflowId] ?? [];\n\t});\n\n\tfunction initialize() {\n\t\tpushStoreEventListenerRemovalFn.value = pushStore.addEventListener((event) => {\n\t\t\tif (event.type === 'activeWorkflowUsersChanged') {\n\t\t\t\tconst activeWorkflowId = workflowStore.workflowId;\n\t\t\t\tif (event.data.workflowId === activeWorkflowId) {\n\t\t\t\t\tusersForWorkflows.value[activeWorkflowId] = event.data.activeUsers;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tfunction terminate() {\n\t\tif (typeof pushStoreEventListenerRemovalFn.value === 'function') {\n\t\t\tpushStoreEventListenerRemovalFn.value();\n\t\t}\n\t}\n\n\tfunction workflowUsersUpdated(data: ActiveUsersForWorkflows) {\n\t\tusersForWorkflows.value = data;\n\t}\n\n\tfunction notifyWorkflowOpened(workflowId: string) {\n\t\tpushStore.send({\n\t\t\ttype: 'workflowOpened',\n\t\t\tworkflowId,\n\t\t});\n\t}\n\n\tfunction notifyWorkflowClosed(workflowId: string) {\n\t\tpushStore.send({ type: 'workflowClosed', workflowId });\n\t}\n\n\treturn {\n\t\tusersForWorkflows,\n\t\tinitialize,\n\t\tterminate,\n\t\tnotifyWorkflowOpened,\n\t\tnotifyWorkflowClosed,\n\t\tworkflowUsersUpdated,\n\t\tgetUsersForCurrentWorkflow,\n\t};\n});\n"],"names":["usePushConnectionStore","defineStore","STORES","rootStore","useRootStore","settingsStore","useSettingsStore","pushRef","computed","pushSource","ref","reconnectTimeout","connectRetries","lostConnection","outgoingQueue","isConnectionOpen","onMessageReceivedHandlers","addEventListener","handler","index","onConnectionError","pushDisconnect","attemptReconnect","TIME","pushMessageReceived","pushConnect","useWebSockets","restUrl","url","protocol","host","baseUrl","onConnectionSuccess","serializeAndSend","message","_a","send","event","receivedData","useCollaborationStore","pushStore","workflowStore","useWorkflowsStore","usersForWorkflows","pushStoreEventListenerRemovalFn","getUsersForCurrentWorkflow","initialize","activeWorkflowId","terminate","workflowUsersUpdated","data","notifyWorkflowOpened","workflowId","notifyWorkflowClosed"],"mappings":"4JAwBO,MAAMA,EAAyBC,EAAYC,EAAO,KAAM,IAAM,CACpE,MAAMC,EAAYC,IACZC,EAAgBC,IAEhBC,EAAUC,EAAS,IAAML,EAAU,OAAO,EAC1CM,EAAaC,EAAoC,IAAI,EACrDC,EAAmBD,EAA2B,IAAI,EAClDE,EAAiBF,EAAI,CAAC,EACtBG,EAAiBH,EAAI,EAAK,EAC1BI,EAAgBJ,EAAe,CAAA,CAAE,EACjCK,EAAmBL,EAAI,EAAK,EAE5BM,EAA4BN,EAA4B,CAAA,CAAE,EAE1DO,EAAoBC,IACCF,EAAA,MAAM,KAAKE,CAAO,EACrC,IAAM,CACZ,MAAMC,EAAQH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,EAAkB,MAAMI,CAAgB,EAAIV,EAAM,KAAK,YAEzD,CAAA,CACA,CACF,CAEA,SAASW,GAAY,CAChB,OAAOJ,EAAgC,OAAU,YACpDA,EAAgC,MAAM,CAExC,CAEA,SAASK,EAAqBC,EAA+B,CAC5DP,EAAkB,MAAQO,CAC3B,CAEA,SAASC,EAAqBC,EAAoB,CACjDZ,EAAU,KAAK,CACd,KAAM,iBACN,WAAAY,CAAA,CACA,CACF,CAEA,SAASC,EAAqBD,EAAoB,CACjDZ,EAAU,KAAK,CAAE,KAAM,iBAAkB,WAAAY,CAAY,CAAA,CACtD,CAEO,MAAA,CACN,kBAAAT,EACA,WAAAG,EACA,UAAAE,EACA,qBAAAG,EACA,qBAAAE,EACA,qBAAAJ,EACA,2BAAAJ,CAAA,CAEF,CAAC"}
1
+ {"version":3,"file":"collaboration.store-ElxCV91F.js","sources":["../../src/stores/pushConnection.store.ts","../../src/stores/collaboration.store.ts"],"sourcesContent":["import { defineStore } from 'pinia';\nimport { STORES, TIME } from '@/constants';\nimport { ref, computed } from 'vue';\nimport { useSettingsStore } from './settings.store';\nimport { useRootStore } from './root.store';\nimport type { IPushData } from '../Interface';\n\nexport interface PushState {\n\tpushRef: string;\n\tpushSource: WebSocket | EventSource | null;\n\treconnectTimeout: NodeJS.Timeout | null;\n\tretryTimeout: NodeJS.Timeout | null;\n\tpushMessageQueue: Array<{ event: Event; retriesLeft: number }>;\n\tconnectRetries: number;\n\tlostConnection: boolean;\n\toutgoingQueue: unknown[];\n\tisConnectionOpen: boolean;\n}\n\nexport type OnPushMessageHandler = (event: IPushData) => void;\n\n/**\n * Store for managing a push connection to the server\n */\nexport const usePushConnectionStore = defineStore(STORES.PUSH, () => {\n\tconst rootStore = useRootStore();\n\tconst settingsStore = useSettingsStore();\n\n\tconst pushRef = computed(() => rootStore.pushRef);\n\tconst pushSource = ref<WebSocket | EventSource | null>(null);\n\tconst reconnectTimeout = ref<NodeJS.Timeout | null>(null);\n\tconst connectRetries = ref(0);\n\tconst lostConnection = ref(false);\n\tconst outgoingQueue = ref<unknown[]>([]);\n\tconst isConnectionOpen = ref(false);\n\n\tconst onMessageReceivedHandlers = ref<OnPushMessageHandler[]>([]);\n\n\tconst addEventListener = (handler: OnPushMessageHandler) => {\n\t\tonMessageReceivedHandlers.value.push(handler);\n\t\treturn () => {\n\t\t\tconst index = onMessageReceivedHandlers.value.indexOf(handler);\n\t\t\tif (index !== -1) {\n\t\t\t\tonMessageReceivedHandlers.value.splice(index, 1);\n\t\t\t}\n\t\t};\n\t};\n\n\tfunction onConnectionError() {\n\t\tpushDisconnect();\n\t\tconnectRetries.value++;\n\t\treconnectTimeout.value = setTimeout(\n\t\t\tattemptReconnect,\n\t\t\tMath.min(connectRetries.value * 2000, 8 * TIME.SECOND), // maximum 8 seconds backoff\n\t\t);\n\t}\n\n\t/**\n\t * Close connection to server\n\t */\n\tfunction pushDisconnect() {\n\t\tif (pushSource.value !== null) {\n\t\t\tpushSource.value.removeEventListener('error', onConnectionError);\n\t\t\tpushSource.value.removeEventListener('close', onConnectionError);\n\t\t\tpushSource.value.removeEventListener('message', pushMessageReceived);\n\t\t\tif (pushSource.value.readyState < 2) pushSource.value.close();\n\t\t\tpushSource.value = null;\n\t\t}\n\n\t\tisConnectionOpen.value = false;\n\t}\n\n\t/**\n\t * Connect to server to receive data via a WebSocket or EventSource\n\t */\n\tfunction pushConnect() {\n\t\t// always close the previous connection so that we do not end up with multiple connections\n\t\tpushDisconnect();\n\n\t\tif (reconnectTimeout.value) {\n\t\t\tclearTimeout(reconnectTimeout.value);\n\t\t\treconnectTimeout.value = null;\n\t\t}\n\n\t\tconst useWebSockets = settingsStore.pushBackend === 'websocket';\n\n\t\tconst restUrl = rootStore.restUrl;\n\t\tconst url = `/push?pushRef=${pushRef.value}`;\n\n\t\tif (useWebSockets) {\n\t\t\tconst { protocol, host } = window.location;\n\t\t\tconst baseUrl = restUrl.startsWith('http')\n\t\t\t\t? restUrl.replace(/^http/, 'ws')\n\t\t\t\t: `${protocol === 'https:' ? 'wss' : 'ws'}://${host + restUrl}`;\n\t\t\tpushSource.value = new WebSocket(`${baseUrl}${url}`);\n\t\t} else {\n\t\t\tpushSource.value = new EventSource(`${restUrl}${url}`, { withCredentials: true });\n\t\t}\n\n\t\tpushSource.value.addEventListener('open', onConnectionSuccess, false);\n\t\tpushSource.value.addEventListener('message', pushMessageReceived, false);\n\t\tpushSource.value.addEventListener(useWebSockets ? 'close' : 'error', onConnectionError, false);\n\t}\n\n\tfunction attemptReconnect() {\n\t\tpushConnect();\n\t}\n\n\tfunction serializeAndSend(message: unknown) {\n\t\tif (pushSource.value && 'send' in pushSource.value) {\n\t\t\tpushSource.value.send(JSON.stringify(message));\n\t\t}\n\t}\n\n\tfunction onConnectionSuccess() {\n\t\tisConnectionOpen.value = true;\n\t\tconnectRetries.value = 0;\n\t\tlostConnection.value = false;\n\t\trootStore.setPushConnectionActive();\n\t\tpushSource.value?.removeEventListener('open', onConnectionSuccess);\n\n\t\tif (outgoingQueue.value.length) {\n\t\t\tfor (const message of outgoingQueue.value) {\n\t\t\t\tserializeAndSend(message);\n\t\t\t}\n\t\t\toutgoingQueue.value = [];\n\t\t}\n\t}\n\n\tfunction send(message: unknown) {\n\t\tif (!isConnectionOpen.value) {\n\t\t\toutgoingQueue.value.push(message);\n\t\t\treturn;\n\t\t}\n\t\tserializeAndSend(message);\n\t}\n\n\t/**\n\t * Process a newly received message\n\t */\n\tasync function pushMessageReceived(event: Event) {\n\t\tlet receivedData: IPushData;\n\t\ttry {\n\t\t\t// @ts-ignore\n\t\t\treceivedData = JSON.parse(event.data);\n\t\t} catch (error) {\n\t\t\treturn;\n\t\t}\n\n\t\tonMessageReceivedHandlers.value.forEach((handler) => handler(receivedData));\n\t}\n\n\treturn {\n\t\tpushRef,\n\t\tpushSource,\n\t\tisConnectionOpen,\n\t\tonMessageReceivedHandlers,\n\t\taddEventListener,\n\t\tpushConnect,\n\t\tpushDisconnect,\n\t\tsend,\n\t};\n});\n","import { defineStore } from 'pinia';\nimport { computed, ref } from 'vue';\nimport { useWorkflowsStore } from '@/stores/workflows.store';\nimport { usePushConnectionStore } from '@/stores/pushConnection.store';\nimport { STORES } from '@/constants';\nimport type { IUser } from '@/Interface';\n\ntype ActiveUsersForWorkflows = {\n\t[workflowId: string]: Array<{ user: IUser; lastSeen: string }>;\n};\n\nexport const useCollaborationStore = defineStore(STORES.COLLABORATION, () => {\n\tconst pushStore = usePushConnectionStore();\n\tconst workflowStore = useWorkflowsStore();\n\n\tconst usersForWorkflows = ref<ActiveUsersForWorkflows>({});\n\tconst pushStoreEventListenerRemovalFn = ref<(() => void) | null>(null);\n\n\tconst getUsersForCurrentWorkflow = computed(() => {\n\t\treturn usersForWorkflows.value[workflowStore.workflowId] ?? [];\n\t});\n\n\tfunction initialize() {\n\t\tpushStoreEventListenerRemovalFn.value = pushStore.addEventListener((event) => {\n\t\t\tif (event.type === 'activeWorkflowUsersChanged') {\n\t\t\t\tconst activeWorkflowId = workflowStore.workflowId;\n\t\t\t\tif (event.data.workflowId === activeWorkflowId) {\n\t\t\t\t\tusersForWorkflows.value[activeWorkflowId] = event.data.activeUsers;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tfunction terminate() {\n\t\tif (typeof pushStoreEventListenerRemovalFn.value === 'function') {\n\t\t\tpushStoreEventListenerRemovalFn.value();\n\t\t}\n\t}\n\n\tfunction workflowUsersUpdated(data: ActiveUsersForWorkflows) {\n\t\tusersForWorkflows.value = data;\n\t}\n\n\tfunction notifyWorkflowOpened(workflowId: string) {\n\t\tpushStore.send({\n\t\t\ttype: 'workflowOpened',\n\t\t\tworkflowId,\n\t\t});\n\t}\n\n\tfunction notifyWorkflowClosed(workflowId: string) {\n\t\tpushStore.send({ type: 'workflowClosed', workflowId });\n\t}\n\n\treturn {\n\t\tusersForWorkflows,\n\t\tinitialize,\n\t\tterminate,\n\t\tnotifyWorkflowOpened,\n\t\tnotifyWorkflowClosed,\n\t\tworkflowUsersUpdated,\n\t\tgetUsersForCurrentWorkflow,\n\t};\n});\n"],"names":["usePushConnectionStore","defineStore","STORES","rootStore","useRootStore","settingsStore","useSettingsStore","pushRef","computed","pushSource","ref","reconnectTimeout","connectRetries","lostConnection","outgoingQueue","isConnectionOpen","onMessageReceivedHandlers","addEventListener","handler","index","onConnectionError","pushDisconnect","attemptReconnect","TIME","pushMessageReceived","pushConnect","useWebSockets","restUrl","url","protocol","host","baseUrl","onConnectionSuccess","serializeAndSend","message","_a","send","event","receivedData","useCollaborationStore","pushStore","workflowStore","useWorkflowsStore","usersForWorkflows","pushStoreEventListenerRemovalFn","getUsersForCurrentWorkflow","initialize","activeWorkflowId","terminate","workflowUsersUpdated","data","notifyWorkflowOpened","workflowId","notifyWorkflowClosed"],"mappings":"4JAwBO,MAAMA,EAAyBC,EAAYC,EAAO,KAAM,IAAM,CACpE,MAAMC,EAAYC,IACZC,EAAgBC,IAEhBC,EAAUC,EAAS,IAAML,EAAU,OAAO,EAC1CM,EAAaC,EAAoC,IAAI,EACrDC,EAAmBD,EAA2B,IAAI,EAClDE,EAAiBF,EAAI,CAAC,EACtBG,EAAiBH,EAAI,EAAK,EAC1BI,EAAgBJ,EAAe,CAAA,CAAE,EACjCK,EAAmBL,EAAI,EAAK,EAE5BM,EAA4BN,EAA4B,CAAA,CAAE,EAE1DO,EAAoBC,IACCF,EAAA,MAAM,KAAKE,CAAO,EACrC,IAAM,CACZ,MAAMC,EAAQH,EAA0B,MAAM,QAAQE,CAAO,EACzDC,IAAU,IACaH,EAAA,MAAM,OAAOG,EAAO,CAAC,CAChD,GAIF,SAASC,GAAoB,CACbC,IACAT,EAAA,QACfD,EAAiB,MAAQ,WACxBW,EACA,KAAK,IAAIV,EAAe,MAAQ,IAAM,EAAIW,EAAK,MAAM,CAAA,CAEvD,CAKA,SAASF,GAAiB,CACrBZ,EAAW,QAAU,OACbA,EAAA,MAAM,oBAAoB,QAASW,CAAiB,EACpDX,EAAA,MAAM,oBAAoB,QAASW,C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