Read and search profiles
Part of Build an integration: shared APIs and infrastructure for adapter authors. For application usage, choose a library.
The API quick start creates catalog and shows a complete runnable program. The recipes below continue in that program, after catalog construction.
List saved metadata
const profiles = catalog.list();
console.log(profiles.map(profile => profile.path).join(', '));const profiles = catalog.list();
console.log(profiles.map(profile => profile.path).join(', '));const profiles = catalog.list();
console.log(profiles.map(profile => profile.path).join(', '));const profiles = catalog.list();
console.log(profiles.map(profile => profile.path).join(', '));DemoSelect an exact profile
get uses the canonical profile path, including folder segments when present. This path identifies a saved record; it is not a file path on the host or a remote server.
const profile = catalog.get('Demo');
console.log(profile?.connections[0]?.endpoint.host ?? 'Profile not found');const profile = catalog.get('Demo');
console.log(profile?.connections[0]?.endpoint.host ?? 'Profile not found');const profile = catalog.get('Demo');
console.log(profile?.connections[0]?.endpoint.host ?? 'Profile not found');const profile = catalog.get('Demo');
console.log(profile?.connections[0]?.endpoint.host ?? 'Profile not found');127.0.0.1Search connection metadata
Default search checks names and canonical paths. Use fields: 'all' to include supported connection metadata such as host and username. Neither form resolves credentials.
const matches = catalog.search('127.0.0.1', {fields: 'all'});
console.log(matches.map(profile => profile.path).join(', '));const matches = catalog.search('127.0.0.1', {fields: 'all'});
console.log(matches.map(profile => profile.path).join(', '));const matches = catalog.search('127.0.0.1', {fields: 'all'});
console.log(matches.map(profile => profile.path).join(', '));const matches = catalog.search('127.0.0.1', {fields: 'all'});
console.log(matches.map(profile => profile.path).join(', '));DemoReplace the catalog with a native source
An application adapter implements the same source operations. The contract allows synchronous or asynchronous results, so await source.list() works with either. Choose a native adapter, then follow its source selection and discovery guide.
Identity and refresh behavior
ProfileCatalog requires profiles to belong to its source and have unique IDs and canonical paths. It holds a metadata snapshot; reconstruct or reopen a source to refresh native changes. See profiles and snapshots for the model and method contracts for failure behavior.