import * as _develit_io_backend_sdk from '@develit-io/backend-sdk'; import { IRPCResponse } from '@develit-io/backend-sdk'; import { L as LabeledScope, t as tables, C as CreateRoleInput, a as CreateRoleOutput, A as AssignRoleToUserInput, b as AssignRoleToUserOutput, c as AssignRolesToUserInput, d as AssignRolesToUserOutput, R as RevokeRoleFromUserInput, e as RevokeRoleFromUserOutput, G as GrantScopeToUserInput, f as GrantScopeToUserOutput, g as GrantScopesToUserInput, h as GrantScopesToUserOutput, i as RevokeScopeFromUserInput, j as RevokeScopeFromUserOutput, k as GrantScopeToRoleInput, l as GrantScopeToRoleOutput, m as RevokeScopeFromRoleInput, n as RevokeScopeFromRoleOutput, o as GetAllUserRolesOutput, p as GetPermissionsOutput, q as GetUserPermissionsInput, r as GetUserPermissionsOutput, V as VerifyAccessInput, s as VerifyAccessOutput, D as DeleteRoleInput, u as DeleteRoleOutput, U as UpdateRoleInput, v as UpdateRoleOutput } from './shared/rbac.TmcBTYf9.cjs'; import { WorkerEntrypoint } from 'cloudflare:workers'; import { DrizzleD1Database } from 'drizzle-orm/d1'; import 'zod'; import 'drizzle-orm'; import './shared/rbac.P-yL2vdQ.cjs'; import 'drizzle-orm/sqlite-core'; type TypedScopeObject = { scope: TScopes[number]['value']; resourceId?: string; resourcePath?: string; }; type TypedScopeCondition = TypedScopeObject | { or: TypedScopeCondition[]; } | { and: TypedScopeCondition[]; } | TypedScopeCondition[]; declare const RbacServiceBase_base: (abstract new (ctx: ExecutionContext, env: RbacEnv) => WorkerEntrypoint) & (abstract new (...args: any[]) => _develit_io_backend_sdk.DevelitWorkerMethods); declare class RbacServiceBase extends RbacServiceBase_base { readonly db: DrizzleD1Database; readonly SCOPES: TScopes; constructor(ctx: ExecutionContext, env: RbacEnv, scopes: TScopes); private validateScope; createRole(input: CreateRoleInput): Promise>; assignRoleToUser(input: AssignRoleToUserInput): Promise>; assignRolesToUser(input: AssignRolesToUserInput): Promise>; revokeRoleFromUser(input: RevokeRoleFromUserInput): Promise>; grantScopeToUser(input: GrantScopeToUserInput): Promise>; grantScopesToUser(input: GrantScopesToUserInput): Promise>; revokeScopeFromUser(input: RevokeScopeFromUserInput): Promise>; grantScopeToRole(input: GrantScopeToRoleInput): Promise>; revokeScopeFromRole(input: RevokeScopeFromRoleInput): Promise>; getAllUserRoles(): Promise>; getPermissions(): Promise>; getUserPermissions(input: GetUserPermissionsInput): Promise>; verifyAccess(input: Omit & { accessRequests: TypedScopeCondition; }): Promise>; private verifySingleScope; deleteRole(input: DeleteRoleInput): Promise>; updateRole(input: UpdateRoleInput): Promise>; } declare function defineRbacService(config?: { scopes: TScopes; }): typeof RbacServiceBase; export { RbacServiceBase, defineRbacService };