Init
This commit is contained in:
81
src/Gridler/utils/golang-restapi-v2/types.ts
Normal file
81
src/Gridler/utils/golang-restapi-v2/types.ts
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user