Updating view definition to include complete query and sorting.
This commit is contained in:
parent
b3ee266023
commit
6e5aab1f3f
|
@ -2110,6 +2110,122 @@
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "A column used to display rows from this view - usually used when rendered in tables."
|
"description": "A column used to display rows from this view - usually used when rendered in tables."
|
||||||
},
|
},
|
||||||
|
"query": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"allOr": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Specifies that a row should be returned if it satisfies any of the specified options, rather than requiring it to fulfill all the search parameters. This defaults to false, meaning AND logic will be used."
|
||||||
|
},
|
||||||
|
"string": {
|
||||||
|
"type": "object",
|
||||||
|
"example": {
|
||||||
|
"columnName1": "value",
|
||||||
|
"columnName2": "value"
|
||||||
|
},
|
||||||
|
"description": "A map of field name to the string to search for, this will look for rows that have a value starting with the string value.",
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The value to search for in the column."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"fuzzy": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "Searches for a sub-string within a string column, e.g. searching for 'dib' will match 'Budibase'."
|
||||||
|
},
|
||||||
|
"range": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "Searches within a range, the format of this must be in the format of an object with a \"low\" and \"high\" property.",
|
||||||
|
"example": {
|
||||||
|
"columnName1": {
|
||||||
|
"low": 10,
|
||||||
|
"high": 20
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"equal": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "Searches for rows that have a column value that is exactly the value set."
|
||||||
|
},
|
||||||
|
"notEqual": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "Searches for any row which does not contain the specified column value."
|
||||||
|
},
|
||||||
|
"empty": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "Searches for rows which do not contain the specified column. The object should simply contain keys of the column names, these can map to any value.",
|
||||||
|
"example": {
|
||||||
|
"columnName1": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notEmpty": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "Searches for rows which have the specified column."
|
||||||
|
},
|
||||||
|
"oneOf": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "Searches for rows which have a column value that is any of the specified values. The format of this must be columnName -> [value1, value2]."
|
||||||
|
},
|
||||||
|
"contains": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "Searches for a value, or set of values in array column types (such as a multi-select). If an array of search options is provided then it must match all.",
|
||||||
|
"example": {
|
||||||
|
"arrayColumn": [
|
||||||
|
"a",
|
||||||
|
"b"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notContains": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "The logical inverse of contains. Only works on array column types. If an array of values is passed, the row must not match any of them to be returned in the response.",
|
||||||
|
"example": {
|
||||||
|
"arrayColumn": [
|
||||||
|
"a",
|
||||||
|
"b"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"containsAny": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "As with the contains search, only works on array column types and searches for any of the provided values when given an array.",
|
||||||
|
"example": {
|
||||||
|
"arrayColumn": [
|
||||||
|
"a",
|
||||||
|
"b"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sort": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"field"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"field": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The field from the table/view schema to sort on."
|
||||||
|
},
|
||||||
|
"order": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The order in which to sort.",
|
||||||
|
"enum": [
|
||||||
|
"ascending",
|
||||||
|
"descending"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The type of sort to perform (by number, or by alphabetically).",
|
||||||
|
"enum": [
|
||||||
|
"string",
|
||||||
|
"number"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": {
|
"additionalProperties": {
|
||||||
|
@ -2203,6 +2319,122 @@
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "A column used to display rows from this view - usually used when rendered in tables."
|
"description": "A column used to display rows from this view - usually used when rendered in tables."
|
||||||
},
|
},
|
||||||
|
"query": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"allOr": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Specifies that a row should be returned if it satisfies any of the specified options, rather than requiring it to fulfill all the search parameters. This defaults to false, meaning AND logic will be used."
|
||||||
|
},
|
||||||
|
"string": {
|
||||||
|
"type": "object",
|
||||||
|
"example": {
|
||||||
|
"columnName1": "value",
|
||||||
|
"columnName2": "value"
|
||||||
|
},
|
||||||
|
"description": "A map of field name to the string to search for, this will look for rows that have a value starting with the string value.",
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The value to search for in the column."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"fuzzy": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "Searches for a sub-string within a string column, e.g. searching for 'dib' will match 'Budibase'."
|
||||||
|
},
|
||||||
|
"range": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "Searches within a range, the format of this must be in the format of an object with a \"low\" and \"high\" property.",
|
||||||
|
"example": {
|
||||||
|
"columnName1": {
|
||||||
|
"low": 10,
|
||||||
|
"high": 20
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"equal": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "Searches for rows that have a column value that is exactly the value set."
|
||||||
|
},
|
||||||
|
"notEqual": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "Searches for any row which does not contain the specified column value."
|
||||||
|
},
|
||||||
|
"empty": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "Searches for rows which do not contain the specified column. The object should simply contain keys of the column names, these can map to any value.",
|
||||||
|
"example": {
|
||||||
|
"columnName1": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notEmpty": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "Searches for rows which have the specified column."
|
||||||
|
},
|
||||||
|
"oneOf": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "Searches for rows which have a column value that is any of the specified values. The format of this must be columnName -> [value1, value2]."
|
||||||
|
},
|
||||||
|
"contains": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "Searches for a value, or set of values in array column types (such as a multi-select). If an array of search options is provided then it must match all.",
|
||||||
|
"example": {
|
||||||
|
"arrayColumn": [
|
||||||
|
"a",
|
||||||
|
"b"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notContains": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "The logical inverse of contains. Only works on array column types. If an array of values is passed, the row must not match any of them to be returned in the response.",
|
||||||
|
"example": {
|
||||||
|
"arrayColumn": [
|
||||||
|
"a",
|
||||||
|
"b"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"containsAny": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "As with the contains search, only works on array column types and searches for any of the provided values when given an array.",
|
||||||
|
"example": {
|
||||||
|
"arrayColumn": [
|
||||||
|
"a",
|
||||||
|
"b"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sort": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"field"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"field": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The field from the table/view schema to sort on."
|
||||||
|
},
|
||||||
|
"order": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The order in which to sort.",
|
||||||
|
"enum": [
|
||||||
|
"ascending",
|
||||||
|
"descending"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The type of sort to perform (by number, or by alphabetically).",
|
||||||
|
"enum": [
|
||||||
|
"string",
|
||||||
|
"number"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": {
|
"additionalProperties": {
|
||||||
|
@ -2307,6 +2539,122 @@
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "A column used to display rows from this view - usually used when rendered in tables."
|
"description": "A column used to display rows from this view - usually used when rendered in tables."
|
||||||
},
|
},
|
||||||
|
"query": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"allOr": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Specifies that a row should be returned if it satisfies any of the specified options, rather than requiring it to fulfill all the search parameters. This defaults to false, meaning AND logic will be used."
|
||||||
|
},
|
||||||
|
"string": {
|
||||||
|
"type": "object",
|
||||||
|
"example": {
|
||||||
|
"columnName1": "value",
|
||||||
|
"columnName2": "value"
|
||||||
|
},
|
||||||
|
"description": "A map of field name to the string to search for, this will look for rows that have a value starting with the string value.",
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The value to search for in the column."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"fuzzy": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "Searches for a sub-string within a string column, e.g. searching for 'dib' will match 'Budibase'."
|
||||||
|
},
|
||||||
|
"range": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "Searches within a range, the format of this must be in the format of an object with a \"low\" and \"high\" property.",
|
||||||
|
"example": {
|
||||||
|
"columnName1": {
|
||||||
|
"low": 10,
|
||||||
|
"high": 20
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"equal": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "Searches for rows that have a column value that is exactly the value set."
|
||||||
|
},
|
||||||
|
"notEqual": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "Searches for any row which does not contain the specified column value."
|
||||||
|
},
|
||||||
|
"empty": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "Searches for rows which do not contain the specified column. The object should simply contain keys of the column names, these can map to any value.",
|
||||||
|
"example": {
|
||||||
|
"columnName1": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notEmpty": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "Searches for rows which have the specified column."
|
||||||
|
},
|
||||||
|
"oneOf": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "Searches for rows which have a column value that is any of the specified values. The format of this must be columnName -> [value1, value2]."
|
||||||
|
},
|
||||||
|
"contains": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "Searches for a value, or set of values in array column types (such as a multi-select). If an array of search options is provided then it must match all.",
|
||||||
|
"example": {
|
||||||
|
"arrayColumn": [
|
||||||
|
"a",
|
||||||
|
"b"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notContains": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "The logical inverse of contains. Only works on array column types. If an array of values is passed, the row must not match any of them to be returned in the response.",
|
||||||
|
"example": {
|
||||||
|
"arrayColumn": [
|
||||||
|
"a",
|
||||||
|
"b"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"containsAny": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "As with the contains search, only works on array column types and searches for any of the provided values when given an array.",
|
||||||
|
"example": {
|
||||||
|
"arrayColumn": [
|
||||||
|
"a",
|
||||||
|
"b"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sort": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"field"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"field": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The field from the table/view schema to sort on."
|
||||||
|
},
|
||||||
|
"order": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The order in which to sort.",
|
||||||
|
"enum": [
|
||||||
|
"ascending",
|
||||||
|
"descending"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The type of sort to perform (by number, or by alphabetically).",
|
||||||
|
"enum": [
|
||||||
|
"string",
|
||||||
|
"number"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": {
|
"additionalProperties": {
|
||||||
|
|
|
@ -1767,6 +1767,106 @@ components:
|
||||||
type: string
|
type: string
|
||||||
description: A column used to display rows from this view - usually used when
|
description: A column used to display rows from this view - usually used when
|
||||||
rendered in tables.
|
rendered in tables.
|
||||||
|
query:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
allOr:
|
||||||
|
type: boolean
|
||||||
|
description: Specifies that a row should be returned if it satisfies any of the
|
||||||
|
specified options, rather than requiring it to fulfill all the
|
||||||
|
search parameters. This defaults to false, meaning AND logic
|
||||||
|
will be used.
|
||||||
|
string:
|
||||||
|
type: object
|
||||||
|
example:
|
||||||
|
columnName1: value
|
||||||
|
columnName2: value
|
||||||
|
description: A map of field name to the string to search for, this will look for
|
||||||
|
rows that have a value starting with the string value.
|
||||||
|
additionalProperties:
|
||||||
|
type: string
|
||||||
|
description: The value to search for in the column.
|
||||||
|
fuzzy:
|
||||||
|
type: object
|
||||||
|
description: Searches for a sub-string within a string column, e.g. searching
|
||||||
|
for 'dib' will match 'Budibase'.
|
||||||
|
range:
|
||||||
|
type: object
|
||||||
|
description: Searches within a range, the format of this must be in the format
|
||||||
|
of an object with a "low" and "high" property.
|
||||||
|
example:
|
||||||
|
columnName1:
|
||||||
|
low: 10
|
||||||
|
high: 20
|
||||||
|
equal:
|
||||||
|
type: object
|
||||||
|
description: Searches for rows that have a column value that is exactly the
|
||||||
|
value set.
|
||||||
|
notEqual:
|
||||||
|
type: object
|
||||||
|
description: Searches for any row which does not contain the specified column
|
||||||
|
value.
|
||||||
|
empty:
|
||||||
|
type: object
|
||||||
|
description: Searches for rows which do not contain the specified column. The
|
||||||
|
object should simply contain keys of the column names, these can
|
||||||
|
map to any value.
|
||||||
|
example:
|
||||||
|
columnName1: ""
|
||||||
|
notEmpty:
|
||||||
|
type: object
|
||||||
|
description: Searches for rows which have the specified column.
|
||||||
|
oneOf:
|
||||||
|
type: object
|
||||||
|
description: Searches for rows which have a column value that is any of the
|
||||||
|
specified values. The format of this must be columnName ->
|
||||||
|
[value1, value2].
|
||||||
|
contains:
|
||||||
|
type: object
|
||||||
|
description: Searches for a value, or set of values in array column types (such
|
||||||
|
as a multi-select). If an array of search options is provided
|
||||||
|
then it must match all.
|
||||||
|
example:
|
||||||
|
arrayColumn:
|
||||||
|
- a
|
||||||
|
- b
|
||||||
|
notContains:
|
||||||
|
type: object
|
||||||
|
description: The logical inverse of contains. Only works on array column types.
|
||||||
|
If an array of values is passed, the row must not match any of
|
||||||
|
them to be returned in the response.
|
||||||
|
example:
|
||||||
|
arrayColumn:
|
||||||
|
- a
|
||||||
|
- b
|
||||||
|
containsAny:
|
||||||
|
type: object
|
||||||
|
description: As with the contains search, only works on array column types and
|
||||||
|
searches for any of the provided values when given an array.
|
||||||
|
example:
|
||||||
|
arrayColumn:
|
||||||
|
- a
|
||||||
|
- b
|
||||||
|
sort:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- field
|
||||||
|
properties:
|
||||||
|
field:
|
||||||
|
type: string
|
||||||
|
description: The field from the table/view schema to sort on.
|
||||||
|
order:
|
||||||
|
type: string
|
||||||
|
description: The order in which to sort.
|
||||||
|
enum:
|
||||||
|
- ascending
|
||||||
|
- descending
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
description: The type of sort to perform (by number, or by alphabetically).
|
||||||
|
enum:
|
||||||
|
- string
|
||||||
|
- number
|
||||||
schema:
|
schema:
|
||||||
type: object
|
type: object
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
|
@ -1843,6 +1943,106 @@ components:
|
||||||
type: string
|
type: string
|
||||||
description: A column used to display rows from this view - usually used when
|
description: A column used to display rows from this view - usually used when
|
||||||
rendered in tables.
|
rendered in tables.
|
||||||
|
query:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
allOr:
|
||||||
|
type: boolean
|
||||||
|
description: Specifies that a row should be returned if it satisfies any of the
|
||||||
|
specified options, rather than requiring it to fulfill all
|
||||||
|
the search parameters. This defaults to false, meaning AND
|
||||||
|
logic will be used.
|
||||||
|
string:
|
||||||
|
type: object
|
||||||
|
example:
|
||||||
|
columnName1: value
|
||||||
|
columnName2: value
|
||||||
|
description: A map of field name to the string to search for, this will look for
|
||||||
|
rows that have a value starting with the string value.
|
||||||
|
additionalProperties:
|
||||||
|
type: string
|
||||||
|
description: The value to search for in the column.
|
||||||
|
fuzzy:
|
||||||
|
type: object
|
||||||
|
description: Searches for a sub-string within a string column, e.g. searching
|
||||||
|
for 'dib' will match 'Budibase'.
|
||||||
|
range:
|
||||||
|
type: object
|
||||||
|
description: Searches within a range, the format of this must be in the format
|
||||||
|
of an object with a "low" and "high" property.
|
||||||
|
example:
|
||||||
|
columnName1:
|
||||||
|
low: 10
|
||||||
|
high: 20
|
||||||
|
equal:
|
||||||
|
type: object
|
||||||
|
description: Searches for rows that have a column value that is exactly the
|
||||||
|
value set.
|
||||||
|
notEqual:
|
||||||
|
type: object
|
||||||
|
description: Searches for any row which does not contain the specified column
|
||||||
|
value.
|
||||||
|
empty:
|
||||||
|
type: object
|
||||||
|
description: Searches for rows which do not contain the specified column. The
|
||||||
|
object should simply contain keys of the column names, these
|
||||||
|
can map to any value.
|
||||||
|
example:
|
||||||
|
columnName1: ""
|
||||||
|
notEmpty:
|
||||||
|
type: object
|
||||||
|
description: Searches for rows which have the specified column.
|
||||||
|
oneOf:
|
||||||
|
type: object
|
||||||
|
description: Searches for rows which have a column value that is any of the
|
||||||
|
specified values. The format of this must be columnName ->
|
||||||
|
[value1, value2].
|
||||||
|
contains:
|
||||||
|
type: object
|
||||||
|
description: Searches for a value, or set of values in array column types (such
|
||||||
|
as a multi-select). If an array of search options is
|
||||||
|
provided then it must match all.
|
||||||
|
example:
|
||||||
|
arrayColumn:
|
||||||
|
- a
|
||||||
|
- b
|
||||||
|
notContains:
|
||||||
|
type: object
|
||||||
|
description: The logical inverse of contains. Only works on array column types.
|
||||||
|
If an array of values is passed, the row must not match any
|
||||||
|
of them to be returned in the response.
|
||||||
|
example:
|
||||||
|
arrayColumn:
|
||||||
|
- a
|
||||||
|
- b
|
||||||
|
containsAny:
|
||||||
|
type: object
|
||||||
|
description: As with the contains search, only works on array column types and
|
||||||
|
searches for any of the provided values when given an array.
|
||||||
|
example:
|
||||||
|
arrayColumn:
|
||||||
|
- a
|
||||||
|
- b
|
||||||
|
sort:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- field
|
||||||
|
properties:
|
||||||
|
field:
|
||||||
|
type: string
|
||||||
|
description: The field from the table/view schema to sort on.
|
||||||
|
order:
|
||||||
|
type: string
|
||||||
|
description: The order in which to sort.
|
||||||
|
enum:
|
||||||
|
- ascending
|
||||||
|
- descending
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
description: The type of sort to perform (by number, or by alphabetically).
|
||||||
|
enum:
|
||||||
|
- string
|
||||||
|
- number
|
||||||
schema:
|
schema:
|
||||||
type: object
|
type: object
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
|
@ -1926,6 +2126,107 @@ components:
|
||||||
type: string
|
type: string
|
||||||
description: A column used to display rows from this view - usually used when
|
description: A column used to display rows from this view - usually used when
|
||||||
rendered in tables.
|
rendered in tables.
|
||||||
|
query:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
allOr:
|
||||||
|
type: boolean
|
||||||
|
description: Specifies that a row should be returned if it satisfies any of the
|
||||||
|
specified options, rather than requiring it to fulfill all
|
||||||
|
the search parameters. This defaults to false, meaning AND
|
||||||
|
logic will be used.
|
||||||
|
string:
|
||||||
|
type: object
|
||||||
|
example:
|
||||||
|
columnName1: value
|
||||||
|
columnName2: value
|
||||||
|
description: A map of field name to the string to search for, this will look for
|
||||||
|
rows that have a value starting with the string value.
|
||||||
|
additionalProperties:
|
||||||
|
type: string
|
||||||
|
description: The value to search for in the column.
|
||||||
|
fuzzy:
|
||||||
|
type: object
|
||||||
|
description: Searches for a sub-string within a string column, e.g. searching
|
||||||
|
for 'dib' will match 'Budibase'.
|
||||||
|
range:
|
||||||
|
type: object
|
||||||
|
description: Searches within a range, the format of this must be in the format
|
||||||
|
of an object with a "low" and "high" property.
|
||||||
|
example:
|
||||||
|
columnName1:
|
||||||
|
low: 10
|
||||||
|
high: 20
|
||||||
|
equal:
|
||||||
|
type: object
|
||||||
|
description: Searches for rows that have a column value that is exactly the
|
||||||
|
value set.
|
||||||
|
notEqual:
|
||||||
|
type: object
|
||||||
|
description: Searches for any row which does not contain the specified column
|
||||||
|
value.
|
||||||
|
empty:
|
||||||
|
type: object
|
||||||
|
description: Searches for rows which do not contain the specified column. The
|
||||||
|
object should simply contain keys of the column names,
|
||||||
|
these can map to any value.
|
||||||
|
example:
|
||||||
|
columnName1: ""
|
||||||
|
notEmpty:
|
||||||
|
type: object
|
||||||
|
description: Searches for rows which have the specified column.
|
||||||
|
oneOf:
|
||||||
|
type: object
|
||||||
|
description: Searches for rows which have a column value that is any of the
|
||||||
|
specified values. The format of this must be columnName ->
|
||||||
|
[value1, value2].
|
||||||
|
contains:
|
||||||
|
type: object
|
||||||
|
description: Searches for a value, or set of values in array column types (such
|
||||||
|
as a multi-select). If an array of search options is
|
||||||
|
provided then it must match all.
|
||||||
|
example:
|
||||||
|
arrayColumn:
|
||||||
|
- a
|
||||||
|
- b
|
||||||
|
notContains:
|
||||||
|
type: object
|
||||||
|
description: The logical inverse of contains. Only works on array column types.
|
||||||
|
If an array of values is passed, the row must not match
|
||||||
|
any of them to be returned in the response.
|
||||||
|
example:
|
||||||
|
arrayColumn:
|
||||||
|
- a
|
||||||
|
- b
|
||||||
|
containsAny:
|
||||||
|
type: object
|
||||||
|
description: As with the contains search, only works on array column types and
|
||||||
|
searches for any of the provided values when given an
|
||||||
|
array.
|
||||||
|
example:
|
||||||
|
arrayColumn:
|
||||||
|
- a
|
||||||
|
- b
|
||||||
|
sort:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- field
|
||||||
|
properties:
|
||||||
|
field:
|
||||||
|
type: string
|
||||||
|
description: The field from the table/view schema to sort on.
|
||||||
|
order:
|
||||||
|
type: string
|
||||||
|
description: The order in which to sort.
|
||||||
|
enum:
|
||||||
|
- ascending
|
||||||
|
- descending
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
description: The type of sort to perform (by number, or by alphabetically).
|
||||||
|
enum:
|
||||||
|
- string
|
||||||
|
- number
|
||||||
schema:
|
schema:
|
||||||
type: object
|
type: object
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
import { object } from "./utils"
|
import { object } from "./utils"
|
||||||
import Resource from "./utils/Resource"
|
import Resource from "./utils/Resource"
|
||||||
|
|
||||||
export default new Resource().setSchemas({
|
export const searchSchema = {
|
||||||
rowSearch: object(
|
|
||||||
{
|
|
||||||
query: {
|
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
allOr: {
|
allOr: {
|
||||||
|
@ -93,7 +90,12 @@ export default new Resource().setSchemas({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
|
|
||||||
|
export default new Resource().setSchemas({
|
||||||
|
rowSearch: object(
|
||||||
|
{
|
||||||
|
query: searchSchema,
|
||||||
paginate: {
|
paginate: {
|
||||||
type: "boolean",
|
type: "boolean",
|
||||||
description: "Enables pagination, by default this is disabled.",
|
description: "Enables pagination, by default this is disabled.",
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { object } from "./utils"
|
import { object } from "./utils"
|
||||||
import Resource from "./utils/Resource"
|
import Resource from "./utils/Resource"
|
||||||
import { CalculationType } from "@budibase/types"
|
import { CalculationType, SortOrder, SortType } from "@budibase/types"
|
||||||
|
import { searchSchema } from "./misc"
|
||||||
|
|
||||||
const view = {
|
const view = {
|
||||||
name: "peopleView",
|
name: "peopleView",
|
||||||
|
@ -81,6 +82,28 @@ const viewSchema = {
|
||||||
description:
|
description:
|
||||||
"A column used to display rows from this view - usually used when rendered in tables.",
|
"A column used to display rows from this view - usually used when rendered in tables.",
|
||||||
},
|
},
|
||||||
|
query: searchSchema,
|
||||||
|
sort: {
|
||||||
|
type: "object",
|
||||||
|
required: ["field"],
|
||||||
|
properties: {
|
||||||
|
field: {
|
||||||
|
type: "string",
|
||||||
|
description: "The field from the table/view schema to sort on.",
|
||||||
|
},
|
||||||
|
order: {
|
||||||
|
type: "string",
|
||||||
|
description: "The order in which to sort.",
|
||||||
|
enum: Object.values(SortOrder),
|
||||||
|
},
|
||||||
|
type: {
|
||||||
|
type: "string",
|
||||||
|
description:
|
||||||
|
"The type of sort to perform (by number, or by alphabetically).",
|
||||||
|
enum: Object.values(SortType),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
schema: {
|
schema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
additionalProperties: {
|
additionalProperties: {
|
||||||
|
|
|
@ -843,6 +843,64 @@ export interface components {
|
||||||
type?: "calculation";
|
type?: "calculation";
|
||||||
/** @description A column used to display rows from this view - usually used when rendered in tables. */
|
/** @description A column used to display rows from this view - usually used when rendered in tables. */
|
||||||
primaryDisplay?: string;
|
primaryDisplay?: string;
|
||||||
|
query?: {
|
||||||
|
/** @description Specifies that a row should be returned if it satisfies any of the specified options, rather than requiring it to fulfill all the search parameters. This defaults to false, meaning AND logic will be used. */
|
||||||
|
allOr?: boolean;
|
||||||
|
/**
|
||||||
|
* @description A map of field name to the string to search for, this will look for rows that have a value starting with the string value.
|
||||||
|
* @example [object Object]
|
||||||
|
*/
|
||||||
|
string?: { [key: string]: string };
|
||||||
|
/** @description Searches for a sub-string within a string column, e.g. searching for 'dib' will match 'Budibase'. */
|
||||||
|
fuzzy?: { [key: string]: unknown };
|
||||||
|
/**
|
||||||
|
* @description Searches within a range, the format of this must be in the format of an object with a "low" and "high" property.
|
||||||
|
* @example [object Object]
|
||||||
|
*/
|
||||||
|
range?: { [key: string]: unknown };
|
||||||
|
/** @description Searches for rows that have a column value that is exactly the value set. */
|
||||||
|
equal?: { [key: string]: unknown };
|
||||||
|
/** @description Searches for any row which does not contain the specified column value. */
|
||||||
|
notEqual?: { [key: string]: unknown };
|
||||||
|
/**
|
||||||
|
* @description Searches for rows which do not contain the specified column. The object should simply contain keys of the column names, these can map to any value.
|
||||||
|
* @example [object Object]
|
||||||
|
*/
|
||||||
|
empty?: { [key: string]: unknown };
|
||||||
|
/** @description Searches for rows which have the specified column. */
|
||||||
|
notEmpty?: { [key: string]: unknown };
|
||||||
|
/** @description Searches for rows which have a column value that is any of the specified values. The format of this must be columnName -> [value1, value2]. */
|
||||||
|
oneOf?: { [key: string]: unknown };
|
||||||
|
/**
|
||||||
|
* @description Searches for a value, or set of values in array column types (such as a multi-select). If an array of search options is provided then it must match all.
|
||||||
|
* @example [object Object]
|
||||||
|
*/
|
||||||
|
contains?: { [key: string]: unknown };
|
||||||
|
/**
|
||||||
|
* @description The logical inverse of contains. Only works on array column types. If an array of values is passed, the row must not match any of them to be returned in the response.
|
||||||
|
* @example [object Object]
|
||||||
|
*/
|
||||||
|
notContains?: { [key: string]: unknown };
|
||||||
|
/**
|
||||||
|
* @description As with the contains search, only works on array column types and searches for any of the provided values when given an array.
|
||||||
|
* @example [object Object]
|
||||||
|
*/
|
||||||
|
containsAny?: { [key: string]: unknown };
|
||||||
|
};
|
||||||
|
sort?: {
|
||||||
|
/** @description The field from the table/view schema to sort on. */
|
||||||
|
field: string;
|
||||||
|
/**
|
||||||
|
* @description The order in which to sort.
|
||||||
|
* @enum {string}
|
||||||
|
*/
|
||||||
|
order?: "ascending" | "descending";
|
||||||
|
/**
|
||||||
|
* @description The type of sort to perform (by number, or by alphabetically).
|
||||||
|
* @enum {string}
|
||||||
|
*/
|
||||||
|
type?: "string" | "number";
|
||||||
|
};
|
||||||
schema: {
|
schema: {
|
||||||
[key: string]:
|
[key: string]:
|
||||||
| {
|
| {
|
||||||
|
@ -884,6 +942,64 @@ export interface components {
|
||||||
type?: "calculation";
|
type?: "calculation";
|
||||||
/** @description A column used to display rows from this view - usually used when rendered in tables. */
|
/** @description A column used to display rows from this view - usually used when rendered in tables. */
|
||||||
primaryDisplay?: string;
|
primaryDisplay?: string;
|
||||||
|
query?: {
|
||||||
|
/** @description Specifies that a row should be returned if it satisfies any of the specified options, rather than requiring it to fulfill all the search parameters. This defaults to false, meaning AND logic will be used. */
|
||||||
|
allOr?: boolean;
|
||||||
|
/**
|
||||||
|
* @description A map of field name to the string to search for, this will look for rows that have a value starting with the string value.
|
||||||
|
* @example [object Object]
|
||||||
|
*/
|
||||||
|
string?: { [key: string]: string };
|
||||||
|
/** @description Searches for a sub-string within a string column, e.g. searching for 'dib' will match 'Budibase'. */
|
||||||
|
fuzzy?: { [key: string]: unknown };
|
||||||
|
/**
|
||||||
|
* @description Searches within a range, the format of this must be in the format of an object with a "low" and "high" property.
|
||||||
|
* @example [object Object]
|
||||||
|
*/
|
||||||
|
range?: { [key: string]: unknown };
|
||||||
|
/** @description Searches for rows that have a column value that is exactly the value set. */
|
||||||
|
equal?: { [key: string]: unknown };
|
||||||
|
/** @description Searches for any row which does not contain the specified column value. */
|
||||||
|
notEqual?: { [key: string]: unknown };
|
||||||
|
/**
|
||||||
|
* @description Searches for rows which do not contain the specified column. The object should simply contain keys of the column names, these can map to any value.
|
||||||
|
* @example [object Object]
|
||||||
|
*/
|
||||||
|
empty?: { [key: string]: unknown };
|
||||||
|
/** @description Searches for rows which have the specified column. */
|
||||||
|
notEmpty?: { [key: string]: unknown };
|
||||||
|
/** @description Searches for rows which have a column value that is any of the specified values. The format of this must be columnName -> [value1, value2]. */
|
||||||
|
oneOf?: { [key: string]: unknown };
|
||||||
|
/**
|
||||||
|
* @description Searches for a value, or set of values in array column types (such as a multi-select). If an array of search options is provided then it must match all.
|
||||||
|
* @example [object Object]
|
||||||
|
*/
|
||||||
|
contains?: { [key: string]: unknown };
|
||||||
|
/**
|
||||||
|
* @description The logical inverse of contains. Only works on array column types. If an array of values is passed, the row must not match any of them to be returned in the response.
|
||||||
|
* @example [object Object]
|
||||||
|
*/
|
||||||
|
notContains?: { [key: string]: unknown };
|
||||||
|
/**
|
||||||
|
* @description As with the contains search, only works on array column types and searches for any of the provided values when given an array.
|
||||||
|
* @example [object Object]
|
||||||
|
*/
|
||||||
|
containsAny?: { [key: string]: unknown };
|
||||||
|
};
|
||||||
|
sort?: {
|
||||||
|
/** @description The field from the table/view schema to sort on. */
|
||||||
|
field: string;
|
||||||
|
/**
|
||||||
|
* @description The order in which to sort.
|
||||||
|
* @enum {string}
|
||||||
|
*/
|
||||||
|
order?: "ascending" | "descending";
|
||||||
|
/**
|
||||||
|
* @description The type of sort to perform (by number, or by alphabetically).
|
||||||
|
* @enum {string}
|
||||||
|
*/
|
||||||
|
type?: "string" | "number";
|
||||||
|
};
|
||||||
schema: {
|
schema: {
|
||||||
[key: string]:
|
[key: string]:
|
||||||
| {
|
| {
|
||||||
|
@ -927,6 +1043,64 @@ export interface components {
|
||||||
type?: "calculation";
|
type?: "calculation";
|
||||||
/** @description A column used to display rows from this view - usually used when rendered in tables. */
|
/** @description A column used to display rows from this view - usually used when rendered in tables. */
|
||||||
primaryDisplay?: string;
|
primaryDisplay?: string;
|
||||||
|
query?: {
|
||||||
|
/** @description Specifies that a row should be returned if it satisfies any of the specified options, rather than requiring it to fulfill all the search parameters. This defaults to false, meaning AND logic will be used. */
|
||||||
|
allOr?: boolean;
|
||||||
|
/**
|
||||||
|
* @description A map of field name to the string to search for, this will look for rows that have a value starting with the string value.
|
||||||
|
* @example [object Object]
|
||||||
|
*/
|
||||||
|
string?: { [key: string]: string };
|
||||||
|
/** @description Searches for a sub-string within a string column, e.g. searching for 'dib' will match 'Budibase'. */
|
||||||
|
fuzzy?: { [key: string]: unknown };
|
||||||
|
/**
|
||||||
|
* @description Searches within a range, the format of this must be in the format of an object with a "low" and "high" property.
|
||||||
|
* @example [object Object]
|
||||||
|
*/
|
||||||
|
range?: { [key: string]: unknown };
|
||||||
|
/** @description Searches for rows that have a column value that is exactly the value set. */
|
||||||
|
equal?: { [key: string]: unknown };
|
||||||
|
/** @description Searches for any row which does not contain the specified column value. */
|
||||||
|
notEqual?: { [key: string]: unknown };
|
||||||
|
/**
|
||||||
|
* @description Searches for rows which do not contain the specified column. The object should simply contain keys of the column names, these can map to any value.
|
||||||
|
* @example [object Object]
|
||||||
|
*/
|
||||||
|
empty?: { [key: string]: unknown };
|
||||||
|
/** @description Searches for rows which have the specified column. */
|
||||||
|
notEmpty?: { [key: string]: unknown };
|
||||||
|
/** @description Searches for rows which have a column value that is any of the specified values. The format of this must be columnName -> [value1, value2]. */
|
||||||
|
oneOf?: { [key: string]: unknown };
|
||||||
|
/**
|
||||||
|
* @description Searches for a value, or set of values in array column types (such as a multi-select). If an array of search options is provided then it must match all.
|
||||||
|
* @example [object Object]
|
||||||
|
*/
|
||||||
|
contains?: { [key: string]: unknown };
|
||||||
|
/**
|
||||||
|
* @description The logical inverse of contains. Only works on array column types. If an array of values is passed, the row must not match any of them to be returned in the response.
|
||||||
|
* @example [object Object]
|
||||||
|
*/
|
||||||
|
notContains?: { [key: string]: unknown };
|
||||||
|
/**
|
||||||
|
* @description As with the contains search, only works on array column types and searches for any of the provided values when given an array.
|
||||||
|
* @example [object Object]
|
||||||
|
*/
|
||||||
|
containsAny?: { [key: string]: unknown };
|
||||||
|
};
|
||||||
|
sort?: {
|
||||||
|
/** @description The field from the table/view schema to sort on. */
|
||||||
|
field: string;
|
||||||
|
/**
|
||||||
|
* @description The order in which to sort.
|
||||||
|
* @enum {string}
|
||||||
|
*/
|
||||||
|
order?: "ascending" | "descending";
|
||||||
|
/**
|
||||||
|
* @description The type of sort to perform (by number, or by alphabetically).
|
||||||
|
* @enum {string}
|
||||||
|
*/
|
||||||
|
type?: "string" | "number";
|
||||||
|
};
|
||||||
schema: {
|
schema: {
|
||||||
[key: string]:
|
[key: string]:
|
||||||
| {
|
| {
|
||||||
|
|
Loading…
Reference in New Issue