Skip to content

List and search

client.folders, a Folders, finds a locator before you open it. Listing a folder opens its folder index, like an open of an object. It gets one decision and one access event. Search opens every folder index in scope and searches the decrypted contents on the device. A query never leaves the device.

List a folder

The samples use the allowed helper from Access decisions.

const listing = await allowed(await client.folders.list(folder));
if (listing) render(listing.entries);

A Listing names the dataset it belongs to, the key domain that governs it, the folder you asked for and its entries. Each Entry is a record, a file or a sub-folder. It carries:

FieldWhat it holds
locatorThe object’s identifier.
kindrecord, file, or folder.
name, typeFrom the current version’s own data. Only a device that may open the index sees a name.
timesWhen it was created and last saved.
currentVersionThe current version number, absent for a plain folder.
versionsEvery VersionInfo: its version, savedAt, writer, baseVersion, whether it is pending, and whether it is retired into the recycle bin.
indexFieldsThe dataset’s index fields, as the Client that saved the version wrote them.
recipientsThe record’s own recipients. The next save keeps their access too.
domainRootSet when this entry is itself the root of a sub-domain.

Search across datasets

folders.search takes a SearchQuery, a scope of one or more datasets, and returns a SearchResult. The query runs over names and index fields, entirely on the device, once the Seald Healthcare Cloud has answered the decision for each folder index.

const found = await client.folders.search(
{ text: 'MR', indexFields: { modality: 'MR' }, kind: 'file', savedFrom: from, savedTo: to },
{ datasets: ['imaging'] },
);
render(found.entries);

Every SearchQuery field is optional:

  • text matches free text in names and index fields.
  • indexFields matches the exact value of one or more index fields.
  • kind limits the search to records or files.
  • savedFrom and savedTo bound the save date.

SearchResult carries entries. Each entry adds the dataset, domain and folder it was found in. SearchResult also carries indexes, one decision per folder index opened. A denied index appears there with no entries. It does not vanish from the results without explanation.

What the SDK does for you

  • Opens the folder index the same way it opens any object: checked, decrypted, and closed when done.
  • Keeps listings consistent. A listing never shows a save that only partly completed.
  • Searches decrypted indexes on the device. The Seald Healthcare Cloud never sees a query’s text or field values.
  • Records one Query Records access event per index opened. The access event names the indexes, never the query.

Decisions and errors you may see

Outcome or ErrorCodeWhenWhat to do
deny on folders.listThe policies refuse the folder index itself.Show text. Nothing in the folder is listed.
deny inside SearchResult.indexesThe policies refused one folder index in scope.That index’s entries are absent. The rest of the result still renders.
storage-unreachableThe SDK could not fetch the folder index.Retry once storage is back.

Next