@n8n/stores 2.32.2 → 2.33.0

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 (82) hide show
  1. package/dist/cloudPlan.store.cjs +243 -0
  2. package/dist/cloudPlan.store.cjs.map +1 -0
  3. package/dist/cloudPlan.store.d.cts +528 -0
  4. package/dist/cloudPlan.store.d.mts +528 -0
  5. package/dist/cloudPlan.store.mjs +243 -0
  6. package/dist/cloudPlan.store.mjs.map +1 -0
  7. package/dist/constants2.cjs +1 -0
  8. package/dist/constants2.cjs.map +1 -1
  9. package/dist/constants2.d.cts +1 -0
  10. package/dist/constants2.d.mts +1 -0
  11. package/dist/constants2.mjs +1 -0
  12. package/dist/constants2.mjs.map +1 -1
  13. package/dist/invitation.api.cjs +4 -0
  14. package/dist/invitation.api.d.cts +2 -0
  15. package/dist/invitation.api.d.mts +2 -0
  16. package/dist/invitation.api.mjs +3 -0
  17. package/dist/invitation2.api.cjs +26 -0
  18. package/dist/invitation2.api.cjs.map +1 -0
  19. package/dist/invitation2.api.d.cts +30 -0
  20. package/dist/invitation2.api.d.mts +30 -0
  21. package/dist/invitation2.api.mjs +14 -0
  22. package/dist/invitation2.api.mjs.map +1 -0
  23. package/dist/modalOpeners.cjs +0 -0
  24. package/dist/modalOpeners.d.cts +2 -0
  25. package/dist/modalOpeners.d.mts +2 -0
  26. package/dist/modalOpeners.mjs +1 -0
  27. package/dist/modalOpeners2.d.cts +11 -0
  28. package/dist/modalOpeners2.d.mts +11 -0
  29. package/dist/notifications.store.cjs +33 -0
  30. package/dist/notifications.store.cjs.map +1 -0
  31. package/dist/notifications.store.d.cts +36 -0
  32. package/dist/notifications.store.d.mts +36 -0
  33. package/dist/notifications.store.mjs +32 -0
  34. package/dist/notifications.store.mjs.map +1 -0
  35. package/dist/onboarding.api.cjs +3 -0
  36. package/dist/onboarding.api.d.cts +7 -0
  37. package/dist/onboarding.api.d.mts +7 -0
  38. package/dist/onboarding.api.mjs +3 -0
  39. package/dist/onboarding2.api.cjs +24 -0
  40. package/dist/onboarding2.api.cjs.map +1 -0
  41. package/dist/onboarding2.api.mjs +18 -0
  42. package/dist/onboarding2.api.mjs.map +1 -0
  43. package/dist/rbac.store.cjs +2 -1
  44. package/dist/rbac.store.cjs.map +1 -1
  45. package/dist/rbac.store.d.cts +18 -18
  46. package/dist/rbac.store.d.mts +1 -1
  47. package/dist/rbac.store.mjs +1 -1
  48. package/dist/roles.store.cjs +88 -0
  49. package/dist/roles.store.cjs.map +1 -0
  50. package/dist/roles.store.d.cts +637 -0
  51. package/dist/roles.store.d.mts +637 -0
  52. package/dist/roles.store.mjs +87 -0
  53. package/dist/roles.store.mjs.map +1 -0
  54. package/dist/settings.store.cjs +6 -0
  55. package/dist/settings.store.d.cts +3795 -0
  56. package/dist/settings.store.d.mts +3795 -0
  57. package/dist/settings.store.mjs +6 -0
  58. package/dist/settings2.store.cjs +387 -0
  59. package/dist/settings2.store.cjs.map +1 -0
  60. package/dist/settings2.store.mjs +348 -0
  61. package/dist/settings2.store.mjs.map +1 -0
  62. package/dist/useAgentRequestStore.cjs +1 -0
  63. package/dist/useAgentRequestStore.cjs.map +1 -1
  64. package/dist/useAgentRequestStore.d.cts +1 -1
  65. package/dist/useAgentRequestStore.d.mts +3 -3
  66. package/dist/useRootStore.cjs +4 -182
  67. package/dist/useRootStore.d.cts +73 -73
  68. package/dist/useRootStore.d.mts +73 -73
  69. package/dist/useRootStore.mjs +4 -182
  70. package/dist/useRootStore2.cjs +189 -0
  71. package/dist/useRootStore2.cjs.map +1 -0
  72. package/dist/useRootStore2.mjs +183 -0
  73. package/dist/useRootStore2.mjs.map +1 -0
  74. package/dist/users.store.cjs +354 -0
  75. package/dist/users.store.cjs.map +1 -0
  76. package/dist/users.store.d.cts +540 -0
  77. package/dist/users.store.d.mts +540 -0
  78. package/dist/users.store.mjs +351 -0
  79. package/dist/users.store.mjs.map +1 -0
  80. package/package.json +14 -8
  81. package/dist/useRootStore.cjs.map +0 -1
  82. package/dist/useRootStore.mjs.map +0 -1
