mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
refactor: Remove duplication of scope definitions (no-changelog) (#11387)
This commit is contained in:
parent
ff14dcb3a1
commit
74d870530b
|
@ -5,45 +5,33 @@ export type Resource = keyof typeof RESOURCES;
|
|||
|
||||
export type ResourceScope<
|
||||
R extends Resource,
|
||||
Operation extends string = DefaultOperations,
|
||||
Operation extends (typeof RESOURCES)[R][number] = (typeof RESOURCES)[R][number],
|
||||
> = `${R}:${Operation}`;
|
||||
|
||||
export type WildcardScope = `${Resource}:*` | '*';
|
||||
|
||||
export type AnnotationTagScope = ResourceScope<'annotationTag'>;
|
||||
export type AuditLogsScope = ResourceScope<'auditLogs', 'manage'>;
|
||||
export type BannerScope = ResourceScope<'banner', 'dismiss'>;
|
||||
export type CommunityScope = ResourceScope<'community', 'register'>;
|
||||
export type CommunityPackageScope = ResourceScope<
|
||||
'communityPackage',
|
||||
'install' | 'uninstall' | 'update' | 'list' | 'manage'
|
||||
>;
|
||||
export type CredentialScope = ResourceScope<'credential', DefaultOperations | 'share' | 'move'>;
|
||||
export type ExternalSecretScope = ResourceScope<'externalSecret', 'list' | 'use'>;
|
||||
export type ExternalSecretProviderScope = ResourceScope<
|
||||
'externalSecretsProvider',
|
||||
DefaultOperations | 'sync'
|
||||
>;
|
||||
export type EventBusDestinationScope = ResourceScope<
|
||||
'eventBusDestination',
|
||||
DefaultOperations | 'test'
|
||||
>;
|
||||
export type LdapScope = ResourceScope<'ldap', 'manage' | 'sync'>;
|
||||
export type LicenseScope = ResourceScope<'license', 'manage'>;
|
||||
export type LogStreamingScope = ResourceScope<'logStreaming', 'manage'>;
|
||||
export type OrchestrationScope = ResourceScope<'orchestration', 'read' | 'list'>;
|
||||
export type AuditLogsScope = ResourceScope<'auditLogs'>;
|
||||
export type BannerScope = ResourceScope<'banner'>;
|
||||
export type CommunityScope = ResourceScope<'community'>;
|
||||
export type CommunityPackageScope = ResourceScope<'communityPackage'>;
|
||||
export type CredentialScope = ResourceScope<'credential'>;
|
||||
export type ExternalSecretScope = ResourceScope<'externalSecret'>;
|
||||
export type ExternalSecretProviderScope = ResourceScope<'externalSecretsProvider'>;
|
||||
export type EventBusDestinationScope = ResourceScope<'eventBusDestination'>;
|
||||
export type LdapScope = ResourceScope<'ldap'>;
|
||||
export type LicenseScope = ResourceScope<'license'>;
|
||||
export type LogStreamingScope = ResourceScope<'logStreaming'>;
|
||||
export type OrchestrationScope = ResourceScope<'orchestration'>;
|
||||
export type ProjectScope = ResourceScope<'project'>;
|
||||
export type SamlScope = ResourceScope<'saml', 'manage'>;
|
||||
export type SecurityAuditScope = ResourceScope<'securityAudit', 'generate'>;
|
||||
export type SourceControlScope = ResourceScope<'sourceControl', 'pull' | 'push' | 'manage'>;
|
||||
export type SamlScope = ResourceScope<'saml'>;
|
||||
export type SecurityAuditScope = ResourceScope<'securityAudit'>;
|
||||
export type SourceControlScope = ResourceScope<'sourceControl'>;
|
||||
export type TagScope = ResourceScope<'tag'>;
|
||||
export type UserScope = ResourceScope<'user', DefaultOperations | 'resetPassword' | 'changeRole'>;
|
||||
export type UserScope = ResourceScope<'user'>;
|
||||
export type VariableScope = ResourceScope<'variable'>;
|
||||
export type WorkersViewScope = ResourceScope<'workersView', 'manage'>;
|
||||
export type WorkflowScope = ResourceScope<
|
||||
'workflow',
|
||||
DefaultOperations | 'share' | 'execute' | 'move'
|
||||
>;
|
||||
export type WorkersViewScope = ResourceScope<'workersView'>;
|
||||
export type WorkflowScope = ResourceScope<'workflow'>;
|
||||
|
||||
export type Scope =
|
||||
| AnnotationTagScope
|
||||
|
|
Loading…
Reference in a new issue