Skip to main content

Utilities

Helper functions exported by @conduction/nextcloud-vue. Each function has its own reference page.

HTTP​

FunctionPurpose
buildHeadersBuild Nextcloud OCS request headers (CSRF token + flags)
buildQueryStringSerialise a params object into a URL query string

Errors​

All three error helpers return the same ApiError shape so consumers can surface them uniformly regardless of source.

FunctionUse when
parseResponseErrorresponse.ok === false — an HTTP response was received
networkErrorfetch threw a TypeError — no response (offline/DNS/CORS)
genericErrorAny other caught exception

Schema​

Helpers that derive UI structure from an OpenRegister / JSON Schema.

FunctionPurpose
columnsFromSchemaGenerate CnDataTable column definitions
filtersFromSchemaGenerate filter definitions from facetable properties
fieldsFromSchemaGenerate form field descriptors (widget, validation, required)
formatValueFormat a raw value for display using a property descriptor

Manifest​

Helpers that back the JSON-manifest renderer. Most consumers never call these directly — they are wired up automatically inside useAppManifest — but they are exported for advanced loaders and CLI manifest checkers.

FunctionPurpose
validateManifestValidate an app manifest against the JSON Schema (build-time and runtime)
resolveManifestSentinelsSubstitute @resolve:<key> strings under pages[].config with their IAppConfig values
clearResolveCacheReset the per-page IAppConfig resolution cache (test-only)

Widget visibility​

Used by the dashboard composable and any custom widget loader that wants the same user/group visibility rules.

FunctionPurpose
filterWidgetsByVisibilityAsync filter of widget definitions for the current user
isWidgetVisibleSync predicate for a single widget
getCurrentUserIdRead OC.currentUser
getCurrentUserGroupsFetch (and cache) the current user's groups
resetVisibilityCacheClear the cached groups

@nextcloud/vue puts every NcModal / NcDialog mask on the same z-index, so two open dialogs tie and the lower one intercepts the clicks aimed at the upper one. These give each open modal its own layer in open order. CnAppRoot wires them up automatically.

FunctionPurpose
installModalStackMake the most recently opened modal the one that receives pointer events
uninstallModalStackStop the observer and release every layer

Composables​

Vue 3 composables live under utilities/composables/.