feat(supabase): workspaces and clients access layer with closed failures

fetchPersonalWorkspaceId, client search (keyset, one probe row), read by id
with explicit columns, create (request id), update (every field), archive,
client animals and archive preview, species labels; RecordFailure kinds of
contract §9.4 plus session_expired and network; RPC answers checked by Zod.
Unit tests and the same functions against real PostgREST on the sandbox.
This commit is contained in:
bchanot committed 2026-10-26 01:34:45 +01:00
1 parent 6251051618
commit a0e069959b
7 files changed
+1136

No files matched your search

+44
View File
@@ -89,3 +89,47 @@ export type SheetVisibility = Enums<'sheet_visibility'>
export type SheetStatus = Enums<'sheet_status'>
/** draft | published | deprecated. */
export type SheetVersionStatus = Enums<'sheet_version_status'>
export {
RECORD_FAILURE_KINDS,
RecordFailure,
classifyRecordError,
type RecordFailureKind,
type RecordPage,
} from './records'
export { fetchPersonalWorkspaceId } from './workspaces'
export { fetchSpeciesLabels, type SpeciesLabel } from './species'
export {
CLIENT_COLUMNS,
createClientRecord,
fetchClientArchivePreview,
fetchClientRecord,
listClientAnimals,
searchClients,
setClientArchived,
updateClientRecord,
type AnimalRelationRole,
type AnimalSex,
type ClientAnimalItem,
type ClientArchivePreview,
type ClientFields,
type ClientKind,
type ClientListItem,
type ClientRecord,
type ClientSearch,
type CreateClientInput,
type NameCursor,
type RelationCursor,
type UpdateClientInput,
} from './clients'
export {
ANIMAL_FIELD_LIMITS,
BIRTH_YEAR_MIN,
CLIENT_FIELD_LIMITS,
CONTROL_CHARACTERS,
COUNTRY_CODE_PATTERN,
EMAIL_PATTERN,
PHONE_E164_PATTERN,
RECORD_DATE_MIN,
codePointLength,
isCleanText,
} from './field-limits'