Skip to content

PERS SDK - v2.3.26 / Exports / ApiResponse

Interface: ApiResponse<T>

Generic API response wrapper for client-side operations Provides consistent structure for success/error handling

Aligns with StructuredError pattern from @explorins/pers-shared Note: PERS API endpoints return DTOs directly (not wrapped in success/data) This is for client-side consistency when apps need response wrappers

Type parameters

Name
T

Table of contents

Properties

Properties

success

success: boolean

Indicates if the operation was successful

Defined in

shared/interfaces/pers-shared-lib.interfaces.ts:32


data

data: T

Response data (present on success)

Defined in

shared/interfaces/pers-shared-lib.interfaces.ts:34


message

Optional message: string

Optional success message

Defined in

shared/interfaces/pers-shared-lib.interfaces.ts:36


error

Optional error: Object

Structured error details (present on failure)

Type declaration

NameTypeDescription
codestringError code (e.g., 'INVALID_REQUEST', 'NOT_FOUND')
messagestringUser-friendly error message
details?unknownAdditional error context

Defined in

shared/interfaces/pers-shared-lib.interfaces.ts:38