import type { IComponent } from "@twin.org/core"; import type { IJsonLdDocument } from "@twin.org/data-json-ld"; /** * Interface describing a contract which provides profile operations. */ export interface IIdentityProfileComponent extends IComponent { /** * Create the profile properties for an identity. * @param publicProfile The public profile data as JSON-LD. * @param privateProfile The private profile data as JSON-LD. * @param identity The identity to perform the profile operation on. * @returns A promise that resolves when the profile has been created. */ create(publicProfile?: T, privateProfile?: U, identity?: string): Promise; /** * Get the profile properties for an identity. * @param publicPropertyNames The public properties to get for the profile, defaults to all. * @param privatePropertyNames The private properties to get for the profile, defaults to all. * @param identity The identity to perform the profile operation on. * @returns The items identity and the properties. */ get(publicPropertyNames?: (keyof T)[], privatePropertyNames?: (keyof U)[], identity?: string): Promise<{ identity: string; publicProfile?: Partial; privateProfile?: Partial; }>; /** * Get the public profile properties for an identity. * @param identity The identity to perform the profile operation on. * @param propertyNames The public properties to get for the profile, defaults to all. * @returns The items properties. */ getPublic(identity: string, propertyNames?: (keyof T)[]): Promise>; /** * Update the profile properties of an identity. * @param publicProfile The public profile data as JSON-LD. * @param privateProfile The private profile data as JSON-LD. * @param identity The identity to perform the profile operation on. * @returns A promise that resolves when the profile has been updated. */ update(publicProfile?: T, privateProfile?: U, identity?: string): Promise; /** * Delete the profile for an identity. * @param identity The identity to perform the profile operation on. * @returns A promise that resolves when the profile has been removed. */ remove(identity?: string): Promise; /** * Get a list of the requested identities. * @param publicFilters The filters to apply to the identities public profiles. * @param publicPropertyNames The public properties to get for the profile, defaults to all. * @param cursor The cursor for paged requests. * @param limit The maximum number of items in a page. * @returns The list of items and cursor for paging. */ list(publicFilters?: { propertyName: string; propertyValue: unknown; }[], publicPropertyNames?: (keyof T)[], cursor?: string, limit?: number): Promise<{ /** * The identities. */ items: { identity: string; publicProfile?: Partial; }[]; /** * An optional cursor, when defined can be used to call find to get more entities. */ cursor?: string; }>; /** * Get a list of identities including private profile data. * @param publicFilters The filters to apply to the identities public profiles. * @param privateFilters The filters to apply to the identities private profiles. * @param publicPropertyNames The public properties to get for the profile, defaults to all. * @param privatePropertyNames The private properties to get for the profile, defaults to none. * @param cursor The cursor for paged requests. * @param limit The maximum number of items in a page. * @returns The list of items and cursor for paging. */ listAdmin(publicFilters?: { propertyName: string; propertyValue: unknown; }[], privateFilters?: { propertyName: string; propertyValue: unknown; }[], publicPropertyNames?: (keyof T)[], privatePropertyNames?: (keyof U)[], cursor?: string, limit?: number): Promise<{ /** * The identities. */ items: { identity: string; publicProfile?: Partial; privateProfile?: Partial; }[]; /** * An optional cursor, when defined can be used to call find to get more entities. */ cursor?: string; }>; }