fetchEndpointSource
One-shot cached fetch of a Wave-2 endpointSource block — the imperative sibling of useEndpointSource for Options-API fetch flows and services.
import { fetchEndpointSource } from '@conduction/nextcloud-vue'
const payload = await fetchEndpointSource(
{ url: '/apps/pipelinq/api/analytics/overview', params: { period: '@workspace.datePreset?' }, responsePath: 'summary' },
{ workspace: { datePreset: 'month' } }, // token context
{ force: false }, // force: true bypasses the shared cache
)
Behaviour (shared with the composable):
paramsvalues resolve through the SAME@-token grammar widget filters use; optional (…?) tokens drop when unresolved, an unresolved REQUIRED token returnsnullwithout a request.- Requests dedupe + short-TTL cache per
(method, url, resolved params)— module-wide, so concurrent callers share ONE http call. - The response is plucked at
responsePath(dot-path);undefinedplucks returnnull. - App-relative URLs route through
generateUrl; absolute (http/https) URLs pass untouched. method: 'POST'sends the resolved params as the JSON body.
See invalidateEndpointSourceCache to drop the shared cache.