This commit is contained in:
Hein
2025-09-19 14:06:53 +02:00
commit 46dabed765
55 changed files with 9856 additions and 0 deletions

View File

@@ -0,0 +1,81 @@
export type APIOptionsType = {
autocreate?: boolean
autoref?: boolean
baseurl?: string
getAPIProvider?: () => { provider: string; providerKey: string }
getAuthToken?: () => string
operations?: Array<FetchAPIOperation>
postfix?: string
prefix?: string
requestTimeoutSec?: number
}
export interface APIResponse {
errmsg: string
payload?: any
retval: number
}
export interface FetchAPIOperation {
name?: string
op?: string
type: FetchOpTypes //x-fieldfilter
value: string
}
export type FetchOpTypes = GoAPIEnum & string
/**
* @description Types for the Go Rest API headers
* @typedef {String} GoAPIEnum
*/
export type GoAPIEnum = 'advsql'
| 'api-key'
| 'api-range-from'
| 'api-range-size'
| 'api-range-total'
| 'api-src'
| 'api'
| 'association_autocreate'
| 'association_autoupdate'
| 'association-update'
| 'cql-sel'
| 'custom-sql-join'
| 'custom-sql-or'
| 'custom-sql-w'
| 'detailapi'
| 'distinct'
| 'expand'
| 'fetch-rownumber'
| 'fieldfilter'
| 'fieldfilter'
| 'func'
| 'limit'
| 'no-return'
| 'not-select-fields'
| 'offset'
| 'parm'
| 'pkrow'
| 'preload'
| 'searchfilter'
| 'searchfilter'
| 'searchop'
| 'searchop'
| 'select-fields'
| 'simpleapi'
| 'skipcache'
| 'skipcount'
| 'sort'
export type GoAPIHeaderKeys = `x-${GoAPIEnum}`
export type MetaCallback = (data: MetaData) => void
export interface MetaData {
limit?: number
offset?: number
total?: number
}