Skip to content

PromptScript API


Class: RegistryCache

Defined in: resolver/src/registry-cache.ts:14

Hierarchical cache for registry imports. Layout: /registries///// Separate from the existing GitCacheManager flat hash cache.

Constructors

Constructor

new RegistryCache(baseDir): RegistryCache

Defined in: resolver/src/registry-cache.ts:15

Parameters

baseDir

string

Returns

RegistryCache

Methods

getCachePath()

getCachePath(repoUrl, version): string

Defined in: resolver/src/registry-cache.ts:17

Parameters

repoUrl

string

version

string

Returns

string


getMeta()

getMeta(repoUrl, version): Promise\<CacheMeta | null>

Defined in: resolver/src/registry-cache.ts:56

Parameters

repoUrl

string

version

string

Returns

Promise\<CacheMeta | null>


getTagsMeta()

getTagsMeta(repoUrl): Promise\<{ fetchedAt: number; tags: string[]; } | null>

Defined in: resolver/src/registry-cache.ts:68

Get cached tag list for a repo (for semver range resolution)

Parameters

repoUrl

string

Returns

Promise\<{ fetchedAt: number; tags: string[]; } | null>


has()

has(repoUrl, version): Promise\<boolean>

Defined in: resolver/src/registry-cache.ts:22

Parameters

repoUrl

string

version

string

Returns

Promise\<boolean>


isStale()

isStale(repoUrl, version, ttlMs): Promise\<boolean>

Defined in: resolver/src/registry-cache.ts:40

Parameters

repoUrl

string

version

string

ttlMs

number

Returns

Promise\<boolean>


set()

set(repoUrl, version, commit): Promise\<string>

Defined in: resolver/src/registry-cache.ts:32

Parameters

repoUrl

string

version

string

commit

string

Returns

Promise\<string>


setTagsMeta()

setTagsMeta(repoUrl, tags): Promise\<void>

Defined in: resolver/src/registry-cache.ts:81

Cache tag list for a repo

Parameters

repoUrl

string

tags

string[]

Returns

Promise\<void>