Composables
All composables are auto-imported.
| Composable | Purpose |
|---|---|
useMongocampAdmin | User and role CRUD |
useMongocampCollectionPaging | Reactive state for paginated collection queries |
useMongocampDocument | Document-level helpers (metadata stamping, partial updates) |
useMongocampSchema | Infers a schema from sampled documents; generates a matching TS interface |
useMongocampFiles | GridFS bucket detection, file-id resolution, upload (also uploadFiles)/download/fetchFileBlob |
useMongocampIndex | Create/list/delete MongoDB indexes (standard, unique, text, expiring) |
useMongocampJobs | List/register/update/execute/delete scheduled background jobs |
useMongocampWebhooks | Outbound webhooks (server 3.0): list, create (secret once), update, remove, deliveries |
useMongocampQueue | The job queue (server 3.0): list by state/name, retry, delete |
useMongocampAccount | Account self-service: profile, password change, API key regeneration |
useMongocampMaintenance | list/run backups and migrations (server 2.11, administrators) |
useMongocampSystem | Read-only database viewer (list, per-database info, collections), cluster members and masked server settings |
useMongocampExport | rowsToCsv and downloadTextFile for exporting rows already on screen |
useMongocampFilterBuilder | Turns filter rows (field, operator, value) into one Lucene query; type-aware operators, injection-safe |
useMongocampAdminGate | blocked / message for components that need an administrator: show "administrators only" without a request |
useMongocampFieldTypes | field paths with the types of their values for a collection (fields/detail, cached): filter fields, write hints |
useMongocampDeclaration | the declaration of a collection (server 2.3: behaviours, system/protected fields), cached per collection and user; 404 ⇒ null |
useMongocampSelf | who "I" am in both auth modes: the signed-in user, or in proxy mode the api key's user (asked once) |
useMongocampLimits | the limits of the server (2.6: body, page rows, export documents, upload, import), cached per user; empty = unknown |
useMongocampReferenceOptions | the reference picker's choices: search a declared reference's target by name, label ids (cached per user), read grant |
useMongocampHistory | audit records of a document or a collection (server 2.3), paged display rows, longs exact |
useMongocampViews | runs a declared view (server 2.10) with parameters, one page, longs exact |
useMongocampDrafts | publish / unpublish / discard the working copy of a document (server 2.11 drafts) |
useMongocampSessions | the signed-in user's own sessions (server 3.0): list (null = no sessions), revoke, revokeOthers |
useMongocampSoftDelete | restoreDocument of a soft-deleted document (server 2.3); 404 ⇒ 'notDeleted' |
useMongocampBulkByFilter | countDocuments / deleteByFilter / updateByFilter: one request each by the Lucene filter of the list |
useMongocampBulkDelete | runBulkDelete: delete many items with limited concurrency (or one request per chunk) and a per-item failure report |
useMongocampImport | importRows: insert documents in batches with a per-batch failure report; importNdjson: send a NDJSON file to the server as it is |
useMongocampAggregation | runAggregation (server-side paging, optional count=none, deny-listed stages refused), listDistinct, sampleDocuments, readable aggregation errors |
useMongocampError | Maps API errors (network / 401 / 403 / 404 / other) to readable messages |
useMongocampQuery | High-level Lucene query helpers (equals, like, inRange, and, or, …) |
useMongocampQueryBuilder | Low-level Lucene syntax builder used by useMongocampQuery |
useMongocampExtendedJson | Converts MongoDB extended-JSON documents to/from the plain values FUAutoForm binds to |
useMongocampConnection | Can the server be reached? online / offline / unreachable, check(), report(error); kept current with the offline option |
useMongocampSession | Is the login still usable? Token-expiry check (no request), optional server check (verify), invalidateSession |
useMongocampRoles | Role/route-pattern access checks (isAdmin, isManager, canSeeAdmin, canSeeManagement, isAllowedPathForRoute, isLogoutRoute); powers the global nav guard |
useMongocampCollectionNames | The collection names, loaded once and shared (sidebar, switcher, panel), split into collections / buckets / mc_* |
useMongocampNavigation | The module's pages as role-aware, translated navigation data (groups, and menu for UNavigationMenu) |
useMongocampBreadcrumbs | The breadcrumb of the current route among the module's pages |
useMongocampPaths | The base routes of the app's MongoCamp pages (module option paths) — what the components' *Path props fall back to |
useMongocampProxyMode | true in server proxy mode (no login, the api key decides) |
useMongocampUi | The module's look from app.config.ts (nuxtUiMongocamp.ui), merged over the defaults |
useMongocampPermissions | May the user read / write / administer a collection? From GET /auth/permissions (never from the session); UI-level gating that fails open |
useMongocampFetchAll | Reads every page of a document or file list by cursor, with a cap, progress and abort (fetchAllDocuments, fetchAllFiles); rows are relaxed Extended JSON |
useMongocampExportAll | Exports a whole collection or filter as JSON, NDJSON (relaxed or canonical Extended JSON) or CSV, streamed by the server (progress, abort; exact 64-bit integers) |
useMongocampPersistedState | A ref remembered in localStorage (versioned, size-capped, never throws) |
useMongocampSavedQueries | Saved filters and recent history per collection, browser-only, validated and capped; JSON export/import |
useMongocampAutoRefresh | Interval loads for live views: no overlap, backoff, pauses in a hidden tab, stops on unmount |
useMongocampCollectionStats | Typed storage sizes and per-index usage ($indexStats, host stripped) of one collection |
useMongocampCollectionCopy | Copy a collection into a new one (copyCollection) and a timestamped quick backup (backupCollection) |
useMongocampSavedPipelines | Saved aggregation pipelines per collection, browser-only, re-checked against the deny-list on every read |
useMongocampServerOverview | Databases, per-collection sizes (one request for all, capped), cluster and jobs in one call; parts fail independently |
useMongocampClientApi | Mode-switching drop-in for useMongocampApi() — session or server proxy mode |
useMongocampProxyApi | The server-proxy-mode branch useMongocampClientApi switches to |
@sfxcode/nuxt-mongocamp-server additionally provides useMongocampApi() (raw API clients: adminApi, collectionApi, documentApi, fileApi, bucketApi, systemApi, …) and useMongocampAuth() (login, logout, isLoggedIn) — this module's composables are built on top of those. In server code (Nitro routes and plugins) the dependency's client is useMongocampEventApi(event, token?) since 2.8; the old server-side name useMongocampApi(event) is deprecated (it clashed with the browser composable) and goes in 3.0.