From 4636f9cfec3c94e11a1d0187c14b0c01c7f12db8 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 5 Sep 2025 01:29:18 +1200 Subject: [PATCH 1/4] Add time between queries --- package.json | 2 +- src/client.ts | 2 +- src/enums/credit-card.ts | 2 +- src/enums/execution-method.ts | 1 + src/models.ts | 12 ++++++------ src/query.ts | 20 ++++++++++++++++++++ src/services/account.ts | 4 ++-- src/services/avatars.ts | 4 ++-- src/services/databases.ts | 9 --------- src/services/functions.ts | 4 ++-- 10 files changed, 36 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index d362a5d1..b7ac5981 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "react-native-appwrite", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API", - "version": "0.12.0", + "version": "0.13.0", "license": "BSD-3-Clause", "main": "dist/cjs/sdk.js", "exports": { diff --git a/src/client.ts b/src/client.ts index e0f1ba1e..25964bdb 100644 --- a/src/client.ts +++ b/src/client.ts @@ -115,7 +115,7 @@ class Client { 'x-sdk-name': 'React Native', 'x-sdk-platform': 'client', 'x-sdk-language': 'reactnative', - 'x-sdk-version': '0.12.0', + 'x-sdk-version': '0.13.0', 'X-Appwrite-Response-Format': '1.8.0', }; diff --git a/src/enums/credit-card.ts b/src/enums/credit-card.ts index a96c73a5..e6ce2429 100644 --- a/src/enums/credit-card.ts +++ b/src/enums/credit-card.ts @@ -11,7 +11,7 @@ export enum CreditCard { Mastercard = 'mastercard', Naranja = 'naranja', TarjetaShopping = 'targeta-shopping', - UnionChinaPay = 'union-china-pay', + UnionPay = 'unionpay', Visa = 'visa', MIR = 'mir', Maestro = 'maestro', diff --git a/src/enums/execution-method.ts b/src/enums/execution-method.ts index fc63b078..39d4c1e8 100644 --- a/src/enums/execution-method.ts +++ b/src/enums/execution-method.ts @@ -5,4 +5,5 @@ export enum ExecutionMethod { PATCH = 'PATCH', DELETE = 'DELETE', OPTIONS = 'OPTIONS', + HEAD = 'HEAD', } \ No newline at end of file diff --git a/src/models.ts b/src/models.ts index 268baa97..53165e1b 100644 --- a/src/models.ts +++ b/src/models.ts @@ -223,15 +223,15 @@ export namespace Models { /** * Row automatically incrementing ID. */ - $sequence: number; + readonly $sequence: number; /** * Table ID. */ - $tableId: string; + readonly $tableId: string; /** * Database ID. */ - $databaseId: string; + readonly $databaseId: string; /** * Row creation date in ISO 8601 format. */ @@ -262,15 +262,15 @@ export namespace Models { /** * Document automatically incrementing ID. */ - $sequence: number; + readonly $sequence: number; /** * Collection ID. */ - $collectionId: string; + readonly $collectionId: string; /** * Database ID. */ - $databaseId: string; + readonly $databaseId: string; /** * Document creation date in ISO 8601 format. */ diff --git a/src/query.ts b/src/query.ts index 09576a46..e0c34d31 100644 --- a/src/query.ts +++ b/src/query.ts @@ -170,6 +170,16 @@ export class Query { static createdAfter = (value: string): string => new Query("createdAfter", undefined, value).toString(); + /** + * Filter resources where document was created between dates. + * + * @param {string} start + * @param {string} end + * @returns {string} + */ + static createdBetween = (start: string, end: string): string => + new Query("createdBetween", undefined, [start, end] as QueryTypesList).toString(); + /** * Filter resources where document was updated before date. * @@ -188,6 +198,16 @@ export class Query { static updatedAfter = (value: string): string => new Query("updatedAfter", undefined, value).toString(); + /** + * Filter resources where document was updated between dates. + * + * @param {string} start + * @param {string} end + * @returns {string} + */ + static updatedBetween = (start: string, end: string): string => + new Query("updatedBetween", undefined, [start, end] as QueryTypesList).toString(); + static or = (queries: string[]) => new Query("or", undefined, queries.map((query) => JSON.parse(query))).toString(); diff --git a/src/services/account.ts b/src/services/account.ts index 0fdb10be..4f143646 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -1521,7 +1521,7 @@ export class Account extends Service { * @param {string} params.secret - Valid verification token. * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated. + * @deprecated This API has been deprecated since 1.6.0. Please use `Account.createSession` instead. */ updateMagicURLSession(params: { userId: string, secret: string }): Promise; /** @@ -1668,7 +1668,7 @@ export class Account extends Service { * @param {string} params.secret - Valid verification token. * @throws {AppwriteException} * @returns {Promise} - * @deprecated This API has been deprecated. + * @deprecated This API has been deprecated since 1.6.0. Please use `Account.createSession` instead. */ updatePhoneSession(params: { userId: string, secret: string }): Promise; /** diff --git a/src/services/avatars.ts b/src/services/avatars.ts index 2eb848f4..e429691b 100644 --- a/src/services/avatars.ts +++ b/src/services/avatars.ts @@ -101,7 +101,7 @@ export class Avatars extends Service { * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. * * - * @param {CreditCard} params.code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay. + * @param {CreditCard} params.code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay. * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100. * @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100. * @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. @@ -115,7 +115,7 @@ export class Avatars extends Service { * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. * * - * @param {CreditCard} code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay. + * @param {CreditCard} code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay. * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100. * @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100. * @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. diff --git a/src/services/databases.ts b/src/services/databases.ts index 1ae1b0e7..9f3f2473 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -141,9 +141,6 @@ export class Databases extends Service { throw new AppwriteException('Missing required parameter: "data"'); } - delete data?.$sequence; - delete data?.$collectionId; - delete data?.$databaseId; const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); const payload: Payload = {}; @@ -301,9 +298,6 @@ export class Databases extends Service { throw new AppwriteException('Missing required parameter: "data"'); } - delete data?.$sequence; - delete data?.$collectionId; - delete data?.$databaseId; const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); const payload: Payload = {}; @@ -383,9 +377,6 @@ export class Databases extends Service { throw new AppwriteException('Missing required parameter: "documentId"'); } - delete data?.$sequence; - delete data?.$collectionId; - delete data?.$databaseId; const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); const payload: Payload = {}; diff --git a/src/services/functions.ts b/src/services/functions.ts index 8903514a..f9f9f2ce 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -74,7 +74,7 @@ export class Functions extends Service { * @param {string} params.body - HTTP body of execution. Default value is empty string. * @param {boolean} params.async - Execute code in the background. Default value is false. * @param {string} params.xpath - HTTP path of execution. Path can include query params. Default value is / - * @param {ExecutionMethod} params.method - HTTP method of execution. Default value is GET. + * @param {ExecutionMethod} params.method - HTTP method of execution. Default value is POST. * @param {object} params.headers - HTTP headers of execution. Defaults to empty. * @param {string} params.scheduledAt - Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes. * @throws {AppwriteException} @@ -88,7 +88,7 @@ export class Functions extends Service { * @param {string} body - HTTP body of execution. Default value is empty string. * @param {boolean} async - Execute code in the background. Default value is false. * @param {string} xpath - HTTP path of execution. Path can include query params. Default value is / - * @param {ExecutionMethod} method - HTTP method of execution. Default value is GET. + * @param {ExecutionMethod} method - HTTP method of execution. Default value is POST. * @param {object} headers - HTTP headers of execution. Defaults to empty. * @param {string} scheduledAt - Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes. * @throws {AppwriteException} From 16a4ec337c6b3c02120ce7e90da2c7c7809503c7 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 5 Sep 2025 21:39:56 +1200 Subject: [PATCH 2/4] Add spatial queries --- src/models.ts | 12 ++--- src/query.ts | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 134 insertions(+), 6 deletions(-) diff --git a/src/models.ts b/src/models.ts index 53165e1b..268baa97 100644 --- a/src/models.ts +++ b/src/models.ts @@ -223,15 +223,15 @@ export namespace Models { /** * Row automatically incrementing ID. */ - readonly $sequence: number; + $sequence: number; /** * Table ID. */ - readonly $tableId: string; + $tableId: string; /** * Database ID. */ - readonly $databaseId: string; + $databaseId: string; /** * Row creation date in ISO 8601 format. */ @@ -262,15 +262,15 @@ export namespace Models { /** * Document automatically incrementing ID. */ - readonly $sequence: number; + $sequence: number; /** * Collection ID. */ - readonly $collectionId: string; + $collectionId: string; /** * Database ID. */ - readonly $databaseId: string; + $databaseId: string; /** * Document creation date in ISO 8601 format. */ diff --git a/src/query.ts b/src/query.ts index e0c34d31..c4b3cf5e 100644 --- a/src/query.ts +++ b/src/query.ts @@ -213,4 +213,132 @@ export class Query { static and = (queries: string[]) => new Query("and", undefined, queries.map((query) => JSON.parse(query))).toString(); + + /** + * Filter resources where attribute is at a specific distance from the given coordinates. + * + * @param {string} attribute + * @param {any[]} values + * @param {number} distance + * @param {boolean} meters + * @returns {string} + */ + static distanceEqual = (attribute: string, values: any[], distance: number, meters: boolean = true): string => + new Query("distanceEqual", attribute, [values, distance, meters] as QueryTypesList).toString(); + + /** + * Filter resources where attribute is not at a specific distance from the given coordinates. + * + * @param {string} attribute + * @param {any[]} values + * @param {number} distance + * @param {boolean} meters + * @returns {string} + */ + static distanceNotEqual = (attribute: string, values: any[], distance: number, meters: boolean = true): string => + new Query("distanceNotEqual", attribute, [values, distance, meters] as QueryTypesList).toString(); + + /** + * Filter resources where attribute is at a distance greater than the specified value from the given coordinates. + * + * @param {string} attribute + * @param {any[]} values + * @param {number} distance + * @param {boolean} meters + * @returns {string} + */ + static distanceGreaterThan = (attribute: string, values: any[], distance: number, meters: boolean = true): string => + new Query("distanceGreaterThan", attribute, [values, distance, meters] as QueryTypesList).toString(); + + /** + * Filter resources where attribute is at a distance less than the specified value from the given coordinates. + * + * @param {string} attribute + * @param {any[]} values + * @param {number} distance + * @param {boolean} meters + * @returns {string} + */ + static distanceLessThan = (attribute: string, values: any[], distance: number, meters: boolean = true): string => + new Query("distanceLessThan", attribute, [values, distance, meters] as QueryTypesList).toString(); + + /** + * Filter resources where attribute intersects with the given geometry. + * + * @param {string} attribute + * @param {any[]} values + * @returns {string} + */ + static intersects = (attribute: string, values: any[]): string => + new Query("intersects", attribute, values).toString(); + + /** + * Filter resources where attribute does not intersect with the given geometry. + * + * @param {string} attribute + * @param {any[]} values + * @returns {string} + */ + static notIntersects = (attribute: string, values: any[]): string => + new Query("notIntersects", attribute, values).toString(); + + /** + * Filter resources where attribute crosses the given geometry. + * + * @param {string} attribute + * @param {any[]} values + * @returns {string} + */ + static crosses = (attribute: string, values: any[]): string => + new Query("crosses", attribute, values).toString(); + + /** + * Filter resources where attribute does not cross the given geometry. + * + * @param {string} attribute + * @param {any[]} values + * @returns {string} + */ + static notCrosses = (attribute: string, values: any[]): string => + new Query("notCrosses", attribute, values).toString(); + + /** + * Filter resources where attribute overlaps with the given geometry. + * + * @param {string} attribute + * @param {any[]} values + * @returns {string} + */ + static overlaps = (attribute: string, values: any[]): string => + new Query("overlaps", attribute, values).toString(); + + /** + * Filter resources where attribute does not overlap with the given geometry. + * + * @param {string} attribute + * @param {any[]} values + * @returns {string} + */ + static notOverlaps = (attribute: string, values: any[]): string => + new Query("notOverlaps", attribute, values).toString(); + + /** + * Filter resources where attribute touches the given geometry. + * + * @param {string} attribute + * @param {any[]} values + * @returns {string} + */ + static touches = (attribute: string, values: any[]): string => + new Query("touches", attribute, values).toString(); + + /** + * Filter resources where attribute does not touch the given geometry. + * + * @param {string} attribute + * @param {any[]} values + * @returns {string} + */ + static notTouches = (attribute: string, values: any[]): string => + new Query("notTouches", attribute, values).toString(); } From 83fe25c1399578701557d51b7a28b2c827d62cae Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Sat, 6 Sep 2025 04:56:16 +1200 Subject: [PATCH 3/4] Fix spatial default --- docs/examples/account/update-prefs.md | 6 +++++- docs/examples/databases/create-document.md | 8 +++++++- docs/examples/databases/decrement-document-attribute.md | 4 ++-- docs/examples/databases/increment-document-attribute.md | 4 ++-- docs/examples/storage/create-file.md | 2 +- docs/examples/tablesdb/create-row.md | 8 +++++++- docs/examples/tablesdb/decrement-row-column.md | 4 ++-- docs/examples/tablesdb/increment-row-column.md | 4 ++-- 8 files changed, 28 insertions(+), 12 deletions(-) diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index 43fa9fc7..b4a8e0ab 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -7,7 +7,11 @@ const client = new Client() const account = new Account(client); const result = await account.updatePrefs({ - prefs: {} + prefs: { + "language": "en", + "timezone": "UTC", + "darkTheme": true + } }); console.log(result); diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index d0d25bd8..e7cffc13 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -10,7 +10,13 @@ const result = await databases.createDocument({ databaseId: '', collectionId: '', documentId: '', - data: {}, + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, permissions: ["read("any")"] // optional }); diff --git a/docs/examples/databases/decrement-document-attribute.md b/docs/examples/databases/decrement-document-attribute.md index 8eb4387c..ddf43c97 100644 --- a/docs/examples/databases/decrement-document-attribute.md +++ b/docs/examples/databases/decrement-document-attribute.md @@ -11,8 +11,8 @@ const result = await databases.decrementDocumentAttribute({ collectionId: '', documentId: '', attribute: '', - value: null, // optional - min: null // optional + value: 0, // optional + min: 0 // optional }); console.log(result); diff --git a/docs/examples/databases/increment-document-attribute.md b/docs/examples/databases/increment-document-attribute.md index 8cb3d816..c129c38a 100644 --- a/docs/examples/databases/increment-document-attribute.md +++ b/docs/examples/databases/increment-document-attribute.md @@ -11,8 +11,8 @@ const result = await databases.incrementDocumentAttribute({ collectionId: '', documentId: '', attribute: '', - value: null, // optional - max: null // optional + value: 0, // optional + max: 0 // optional }); console.log(result); diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index 4a44d3ca..965c8d42 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -9,7 +9,7 @@ const storage = new Storage(client); const result = await storage.createFile({ bucketId: '', fileId: '', - file: await pickSingle(), + file: InputFile.fromPath('/path/to/file', 'filename'), permissions: ["read("any")"] // optional }); diff --git a/docs/examples/tablesdb/create-row.md b/docs/examples/tablesdb/create-row.md index 43018476..a02a8376 100644 --- a/docs/examples/tablesdb/create-row.md +++ b/docs/examples/tablesdb/create-row.md @@ -10,7 +10,13 @@ const result = await tablesDB.createRow({ databaseId: '', tableId: '', rowId: '', - data: {}, + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, permissions: ["read("any")"] // optional }); diff --git a/docs/examples/tablesdb/decrement-row-column.md b/docs/examples/tablesdb/decrement-row-column.md index 6b47c18c..e00eeb84 100644 --- a/docs/examples/tablesdb/decrement-row-column.md +++ b/docs/examples/tablesdb/decrement-row-column.md @@ -11,8 +11,8 @@ const result = await tablesDB.decrementRowColumn({ tableId: '', rowId: '', column: '', - value: null, // optional - min: null // optional + value: 0, // optional + min: 0 // optional }); console.log(result); diff --git a/docs/examples/tablesdb/increment-row-column.md b/docs/examples/tablesdb/increment-row-column.md index 62b7dd0c..d4b2cf98 100644 --- a/docs/examples/tablesdb/increment-row-column.md +++ b/docs/examples/tablesdb/increment-row-column.md @@ -11,8 +11,8 @@ const result = await tablesDB.incrementRowColumn({ tableId: '', rowId: '', column: '', - value: null, // optional - max: null // optional + value: 0, // optional + max: 0 // optional }); console.log(result); From 7218be2ede8d8baf6a4dea279bf4f6b881abb30e Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 8 Sep 2025 21:40:24 +1200 Subject: [PATCH 4/4] Update spatial queries --- src/query.ts | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/query.ts b/src/query.ts index c4b3cf5e..12c567e9 100644 --- a/src/query.ts +++ b/src/query.ts @@ -1,5 +1,5 @@ type QueryTypesSingle = string | number | boolean; -export type QueryTypesList = string[] | number[] | boolean[] | Query[]; +export type QueryTypesList = string[] | number[] | boolean[] | Query[] | any[]; export type QueryTypes = QueryTypesSingle | QueryTypesList; type AttributesTypes = string | string[]; @@ -33,10 +33,10 @@ export class Query { }); } - static equal = (attribute: string, value: QueryTypes): string => + static equal = (attribute: string, value: QueryTypes | any[]): string => new Query("equal", attribute, value).toString(); - static notEqual = (attribute: string, value: QueryTypes): string => + static notEqual = (attribute: string, value: QueryTypes | any[]): string => new Query("notEqual", attribute, value).toString(); static lessThan = (attribute: string, value: QueryTypes): string => @@ -97,7 +97,7 @@ export class Query { * @param {string | string[]} value * @returns {string} */ - static contains = (attribute: string, value: string | string[]): string => + static contains = (attribute: string, value: string | any[]): string => new Query("contains", attribute, value).toString(); /** @@ -107,7 +107,7 @@ export class Query { * @param {string | string[]} value * @returns {string} */ - static notContains = (attribute: string, value: string | string[]): string => + static notContains = (attribute: string, value: string | any[]): string => new Query("notContains", attribute, value).toString(); /** @@ -224,7 +224,7 @@ export class Query { * @returns {string} */ static distanceEqual = (attribute: string, values: any[], distance: number, meters: boolean = true): string => - new Query("distanceEqual", attribute, [values, distance, meters] as QueryTypesList).toString(); + new Query("distanceEqual", attribute, [[values, distance, meters]] as QueryTypesList).toString(); /** * Filter resources where attribute is not at a specific distance from the given coordinates. @@ -236,7 +236,7 @@ export class Query { * @returns {string} */ static distanceNotEqual = (attribute: string, values: any[], distance: number, meters: boolean = true): string => - new Query("distanceNotEqual", attribute, [values, distance, meters] as QueryTypesList).toString(); + new Query("distanceNotEqual", attribute, [[values, distance, meters]] as QueryTypesList).toString(); /** * Filter resources where attribute is at a distance greater than the specified value from the given coordinates. @@ -248,7 +248,7 @@ export class Query { * @returns {string} */ static distanceGreaterThan = (attribute: string, values: any[], distance: number, meters: boolean = true): string => - new Query("distanceGreaterThan", attribute, [values, distance, meters] as QueryTypesList).toString(); + new Query("distanceGreaterThan", attribute, [[values, distance, meters]] as QueryTypesList).toString(); /** * Filter resources where attribute is at a distance less than the specified value from the given coordinates. @@ -260,7 +260,7 @@ export class Query { * @returns {string} */ static distanceLessThan = (attribute: string, values: any[], distance: number, meters: boolean = true): string => - new Query("distanceLessThan", attribute, [values, distance, meters] as QueryTypesList).toString(); + new Query("distanceLessThan", attribute, [[values, distance, meters]] as QueryTypesList).toString(); /** * Filter resources where attribute intersects with the given geometry. @@ -270,7 +270,7 @@ export class Query { * @returns {string} */ static intersects = (attribute: string, values: any[]): string => - new Query("intersects", attribute, values).toString(); + new Query("intersects", attribute, [values]).toString(); /** * Filter resources where attribute does not intersect with the given geometry. @@ -280,7 +280,7 @@ export class Query { * @returns {string} */ static notIntersects = (attribute: string, values: any[]): string => - new Query("notIntersects", attribute, values).toString(); + new Query("notIntersects", attribute, [values]).toString(); /** * Filter resources where attribute crosses the given geometry. @@ -290,7 +290,7 @@ export class Query { * @returns {string} */ static crosses = (attribute: string, values: any[]): string => - new Query("crosses", attribute, values).toString(); + new Query("crosses", attribute, [values]).toString(); /** * Filter resources where attribute does not cross the given geometry. @@ -300,7 +300,7 @@ export class Query { * @returns {string} */ static notCrosses = (attribute: string, values: any[]): string => - new Query("notCrosses", attribute, values).toString(); + new Query("notCrosses", attribute, [values]).toString(); /** * Filter resources where attribute overlaps with the given geometry. @@ -310,7 +310,7 @@ export class Query { * @returns {string} */ static overlaps = (attribute: string, values: any[]): string => - new Query("overlaps", attribute, values).toString(); + new Query("overlaps", attribute, [values]).toString(); /** * Filter resources where attribute does not overlap with the given geometry. @@ -320,7 +320,7 @@ export class Query { * @returns {string} */ static notOverlaps = (attribute: string, values: any[]): string => - new Query("notOverlaps", attribute, values).toString(); + new Query("notOverlaps", attribute, [values]).toString(); /** * Filter resources where attribute touches the given geometry. @@ -330,7 +330,7 @@ export class Query { * @returns {string} */ static touches = (attribute: string, values: any[]): string => - new Query("touches", attribute, values).toString(); + new Query("touches", attribute, [values]).toString(); /** * Filter resources where attribute does not touch the given geometry. @@ -340,5 +340,5 @@ export class Query { * @returns {string} */ static notTouches = (attribute: string, values: any[]): string => - new Query("notTouches", attribute, values).toString(); + new Query("notTouches", attribute, [values]).toString(); }