Skip to content

@univ-lehavre/atlas-redcap-client ​

Description ​

REDCap API client for @univ-lehavre/crf.

Example ​

typescript
import { Effect } from 'effect';
import {
  createRedcapClient,
  RedcapUrl,
  RedcapToken
} from '@univ-lehavre/crf/redcap';

const client = createRedcapClient({
  url: RedcapUrl('https://redcap.example.com/api/'),
  token: RedcapToken('AABBCCDD11223344AABBCCDD11223344'),
});

const version = await Effect.runPromise(client.getVersion());

Classes ​

ClassDescription
RedcapApiErrorAPI error response from REDCap
RedcapClientServiceEffect Context Tag for the REDCap Client Service.
RedcapHttpErrorHTTP error response from REDCap.
RedcapNetworkErrorNetwork/transport error
UnsupportedVersionErrorError when REDCap version is not supported
VersionParseErrorError parsing a version string

Interfaces ​

InterfaceDescription
components-
ExportRecordsOptionsOptions for exporting records from REDCap.
ImportRecordsOptionsOptions for importing records into REDCap.
operations-
pathsThis file was auto-generated by openapi-typescript. Do not make direct changes to the file.
RedcapAdapterInterface for adapting REDCap API requests/responses based on server version.
RedcapClientREDCap API client interface.
RedcapConfigConfiguration for REDCap API client.
RedcapFeaturesFeature flags indicating what's available in a REDCap version.
VersionParsed version object

Type Aliases ​

Type AliasDescription
BooleanFlagBinary flag (0 or 1)
EmailEmail address
ErrorResponse-
ExportFieldName-
Field-
ImportResult-
Instrument-
InstrumentNameREDCap instrument (form) name
IsoTimestampISO 8601 timestamp
NonEmptyStringNon-empty string
PositiveIntPositive integer (>= 1)
ProjectInfo-
RecordIdREDCap record identifier
RedcapClientErrorAll possible errors from the REDCap client.
RedcapErrorUnion of all REDCap errors
RedcapTokenREDCap API token (32 uppercase hex characters).
RedcapUrlBranded type for REDCap API URL. Alias for SafeApiUrl from @univ-lehavre/atlas-net.
SupportedVersionStringType alias for version strings in SUPPORTED_VERSIONS. Since SUPPORTED_VERSIONS is typed as readonly string[], this is effectively string.
TransformedParamsParameters for REDCap API requests after transformation.
UserIdREDCap user ID (username)

Variables ​

VariableDescription
compareVersionsCompare two versions
EmailValidate and brand a string as Email
formatVersionFormat a Version object as a string
fromBooleanFlagConvert BooleanFlag to boolean
getMajorVersionGet the major version number
InstrumentNameValidate and brand a string as InstrumentName
IsoTimestampValidate and brand a string as IsoTimestamp
isVersionAtLeastCheck if current version is at least the minimum version
isVersionInRangeCheck if current version is within the specified range [min, max)
isVersionLessThanCheck if current version is less than the maximum version
NonEmptyStringValidate and brand a string as NonEmptyString
parseVersionParse a version string into a Version object using Effect.
PositiveIntValidate and brand a number as PositiveInt
RecordIdValidate and brand a string as RecordId
RedcapTokenValidate and brand a string as RedcapToken.
RedcapUrl-
SUPPORTED_VERSIONSKnown supported REDCap versions
toBooleanFlagConvert boolean to BooleanFlag
UserIdValidate and brand a string as UserId

Functions ​

FunctionDescription
createRedcapClientCreates a new REDCap API client instance.
escapeFilterLogicValueEscapes special characters in a value to be used in REDCap filterLogic. Prevents injection attacks by escaping double quotes and backslashes.
getAdapterGet the adapter for a specific REDCap version. Prefer using getAdapterEffect for better error handling.
getAdapterEffectGet the adapter for a specific REDCap version as an Effect.
getLatestAdapterGet the latest adapter (for the newest supported version).
getMinSupportedVersionGet the minimum supported version.
getSupportedVersionRangesGet all supported version ranges.
isVersionSupportedCheck if a version is supported.
makeRedcapClientLayerCreates an Effect Layer providing the RedcapClientService.

References ​

BooleanFlagType ​

Renames and re-exports BooleanFlag


EmailType ​

Renames and re-exports Email


InstrumentNameType ​

Renames and re-exports InstrumentName


IsoTimestampType ​

Renames and re-exports IsoTimestamp


NonEmptyStringType ​

Renames and re-exports NonEmptyString


PositiveIntType ​

Renames and re-exports PositiveInt


RecordIdType ​

Renames and re-exports RecordId


RedcapTokenType ​

Renames and re-exports RedcapToken


RedcapUrlType ​

Renames and re-exports RedcapUrl


UserIdType ​

Renames and re-exports UserId