Skip to content

Interface: IETagProvider ​

Defined in: interfaces/etag.interface.ts:13

Interface for computing and validating ETags for OData entities.

Implementations are adapter-specific (e.g., TypeOrmETagProvider). Core uses this interface without importing any ORM code.

Methods ​

computeETag() ​

computeETag(entity, etagColumn): string

Defined in: interfaces/etag.interface.ts:25

Compute a weak ETag string from an entity's ETag column value. Format: W/"<value>"

Parameters ​

entity ​

Record<string, unknown>

etagColumn ​

string

Returns ​

string


getETagColumn() ​

getETagColumn(entitySetName): string | undefined

Defined in: interfaces/etag.interface.ts:19

Get the ETag column name for an entity set. Returns undefined if the entity set is not ETag-enabled (no

Parameters ​

entitySetName ​

string

Returns ​

string | undefined

Update Date Column ​

or

OData ETag ​

decorator found).


validateIfMatch() ​

validateIfMatch(ifMatchValue, entity, etagColumn): boolean

Defined in: interfaces/etag.interface.ts:32

Validate an If-Match header value against the current entity state. Returns true if the ETag matches (proceed with mutation), false if the ETag is stale (return 412).

Parameters ​

ifMatchValue ​

string

entity ​

Record<string, unknown>

etagColumn ​

string

Returns ​

boolean