UNPKG

@accounter/server

Version:
22 lines (21 loc) 1.01 kB
import type { BusinessScopeParseResult } from '../shared/types/auth.js'; /** * Request header carrying the requested multi-business read scope: a * comma-separated list of business UUIDs. Read case-insensitively, matching how * other auth headers are read in the auth plugin. */ export declare const BUSINESS_SCOPE_HEADER = "x-business-scope"; /** * Parse the `X-Business-Scope` header value into a requested read scope. * * - A missing or blank header is `absent` (no narrowing — callers default to * all accessible businesses). * - Entries are split on commas and trimmed. An empty entry (e.g. a trailing * comma or `a,,b`) is a malformed `EMPTY_ENTRY`; a non-UUID entry is * `INVALID_UUID`. * - Valid ids are lower-cased and de-duplicated, preserving first-seen order. * * Pure utility — does not consult auth state and is not wired into auth * decisions here. */ export declare function parseBusinessScopeHeader(headerValue: string | null | undefined): BusinessScopeParseResult;