@@ -0,0 +1,243 @@
1
+ import { t as STORES } from "./constants2.mjs";
2
+ import "./metaTagConfig2.mjs";
3
+ import { t as useRootStore } from "./useRootStore2.mjs";
4
+ import { t as useSettingsStore } from "./settings2.store.mjs";
5
+ import * as cloudApi from "@n8n/rest-api-client/api/cloudPlans";
6
+ import { getAdminPanelLoginCode, getCurrentPlan, getCurrentUsage } from "@n8n/rest-api-client/api/cloudPlans";
7
+ import { defineStore } from "pinia";
8
+ import { computed, reactive, ref } from "vue";
9
+
10
+ //#region src/cloudPlan.store.ts
11
+ const CLOUD_TRIAL_CHECK_INTERVAL = 5e3;
12
+ const DEFAULT_STATE = {
13
+ initialized: false,
14
+ data: null,
15
+ usage: null,
16
+ loadingPlan: false
17
+ };
18
+ const useCloudPlanStore = defineStore(STORES.CLOUD_PLAN, () => {
19
+ const rootStore = useRootStore();
20
+ const settingsStore = useSettingsStore();
21
+ const state = reactive(DEFAULT_STATE);
22
+ const currentUserCloudInfo = ref(null);
23
+ const now = ref(Date.now());
24
+ const _isInstanceOwner = ref(() => false);
25
+ const setIsInstanceOwner = (getter) => {
26
+ _isInstanceOwner.value = getter;
27
+ };
28
+ const reset = () => {
29
+ currentUserCloudInfo.value = null;
30
+ state.data = null;
31
+ state.usage = null;
32
+ };
33
+ const userIsTrialing = computed(() => state.data?.userIsTrialing ?? false);
34
+ const bannerConfig = computed(() => state.data?.bannerConfig);
35
+ const bannerForceShow = computed(() => bannerConfig.value?.forceShow === true);
36
+ const isBannerDismissed = computed(() => {
37
+ const dismissed = settingsStore.permanentlyDismissedBanners;
38
+ return dismissed.includes("TRIAL") || dismissed.includes("TRIAL_OVER");
39
+ });
40
+ const shouldShowBanner = computed(() => {
41
+ if (!bannerConfig.value) return false;
42
+ if (!bannerDismissible.value) return true;
43
+ return bannerForceShow.value || !isBannerDismissed.value;
44
+ });
45
+ const bannerTimeLeft = computed(() => ({
46
+ show: !!bannerConfig.value?.timeLeft,
47
+ text: bannerConfig.value?.timeLeft?.text
48
+ }));
49
+ const showExecutions = computed(() => bannerConfig.value?.showExecutions === true);
50
+ const bannerCta = computed(() => ({
51
+ text: bannerConfig.value?.cta?.text ?? "Upgrade Now",
52
+ icon: bannerConfig.value?.cta?.icon ?? "zap",
53
+ size: bannerConfig.value?.cta?.size ?? "small",
54
+ style: bannerConfig.value?.cta?.style ?? "success",
55
+ variant: bannerConfig.value?.cta?.variant,
56
+ href: bannerConfig.value?.cta?.href
57
+ }));
58
+ const bannerIcon = computed(() => bannerConfig.value?.icon);
59
+ const bannerDismissible = computed(() => bannerConfig.value?.dismissible ?? true);
60
+ const currentPlanData = computed(() => state.data);
61
+ const currentUsageData = computed(() => state.usage);
62
+ const selectedApps = computed(() => currentUserCloudInfo.value?.selectedApps);
63
+ const codingSkill = computed(() => {
64
+ const information = currentUserCloudInfo.value?.information;
65
+ if (!information) return 0;
66
+ if (!("which_of_these_do_you_feel_comfortable_doing" in information && information.which_of_these_do_you_feel_comfortable_doing && Array.isArray(information.which_of_these_do_you_feel_comfortable_doing))) return 0;
67
+ return information.which_of_these_do_you_feel_comfortable_doing.length;
68
+ });
69
+ const trialExpired = computed(() => state.data?.userIsTrialing && Date.now() >= new Date(state.data?.expirationDate).getTime());
70
+ const allExecutionsUsed = computed(() => {
71
+ if (!state.usage?.executions || !state.data?.monthlyExecutionsLimit) return false;
72
+ return state.usage?.executions >= state.data?.monthlyExecutionsLimit;
73
+ });
74
+ const hasCloudPlan = computed(() => {
75
+ const { n8nMetadata } = settingsStore.settings;
76
+ const isCloud = Boolean(settingsStore.isCloudDeployment);
77
+ return _isInstanceOwner.value() && isCloud && !!n8nMetadata?.userId;
78
+ });
79
+ const getUserCloudAccount = async () => {
80
+ if (!hasCloudPlan.value) throw new Error("User does not have a cloud plan");
81
+ let cloudUser = null;
82
+ try {
83
+ cloudUser = await cloudApi.getCloudUserInfo(rootStore.restApiContext);
84
+ currentUserCloudInfo.value = cloudUser;
85
+ } catch (error) {
86
+ throw new Error(error.message);
87
+ }
88
+ };
89
+ const getAutoLoginCode = async () => {
90
+ return await getAdminPanelLoginCode(rootStore.restApiContext);
91
+ };
92
+ const getOwnerCurrentPlan = async () => {
93
+ if (!hasCloudPlan.value) throw new Error("User does not have a cloud plan");
94
+ state.loadingPlan = true;
95
+ let plan;
96
+ try {
97
+ plan = await getCurrentPlan(rootStore.restApiContext);
98
+ state.data = plan;
99
+ state.loadingPlan = false;
100
+ } catch (error) {
101
+ state.loadingPlan = false;
102
+ throw new Error(error);
103
+ }
104
+ return plan;
105
+ };
106
+ const getInstanceCurrentUsage = async () => {
107
+ const usage = await getCurrentUsage({
108
+ baseUrl: rootStore.baseUrl,
109
+ pushRef: ""
110
+ });
111
+ state.usage = usage;
112
+ return usage;
113
+ };
114
+ const usageLeft = computed(() => {
115
+ if (!state.data || !state.usage) return {
116
+ workflowsLeft: -1,
117
+ executionsLeft: -1
118
+ };
119
+ return {
120
+ workflowsLeft: state.data.activeWorkflowsLimit - state.usage.activeWorkflows,
121
+ executionsLeft: state.data.monthlyExecutionsLimit - state.usage.executions
122
+ };
123
+ });
124
+ const trialDaysLeft = computed(() => {
125
+ if (!state.data?.expirationDate) return -1;
126
+ const differenceInMs = (/* @__PURE__ */ new Date()).valueOf() - new Date(state.data.expirationDate).valueOf();
127
+ const differenceInDays = Math.floor(differenceInMs / (1e3 * 60 * 60 * 24));
128
+ return Math.ceil(differenceInDays);
129
+ });
130
+ const trialTimeLeft = computed(() => {
131
+ if (!state.data?.expirationDate) return {
132
+ count: 0,
133
+ unit: "days"
134
+ };
135
+ const msLeft = new Date(state.data.expirationDate).valueOf() - now.value;
136
+ if (msLeft <= 0) return {
137
+ count: 0,
138
+ unit: "minutes"
139
+ };
140
+ const hours = msLeft / (1e3 * 60 * 60);
141
+ if (hours < 1) return {
142
+ count: Math.ceil(msLeft / (1e3 * 60)),
143
+ unit: "minutes"
144
+ };
145
+ else if (hours < 24) return {
146
+ count: Math.ceil(hours),
147
+ unit: "hours"
148
+ };
149
+ else return {
150
+ count: Math.ceil(hours / 24),
151
+ unit: "days"
152
+ };
153
+ });
154
+ const startPollingInstanceUsageData = () => {
155
+ const interval = setInterval(async () => {
156
+ now.value = Date.now();
157
+ try {
158
+ await getInstanceCurrentUsage();
159
+ if (trialExpired.value || allExecutionsUsed.value) {
160
+ clearInterval(interval);
161
+ return;
162
+ }
163
+ } catch {}
164
+ }, CLOUD_TRIAL_CHECK_INTERVAL);
165
+ };
166
+ const checkForCloudPlanData = async () => {
167
+ try {
168
+ await getOwnerCurrentPlan();
169
+ if (!userIsTrialing.value) return;
170
+ await getInstanceCurrentUsage();
171
+ startPollingInstanceUsageData();
172
+ } catch (e) {
173
+ throw new Error(e.message);
174
+ }
175
+ };
176
+ const fetchUserCloudAccount = async () => {
177
+ try {
178
+ await getUserCloudAccount();
179
+ } catch (e) {
180
+ throw new Error(e.message);
181
+ }
182
+ };
183
+ const initialize = async () => {
184
+ if (state.initialized) return;
185
+ try {
186
+ await checkForCloudPlanData();
187
+ } catch (error) {
188
+ console.warn("Error checking for cloud plan data:", error);
189
+ }
190
+ try {
191
+ await fetchUserCloudAccount();
192
+ } catch (error) {
193
+ console.warn("Error fetching user cloud account:", error);
194
+ }
195
+ state.initialized = true;
196
+ };
197
+ const generateCloudDashboardAutoLoginLink = async (data) => {
198
+ const searchParams = new URLSearchParams();
199
+ const adminPanelHost = new URL(window.location.href).host.split(".").slice(1).join(".");
200
+ const { code } = await getAutoLoginCode();
201
+ const linkUrl = `https://${adminPanelHost}/login`;
202
+ searchParams.set("code", code);
203
+ searchParams.set("returnPath", data.redirectionPath);
204
+ return `${linkUrl}?${searchParams.toString()}`;
205
+ };
206
+ return {
207
+ state,
208
+ usageLeft,
209
+ trialDaysLeft,
210
+ trialTimeLeft,
211
+ userIsTrialing,
212
+ currentPlanData,
213
+ currentUsageData,
214
+ trialExpired,
215
+ allExecutionsUsed,
216
+ hasCloudPlan,
217
+ currentUserCloudInfo,
218
+ generateCloudDashboardAutoLoginLink,
219
+ initialize,
220
+ getOwnerCurrentPlan,
221
+ getInstanceCurrentUsage,
222
+ reset,
223
+ checkForCloudPlanData,
224
+ fetchUserCloudAccount,
225
+ getAutoLoginCode,
226
+ selectedApps,
227
+ codingSkill,
228
+ shouldShowBanner,
229
+ bannerConfig,
230
+ bannerForceShow,
231
+ isBannerDismissed,
232
+ bannerTimeLeft,
233
+ showExecutions,
234
+ bannerCta,
235
+ bannerIcon,
236
+ bannerDismissible,
237
+ setIsInstanceOwner
238
+ };
239
+ });
240
+
241
+ //#endregion
242
+ export { useCloudPlanStore };
243
+ //# sourceMappingURL=cloudPlan.store.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloudPlan.store.mjs","names":["DEFAULT_STATE: CloudPlanState","cloudUser: Cloud.UserAccount | null"],"sources":["../src/cloudPlan.store.ts"],"sourcesContent":["import type { Cloud, InstanceUsage } from '@n8n/rest-api-client/api/cloudPlans';\nimport {\n\tgetAdminPanelLoginCode,\n\tgetCurrentPlan,\n\tgetCurrentUsage,\n} from '@n8n/rest-api-client/api/cloudPlans';\nimport * as cloudApi from '@n8n/rest-api-client/api/cloudPlans';\nimport { defineStore } from 'pinia';\nimport { computed, reactive, ref } from 'vue';\n\nimport { STORES } from './constants';\nimport { useSettingsStore } from './settings.store';\nimport { useRootStore } from './useRootStore';\n\nexport interface CloudPlanState {\n\tinitialized: boolean;\n\tdata: Cloud.PlanData | null;\n\tusage: InstanceUsage | null;\n\tloadingPlan: boolean;\n}\n\nconst CLOUD_TRIAL_CHECK_INTERVAL = 5000;\n\nconst DEFAULT_STATE: CloudPlanState = {\n\tinitialized: false,\n\tdata: null,\n\tusage: null,\n\tloadingPlan: false,\n};\n\nexport const useCloudPlanStore = defineStore(STORES.CLOUD_PLAN, () => {\n\tconst rootStore = useRootStore();\n\tconst settingsStore = useSettingsStore();\n\n\tconst state = reactive<CloudPlanState>(DEFAULT_STATE);\n\tconst currentUserCloudInfo = ref<Cloud.UserAccount | null>(null);\n\n\tconst now = ref<number>(Date.now());\n\n\t// Injected by the caller (e.g. editor-ui shim) — returns whether the\n\t// current user is the instance owner. Defaults to `false` so the store\n\t// is safe to use before injection.\n\tconst _isInstanceOwner = ref<() => boolean>(() => false);\n\n\tconst setIsInstanceOwner = (getter: () => boolean) => {\n\t\t_isInstanceOwner.value = getter;\n\t};\n\n\tconst reset = () => {\n\t\tcurrentUserCloudInfo.value = null;\n\t\tstate.data = null;\n\t\tstate.usage = null;\n\t};\n\n\tconst userIsTrialing = computed(() => state.data?.userIsTrialing ?? false);\n\n\tconst bannerConfig = computed(() => state.data?.bannerConfig);\n\n\t// Whether forceShow is enabled - shows banner even if previously dismissed\n\tconst bannerForceShow = computed(() => bannerConfig.value?.forceShow === true);\n\n\t// Check if TRIAL banner was previously dismissed\n\tconst isBannerDismissed = computed(() => {\n\t\tconst dismissed = settingsStore.permanentlyDismissedBanners as string[];\n\t\treturn dismissed.includes('TRIAL') || dismissed.includes('TRIAL_OVER');\n\t});\n\n\t// Whether to show trial banner:\n\t// - bannerConfig must exist (backend wants to show banner)\n\t// - If not dismissible, always show (regardless of previous dismissal)\n\t// - If dismissible: show if forceShow is true OR banner was not previously dismissed\n\tconst shouldShowBanner = computed(() => {\n\t\tif (!bannerConfig.value) return false;\n\t\tif (!bannerDismissible.value) return true;\n\t\treturn bannerForceShow.value || !isBannerDismissed.value;\n\t});\n\n\t// If timeLeft is set, show it; otherwise hide\n\tconst bannerTimeLeft = computed(() => ({\n\t\tshow: !!bannerConfig.value?.timeLeft,\n\t\ttext: bannerConfig.value?.timeLeft?.text,\n\t}));\n\n\t// If showExecutions is true, show the executions section\n\tconst showExecutions = computed(() => bannerConfig.value?.showExecutions === true);\n\n\tconst bannerCta = computed(() => ({\n\t\ttext: bannerConfig.value?.cta?.text ?? 'Upgrade Now',\n\t\ticon: bannerConfig.value?.cta?.icon ?? 'zap',\n\t\tsize: bannerConfig.value?.cta?.size ?? 'small',\n\t\tstyle: bannerConfig.value?.cta?.style ?? 'success',\n\t\tvariant: bannerConfig.value?.cta?.variant,\n\t\thref: bannerConfig.value?.cta?.href,\n\t}));\n\n\t// Banner icon (left side info icon) - undefined means no icon\n\tconst bannerIcon = computed(() => bannerConfig.value?.icon);\n\n\tconst bannerDismissible = computed(() => bannerConfig.value?.dismissible ?? true);\n\n\tconst currentPlanData = computed(() => state.data);\n\n\tconst currentUsageData = computed(() => state.usage);\n\n\tconst selectedApps = computed(() => currentUserCloudInfo.value?.selectedApps);\n\tconst codingSkill = computed(() => {\n\t\tconst information = currentUserCloudInfo.value?.information;\n\t\tif (!information) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tif (\n\t\t\t!(\n\t\t\t\t'which_of_these_do_you_feel_comfortable_doing' in information &&\n\t\t\t\tinformation.which_of_these_do_you_feel_comfortable_doing &&\n\t\t\t\tArray.isArray(information.which_of_these_do_you_feel_comfortable_doing)\n\t\t\t)\n\t\t) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn information.which_of_these_do_you_feel_comfortable_doing.length;\n\t});\n\n\tconst trialExpired = computed(\n\t\t() =>\n\t\t\tstate.data?.userIsTrialing && Date.now() >= new Date(state.data?.expirationDate).getTime(),\n\t);\n\n\tconst allExecutionsUsed = computed(() => {\n\t\tif (!state.usage?.executions || !state.data?.monthlyExecutionsLimit) return false;\n\t\treturn state.usage?.executions >= state.data?.monthlyExecutionsLimit;\n\t});\n\n\tconst hasCloudPlan = computed<boolean>(() => {\n\t\tconst { n8nMetadata } = settingsStore.settings as { n8nMetadata?: { userId?: string } };\n\t\tconst isCloud = Boolean(settingsStore.isCloudDeployment);\n\t\treturn _isInstanceOwner.value() && isCloud && !!n8nMetadata?.userId;\n\t});\n\n\tconst getUserCloudAccount = async () => {\n\t\tif (!hasCloudPlan.value) throw new Error('User does not have a cloud plan');\n\t\tlet cloudUser: Cloud.UserAccount | null = null;\n\t\ttry {\n\t\t\tcloudUser = await cloudApi.getCloudUserInfo(rootStore.restApiContext);\n\t\t\tcurrentUserCloudInfo.value = cloudUser;\n\t\t} catch (error) {\n\t\t\tthrow new Error((error as Error).message);\n\t\t}\n\t};\n\n\tconst getAutoLoginCode = async (): Promise<{ code: string }> => {\n\t\treturn await getAdminPanelLoginCode(rootStore.restApiContext);\n\t};\n\n\tconst getOwnerCurrentPlan = async () => {\n\t\tif (!hasCloudPlan.value) throw new Error('User does not have a cloud plan');\n\t\tstate.loadingPlan = true;\n\t\tlet plan;\n\t\ttry {\n\t\t\tplan = await getCurrentPlan(rootStore.restApiContext);\n\t\t\tstate.data = plan;\n\t\t\tstate.loadingPlan = false;\n\t\t} catch (error) {\n\t\t\tstate.loadingPlan = false;\n\t\t\tthrow new Error(error as string);\n\t\t}\n\n\t\treturn plan;\n\t};\n\n\tconst getInstanceCurrentUsage = async () => {\n\t\tconst usage = await getCurrentUsage({ baseUrl: rootStore.baseUrl, pushRef: '' });\n\t\tstate.usage = usage;\n\t\treturn usage;\n\t};\n\n\tconst usageLeft = computed(() => {\n\t\tif (!state.data || !state.usage) return { workflowsLeft: -1, executionsLeft: -1 };\n\n\t\treturn {\n\t\t\tworkflowsLeft: state.data.activeWorkflowsLimit - state.usage.activeWorkflows,\n\t\t\texecutionsLeft: state.data.monthlyExecutionsLimit - state.usage.executions,\n\t\t};\n\t});\n\n\tconst trialDaysLeft = computed(() => {\n\t\tif (!state.data?.expirationDate) return -1;\n\n\t\tconst differenceInMs = new Date().valueOf() - new Date(state.data.expirationDate).valueOf();\n\n\t\tconst differenceInDays = Math.floor(differenceInMs / (1000 * 60 * 60 * 24));\n\n\t\treturn Math.ceil(differenceInDays);\n\t});\n\n\tconst trialTimeLeft = computed((): { count: number; unit: 'days' | 'hours' | 'minutes' } => {\n\t\tif (!state.data?.expirationDate) {\n\t\t\treturn { count: 0, unit: 'days' };\n\t\t}\n\n\t\tconst msLeft = new Date(state.data.expirationDate).valueOf() - now.value;\n\t\tif (msLeft <= 0) {\n\t\t\treturn { count: 0, unit: 'minutes' };\n\t\t}\n\n\t\tconst hours = msLeft / (1000 * 60 * 60);\n\n\t\tif (hours < 1) {\n\t\t\treturn { count: Math.ceil(msLeft / (1000 * 60)), unit: 'minutes' };\n\t\t} else if (hours < 24) {\n\t\t\treturn { count: Math.ceil(hours), unit: 'hours' };\n\t\t} else {\n\t\t\treturn { count: Math.ceil(hours / 24), unit: 'days' };\n\t\t}\n\t});\n\n\tconst startPollingInstanceUsageData = () => {\n\t\tconst interval = setInterval(async () => {\n\t\t\tnow.value = Date.now();\n\t\t\ttry {\n\t\t\t\tawait getInstanceCurrentUsage();\n\t\t\t\tif (trialExpired.value || allExecutionsUsed.value) {\n\t\t\t\t\tclearInterval(interval);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t// Silently ignore polling errors — the next interval will retry\n\t\t\t}\n\t\t}, CLOUD_TRIAL_CHECK_INTERVAL);\n\t};\n\n\tconst checkForCloudPlanData = async (): Promise<void> => {\n\t\ttry {\n\t\t\tawait getOwnerCurrentPlan();\n\t\t\tif (!userIsTrialing.value) return;\n\t\t\tawait getInstanceCurrentUsage();\n\t\t\tstartPollingInstanceUsageData();\n\t\t} catch (e) {\n\t\t\tthrow new Error((e as Error).message);\n\t\t}\n\t};\n\n\tconst fetchUserCloudAccount = async () => {\n\t\ttry {\n\t\t\tawait getUserCloudAccount();\n\t\t} catch (e) {\n\t\t\tthrow new Error((e as Error).message);\n\t\t}\n\t};\n\n\tconst initialize = async () => {\n\t\tif (state.initialized) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tawait checkForCloudPlanData();\n\t\t} catch (error) {\n\t\t\tconsole.warn('Error checking for cloud plan data:', error);\n\t\t}\n\n\t\ttry {\n\t\t\tawait fetchUserCloudAccount();\n\t\t} catch (error) {\n\t\t\tconsole.warn('Error fetching user cloud account:', error);\n\t\t}\n\n\t\tstate.initialized = true;\n\t};\n\n\tconst generateCloudDashboardAutoLoginLink = async (data: { redirectionPath: string }) => {\n\t\tconst searchParams = new URLSearchParams();\n\n\t\tconst adminPanelHost = new URL(window.location.href).host.split('.').slice(1).join('.');\n\t\tconst { code } = await getAutoLoginCode();\n\t\tconst linkUrl = `https://${adminPanelHost}/login`;\n\t\tsearchParams.set('code', code);\n\t\tsearchParams.set('returnPath', data.redirectionPath);\n\n\t\treturn `${linkUrl}?${searchParams.toString()}`;\n\t};\n\n\treturn {\n\t\tstate,\n\t\tusageLeft,\n\t\ttrialDaysLeft,\n\t\ttrialTimeLeft,\n\t\tuserIsTrialing,\n\t\tcurrentPlanData,\n\t\tcurrentUsageData,\n\t\ttrialExpired,\n\t\tallExecutionsUsed,\n\t\thasCloudPlan,\n\t\tcurrentUserCloudInfo,\n\t\tgenerateCloudDashboardAutoLoginLink,\n\t\tinitialize,\n\t\tgetOwnerCurrentPlan,\n\t\tgetInstanceCurrentUsage,\n\t\treset,\n\t\tcheckForCloudPlanData,\n\t\tfetchUserCloudAccount,\n\t\tgetAutoLoginCode,\n\t\tselectedApps,\n\t\tcodingSkill,\n\t\tshouldShowBanner,\n\t\tbannerConfig,\n\t\tbannerForceShow,\n\t\tisBannerDismissed,\n\t\tbannerTimeLeft,\n\t\tshowExecutions,\n\t\tbannerCta,\n\t\tbannerIcon,\n\t\tbannerDismissible,\n\t\tsetIsInstanceOwner,\n\t};\n});\n"],"mappings":"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"}
@@ -4,6 +4,7 @@ const STORES = {
4
4
  COMMUNITY_NODES: "communityNodes",
5
5
  ROOT: "root",
6
6
  SETTINGS: "settings",
7
+ NOTIFICATIONS: "notifications",
7
8
  UI: "ui",
8
9
  USERS: "users",
9
10
  WORKFLOWS: "workflows",
@@ -1 +1 @@
1
- {"version":3,"file":"constants2.cjs","names":[],"sources":["../src/constants.ts"],"sourcesContent":["export const STORES = {\n\tCOMMUNITY_NODES: 'communityNodes',\n\tROOT: 'root',\n\tSETTINGS: 'settings',\n\tUI: 'ui',\n\tUSERS: 'users',\n\tWORKFLOWS: 'workflows',\n\tWORKFLOWS_LIST: 'workflowsList',\n\tWORKFLOWS_V2: 'workflowsV2',\n\tWORKFLOWS_EE: 'workflowsEE',\n\tWORKFLOW_DOCUMENTS: 'workflowDocuments',\n\tEXECUTION_DATA: 'executionData',\n\tWORKFLOW_EXECUTION_STATES: 'workflowExecutionStates',\n\tEXECUTIONS: 'executions',\n\tNDV: 'ndv',\n\tTEMPLATES: 'templates',\n\tNODE_TYPES: 'nodeTypes',\n\tCREDENTIALS: 'credentials',\n\tTAGS: 'tags',\n\tANNOTATION_TAGS: 'annotationTags',\n\tVERSIONS: 'versions',\n\tNODE_CREATOR: 'nodeCreator',\n\tWEBHOOKS: 'webhooks',\n\tHISTORY: 'history',\n\tCLOUD_PLAN: 'cloudPlan',\n\tRBAC: 'rbac',\n\tPUSH: 'push',\n\tCOLLABORATION: 'collaboration',\n\tASSISTANT: 'assistant',\n\tBUILDER: 'builder',\n\tCHAT_PANEL: 'chatPanel',\n\tCHAT_PANEL_STATE: 'chatPanelState',\n\tBECOME_TEMPLATE_CREATOR: 'becomeTemplateCreator',\n\tPROJECTS: 'projects',\n\tAPI_KEYS: 'apiKeys',\n\tEVALUATION: 'evaluation',\n\tEVAL_COLLECTIONS: 'evalCollections',\n\tFOLDERS: 'folders',\n\tMODULES: 'modules',\n\tFOCUS_PANEL: 'focusPanel',\n\tAI_TEMPLATES_STARTER_COLLECTION: 'aiTemplatesStarterCollection',\n\tPERSONALIZED_TEMPLATES: 'personalizedTemplates',\n\tEXPERIMENT_READY_TO_RUN_WORKFLOWS: 'readyToRunWorkflows',\n\tEXPERIMENT_READY_TO_RUN_WORKFLOWS_V2: 'readyToRunWorkflowsV2',\n\tEXPERIMENT_TEMPLATE_RECO_V2: 'templateRecoV2',\n\tPERSONALIZED_TEMPLATES_V3: 'personalizedTemplatesV3',\n\tREADY_TO_RUN: 'readyToRun',\n\tTEMPLATES_DATA_QUALITY: 'templatesDataQuality',\n\tBANNERS: 'banners',\n\tCONSENT: 'consent',\n\tCHAT_HUB: 'chatHub',\n\tCHAT_HUB_PANEL: 'chatHubPanel',\n\tEXPERIMENT_CREDENTIALS_APP_SELECTION: 'credentialsAppSelection',\n\tEXPERIMENT_SURFACE_MCP_TO_NEW_CLOUD_USERS: 'surfaceMcpToNewCloudUsers',\n\tEXPERIMENT_EXPOSE_ALL_WORKFLOWS_TO_MCP: 'exposeAllWorkflowsToMcp',\n\tSETUP_PANEL: 'setupPanel',\n\tFOCUSED_NODES: 'focusedNodes',\n\tFAVORITES: 'favorites',\n\tAI_GATEWAY: 'aiGateway',\n\tEVALUATIONS_WIZARD_SIDEPANEL: 'evaluationsWizardSidepanel',\n} as const;\n"],"mappings":";;AAAA,MAAa,SAAS;CACrB,iBAAiB;CACjB,MAAM;CACN,UAAU;CACV,IAAI;CACJ,OAAO;CACP,WAAW;CACX,gBAAgB;CAChB,cAAc;CACd,cAAc;CACd,oBAAoB;CACpB,gBAAgB;CAChB,2BAA2B;CAC3B,YAAY;CACZ,KAAK;CACL,WAAW;CACX,YAAY;CACZ,aAAa;CACb,MAAM;CACN,iBAAiB;CACjB,UAAU;CACV,cAAc;CACd,UAAU;CACV,SAAS;CACT,YAAY;CACZ,MAAM;CACN,MAAM;CACN,eAAe;CACf,WAAW;CACX,SAAS;CACT,YAAY;CACZ,kBAAkB;CAClB,yBAAyB;CACzB,UAAU;CACV,UAAU;CACV,YAAY;CACZ,kBAAkB;CAClB,SAAS;CACT,SAAS;CACT,aAAa;CACb,iCAAiC;CACjC,wBAAwB;CACxB,mCAAmC;CACnC,sCAAsC;CACtC,6BAA6B;CAC7B,2BAA2B;CAC3B,cAAc;CACd,wBAAwB;CACxB,SAAS;CACT,SAAS;CACT,UAAU;CACV,gBAAgB;CAChB,sCAAsC;CACtC,2CAA2C;CAC3C,wCAAwC;CACxC,aAAa;CACb,eAAe;CACf,WAAW;CACX,YAAY;CACZ,8BAA8B;CAC9B"}
1
+ {"version":3,"file":"constants2.cjs","names":[],"sources":["../src/constants.ts"],"sourcesContent":["export const STORES = {\n\tCOMMUNITY_NODES: 'communityNodes',\n\tROOT: 'root',\n\tSETTINGS: 'settings',\n\tNOTIFICATIONS: 'notifications',\n\tUI: 'ui',\n\tUSERS: 'users',\n\tWORKFLOWS: 'workflows',\n\tWORKFLOWS_LIST: 'workflowsList',\n\tWORKFLOWS_V2: 'workflowsV2',\n\tWORKFLOWS_EE: 'workflowsEE',\n\tWORKFLOW_DOCUMENTS: 'workflowDocuments',\n\tEXECUTION_DATA: 'executionData',\n\tWORKFLOW_EXECUTION_STATES: 'workflowExecutionStates',\n\tEXECUTIONS: 'executions',\n\tNDV: 'ndv',\n\tTEMPLATES: 'templates',\n\tNODE_TYPES: 'nodeTypes',\n\tCREDENTIALS: 'credentials',\n\tTAGS: 'tags',\n\tANNOTATION_TAGS: 'annotationTags',\n\tVERSIONS: 'versions',\n\tNODE_CREATOR: 'nodeCreator',\n\tWEBHOOKS: 'webhooks',\n\tHISTORY: 'history',\n\tCLOUD_PLAN: 'cloudPlan',\n\tRBAC: 'rbac',\n\tPUSH: 'push',\n\tCOLLABORATION: 'collaboration',\n\tASSISTANT: 'assistant',\n\tBUILDER: 'builder',\n\tCHAT_PANEL: 'chatPanel',\n\tCHAT_PANEL_STATE: 'chatPanelState',\n\tBECOME_TEMPLATE_CREATOR: 'becomeTemplateCreator',\n\tPROJECTS: 'projects',\n\tAPI_KEYS: 'apiKeys',\n\tEVALUATION: 'evaluation',\n\tEVAL_COLLECTIONS: 'evalCollections',\n\tFOLDERS: 'folders',\n\tMODULES: 'modules',\n\tFOCUS_PANEL: 'focusPanel',\n\tAI_TEMPLATES_STARTER_COLLECTION: 'aiTemplatesStarterCollection',\n\tPERSONALIZED_TEMPLATES: 'personalizedTemplates',\n\tEXPERIMENT_READY_TO_RUN_WORKFLOWS: 'readyToRunWorkflows',\n\tEXPERIMENT_READY_TO_RUN_WORKFLOWS_V2: 'readyToRunWorkflowsV2',\n\tEXPERIMENT_TEMPLATE_RECO_V2: 'templateRecoV2',\n\tPERSONALIZED_TEMPLATES_V3: 'personalizedTemplatesV3',\n\tREADY_TO_RUN: 'readyToRun',\n\tTEMPLATES_DATA_QUALITY: 'templatesDataQuality',\n\tBANNERS: 'banners',\n\tCONSENT: 'consent',\n\tCHAT_HUB: 'chatHub',\n\tCHAT_HUB_PANEL: 'chatHubPanel',\n\tEXPERIMENT_CREDENTIALS_APP_SELECTION: 'credentialsAppSelection',\n\tEXPERIMENT_SURFACE_MCP_TO_NEW_CLOUD_USERS: 'surfaceMcpToNewCloudUsers',\n\tEXPERIMENT_EXPOSE_ALL_WORKFLOWS_TO_MCP: 'exposeAllWorkflowsToMcp',\n\tSETUP_PANEL: 'setupPanel',\n\tFOCUSED_NODES: 'focusedNodes',\n\tFAVORITES: 'favorites',\n\tAI_GATEWAY: 'aiGateway',\n\tEVALUATIONS_WIZARD_SIDEPANEL: 'evaluationsWizardSidepanel',\n} as const;\n"],"mappings":";;AAAA,MAAa,SAAS;CACrB,iBAAiB;CACjB,MAAM;CACN,UAAU;CACV,eAAe;CACf,IAAI;CACJ,OAAO;CACP,WAAW;CACX,gBAAgB;CAChB,cAAc;CACd,cAAc;CACd,oBAAoB;CACpB,gBAAgB;CAChB,2BAA2B;CAC3B,YAAY;CACZ,KAAK;CACL,WAAW;CACX,YAAY;CACZ,aAAa;CACb,MAAM;CACN,iBAAiB;CACjB,UAAU;CACV,cAAc;CACd,UAAU;CACV,SAAS;CACT,YAAY;CACZ,MAAM;CACN,MAAM;CACN,eAAe;CACf,WAAW;CACX,SAAS;CACT,YAAY;CACZ,kBAAkB;CAClB,yBAAyB;CACzB,UAAU;CACV,UAAU;CACV,YAAY;CACZ,kBAAkB;CAClB,SAAS;CACT,SAAS;CACT,aAAa;CACb,iCAAiC;CACjC,wBAAwB;CACxB,mCAAmC;CACnC,sCAAsC;CACtC,6BAA6B;CAC7B,2BAA2B;CAC3B,cAAc;CACd,wBAAwB;CACxB,SAAS;CACT,SAAS;CACT,UAAU;CACV,gBAAgB;CAChB,sCAAsC;CACtC,2CAA2C;CAC3C,wCAAwC;CACxC,aAAa;CACb,eAAe;CACf,WAAW;CACX,YAAY;CACZ,8BAA8B;CAC9B"}
@@ -3,6 +3,7 @@ declare const STORES: {
3
3
  readonly COMMUNITY_NODES: "communityNodes";
4
4
  readonly ROOT: "root";
5
5
  readonly SETTINGS: "settings";
6
+ readonly NOTIFICATIONS: "notifications";
6
7
  readonly UI: "ui";
7
8
  readonly USERS: "users";
8
9
  readonly WORKFLOWS: "workflows";
@@ -3,6 +3,7 @@ declare const STORES: {
3
3
  readonly COMMUNITY_NODES: "communityNodes";
4
4
  readonly ROOT: "root";
5
5
  readonly SETTINGS: "settings";
6
+ readonly NOTIFICATIONS: "notifications";
6
7
  readonly UI: "ui";
7
8
  readonly USERS: "users";
8
9
  readonly WORKFLOWS: "workflows";
@@ -3,6 +3,7 @@ const STORES = {
3
3
  COMMUNITY_NODES: "communityNodes",
4
4
  ROOT: "root",
5
5
  SETTINGS: "settings",
6
+ NOTIFICATIONS: "notifications",
6
7
  UI: "ui",
7
8
  USERS: "users",
8
9
  WORKFLOWS: "workflows",
@@ -1 +1 @@
1
- {"version":3,"file":"constants2.mjs","names":[],"sources":["../src/constants.ts"],"sourcesContent":["export const STORES = {\n\tCOMMUNITY_NODES: 'communityNodes',\n\tROOT: 'root',\n\tSETTINGS: 'settings',\n\tUI: 'ui',\n\tUSERS: 'users',\n\tWORKFLOWS: 'workflows',\n\tWORKFLOWS_LIST: 'workflowsList',\n\tWORKFLOWS_V2: 'workflowsV2',\n\tWORKFLOWS_EE: 'workflowsEE',\n\tWORKFLOW_DOCUMENTS: 'workflowDocuments',\n\tEXECUTION_DATA: 'executionData',\n\tWORKFLOW_EXECUTION_STATES: 'workflowExecutionStates',\n\tEXECUTIONS: 'executions',\n\tNDV: 'ndv',\n\tTEMPLATES: 'templates',\n\tNODE_TYPES: 'nodeTypes',\n\tCREDENTIALS: 'credentials',\n\tTAGS: 'tags',\n\tANNOTATION_TAGS: 'annotationTags',\n\tVERSIONS: 'versions',\n\tNODE_CREATOR: 'nodeCreator',\n\tWEBHOOKS: 'webhooks',\n\tHISTORY: 'history',\n\tCLOUD_PLAN: 'cloudPlan',\n\tRBAC: 'rbac',\n\tPUSH: 'push',\n\tCOLLABORATION: 'collaboration',\n\tASSISTANT: 'assistant',\n\tBUILDER: 'builder',\n\tCHAT_PANEL: 'chatPanel',\n\tCHAT_PANEL_STATE: 'chatPanelState',\n\tBECOME_TEMPLATE_CREATOR: 'becomeTemplateCreator',\n\tPROJECTS: 'projects',\n\tAPI_KEYS: 'apiKeys',\n\tEVALUATION: 'evaluation',\n\tEVAL_COLLECTIONS: 'evalCollections',\n\tFOLDERS: 'folders',\n\tMODULES: 'modules',\n\tFOCUS_PANEL: 'focusPanel',\n\tAI_TEMPLATES_STARTER_COLLECTION: 'aiTemplatesStarterCollection',\n\tPERSONALIZED_TEMPLATES: 'personalizedTemplates',\n\tEXPERIMENT_READY_TO_RUN_WORKFLOWS: 'readyToRunWorkflows',\n\tEXPERIMENT_READY_TO_RUN_WORKFLOWS_V2: 'readyToRunWorkflowsV2',\n\tEXPERIMENT_TEMPLATE_RECO_V2: 'templateRecoV2',\n\tPERSONALIZED_TEMPLATES_V3: 'personalizedTemplatesV3',\n\tREADY_TO_RUN: 'readyToRun',\n\tTEMPLATES_DATA_QUALITY: 'templatesDataQuality',\n\tBANNERS: 'banners',\n\tCONSENT: 'consent',\n\tCHAT_HUB: 'chatHub',\n\tCHAT_HUB_PANEL: 'chatHubPanel',\n\tEXPERIMENT_CREDENTIALS_APP_SELECTION: 'credentialsAppSelection',\n\tEXPERIMENT_SURFACE_MCP_TO_NEW_CLOUD_USERS: 'surfaceMcpToNewCloudUsers',\n\tEXPERIMENT_EXPOSE_ALL_WORKFLOWS_TO_MCP: 'exposeAllWorkflowsToMcp',\n\tSETUP_PANEL: 'setupPanel',\n\tFOCUSED_NODES: 'focusedNodes',\n\tFAVORITES: 'favorites',\n\tAI_GATEWAY: 'aiGateway',\n\tEVALUATIONS_WIZARD_SIDEPANEL: 'evaluationsWizardSidepanel',\n} as const;\n"],"mappings":";AAAA,MAAa,SAAS;CACrB,iBAAiB;CACjB,MAAM;CACN,UAAU;CACV,IAAI;CACJ,OAAO;CACP,WAAW;CACX,gBAAgB;CAChB,cAAc;CACd,cAAc;CACd,oBAAoB;CACpB,gBAAgB;CAChB,2BAA2B;CAC3B,YAAY;CACZ,KAAK;CACL,WAAW;CACX,YAAY;CACZ,aAAa;CACb,MAAM;CACN,iBAAiB;CACjB,UAAU;CACV,cAAc;CACd,UAAU;CACV,SAAS;CACT,YAAY;CACZ,MAAM;CACN,MAAM;CACN,eAAe;CACf,WAAW;CACX,SAAS;CACT,YAAY;CACZ,kBAAkB;CAClB,yBAAyB;CACzB,UAAU;CACV,UAAU;CACV,YAAY;CACZ,kBAAkB;CAClB,SAAS;CACT,SAAS;CACT,aAAa;CACb,iCAAiC;CACjC,wBAAwB;CACxB,mCAAmC;CACnC,sCAAsC;CACtC,6BAA6B;CAC7B,2BAA2B;CAC3B,cAAc;CACd,wBAAwB;CACxB,SAAS;CACT,SAAS;CACT,UAAU;CACV,gBAAgB;CAChB,sCAAsC;CACtC,2CAA2C;CAC3C,wCAAwC;CACxC,aAAa;CACb,eAAe;CACf,WAAW;CACX,YAAY;CACZ,8BAA8B;CAC9B"}
1
+ {"version":3,"file":"constants2.mjs","names":[],"sources":["../src/constants.ts"],"sourcesContent":["export const STORES = {\n\tCOMMUNITY_NODES: 'communityNodes',\n\tROOT: 'root',\n\tSETTINGS: 'settings',\n\tNOTIFICATIONS: 'notifications',\n\tUI: 'ui',\n\tUSERS: 'users',\n\tWORKFLOWS: 'workflows',\n\tWORKFLOWS_LIST: 'workflowsList',\n\tWORKFLOWS_V2: 'workflowsV2',\n\tWORKFLOWS_EE: 'workflowsEE',\n\tWORKFLOW_DOCUMENTS: 'workflowDocuments',\n\tEXECUTION_DATA: 'executionData',\n\tWORKFLOW_EXECUTION_STATES: 'workflowExecutionStates',\n\tEXECUTIONS: 'executions',\n\tNDV: 'ndv',\n\tTEMPLATES: 'templates',\n\tNODE_TYPES: 'nodeTypes',\n\tCREDENTIALS: 'credentials',\n\tTAGS: 'tags',\n\tANNOTATION_TAGS: 'annotationTags',\n\tVERSIONS: 'versions',\n\tNODE_CREATOR: 'nodeCreator',\n\tWEBHOOKS: 'webhooks',\n\tHISTORY: 'history',\n\tCLOUD_PLAN: 'cloudPlan',\n\tRBAC: 'rbac',\n\tPUSH: 'push',\n\tCOLLABORATION: 'collaboration',\n\tASSISTANT: 'assistant',\n\tBUILDER: 'builder',\n\tCHAT_PANEL: 'chatPanel',\n\tCHAT_PANEL_STATE: 'chatPanelState',\n\tBECOME_TEMPLATE_CREATOR: 'becomeTemplateCreator',\n\tPROJECTS: 'projects',\n\tAPI_KEYS: 'apiKeys',\n\tEVALUATION: 'evaluation',\n\tEVAL_COLLECTIONS: 'evalCollections',\n\tFOLDERS: 'folders',\n\tMODULES: 'modules',\n\tFOCUS_PANEL: 'focusPanel',\n\tAI_TEMPLATES_STARTER_COLLECTION: 'aiTemplatesStarterCollection',\n\tPERSONALIZED_TEMPLATES: 'personalizedTemplates',\n\tEXPERIMENT_READY_TO_RUN_WORKFLOWS: 'readyToRunWorkflows',\n\tEXPERIMENT_READY_TO_RUN_WORKFLOWS_V2: 'readyToRunWorkflowsV2',\n\tEXPERIMENT_TEMPLATE_RECO_V2: 'templateRecoV2',\n\tPERSONALIZED_TEMPLATES_V3: 'personalizedTemplatesV3',\n\tREADY_TO_RUN: 'readyToRun',\n\tTEMPLATES_DATA_QUALITY: 'templatesDataQuality',\n\tBANNERS: 'banners',\n\tCONSENT: 'consent',\n\tCHAT_HUB: 'chatHub',\n\tCHAT_HUB_PANEL: 'chatHubPanel',\n\tEXPERIMENT_CREDENTIALS_APP_SELECTION: 'credentialsAppSelection',\n\tEXPERIMENT_SURFACE_MCP_TO_NEW_CLOUD_USERS: 'surfaceMcpToNewCloudUsers',\n\tEXPERIMENT_EXPOSE_ALL_WORKFLOWS_TO_MCP: 'exposeAllWorkflowsToMcp',\n\tSETUP_PANEL: 'setupPanel',\n\tFOCUSED_NODES: 'focusedNodes',\n\tFAVORITES: 'favorites',\n\tAI_GATEWAY: 'aiGateway',\n\tEVALUATIONS_WIZARD_SIDEPANEL: 'evaluationsWizardSidepanel',\n} as const;\n"],"mappings":";AAAA,MAAa,SAAS;CACrB,iBAAiB;CACjB,MAAM;CACN,UAAU;CACV,eAAe;CACf,IAAI;CACJ,OAAO;CACP,WAAW;CACX,gBAAgB;CAChB,cAAc;CACd,cAAc;CACd,oBAAoB;CACpB,gBAAgB;CAChB,2BAA2B;CAC3B,YAAY;CACZ,KAAK;CACL,WAAW;CACX,YAAY;CACZ,aAAa;CACb,MAAM;CACN,iBAAiB;CACjB,UAAU;CACV,cAAc;CACd,UAAU;CACV,SAAS;CACT,YAAY;CACZ,MAAM;CACN,MAAM;CACN,eAAe;CACf,WAAW;CACX,SAAS;CACT,YAAY;CACZ,kBAAkB;CAClB,yBAAyB;CACzB,UAAU;CACV,UAAU;CACV,YAAY;CACZ,kBAAkB;CAClB,SAAS;CACT,SAAS;CACT,aAAa;CACb,iCAAiC;CACjC,wBAAwB;CACxB,mCAAmC;CACnC,sCAAsC;CACtC,6BAA6B;CAC7B,2BAA2B;CAC3B,cAAc;CACd,wBAAwB;CACxB,SAAS;CACT,SAAS;CACT,UAAU;CACV,gBAAgB;CAChB,sCAAsC;CACtC,2CAA2C;CAC3C,wCAAwC;CACxC,aAAa;CACb,eAAe;CACf,WAAW;CACX,YAAY;CACZ,8BAA8B;CAC9B"}
@@ -0,0 +1,4 @@
1
+ const require_invitation_api = require('./invitation2.api.cjs');
2
+
3
+ exports.acceptInvitation = require_invitation_api.acceptInvitation;
4
+ exports.inviteUsers = require_invitation_api.inviteUsers;
@@ -0,0 +1,2 @@
1
+ import { n as acceptInvitation, r as inviteUsers, t as IInviteResponse } from "./invitation2.api.cjs";
2
+ export { IInviteResponse, acceptInvitation, inviteUsers };
@@ -0,0 +1,2 @@
1
+ import { n as acceptInvitation, r as inviteUsers, t as IInviteResponse } from "./invitation2.api.mjs";
2
+ export { IInviteResponse, acceptInvitation, inviteUsers };
@@ -0,0 +1,3 @@
1
+ import { n as inviteUsers, t as acceptInvitation } from "./invitation2.api.mjs";
2
+
3
+ export { acceptInvitation, inviteUsers };
@@ -0,0 +1,26 @@
1
+ const require_settings_store = require('./settings2.store.cjs');
2
+ let __n8n_rest_api_client = require("@n8n/rest-api-client");
3
+
4
+ //#region src/invitation.api.ts
5
+ async function inviteUsers(context, params) {
6
+ return await (0, __n8n_rest_api_client.makeRestApiRequest)(context, "POST", "/invitations", params);
7
+ }
8
+ async function acceptInvitation(context, params) {
9
+ if (!params.token) throw new Error("Token is required");
10
+ return await (0, __n8n_rest_api_client.makeRestApiRequest)(context, "POST", "/invitations/accept", params);
11
+ }
12
+
13
+ //#endregion
14
+ Object.defineProperty(exports, 'acceptInvitation', {
15
+ enumerable: true,
16
+ get: function () {
17
+ return acceptInvitation;
18
+ }
19
+ });
20
+ Object.defineProperty(exports, 'inviteUsers', {
21
+ enumerable: true,
22
+ get: function () {
23
+ return inviteUsers;
24
+ }
25
+ });
26
+ //# sourceMappingURL=invitation2.api.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invitation2.api.cjs","names":[],"sources":["../src/invitation.api.ts"],"sourcesContent":["import type { Role } from '@n8n/api-types';\nimport type { AssignableGlobalRole } from '@n8n/permissions';\nimport type { IRestApiContext } from '@n8n/rest-api-client';\nimport { makeRestApiRequest } from '@n8n/rest-api-client';\nimport type { CurrentUserResponse } from '@n8n/rest-api-client/api/users';\nimport type { IDataObject } from 'n8n-workflow';\n\nexport interface IInviteResponse {\n\tuser: {\n\t\tid: string;\n\t\temail: string;\n\t\temailSent: boolean;\n\t\tinviteAcceptUrl: string;\n\t\trole: Role;\n\t};\n\terror?: string;\n}\n\ntype AcceptInvitationParams = {\n\ttoken: string;\n\tfirstName: string;\n\tlastName: string;\n\tpassword: string;\n};\n\nexport async function inviteUsers(\n\tcontext: IRestApiContext,\n\tparams: Array<{ email: string; role: AssignableGlobalRole }>,\n) {\n\treturn await makeRestApiRequest<IInviteResponse[]>(context, 'POST', '/invitations', params);\n}\n\nexport async function acceptInvitation(context: IRestApiContext, params: AcceptInvitationParams) {\n\tif (!params.token) {\n\t\tthrow new Error('Token is required');\n\t}\n\n\treturn await makeRestApiRequest<CurrentUserResponse>(\n\t\tcontext,\n\t\t'POST',\n\t\t'/invitations/accept',\n\t\tparams as unknown as IDataObject,\n\t);\n}\n"],"mappings":";;;;AAyBA,eAAsB,YACrB,SACA,QACC;AACD,QAAO,oDAA4C,SAAS,QAAQ,gBAAgB,OAAO;;AAG5F,eAAsB,iBAAiB,SAA0B,QAAgC;AAChG,KAAI,CAAC,OAAO,MACX,OAAM,IAAI,MAAM,oBAAoB;AAGrC,QAAO,oDACN,SACA,QACA,uBACA,OACA"}
@@ -0,0 +1,30 @@
1
+ import { Role } from "@n8n/api-types";
2
+ import { AssignableGlobalRole } from "@n8n/permissions";
3
+ import { IRestApiContext } from "@n8n/rest-api-client";
4
+ import { CurrentUserResponse } from "@n8n/rest-api-client/api/users";
5
+
6
+ //#region src/invitation.api.d.ts
7
+ interface IInviteResponse {
8
+ user: {
9
+ id: string;
10
+ email: string;
11
+ emailSent: boolean;
12
+ inviteAcceptUrl: string;
13
+ role: Role;
14
+ };
15
+ error?: string;
16
+ }
17
+ type AcceptInvitationParams = {
18
+ token: string;
19
+ firstName: string;
20
+ lastName: string;
21
+ password: string;
22
+ };
23
+ declare function inviteUsers(context: IRestApiContext, params: Array<{
24
+ email: string;
25
+ role: AssignableGlobalRole;
26
+ }>): Promise<IInviteResponse[]>;
27
+ declare function acceptInvitation(context: IRestApiContext, params: AcceptInvitationParams): Promise<CurrentUserResponse>;
28
+ //#endregion
29
+ export { acceptInvitation as n, inviteUsers as r, IInviteResponse as t };
30
+ //# sourceMappingURL=invitation2.api.d.cts.map
@@ -0,0 +1,30 @@
1
+ import { Role } from "@n8n/api-types";
2
+ import { IRestApiContext } from "@n8n/rest-api-client";
3
+ import { AssignableGlobalRole } from "@n8n/permissions";
4
+ import { CurrentUserResponse } from "@n8n/rest-api-client/api/users";
5
+
6
+ //#region src/invitation.api.d.ts
7
+ interface IInviteResponse {
8
+ user: {
9
+ id: string;
10
+ email: string;
11
+ emailSent: boolean;
12
+ inviteAcceptUrl: string;
13
+ role: Role;
14
+ };
15
+ error?: string;
16
+ }
17
+ type AcceptInvitationParams = {
18
+ token: string;
19
+ firstName: string;
20
+ lastName: string;
21
+ password: string;
22
+ };
23
+ declare function inviteUsers(context: IRestApiContext, params: Array<{
24
+ email: string;
25
+ role: AssignableGlobalRole;
26
+ }>): Promise<IInviteResponse[]>;
27
+ declare function acceptInvitation(context: IRestApiContext, params: AcceptInvitationParams): Promise<CurrentUserResponse>;
28
+ //#endregion
29
+ export { acceptInvitation as n, inviteUsers as r, IInviteResponse as t };
30
+ //# sourceMappingURL=invitation2.api.d.mts.map
@@ -0,0 +1,14 @@
1
+ import { makeRestApiRequest } from "@n8n/rest-api-client";
2
+
3
+ //#region src/invitation.api.ts
4
+ async function inviteUsers(context, params) {
5
+ return await makeRestApiRequest(context, "POST", "/invitations", params);
6
+ }
7
+ async function acceptInvitation(context, params) {
8
+ if (!params.token) throw new Error("Token is required");
9
+ return await makeRestApiRequest(context, "POST", "/invitations/accept", params);
10
+ }
11
+
12
+ //#endregion
13
+ export { inviteUsers as n, acceptInvitation as t };
14
+ //# sourceMappingURL=invitation2.api.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invitation2.api.mjs","names":[],"sources":["../src/invitation.api.ts"],"sourcesContent":["import type { Role } from '@n8n/api-types';\nimport type { AssignableGlobalRole } from '@n8n/permissions';\nimport type { IRestApiContext } from '@n8n/rest-api-client';\nimport { makeRestApiRequest } from '@n8n/rest-api-client';\nimport type { CurrentUserResponse } from '@n8n/rest-api-client/api/users';\nimport type { IDataObject } from 'n8n-workflow';\n\nexport interface IInviteResponse {\n\tuser: {\n\t\tid: string;\n\t\temail: string;\n\t\temailSent: boolean;\n\t\tinviteAcceptUrl: string;\n\t\trole: Role;\n\t};\n\terror?: string;\n}\n\ntype AcceptInvitationParams = {\n\ttoken: string;\n\tfirstName: string;\n\tlastName: string;\n\tpassword: string;\n};\n\nexport async function inviteUsers(\n\tcontext: IRestApiContext,\n\tparams: Array<{ email: string; role: AssignableGlobalRole }>,\n) {\n\treturn await makeRestApiRequest<IInviteResponse[]>(context, 'POST', '/invitations', params);\n}\n\nexport async function acceptInvitation(context: IRestApiContext, params: AcceptInvitationParams) {\n\tif (!params.token) {\n\t\tthrow new Error('Token is required');\n\t}\n\n\treturn await makeRestApiRequest<CurrentUserResponse>(\n\t\tcontext,\n\t\t'POST',\n\t\t'/invitations/accept',\n\t\tparams as unknown as IDataObject,\n\t);\n}\n"],"mappings":";;;AAyBA,eAAsB,YACrB,SACA,QACC;AACD,QAAO,MAAM,mBAAsC,SAAS,QAAQ,gBAAgB,OAAO;;AAG5F,eAAsB,iBAAiB,SAA0B,QAAgC;AAChG,KAAI,CAAC,OAAO,MACX,OAAM,IAAI,MAAM,oBAAoB;AAGrC,QAAO,MAAM,mBACZ,SACA,QACA,uBACA,OACA"}
File without changes
@@ -0,0 +1,2 @@
1
+ import { t as ModalOpeners } from "./modalOpeners2.cjs";
2
+ export { ModalOpeners };
@@ -0,0 +1,2 @@
1
+ import { t as ModalOpeners } from "./modalOpeners2.mjs";
2
+ export { ModalOpeners };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,11 @@
1
+ //#region src/modalOpeners.d.ts
2
+ interface ModalOpeners {
3
+ openModal(name: string): void;
4
+ openModalWithData(payload: {
5
+ name: string;
6
+ data: Record<string, unknown>;
7
+ }): void;
8
+ }
9
+ //#endregion
10
+ export { ModalOpeners as t };
11
+ //# sourceMappingURL=modalOpeners2.d.cts.map
@@ -0,0 +1,11 @@
1
+ //#region src/modalOpeners.d.ts
2
+ interface ModalOpeners {
3
+ openModal(name: string): void;
4
+ openModalWithData(payload: {
5
+ name: string;
6
+ data: Record<string, unknown>;
7
+ }): void;
8
+ }
9
+ //#endregion
10
+ export { ModalOpeners as t };
11
+ //# sourceMappingURL=modalOpeners2.d.mts.map
@@ -0,0 +1,33 @@
1
+ const require_settings_store = require('./settings2.store.cjs');
2
+ const require_constants = require('./constants2.cjs');
3
+ let pinia = require("pinia");
4
+ let vue = require("vue");
5
+
6
+ //#region src/notifications.store.ts
7
+ /**
8
+ * Notification state extracted from `ui.store`: the per-view queue of pending
9
+ * notifications and the suppression flags read by the toast layer.
10
+ */
11
+ const useNotificationsStore = (0, pinia.defineStore)(require_constants.STORES.NOTIFICATIONS, () => {
12
+ const pendingNotificationsForViews = (0, vue.ref)({});
13
+ const areNotificationsSuppressed = (0, vue.ref)(false);
14
+ const allowErrorNotificationsWhenSuppressed = (0, vue.ref)(false);
15
+ const setNotificationsForView = (view, notifications) => {
16
+ pendingNotificationsForViews.value[view] = notifications;
17
+ };
18
+ const setNotificationsSuppressed = (suppressed, options) => {
19
+ areNotificationsSuppressed.value = suppressed;
20
+ allowErrorNotificationsWhenSuppressed.value = suppressed && options?.allowErrors === true;
21
+ };
22
+ return {
23
+ pendingNotificationsForViews,
24
+ areNotificationsSuppressed,
25
+ allowErrorNotificationsWhenSuppressed,
26
+ setNotificationsForView,
27
+ setNotificationsSuppressed
28
+ };
29
+ });
30
+
31
+ //#endregion
32
+ exports.useNotificationsStore = useNotificationsStore;
33
+ //# sourceMappingURL=notifications.store.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifications.store.cjs","names":["STORES"],"sources":["../src/notifications.store.ts"],"sourcesContent":["import type { VIEWS } from '@n8n/frontend-constants/views';\nimport { defineStore } from 'pinia';\nimport { ref, type Component, type Ref, type VNode } from 'vue';\n\nimport { STORES } from './constants';\n\ntype NotificationType = '' | 'success' | 'warning' | 'error' | 'info';\ntype NotificationPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';\n\n/**\n * Notification payload accepted by the toast layer.\n *\n * This mirrors Element Plus' notification options (the shape the toast layer\n * ultimately forwards to `ElNotification`) but is declared inline so this\n * package carries no dependency on `element-plus`. `message` is required; every\n * other field is optional, matching the original `Partial<...>`-based type.\n *\n * Relocated here from `editor-ui`'s `@/Interface` so it can travel with the\n * notifications store; `editor-ui` re-exports it for existing importers.\n */\nexport interface NotificationOptions {\n\tmessage: string | VNode;\n\ttitle?: string;\n\ttype?: NotificationType;\n\ticon?: string | Component;\n\tcustomClass?: string;\n\tduration?: number;\n\tposition?: NotificationPosition;\n\tshowClose?: boolean;\n\tdangerouslyUseHTMLString?: boolean;\n\toffset?: number;\n\tappendTo?: HTMLElement | string;\n\tzIndex?: number;\n\tonClick?: () => void;\n\tonClose?: () => void;\n}\n\n/**\n * Public surface of the notifications store. Declared explicitly so the emitted\n * type declarations reference these named types instead of inlining the\n * structural notification/Vue types, keeping the declarations portable across\n * the package boundary.\n */\nexport interface NotificationsStore {\n\tpendingNotificationsForViews: Ref<Partial<Record<VIEWS, NotificationOptions[]>>>;\n\tareNotificationsSuppressed: Ref<boolean>;\n\tallowErrorNotificationsWhenSuppressed: Ref<boolean>;\n\tsetNotificationsForView: (view: VIEWS, notifications: NotificationOptions[]) => void;\n\tsetNotificationsSuppressed: (suppressed: boolean, options?: { allowErrors?: boolean }) => void;\n}\n\n/**\n * Notification state extracted from `ui.store`: the per-view queue of pending\n * notifications and the suppression flags read by the toast layer.\n */\nexport const useNotificationsStore = defineStore(STORES.NOTIFICATIONS, (): NotificationsStore => {\n\tconst pendingNotificationsForViews = ref<Partial<Record<VIEWS, NotificationOptions[]>>>({});\n\tconst areNotificationsSuppressed = ref(false);\n\tconst allowErrorNotificationsWhenSuppressed = ref(false);\n\n\tconst setNotificationsForView = (view: VIEWS, notifications: NotificationOptions[]) => {\n\t\tpendingNotificationsForViews.value[view] = notifications;\n\t};\n\n\tconst setNotificationsSuppressed = (suppressed: boolean, options?: { allowErrors?: boolean }) => {\n\t\tareNotificationsSuppressed.value = suppressed;\n\t\tallowErrorNotificationsWhenSuppressed.value = suppressed && options?.allowErrors === true;\n\t};\n\n\treturn {\n\t\tpendingNotificationsForViews,\n\t\tareNotificationsSuppressed,\n\t\tallowErrorNotificationsWhenSuppressed,\n\t\tsetNotificationsForView,\n\t\tsetNotificationsSuppressed,\n\t};\n});\n"],"mappings":";;;;;;;;;;AAuDA,MAAa,+CAAoCA,yBAAO,qBAAyC;CAChG,MAAM,4CAAkF,EAAE,CAAC;CAC3F,MAAM,0CAAiC,MAAM;CAC7C,MAAM,qDAA4C,MAAM;CAExD,MAAM,2BAA2B,MAAa,kBAAyC;AACtF,+BAA6B,MAAM,QAAQ;;CAG5C,MAAM,8BAA8B,YAAqB,YAAwC;AAChG,6BAA2B,QAAQ;AACnC,wCAAsC,QAAQ,cAAc,SAAS,gBAAgB;;AAGtF,QAAO;EACN;EACA;EACA;EACA;EACA;EACA;EACA"}
@@ -0,0 +1,36 @@
1
+ import { Component, Ref, VNode } from "vue";
2
+ import * as pinia1 from "pinia";
3
+ import { VIEWS } from "@n8n/frontend-constants/views";
4
+
5
+ //#region src/notifications.store.d.ts
6
+ type NotificationType = '' | 'success' | 'warning' | 'error' | 'info';
7
+ type NotificationPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
8
+ interface NotificationOptions {
9
+ message: string | VNode;
10
+ title?: string;
11
+ type?: NotificationType;
12
+ icon?: string | Component;
13
+ customClass?: string;
14
+ duration?: number;
15
+ position?: NotificationPosition;
16
+ showClose?: boolean;
17
+ dangerouslyUseHTMLString?: boolean;
18
+ offset?: number;
19
+ appendTo?: HTMLElement | string;
20
+ zIndex?: number;
21
+ onClick?: () => void;
22
+ onClose?: () => void;
23
+ }
24
+ interface NotificationsStore {
25
+ pendingNotificationsForViews: Ref<Partial<Record<VIEWS, NotificationOptions[]>>>;
26
+ areNotificationsSuppressed: Ref<boolean>;
27
+ allowErrorNotificationsWhenSuppressed: Ref<boolean>;
28
+ setNotificationsForView: (view: VIEWS, notifications: NotificationOptions[]) => void;
29
+ setNotificationsSuppressed: (suppressed: boolean, options?: {
30
+ allowErrors?: boolean;
31
+ }) => void;
32
+ }
33
+ declare const useNotificationsStore: pinia1.StoreDefinition<"notifications", Pick<NotificationsStore, "pendingNotificationsForViews" | "areNotificationsSuppressed" | "allowErrorNotificationsWhenSuppressed">, Pick<NotificationsStore, never>, Pick<NotificationsStore, "setNotificationsForView" | "setNotificationsSuppressed">>;
34
+ //#endregion
35
+ export { NotificationOptions, NotificationsStore, useNotificationsStore };
36
+ //# sourceMappingURL=notifications.store.d.cts.map
@@ -0,0 +1,36 @@
1
+ import * as pinia0 from "pinia";
2
+ import { Component, Ref, VNode } from "vue";
3
+ import { VIEWS } from "@n8n/frontend-constants/views";
4
+
5
+ //#region src/notifications.store.d.ts
6
+ type NotificationType = '' | 'success' | 'warning' | 'error' | 'info';
7
+ type NotificationPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
8
+ interface NotificationOptions {
9
+ message: string | VNode;
10
+ title?: string;
11
+ type?: NotificationType;
12
+ icon?: string | Component;
13
+ customClass?: string;
14
+ duration?: number;
15
+ position?: NotificationPosition;
16
+ showClose?: boolean;
17
+ dangerouslyUseHTMLString?: boolean;
18
+ offset?: number;
19
+ appendTo?: HTMLElement | string;
20
+ zIndex?: number;
21
+ onClick?: () => void;
22
+ onClose?: () => void;
23
+ }
24
+ interface NotificationsStore {
25
+ pendingNotificationsForViews: Ref<Partial<Record<VIEWS, NotificationOptions[]>>>;
26
+ areNotificationsSuppressed: Ref<boolean>;
27
+ allowErrorNotificationsWhenSuppressed: Ref<boolean>;
28
+ setNotificationsForView: (view: VIEWS, notifications: NotificationOptions[]) => void;
29
+ setNotificationsSuppressed: (suppressed: boolean, options?: {
30
+ allowErrors?: boolean;
31
+ }) => void;
32
+ }
33
+ declare const useNotificationsStore: pinia0.StoreDefinition<"notifications", Pick<NotificationsStore, "pendingNotificationsForViews" | "areNotificationsSuppressed" | "allowErrorNotificationsWhenSuppressed">, Pick<NotificationsStore, never>, Pick<NotificationsStore, "setNotificationsForView" | "setNotificationsSuppressed">>;
34
+ //#endregion
35
+ export { NotificationOptions, NotificationsStore, useNotificationsStore };
36
+ //# sourceMappingURL=notifications.store.d.mts.map