@n8n/stores 2.31.2 → 2.32.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.
@@ -0,0 +1,358 @@
1
+ import { Resource, Scope, ScopeOptions } from "@n8n/permissions";
2
+ import * as pinia0 from "pinia";
3
+ import * as vue0 from "vue";
4
+ import { Role } from "@n8n/api-types";
5
+
6
+ //#region src/rbac.store.d.ts
7
+ declare const useRBACStore: pinia0.StoreDefinition<"rbac", Pick<{
8
+ globalRoles: vue0.Ref<Role[], Role[]>;
9
+ rolesByProjectId: vue0.Ref<Record<string, string[]>, Record<string, string[]>>;
10
+ globalScopes: vue0.Ref<Scope[], Scope[]>;
11
+ scopesByProjectId: vue0.Ref<Record<string, Scope[]>, Record<string, Scope[]>>;
12
+ scopesByResourceId: vue0.Ref<{
13
+ chatHub: Record<string, Scope[]>;
14
+ agent: Record<string, Scope[]>;
15
+ aiAssistant: Record<string, Scope[]>;
16
+ annotationTag: Record<string, Scope[]>;
17
+ auditLogs: Record<string, Scope[]>;
18
+ banner: Record<string, Scope[]>;
19
+ community: Record<string, Scope[]>;
20
+ communityPackage: Record<string, Scope[]>;
21
+ credential: Record<string, Scope[]>;
22
+ externalSecretsProvider: Record<string, Scope[]>;
23
+ externalSecret: Record<string, Scope[]>;
24
+ eventBusDestination: Record<string, Scope[]>;
25
+ ldap: Record<string, Scope[]>;
26
+ license: Record<string, Scope[]>;
27
+ logStreaming: Record<string, Scope[]>;
28
+ orchestration: Record<string, Scope[]>;
29
+ project: Record<string, Scope[]>;
30
+ saml: Record<string, Scope[]>;
31
+ securityAudit: Record<string, Scope[]>;
32
+ securitySettings: Record<string, Scope[]>;
33
+ sourceControl: Record<string, Scope[]>;
34
+ tag: Record<string, Scope[]>;
35
+ user: Record<string, Scope[]>;
36
+ variable: Record<string, Scope[]>;
37
+ projectVariable: Record<string, Scope[]>;
38
+ workersView: Record<string, Scope[]>;
39
+ workflow: Record<string, Scope[]>;
40
+ folder: Record<string, Scope[]>;
41
+ insights: Record<string, Scope[]>;
42
+ oidc: Record<string, Scope[]>;
43
+ provisioning: Record<string, Scope[]>;
44
+ dataTable: Record<string, Scope[]>;
45
+ execution: Record<string, Scope[]>;
46
+ testRun: Record<string, Scope[]>;
47
+ workflowTags: Record<string, Scope[]>;
48
+ role: Record<string, Scope[]>;
49
+ mcp: Record<string, Scope[]>;
50
+ mcpApiKey: Record<string, Scope[]>;
51
+ chatHubAgent: Record<string, Scope[]>;
52
+ breakingChanges: Record<string, Scope[]>;
53
+ apiKey: Record<string, Scope[]>;
54
+ encryptionKey: Record<string, Scope[]>;
55
+ credentialResolver: Record<string, Scope[]>;
56
+ instanceAi: Record<string, Scope[]>;
57
+ roleMappingRule: Record<string, Scope[]>;
58
+ otel: Record<string, Scope[]>;
59
+ }, Record<"chatHub" | "agent" | "aiAssistant" | "annotationTag" | "auditLogs" | "banner" | "community" | "communityPackage" | "credential" | "externalSecretsProvider" | "externalSecret" | "eventBusDestination" | "ldap" | "license" | "logStreaming" | "orchestration" | "project" | "saml" | "securityAudit" | "securitySettings" | "sourceControl" | "tag" | "user" | "variable" | "projectVariable" | "workersView" | "workflow" | "folder" | "insights" | "oidc" | "provisioning" | "dataTable" | "execution" | "testRun" | "workflowTags" | "role" | "mcp" | "mcpApiKey" | "chatHubAgent" | "breakingChanges" | "apiKey" | "encryptionKey" | "credentialResolver" | "instanceAi" | "roleMappingRule" | "otel", Record<string, Scope[]>> | {
60
+ chatHub: Record<string, Scope[]>;
61
+ agent: Record<string, Scope[]>;
62
+ aiAssistant: Record<string, Scope[]>;
63
+ annotationTag: Record<string, Scope[]>;
64
+ auditLogs: Record<string, Scope[]>;
65
+ banner: Record<string, Scope[]>;
66
+ community: Record<string, Scope[]>;
67
+ communityPackage: Record<string, Scope[]>;
68
+ credential: Record<string, Scope[]>;
69
+ externalSecretsProvider: Record<string, Scope[]>;
70
+ externalSecret: Record<string, Scope[]>;
71
+ eventBusDestination: Record<string, Scope[]>;
72
+ ldap: Record<string, Scope[]>;
73
+ license: Record<string, Scope[]>;
74
+ logStreaming: Record<string, Scope[]>;
75
+ orchestration: Record<string, Scope[]>;
76
+ project: Record<string, Scope[]>;
77
+ saml: Record<string, Scope[]>;
78
+ securityAudit: Record<string, Scope[]>;
79
+ securitySettings: Record<string, Scope[]>;
80
+ sourceControl: Record<string, Scope[]>;
81
+ tag: Record<string, Scope[]>;
82
+ user: Record<string, Scope[]>;
83
+ variable: Record<string, Scope[]>;
84
+ projectVariable: Record<string, Scope[]>;
85
+ workersView: Record<string, Scope[]>;
86
+ workflow: Record<string, Scope[]>;
87
+ folder: Record<string, Scope[]>;
88
+ insights: Record<string, Scope[]>;
89
+ oidc: Record<string, Scope[]>;
90
+ provisioning: Record<string, Scope[]>;
91
+ dataTable: Record<string, Scope[]>;
92
+ execution: Record<string, Scope[]>;
93
+ testRun: Record<string, Scope[]>;
94
+ workflowTags: Record<string, Scope[]>;
95
+ role: Record<string, Scope[]>;
96
+ mcp: Record<string, Scope[]>;
97
+ mcpApiKey: Record<string, Scope[]>;
98
+ chatHubAgent: Record<string, Scope[]>;
99
+ breakingChanges: Record<string, Scope[]>;
100
+ apiKey: Record<string, Scope[]>;
101
+ encryptionKey: Record<string, Scope[]>;
102
+ credentialResolver: Record<string, Scope[]>;
103
+ instanceAi: Record<string, Scope[]>;
104
+ roleMappingRule: Record<string, Scope[]>;
105
+ otel: Record<string, Scope[]>;
106
+ }>;
107
+ addGlobalRole: (role: Role) => void;
108
+ hasRole: (role: Role) => boolean;
109
+ addGlobalScope: (scope: Scope) => void;
110
+ setGlobalScopes: (scopes: Scope[]) => void;
111
+ addProjectScope: (scope: Scope, context: {
112
+ projectId: string;
113
+ }) => void;
114
+ addResourceScope: (scope: Scope, context: {
115
+ resourceType: Resource;
116
+ resourceId: string;
117
+ }) => void;
118
+ hasScope: (scope: Scope | Scope[], context?: {
119
+ resourceType?: Resource;
120
+ resourceId?: string;
121
+ projectId?: string;
122
+ }, options?: ScopeOptions) => boolean;
123
+ }, "globalRoles" | "rolesByProjectId" | "globalScopes" | "scopesByProjectId" | "scopesByResourceId">, Pick<{
124
+ globalRoles: vue0.Ref<Role[], Role[]>;
125
+ rolesByProjectId: vue0.Ref<Record<string, string[]>, Record<string, string[]>>;
126
+ globalScopes: vue0.Ref<Scope[], Scope[]>;
127
+ scopesByProjectId: vue0.Ref<Record<string, Scope[]>, Record<string, Scope[]>>;
128
+ scopesByResourceId: vue0.Ref<{
129
+ chatHub: Record<string, Scope[]>;
130
+ agent: Record<string, Scope[]>;
131
+ aiAssistant: Record<string, Scope[]>;
132
+ annotationTag: Record<string, Scope[]>;
133
+ auditLogs: Record<string, Scope[]>;
134
+ banner: Record<string, Scope[]>;
135
+ community: Record<string, Scope[]>;
136
+ communityPackage: Record<string, Scope[]>;
137
+ credential: Record<string, Scope[]>;
138
+ externalSecretsProvider: Record<string, Scope[]>;
139
+ externalSecret: Record<string, Scope[]>;
140
+ eventBusDestination: Record<string, Scope[]>;
141
+ ldap: Record<string, Scope[]>;
142
+ license: Record<string, Scope[]>;
143
+ logStreaming: Record<string, Scope[]>;
144
+ orchestration: Record<string, Scope[]>;
145
+ project: Record<string, Scope[]>;
146
+ saml: Record<string, Scope[]>;
147
+ securityAudit: Record<string, Scope[]>;
148
+ securitySettings: Record<string, Scope[]>;
149
+ sourceControl: Record<string, Scope[]>;
150
+ tag: Record<string, Scope[]>;
151
+ user: Record<string, Scope[]>;
152
+ variable: Record<string, Scope[]>;
153
+ projectVariable: Record<string, Scope[]>;
154
+ workersView: Record<string, Scope[]>;
155
+ workflow: Record<string, Scope[]>;
156
+ folder: Record<string, Scope[]>;
157
+ insights: Record<string, Scope[]>;
158
+ oidc: Record<string, Scope[]>;
159
+ provisioning: Record<string, Scope[]>;
160
+ dataTable: Record<string, Scope[]>;
161
+ execution: Record<string, Scope[]>;
162
+ testRun: Record<string, Scope[]>;
163
+ workflowTags: Record<string, Scope[]>;
164
+ role: Record<string, Scope[]>;
165
+ mcp: Record<string, Scope[]>;
166
+ mcpApiKey: Record<string, Scope[]>;
167
+ chatHubAgent: Record<string, Scope[]>;
168
+ breakingChanges: Record<string, Scope[]>;
169
+ apiKey: Record<string, Scope[]>;
170
+ encryptionKey: Record<string, Scope[]>;
171
+ credentialResolver: Record<string, Scope[]>;
172
+ instanceAi: Record<string, Scope[]>;
173
+ roleMappingRule: Record<string, Scope[]>;
174
+ otel: Record<string, Scope[]>;
175
+ }, Record<"chatHub" | "agent" | "aiAssistant" | "annotationTag" | "auditLogs" | "banner" | "community" | "communityPackage" | "credential" | "externalSecretsProvider" | "externalSecret" | "eventBusDestination" | "ldap" | "license" | "logStreaming" | "orchestration" | "project" | "saml" | "securityAudit" | "securitySettings" | "sourceControl" | "tag" | "user" | "variable" | "projectVariable" | "workersView" | "workflow" | "folder" | "insights" | "oidc" | "provisioning" | "dataTable" | "execution" | "testRun" | "workflowTags" | "role" | "mcp" | "mcpApiKey" | "chatHubAgent" | "breakingChanges" | "apiKey" | "encryptionKey" | "credentialResolver" | "instanceAi" | "roleMappingRule" | "otel", Record<string, Scope[]>> | {
176
+ chatHub: Record<string, Scope[]>;
177
+ agent: Record<string, Scope[]>;
178
+ aiAssistant: Record<string, Scope[]>;
179
+ annotationTag: Record<string, Scope[]>;
180
+ auditLogs: Record<string, Scope[]>;
181
+ banner: Record<string, Scope[]>;
182
+ community: Record<string, Scope[]>;
183
+ communityPackage: Record<string, Scope[]>;
184
+ credential: Record<string, Scope[]>;
185
+ externalSecretsProvider: Record<string, Scope[]>;
186
+ externalSecret: Record<string, Scope[]>;
187
+ eventBusDestination: Record<string, Scope[]>;
188
+ ldap: Record<string, Scope[]>;
189
+ license: Record<string, Scope[]>;
190
+ logStreaming: Record<string, Scope[]>;
191
+ orchestration: Record<string, Scope[]>;
192
+ project: Record<string, Scope[]>;
193
+ saml: Record<string, Scope[]>;
194
+ securityAudit: Record<string, Scope[]>;
195
+ securitySettings: Record<string, Scope[]>;
196
+ sourceControl: Record<string, Scope[]>;
197
+ tag: Record<string, Scope[]>;
198
+ user: Record<string, Scope[]>;
199
+ variable: Record<string, Scope[]>;
200
+ projectVariable: Record<string, Scope[]>;
201
+ workersView: Record<string, Scope[]>;
202
+ workflow: Record<string, Scope[]>;
203
+ folder: Record<string, Scope[]>;
204
+ insights: Record<string, Scope[]>;
205
+ oidc: Record<string, Scope[]>;
206
+ provisioning: Record<string, Scope[]>;
207
+ dataTable: Record<string, Scope[]>;
208
+ execution: Record<string, Scope[]>;
209
+ testRun: Record<string, Scope[]>;
210
+ workflowTags: Record<string, Scope[]>;
211
+ role: Record<string, Scope[]>;
212
+ mcp: Record<string, Scope[]>;
213
+ mcpApiKey: Record<string, Scope[]>;
214
+ chatHubAgent: Record<string, Scope[]>;
215
+ breakingChanges: Record<string, Scope[]>;
216
+ apiKey: Record<string, Scope[]>;
217
+ encryptionKey: Record<string, Scope[]>;
218
+ credentialResolver: Record<string, Scope[]>;
219
+ instanceAi: Record<string, Scope[]>;
220
+ roleMappingRule: Record<string, Scope[]>;
221
+ otel: Record<string, Scope[]>;
222
+ }>;
223
+ addGlobalRole: (role: Role) => void;
224
+ hasRole: (role: Role) => boolean;
225
+ addGlobalScope: (scope: Scope) => void;
226
+ setGlobalScopes: (scopes: Scope[]) => void;
227
+ addProjectScope: (scope: Scope, context: {
228
+ projectId: string;
229
+ }) => void;
230
+ addResourceScope: (scope: Scope, context: {
231
+ resourceType: Resource;
232
+ resourceId: string;
233
+ }) => void;
234
+ hasScope: (scope: Scope | Scope[], context?: {
235
+ resourceType?: Resource;
236
+ resourceId?: string;
237
+ projectId?: string;
238
+ }, options?: ScopeOptions) => boolean;
239
+ }, never>, Pick<{
240
+ globalRoles: vue0.Ref<Role[], Role[]>;
241
+ rolesByProjectId: vue0.Ref<Record<string, string[]>, Record<string, string[]>>;
242
+ globalScopes: vue0.Ref<Scope[], Scope[]>;
243
+ scopesByProjectId: vue0.Ref<Record<string, Scope[]>, Record<string, Scope[]>>;
244
+ scopesByResourceId: vue0.Ref<{
245
+ chatHub: Record<string, Scope[]>;
246
+ agent: Record<string, Scope[]>;
247
+ aiAssistant: Record<string, Scope[]>;
248
+ annotationTag: Record<string, Scope[]>;
249
+ auditLogs: Record<string, Scope[]>;
250
+ banner: Record<string, Scope[]>;
251
+ community: Record<string, Scope[]>;
252
+ communityPackage: Record<string, Scope[]>;
253
+ credential: Record<string, Scope[]>;
254
+ externalSecretsProvider: Record<string, Scope[]>;
255
+ externalSecret: Record<string, Scope[]>;
256
+ eventBusDestination: Record<string, Scope[]>;
257
+ ldap: Record<string, Scope[]>;
258
+ license: Record<string, Scope[]>;
259
+ logStreaming: Record<string, Scope[]>;
260
+ orchestration: Record<string, Scope[]>;
261
+ project: Record<string, Scope[]>;
262
+ saml: Record<string, Scope[]>;
263
+ securityAudit: Record<string, Scope[]>;
264
+ securitySettings: Record<string, Scope[]>;
265
+ sourceControl: Record<string, Scope[]>;
266
+ tag: Record<string, Scope[]>;
267
+ user: Record<string, Scope[]>;
268
+ variable: Record<string, Scope[]>;
269
+ projectVariable: Record<string, Scope[]>;
270
+ workersView: Record<string, Scope[]>;
271
+ workflow: Record<string, Scope[]>;
272
+ folder: Record<string, Scope[]>;
273
+ insights: Record<string, Scope[]>;
274
+ oidc: Record<string, Scope[]>;
275
+ provisioning: Record<string, Scope[]>;
276
+ dataTable: Record<string, Scope[]>;
277
+ execution: Record<string, Scope[]>;
278
+ testRun: Record<string, Scope[]>;
279
+ workflowTags: Record<string, Scope[]>;
280
+ role: Record<string, Scope[]>;
281
+ mcp: Record<string, Scope[]>;
282
+ mcpApiKey: Record<string, Scope[]>;
283
+ chatHubAgent: Record<string, Scope[]>;
284
+ breakingChanges: Record<string, Scope[]>;
285
+ apiKey: Record<string, Scope[]>;
286
+ encryptionKey: Record<string, Scope[]>;
287
+ credentialResolver: Record<string, Scope[]>;
288
+ instanceAi: Record<string, Scope[]>;
289
+ roleMappingRule: Record<string, Scope[]>;
290
+ otel: Record<string, Scope[]>;
291
+ }, Record<"chatHub" | "agent" | "aiAssistant" | "annotationTag" | "auditLogs" | "banner" | "community" | "communityPackage" | "credential" | "externalSecretsProvider" | "externalSecret" | "eventBusDestination" | "ldap" | "license" | "logStreaming" | "orchestration" | "project" | "saml" | "securityAudit" | "securitySettings" | "sourceControl" | "tag" | "user" | "variable" | "projectVariable" | "workersView" | "workflow" | "folder" | "insights" | "oidc" | "provisioning" | "dataTable" | "execution" | "testRun" | "workflowTags" | "role" | "mcp" | "mcpApiKey" | "chatHubAgent" | "breakingChanges" | "apiKey" | "encryptionKey" | "credentialResolver" | "instanceAi" | "roleMappingRule" | "otel", Record<string, Scope[]>> | {
292
+ chatHub: Record<string, Scope[]>;
293
+ agent: Record<string, Scope[]>;
294
+ aiAssistant: Record<string, Scope[]>;
295
+ annotationTag: Record<string, Scope[]>;
296
+ auditLogs: Record<string, Scope[]>;
297
+ banner: Record<string, Scope[]>;
298
+ community: Record<string, Scope[]>;
299
+ communityPackage: Record<string, Scope[]>;
300
+ credential: Record<string, Scope[]>;
301
+ externalSecretsProvider: Record<string, Scope[]>;
302
+ externalSecret: Record<string, Scope[]>;
303
+ eventBusDestination: Record<string, Scope[]>;
304
+ ldap: Record<string, Scope[]>;
305
+ license: Record<string, Scope[]>;
306
+ logStreaming: Record<string, Scope[]>;
307
+ orchestration: Record<string, Scope[]>;
308
+ project: Record<string, Scope[]>;
309
+ saml: Record<string, Scope[]>;
310
+ securityAudit: Record<string, Scope[]>;
311
+ securitySettings: Record<string, Scope[]>;
312
+ sourceControl: Record<string, Scope[]>;
313
+ tag: Record<string, Scope[]>;
314
+ user: Record<string, Scope[]>;
315
+ variable: Record<string, Scope[]>;
316
+ projectVariable: Record<string, Scope[]>;
317
+ workersView: Record<string, Scope[]>;
318
+ workflow: Record<string, Scope[]>;
319
+ folder: Record<string, Scope[]>;
320
+ insights: Record<string, Scope[]>;
321
+ oidc: Record<string, Scope[]>;
322
+ provisioning: Record<string, Scope[]>;
323
+ dataTable: Record<string, Scope[]>;
324
+ execution: Record<string, Scope[]>;
325
+ testRun: Record<string, Scope[]>;
326
+ workflowTags: Record<string, Scope[]>;
327
+ role: Record<string, Scope[]>;
328
+ mcp: Record<string, Scope[]>;
329
+ mcpApiKey: Record<string, Scope[]>;
330
+ chatHubAgent: Record<string, Scope[]>;
331
+ breakingChanges: Record<string, Scope[]>;
332
+ apiKey: Record<string, Scope[]>;
333
+ encryptionKey: Record<string, Scope[]>;
334
+ credentialResolver: Record<string, Scope[]>;
335
+ instanceAi: Record<string, Scope[]>;
336
+ roleMappingRule: Record<string, Scope[]>;
337
+ otel: Record<string, Scope[]>;
338
+ }>;
339
+ addGlobalRole: (role: Role) => void;
340
+ hasRole: (role: Role) => boolean;
341
+ addGlobalScope: (scope: Scope) => void;
342
+ setGlobalScopes: (scopes: Scope[]) => void;
343
+ addProjectScope: (scope: Scope, context: {
344
+ projectId: string;
345
+ }) => void;
346
+ addResourceScope: (scope: Scope, context: {
347
+ resourceType: Resource;
348
+ resourceId: string;
349
+ }) => void;
350
+ hasScope: (scope: Scope | Scope[], context?: {
351
+ resourceType?: Resource;
352
+ resourceId?: string;
353
+ projectId?: string;
354
+ }, options?: ScopeOptions) => boolean;
355
+ }, "addGlobalRole" | "hasRole" | "addGlobalScope" | "setGlobalScopes" | "addProjectScope" | "addResourceScope" | "hasScope">>;
356
+ //#endregion
357
+ export { useRBACStore };
358
+ //# sourceMappingURL=rbac.store.d.mts.map
@@ -0,0 +1,106 @@
1
+ import { t as STORES } from "./constants2.mjs";
2
+ import { hasScope } from "@n8n/permissions";
3
+ import { defineStore } from "pinia";
4
+ import { ref } from "vue";
5
+
6
+ //#region src/rbac.store.ts
7
+ const useRBACStore = defineStore(STORES.RBAC, () => {
8
+ const globalRoles = ref([]);
9
+ const rolesByProjectId = ref({});
10
+ const globalScopes = ref([]);
11
+ const scopesByProjectId = ref({});
12
+ const scopesByResourceId = ref({
13
+ agent: {},
14
+ aiAssistant: {},
15
+ workflow: {},
16
+ tag: {},
17
+ annotationTag: {},
18
+ user: {},
19
+ credential: {},
20
+ variable: {},
21
+ projectVariable: {},
22
+ sourceControl: {},
23
+ externalSecretsProvider: {},
24
+ externalSecret: {},
25
+ project: {},
26
+ orchestration: {},
27
+ workersView: {},
28
+ eventBusDestination: {},
29
+ auditLogs: {},
30
+ banner: {},
31
+ community: {},
32
+ communityPackage: {},
33
+ ldap: {},
34
+ license: {},
35
+ logStreaming: {},
36
+ saml: {},
37
+ oidc: {},
38
+ provisioning: {},
39
+ securityAudit: {},
40
+ folder: {},
41
+ insights: {},
42
+ dataTable: {},
43
+ execution: {},
44
+ testRun: {},
45
+ workflowTags: {},
46
+ role: {},
47
+ mcp: {},
48
+ mcpApiKey: {},
49
+ chatHub: {},
50
+ chatHubAgent: {},
51
+ breakingChanges: {},
52
+ apiKey: {},
53
+ encryptionKey: {},
54
+ credentialResolver: {},
55
+ instanceAi: {},
56
+ securitySettings: {},
57
+ roleMappingRule: {},
58
+ otel: {}
59
+ });
60
+ function addGlobalRole(role) {
61
+ if (!globalRoles.value.includes(role)) globalRoles.value.push(role);
62
+ }
63
+ function hasRole(role) {
64
+ return globalRoles.value.includes(role);
65
+ }
66
+ function addGlobalScope(scope) {
67
+ if (!globalScopes.value.includes(scope)) globalScopes.value.push(scope);
68
+ }
69
+ function setGlobalScopes(scopes) {
70
+ globalScopes.value = scopes;
71
+ }
72
+ function addProjectScope(scope, context) {
73
+ if (!scopesByProjectId.value[context.projectId]) scopesByProjectId.value[context.projectId] = [];
74
+ if (!scopesByProjectId.value[context.projectId].includes(scope)) scopesByProjectId.value[context.projectId].push(scope);
75
+ }
76
+ function addResourceScope(scope, context) {
77
+ const scopesByResourceType = scopesByResourceId.value[context.resourceType];
78
+ if (!scopesByResourceType[context.resourceId]) scopesByResourceType[context.resourceId] = [];
79
+ if (!scopesByResourceType[context.resourceId].includes(scope)) scopesByResourceType[context.resourceId].push(scope);
80
+ }
81
+ function hasScope$1(scope, context, options) {
82
+ return hasScope(scope, {
83
+ global: globalScopes.value,
84
+ project: context?.projectId ? scopesByProjectId.value[context.projectId] : [],
85
+ resource: context?.resourceType && context?.resourceId ? scopesByResourceId.value[context.resourceType][context.resourceId] : []
86
+ }, void 0, options);
87
+ }
88
+ return {
89
+ globalRoles,
90
+ rolesByProjectId,
91
+ globalScopes,
92
+ scopesByProjectId,
93
+ scopesByResourceId,
94
+ addGlobalRole,
95
+ hasRole,
96
+ addGlobalScope,
97
+ setGlobalScopes,
98
+ addProjectScope,
99
+ addResourceScope,
100
+ hasScope: hasScope$1
101
+ };
102
+ });
103
+
104
+ //#endregion
105
+ export { useRBACStore };
106
+ //# sourceMappingURL=rbac.store.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rbac.store.mjs","names":["hasScope","genericHasScope"],"sources":["../src/rbac.store.ts"],"sourcesContent":["import type { Role } from '@n8n/api-types';\nimport { hasScope as genericHasScope } from '@n8n/permissions';\nimport type { ScopeOptions, Scope, Resource } from '@n8n/permissions';\nimport { defineStore } from 'pinia';\nimport { ref } from 'vue';\n\nimport { STORES } from './constants';\n\nexport const useRBACStore = defineStore(STORES.RBAC, () => {\n\tconst globalRoles = ref<Role[]>([]);\n\tconst rolesByProjectId = ref<Record<string, string[]>>({});\n\n\tconst globalScopes = ref<Scope[]>([]);\n\tconst scopesByProjectId = ref<Record<string, Scope[]>>({});\n\tconst scopesByResourceId = ref<Record<Resource, Record<string, Scope[]>>>({\n\t\tagent: {},\n\t\taiAssistant: {},\n\t\tworkflow: {},\n\t\ttag: {},\n\t\tannotationTag: {},\n\t\tuser: {},\n\t\tcredential: {},\n\t\tvariable: {},\n\t\tprojectVariable: {},\n\t\tsourceControl: {},\n\t\texternalSecretsProvider: {},\n\t\texternalSecret: {},\n\t\tproject: {},\n\t\torchestration: {},\n\t\tworkersView: {},\n\t\teventBusDestination: {},\n\t\tauditLogs: {},\n\t\tbanner: {},\n\t\tcommunity: {},\n\t\tcommunityPackage: {},\n\t\tldap: {},\n\t\tlicense: {},\n\t\tlogStreaming: {},\n\t\tsaml: {},\n\t\toidc: {},\n\t\tprovisioning: {},\n\t\tsecurityAudit: {},\n\t\tfolder: {},\n\t\tinsights: {},\n\t\tdataTable: {},\n\t\texecution: {},\n\t\ttestRun: {},\n\t\tworkflowTags: {},\n\t\trole: {},\n\t\tmcp: {},\n\t\tmcpApiKey: {},\n\t\tchatHub: {},\n\t\tchatHubAgent: {},\n\t\tbreakingChanges: {},\n\t\tapiKey: {},\n\t\tencryptionKey: {},\n\t\tcredentialResolver: {},\n\t\tinstanceAi: {},\n\t\tsecuritySettings: {},\n\t\troleMappingRule: {},\n\t\totel: {},\n\t});\n\n\tfunction addGlobalRole(role: Role) {\n\t\tif (!globalRoles.value.includes(role)) {\n\t\t\tglobalRoles.value.push(role);\n\t\t}\n\t}\n\n\tfunction hasRole(role: Role) {\n\t\treturn globalRoles.value.includes(role);\n\t}\n\n\tfunction addGlobalScope(scope: Scope) {\n\t\tif (!globalScopes.value.includes(scope)) {\n\t\t\tglobalScopes.value.push(scope);\n\t\t}\n\t}\n\n\tfunction setGlobalScopes(scopes: Scope[]) {\n\t\tglobalScopes.value = scopes;\n\t}\n\n\tfunction addProjectScope(\n\t\tscope: Scope,\n\t\tcontext: {\n\t\t\tprojectId: string;\n\t\t},\n\t) {\n\t\tif (!scopesByProjectId.value[context.projectId]) {\n\t\t\tscopesByProjectId.value[context.projectId] = [];\n\t\t}\n\n\t\tif (!scopesByProjectId.value[context.projectId].includes(scope)) {\n\t\t\tscopesByProjectId.value[context.projectId].push(scope);\n\t\t}\n\t}\n\n\tfunction addResourceScope(\n\t\tscope: Scope,\n\t\tcontext: {\n\t\t\tresourceType: Resource;\n\t\t\tresourceId: string;\n\t\t},\n\t) {\n\t\tconst scopesByResourceType = scopesByResourceId.value[context.resourceType];\n\t\tif (!scopesByResourceType[context.resourceId]) {\n\t\t\tscopesByResourceType[context.resourceId] = [];\n\t\t}\n\n\t\tif (!scopesByResourceType[context.resourceId].includes(scope)) {\n\t\t\tscopesByResourceType[context.resourceId].push(scope);\n\t\t}\n\t}\n\n\tfunction hasScope(\n\t\tscope: Scope | Scope[],\n\t\tcontext?: {\n\t\t\tresourceType?: Resource;\n\t\t\tresourceId?: string;\n\t\t\tprojectId?: string;\n\t\t},\n\t\toptions?: ScopeOptions,\n\t): boolean {\n\t\treturn genericHasScope(\n\t\t\tscope,\n\t\t\t{\n\t\t\t\tglobal: globalScopes.value,\n\t\t\t\tproject: context?.projectId ? scopesByProjectId.value[context.projectId] : [],\n\t\t\t\tresource:\n\t\t\t\t\tcontext?.resourceType && context?.resourceId\n\t\t\t\t\t\t? scopesByResourceId.value[context.resourceType][context.resourceId]\n\t\t\t\t\t\t: [],\n\t\t\t},\n\t\t\tundefined,\n\t\t\toptions,\n\t\t);\n\t}\n\n\treturn {\n\t\tglobalRoles,\n\t\trolesByProjectId,\n\t\tglobalScopes,\n\t\tscopesByProjectId,\n\t\tscopesByResourceId,\n\t\taddGlobalRole,\n\t\thasRole,\n\t\taddGlobalScope,\n\t\tsetGlobalScopes,\n\t\taddProjectScope,\n\t\taddResourceScope,\n\t\thasScope,\n\t};\n});\n"],"mappings":";;;;;;AAQA,MAAa,eAAe,YAAY,OAAO,YAAY;CAC1D,MAAM,cAAc,IAAY,EAAE,CAAC;CACnC,MAAM,mBAAmB,IAA8B,EAAE,CAAC;CAE1D,MAAM,eAAe,IAAa,EAAE,CAAC;CACrC,MAAM,oBAAoB,IAA6B,EAAE,CAAC;CAC1D,MAAM,qBAAqB,IAA+C;EACzE,OAAO,EAAE;EACT,aAAa,EAAE;EACf,UAAU,EAAE;EACZ,KAAK,EAAE;EACP,eAAe,EAAE;EACjB,MAAM,EAAE;EACR,YAAY,EAAE;EACd,UAAU,EAAE;EACZ,iBAAiB,EAAE;EACnB,eAAe,EAAE;EACjB,yBAAyB,EAAE;EAC3B,gBAAgB,EAAE;EAClB,SAAS,EAAE;EACX,eAAe,EAAE;EACjB,aAAa,EAAE;EACf,qBAAqB,EAAE;EACvB,WAAW,EAAE;EACb,QAAQ,EAAE;EACV,WAAW,EAAE;EACb,kBAAkB,EAAE;EACpB,MAAM,EAAE;EACR,SAAS,EAAE;EACX,cAAc,EAAE;EAChB,MAAM,EAAE;EACR,MAAM,EAAE;EACR,cAAc,EAAE;EAChB,eAAe,EAAE;EACjB,QAAQ,EAAE;EACV,UAAU,EAAE;EACZ,WAAW,EAAE;EACb,WAAW,EAAE;EACb,SAAS,EAAE;EACX,cAAc,EAAE;EAChB,MAAM,EAAE;EACR,KAAK,EAAE;EACP,WAAW,EAAE;EACb,SAAS,EAAE;EACX,cAAc,EAAE;EAChB,iBAAiB,EAAE;EACnB,QAAQ,EAAE;EACV,eAAe,EAAE;EACjB,oBAAoB,EAAE;EACtB,YAAY,EAAE;EACd,kBAAkB,EAAE;EACpB,iBAAiB,EAAE;EACnB,MAAM,EAAE;EACR,CAAC;CAEF,SAAS,cAAc,MAAY;AAClC,MAAI,CAAC,YAAY,MAAM,SAAS,KAAK,CACpC,aAAY,MAAM,KAAK,KAAK;;CAI9B,SAAS,QAAQ,MAAY;AAC5B,SAAO,YAAY,MAAM,SAAS,KAAK;;CAGxC,SAAS,eAAe,OAAc;AACrC,MAAI,CAAC,aAAa,MAAM,SAAS,MAAM,CACtC,cAAa,MAAM,KAAK,MAAM;;CAIhC,SAAS,gBAAgB,QAAiB;AACzC,eAAa,QAAQ;;CAGtB,SAAS,gBACR,OACA,SAGC;AACD,MAAI,CAAC,kBAAkB,MAAM,QAAQ,WACpC,mBAAkB,MAAM,QAAQ,aAAa,EAAE;AAGhD,MAAI,CAAC,kBAAkB,MAAM,QAAQ,WAAW,SAAS,MAAM,CAC9D,mBAAkB,MAAM,QAAQ,WAAW,KAAK,MAAM;;CAIxD,SAAS,iBACR,OACA,SAIC;EACD,MAAM,uBAAuB,mBAAmB,MAAM,QAAQ;AAC9D,MAAI,CAAC,qBAAqB,QAAQ,YACjC,sBAAqB,QAAQ,cAAc,EAAE;AAG9C,MAAI,CAAC,qBAAqB,QAAQ,YAAY,SAAS,MAAM,CAC5D,sBAAqB,QAAQ,YAAY,KAAK,MAAM;;CAItD,SAASA,WACR,OACA,SAKA,SACU;AACV,SAAOC,SACN,OACA;GACC,QAAQ,aAAa;GACrB,SAAS,SAAS,YAAY,kBAAkB,MAAM,QAAQ,aAAa,EAAE;GAC7E,UACC,SAAS,gBAAgB,SAAS,aAC/B,mBAAmB,MAAM,QAAQ,cAAc,QAAQ,cACvD,EAAE;GACN,EACD,QACA,QACA;;AAGF,QAAO;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA"}
@@ -1,5 +1,5 @@
1
- let __vueuse_core = require("@vueuse/core");
2
1
  let pinia = require("pinia");
