Skip to main content

CodemapApi

@codebolt/client-sdk


Class: CodemapApi

Defined in: CodeBolt/packages/clientsdk/src/api/codemap.api.ts:11

Manages codemap generation and retrieval in the CodeBolt runtime.

Codemaps are structural representations of source files, capturing classes, functions, imports, and their relationships. This API handles generating, listing, querying, and deleting codemaps.

Constructors

Constructor

new CodemapApi(http: HttpClient): CodemapApi;

Defined in: CodeBolt/packages/clientsdk/src/api/codemap.api.ts:12

Parameters

ParameterType
httpHttpClient

Returns

CodemapApi

Methods

delete()

delete(codemapId: string): Promise<unknown>;

Defined in: CodeBolt/packages/clientsdk/src/api/codemap.api.ts:103

Deletes a codemap by its ID.

Permanently removes the codemap from the system. The underlying source files are not affected.

Parameters

ParameterTypeDescription
codemapIdstringThe unique identifier of the codemap to delete

Returns

Promise<unknown>

A promise that resolves when deletion is complete

Example

await client.codemap.delete('map-abc');

generate()

generate(data: GenerateCodemapRequest): Promise<Codemap>;

Defined in: CodeBolt/packages/clientsdk/src/api/codemap.api.ts:85

Generates a new codemap for specified files.

Parses the target files and produces a structural representation capturing symbols, dependencies, and relationships.

Parameters

ParameterTypeDescription
dataGenerateCodemapRequestThe generation request specifying target files or directories

Returns

Promise<Codemap>

A promise that resolves to the newly generated Codemap

Example

const map = await client.codemap.generate({
path: 'src/auth/',
});

get()

get(codemapId: string): Promise<Codemap>;

Defined in: CodeBolt/packages/clientsdk/src/api/codemap.api.ts:65

Retrieves a specific codemap by its ID.

Returns the full structural representation including all symbols, relationships, and metadata.

Parameters

ParameterTypeDescription
codemapIdstringThe unique identifier of the codemap

Returns

Promise<Codemap>

A promise that resolves to the Codemap

Example

const map = await client.codemap.get('map-abc');
console.log(map.symbols);

getByPath()

getByPath(params: CodemapByPathParams): Promise<Codemap[]>;

Defined in: CodeBolt/packages/clientsdk/src/api/codemap.api.ts:46

Retrieves codemap entries by file path.

Looks up codemaps associated with a specific file path, returning all structural information for that file.

Parameters

ParameterTypeDescription
paramsCodemapByPathParamsQuery parameters including the file path to look up

Returns

Promise<Codemap[]>

A promise that resolves to an array of matching Codemap objects

Example

const maps = await client.codemap.getByPath({ path: 'src/index.ts' });

list()

list(params?: Record<string, unknown>): Promise<Codemap[]>;

Defined in: CodeBolt/packages/clientsdk/src/api/codemap.api.ts:28

Lists all codemaps.

Returns every codemap that has been generated in the current workspace.

Parameters

ParameterTypeDescription
params?Record<string, unknown>Optional query parameters for filtering or pagination

Returns

Promise<Codemap[]>

A promise that resolves to an array of Codemap objects

Example

const maps = await client.codemap.list();
console.log(`${maps.length} codemaps available`);