import { Logger } from 'winston'; import { IPermitConfig } from '../config'; import { ActionConfig, ResourceConfig, ResourceTypes } from './interfaces'; import { ActionDefinition, ResourceDefinition, ResourceRegistry } from './registry'; export interface SyncObjectResponse { id: string; } export declare class ResourceStub { private reporter; readonly resourceName: string; constructor(reporter: ResourceReporter, resourceName: string); action(config: ActionConfig): void; } export interface IResourceReporter { resource(config: ResourceConfig): ResourceStub; action(config: ActionConfig): ActionDefinition; syncResources(config: ResourceTypes): ResourceStub[]; } /** * the ResourceReporter is used to sync resources and actions * (the authorization enforcement points) defined by the app to the * permit.io control plane in the cloud, so that policy and permissions * may be defined by the control plane. The only data permit.io needs to * know about the app is the available enforcement point (i.e: resources * and actions). */ export declare class ResourceReporter implements IResourceReporter { private config; private registry; private logger; private initialized; private client; constructor(config: IPermitConfig, registry: ResourceRegistry, logger: Logger); get token(): string; addResource(resource: ResourceDefinition): ResourceStub; addActionToResource(resourceName: string, actionDef: ActionDefinition): void; private maybeSyncResource; private maybeSyncAction; private syncResourcesToControlPlane; resource(config: ResourceConfig): ResourceStub; action(config: ActionConfig): ActionDefinition; syncResources(config: ResourceTypes): ResourceStub[]; getMethods(): IResourceReporter; }