2
+ let __vueuse_core = require("@vueuse/core");
3
3
 
4
4
  //#region src/useAgentRequestStore.ts
5
5
  const LOCAL_STORAGE_AGENT_REQUESTS = "N8N_AGENT_REQUESTS";
@@ -1,5 +1,5 @@
1
- import * as _vueuse_core0 from "@vueuse/core";
2
1
  import * as pinia0 from "pinia";
2
+ import * as _vueuse_core0 from "@vueuse/core";
3
3
  import { AgentRequestQuery } from "n8n-workflow";
4
4
 
5
5
  //#region src/useAgentRequestStore.d.ts
@@ -1,5 +1,5 @@
1
- import * as _vueuse_core0 from "@vueuse/core";
2
1
  import * as pinia0 from "pinia";
2
+ import * as _vueuse_core0 from "@vueuse/core";
3
3
  import { AgentRequestQuery } from "n8n-workflow";
4
4
 
5
5
  //#region src/useAgentRequestStore.d.ts
@@ -1,5 +1,5 @@
1
- import { useLocalStorage } from "@vueuse/core";
2
1
  import { defineStore } from "pinia";
2
+ import { useLocalStorage } from "@vueuse/core";
3
3
 
4
4
  //#region src/useAgentRequestStore.ts
5
5
  const LOCAL_STORAGE_AGENT_REQUESTS = "N8N_AGENT_REQUESTS";
@@ -1,8 +1,8 @@
1
1
  const require_constants = require('./constants2.cjs');
2
2
  const require_metaTagConfig = require('./metaTagConfig2.cjs');
3
3
  let pinia = require("pinia");
4
- let n8n_workflow = require("n8n-workflow");
5
4
  let vue = require("vue");
5
+ let n8n_workflow = require("n8n-workflow");
6
6
 
7
7
  //#region src/useRootStore.ts
8
8
  const { VUE_APP_URL_BASE_API } = {}.env;