Files
directus/packages/shared/src/constants/fields.ts
Rijk van Zanten 90f5b0a471 Add functions support to the app + add count function (#12488)
* Rename date functions to fn, add json_array_length for pg

* Add json count to mssql

* Add json array count support to other vendors

* Add UI for selecting API functions

* Make it not break

* Render functions in filter preview better

* Include functions in field altering

* Add schema access to database helper

* Allow filtering against o2m/m2m/m2a count

* Add data function execution helpers in utils

* Fix type issue

* Inject function results in validate step

* Render field keys with function names translated

* Allow selecting nested/functions in field validation step

* Make sure number comparisons are treated as numbers

* Add check if instanceof date when casting to a Number

* Prevent selecting foreign keys for junction sort (#12463)

* [SDK] Add further request options to `items` functions (#12503)

* add possibility to set further options to the request

* fix options type

* add typings to interface

* add test if headers are passed thourght

* create reusable options param

* set higher priority to options param

* Small stylistic cleanup

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Jürg Hunziker <juerg.hunziker@gmail.com>
2022-03-31 16:56:26 -04:00

54 lines
868 B
TypeScript

export const TYPES = [
'alias',
'bigInteger',
'boolean',
'date',
'dateTime',
'decimal',
'float',
'integer',
'json',
'string',
'text',
'time',
'timestamp',
'binary',
'uuid',
'hash',
'csv',
'geometry',
'geometry.Point',
'geometry.LineString',
'geometry.Polygon',
'geometry.MultiPoint',
'geometry.MultiLineString',
'geometry.MultiPolygon',
'unknown',
] as const;
export const GEOMETRY_TYPES = [
'Point',
'LineString',
'Polygon',
'MultiPoint',
'MultiLineString',
'MultiPolygon',
] as const;
export const GEOMETRY_FORMATS = ['native', 'geojson', 'wkt', 'lnglat'] as const;
export const LOCAL_TYPES = [
'standard',
'file',
'files',
'm2o',
'o2m',
'm2m',
'm2a',
'presentation',
'translations',
'group',
] as const;
export const FUNCTIONS = ['year', 'month', 'week', 'day', 'weekday', 'hour', 'minute', 'second', 'count'] as const;