import { Logger } from 'winston'; import { IPermitConfig } from '../config'; import { RelationshipTupleCreate, RelationshipTupleDelete, RelationshipTupleRead } from '../openapi'; import { BasePermitApi, IPagination } from './base'; export { RelationshipTupleCreate, RelationshipTupleDelete, RelationshipTupleRead, } from '../openapi'; /** * Represents the parameters for listing role createments. */ export interface IListRelationshipTuples extends IPagination { /** * optional subject filter, will only return relationship tuples with this this subject. */ subject?: string; /** * optional relation filter, will only return relationship tuples with this relation. */ relation?: string; /** * optional object filter, will only return relationship tuples with this object. */ object?: string; } /** * API client for managing role createments. */ export interface IRelationshipTuplesApi { /** * Retrieves a list of role createments based on the specified filters. * * @param params - The filters and pagination options for listing role createments. * @returns A promise that resolves with an array of role createments. * @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: IListRelationshipTuples): Promise; /** * Creates a new relationship tuple, that states that a relationship (of type: relation) * exists between two resource instances: the subject and the object. * * @param tuple - The tuple to create * @returns A promise that resolves to the created relationship tuple. * @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(tuple: RelationshipTupleCreate): Promise; /** * Removes a relationship tuple. * * @param tuple - The tuple to delete * @returns A promise that resolves when the tuple is successfully 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(tuple: RelationshipTupleDelete): Promise; } /** * The RelationshipTuplesApi class provides methods for interacting with Role createments. */ export declare class RelationshipTuplesApi extends BasePermitApi implements IRelationshipTuplesApi { private relationshipTuples; /** * Creates an instance of the RelationshipTuplesApi. * @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 role createments based on the specified filters. * * @param params - The filters and pagination options for listing role createments. * @returns A promise that resolves with an array of role createments. * @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: IListRelationshipTuples): Promise; /** * Creates a new relationship tuple, that states that a relationship (of type: relation) * exists between two resource instances: the subject and the object. * * @param tuple - The tuple to create * @returns A promise that resolves to the created relationship tuple. * @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(tuple: RelationshipTupleCreate): Promise; /** * Removes a relationship tuple. * * @param tuple - The tuple to delete * @returns A promise that resolves when the tuple is successfully 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(tuple: RelationshipTupleDelete): Promise; }