Registry
Registry Cache Module
Registry caching with TTL support.
Provides filesystem-based caching for the extensions registry.
Functions
clearRegistryCache()
TypeScript
function clearRegistryCache(cacheDir?): Promise<void>;Defined in: packages/core/src/registry/cache.ts:139
Clear the registry cache.
Parameters
| Parameter | Type | Description |
|---|---|---|
cacheDir? |
string |
Cache directory (uses default if not provided) |
Returns
Promise<void>
getCacheFilePath()
TypeScript
function getCacheFilePath(cacheDir?): string;Defined in: packages/core/src/registry/cache.ts:60
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:159
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:38
Get the default cache directory.
Returns
string
Path to cache directory
readCachedRegistry()
TypeScript
function readCachedRegistry(
cacheDir,
url,
ttl): Promise<Registry | null>;Defined in: packages/core/src/registry/cache.ts:73
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_TTL |
Cache TTL in milliseconds |
Returns
Promise<Registry | null>
Cached registry or null if cache is invalid/expired
writeCachedRegistry()
TypeScript
function writeCachedRegistry(
cacheDir,
url,
registry): Promise<void>;Defined in: packages/core/src/registry/cache.ts:113
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>
Registry Fetcher Module
Registry fetching and parsing.
Handles loading the Quarto extensions registry with caching support.
Interfaces
RegistryOptions
Defined in: packages/core/src/registry/fetcher.ts:26
Options for fetching the registry.
Extended by
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
auth? |
AuthConfig |
Authentication configuration. | packages/core/src/registry/fetcher.ts:36 |
cacheDir? |
string |
Cache directory (uses platform default if not provided). | packages/core/src/registry/fetcher.ts:30 |
cacheTtl? |
number |
Cache TTL in milliseconds (default: 24 hours). | packages/core/src/registry/fetcher.ts:34 |
forceRefresh? |
boolean |
Force refresh, ignoring cache. | packages/core/src/registry/fetcher.ts:32 |
registryUrl? |
string |
Custom registry URL. | packages/core/src/registry/fetcher.ts:28 |
timeout? |
number |
Request timeout in milliseconds. | packages/core/src/registry/fetcher.ts:38 |
Functions
fetchRegistry()
TypeScript
function fetchRegistry(options): Promise<Registry>;Defined in: packages/core/src/registry/fetcher.ts:47
Fetch the extension registry.
Parameters
| Parameter | Type | Description |
|---|---|---|
options |
RegistryOptions |
Registry options |
Returns
Promise<Registry>
Parsed registry
getDefaultRegistryUrl()
TypeScript
function getDefaultRegistryUrl(): string;Defined in: packages/core/src/registry/fetcher.ts:83
Get the default registry URL.
Returns
string
HTTP Utilities Module
HTTP utilities with timeout and retry support.
Provides robust fetch operations with configurable timeouts and retries.
Interfaces
HttpOptions
Defined in: packages/core/src/registry/http.ts:16
Options for HTTP requests.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
headers? |
Record<string, string> |
Custom headers to include. | packages/core/src/registry/http.ts:24 |
retries? |
number |
Number of retry attempts (default: 3). | packages/core/src/registry/http.ts:20 |
retryDelay? |
number |
Base delay for exponential backoff in ms (default: 1000). | packages/core/src/registry/http.ts:22 |
timeout? |
number |
Request timeout in milliseconds (default: 30000). | packages/core/src/registry/http.ts:18 |
Functions
fetchJson()
TypeScript
function fetchJson<T>(url, options): Promise<T>;Defined in: packages/core/src/registry/http.ts:87
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
fetchText()
TypeScript
function fetchText(url, options): Promise<string>;Defined in: packages/core/src/registry/http.ts:140
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
Registry Search Module
Registry search and listing functions.
Provides search and filtering capabilities for the extensions registry.
Interfaces
ListAvailableOptions
Defined in: packages/core/src/registry/search.ts:17
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:36 |
cacheDir? |
string |
Cache directory (uses platform default if not provided). | RegistryOptions.cacheDir |
packages/core/src/registry/fetcher.ts:30 |
cacheTtl? |
number |
Cache TTL in milliseconds (default: 24 hours). | RegistryOptions.cacheTtl |
packages/core/src/registry/fetcher.ts:34 |
forceRefresh? |
boolean |
Force refresh, ignoring cache. | RegistryOptions.forceRefresh |
packages/core/src/registry/fetcher.ts:32 |
limit? |
number |
Maximum number of results. | - | packages/core/src/registry/search.ts:23 |
registryUrl? |
string |
Custom registry URL. | RegistryOptions.registryUrl |
packages/core/src/registry/fetcher.ts:28 |
templatesOnly? |
boolean |
Filter to templates only. | - | packages/core/src/registry/search.ts:21 |
timeout? |
number |
Request timeout in milliseconds. | RegistryOptions.timeout |
packages/core/src/registry/fetcher.ts:38 |
type? |
ExtensionType |
Filter by extension type (based on topics). | - | packages/core/src/registry/search.ts:19 |
SearchOptions
Defined in: packages/core/src/registry/search.ts:29
Options for searching extensions.
Extends
Properties
Functions
getExtension()
TypeScript
function getExtension(id, options): Promise<RegistryEntry | null>;Defined in: packages/core/src/registry/search.ts:133
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:145
Get extensions by owner.
Parameters
| Parameter | Type | Description |
|---|---|---|
owner |
string |
Owner name |
options |
RegistryOptions |
Registry options |
Returns
Promise<<code><a href="types-2.qmd#registryentry" style="text-decoration-line: underline; text-decoration-style: dashed; text-decoration-thickness: 1px; text-decoration-color: currentColor;">RegistryEntry</a>[]</code>{=html}>
Array of registry entries
listAvailable()
TypeScript
function listAvailable(options): Promise<RegistryEntry[]>;Defined in: packages/core/src/registry/search.ts:49
List all available extensions from the registry.
Parameters
| Parameter | Type | Description |
|---|---|---|
options |
ListAvailableOptions |
List options |
Returns
Promise<<code><a href="types-2.qmd#registryentry" style="text-decoration-line: underline; text-decoration-style: dashed; text-decoration-thickness: 1px; text-decoration-color: currentColor;">RegistryEntry</a>[]</code>{=html}>
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 });search()
TypeScript
function search(query, options): Promise<RegistryEntry[]>;Defined in: packages/core/src/registry/search.ts:88
Search for extensions in the registry.
Parameters
| Parameter | Type | Description |
|---|---|---|
query |
string |
Search query (searches name, description, topics) |
options |
SearchOptions |
Search options |
Returns
Promise<<code><a href="types-2.qmd#registryentry" style="text-decoration-line: underline; text-decoration-style: dashed; text-decoration-thickness: 1px; text-decoration-color: currentColor;">RegistryEntry</a>[]</code>{=html}>
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 });