diff --git a/packages/server/specs/openapi.json b/packages/server/specs/openapi.json index 1cf2d0ebce..7d07b424f0 100644 --- a/packages/server/specs/openapi.json +++ b/packages/server/specs/openapi.json @@ -853,6 +853,7 @@ "array", "datetime", "attachment", + "attachment_single", "link", "formula", "auto", @@ -1059,6 +1060,7 @@ "array", "datetime", "attachment", + "attachment_single", "link", "formula", "auto", @@ -1276,6 +1278,7 @@ "array", "datetime", "attachment", + "attachment_single", "link", "formula", "auto", @@ -1752,7 +1755,7 @@ }, "fuzzy": { "type": "object", - "description": "A fuzzy search, only supported by internal tables." + "description": "Searches for a sub-string within a string column, e.g. searching for 'dib' will match 'Budibase'." }, "range": { "type": "object", @@ -1786,6 +1789,36 @@ "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" + ] + } } } }, diff --git a/packages/server/specs/openapi.yaml b/packages/server/specs/openapi.yaml index a1615e7426..3a798c424b 100644 --- a/packages/server/specs/openapi.yaml +++ b/packages/server/specs/openapi.yaml @@ -775,6 +775,7 @@ components: - array - datetime - attachment + - attachment_single - link - formula - auto @@ -940,6 +941,7 @@ components: - array - datetime - attachment + - attachment_single - link - formula - auto @@ -1112,6 +1114,7 @@ components: - array - datetime - attachment + - attachment_single - link - formula - auto @@ -1492,7 +1495,8 @@ components: description: The value to search for in the column. fuzzy: type: object - description: A fuzzy search, only supported by internal tables. + 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 @@ -1524,6 +1528,32 @@ components: 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 paginate: type: boolean description: Enables pagination, by default this is disabled. diff --git a/packages/server/specs/resources/misc.ts b/packages/server/specs/resources/misc.ts index 16cb831c86..f56dff3301 100644 --- a/packages/server/specs/resources/misc.ts +++ b/packages/server/specs/resources/misc.ts @@ -27,7 +27,8 @@ export default new Resource().setSchemas({ }, fuzzy: { type: "object", - description: "A fuzzy search, only supported by internal tables.", + description: + "Searches for a sub-string within a string column, e.g. searching for 'dib' will match 'Budibase'.", }, range: { type: "object", @@ -67,6 +68,30 @@ export default new Resource().setSchemas({ 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"], + }, + }, }, }, paginate: { diff --git a/packages/server/src/definitions/openapi.ts b/packages/server/src/definitions/openapi.ts index 34014ba626..cc3c8a7d4d 100644 --- a/packages/server/src/definitions/openapi.ts +++ b/packages/server/src/definitions/openapi.ts @@ -273,6 +273,7 @@ export interface components { | "array" | "datetime" | "attachment" + | "attachment_single" | "link" | "formula" | "auto" @@ -381,6 +382,7 @@ export interface components { | "array" | "datetime" | "attachment" + | "attachment_single" | "link" | "formula" | "auto" @@ -491,6 +493,7 @@ export interface components { | "array" | "datetime" | "attachment" + | "attachment_single" | "link" | "formula" | "auto" @@ -693,7 +696,7 @@ export interface components { * @example [object Object] */ string?: { [key: string]: string }; - /** @description A fuzzy search, only supported by internal tables. */ + /** @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. @@ -713,6 +716,21 @@ export interface components { 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 }; }; /** @description Enables pagination, by default this is disabled. */ paginate?: boolean;