LogoRobo.js
Framework

rebuildCatalogFromChunks()

Function: rebuildCatalogFromChunks()

function rebuildCatalogFromChunks(
   adapter, 
   modelName, 
   namespace?, 
options?): Promise<CatalogRebuildResult>

Rebuild a catalog from chunks and segments stored in the adapter.

This function scans all chunk and segment keys for a model and reconstructs the catalog from the stored data. It's useful for:

  • Recovery when catalog is missing or corrupted
  • Verification of catalog integrity
  • Migration between catalog versions

Parameters

ParameterTypeDescription
adapterFlashcoreAdapter<string, unknown>The storage adapter (must support scan)
modelNamestringName of the model to rebuild
namespace?stringOptional namespace
options?CatalogRebuildOptionsRebuild options

Returns

Promise<CatalogRebuildResult>

Rebuild result with the new catalog

Throws

FeatureNotSupportedError if adapter doesn't support scan

On this page