/** * ProfileManager - Utility class for managing user's Profile document. * * Use this in table hooks to add/remove links from the user's Profile. * * @example * hooks: { * afterInsert: async (ctx, record) => { * if (record.public) { * const pm = new ProfileManager(ctx.session); * await pm.addToProfile('http://xmlns.com/foaf/0.1/made', record['@id']); * } * }, * } */ import type { SolidSession } from './schema'; /** * Manages links in the user's Profile document. * Use this to implement publish/unpublish patterns or manage social connections. * * @example * // In a table hook * const pm = new ProfileManager(ctx.session); * * // Publish a resource (link via foaf:made) * await pm.addToProfile('http://xmlns.com/foaf/0.1/made', agentUri); * * // Add a friend (link via foaf:knows) * await pm.addToProfile('http://xmlns.com/foaf/0.1/knows', friendWebId); * * // Add an interest * await pm.addToProfile('http://xmlns.com/foaf/0.1/interest', topicUri); */ export declare class ProfileManager { private fetchFn; private webId; /** * Create a ProfileManager instance. * * @param session - The Solid authentication session (compatible with Inrupt Session) * * @example * // In a table hook * afterInsert: async (ctx, record) => { * const pm = new ProfileManager(ctx.session); * await pm.addToProfile('foaf:made', record['@id']); * } */ constructor(session: SolidSession); /** * Add a link from the user's Profile to a target URI. * * @param predicate - The RDF predicate to use (e.g., 'http://xmlns.com/foaf/0.1/made') * @param targetUri - The URI to link to (e.g., the resource's @id) * * @example * await pm.addToProfile('http://xmlns.com/foaf/0.1/made', record['@id']); */ addToProfile(predicate: string, targetUri: string): Promise; /** * Remove a link from the user's Profile to a target URI. * * @param predicate - The RDF predicate (e.g., 'http://xmlns.com/foaf/0.1/made') * @param targetUri - The URI to unlink (e.g., the resource's @id) * * @example * await pm.removeFromProfile('http://xmlns.com/foaf/0.1/made', record['@id']); */ removeFromProfile(predicate: string, targetUri: string): Promise; /** * Check if a resource is currently linked from the Profile. * * @param predicate - The RDF predicate to check * @param targetUri - The URI to check for * @returns true if the link exists, false otherwise */ isLinked(predicate: string, targetUri: string): Promise; /** * Get all URIs linked from the Profile with the given predicate. * * @param predicate - The RDF predicate to query * @returns Array of linked URIs */ getLinkedResources(predicate: string): Promise; /** * Get the user's WebID. */ getWebId(): string; } //# sourceMappingURL=profile-manager.d.ts.map