Skip to content

Latest commit

 

History

History
142 lines (108 loc) · 2.9 KB

File metadata and controls

142 lines (108 loc) · 2.9 KB
title Odata
description Odata protocol schemas

Odata

**Source:** `packages/spec/src/api/odata.zod.ts`

TypeScript Usage

import { ODataConfigSchema, ODataErrorSchema, ODataFilterFunctionSchema, ODataFilterOperatorSchema, ODataMetadataSchema, ODataQuerySchema, ODataResponseSchema } from '@objectstack/spec/api';
import type { ODataConfig, ODataError, ODataFilterFunction, ODataFilterOperator, ODataMetadata, ODataQuery, ODataResponse } from '@objectstack/spec/api';

// Validate data
const result = ODataConfigSchema.parse(data);

ODataConfig

Properties

Property Type Required Description
enabled boolean optional Enable OData API
path string optional OData endpoint path
metadata object optional OData metadata configuration

ODataError

Properties

Property Type Required Description
error object

ODataFilterFunction

Allowed Values

  • contains
  • startswith
  • endswith
  • length
  • indexof
  • substring
  • tolower
  • toupper
  • trim
  • concat
  • year
  • month
  • day
  • hour
  • minute
  • second
  • date
  • time
  • now
  • maxdatetime
  • mindatetime
  • round
  • floor
  • ceiling
  • cast
  • isof
  • any
  • all

ODataFilterOperator

Allowed Values

  • eq
  • ne
  • lt
  • le
  • gt
  • ge
  • and
  • or
  • not
  • (
  • )
  • in
  • has

ODataMetadata

Properties

Property Type Required Description
namespace string Service namespace
entityTypes object[] Entity types
entitySets object[] Entity sets

ODataQuery

Properties

Property Type Required Description
$select string | string[] optional Fields to select
$filter string optional Filter expression (OData filter syntax)
$orderby string | string[] optional Sort order
$top integer optional Max results to return
$skip integer optional Results to skip
$expand string | string[] optional Navigation properties to expand
$count boolean optional Include total count
$search string optional Search expression
$format Enum<'json' | 'xml' | 'atom'> optional Response format
$apply string optional Aggregation expression

ODataResponse

Properties

Property Type Required Description
@odata.context string optional Metadata context URL
@odata.count integer optional Total results count
@odata.nextLink string optional Next page URL
value Record<string, any>[] Results array