### Start Web Development Server Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Starts the Quasar development server with hot reloading enabled for web SPA development. ```bash quasar dev ``` -------------------------------- ### Start Electron Development Server Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Starts the Quasar development server for an Electron desktop application, including enabling the DevTools. ```bash quasar dev -m electron --devtools ``` -------------------------------- ### Start Development Server Source: https://github.com/bfritscher/typesense-dashboard/blob/main/README.md Start the application in development mode with hot-code reloading and error reporting. Use the --devtools flag for Electron debugging. ```bash quasar dev ``` ```bash quasar dev -m electron --devtools ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/bfritscher/typesense-dashboard/blob/main/README.md Use yarn to install all necessary project dependencies. ```bash yarn ``` -------------------------------- ### Build and Run Docker Image Source: https://github.com/bfritscher/typesense-dashboard/blob/main/README.md Build the Docker image locally and run it, exposing port 80. Ensure your Typesense server is started with `--enable-cors` if accessing from the web. ```bash docker build -t typesense-dashboard . docker run -d -p 80:80 typesense-dashboard ``` -------------------------------- ### Cluster Setup Configuration Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Defines cluster nodes and their configurations, including API keys, host, port, protocol, and a cluster tag for grouping. ```json { "history": [ { "apiKey": "key-node1", "node": { "host": "ts1.prod.internal", "port": "8108", "protocol": "http", "path": "" }, "clusterTag": "production" }, { "apiKey": "key-node2", "node": { "host": "ts2.prod.internal", "port": "8108", "protocol": "http", "path": "" }, "clusterTag": "production" }, { "apiKey": "key-node3", "node": { "host": "ts3.prod.internal", "port": "8108", "protocol": "http", "path": "" }, "clusterTag": "production" } ] } ``` -------------------------------- ### Docker Configuration for Typesense Dashboard Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Examples of how to configure the Typesense Dashboard when running in Docker, either by mounting a configuration file or injecting it via a base64 encoded environment variable. ```bash docker run -d -p 80:80 -v /path/to/config.json:/srv/config.json ghcr.io/bfritscher/typesense-dashboard:latest ``` ```bash docker run -d -p 80:80 -e TYPESENSE_DASHBOARD_CONFIG=$(base64 -w 0 config.json) ghcr.io/bfritscher/typesense-dashboard:latest ``` -------------------------------- ### Debug Response Example Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt An example of the response format from the `/debug` endpoint, indicating the Typesense version and the current node's state (e.g., Leader). ```typescript // ── Debug response (/debug) ─────────────────────────────────── // { version: '0.26.0', state: 1 } state: 1 = Leader, other = Follower ``` -------------------------------- ### Build Docker Image for Subfolder Deployment Source: https://github.com/bfritscher/typesense-dashboard/blob/main/README.md Build the Docker image with a specified public path, allowing the dashboard to be served from a subfolder. The `PUBLIC_PATH` argument must start with '/'. ```bash docker build --build-arg=PUBLIC_PATH=/example -t typesense-dashboard . ``` -------------------------------- ### Available Server Operations Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Shows examples of available store actions for managing the Typesense server, including clearing cache, compacting the database, setting slow query thresholds, and creating snapshots. ```typescript await store.clearCache(); await store.operationCompactDB(); await store.slowQueryThreshold(500); // -1 to disable slow-query logging await store.createSnapshot('/var/typesense-snapshots/snap-2024-01-15T10:00'); ``` -------------------------------- ### Exporting Search Results Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Demonstrates how to export search results. The first example exports only the hit documents, while the second exports the entire raw search response object. ```typescript store.exportToJson(results.hits.map((h: any) => h.document)); store.exportToJson(results); ``` -------------------------------- ### Auto-refresh Setup for Server Status Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Vue lifecycle hooks for setting up and tearing down an interval timer to periodically refresh server status information. ```typescript // ── Auto-refresh setup (Vue lifecycle) ─────────────────────────────────────── onMounted(() => { refreshInterval.value = window.setInterval(() => store.refreshServerStatus(), 2000); }); onBeforeUnmount(() => window.clearInterval(refreshInterval.value)); ``` -------------------------------- ### Programmatic Navigation with Vue Router Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt This example demonstrates how to use Vue Router's `useRouter` hook within a Vue component or Pinia action to programmatically navigate between application routes. Ensure `useNodeStore.setIsConnected()` is handled to manage redirects. ```typescript import { useRouter } from 'vue-router'; const router = useRouter(); // Navigate to a collection's search page await router.push('/collection/products/search'); // Navigate to a collection's schema page (used automatically after createCollection) await router.push(`/collection/${collectionName}/schema`); ``` -------------------------------- ### Perform Raw HTTP Operations with Api Class Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Executes raw HTTP requests for endpoints not directly supported by the SDK, such as fetching metrics, health status, or performing database operations like compacting and cache clearing. Use `get` for GET requests and `post` for POST requests. ```typescript // Raw HTTP (for endpoints not covered by the SDK) const metrics = await api.get('/metrics.json'); // => { data: { system_cpu_active_percentage: "12.5", system_memory_used_bytes: "1048576000", ... } } const health = await api.get('/health'); // => { data: { ok: true } } await api.post('/operations/db/compact'); await api.post('/operations/cache/clear'); await api.post('/config', { 'log-slow-requests-time-ms': 500 }); ``` -------------------------------- ### Get Debug Info with Api Class Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Retrieves debug information about the Typesense instance, including its version and state (e.g., Leader). ```typescript // Debug info (version, state) const debug = await api.getDebug(); // => { version: '0.25.2', state: 1 } (state 1 = Leader) ``` -------------------------------- ### Sample Configuration JSON Source: https://github.com/bfritscher/typesense-dashboard/blob/main/README.md A sample `config.json` file demonstrating various configuration options including API keys, node details, UI settings, and history for bookmarking cluster configurations. ```json { "apiKey": "xyz", "node": { "host": "somehost", "port": "443", "protocol": "https", "path": "", "tls": true }, "ui": { "hideProjectInfo": false }, "history": [ { "apiKey": "abc", "node": { "host": "anotherhost", "port": "80", "protocol": "http", "path": "", "tls": false } }, { "apiKey": "def", "node": { "host": "yetanotherhost", "port": "8080", "protocol": "http", "path": "", "tls": true }, "clusterTag": "dev-cluster" } ] } ``` -------------------------------- ### Initialize and Authenticate with Typesense Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Initializes the Pinia store and logs in to a Typesense instance. Ensure the `useNodeStore` is imported and the connection details are correct. The `connectionCheck` action verifies the connection and loads server data. ```typescript import { useNodeStore } from 'src/stores/node'; const store = useNodeStore(); // ── Authentication ────────────────────────────────────────────────────────── store.login({ apiKey: 'my-admin-key', node: { host: 'ts.example.com', port: 443, protocol: 'https', path: '', tls: true }, connectionTimeoutSeconds: 15, clusterTag: 'prod-cluster', // optional: groups node in Cluster Status view forceHomeRedirect: true, // optional: navigate home after login }); // Checks connection, loads collections, detects optional features await store.connectionCheck(); // store.isConnected => true / false // store.error => null | "Connection refused" | ... // store.data.features => { stopwords: true, analyticsRules: true, ... } ``` ```typescript store.logout(); // Clears localStorage, redirects to /login ``` -------------------------------- ### Build Desktop App for All Platforms Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Use this command to build the Typesense Dashboard as a desktop application for all supported platforms using the Quasar CLI with Electron target. ```bash quasar build -m electron --target all ``` -------------------------------- ### Build for Production Source: https://github.com/bfritscher/typesense-dashboard/blob/main/README.md Build the application for production. Supports building for all Electron targets. ```bash quasar build ``` ```bash quasar build --mode electron --target all ``` -------------------------------- ### Access Cluster Information with Pinia Store Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Access reactive properties `currentClusterTag` and `clusterMembersForCurrent` to get the currently selected cluster tag and its members, respectively. ```typescript // store.currentClusterTag => 'prod-cluster' | null ``` ```typescript // store.clusterMembersForCurrent => NodeLoginDataInterface[] sorted by host/port/protocol ``` -------------------------------- ### Build Web SPA Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Builds the project into a static web Single Page Application (SPA) for production deployment. ```bash quasar build ``` -------------------------------- ### Run Executable on Linux Source: https://github.com/bfritscher/typesense-dashboard/blob/main/README.md On Linux, make the application executable before running it from the command line. ```bash ./'Typesense-Dashboard' ``` -------------------------------- ### Run Pre-built Docker Image Source: https://github.com/bfritscher/typesense-dashboard/blob/main/README.md Run the latest pre-built Typesense Dashboard Docker image from GitHub Container Registry, exposing port 80. ```bash docker run -d -p 80:80 ghcr.io/bfritscher/typesense-dashboard:latest ``` -------------------------------- ### Initialize and Configure Api Class Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Initializes the Api class with node credentials and configuration. Ensure the NodeConfiguration object is correctly populated with host, port, protocol, and API key. ```typescript import { Api } from 'src/shared/api'; const api = new Api(); // Initialize with node credentials api.init({ node: { host: 'localhost', port: 8108, protocol: 'http', path: '' }, apiKey: 'my-admin-key', connectionTimeoutSeconds: 10, }); ``` -------------------------------- ### Full Typesense Dashboard Configuration with Bookmarks and UI Options Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt This comprehensive JSON configuration includes settings for bookmarks, clusters, and UI customization. It allows pre-populating connection settings, triggering automatic login, and seeding the server history. ```json { "apiKey": "primary-key", "node": { "host": "ts-node1.internal", "port": "8108", "protocol": "http", "path": "", "tls": false }, "connectionTimeoutSeconds": 10, "ui": { "hideProjectInfo": true // hides version/GitHub/issue-tracker from nav }, "history": [ { "apiKey": "primary-key", "node": { "host": "ts-node1.internal", "port": "8108", "protocol": "http", "path": "" }, "clusterTag": "prod" }, { "apiKey": "secondary-key", "node": { "host": "ts-node2.internal", "port": "8108", "protocol": "http", "path": "" }, "clusterTag": "prod" } ] } ``` -------------------------------- ### Mount Configuration File in Docker Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Runs the Docker container and mounts a local `config.json` file to the container's expected path for autologin and bookmarks. ```bash docker run -d -p 80:80 \ -v /path/to/config.json:/srv/config.json \ ghcr.io/bfritscher/typesense-dashboard:latest ``` -------------------------------- ### Build Docker Image for Subfolder Deployment Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Builds the Docker image with a `PUBLIC_PATH` build argument to deploy the dashboard in a subfolder (e.g., `/admin`). ```bash docker build --build-arg PUBLIC_PATH=/admin -t typesense-dashboard . docker run -d -p 80:80 typesense-dashboard ``` -------------------------------- ### Provide Configuration via Base64 Encoded Environment Variable Source: https://github.com/bfritscher/typesense-dashboard/blob/main/README.md Run the Typesense Dashboard Docker container and provide the configuration JSON as a base64 encoded string via the `TYPESENSE_DASHBOARD_CONFIG` environment variable. The container will generate `config.json` at startup. ```bash docker run -d -p 80:80 -e TYPESENSE_DASHBOARD_CONFIG=$(base64 -w 0 /path/to/config.json) typesense-dashboard ``` -------------------------------- ### Configure Node Host to SAME Source: https://github.com/bfritscher/typesense-dashboard/blob/main/README.md Set the `node.host` to "SAME" in the `config.json` to connect to a Typesense node on the same hostname as the dashboard. This automatically resolves host, protocol, and port from `window.location`. ```json { "node": { "host": "SAME", "path": "/api" } } ``` -------------------------------- ### Format Code Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Formats the codebase according to the project's style guidelines. ```bash yarn format ``` -------------------------------- ### Minimal Auto-Login Configuration for Typesense Dashboard Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt This JSON configuration is the minimum required to pre-populate connection settings and trigger an automatic login. Provide this file at `/srv/config.json` (Docker) or via the `TYPESENSE_DASHBOARD_CONFIG` environment variable. ```json { "apiKey": "my-admin-key", "node": { "host": "ts.example.com", "port": "443", "protocol": "https", "path": "", "tls": true } } ``` -------------------------------- ### Format Project Files Source: https://github.com/bfritscher/typesense-dashboard/blob/main/README.md Format code files according to project standards. Supports both yarn and npm. ```bash yarn format ``` ```bash npm run format ``` -------------------------------- ### Inject Configuration via Base64 Environment Variable Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Runs the Docker container and injects the dashboard configuration by passing a base64 encoded `config.json` via the `TYPESENSE_DASHBOARD_CONFIG` environment variable. ```bash docker run -d -p 80:80 \ -e TYPESENSE_DASHBOARD_CONFIG=$(base64 -w 0 /path/to/config.json) \ ghcr.io/bfritscher/typesense-dashboard:latest ``` -------------------------------- ### Create Snapshot with Api Class Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Creates a snapshot of the Typesense data at a specified path. This is useful for backups and migrations. ```typescript // Snapshot await api.createSnapshot('/tmp/typesense-snapshot-2024-01-15T12:00'); ``` -------------------------------- ### Mount Configuration File in Docker Source: https://github.com/bfritscher/typesense-dashboard/blob/main/README.md Run the Typesense Dashboard Docker container and mount a local `config.json` file to `/srv/config.json` within the container. This provides persistent configuration. ```bash docker run -d -p 80:80 -v /path/to/config.json:/srv/config.json typesense-dashboard ``` -------------------------------- ### Lint Project Files Source: https://github.com/bfritscher/typesense-dashboard/blob/main/README.md Run the linter to check for code style issues. Supports both yarn and npm. ```bash yarn lint ``` ```bash npm run lint ``` -------------------------------- ### Manage Search Presets with Api Class Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Defines reusable search configurations as presets. Use `upsertSearchPreset` to create or update a preset and `deleteSearchPreset` to remove it. ```typescript // Search Presets await api.upsertSearchPreset('default-search', { value: { q: '*', sort_by: 'popularity', per_page: 20 }, }); await api.deleteSearchPreset('default-search'); ``` -------------------------------- ### Manage Collections with Api Class Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Demonstrates creating, updating, and dropping collections. The `createCollection` method requires a schema definition, while `updateCollection` allows modifying existing fields. Use `dropCollection` to remove a collection. ```typescript // Collections const collections = await api.getCollections(); // => CollectionSchema[] const newCollection = await api.createCollection({ name: 'products', fields: [ { name: 'title', type: 'string' }, { name: 'price', type: 'float', facet: true }, { name: 'in_stock', type: 'bool', optional: true }, { name: 'description', type: 'string', index: false }, ], default_sorting_field: 'price', }); await api.updateCollection('products', { fields: [{ name: 'rating', type: 'float', optional: true }], }); await api.dropCollection('products'); // Clone a collection schema await api.post('/collections?src_name=products', { name: 'products_v2' }); ``` -------------------------------- ### Search Presets Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Allows defining and managing reusable search query configurations. ```APIDOC ## Search Presets ### Description Allows defining and managing reusable search query configurations. ### Method `upsertSearchPreset({ name: string, value: object })` Creates or updates a search preset. ### Method `deleteSearchPreset(presetName: string)` Deletes a search preset. ``` -------------------------------- ### Snapshot Management Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Method for creating a snapshot of the Typesense data. ```APIDOC ## Snapshot ### Create Snapshot Creates a snapshot of the Typesense data at the specified path. ### Method POST ### Endpoint /snapshots ### Request Body - **path** (string) - Required - The path where the snapshot will be created. ``` -------------------------------- ### Same-Host Mode Configuration for Typesense Dashboard Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt This configuration is used when the dashboard is served via a reverse proxy on the same domain. The dashboard resolves host, port, and protocol from `window.location` at runtime. ```json { "apiKey": "my-key", "node": { "host": "SAME", "path": "/api" } } ``` -------------------------------- ### Server Status Metrics Keys Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Lists the keys used to retrieve system and Typesense-specific metrics from the `/metrics.json` endpoint for monitoring purposes. ```typescript // ── Metrics keys consumed from /metrics.json ───────────────────────────────── // system_cpu_active_percentage → overall CPU bar // system_cpu{N}_active_percentage → per-core circular gauges // system_memory_used_bytes → memory progress bar // system_memory_total_bytes // system_disk_used_bytes → disk progress bar // system_disk_total_bytes // system_network_received_bytes → Rx label // system_network_sent_bytes → Tx label // typesense_memory_* → Typesense memory section ``` -------------------------------- ### Manage Stemming Dictionaries with Pinia Store Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Use `upsertStemmingDictionaries` to add or update custom stemming rules, and `deleteStemmingDictionary` to remove them. Requires the store to be initialized. ```typescript await store.upsertStemmingDictionaries({ id: 'irregular-plurals', words: [{ root: 'mouse', word: 'mice' }, { root: 'foot', word: 'feet' }], }); ``` ```typescript await store.deleteStemmingDictionary('irregular-plurals'); ``` -------------------------------- ### API Keys Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Handles the creation and deletion of API keys with specified permissions and collections. ```APIDOC ## API Keys ### Description Handles the creation and deletion of API keys with specified permissions and collections. ### Method `createApiKey({ description?: string, actions: array, collections: array, expires_at?: number })` Creates a new API key. ### Response - `key.value` (string): The raw API key string (shown once). - `key.id` (number): The ID of the created API key. ### Method `deleteApiKey(apiKeyId: string)` Deletes an API key by its ID. ``` -------------------------------- ### Export Data to JSON with Pinia Store Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Use the `exportToJson` method to download data as a JSON file. This method utilizes `FileSaver.js` for the download process. ```typescript store.exportToJson({ key: 'value' }); // Downloads export.json via FileSaver ``` -------------------------------- ### Import and Export Documents Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Handles the import of documents into a collection using 'upsert' or 'create' actions. It also supports exporting all documents from a collection to a JSONL file for download. ```typescript const importResults = await store.importDocuments({ action: 'upsert', documents: [ { id: '1', title: 'Hello World', body: 'First post', published: true, tags: ['intro'] }, ], }); // => [{ success: true }, ...] ``` ```typescript await store.exportDocuments('articles'); // Downloads articles.jsonl via FileSaver ``` -------------------------------- ### Import and Export Documents with Api Class Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Imports documents into a collection using 'upsert' or 'create' actions. Exports documents as a JSONL string. Ensure the document IDs are unique for 'upsert' operations. ```typescript // Documents await api.importDocuments('products', [ { id: '1', title: 'Widget', price: 9.99, in_stock: true }, { id: '2', title: 'Gadget', price: 49.99, in_stock: false }, ], 'upsert'); // action: 'create' | 'upsert' | 'update' const exported: string = await api.exportDocuments('products'); // => JSONL string, one document per line await api.deleteDocumentById('products', '42'); ``` -------------------------------- ### Server Operations Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Provides methods to perform various server operations like compacting the database, clearing cache, and creating snapshots. ```APIDOC ## operationCompactDB ### Description Initiates a database compaction operation on the Typesense server. ### Method `store.operationCompactDB()` ### Endpoint `POST /operations/db/compact` ## clearCache ### Description Clears the cache on the Typesense server. ### Method `store.clearCache()` ### Endpoint `POST /operations/cache/clear` ## slowQueryThreshold ### Description Sets the threshold for logging slow queries. ### Method `store.slowQueryThreshold(200)` ### Endpoint `POST /config` ### Request Body - **log-slow-requests-time-ms** (number) - Required - The time in milliseconds to consider a query slow. ## createSnapshot ### Description Creates a snapshot of the Typesense database. ### Method `store.createSnapshot('/tmp/backup')` ### Endpoint `POST /operations/snapshot` ### Parameters - **path** (string) - Required - The path where the snapshot will be saved. ``` -------------------------------- ### Manage API Keys Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Enables the creation of API keys with specific permissions (actions, collections) and expiration dates. It also provides functionality to delete existing API keys. The generated key value is shown only once. ```typescript const key = await store.createApiKey({ description: 'Read-only key', actions: ['documents:search'], collections: ['articles'], expires_at: Math.floor(Date.now() / 1000) + 86400 * 30, // 30 days }); // key.value contains the raw key string — shown once! await store.deleteApiKey(String(key.id)); ``` -------------------------------- ### Search Preset Management Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Methods for managing search presets for a collection. ```APIDOC ## Search Presets ### Upsert Search Preset Creates or updates a search preset. ### Method PUT ### Endpoint /search-presets/{presetName} ### Parameters #### Path Parameters - **presetName** (string) - Required - The name of the search preset. ### Request Body - **value** (object) - Required - The search parameters for the preset. - **q** (string) - Optional - The default search query. - **sort_by** (string) - Optional - The default sort order. - **per_page** (integer) - Optional - The default number of results per page. ### Delete Search Preset Deletes a search preset. ### Method DELETE ### Endpoint /search-presets/{presetName} ### Parameters #### Path Parameters - **presetName** (string) - Required - The name of the search preset to delete. ``` -------------------------------- ### Configure Development Proxy with PowerShell Source: https://github.com/bfritscher/typesense-dashboard/blob/main/README.md Set the `DEV_API_PROXY_TARGET` environment variable in PowerShell to proxy `/api` requests to a remote Typesense server during local development, avoiding CORS issues. ```powershell $env:DEV_API_PROXY_TARGET = "https://my-typesense.example.com"; npm run dev ``` -------------------------------- ### Manage API Keys with Api Class Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Creates API keys with specified actions and collection restrictions, and deletes them. The `createApiKey` method returns the key details, including its ID for deletion. ```typescript // API Keys const key = await api.createApiKey({ description: 'Search-only key', actions: ['documents:search'], collections: ['products'], }); await api.deleteApiKey(String(key.id)); ``` -------------------------------- ### Load and Manage Active Collection Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Loads the schema, synonyms, and overrides for a specified collection, setting it as the current collection in the store. This prepares the store for operations specific to that collection. ```typescript store.loadCurrentCollectionByName('articles'); // Sets store.currentCollection, loads synonyms & overrides for that collection ``` -------------------------------- ### Create a Typesense Collection Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Defines and creates a new collection in Typesense. Specify the collection name and its fields with their types and facetability. The action navigates to the collection's schema page upon success. ```typescript await store.createCollection({ name: 'articles', fields: [ { name: 'title', type: 'string' }, { name: 'body', type: 'string' }, { name: 'published', type: 'bool', facet: true }, { name: 'tags', type: 'string[]', facet: true }, ], default_sorting_field: '', }); // Navigates to /collection/articles/schema on success ``` -------------------------------- ### Manage Search Presets Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Allows for the creation (upsert) and deletion of search presets. Search presets define default query parameters that can be applied to searches, simplifying common search configurations. ```typescript await store.upsertSearchPreset({ name: 'full-text', value: { q: '*', query_by: 'title,body' } }); ``` ```typescript await store.deleteSearchPreset('full-text'); ``` -------------------------------- ### Perform Server Operations with Pinia Store Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Execute various server maintenance and configuration tasks using dedicated store methods. These operations often correspond to specific API endpoints. ```typescript await store.operationCompactDB(); // POST /operations/db/compact ``` ```typescript await store.clearCache(); // POST /operations/cache/clear ``` ```typescript await store.slowQueryThreshold(200); // POST /config { log-slow-requests-time-ms: 200 } ``` ```typescript await store.createSnapshot('/tmp/backup'); // POST /operations/snapshot ``` -------------------------------- ### Collection Management Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Provides methods for creating, updating, cloning, and deleting collections in Typesense. ```APIDOC ## Collection Management ### Description Provides methods for creating, updating, cloning, and deleting collections in Typesense. ### Method `createCollection({ name: string, fields: array, default_sorting_field?: string })` Creates a new collection. ### Method `updateCollection({ collectionName: string, schema: object })` Updates an existing collection's schema. ### Method `cloneCollectionSchema({ collectionName: string, destinationName: string })` Clones the schema of one collection to another. ### Method `dropCollection(collectionName: string)` Deletes a collection. ``` -------------------------------- ### Refresh Server Status with Pinia Store Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Call `refreshServerStatus()` to update the store's data regarding server metrics, health, and statistics. ```typescript store.refreshServerStatus(); ``` -------------------------------- ### Authentication Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Handles login, logout, and connection checks for the Typesense instance. It also manages session persistence and feature detection. ```APIDOC ## Authentication ### Description Handles login, logout, and connection checks for the Typesense instance. It also manages session persistence and feature detection. ### Method `login({ apiKey: string, node: object, connectionTimeoutSeconds: number, clusterTag?: string, forceHomeRedirect?: boolean })` Logs into the Typesense instance. ### Method `connectionCheck()` Checks the connection to the Typesense instance and loads collections. ### Properties - `isConnected` (boolean): Indicates if the connection is established. - `error` (string | null): Stores any connection errors. - `data.features` (object): Contains detected features of the Typesense instance. ### Method `logout()` Logs out of the Typesense instance, clears `localStorage`, and redirects to `/login`. ``` -------------------------------- ### Lint Code Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Runs the linter to check for code style and potential errors. ```bash yarn lint ``` -------------------------------- ### Manage Aliases with Api Class Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Manages collection aliases for easier referencing. Use `upsertAlias` to create or update an alias, `getAliases` to retrieve all aliases, and `deleteAlias` to remove one. ```typescript // Aliases await api.upsertAlias({ name: 'products_live', collection_name: 'products' }); const aliases = await api.getAliases(); // => { aliases: CollectionAliasSchema[] } await api.deleteAlias('products_live'); ``` -------------------------------- ### API Key Management Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Methods for creating and deleting API keys. ```APIDOC ## API Keys ### Create API Key Creates a new API key with specified permissions. ### Method POST ### Endpoint /keys ### Request Body - **description** (string) - Optional - A description for the API key. - **actions** (array) - Required - A list of actions the API key can perform. - **collections** (array) - Optional - A list of collections the API key has access to. ### Delete API Key Deletes an existing API key. ### Method DELETE ### Endpoint /keys/{keyId} ### Parameters #### Path Parameters - **keyId** (string) - Required - The ID of the API key to delete. ``` -------------------------------- ### Copy Docker Image Contents Source: https://github.com/bfritscher/typesense-dashboard/blob/main/README.md Copy the contents of the Typesense Dashboard Docker image's `/srv` directory into another Docker image. This is useful for creating custom deployments. ```Dockerfile FROM alpine COPY --from=typesense-dashboard /srv /typesense-dashboard ``` -------------------------------- ### Manage Collection Aliases Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Allows for the creation and deletion of aliases, which are convenient shortcuts pointing to specific collections. The store automatically updates its internal state for aliases after these operations. ```typescript await store.createAlias({ name: 'articles_live', collection_name: 'articles' }); ``` ```typescript await store.deleteAlias('articles_live'); // store.data.aliases is updated automatically ``` -------------------------------- ### Manage Synonyms Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Handles the creation and deletion of synonym rules for a collection. Synonyms allow users to search for related terms interchangeably. The store automatically updates its synonym list. ```typescript await store.createSynonym({ id: 'vehicle-synonyms', synonym: { synonyms: ['car', 'automobile', 'vehicle'] }, }); ``` ```typescript await store.deleteSynonym('vehicle-synonyms'); ``` -------------------------------- ### Typical Search Parameters Object Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt A standard object for defining search queries in Typesense. It includes parameters for keywords, filtering, faceting, sorting, pagination, and typo tolerance. ```typescript const searchParams = { q: 'wireless headphones', query_by: 'title,description', filter_by: 'price:<200 && in_stock:true', facet_by: 'brand,category', sort_by: 'rating:desc,_text_match:desc', page: 1, per_page: 20, exhaustive_search: true, highlight_full_fields: 'title', num_typos: 1, }; ``` -------------------------------- ### Alias Management Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Methods for managing collection aliases. ```APIDOC ## Aliases ### Upsert Alias Creates or updates a collection alias. ### Method PUT ### Endpoint /aliases ### Request Body - **name** (string) - Required - The name of the alias. - **collection_name** (string) - Required - The name of the collection the alias points to. ### Get Aliases Retrieves a list of all collection aliases. ### Method GET ### Endpoint /aliases ### Delete Alias Deletes a collection alias. ### Method DELETE ### Endpoint /aliases/{aliasName} ### Parameters #### Path Parameters - **aliasName** (string) - Required - The name of the alias to delete. ``` -------------------------------- ### Stemming Dictionary Management Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Methods for managing stemming dictionaries for a collection. ```APIDOC ## Stemming Dictionaries ### Upsert Stemming Dictionaries Creates or updates a stemming dictionary. ### Method PUT ### Endpoint /stemming-dictionaries/{dictionaryName} ### Parameters #### Path Parameters - **dictionaryName** (string) - Required - The name of the stemming dictionary. ### Request Body - An array of stemming rules. - **root** (string) - Required - The root word. - **word** (string) - Required - The irregular plural form. ### Get Stemming Dictionary Retrieves a stemming dictionary. ### Method GET ### Endpoint /stemming-dictionaries/{dictionaryName} ### Parameters #### Path Parameters - **dictionaryName** (string) - Required - The name of the stemming dictionary. ``` -------------------------------- ### Perform a Typesense Search Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Executes a search query against a Typesense collection with various parameters like query string, fields to search, filtering, faceting, sorting, and pagination. The result is typed as `SearchResponse`. ```typescript const results = await store.search({ q: 'hello', query_by: 'title,body', filter_by: 'published:true', facet_by: 'tags', sort_by: '_text_match:desc', page: 1, per_page: 25, exhaustive_search: true, }); // => SearchResponse ``` -------------------------------- ### Manage Stemming Dictionaries with Api Class Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Manages custom stemming dictionaries, such as irregular plurals. Use `upsertStemmingDictionaries` to add or update entries and `getStemmingDictionary` to retrieve the dictionary. ```typescript // Stemming Dictionaries await api.upsertStemmingDictionaries('irregular-plurals', [ { root: 'person', word: 'people' }, { root: 'child', word: 'children' }, ]); const dict = await api.getStemmingDictionary('irregular-plurals'); ``` -------------------------------- ### Synonym Management Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Methods for managing synonyms for a collection. ```APIDOC ## Synonyms ### Upsert Synonym Creates or updates synonyms for a collection. ### Method PUT ### Endpoint /collections/{collectionName}/synonyms/{synonymId} ### Parameters #### Path Parameters - **collectionName** (string) - Required - The name of the collection. - **synonymId** (string) - Required - The ID of the synonym. ### Request Body - For multi-way synonyms: - **synonyms** (array) - Required - A list of words that are synonyms of each other. - For one-way synonyms: - **root** (string) - Required - The root word. - **synonyms** (array) - Required - A list of words that are synonyms of the root word. ### Delete Synonym Deletes a synonym from a collection. ### Method DELETE ### Endpoint /collections/{collectionName}/synonyms/{synonymId} ### Parameters #### Path Parameters - **collectionName** (string) - Required - The name of the collection. - **synonymId** (string) - Required - The ID of the synonym to delete. ``` -------------------------------- ### JSON Export Helper Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt A utility method to export data to a JSON file. ```APIDOC ## exportToJson ### Description Exports the provided data object to a JSON file named 'export.json'. ### Method `store.exportToJson({ key: 'value' })` ### Parameters - **data** (object) - Required - The data object to export. ``` -------------------------------- ### Manage Overrides (Curations) with Api Class Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Defines rules to curate search results, including including or excluding specific documents for given queries. Use `upsertOverride` to manage these rules and `deleteOverride` to remove them. ```typescript // Overrides (Curations) await api.upsertOverride('products', 'override-1', { rule: { query: 'apple', match: 'exact' }, includes: [{ id: '422', position: 1 }], excludes: [{ id: '287' }], }); await api.deleteOverride('products', 'override-1'); ``` -------------------------------- ### Manage Stopwords with Pinia Store Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Use `upsertStopwords` to add or update stopwords for a given locale, and `deleteStopwords` to remove them. Requires the store to be initialized. ```typescript await store.upsertStopwords({ id: 'common-en', locale: 'en', stopwords: ['the', 'is', 'at'] }); ``` ```typescript await store.deleteStopwords('common-en'); ``` -------------------------------- ### Aliases Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Manages aliases for collections, allowing for easier referencing and management. ```APIDOC ## Aliases ### Description Manages aliases for collections, allowing for easier referencing and management. ### Method `createAlias({ name: string, collection_name: string })` Creates a new alias for a collection. ### Method `deleteAlias(aliasName: string)` Deletes an alias. ``` -------------------------------- ### Manage Login History with Pinia Store Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Utilize methods like `setHistoryTag`, `removeHistoryTag`, `removeHistoryAt`, and `clearHistory` to manage the login history data stored within the Pinia store. ```typescript store.setHistoryTag(0, 'prod-cluster'); // tag index 0 with cluster name ``` ```typescript store.removeHistoryTag(0); ``` ```typescript store.removeHistoryAt(2); ``` ```typescript store.clearHistory(); ``` -------------------------------- ### Login History Management Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Methods for managing and manipulating the login history data. ```APIDOC ## setHistoryTag ### Description Tags a specific entry in the login history with a cluster name. ### Method `store.setHistoryTag(0, 'prod-cluster')` ### Parameters - **index** (number) - Required - The index of the history entry to tag. - **tagName** (string) - Required - The name of the tag to apply. ## removeHistoryTag ### Description Removes the tag from a specific entry in the login history. ### Method `store.removeHistoryTag(0)` ### Parameters - **index** (number) - Required - The index of the history entry to remove the tag from. ## removeHistoryAt ### Description Removes a login history entry at a specific index. ### Method `store.removeHistoryAt(2)` ### Parameters - **index** (number) - Required - The index of the history entry to remove. ## clearHistory ### Description Clears all entries from the login history. ### Method `store.clearHistory()` ``` -------------------------------- ### Manage Analytics Rules with Api Class Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Configures analytics rules, such as identifying popular queries. Specify source collections, destination collections, and limits for the analysis. Use `upsertAnalyticsRule` and `deleteAnalyticsRule`. ```typescript // Analytics Rules await api.upsertAnalyticsRule('popular-queries', { type: 'popular_queries', params: { source: { collections: ['products'] }, destination: { collection: 'products_analytics' }, limit: 100, expand_query: false, }, }); await api.deleteAnalyticsRule('popular-queries'); ``` -------------------------------- ### Document Management Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Methods for importing, exporting, and deleting documents within a collection. ```APIDOC ## Documents ### Import Documents Imports documents into a collection. Supports `create`, `upsert`, and `update` actions. ### Method POST ### Endpoint /collections/{collectionName}/documents/import ### Parameters #### Path Parameters - **collectionName** (string) - Required - The name of the collection. #### Query Parameters - **action** (string) - Optional - The action to perform (`create`, `upsert`, `update`). Defaults to `upsert`. ### Request Body - Documents in JSONL format (one JSON object per line). ### Export Documents Exports all documents from a collection in JSONL format. ### Method GET ### Endpoint /collections/{collectionName}/documents/export ### Parameters #### Path Parameters - **collectionName** (string) - Required - The name of the collection. ### Delete Document By ID Deletes a specific document from a collection by its ID. ### Method DELETE ### Endpoint /collections/{collectionName}/documents/{documentId} ### Parameters #### Path Parameters - **collectionName** (string) - Required - The name of the collection. - **documentId** (string) - Required - The ID of the document to delete. ``` -------------------------------- ### Manage Synonyms with Api Class Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Configures synonyms for a collection, supporting both multi-way and one-way synonym definitions. Use `upsertSynonym` to add or update, and `deleteSynonym` to remove. ```typescript // Synonyms await api.upsertSynonym('products', 'syn-1', { synonyms: ['phone', 'mobile', 'handset'], // multi-way }); await api.upsertSynonym('products', 'syn-2', { root: 'sneaker', synonyms: ['trainer', 'running shoe'], // one-way }); await api.deleteSynonym('products', 'syn-1'); ``` -------------------------------- ### Stemming Dictionaries Management Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Methods for managing stemming dictionaries. This allows for the addition and removal of custom stemming rules. ```APIDOC ## upsertStemmingDictionaries ### Description Adds or updates a stemming dictionary with custom word rules. ### Method `store.upsertStemmingDictionaries({ id: 'irregular-plurals', words: [{ root: 'mouse', word: 'mice' }, { root: 'foot', word: 'feet' }] })` ### Parameters - **id** (string) - Required - Identifier for the stemming dictionary. - **words** (array of objects) - Required - A list of word mappings, each with a `root` and `word` property. - **root** (string) - Required - The root form of the word. - **word** (string) - Required - The irregular form of the word. ## deleteStemmingDictionary ### Description Deletes a stemming dictionary by its identifier. ### Method `store.deleteStemmingDictionary('irregular-plurals')` ### Parameters - **id** (string) - Required - The identifier of the stemming dictionary to delete. ``` -------------------------------- ### Synonyms Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Manages synonyms for search terms within a collection. ```APIDOC ## Synonyms ### Description Manages synonyms for search terms within a collection. ### Method `createSynonym({ id: string, synonym: object })` Creates a new synonym configuration. ### Method `deleteSynonym(synonymId: string)` Deletes a synonym configuration. ``` -------------------------------- ### Manage Overrides (Curations) Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Allows the creation and deletion of override rules, which can be used to boost specific documents or results for certain queries. This is useful for curating search results. ```typescript await store.createOverride({ id: 'boost-featured', override: { rule: { query: 'best laptops', match: 'contains' }, includes: [{ id: 'laptop-pro', position: 1 }], }, }); ``` ```typescript await store.deleteOverride('boost-featured'); ``` -------------------------------- ### Override Management Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Methods for managing overrides (curations) for a collection. ```APIDOC ## Overrides (Curations) ### Upsert Override Creates or updates an override rule for a collection. ### Method PUT ### Endpoint /collections/{collectionName}/overrides/{overrideId} ### Parameters #### Path Parameters - **collectionName** (string) - Required - The name of the collection. - **overrideId** (string) - Required - The ID of the override rule. ### Request Body - **rule** (object) - Required - The rule definition. - **query** (string) - Required - The query string to match. - **match** (string) - Required - The match type (`exact`, `contains`, `starts_with`, `ends_with`). - **includes** (array) - Optional - A list of document IDs to include at specific positions. - **id** (string) - Required - The document ID. - **position** (integer) - Required - The position to insert the document. - **excludes** (array) - Optional - A list of document IDs to exclude. - **id** (string) - Required - The document ID. ### Delete Override Deletes an override rule from a collection. ### Method DELETE ### Endpoint /collections/{collectionName}/overrides/{overrideId} ### Parameters #### Path Parameters - **collectionName** (string) - Required - The name of the collection. - **overrideId** (string) - Required - The ID of the override rule to delete. ``` -------------------------------- ### Active Collection Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Manages the currently active collection, loading its synonyms and overrides. ```APIDOC ## Active Collection ### Description Manages the currently active collection, loading its synonyms and overrides. ### Method `loadCurrentCollectionByName(collectionName: string)` Sets the current collection and loads its associated synonyms and overrides. ``` -------------------------------- ### Raw HTTP Endpoints Source: https://context7.com/bfritscher/typesense-dashboard/llms.txt Methods for accessing raw HTTP endpoints not covered by the SDK. ```APIDOC ## Raw HTTP Endpoints ### Get Metrics Retrieves system metrics. ### Method GET ### Endpoint /metrics.json ### Get Health Checks the health of the Typesense instance. ### Method GET ### Endpoint /health ### Compact Database Initiates a database compaction operation. ### Method POST ### Endpoint /operations/db/compact ### Clear Cache Clears the Typesense cache. ### Method POST ### Endpoint /operations/cache/clear ### Update Configuration Updates the Typesense configuration. ### Method POST ### Endpoint /config ### Request Body - Key-value pairs for configuration settings (e.g., `log-slow-requests-time-ms`). ```