import { Logger } from 'winston'; import { IPermitConfig } from '../config'; import { ConditionSetRuleCreate, ConditionSetRuleRead, ConditionSetRuleRemove } from '../openapi'; import { BasePermitApi, IPagination } from './base'; export { ConditionSetRuleCreate, ConditionSetRuleRead, ConditionSetRuleRemove } from '../openapi'; export interface IListConditionSetRules extends IPagination { /** * the key of the userset, if used only rules matching that userset will be fetched. */ userSetKey: string; /** * the key of the permission, formatted as :. * if used only rules granting that permission will be fetched. */ permissionKey: string; /** * the key of the resourceset, if used only rules matching that resourceset will be fetched. */ resourceSetKey: string; } /** * The ConditionSetsApi class provides methods for interacting with condition sets using the Permit REST API. */ export interface IConditionSetRulesApi { /** * Retrieves a list of condition set rules based on the specified parameters. * * @param params - parameters for filtering and pagination, @see {@link IListConditionSetRules} * @returns A promise that resolves to an array of condition set rules. * @throws {@link PermitApiError} If the API returns an error HTTP status code. * @throws {@link PermitContextError} If the configured {@link ApiContext} does not match the required endpoint context. */ list(params: IListConditionSetRules): Promise; /** * Creates a new condition set rule. * * @param rule - The condition set rule to create. * @returns A promise that resolves to the created condition set rule. * @throws {@link PermitApiError} If the API returns an error HTTP status code. * @throws {@link PermitContextError} If the configured {@link ApiContext} does not match the required endpoint context. */ create(rule: ConditionSetRuleCreate): Promise; /** * Deletes a condition set rule. * * @param rule - The condition set rule to delete. * @returns A promise that resolves when the condition set rule is deleted. * @throws {@link PermitApiError} If the API returns an error HTTP status code. * @throws {@link PermitContextError} If the configured {@link ApiContext} does not match the required endpoint context. */ delete(rule: ConditionSetRuleRemove): Promise; } export declare class ConditionSetRulesApi extends BasePermitApi implements IConditionSetRulesApi { private setRules; /** * Creates an instance of the ConditionSetRulesApi. * @param config - The configuration object for the Permit SDK. * @param logger - The logger instance for logging. */ constructor(config: IPermitConfig, logger: Logger); /** * Retrieves a list of condition set rules based on the specified parameters. * * @param params - parameters for filtering and pagination, @see {@link IListConditionSetRules} * @returns A promise that resolves to an array of condition set rules. * @throws {@link PermitApiError} If the API returns an error HTTP status code. * @throws {@link PermitContextError} If the configured {@link ApiContext} does not match the required endpoint context. */ list(params: IListConditionSetRules): Promise; /** * Creates a new condition set rule. * * @param rule - The condition set rule to create. * @returns A promise that resolves to the created condition set rule. * @throws {@link PermitApiError} If the API returns an error HTTP status code. * @throws {@link PermitContextError} If the configured {@link ApiContext} does not match the required endpoint context. */ create(rule: ConditionSetRuleCreate): Promise; /** * Deletes a condition set rule. * * @param rule - The condition set rule to delete. * @returns A promise that resolves when the condition set rule is deleted. * @throws {@link PermitApiError} If the API returns an error HTTP status code. * @throws {@link PermitContextError} If the configured {@link ApiContext} does not match the required endpoint context. */ delete(rule: ConditionSetRuleRemove): Promise; }