Registry
Registry Cache Module
Registry caching with TTL support.
Provides filesystem-based caching for the extensions registry.
Variables
Functions
Registry Fetcher Module
Registry fetching and parsing.
Handles loading the Quarto extensions registry with caching support.
Interfaces
Functions
HTTP Utilities Module
HTTP utilities with timeout and retry support.
Provides robust fetch operations with configurable timeouts and retries.
Interfaces
Functions
Registry Search Module
Registry search and listing functions.
Provides search and filtering capabilities for the extensions registry.
Interfaces
Functions
clearRegistryCache
TypeScript
function clearRegistryCache(cacheDir?): Promise<void>;Defined in: packages/core/src/registry/cache.ts:146
Clear the registry cache.
Parameters
| Parameter | Type | Description |
|---|---|---|
cacheDir? |
string |
Cache directory (uses default if not provided) |
Returns
Promise<void>
fetchJson
TypeScript
function fetchJson<T>(url, options?): Promise<T>;Defined in: packages/core/src/registry/http.ts:185
Fetch JSON with timeout and retry support.
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type | Description |
|---|---|---|
url |
string |
URL to fetch |
options |
HttpOptions |
HTTP options |
Returns
Promise<T>
Parsed JSON response
fetchRegistry
TypeScript
function fetchRegistry(options?): Promise<Registry>;Defined in: packages/core/src/registry/fetcher.ts:44
Fetch the extension registry.
Parameters
| Parameter | Type | Description |
|---|---|---|
options |
RegistryOptions |
Registry options |
Returns
Promise<Registry>
Parsed registry
fetchText
TypeScript
function fetchText(url, options?): Promise<string>;Defined in: packages/core/src/registry/http.ts:201
Fetch text with timeout and retry support.
Parameters
| Parameter | Type | Description |
|---|---|---|
url |
string |
URL to fetch |
options |
HttpOptions |
HTTP options |
Returns
Promise<string>
Response text
getCacheFilePath
TypeScript
function getCacheFilePath(cacheDir?): string;Defined in: packages/core/src/registry/cache.ts:62
Get the cache file path.
Parameters
| Parameter | Type | Description |
|---|---|---|
cacheDir? |
string |
Cache directory (uses default if not provided) |
Returns
string
Path to cache file
getCacheStatus
TypeScript
function getCacheStatus(cacheDir?): Promise<
| {
age?: number;
exists: boolean;
url?: string;
}
| null>;Defined in: packages/core/src/registry/cache.ts:201
Get cache status information.
Parameters
| Parameter | Type | Description |
|---|---|---|
cacheDir? |
string |
Cache directory |
Returns
Promise< | { age?: number; exists: boolean; url?: string; } | null>
Cache status or null if no cache exists
getDefaultCacheDir
TypeScript
function getDefaultCacheDir(): string;Defined in: packages/core/src/registry/cache.ts:40
Get the default cache directory.
Returns
string
Path to cache directory
getDefaultRegistryUrl
TypeScript
function getDefaultRegistryUrl(): string;Defined in: packages/core/src/registry/fetcher.ts:80
Get the default registry URL.
Returns
string
getExtension
TypeScript
function getExtension(id, options?): Promise<RegistryEntry | null>;Defined in: packages/core/src/registry/search.ts:156
Get a specific extension by ID from the registry.
Parameters
| Parameter | Type | Description |
|---|---|---|
id |
string |
Extension ID (e.g., “quarto-ext/lightbox”) |
options |
RegistryOptions |
Registry options |
Returns
Promise<RegistryEntry | null>
Registry entry or null if not found
getExtensionsByOwner
TypeScript
function getExtensionsByOwner(owner, options?): Promise<RegistryEntry[]>;Defined in: packages/core/src/registry/search.ts:168
Get extensions by owner.
Parameters
| Parameter | Type | Description |
|---|---|---|
owner |
string |
Owner name |
options |
RegistryOptions |
Registry options |
Returns
Promise<RegistryEntry[]>
Array of registry entries
listAvailable
TypeScript
function listAvailable(options?): Promise<RegistryEntry[]>;Defined in: packages/core/src/registry/search.ts:72
List all available extensions from the registry.
Parameters
| Parameter | Type | Description |
|---|---|---|
options |
ListAvailableOptions |
List options |
Returns
Promise<RegistryEntry[]>
Array of registry entries
Example
TypeScript
// List all filters
const filters = await listAvailable({ type: "filter" });
// List templates only
const templates = await listAvailable({ templatesOnly: true, limit: 10 });lookupRegistryEntry
TypeScript
function lookupRegistryEntry(registry, key): RegistryEntry | null;Defined in: packages/core/src/registry/search.ts:21
Look up a registry entry by key with case-insensitive fallback.
Parameters
| Parameter | Type | Description |
|---|---|---|
registry |
Registry |
Registry to search |
key |
string |
Entry key (e.g., “quarto-ext/lightbox”) |
Returns
RegistryEntry | null
Matching entry or null
readCachedRegistry
TypeScript
function readCachedRegistry(
cacheDir,
url,
ttl?): Promise<Registry | null>;Defined in: packages/core/src/registry/cache.ts:75
Read cached registry if valid.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
cacheDir |
string |
undefined |
Cache directory |
url |
string |
undefined |
Expected registry URL |
ttl |
number |
DEFAULT_CACHE_TTL |
Cache TTL in milliseconds |
Returns
Promise<Registry | null>
Cached registry or null if cache is invalid/expired
search
TypeScript
function search(query, options?): Promise<RegistryEntry[]>;Defined in: packages/core/src/registry/search.ts:111
Search for extensions in the registry.
Parameters
| Parameter | Type | Description |
|---|---|---|
query |
string |
Search query (searches name, description, topics) |
options |
SearchOptions |
Search options |
Returns
Promise<RegistryEntry[]>
Array of matching registry entries
Example
TypeScript
// Search for table-related extensions
const results = await search("table", { limit: 10 });
// Search for popular filters only
const filters = await search("code", { type: "filter", minStars: 50 });writeCachedRegistry
TypeScript
function writeCachedRegistry(
cacheDir,
url,
registry): Promise<void>;Defined in: packages/core/src/registry/cache.ts:119
Write registry to cache.
Parameters
| Parameter | Type | Description |
|---|---|---|
cacheDir |
string |
Cache directory |
url |
string |
Registry URL |
registry |
Registry |
Registry data to cache |
Returns
Promise<void>
HttpOptions
Defined in: packages/core/src/registry/http.ts:17
Options for HTTP requests.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
headers? |
Record<string, string> |
Custom headers to include. | packages/core/src/registry/http.ts:25 |
retries? |
number |
Number of retry attempts (default: 3). | packages/core/src/registry/http.ts:21 |
retryDelay? |
number |
Base delay for exponential backoff in ms (default: 1000). | packages/core/src/registry/http.ts:23 |
signal? |
AbortSignal |
AbortSignal for cancellation. | packages/core/src/registry/http.ts:27 |
timeout? |
number |
Request timeout in milliseconds (default: 30000). | packages/core/src/registry/http.ts:19 |
ListAvailableOptions
Defined in: packages/core/src/registry/search.ts:40
Options for listing available extensions.
Extends
Extended by
Properties
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
auth? |
AuthConfig |
Authentication configuration. | RegistryOptions.auth |
packages/core/src/registry/fetcher.ts:33 |
cacheDir? |
string |
Cache directory (uses platform default if not provided). | RegistryOptions.cacheDir |
packages/core/src/registry/fetcher.ts:27 |
cacheTtl? |
number |
Cache TTL in milliseconds (default: 24 hours). | RegistryOptions.cacheTtl |
packages/core/src/registry/fetcher.ts:31 |
forceRefresh? |
boolean |
Force refresh, ignoring cache. | RegistryOptions.forceRefresh |
packages/core/src/registry/fetcher.ts:29 |
limit? |
number |
Maximum number of results. | - | packages/core/src/registry/search.ts:46 |
registryUrl? |
string |
Custom registry URL. | RegistryOptions.registryUrl |
packages/core/src/registry/fetcher.ts:25 |
templatesOnly? |
boolean |
Filter to templates only. | - | packages/core/src/registry/search.ts:44 |
timeout? |
number |
Request timeout in milliseconds. | RegistryOptions.timeout |
packages/core/src/registry/fetcher.ts:35 |
type? |
ExtensionType |
Filter by extension type (based on topics). | - | packages/core/src/registry/search.ts:42 |
RegistryOptions
Defined in: packages/core/src/registry/fetcher.ts:23
Options for fetching the registry.
Extended by
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
auth? |
AuthConfig |
Authentication configuration. | packages/core/src/registry/fetcher.ts:33 |
cacheDir? |
string |
Cache directory (uses platform default if not provided). | packages/core/src/registry/fetcher.ts:27 |
cacheTtl? |
number |
Cache TTL in milliseconds (default: 24 hours). | packages/core/src/registry/fetcher.ts:31 |
forceRefresh? |
boolean |
Force refresh, ignoring cache. | packages/core/src/registry/fetcher.ts:29 |
registryUrl? |
string |
Custom registry URL. | packages/core/src/registry/fetcher.ts:25 |
timeout? |
number |
Request timeout in milliseconds. | packages/core/src/registry/fetcher.ts:35 |
SearchOptions
Defined in: packages/core/src/registry/search.ts:52
Options for searching extensions.
Extends
Properties
DEFAULT_CACHE_TTL
TypeScript
const DEFAULT_CACHE_TTL: number;Defined in: packages/core/src/registry/cache.ts:16
Default cache TTL: 24 hours in milliseconds.