Merge branch '1.8.x' into chore-beautify-certificate-logs

This commit is contained in:
Khushboo Verma 2025-09-08 11:32:00 +05:30 committed by GitHub
commit 28d31c9726
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
62 changed files with 4636 additions and 3163 deletions

View file

@ -226,7 +226,7 @@ return [
[
'key' => 'cli',
'name' => 'Command Line',
'version' => '9.0.2',
'version' => '9.1.0',
'url' => 'https://github.com/appwrite/sdk-for-cli',
'package' => 'https://www.npmjs.com/package/appwrite-cli',
'enabled' => true,

View file

@ -1891,7 +1891,7 @@
"prefs": {
"type": "object",
"description": "Prefs key-value JSON object.",
"x-example": "{}"
"x-example": "{\"language\":\"en\",\"timezone\":\"UTC\",\"darkTheme\":true}"
}
},
"required": [
@ -4830,7 +4830,7 @@
"x-appwrite": {
"method": "listDocuments",
"group": "documents",
"weight": 340,
"weight": 339,
"cookies": false,
"type": "",
"demo": "databases\/list-documents.md",
@ -4919,7 +4919,7 @@
"x-appwrite": {
"method": "createDocument",
"group": "documents",
"weight": 332,
"weight": 331,
"cookies": false,
"type": "",
"demo": "databases\/create-document.md",
@ -5020,7 +5020,7 @@
"data": {
"type": "object",
"description": "Document data as JSON object.",
"x-example": "{}"
"x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}"
},
"permissions": {
"type": "array",
@ -5069,7 +5069,7 @@
"x-appwrite": {
"method": "getDocument",
"group": "documents",
"weight": 333,
"weight": 332,
"cookies": false,
"type": "",
"demo": "databases\/get-document.md",
@ -5168,7 +5168,7 @@
"x-appwrite": {
"method": "upsertDocument",
"group": "documents",
"weight": 336,
"weight": 335,
"cookies": false,
"type": "",
"demo": "databases\/upsert-document.md",
@ -5316,7 +5316,7 @@
"x-appwrite": {
"method": "updateDocument",
"group": "documents",
"weight": 334,
"weight": 333,
"cookies": false,
"type": "",
"demo": "databases\/update-document.md",
@ -5419,7 +5419,7 @@
"x-appwrite": {
"method": "deleteDocument",
"group": "documents",
"weight": 338,
"weight": 337,
"cookies": false,
"type": "",
"demo": "databases\/delete-document.md",
@ -5507,7 +5507,7 @@
"x-appwrite": {
"method": "decrementDocumentAttribute",
"group": "documents",
"weight": 343,
"weight": 342,
"cookies": false,
"type": "",
"demo": "databases\/decrement-document-attribute.md",
@ -5626,7 +5626,7 @@
"x-appwrite": {
"method": "incrementDocumentAttribute",
"group": "documents",
"weight": 342,
"weight": 341,
"cookies": false,
"type": "",
"demo": "databases\/increment-document-attribute.md",
@ -6010,7 +6010,7 @@
"x-appwrite": {
"method": "query",
"group": "graphql",
"weight": 255,
"weight": 254,
"cookies": false,
"type": "graphql",
"demo": "graphql\/query.md",
@ -6062,7 +6062,7 @@
"x-appwrite": {
"method": "mutation",
"group": "graphql",
"weight": 254,
"weight": 253,
"cookies": false,
"type": "graphql",
"demo": "graphql\/mutation.md",
@ -6530,7 +6530,7 @@
"x-appwrite": {
"method": "createSubscriber",
"group": "subscribers",
"weight": 301,
"weight": 300,
"cookies": false,
"type": "",
"demo": "messaging\/create-subscriber.md",
@ -6613,7 +6613,7 @@
"x-appwrite": {
"method": "deleteSubscriber",
"group": "subscribers",
"weight": 305,
"weight": 304,
"cookies": false,
"type": "",
"demo": "messaging\/delete-subscriber.md",
@ -6688,7 +6688,7 @@
"x-appwrite": {
"method": "listFiles",
"group": "files",
"weight": 161,
"weight": 160,
"cookies": false,
"type": "",
"demo": "storage\/list-files.md",
@ -6774,7 +6774,7 @@
"x-appwrite": {
"method": "createFile",
"group": "files",
"weight": 160,
"weight": 159,
"cookies": false,
"type": "upload",
"demo": "storage\/create-file.md",
@ -6872,7 +6872,7 @@
"x-appwrite": {
"method": "getFile",
"group": "files",
"weight": 162,
"weight": 161,
"cookies": false,
"type": "",
"demo": "storage\/get-file.md",
@ -6944,7 +6944,7 @@
"x-appwrite": {
"method": "updateFile",
"group": "files",
"weight": 167,
"weight": 166,
"cookies": false,
"type": "",
"demo": "storage\/update-file.md",
@ -7033,7 +7033,7 @@
"x-appwrite": {
"method": "deleteFile",
"group": "files",
"weight": 168,
"weight": 167,
"cookies": false,
"type": "",
"demo": "storage\/delete-file.md",
@ -7100,7 +7100,7 @@
"x-appwrite": {
"method": "getFileDownload",
"group": "files",
"weight": 164,
"weight": 163,
"cookies": false,
"type": "location",
"demo": "storage\/get-file-download.md",
@ -7178,7 +7178,7 @@
"x-appwrite": {
"method": "getFilePreview",
"group": "files",
"weight": 163,
"weight": 162,
"cookies": false,
"type": "location",
"demo": "storage\/get-file-preview.md",
@ -7406,7 +7406,7 @@
"x-appwrite": {
"method": "getFileView",
"group": "files",
"weight": 165,
"weight": 164,
"cookies": false,
"type": "location",
"demo": "storage\/get-file-view.md",
@ -7491,7 +7491,7 @@
"x-appwrite": {
"method": "listRows",
"group": "rows",
"weight": 432,
"weight": 431,
"cookies": false,
"type": "",
"demo": "tablesdb\/list-rows.md",
@ -7579,7 +7579,7 @@
"x-appwrite": {
"method": "createRow",
"group": "rows",
"weight": 424,
"weight": 423,
"cookies": false,
"type": "",
"demo": "tablesdb\/create-row.md",
@ -7675,7 +7675,7 @@
"data": {
"type": "object",
"description": "Row data as JSON object.",
"x-example": "{}"
"x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}"
},
"permissions": {
"type": "array",
@ -7724,7 +7724,7 @@
"x-appwrite": {
"method": "getRow",
"group": "rows",
"weight": 425,
"weight": 424,
"cookies": false,
"type": "",
"demo": "tablesdb\/get-row.md",
@ -7822,7 +7822,7 @@
"x-appwrite": {
"method": "upsertRow",
"group": "rows",
"weight": 428,
"weight": 427,
"cookies": false,
"type": "",
"demo": "tablesdb\/upsert-row.md",
@ -7961,7 +7961,7 @@
"x-appwrite": {
"method": "updateRow",
"group": "rows",
"weight": 426,
"weight": 425,
"cookies": false,
"type": "",
"demo": "tablesdb\/update-row.md",
@ -8063,7 +8063,7 @@
"x-appwrite": {
"method": "deleteRow",
"group": "rows",
"weight": 430,
"weight": 429,
"cookies": false,
"type": "",
"demo": "tablesdb\/delete-row.md",
@ -8150,7 +8150,7 @@
"x-appwrite": {
"method": "decrementRowColumn",
"group": "rows",
"weight": 435,
"weight": 434,
"cookies": false,
"type": "",
"demo": "tablesdb\/decrement-row-column.md",
@ -8268,7 +8268,7 @@
"x-appwrite": {
"method": "incrementRowColumn",
"group": "rows",
"weight": 434,
"weight": 433,
"cookies": false,
"type": "",
"demo": "tablesdb\/increment-row-column.md",
@ -8386,7 +8386,7 @@
"x-appwrite": {
"method": "list",
"group": "teams",
"weight": 172,
"weight": 171,
"cookies": false,
"type": "",
"demo": "teams\/list.md",
@ -8462,7 +8462,7 @@
"x-appwrite": {
"method": "create",
"group": "teams",
"weight": 171,
"weight": 170,
"cookies": false,
"type": "",
"demo": "teams\/create.md",
@ -8547,7 +8547,7 @@
"x-appwrite": {
"method": "get",
"group": "teams",
"weight": 173,
"weight": 172,
"cookies": false,
"type": "",
"demo": "teams\/get.md",
@ -8609,7 +8609,7 @@
"x-appwrite": {
"method": "updateName",
"group": "teams",
"weight": 175,
"weight": 174,
"cookies": false,
"type": "",
"demo": "teams\/update-name.md",
@ -8683,7 +8683,7 @@
"x-appwrite": {
"method": "delete",
"group": "teams",
"weight": 177,
"weight": 176,
"cookies": false,
"type": "",
"demo": "teams\/delete.md",
@ -8747,7 +8747,7 @@
"x-appwrite": {
"method": "listMemberships",
"group": "memberships",
"weight": 179,
"weight": 178,
"cookies": false,
"type": "",
"demo": "teams\/list-memberships.md",
@ -8833,7 +8833,7 @@
"x-appwrite": {
"method": "createMembership",
"group": "memberships",
"weight": 178,
"weight": 177,
"cookies": false,
"type": "",
"demo": "teams\/create-membership.md",
@ -8944,7 +8944,7 @@
"x-appwrite": {
"method": "getMembership",
"group": "memberships",
"weight": 180,
"weight": 179,
"cookies": false,
"type": "",
"demo": "teams\/get-membership.md",
@ -9016,7 +9016,7 @@
"x-appwrite": {
"method": "updateMembership",
"group": "memberships",
"weight": 181,
"weight": 180,
"cookies": false,
"type": "",
"demo": "teams\/update-membership.md",
@ -9103,7 +9103,7 @@
"x-appwrite": {
"method": "deleteMembership",
"group": "memberships",
"weight": 183,
"weight": 182,
"cookies": false,
"type": "",
"demo": "teams\/delete-membership.md",
@ -9177,7 +9177,7 @@
"x-appwrite": {
"method": "updateMembershipStatus",
"group": "memberships",
"weight": 182,
"weight": 181,
"cookies": false,
"type": "",
"demo": "teams\/update-membership-status.md",
@ -9275,7 +9275,7 @@
"x-appwrite": {
"method": "getPrefs",
"group": "teams",
"weight": 174,
"weight": 173,
"cookies": false,
"type": "",
"demo": "teams\/get-prefs.md",
@ -9336,7 +9336,7 @@
"x-appwrite": {
"method": "updatePrefs",
"group": "teams",
"weight": 176,
"weight": 175,
"cookies": false,
"type": "",
"demo": "teams\/update-prefs.md",

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1891,7 +1891,7 @@
"prefs": {
"type": "object",
"description": "Prefs key-value JSON object.",
"x-example": "{}"
"x-example": "{\"language\":\"en\",\"timezone\":\"UTC\",\"darkTheme\":true}"
}
},
"required": [
@ -4830,7 +4830,7 @@
"x-appwrite": {
"method": "listDocuments",
"group": "documents",
"weight": 340,
"weight": 339,
"cookies": false,
"type": "",
"demo": "databases\/list-documents.md",
@ -4919,7 +4919,7 @@
"x-appwrite": {
"method": "createDocument",
"group": "documents",
"weight": 332,
"weight": 331,
"cookies": false,
"type": "",
"demo": "databases\/create-document.md",
@ -5020,7 +5020,7 @@
"data": {
"type": "object",
"description": "Document data as JSON object.",
"x-example": "{}"
"x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}"
},
"permissions": {
"type": "array",
@ -5069,7 +5069,7 @@
"x-appwrite": {
"method": "getDocument",
"group": "documents",
"weight": 333,
"weight": 332,
"cookies": false,
"type": "",
"demo": "databases\/get-document.md",
@ -5168,7 +5168,7 @@
"x-appwrite": {
"method": "upsertDocument",
"group": "documents",
"weight": 336,
"weight": 335,
"cookies": false,
"type": "",
"demo": "databases\/upsert-document.md",
@ -5316,7 +5316,7 @@
"x-appwrite": {
"method": "updateDocument",
"group": "documents",
"weight": 334,
"weight": 333,
"cookies": false,
"type": "",
"demo": "databases\/update-document.md",
@ -5419,7 +5419,7 @@
"x-appwrite": {
"method": "deleteDocument",
"group": "documents",
"weight": 338,
"weight": 337,
"cookies": false,
"type": "",
"demo": "databases\/delete-document.md",
@ -5507,7 +5507,7 @@
"x-appwrite": {
"method": "decrementDocumentAttribute",
"group": "documents",
"weight": 343,
"weight": 342,
"cookies": false,
"type": "",
"demo": "databases\/decrement-document-attribute.md",
@ -5626,7 +5626,7 @@
"x-appwrite": {
"method": "incrementDocumentAttribute",
"group": "documents",
"weight": 342,
"weight": 341,
"cookies": false,
"type": "",
"demo": "databases\/increment-document-attribute.md",
@ -6010,7 +6010,7 @@
"x-appwrite": {
"method": "query",
"group": "graphql",
"weight": 255,
"weight": 254,
"cookies": false,
"type": "graphql",
"demo": "graphql\/query.md",
@ -6062,7 +6062,7 @@
"x-appwrite": {
"method": "mutation",
"group": "graphql",
"weight": 254,
"weight": 253,
"cookies": false,
"type": "graphql",
"demo": "graphql\/mutation.md",
@ -6530,7 +6530,7 @@
"x-appwrite": {
"method": "createSubscriber",
"group": "subscribers",
"weight": 301,
"weight": 300,
"cookies": false,
"type": "",
"demo": "messaging\/create-subscriber.md",
@ -6613,7 +6613,7 @@
"x-appwrite": {
"method": "deleteSubscriber",
"group": "subscribers",
"weight": 305,
"weight": 304,
"cookies": false,
"type": "",
"demo": "messaging\/delete-subscriber.md",
@ -6688,7 +6688,7 @@
"x-appwrite": {
"method": "listFiles",
"group": "files",
"weight": 161,
"weight": 160,
"cookies": false,
"type": "",
"demo": "storage\/list-files.md",
@ -6774,7 +6774,7 @@
"x-appwrite": {
"method": "createFile",
"group": "files",
"weight": 160,
"weight": 159,
"cookies": false,
"type": "upload",
"demo": "storage\/create-file.md",
@ -6872,7 +6872,7 @@
"x-appwrite": {
"method": "getFile",
"group": "files",
"weight": 162,
"weight": 161,
"cookies": false,
"type": "",
"demo": "storage\/get-file.md",
@ -6944,7 +6944,7 @@
"x-appwrite": {
"method": "updateFile",
"group": "files",
"weight": 167,
"weight": 166,
"cookies": false,
"type": "",
"demo": "storage\/update-file.md",
@ -7033,7 +7033,7 @@
"x-appwrite": {
"method": "deleteFile",
"group": "files",
"weight": 168,
"weight": 167,
"cookies": false,
"type": "",
"demo": "storage\/delete-file.md",
@ -7100,7 +7100,7 @@
"x-appwrite": {
"method": "getFileDownload",
"group": "files",
"weight": 164,
"weight": 163,
"cookies": false,
"type": "location",
"demo": "storage\/get-file-download.md",
@ -7178,7 +7178,7 @@
"x-appwrite": {
"method": "getFilePreview",
"group": "files",
"weight": 163,
"weight": 162,
"cookies": false,
"type": "location",
"demo": "storage\/get-file-preview.md",
@ -7406,7 +7406,7 @@
"x-appwrite": {
"method": "getFileView",
"group": "files",
"weight": 165,
"weight": 164,
"cookies": false,
"type": "location",
"demo": "storage\/get-file-view.md",
@ -7491,7 +7491,7 @@
"x-appwrite": {
"method": "listRows",
"group": "rows",
"weight": 432,
"weight": 431,
"cookies": false,
"type": "",
"demo": "tablesdb\/list-rows.md",
@ -7579,7 +7579,7 @@
"x-appwrite": {
"method": "createRow",
"group": "rows",
"weight": 424,
"weight": 423,
"cookies": false,
"type": "",
"demo": "tablesdb\/create-row.md",
@ -7675,7 +7675,7 @@
"data": {
"type": "object",
"description": "Row data as JSON object.",
"x-example": "{}"
"x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}"
},
"permissions": {
"type": "array",
@ -7724,7 +7724,7 @@
"x-appwrite": {
"method": "getRow",
"group": "rows",
"weight": 425,
"weight": 424,
"cookies": false,
"type": "",
"demo": "tablesdb\/get-row.md",
@ -7822,7 +7822,7 @@
"x-appwrite": {
"method": "upsertRow",
"group": "rows",
"weight": 428,
"weight": 427,
"cookies": false,
"type": "",
"demo": "tablesdb\/upsert-row.md",
@ -7961,7 +7961,7 @@
"x-appwrite": {
"method": "updateRow",
"group": "rows",
"weight": 426,
"weight": 425,
"cookies": false,
"type": "",
"demo": "tablesdb\/update-row.md",
@ -8063,7 +8063,7 @@
"x-appwrite": {
"method": "deleteRow",
"group": "rows",
"weight": 430,
"weight": 429,
"cookies": false,
"type": "",
"demo": "tablesdb\/delete-row.md",
@ -8150,7 +8150,7 @@
"x-appwrite": {
"method": "decrementRowColumn",
"group": "rows",
"weight": 435,
"weight": 434,
"cookies": false,
"type": "",
"demo": "tablesdb\/decrement-row-column.md",
@ -8268,7 +8268,7 @@
"x-appwrite": {
"method": "incrementRowColumn",
"group": "rows",
"weight": 434,
"weight": 433,
"cookies": false,
"type": "",
"demo": "tablesdb\/increment-row-column.md",
@ -8386,7 +8386,7 @@
"x-appwrite": {
"method": "list",
"group": "teams",
"weight": 172,
"weight": 171,
"cookies": false,
"type": "",
"demo": "teams\/list.md",
@ -8462,7 +8462,7 @@
"x-appwrite": {
"method": "create",
"group": "teams",
"weight": 171,
"weight": 170,
"cookies": false,
"type": "",
"demo": "teams\/create.md",
@ -8547,7 +8547,7 @@
"x-appwrite": {
"method": "get",
"group": "teams",
"weight": 173,
"weight": 172,
"cookies": false,
"type": "",
"demo": "teams\/get.md",
@ -8609,7 +8609,7 @@
"x-appwrite": {
"method": "updateName",
"group": "teams",
"weight": 175,
"weight": 174,
"cookies": false,
"type": "",
"demo": "teams\/update-name.md",
@ -8683,7 +8683,7 @@
"x-appwrite": {
"method": "delete",
"group": "teams",
"weight": 177,
"weight": 176,
"cookies": false,
"type": "",
"demo": "teams\/delete.md",
@ -8747,7 +8747,7 @@
"x-appwrite": {
"method": "listMemberships",
"group": "memberships",
"weight": 179,
"weight": 178,
"cookies": false,
"type": "",
"demo": "teams\/list-memberships.md",
@ -8833,7 +8833,7 @@
"x-appwrite": {
"method": "createMembership",
"group": "memberships",
"weight": 178,
"weight": 177,
"cookies": false,
"type": "",
"demo": "teams\/create-membership.md",
@ -8944,7 +8944,7 @@
"x-appwrite": {
"method": "getMembership",
"group": "memberships",
"weight": 180,
"weight": 179,
"cookies": false,
"type": "",
"demo": "teams\/get-membership.md",
@ -9016,7 +9016,7 @@
"x-appwrite": {
"method": "updateMembership",
"group": "memberships",
"weight": 181,
"weight": 180,
"cookies": false,
"type": "",
"demo": "teams\/update-membership.md",
@ -9103,7 +9103,7 @@
"x-appwrite": {
"method": "deleteMembership",
"group": "memberships",
"weight": 183,
"weight": 182,
"cookies": false,
"type": "",
"demo": "teams\/delete-membership.md",
@ -9177,7 +9177,7 @@
"x-appwrite": {
"method": "updateMembershipStatus",
"group": "memberships",
"weight": 182,
"weight": 181,
"cookies": false,
"type": "",
"demo": "teams\/update-membership-status.md",
@ -9275,7 +9275,7 @@
"x-appwrite": {
"method": "getPrefs",
"group": "teams",
"weight": 174,
"weight": 173,
"cookies": false,
"type": "",
"demo": "teams\/get-prefs.md",
@ -9336,7 +9336,7 @@
"x-appwrite": {
"method": "updatePrefs",
"group": "teams",
"weight": 176,
"weight": 175,
"cookies": false,
"type": "",
"demo": "teams\/update-prefs.md",

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1979,7 +1979,7 @@
"type": "object",
"description": "Prefs key-value JSON object.",
"default": {},
"x-example": "{}"
"x-example": "{\"language\":\"en\",\"timezone\":\"UTC\",\"darkTheme\":true}"
}
},
"required": [
@ -4972,7 +4972,7 @@
"x-appwrite": {
"method": "listDocuments",
"group": "documents",
"weight": 340,
"weight": 339,
"cookies": false,
"type": "",
"demo": "databases\/list-documents.md",
@ -5057,7 +5057,7 @@
"x-appwrite": {
"method": "createDocument",
"group": "documents",
"weight": 332,
"weight": 331,
"cookies": false,
"type": "",
"demo": "databases\/create-document.md",
@ -5154,7 +5154,7 @@
"type": "object",
"description": "Document data as JSON object.",
"default": [],
"x-example": "{}"
"x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}"
},
"permissions": {
"type": "array",
@ -5204,7 +5204,7 @@
"x-appwrite": {
"method": "getDocument",
"group": "documents",
"weight": 333,
"weight": 332,
"cookies": false,
"type": "",
"demo": "databases\/get-document.md",
@ -5297,7 +5297,7 @@
"x-appwrite": {
"method": "upsertDocument",
"group": "documents",
"weight": 336,
"weight": 335,
"cookies": false,
"type": "",
"demo": "databases\/upsert-document.md",
@ -5440,7 +5440,7 @@
"x-appwrite": {
"method": "updateDocument",
"group": "documents",
"weight": 334,
"weight": 333,
"cookies": false,
"type": "",
"demo": "databases\/update-document.md",
@ -5540,7 +5540,7 @@
"x-appwrite": {
"method": "deleteDocument",
"group": "documents",
"weight": 338,
"weight": 337,
"cookies": false,
"type": "",
"demo": "databases\/delete-document.md",
@ -5623,7 +5623,7 @@
"x-appwrite": {
"method": "decrementDocumentAttribute",
"group": "documents",
"weight": 343,
"weight": 342,
"cookies": false,
"type": "",
"demo": "databases\/decrement-document-attribute.md",
@ -5735,7 +5735,7 @@
"x-appwrite": {
"method": "incrementDocumentAttribute",
"group": "documents",
"weight": 342,
"weight": 341,
"cookies": false,
"type": "",
"demo": "databases\/increment-document-attribute.md",
@ -6106,7 +6106,7 @@
"x-appwrite": {
"method": "query",
"group": "graphql",
"weight": 255,
"weight": 254,
"cookies": false,
"type": "graphql",
"demo": "graphql\/query.md",
@ -6179,7 +6179,7 @@
"x-appwrite": {
"method": "mutation",
"group": "graphql",
"weight": 254,
"weight": 253,
"cookies": false,
"type": "graphql",
"demo": "graphql\/mutation.md",
@ -6660,7 +6660,7 @@
"x-appwrite": {
"method": "createSubscriber",
"group": "subscribers",
"weight": 301,
"weight": 300,
"cookies": false,
"type": "",
"demo": "messaging\/create-subscriber.md",
@ -6744,7 +6744,7 @@
"x-appwrite": {
"method": "deleteSubscriber",
"group": "subscribers",
"weight": 305,
"weight": 304,
"cookies": false,
"type": "",
"demo": "messaging\/delete-subscriber.md",
@ -6814,7 +6814,7 @@
"x-appwrite": {
"method": "listFiles",
"group": "files",
"weight": 161,
"weight": 160,
"cookies": false,
"type": "",
"demo": "storage\/list-files.md",
@ -6896,7 +6896,7 @@
"x-appwrite": {
"method": "createFile",
"group": "files",
"weight": 160,
"weight": 159,
"cookies": false,
"type": "upload",
"demo": "storage\/create-file.md",
@ -6985,7 +6985,7 @@
"x-appwrite": {
"method": "getFile",
"group": "files",
"weight": 162,
"weight": 161,
"cookies": false,
"type": "",
"demo": "storage\/get-file.md",
@ -7054,7 +7054,7 @@
"x-appwrite": {
"method": "updateFile",
"group": "files",
"weight": 167,
"weight": 166,
"cookies": false,
"type": "",
"demo": "storage\/update-file.md",
@ -7142,7 +7142,7 @@
"x-appwrite": {
"method": "deleteFile",
"group": "files",
"weight": 168,
"weight": 167,
"cookies": false,
"type": "",
"demo": "storage\/delete-file.md",
@ -7211,7 +7211,7 @@
"x-appwrite": {
"method": "getFileDownload",
"group": "files",
"weight": 164,
"weight": 163,
"cookies": false,
"type": "location",
"demo": "storage\/get-file-download.md",
@ -7289,7 +7289,7 @@
"x-appwrite": {
"method": "getFilePreview",
"group": "files",
"weight": 163,
"weight": 162,
"cookies": false,
"type": "location",
"demo": "storage\/get-file-preview.md",
@ -7495,7 +7495,7 @@
"x-appwrite": {
"method": "getFileView",
"group": "files",
"weight": 165,
"weight": 164,
"cookies": false,
"type": "location",
"demo": "storage\/get-file-view.md",
@ -7573,7 +7573,7 @@
"x-appwrite": {
"method": "listRows",
"group": "rows",
"weight": 432,
"weight": 431,
"cookies": false,
"type": "",
"demo": "tablesdb\/list-rows.md",
@ -7657,7 +7657,7 @@
"x-appwrite": {
"method": "createRow",
"group": "rows",
"weight": 424,
"weight": 423,
"cookies": false,
"type": "",
"demo": "tablesdb\/create-row.md",
@ -7749,7 +7749,7 @@
"type": "object",
"description": "Row data as JSON object.",
"default": [],
"x-example": "{}"
"x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}"
},
"permissions": {
"type": "array",
@ -7799,7 +7799,7 @@
"x-appwrite": {
"method": "getRow",
"group": "rows",
"weight": 425,
"weight": 424,
"cookies": false,
"type": "",
"demo": "tablesdb\/get-row.md",
@ -7891,7 +7891,7 @@
"x-appwrite": {
"method": "upsertRow",
"group": "rows",
"weight": 428,
"weight": 427,
"cookies": false,
"type": "",
"demo": "tablesdb\/upsert-row.md",
@ -8025,7 +8025,7 @@
"x-appwrite": {
"method": "updateRow",
"group": "rows",
"weight": 426,
"weight": 425,
"cookies": false,
"type": "",
"demo": "tablesdb\/update-row.md",
@ -8124,7 +8124,7 @@
"x-appwrite": {
"method": "deleteRow",
"group": "rows",
"weight": 430,
"weight": 429,
"cookies": false,
"type": "",
"demo": "tablesdb\/delete-row.md",
@ -8206,7 +8206,7 @@
"x-appwrite": {
"method": "decrementRowColumn",
"group": "rows",
"weight": 435,
"weight": 434,
"cookies": false,
"type": "",
"demo": "tablesdb\/decrement-row-column.md",
@ -8317,7 +8317,7 @@
"x-appwrite": {
"method": "incrementRowColumn",
"group": "rows",
"weight": 434,
"weight": 433,
"cookies": false,
"type": "",
"demo": "tablesdb\/increment-row-column.md",
@ -8426,7 +8426,7 @@
"x-appwrite": {
"method": "list",
"group": "teams",
"weight": 172,
"weight": 171,
"cookies": false,
"type": "",
"demo": "teams\/list.md",
@ -8500,7 +8500,7 @@
"x-appwrite": {
"method": "create",
"group": "teams",
"weight": 171,
"weight": 170,
"cookies": false,
"type": "",
"demo": "teams\/create.md",
@ -8589,7 +8589,7 @@
"x-appwrite": {
"method": "get",
"group": "teams",
"weight": 173,
"weight": 172,
"cookies": false,
"type": "",
"demo": "teams\/get.md",
@ -8650,7 +8650,7 @@
"x-appwrite": {
"method": "updateName",
"group": "teams",
"weight": 175,
"weight": 174,
"cookies": false,
"type": "",
"demo": "teams\/update-name.md",
@ -8724,7 +8724,7 @@
"x-appwrite": {
"method": "delete",
"group": "teams",
"weight": 177,
"weight": 176,
"cookies": false,
"type": "",
"demo": "teams\/delete.md",
@ -8785,7 +8785,7 @@
"x-appwrite": {
"method": "listMemberships",
"group": "memberships",
"weight": 179,
"weight": 178,
"cookies": false,
"type": "",
"demo": "teams\/list-memberships.md",
@ -8867,7 +8867,7 @@
"x-appwrite": {
"method": "createMembership",
"group": "memberships",
"weight": 178,
"weight": 177,
"cookies": false,
"type": "",
"demo": "teams\/create-membership.md",
@ -8979,7 +8979,7 @@
"x-appwrite": {
"method": "getMembership",
"group": "memberships",
"weight": 180,
"weight": 179,
"cookies": false,
"type": "",
"demo": "teams\/get-membership.md",
@ -9048,7 +9048,7 @@
"x-appwrite": {
"method": "updateMembership",
"group": "memberships",
"weight": 181,
"weight": 180,
"cookies": false,
"type": "",
"demo": "teams\/update-membership.md",
@ -9133,7 +9133,7 @@
"x-appwrite": {
"method": "deleteMembership",
"group": "memberships",
"weight": 183,
"weight": 182,
"cookies": false,
"type": "",
"demo": "teams\/delete-membership.md",
@ -9204,7 +9204,7 @@
"x-appwrite": {
"method": "updateMembershipStatus",
"group": "memberships",
"weight": 182,
"weight": 181,
"cookies": false,
"type": "",
"demo": "teams\/update-membership-status.md",
@ -9298,7 +9298,7 @@
"x-appwrite": {
"method": "getPrefs",
"group": "teams",
"weight": 174,
"weight": 173,
"cookies": false,
"type": "",
"demo": "teams\/get-prefs.md",
@ -9359,7 +9359,7 @@
"x-appwrite": {
"method": "updatePrefs",
"group": "teams",
"weight": 176,
"weight": 175,
"cookies": false,
"type": "",
"demo": "teams\/update-prefs.md",

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1979,7 +1979,7 @@
"type": "object",
"description": "Prefs key-value JSON object.",
"default": {},
"x-example": "{}"
"x-example": "{\"language\":\"en\",\"timezone\":\"UTC\",\"darkTheme\":true}"
}
},
"required": [
@ -4972,7 +4972,7 @@
"x-appwrite": {
"method": "listDocuments",
"group": "documents",
"weight": 340,
"weight": 339,
"cookies": false,
"type": "",
"demo": "databases\/list-documents.md",
@ -5057,7 +5057,7 @@
"x-appwrite": {
"method": "createDocument",
"group": "documents",
"weight": 332,
"weight": 331,
"cookies": false,
"type": "",
"demo": "databases\/create-document.md",
@ -5154,7 +5154,7 @@
"type": "object",
"description": "Document data as JSON object.",
"default": [],
"x-example": "{}"
"x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}"
},
"permissions": {
"type": "array",
@ -5204,7 +5204,7 @@
"x-appwrite": {
"method": "getDocument",
"group": "documents",
"weight": 333,
"weight": 332,
"cookies": false,
"type": "",
"demo": "databases\/get-document.md",
@ -5297,7 +5297,7 @@
"x-appwrite": {
"method": "upsertDocument",
"group": "documents",
"weight": 336,
"weight": 335,
"cookies": false,
"type": "",
"demo": "databases\/upsert-document.md",
@ -5440,7 +5440,7 @@
"x-appwrite": {
"method": "updateDocument",
"group": "documents",
"weight": 334,
"weight": 333,
"cookies": false,
"type": "",
"demo": "databases\/update-document.md",
@ -5540,7 +5540,7 @@
"x-appwrite": {
"method": "deleteDocument",
"group": "documents",
"weight": 338,
"weight": 337,
"cookies": false,
"type": "",
"demo": "databases\/delete-document.md",
@ -5623,7 +5623,7 @@
"x-appwrite": {
"method": "decrementDocumentAttribute",
"group": "documents",
"weight": 343,
"weight": 342,
"cookies": false,
"type": "",
"demo": "databases\/decrement-document-attribute.md",
@ -5735,7 +5735,7 @@
"x-appwrite": {
"method": "incrementDocumentAttribute",
"group": "documents",
"weight": 342,
"weight": 341,
"cookies": false,
"type": "",
"demo": "databases\/increment-document-attribute.md",
@ -6106,7 +6106,7 @@
"x-appwrite": {
"method": "query",
"group": "graphql",
"weight": 255,
"weight": 254,
"cookies": false,
"type": "graphql",
"demo": "graphql\/query.md",
@ -6179,7 +6179,7 @@
"x-appwrite": {
"method": "mutation",
"group": "graphql",
"weight": 254,
"weight": 253,
"cookies": false,
"type": "graphql",
"demo": "graphql\/mutation.md",
@ -6660,7 +6660,7 @@
"x-appwrite": {
"method": "createSubscriber",
"group": "subscribers",
"weight": 301,
"weight": 300,
"cookies": false,
"type": "",
"demo": "messaging\/create-subscriber.md",
@ -6744,7 +6744,7 @@
"x-appwrite": {
"method": "deleteSubscriber",
"group": "subscribers",
"weight": 305,
"weight": 304,
"cookies": false,
"type": "",
"demo": "messaging\/delete-subscriber.md",
@ -6814,7 +6814,7 @@
"x-appwrite": {
"method": "listFiles",
"group": "files",
"weight": 161,
"weight": 160,
"cookies": false,
"type": "",
"demo": "storage\/list-files.md",
@ -6896,7 +6896,7 @@
"x-appwrite": {
"method": "createFile",
"group": "files",
"weight": 160,
"weight": 159,
"cookies": false,
"type": "upload",
"demo": "storage\/create-file.md",
@ -6985,7 +6985,7 @@
"x-appwrite": {
"method": "getFile",
"group": "files",
"weight": 162,
"weight": 161,
"cookies": false,
"type": "",
"demo": "storage\/get-file.md",
@ -7054,7 +7054,7 @@
"x-appwrite": {
"method": "updateFile",
"group": "files",
"weight": 167,
"weight": 166,
"cookies": false,
"type": "",
"demo": "storage\/update-file.md",
@ -7142,7 +7142,7 @@
"x-appwrite": {
"method": "deleteFile",
"group": "files",
"weight": 168,
"weight": 167,
"cookies": false,
"type": "",
"demo": "storage\/delete-file.md",
@ -7211,7 +7211,7 @@
"x-appwrite": {
"method": "getFileDownload",
"group": "files",
"weight": 164,
"weight": 163,
"cookies": false,
"type": "location",
"demo": "storage\/get-file-download.md",
@ -7289,7 +7289,7 @@
"x-appwrite": {
"method": "getFilePreview",
"group": "files",
"weight": 163,
"weight": 162,
"cookies": false,
"type": "location",
"demo": "storage\/get-file-preview.md",
@ -7495,7 +7495,7 @@
"x-appwrite": {
"method": "getFileView",
"group": "files",
"weight": 165,
"weight": 164,
"cookies": false,
"type": "location",
"demo": "storage\/get-file-view.md",
@ -7573,7 +7573,7 @@
"x-appwrite": {
"method": "listRows",
"group": "rows",
"weight": 432,
"weight": 431,
"cookies": false,
"type": "",
"demo": "tablesdb\/list-rows.md",
@ -7657,7 +7657,7 @@
"x-appwrite": {
"method": "createRow",
"group": "rows",
"weight": 424,
"weight": 423,
"cookies": false,
"type": "",
"demo": "tablesdb\/create-row.md",
@ -7749,7 +7749,7 @@
"type": "object",
"description": "Row data as JSON object.",
"default": [],
"x-example": "{}"
"x-example": "{\"username\":\"walter.obrien\",\"email\":\"walter.obrien@example.com\",\"fullName\":\"Walter O'Brien\",\"age\":30,\"isAdmin\":false}"
},
"permissions": {
"type": "array",
@ -7799,7 +7799,7 @@
"x-appwrite": {
"method": "getRow",
"group": "rows",
"weight": 425,
"weight": 424,
"cookies": false,
"type": "",
"demo": "tablesdb\/get-row.md",
@ -7891,7 +7891,7 @@
"x-appwrite": {
"method": "upsertRow",
"group": "rows",
"weight": 428,
"weight": 427,
"cookies": false,
"type": "",
"demo": "tablesdb\/upsert-row.md",
@ -8025,7 +8025,7 @@
"x-appwrite": {
"method": "updateRow",
"group": "rows",
"weight": 426,
"weight": 425,
"cookies": false,
"type": "",
"demo": "tablesdb\/update-row.md",
@ -8124,7 +8124,7 @@
"x-appwrite": {
"method": "deleteRow",
"group": "rows",
"weight": 430,
"weight": 429,
"cookies": false,
"type": "",
"demo": "tablesdb\/delete-row.md",
@ -8206,7 +8206,7 @@
"x-appwrite": {
"method": "decrementRowColumn",
"group": "rows",
"weight": 435,
"weight": 434,
"cookies": false,
"type": "",
"demo": "tablesdb\/decrement-row-column.md",
@ -8317,7 +8317,7 @@
"x-appwrite": {
"method": "incrementRowColumn",
"group": "rows",
"weight": 434,
"weight": 433,
"cookies": false,
"type": "",
"demo": "tablesdb\/increment-row-column.md",
@ -8426,7 +8426,7 @@
"x-appwrite": {
"method": "list",
"group": "teams",
"weight": 172,
"weight": 171,
"cookies": false,
"type": "",
"demo": "teams\/list.md",
@ -8500,7 +8500,7 @@
"x-appwrite": {
"method": "create",
"group": "teams",
"weight": 171,
"weight": 170,
"cookies": false,
"type": "",
"demo": "teams\/create.md",
@ -8589,7 +8589,7 @@
"x-appwrite": {
"method": "get",
"group": "teams",
"weight": 173,
"weight": 172,
"cookies": false,
"type": "",
"demo": "teams\/get.md",
@ -8650,7 +8650,7 @@
"x-appwrite": {
"method": "updateName",
"group": "teams",
"weight": 175,
"weight": 174,
"cookies": false,
"type": "",
"demo": "teams\/update-name.md",
@ -8724,7 +8724,7 @@
"x-appwrite": {
"method": "delete",
"group": "teams",
"weight": 177,
"weight": 176,
"cookies": false,
"type": "",
"demo": "teams\/delete.md",
@ -8785,7 +8785,7 @@
"x-appwrite": {
"method": "listMemberships",
"group": "memberships",
"weight": 179,
"weight": 178,
"cookies": false,
"type": "",
"demo": "teams\/list-memberships.md",
@ -8867,7 +8867,7 @@
"x-appwrite": {
"method": "createMembership",
"group": "memberships",
"weight": 178,
"weight": 177,
"cookies": false,
"type": "",
"demo": "teams\/create-membership.md",
@ -8979,7 +8979,7 @@
"x-appwrite": {
"method": "getMembership",
"group": "memberships",
"weight": 180,
"weight": 179,
"cookies": false,
"type": "",
"demo": "teams\/get-membership.md",
@ -9048,7 +9048,7 @@
"x-appwrite": {
"method": "updateMembership",
"group": "memberships",
"weight": 181,
"weight": 180,
"cookies": false,
"type": "",
"demo": "teams\/update-membership.md",
@ -9133,7 +9133,7 @@
"x-appwrite": {
"method": "deleteMembership",
"group": "memberships",
"weight": 183,
"weight": 182,
"cookies": false,
"type": "",
"demo": "teams\/delete-membership.md",
@ -9204,7 +9204,7 @@
"x-appwrite": {
"method": "updateMembershipStatus",
"group": "memberships",
"weight": 182,
"weight": 181,
"cookies": false,
"type": "",
"demo": "teams\/update-membership-status.md",
@ -9298,7 +9298,7 @@
"x-appwrite": {
"method": "getPrefs",
"group": "teams",
"weight": 174,
"weight": 173,
"cookies": false,
"type": "",
"demo": "teams\/get-prefs.md",
@ -9359,7 +9359,7 @@
"x-appwrite": {
"method": "updatePrefs",
"group": "teams",
"weight": 176,
"weight": 175,
"cookies": false,
"type": "",
"demo": "teams\/update-prefs.md",

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -3168,7 +3168,7 @@ App::patch('/v1/account/prefs')
],
contentType: ContentType::JSON
))
->param('prefs', [], new Assoc(), 'Prefs key-value JSON object.')
->param('prefs', [], new Assoc(), 'Prefs key-value JSON object.', example: '{"language":"en","timezone":"UTC","darkTheme":true}')
->inject('requestTimestamp')
->inject('response')
->inject('user')

View file

@ -30,14 +30,11 @@ use Utopia\Database\Database;
use Utopia\Database\DateTime;
use Utopia\Database\Document;
use Utopia\Database\Exception\Duplicate;
use Utopia\Database\Exception\Order as OrderException;
use Utopia\Database\Exception\Query as QueryException;
use Utopia\Database\Helpers\ID;
use Utopia\Database\Helpers\Permission;
use Utopia\Database\Helpers\Role;
use Utopia\Database\Query;
use Utopia\Database\Validator\Datetime as DatetimeValidator;
use Utopia\Database\Validator\Query\Cursor;
use Utopia\Database\Validator\UID;
use Utopia\Domains\Validator\PublicDomain;
use Utopia\DSN\DSN;
@ -304,77 +301,6 @@ App::post('/v1/projects')
->dynamic($project, Response::MODEL_PROJECT);
});
App::get('/v1/projects')
->desc('List projects')
->groups(['api', 'projects'])
->label('scope', 'projects.read')
->label('sdk', new Method(
namespace: 'projects',
group: 'projects',
name: 'list',
description: '/docs/references/projects/list.md',
auth: [AuthType::ADMIN],
responses: [
new SDKResponse(
code: Response::STATUS_CODE_OK,
model: Response::MODEL_PROJECT_LIST,
)
]
))
->param('queries', [], new Projects(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Projects::ALLOWED_ATTRIBUTES), true)
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
->inject('response')
->inject('dbForPlatform')
->action(function (array $queries, string $search, Response $response, Database $dbForPlatform) {
try {
$queries = Query::parseQueries($queries);
} catch (QueryException $e) {
throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage());
}
if (!empty($search)) {
$queries[] = Query::search('search', $search);
}
/**
* Get cursor document if there was a cursor query, we use array_filter and reset for reference $cursor to $queries
*/
$cursor = \array_filter($queries, function ($query) {
return \in_array($query->getMethod(), [Query::TYPE_CURSOR_AFTER, Query::TYPE_CURSOR_BEFORE]);
});
$cursor = reset($cursor);
if ($cursor) {
/** @var Query $cursor */
$validator = new Cursor();
if (!$validator->isValid($cursor)) {
throw new Exception(Exception::GENERAL_QUERY_INVALID, $validator->getDescription());
}
$projectId = $cursor->getValue();
$cursorDocument = $dbForPlatform->getDocument('projects', $projectId);
if ($cursorDocument->isEmpty()) {
throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, "Project '{$projectId}' for the 'cursor' value not found.");
}
$cursor->setValue($cursorDocument);
}
$filterQueries = Query::groupByType($queries)['filters'];
try {
$projects = $dbForPlatform->find('projects', $queries);
$total = $dbForPlatform->count('projects', $filterQueries, APP_LIMIT_COUNT);
} catch (OrderException $e) {
throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null.");
}
$response->dynamic(new Document([
'projects' => $projects,
'total' => $total,
]), Response::MODEL_PROJECT_LIST);
});
App::get('/v1/projects/:projectId')
->desc('Get project')
->groups(['api', 'projects'])

View file

@ -36,6 +36,7 @@ use Utopia\Database\Exception\Authorization as AuthorizationException;
use Utopia\Database\Exception\Duplicate;
use Utopia\Database\Exception\Order as OrderException;
use Utopia\Database\Exception\Query as QueryException;
use Utopia\Database\Exception\Structure as StructureException;
use Utopia\Database\Helpers\ID;
use Utopia\Database\Helpers\Permission;
use Utopia\Database\Helpers\Role;
@ -282,7 +283,13 @@ App::get('/v1/teams/:teamId/prefs')
$prefs = $team->getAttribute('prefs', []);
$response->dynamic(new Document($prefs), Response::MODEL_PREFERENCES);
try {
$prefs = new Document($prefs);
} catch (StructureException $e) {
throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, $e->getMessage());
}
$response->dynamic($prefs, Response::MODEL_PREFERENCES);
});
App::put('/v1/teams/:teamId')
@ -357,6 +364,11 @@ App::put('/v1/teams/:teamId/prefs')
->inject('dbForProject')
->inject('queueForEvents')
->action(function (string $teamId, array $prefs, Response $response, Database $dbForProject, Event $queueForEvents) {
try {
$prefs = new Document($prefs);
} catch (StructureException $e) {
throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, $e->getMessage());
}
$team = $dbForProject->getDocument('teams', $teamId);
@ -364,11 +376,13 @@ App::put('/v1/teams/:teamId/prefs')
throw new Exception(Exception::TEAM_NOT_FOUND);
}
$team = $dbForProject->updateDocument('teams', $team->getId(), $team->setAttribute('prefs', $prefs));
$team = $dbForProject->updateDocument('teams', $team->getId(), new Document([
'prefs' => $prefs->getArrayCopy()
]));
$queueForEvents->setParam('teamId', $team->getId());
$response->dynamic(new Document($prefs), Response::MODEL_PREFERENCES);
$response->dynamic($prefs, Response::MODEL_PREFERENCES);
});
App::delete('/v1/teams/:teamId')

View file

@ -718,7 +718,16 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw
continue;
}
$response->setHeader($name, $values);
if (\is_array($values)) {
$count = 0;
foreach ($values as $value) {
$override = $count === 0;
$response->addHeader($name, $value, override: $override);
$count++;
}
} else {
$response->addHeader($name, $values);
}
}
$response

View file

@ -68,7 +68,7 @@
"utopia-php/platform": "0.7.*",
"utopia-php/pools": "0.8.*",
"utopia-php/preloader": "0.2.*",
"utopia-php/queue": "0.11.0",
"utopia-php/queue": "0.11.*",
"utopia-php/registry": "0.5.*",
"utopia-php/storage": "0.18.*",
"utopia-php/swoole": "0.8.*",

132
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "0da713ee5642eba1d30bc51c1a04a723",
"content-hash": "7553e976312b0423cc31544abb91caec",
"packages": [
{
"name": "adhocore/jwt",
@ -283,25 +283,25 @@
},
{
"name": "brick/math",
"version": "0.13.1",
"version": "0.14.0",
"source": {
"type": "git",
"url": "https://github.com/brick/math.git",
"reference": "fc7ed316430118cc7836bf45faff18d5dfc8de04"
"reference": "113a8ee2656b882d4c3164fa31aa6e12cbb7aaa2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/brick/math/zipball/fc7ed316430118cc7836bf45faff18d5dfc8de04",
"reference": "fc7ed316430118cc7836bf45faff18d5dfc8de04",
"url": "https://api.github.com/repos/brick/math/zipball/113a8ee2656b882d4c3164fa31aa6e12cbb7aaa2",
"reference": "113a8ee2656b882d4c3164fa31aa6e12cbb7aaa2",
"shasum": ""
},
"require": {
"php": "^8.1"
"php": "^8.2"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.2",
"phpunit/phpunit": "^10.1",
"vimeo/psalm": "6.8.8"
"phpstan/phpstan": "2.1.22",
"phpunit/phpunit": "^11.5"
},
"type": "library",
"autoload": {
@ -331,7 +331,7 @@
],
"support": {
"issues": "https://github.com/brick/math/issues",
"source": "https://github.com/brick/math/tree/0.13.1"
"source": "https://github.com/brick/math/tree/0.14.0"
},
"funding": [
{
@ -339,7 +339,7 @@
"type": "github"
}
],
"time": "2025-03-29T13:50:30+00:00"
"time": "2025-08-29T12:40:03+00:00"
},
{
"name": "chillerlan/php-qrcode",
@ -1162,16 +1162,16 @@
},
{
"name": "open-telemetry/api",
"version": "1.4.0",
"version": "1.5.0",
"source": {
"type": "git",
"url": "https://github.com/opentelemetry-php/api.git",
"reference": "b3a9286f9c1c8247c83493c5b1fa475cd0cec7f7"
"reference": "7692075f486c14d8cfd37fba98a08a5667f089e5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/opentelemetry-php/api/zipball/b3a9286f9c1c8247c83493c5b1fa475cd0cec7f7",
"reference": "b3a9286f9c1c8247c83493c5b1fa475cd0cec7f7",
"url": "https://api.github.com/repos/opentelemetry-php/api/zipball/7692075f486c14d8cfd37fba98a08a5667f089e5",
"reference": "7692075f486c14d8cfd37fba98a08a5667f089e5",
"shasum": ""
},
"require": {
@ -1228,7 +1228,7 @@
"issues": "https://github.com/open-telemetry/opentelemetry-php/issues",
"source": "https://github.com/open-telemetry/opentelemetry-php"
},
"time": "2025-06-19T23:36:51+00:00"
"time": "2025-08-07T23:07:38+00:00"
},
{
"name": "open-telemetry/context",
@ -1418,22 +1418,22 @@
},
{
"name": "open-telemetry/sdk",
"version": "1.7.0",
"version": "1.7.1",
"source": {
"type": "git",
"url": "https://github.com/opentelemetry-php/sdk.git",
"reference": "86287cf30fd6549444d7b8f7d8758d92e24086ac"
"reference": "52690d4b37ae4f091af773eef3c238ed2bc0aa06"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/86287cf30fd6549444d7b8f7d8758d92e24086ac",
"reference": "86287cf30fd6549444d7b8f7d8758d92e24086ac",
"url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/52690d4b37ae4f091af773eef3c238ed2bc0aa06",
"reference": "52690d4b37ae4f091af773eef3c238ed2bc0aa06",
"shasum": ""
},
"require": {
"ext-json": "*",
"nyholm/psr7-server": "^1.1",
"open-telemetry/api": "~1.4.0",
"open-telemetry/api": "^1.4",
"open-telemetry/context": "^1.0",
"open-telemetry/sem-conv": "^1.0",
"php": "^8.1",
@ -1511,7 +1511,7 @@
"issues": "https://github.com/open-telemetry/opentelemetry-php/issues",
"source": "https://github.com/open-telemetry/opentelemetry-php"
},
"time": "2025-08-06T03:07:06+00:00"
"time": "2025-09-05T07:17:06+00:00"
},
{
"name": "open-telemetry/sem-conv",
@ -2379,20 +2379,20 @@
},
{
"name": "ramsey/uuid",
"version": "4.9.0",
"version": "4.9.1",
"source": {
"type": "git",
"url": "https://github.com/ramsey/uuid.git",
"reference": "4e0e23cc785f0724a0e838279a9eb03f28b092a0"
"reference": "81f941f6f729b1e3ceea61d9d014f8b6c6800440"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ramsey/uuid/zipball/4e0e23cc785f0724a0e838279a9eb03f28b092a0",
"reference": "4e0e23cc785f0724a0e838279a9eb03f28b092a0",
"url": "https://api.github.com/repos/ramsey/uuid/zipball/81f941f6f729b1e3ceea61d9d014f8b6c6800440",
"reference": "81f941f6f729b1e3ceea61d9d014f8b6c6800440",
"shasum": ""
},
"require": {
"brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12 || ^0.13",
"brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12 || ^0.13 || ^0.14",
"php": "^8.0",
"ramsey/collection": "^1.2 || ^2.0"
},
@ -2451,9 +2451,9 @@
],
"support": {
"issues": "https://github.com/ramsey/uuid/issues",
"source": "https://github.com/ramsey/uuid/tree/4.9.0"
"source": "https://github.com/ramsey/uuid/tree/4.9.1"
},
"time": "2025-06-25T14:20:11+00:00"
"time": "2025-09-04T20:59:21+00:00"
},
{
"name": "spomky-labs/otphp",
@ -3638,16 +3638,16 @@
},
{
"name": "utopia-php/database",
"version": "1.4.0",
"version": "1.4.1",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/database.git",
"reference": "d32bd6160d55cab0cbe4b070e1c56e4c2a03c7a0"
"reference": "b5ea4d133a1a4e747b7522e61e072289129a06f4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/database/zipball/d32bd6160d55cab0cbe4b070e1c56e4c2a03c7a0",
"reference": "d32bd6160d55cab0cbe4b070e1c56e4c2a03c7a0",
"url": "https://api.github.com/repos/utopia-php/database/zipball/b5ea4d133a1a4e747b7522e61e072289129a06f4",
"reference": "b5ea4d133a1a4e747b7522e61e072289129a06f4",
"shasum": ""
},
"require": {
@ -3688,9 +3688,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/database/issues",
"source": "https://github.com/utopia-php/database/tree/1.4.0"
"source": "https://github.com/utopia-php/database/tree/1.4.1"
},
"time": "2025-09-04T11:45:26+00:00"
"time": "2025-09-05T13:23:52+00:00"
},
{
"name": "utopia-php/detector",
@ -3942,16 +3942,16 @@
},
{
"name": "utopia-php/framework",
"version": "0.33.24",
"version": "0.33.27",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/http.git",
"reference": "5112b1023342163e3fbedec99f38fc32c8700aa0"
"reference": "d9d10a895e85c8c7675220347cc6109db9d3bd37"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/http/zipball/5112b1023342163e3fbedec99f38fc32c8700aa0",
"reference": "5112b1023342163e3fbedec99f38fc32c8700aa0",
"url": "https://api.github.com/repos/utopia-php/http/zipball/d9d10a895e85c8c7675220347cc6109db9d3bd37",
"reference": "d9d10a895e85c8c7675220347cc6109db9d3bd37",
"shasum": ""
},
"require": {
@ -3983,9 +3983,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/http/issues",
"source": "https://github.com/utopia-php/http/tree/0.33.24"
"source": "https://github.com/utopia-php/http/tree/0.33.27"
},
"time": "2025-09-04T04:18:39+00:00"
"time": "2025-09-07T18:40:53+00:00"
},
{
"name": "utopia-php/image",
@ -4296,16 +4296,16 @@
},
{
"name": "utopia-php/platform",
"version": "0.7.8",
"version": "0.7.12",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/platform.git",
"reference": "e3a4536c46f10988b1a446ec6b8dd8a9914be854"
"reference": "04255de21db75e90b170040f4d1b457ba721e7a5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/platform/zipball/e3a4536c46f10988b1a446ec6b8dd8a9914be854",
"reference": "e3a4536c46f10988b1a446ec6b8dd8a9914be854",
"url": "https://api.github.com/repos/utopia-php/platform/zipball/04255de21db75e90b170040f4d1b457ba721e7a5",
"reference": "04255de21db75e90b170040f4d1b457ba721e7a5",
"shasum": ""
},
"require": {
@ -4340,9 +4340,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/platform/issues",
"source": "https://github.com/utopia-php/platform/tree/0.7.8"
"source": "https://github.com/utopia-php/platform/tree/0.7.12"
},
"time": "2025-05-30T10:05:43+00:00"
"time": "2025-09-05T15:53:12+00:00"
},
{
"name": "utopia-php/pools",
@ -4451,16 +4451,16 @@
},
{
"name": "utopia-php/queue",
"version": "0.11.0",
"version": "0.11.1",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/queue.git",
"reference": "06b5ced0eaed2ecc6aab6d8e1b4d96bff37a1ce5"
"reference": "498bbbef418b1db71b51e1bb62f5d1d752ddd8d6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/queue/zipball/06b5ced0eaed2ecc6aab6d8e1b4d96bff37a1ce5",
"reference": "06b5ced0eaed2ecc6aab6d8e1b4d96bff37a1ce5",
"url": "https://api.github.com/repos/utopia-php/queue/zipball/498bbbef418b1db71b51e1bb62f5d1d752ddd8d6",
"reference": "498bbbef418b1db71b51e1bb62f5d1d752ddd8d6",
"shasum": ""
},
"require": {
@ -4511,9 +4511,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/queue/issues",
"source": "https://github.com/utopia-php/queue/tree/0.11.0"
"source": "https://github.com/utopia-php/queue/tree/0.11.1"
},
"time": "2025-05-30T09:52:38+00:00"
"time": "2025-05-30T11:50:34+00:00"
},
{
"name": "utopia-php/registry",
@ -4627,16 +4627,16 @@
},
{
"name": "utopia-php/swoole",
"version": "0.8.3",
"version": "0.8.4",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/swoole.git",
"reference": "1af73dd3e73987cf729c7db399054e4a70befd99"
"reference": "150c30700e738c52348cce9ed0e0f0ff96872081"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/swoole/zipball/1af73dd3e73987cf729c7db399054e4a70befd99",
"reference": "1af73dd3e73987cf729c7db399054e4a70befd99",
"url": "https://api.github.com/repos/utopia-php/swoole/zipball/150c30700e738c52348cce9ed0e0f0ff96872081",
"reference": "150c30700e738c52348cce9ed0e0f0ff96872081",
"shasum": ""
},
"require": {
@ -4672,9 +4672,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/swoole/issues",
"source": "https://github.com/utopia-php/swoole/tree/0.8.3"
"source": "https://github.com/utopia-php/swoole/tree/0.8.4"
},
"time": "2025-03-26T10:09:05+00:00"
"time": "2025-09-07T09:39:46+00:00"
},
{
"name": "utopia-php/system",
@ -5007,16 +5007,16 @@
"packages-dev": [
{
"name": "appwrite/sdk-generator",
"version": "1.1.16",
"version": "1.3.2",
"source": {
"type": "git",
"url": "https://github.com/appwrite/sdk-generator.git",
"reference": "f8fbc4b1ba0e918825338f50cbdea4d887389c41"
"reference": "375a6c9b168db6fdf58fbe0d49d2261d80700b4a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/f8fbc4b1ba0e918825338f50cbdea4d887389c41",
"reference": "f8fbc4b1ba0e918825338f50cbdea4d887389c41",
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/375a6c9b168db6fdf58fbe0d49d2261d80700b4a",
"reference": "375a6c9b168db6fdf58fbe0d49d2261d80700b4a",
"shasum": ""
},
"require": {
@ -5052,9 +5052,9 @@
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
"support": {
"issues": "https://github.com/appwrite/sdk-generator/issues",
"source": "https://github.com/appwrite/sdk-generator/tree/1.1.16"
"source": "https://github.com/appwrite/sdk-generator/tree/1.3.2"
},
"time": "2025-09-03T06:50:04+00:00"
"time": "2025-09-05T15:50:35+00:00"
},
{
"name": "doctrine/annotations",
@ -8512,7 +8512,7 @@
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {},
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
@ -8536,5 +8536,5 @@
"platform-overrides": {
"php": "8.3"
},
"plugin-api-version": "2.6.0"
"plugin-api-version": "2.3.0"
}

View file

@ -0,0 +1,5 @@
appwrite databases create-line-attribute \
--database-id <DATABASE_ID> \
--collection-id <COLLECTION_ID> \
--key '' \
--required false

View file

@ -0,0 +1,5 @@
appwrite databases create-point-attribute \
--database-id <DATABASE_ID> \
--collection-id <COLLECTION_ID> \
--key '' \
--required false

View file

@ -0,0 +1,5 @@
appwrite databases create-polygon-attribute \
--database-id <DATABASE_ID> \
--collection-id <COLLECTION_ID> \
--key '' \
--required false

View file

@ -0,0 +1,5 @@
appwrite databases update-line-attribute \
--database-id <DATABASE_ID> \
--collection-id <COLLECTION_ID> \
--key '' \
--required false

View file

@ -0,0 +1,5 @@
appwrite databases update-point-attribute \
--database-id <DATABASE_ID> \
--collection-id <COLLECTION_ID> \
--key '' \
--required false

View file

@ -0,0 +1,5 @@
appwrite databases update-polygon-attribute \
--database-id <DATABASE_ID> \
--collection-id <COLLECTION_ID> \
--key '' \
--required false

View file

@ -0,0 +1,5 @@
appwrite tables-db create-line-column \
--database-id <DATABASE_ID> \
--table-id <TABLE_ID> \
--key '' \
--required false

View file

@ -0,0 +1,5 @@
appwrite tables-db create-point-column \
--database-id <DATABASE_ID> \
--table-id <TABLE_ID> \
--key '' \
--required false

View file

@ -0,0 +1,5 @@
appwrite tables-db create-polygon-column \
--database-id <DATABASE_ID> \
--table-id <TABLE_ID> \
--key '' \
--required false

View file

@ -0,0 +1,5 @@
appwrite tables-db update-line-column \
--database-id <DATABASE_ID> \
--table-id <TABLE_ID> \
--key '' \
--required false

View file

@ -0,0 +1,5 @@
appwrite tables-db update-point-column \
--database-id <DATABASE_ID> \
--table-id <TABLE_ID> \
--key '' \
--required false

View file

@ -0,0 +1,5 @@
appwrite tables-db update-polygon-column \
--database-id <DATABASE_ID> \
--table-id <TABLE_ID> \
--key '' \
--required false

View file

@ -1 +0,0 @@
Get a list of all projects. You can use the query params to filter your results.

View file

@ -57,7 +57,8 @@ class Mapper
'datetime' => Type::string(),
'json' => Types::json(),
'none' => Types::json(),
'any' => Types::json()
'any' => Types::json(),
'array' => Types::json()
];
foreach ($defaults as $type => $default) {

View file

@ -9,11 +9,11 @@ use Appwrite\SDK\AuthType;
use Appwrite\SDK\Deprecated;
use Appwrite\SDK\Method;
use Appwrite\SDK\Response as SDKResponse;
use Appwrite\Utopia\Database\Validator\Spatial;
use Appwrite\Utopia\Response as UtopiaResponse;
use Utopia\Database\Database;
use Utopia\Database\Document;
use Utopia\Database\Validator\Key;
use Utopia\Database\Validator\Spatial;
use Utopia\Database\Validator\UID;
use Utopia\Swoole\Response as SwooleResponse;
use Utopia\Validator\Boolean;
@ -64,7 +64,7 @@ class Create extends Action
->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).')
->param('key', '', new Key(), 'Attribute Key.')
->param('required', null, new Boolean(), 'Is attribute required?')
->param('default', null, new Nullable(new Spatial(Database::VAR_LINESTRING)), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.', true)
->param('default', null, new Nullable(new Spatial(Database::VAR_LINESTRING)), 'Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.', true)
->inject('response')
->inject('dbForProject')
->inject('queueForDatabase')
@ -72,10 +72,8 @@ class Create extends Action
->callback($this->action(...));
}
public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void
public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?array $default, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void
{
$default = \is_string($default) ? \json_decode($default, true) : $default;
$attribute = $this->createAttribute($databaseId, $collectionId, new Document([
'key' => $key,
'type' => Database::VAR_LINESTRING,

View file

@ -9,10 +9,10 @@ use Appwrite\SDK\ContentType;
use Appwrite\SDK\Deprecated;
use Appwrite\SDK\Method;
use Appwrite\SDK\Response as SDKResponse;
use Appwrite\Utopia\Database\Validator\Spatial;
use Appwrite\Utopia\Response as UtopiaResponse;
use Utopia\Database\Database;
use Utopia\Database\Validator\Key;
use Utopia\Database\Validator\Spatial;
use Utopia\Database\Validator\UID;
use Utopia\Swoole\Response as SwooleResponse;
use Utopia\Validator\Boolean;
@ -64,7 +64,7 @@ class Update extends Action
->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).')
->param('key', '', new Key(), 'Attribute Key.')
->param('required', null, new Boolean(), 'Is attribute required?')
->param('default', null, new Nullable(new Spatial(Database::VAR_LINESTRING)), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.', true)
->param('default', null, new Nullable(new Spatial(Database::VAR_LINESTRING)), 'Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.', true)
->param('newKey', null, new Key(), 'New attribute key.', true)
->inject('response')
->inject('dbForProject')
@ -72,10 +72,8 @@ class Update extends Action
->callback($this->action(...));
}
public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void
public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?array $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void
{
$default = \is_string($default) ? \json_decode($default, true) : $default;
$attribute = $this->updateAttribute(
databaseId: $databaseId,
collectionId: $collectionId,

View file

@ -9,11 +9,11 @@ use Appwrite\SDK\AuthType;
use Appwrite\SDK\Deprecated;
use Appwrite\SDK\Method;
use Appwrite\SDK\Response as SDKResponse;
use Appwrite\Utopia\Database\Validator\Spatial;
use Appwrite\Utopia\Response as UtopiaResponse;
use Utopia\Database\Database;
use Utopia\Database\Document;
use Utopia\Database\Validator\Key;
use Utopia\Database\Validator\Spatial;
use Utopia\Database\Validator\UID;
use Utopia\Swoole\Response as SwooleResponse;
use Utopia\Validator\Boolean;
@ -64,7 +64,7 @@ class Create extends Action
->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).')
->param('key', '', new Key(), 'Attribute Key.')
->param('required', null, new Boolean(), 'Is attribute required?')
->param('default', null, new Nullable(new Spatial(Database::VAR_POINT)), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.', true)
->param('default', null, new Nullable(new Spatial(Database::VAR_POINT)), 'Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.', true)
->inject('response')
->inject('dbForProject')
->inject('queueForDatabase')
@ -72,10 +72,8 @@ class Create extends Action
->callback($this->action(...));
}
public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void
public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?array $default, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void
{
$default = \is_string($default) ? \json_decode($default, true) : $default;
$attribute = $this->createAttribute($databaseId, $collectionId, new Document([
'key' => $key,
'type' => Database::VAR_POINT,

View file

@ -9,10 +9,10 @@ use Appwrite\SDK\ContentType;
use Appwrite\SDK\Deprecated;
use Appwrite\SDK\Method;
use Appwrite\SDK\Response as SDKResponse;
use Appwrite\Utopia\Database\Validator\Spatial;
use Appwrite\Utopia\Response as UtopiaResponse;
use Utopia\Database\Database;
use Utopia\Database\Validator\Key;
use Utopia\Database\Validator\Spatial;
use Utopia\Database\Validator\UID;
use Utopia\Swoole\Response as SwooleResponse;
use Utopia\Validator\Boolean;
@ -64,7 +64,7 @@ class Update extends Action
->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).')
->param('key', '', new Key(), 'Attribute Key.')
->param('required', null, new Boolean(), 'Is attribute required?')
->param('default', null, new Nullable(new Spatial(Database::VAR_POINT)), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.', true)
->param('default', null, new Nullable(new Spatial(Database::VAR_POINT)), 'Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.', true)
->param('newKey', null, new Key(), 'New attribute key.', true)
->inject('response')
->inject('dbForProject')
@ -72,10 +72,8 @@ class Update extends Action
->callback($this->action(...));
}
public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void
public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?array $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void
{
$default = \is_string($default) ? \json_decode($default, true) : $default;
$attribute = $this->updateAttribute(
databaseId: $databaseId,
collectionId: $collectionId,

View file

@ -9,11 +9,11 @@ use Appwrite\SDK\AuthType;
use Appwrite\SDK\Deprecated;
use Appwrite\SDK\Method;
use Appwrite\SDK\Response as SDKResponse;
use Appwrite\Utopia\Database\Validator\Spatial;
use Appwrite\Utopia\Response as UtopiaResponse;
use Utopia\Database\Database;
use Utopia\Database\Document;
use Utopia\Database\Validator\Key;
use Utopia\Database\Validator\Spatial;
use Utopia\Database\Validator\UID;
use Utopia\Swoole\Response as SwooleResponse;
use Utopia\Validator\Boolean;
@ -64,7 +64,7 @@ class Create extends Action
->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).')
->param('key', '', new Key(), 'Attribute Key.')
->param('required', null, new Boolean(), 'Is attribute required?')
->param('default', null, new Nullable(new Spatial(Database::VAR_POLYGON)), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.', true)
->param('default', null, new Nullable(new Spatial(Database::VAR_POLYGON)), 'Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.', true)
->inject('response')
->inject('dbForProject')
->inject('queueForDatabase')
@ -72,10 +72,8 @@ class Create extends Action
->callback($this->action(...));
}
public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void
public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?array $default, UtopiaResponse $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents): void
{
$default = \is_string($default) ? \json_decode($default, true) : $default;
$attribute = $this->createAttribute($databaseId, $collectionId, new Document([
'key' => $key,
'type' => Database::VAR_POLYGON,

View file

@ -9,10 +9,10 @@ use Appwrite\SDK\ContentType;
use Appwrite\SDK\Deprecated;
use Appwrite\SDK\Method;
use Appwrite\SDK\Response as SDKResponse;
use Appwrite\Utopia\Database\Validator\Spatial;
use Appwrite\Utopia\Response as UtopiaResponse;
use Utopia\Database\Database;
use Utopia\Database\Validator\Key;
use Utopia\Database\Validator\Spatial;
use Utopia\Database\Validator\UID;
use Utopia\Swoole\Response as SwooleResponse;
use Utopia\Validator\Boolean;
@ -64,7 +64,7 @@ class Update extends Action
->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).')
->param('key', '', new Key(), 'Attribute Key.')
->param('required', null, new Boolean(), 'Is attribute required?')
->param('default', null, new Nullable(new Spatial(Database::VAR_POLYGON)), 'Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.', true)
->param('default', null, new Nullable(new Spatial(Database::VAR_POLYGON)), 'Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.', true)
->param('newKey', null, new Key(), 'New attribute key.', true)
->inject('response')
->inject('dbForProject')
@ -72,10 +72,8 @@ class Update extends Action
->callback($this->action(...));
}
public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?string $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void
public function action(string $databaseId, string $collectionId, string $key, ?bool $required, ?array $default, ?string $newKey, UtopiaResponse $response, Database $dbForProject, Event $queueForEvents): void
{
$default = \is_string($default) ? \json_decode($default, true) : $default;
$attribute = $this->updateAttribute(
databaseId: $databaseId,
collectionId: $collectionId,

View file

@ -116,7 +116,7 @@ class Create extends Action
->param('databaseId', '', new UID(), 'Database ID.')
->param('documentId', '', new CustomId(), 'Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.', true)
->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.')
->param('data', [], new JSON(), 'Document data as JSON object.', true)
->param('data', [], new JSON(), 'Document data as JSON object.', true, example: '{"username":"walter.obrien","email":"walter.obrien@example.com","fullName":"Walter O\'Brien","age":30,"isAdmin":false}')
->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true)
->param('documents', [], fn (array $plan) => new ArrayList(new JSON(), $plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH), 'Array of documents data as JSON objects.', true, ['plan'])
->inject('response')

View file

@ -6,10 +6,10 @@ use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Li
use Appwrite\SDK\AuthType;
use Appwrite\SDK\Method;
use Appwrite\SDK\Response as SDKResponse;
use Appwrite\Utopia\Database\Validator\Spatial;
use Appwrite\Utopia\Response as UtopiaResponse;
use Utopia\Database\Database;
use Utopia\Database\Validator\Key;
use Utopia\Database\Validator\Spatial;
use Utopia\Database\Validator\UID;
use Utopia\Swoole\Response as SwooleResponse;
use Utopia\Validator\Boolean;
@ -56,7 +56,7 @@ class Create extends LineCreate
->param('tableId', '', new UID(), 'Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).')
->param('key', '', new Key(), 'Column Key.')
->param('required', null, new Boolean(), 'Is column required?')
->param('default', null, new Nullable(new Spatial(Database::VAR_LINESTRING)), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.', true)
->param('default', null, new Nullable(new Spatial(Database::VAR_LINESTRING)), 'Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required.', true)
->inject('response')
->inject('dbForProject')
->inject('queueForDatabase')

View file

@ -7,10 +7,10 @@ use Appwrite\SDK\AuthType;
use Appwrite\SDK\ContentType;
use Appwrite\SDK\Method;
use Appwrite\SDK\Response as SDKResponse;
use Appwrite\Utopia\Database\Validator\Spatial;
use Appwrite\Utopia\Response as UtopiaResponse;
use Utopia\Database\Database;
use Utopia\Database\Validator\Key;
use Utopia\Database\Validator\Spatial;
use Utopia\Database\Validator\UID;
use Utopia\Swoole\Response as SwooleResponse;
use Utopia\Validator\Boolean;
@ -58,7 +58,7 @@ class Update extends LineUpdate
->param('tableId', '', new UID(), 'Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).')
->param('key', '', new Key(), 'Column Key.')
->param('required', null, new Boolean(), 'Is column required?')
->param('default', null, new Nullable(new Spatial(Database::VAR_LINESTRING)), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.', true)
->param('default', null, new Nullable(new Spatial(Database::VAR_LINESTRING)), 'Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required.', true)
->param('newKey', null, new Key(), 'New Column Key.', true)
->inject('response')
->inject('dbForProject')

View file

@ -6,10 +6,10 @@ use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Po
use Appwrite\SDK\AuthType;
use Appwrite\SDK\Method;
use Appwrite\SDK\Response as SDKResponse;
use Appwrite\Utopia\Database\Validator\Spatial;
use Appwrite\Utopia\Response as UtopiaResponse;
use Utopia\Database\Database;
use Utopia\Database\Validator\Key;
use Utopia\Database\Validator\Spatial;
use Utopia\Database\Validator\UID;
use Utopia\Swoole\Response as SwooleResponse;
use Utopia\Validator\Boolean;
@ -56,7 +56,7 @@ class Create extends PointCreate
->param('tableId', '', new UID(), 'Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).')
->param('key', '', new Key(), 'Column Key.')
->param('required', null, new Boolean(), 'Is column required?')
->param('default', null, new Nullable(new Spatial(Database::VAR_POINT)), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.', true)
->param('default', null, new Nullable(new Spatial(Database::VAR_POINT)), 'Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.', true)
->inject('response')
->inject('dbForProject')
->inject('queueForDatabase')

View file

@ -7,10 +7,10 @@ use Appwrite\SDK\AuthType;
use Appwrite\SDK\ContentType;
use Appwrite\SDK\Method;
use Appwrite\SDK\Response as SDKResponse;
use Appwrite\Utopia\Database\Validator\Spatial;
use Appwrite\Utopia\Response as UtopiaResponse;
use Utopia\Database\Database;
use Utopia\Database\Validator\Key;
use Utopia\Database\Validator\Spatial;
use Utopia\Database\Validator\UID;
use Utopia\Swoole\Response as SwooleResponse;
use Utopia\Validator\Boolean;
@ -58,7 +58,7 @@ class Update extends PointUpdate
->param('tableId', '', new UID(), 'Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).')
->param('key', '', new Key(), 'Column Key.')
->param('required', null, new Boolean(), 'Is column required?')
->param('default', null, new Nullable(new Spatial(Database::VAR_POINT)), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.', true)
->param('default', null, new Nullable(new Spatial(Database::VAR_POINT)), 'Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.', true)
->param('newKey', null, new Key(), 'New Column Key.', true)
->inject('response')
->inject('dbForProject')

View file

@ -6,10 +6,10 @@ use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Attributes\Po
use Appwrite\SDK\AuthType;
use Appwrite\SDK\Method;
use Appwrite\SDK\Response as SDKResponse;
use Appwrite\Utopia\Database\Validator\Spatial;
use Appwrite\Utopia\Response as UtopiaResponse;
use Utopia\Database\Database;
use Utopia\Database\Validator\Key;
use Utopia\Database\Validator\Spatial;
use Utopia\Database\Validator\UID;
use Utopia\Swoole\Response as SwooleResponse;
use Utopia\Validator\Boolean;
@ -56,7 +56,7 @@ class Create extends PolygonCreate
->param('tableId', '', new UID(), 'Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).')
->param('key', '', new Key(), 'Column Key.')
->param('required', null, new Boolean(), 'Is column required?')
->param('default', null, new Nullable(new Spatial(Database::VAR_POLYGON)), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.', true)
->param('default', null, new Nullable(new Spatial(Database::VAR_POLYGON)), 'Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.', true)
->inject('response')
->inject('dbForProject')
->inject('queueForDatabase')

View file

@ -7,10 +7,10 @@ use Appwrite\SDK\AuthType;
use Appwrite\SDK\ContentType;
use Appwrite\SDK\Method;
use Appwrite\SDK\Response as SDKResponse;
use Appwrite\Utopia\Database\Validator\Spatial;
use Appwrite\Utopia\Response as UtopiaResponse;
use Utopia\Database\Database;
use Utopia\Database\Validator\Key;
use Utopia\Database\Validator\Spatial;
use Utopia\Database\Validator\UID;
use Utopia\Swoole\Response as SwooleResponse;
use Utopia\Validator\Boolean;
@ -58,7 +58,7 @@ class Update extends PolygonUpdate
->param('tableId', '', new UID(), 'Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).')
->param('key', '', new Key(), 'Column Key.')
->param('required', null, new Boolean(), 'Is column required?')
->param('default', null, new Nullable(new Spatial(Database::VAR_POLYGON)), 'Default value for column when not provided, as JSON string. Cannot be set when column is required.', true)
->param('default', null, new Nullable(new Spatial(Database::VAR_POLYGON)), 'Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.', true)
->param('newKey', null, new Key(), 'New Column Key.', true)
->inject('response')
->inject('dbForProject')

View file

@ -95,7 +95,7 @@ class Create extends DocumentCreate
->param('databaseId', '', new UID(), 'Database ID.')
->param('rowId', '', new CustomId(), 'Row ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.', true)
->param('tableId', '', new UID(), 'Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows.')
->param('data', [], new JSON(), 'Row data as JSON object.', true)
->param('data', [], new JSON(), 'Row data as JSON object.', true, example: '{"username":"walter.obrien","email":"walter.obrien@example.com","fullName":"Walter O\'Brien","age":30,"isAdmin":false}')
->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true)
->param('rows', [], fn (array $plan) => new ArrayList(new JSON(), $plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH), 'Array of documents data as JSON objects.', true, ['plan'])
->inject('response')

View file

@ -0,0 +1,116 @@
<?php
namespace Appwrite\Platform\Modules\Projects\Http\Projects;
use Appwrite\Extend\Exception;
use Appwrite\SDK\AuthType;
use Appwrite\SDK\ContentType;
use Appwrite\SDK\Method;
use Appwrite\SDK\Response as SDKResponse;
use Appwrite\Utopia\Database\Validator\Queries\Projects;
use Appwrite\Utopia\Response;
use Utopia\Database\Database;
use Utopia\Database\Document;
use Utopia\Database\Exception\Order;
use Utopia\Database\Exception\Query as QueryException;
use Utopia\Database\Query;
use Utopia\Database\Validator\Query\Cursor;
use Utopia\Platform\Action;
use Utopia\Platform\Scope\HTTP;
use Utopia\Validator;
use Utopia\Validator\Text;
class XList extends Action
{
use HTTP;
public static function getName()
{
return 'listProjects';
}
protected function getQueriesValidator(): Validator
{
return new Projects();
}
public function __construct()
{
$this
->setHttpMethod(Action::HTTP_REQUEST_METHOD_GET)
->setHttpPath('/v1/projects')
->desc('List projects')
->groups(['api', 'projects'])
->label('scope', 'projects.read')
->label('sdk', new Method(
namespace: 'projects',
group: 'projects',
name: 'list',
description: <<<EOT
Get a list of all projects. You can use the query params to filter your results.
EOT,
auth: [AuthType::ADMIN],
responses: [
new SDKResponse(
code: Response::STATUS_CODE_OK,
model: Response::MODEL_PROJECT_LIST
)
],
contentType: ContentType::JSON
))
->param('queries', [], $this->getQueriesValidator(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Projects::ALLOWED_ATTRIBUTES), true)
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
->inject('response')
->inject('dbForPlatform')
->callback($this->action(...));
}
public function action(array $queries, string $search, Response $response, Database $dbForPlatform)
{
try {
$queries = Query::parseQueries($queries);
} catch (QueryException $e) {
throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage());
}
if (!empty($search)) {
$queries[] = Query::search('search', $search);
}
/**
* Get cursor document if there was a cursor query, we use array_filter and reset for reference $cursor to $queries
*/
$cursor = \array_filter($queries, function ($query) {
return \in_array($query->getMethod(), [Query::TYPE_CURSOR_AFTER, Query::TYPE_CURSOR_BEFORE]);
});
$cursor = reset($cursor);
if ($cursor) {
/** @var Query $cursor */
$validator = new Cursor();
if (!$validator->isValid($cursor)) {
throw new Exception(Exception::GENERAL_QUERY_INVALID, $validator->getDescription());
}
$projectId = $cursor->getValue();
$cursorDocument = $dbForPlatform->getDocument('projects', $projectId);
if ($cursorDocument->isEmpty()) {
throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, "Project '{$projectId}' for the 'cursor' value not found.");
}
$cursor->setValue($cursorDocument);
}
$filterQueries = Query::groupByType($queries)['filters'];
try {
$projects = $dbForPlatform->find('projects', $queries);
$total = $dbForPlatform->count('projects', $filterQueries, APP_LIMIT_COUNT);
} catch (Order $e) {
throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null.");
}
$response->dynamic(new Document([
'projects' => $projects,
'total' => $total,
]), Response::MODEL_PROJECT_LIST);
}
}

View file

@ -7,6 +7,7 @@ use Appwrite\Platform\Modules\Projects\Http\DevKeys\Delete as DeleteDevKey;
use Appwrite\Platform\Modules\Projects\Http\DevKeys\Get as GetDevKey;
use Appwrite\Platform\Modules\Projects\Http\DevKeys\Update as UpdateDevKey;
use Appwrite\Platform\Modules\Projects\Http\DevKeys\XList as ListDevKeys;
use Appwrite\Platform\Modules\Projects\Http\Projects\XList as ListProjects;
use Utopia\Platform\Service;
class Http extends Service
@ -19,5 +20,7 @@ class Http extends Service
$this->addAction(GetDevKey::getName(), new GetDevKey());
$this->addAction(ListDevKeys::getName(), new ListDevKeys());
$this->addAction(DeleteDevKey::getName(), new DeleteDevKey());
$this->addAction(ListProjects::getName(), new ListProjects());
}
}

View file

@ -433,7 +433,7 @@ class OpenAPI3 extends Format
case 'Utopia\Validator\Assoc':
$param['default'] = (empty($param['default'])) ? new \stdClass() : $param['default'];
$node['schema']['type'] = 'object';
$node['schema']['x-example'] = '{}';
$node['schema']['x-example'] = ($param['example'] ?? '') ?: '{}';
break;
case 'Utopia\Storage\Validator\File':
$consumes = ['multipart/form-data'];
@ -447,6 +447,15 @@ class OpenAPI3 extends Format
'type' => $validator->getValidator()->getType(),
];
break;
case 'Utopia\Database\Validator\Spatial':
$node['schema']['type'] = 'array';
$node['schema']['items'] = [
'oneOf' => [
['type' => 'array']
]
];
$node['schema']['x-example'] = '[[1,2], [3, 4]]';
break;
case 'Appwrite\Utopia\Database\Validator\Queries\Columns':
case 'Appwrite\Utopia\Database\Validator\Queries\Attributes':
case 'Appwrite\Utopia\Database\Validator\Queries\Buckets':
@ -671,6 +680,10 @@ class OpenAPI3 extends Format
$output['components']['schemas'][$model->getType()]['properties'][$name]['additionalProperties'] = true;
break;
case 'array':
$type = 'array';
break;
case 'integer':
$type = 'integer';
$format = 'int32';

View file

@ -462,12 +462,21 @@ class Swagger2 extends Format
'type' => $validator->getValidator()->getType(),
];
break;
case 'Utopia\Database\Validator\Spatial':
$node['type'] = 'array';
$node['schema']['items'] = [
'oneOf' => [
['type' => 'array']
]
];
$node['x-example'] = '[[1,2], [3, 4]]';
break;
case 'Utopia\Validator\JSON':
case 'Utopia\Validator\Mock':
case 'Utopia\Validator\Assoc':
$node['type'] = 'object';
$node['default'] = (empty($param['default'])) ? new \stdClass() : $param['default'];
$node['x-example'] = '{}';
$node['x-example'] = ($param['example'] ?? '') ?: '{}';
break;
case 'Utopia\Storage\Validator\File':
$consumes = ['multipart/form-data'];
@ -678,6 +687,10 @@ class Swagger2 extends Format
$type = 'object';
break;
case 'array':
$type = 'array';
break;
case 'integer':
$type = 'integer';
$format = 'int32';

View file

@ -1,42 +0,0 @@
<?php
namespace Appwrite\Utopia\Database\Validator;
use Utopia\Database\Validator\Spatial as SpatialValidator;
use Utopia\Validator\JSON;
class Spatial extends JSON
{
private string $spatialAttributeType;
public function getDescription(): string
{
return 'Value must be a valid spatial type JSON string';
}
/**
* @param string $spatialAttributeType
*/
public function __construct(string $spatialAttributeType)
{
$this->spatialAttributeType = $spatialAttributeType;
}
/**
* Is valid.
*
* Returns true if valid or false if not.
*
* @param $value
*
* @return bool
*/
public function isValid($value): bool
{
if (!parent::isValid($value)) {
return false;
}
$value = \json_decode($value, true);
$validator = new SpatialValidator($this->spatialAttributeType);
return $validator->isValid($value);
}
}

View file

@ -955,24 +955,6 @@ class Response extends SwooleResponse
return !empty($this->filters);
}
/**
* Set Header
*
* @param string $key
* @param string|array<string> $value
* @return void
*/
public function setHeader(string $key, mixed $value): void
{
if (is_array($value)) {
// Temporary solution to support proxying Set-cookie (2 cookies, 1 name)
// Ideally this would live in http library, supporting array of values in all adapters
$this->swoole->header($key, $value);
} else {
$this->sendHeader($key, $value);
}
}
/**
* Static wrapper to show sensitive data in response
*

View file

@ -15,6 +15,7 @@ abstract class Model
public const TYPE_DATETIME_EXAMPLE = '2020-10-15T06:38:00.000+00:00';
public const TYPE_RELATIONSHIP = 'relationship';
public const TYPE_PAYLOAD = 'payload';
public const TYPE_ARRAY = 'array';
/**
* @var bool

View file

@ -12,15 +12,19 @@ class AttributeLine extends Attribute
$this
->addRule('default', [
'type' => self::TYPE_JSON,
'type' => self::TYPE_ARRAY,
'description' => 'Default value for attribute when not provided. Cannot be set when attribute is required.',
'default' => null,
'required' => false,
'example' => '[[0, 0], [1, 1]]'
'example' => [[0, 0], [1, 1]]
])
;
}
public array $conditions = [
'type' => 'linestring',
];
/**
* Get Name
*

View file

@ -12,15 +12,19 @@ class AttributePoint extends Attribute
$this
->addRule('default', [
'type' => self::TYPE_JSON,
'type' => self::TYPE_ARRAY,
'description' => 'Default value for attribute when not provided. Cannot be set when attribute is required.',
'default' => null,
'required' => false,
'example' => '[0, 0]'
'example' => [0, 0]
])
;
}
public array $conditions = [
'type' => 'point',
];
/**
* Get Name
*

View file

@ -12,15 +12,19 @@ class AttributePolygon extends Attribute
$this
->addRule('default', [
'type' => self::TYPE_JSON,
'type' => self::TYPE_ARRAY,
'description' => 'Default value for attribute when not provided. Cannot be set when attribute is required.',
'default' => null,
'required' => false,
'example' => '[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]'
'example' => [[[0, 0], [0, 10]], [[10, 10], [0, 0]]]
])
;
}
public array $conditions = [
'type' => 'polygon',
];
/**
* Get Name
*

View file

@ -12,15 +12,19 @@ class ColumnLine extends Column
$this
->addRule('default', [
'type' => self::TYPE_JSON,
'type' => self::TYPE_ARRAY,
'description' => 'Default value for column when not provided. Cannot be set when column is required.',
'default' => null,
'required' => false,
'example' => '[[0, 0], [1, 1]]'
'example' => [[0, 0], [1, 1]]
])
;
}
public array $conditions = [
'type' => 'linestring',
];
/**
* Get Name
*

View file

@ -12,15 +12,19 @@ class ColumnPoint extends Column
$this
->addRule('default', [
'type' => self::TYPE_JSON,
'type' => self::TYPE_ARRAY,
'description' => 'Default value for column when not provided. Cannot be set when column is required.',
'default' => null,
'required' => false,
'example' => '[0, 0]'
'example' => [0, 0]
])
;
}
public array $conditions = [
'type' => 'point',
];
/**
* Get Name
*

View file

@ -12,15 +12,19 @@ class ColumnPolygon extends Column
$this
->addRule('default', [
'type' => self::TYPE_JSON,
'type' => self::TYPE_ARRAY,
'description' => 'Default value for column when not provided. Cannot be set when column is required.',
'default' => null,
'required' => false,
'example' => '[[[0, 0], [0, 10]], [[10, 10], [0, 0]]]'
'example' => [[[0, 0], [0, 10]], [[10, 10], [0, 0]]]
])
;
}
public array $conditions = [
'type' => 'polygon',
];
/**
* Get Name
*

View file

@ -6537,7 +6537,7 @@ trait DatabasesBase
'x-appwrite-key' => $this->getProject()['apiKey']
]), [
'required' => false,
'default' => json_encode([[0, 0], [1, 1]]),
'default' => [[0, 0], [1, 1]],
]);
$this->assertEquals(200, $response['headers']['status-code']);
@ -6564,7 +6564,7 @@ trait DatabasesBase
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-key' => $this->getProject()['apiKey']
]), [
'default' => json_encode([0, 0]),
'default' => [0, 0],
'required' => false
]);
@ -6769,7 +6769,7 @@ trait DatabasesBase
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [
'queries' => [Query::contains('lineAttr', [[1.0, 1.0]])->toString()]
'queries' => [Query::contains('lineAttr', [[1.1, 1.1]])->toString()]
]);
$this->assertEquals(200, $response['headers']['status-code']);
$this->assertCount(1, $response['body']['documents']);
@ -7635,19 +7635,6 @@ trait DatabasesBase
]);
$this->assertEquals(202, $retriedIndex['headers']['status-code']);
// Passing orders to spatial index should not throw error(in case of mariadb)
$ordersIndex = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/indexes', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-key' => $this->getProject()['apiKey']
]), [
'key' => 'idx_required_point_with_orders',
'type' => Database::INDEX_SPATIAL,
'attributes' => ['pRequired'],
'orders' => ['ASC']
]);
$this->assertEquals(202, $ordersIndex['headers']['status-code']);
// Cleanup
$this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([
'content-type' => 'application/json',

View file

@ -8230,7 +8230,7 @@ trait DatabasesBase
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [
'queries' => [Query::contains('lineAttr', [[1.0, 1.0]])->toString()]
'queries' => [Query::contains('lineAttr', [[1.1, 1.1]])->toString()]
]);
$this->assertEquals(200, $response['headers']['status-code']);
$this->assertCount(1, $response['body']['rows']);
@ -8562,19 +8562,6 @@ trait DatabasesBase
]);
$this->assertEquals(202, $retriedIndex['headers']['status-code']);
// Passing orders to spatial index should not throw error (in case of mariadb)
$ordersIndex = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/indexes', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-key' => $this->getProject()['apiKey']
]), [
'key' => 'idx_required_point_with_orders',
'type' => Database::INDEX_SPATIAL,
'columns' => ['pRequired'],
'orders' => ['ASC']
]);
$this->assertEquals(202, $ordersIndex['headers']['status-code']);
// Cleanup
$this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([
'content-type' => 'application/json',
@ -8683,7 +8670,7 @@ trait DatabasesBase
'x-appwrite-key' => $this->getProject()['apiKey']
]), [
'required' => false,
'default' => json_encode([[0, 0], [1, 1]]),
'default' => [[0, 0], [1, 1]],
]);
$this->assertEquals(200, $response['headers']['status-code']);
@ -8710,7 +8697,7 @@ trait DatabasesBase
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-key' => $this->getProject()['apiKey']
]), [
'default' => json_encode([0, 0]),
'default' => [0, 0],
'required' => false
]);
$this->assertEquals(200, $response['headers']['status-code']);