mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
754fce6eb6 | ||
|
|
bb0f40569f | ||
|
|
f666a1e3a1 | ||
|
|
85382fe5a9 |
@@ -78,7 +78,7 @@ _APP_FUNCTIONS_MAINTENANCE_INTERVAL=600
|
||||
_APP_FUNCTIONS_RUNTIMES_NETWORK=runtimes
|
||||
_APP_EXECUTOR_SECRET=your-secret-key
|
||||
_APP_EXECUTOR_HOST=http://proxy/v1
|
||||
_APP_FUNCTIONS_RUNTIMES=php-8.0,node-18.0,python-3.9,ruby-3.1
|
||||
_APP_FUNCTIONS_RUNTIMES=php-8.3,php-8.0,node-18.0,python-3.9,ruby-3.1
|
||||
_APP_MAINTENANCE_INTERVAL=86400
|
||||
_APP_MAINTENANCE_DELAY=
|
||||
_APP_MAINTENANCE_RETENTION_CACHE=2592000
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Same as ./runtimes.php, but without deprecated runtimes
|
||||
*/
|
||||
|
||||
use Appwrite\Runtimes\Runtimes;
|
||||
|
||||
return (new Runtimes('v4'))->getAll(deprecated: false);
|
||||
@@ -9429,57 +9429,42 @@
|
||||
"runtime": {
|
||||
"type": "string",
|
||||
"description": "Execution runtime.",
|
||||
"x-example": "node-14.5",
|
||||
"x-example": "node-18.0",
|
||||
"enum": [
|
||||
"node-14.5",
|
||||
"node-16.0",
|
||||
"node-18.0",
|
||||
"node-19.0",
|
||||
"node-20.0",
|
||||
"node-21.0",
|
||||
"node-22",
|
||||
"php-8.0",
|
||||
"php-8.1",
|
||||
"php-8.2",
|
||||
"php-8.3",
|
||||
"ruby-3.0",
|
||||
"ruby-3.1",
|
||||
"ruby-3.2",
|
||||
"ruby-3.3",
|
||||
"python-3.8",
|
||||
"python-3.9",
|
||||
"python-3.10",
|
||||
"python-3.11",
|
||||
"python-3.12",
|
||||
"python-ml-3.11",
|
||||
"deno-1.21",
|
||||
"deno-1.24",
|
||||
"deno-1.35",
|
||||
"deno-1.40",
|
||||
"deno-1.46",
|
||||
"deno-2.0",
|
||||
"dart-2.15",
|
||||
"dart-2.16",
|
||||
"dart-2.17",
|
||||
"dart-2.18",
|
||||
"dart-2.19",
|
||||
"dart-3.0",
|
||||
"dart-3.1",
|
||||
"dart-3.3",
|
||||
"dart-3.5",
|
||||
"dotnet-6.0",
|
||||
"dotnet-7.0",
|
||||
"dotnet-8.0",
|
||||
"java-8.0",
|
||||
"java-11.0",
|
||||
"java-17.0",
|
||||
"java-18.0",
|
||||
"java-21.0",
|
||||
"java-22",
|
||||
"swift-5.5",
|
||||
"swift-5.8",
|
||||
"swift-5.9",
|
||||
"swift-5.10",
|
||||
"kotlin-1.6",
|
||||
"kotlin-1.8",
|
||||
"kotlin-1.9",
|
||||
"kotlin-2.0",
|
||||
@@ -9489,7 +9474,8 @@
|
||||
"bun-1.1",
|
||||
"go-1.23",
|
||||
"static-1",
|
||||
"flutter-3.24"
|
||||
"flutter-3.24",
|
||||
"ssr-22"
|
||||
],
|
||||
"x-enum-name": null,
|
||||
"x-enum-keys": []
|
||||
@@ -10087,57 +10073,42 @@
|
||||
"runtime": {
|
||||
"type": "string",
|
||||
"description": "Execution runtime.",
|
||||
"x-example": "node-14.5",
|
||||
"x-example": "node-18.0",
|
||||
"enum": [
|
||||
"node-14.5",
|
||||
"node-16.0",
|
||||
"node-18.0",
|
||||
"node-19.0",
|
||||
"node-20.0",
|
||||
"node-21.0",
|
||||
"node-22",
|
||||
"php-8.0",
|
||||
"php-8.1",
|
||||
"php-8.2",
|
||||
"php-8.3",
|
||||
"ruby-3.0",
|
||||
"ruby-3.1",
|
||||
"ruby-3.2",
|
||||
"ruby-3.3",
|
||||
"python-3.8",
|
||||
"python-3.9",
|
||||
"python-3.10",
|
||||
"python-3.11",
|
||||
"python-3.12",
|
||||
"python-ml-3.11",
|
||||
"deno-1.21",
|
||||
"deno-1.24",
|
||||
"deno-1.35",
|
||||
"deno-1.40",
|
||||
"deno-1.46",
|
||||
"deno-2.0",
|
||||
"dart-2.15",
|
||||
"dart-2.16",
|
||||
"dart-2.17",
|
||||
"dart-2.18",
|
||||
"dart-2.19",
|
||||
"dart-3.0",
|
||||
"dart-3.1",
|
||||
"dart-3.3",
|
||||
"dart-3.5",
|
||||
"dotnet-6.0",
|
||||
"dotnet-7.0",
|
||||
"dotnet-8.0",
|
||||
"java-8.0",
|
||||
"java-11.0",
|
||||
"java-17.0",
|
||||
"java-18.0",
|
||||
"java-21.0",
|
||||
"java-22",
|
||||
"swift-5.5",
|
||||
"swift-5.8",
|
||||
"swift-5.9",
|
||||
"swift-5.10",
|
||||
"kotlin-1.6",
|
||||
"kotlin-1.8",
|
||||
"kotlin-1.9",
|
||||
"kotlin-2.0",
|
||||
@@ -10147,7 +10118,8 @@
|
||||
"bun-1.1",
|
||||
"go-1.23",
|
||||
"static-1",
|
||||
"flutter-3.24"
|
||||
"flutter-3.24",
|
||||
"ssr-22"
|
||||
],
|
||||
"x-enum-name": null,
|
||||
"x-enum-keys": []
|
||||
@@ -35324,6 +35296,11 @@
|
||||
"type": "string"
|
||||
},
|
||||
"x-example": "amd64"
|
||||
},
|
||||
"deprecated": {
|
||||
"type": "boolean",
|
||||
"description": "Deprecated runtimes cannot be used during creation.",
|
||||
"x-example": false
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -35334,7 +35311,8 @@
|
||||
"base",
|
||||
"image",
|
||||
"logo",
|
||||
"supports"
|
||||
"supports",
|
||||
"deprecated"
|
||||
]
|
||||
},
|
||||
"deployment": {
|
||||
|
||||
@@ -8537,57 +8537,42 @@
|
||||
"runtime": {
|
||||
"type": "string",
|
||||
"description": "Execution runtime.",
|
||||
"x-example": "node-14.5",
|
||||
"x-example": "node-18.0",
|
||||
"enum": [
|
||||
"node-14.5",
|
||||
"node-16.0",
|
||||
"node-18.0",
|
||||
"node-19.0",
|
||||
"node-20.0",
|
||||
"node-21.0",
|
||||
"node-22",
|
||||
"php-8.0",
|
||||
"php-8.1",
|
||||
"php-8.2",
|
||||
"php-8.3",
|
||||
"ruby-3.0",
|
||||
"ruby-3.1",
|
||||
"ruby-3.2",
|
||||
"ruby-3.3",
|
||||
"python-3.8",
|
||||
"python-3.9",
|
||||
"python-3.10",
|
||||
"python-3.11",
|
||||
"python-3.12",
|
||||
"python-ml-3.11",
|
||||
"deno-1.21",
|
||||
"deno-1.24",
|
||||
"deno-1.35",
|
||||
"deno-1.40",
|
||||
"deno-1.46",
|
||||
"deno-2.0",
|
||||
"dart-2.15",
|
||||
"dart-2.16",
|
||||
"dart-2.17",
|
||||
"dart-2.18",
|
||||
"dart-2.19",
|
||||
"dart-3.0",
|
||||
"dart-3.1",
|
||||
"dart-3.3",
|
||||
"dart-3.5",
|
||||
"dotnet-6.0",
|
||||
"dotnet-7.0",
|
||||
"dotnet-8.0",
|
||||
"java-8.0",
|
||||
"java-11.0",
|
||||
"java-17.0",
|
||||
"java-18.0",
|
||||
"java-21.0",
|
||||
"java-22",
|
||||
"swift-5.5",
|
||||
"swift-5.8",
|
||||
"swift-5.9",
|
||||
"swift-5.10",
|
||||
"kotlin-1.6",
|
||||
"kotlin-1.8",
|
||||
"kotlin-1.9",
|
||||
"kotlin-2.0",
|
||||
@@ -8597,7 +8582,8 @@
|
||||
"bun-1.1",
|
||||
"go-1.23",
|
||||
"static-1",
|
||||
"flutter-3.24"
|
||||
"flutter-3.24",
|
||||
"ssr-22"
|
||||
],
|
||||
"x-enum-name": null,
|
||||
"x-enum-keys": []
|
||||
@@ -8961,57 +8947,42 @@
|
||||
"runtime": {
|
||||
"type": "string",
|
||||
"description": "Execution runtime.",
|
||||
"x-example": "node-14.5",
|
||||
"x-example": "node-18.0",
|
||||
"enum": [
|
||||
"node-14.5",
|
||||
"node-16.0",
|
||||
"node-18.0",
|
||||
"node-19.0",
|
||||
"node-20.0",
|
||||
"node-21.0",
|
||||
"node-22",
|
||||
"php-8.0",
|
||||
"php-8.1",
|
||||
"php-8.2",
|
||||
"php-8.3",
|
||||
"ruby-3.0",
|
||||
"ruby-3.1",
|
||||
"ruby-3.2",
|
||||
"ruby-3.3",
|
||||
"python-3.8",
|
||||
"python-3.9",
|
||||
"python-3.10",
|
||||
"python-3.11",
|
||||
"python-3.12",
|
||||
"python-ml-3.11",
|
||||
"deno-1.21",
|
||||
"deno-1.24",
|
||||
"deno-1.35",
|
||||
"deno-1.40",
|
||||
"deno-1.46",
|
||||
"deno-2.0",
|
||||
"dart-2.15",
|
||||
"dart-2.16",
|
||||
"dart-2.17",
|
||||
"dart-2.18",
|
||||
"dart-2.19",
|
||||
"dart-3.0",
|
||||
"dart-3.1",
|
||||
"dart-3.3",
|
||||
"dart-3.5",
|
||||
"dotnet-6.0",
|
||||
"dotnet-7.0",
|
||||
"dotnet-8.0",
|
||||
"java-8.0",
|
||||
"java-11.0",
|
||||
"java-17.0",
|
||||
"java-18.0",
|
||||
"java-21.0",
|
||||
"java-22",
|
||||
"swift-5.5",
|
||||
"swift-5.8",
|
||||
"swift-5.9",
|
||||
"swift-5.10",
|
||||
"kotlin-1.6",
|
||||
"kotlin-1.8",
|
||||
"kotlin-1.9",
|
||||
"kotlin-2.0",
|
||||
@@ -9021,7 +8992,8 @@
|
||||
"bun-1.1",
|
||||
"go-1.23",
|
||||
"static-1",
|
||||
"flutter-3.24"
|
||||
"flutter-3.24",
|
||||
"ssr-22"
|
||||
],
|
||||
"x-enum-name": null,
|
||||
"x-enum-keys": []
|
||||
@@ -25876,6 +25848,11 @@
|
||||
"type": "string"
|
||||
},
|
||||
"x-example": "amd64"
|
||||
},
|
||||
"deprecated": {
|
||||
"type": "boolean",
|
||||
"description": "Deprecated runtimes cannot be used during creation.",
|
||||
"x-example": false
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -25886,7 +25863,8 @@
|
||||
"base",
|
||||
"image",
|
||||
"logo",
|
||||
"supports"
|
||||
"supports",
|
||||
"deprecated"
|
||||
]
|
||||
},
|
||||
"deployment": {
|
||||
|
||||
@@ -9551,57 +9551,42 @@
|
||||
"type": "string",
|
||||
"description": "Execution runtime.",
|
||||
"default": null,
|
||||
"x-example": "node-14.5",
|
||||
"x-example": "node-18.0",
|
||||
"enum": [
|
||||
"node-14.5",
|
||||
"node-16.0",
|
||||
"node-18.0",
|
||||
"node-19.0",
|
||||
"node-20.0",
|
||||
"node-21.0",
|
||||
"node-22",
|
||||
"php-8.0",
|
||||
"php-8.1",
|
||||
"php-8.2",
|
||||
"php-8.3",
|
||||
"ruby-3.0",
|
||||
"ruby-3.1",
|
||||
"ruby-3.2",
|
||||
"ruby-3.3",
|
||||
"python-3.8",
|
||||
"python-3.9",
|
||||
"python-3.10",
|
||||
"python-3.11",
|
||||
"python-3.12",
|
||||
"python-ml-3.11",
|
||||
"deno-1.21",
|
||||
"deno-1.24",
|
||||
"deno-1.35",
|
||||
"deno-1.40",
|
||||
"deno-1.46",
|
||||
"deno-2.0",
|
||||
"dart-2.15",
|
||||
"dart-2.16",
|
||||
"dart-2.17",
|
||||
"dart-2.18",
|
||||
"dart-2.19",
|
||||
"dart-3.0",
|
||||
"dart-3.1",
|
||||
"dart-3.3",
|
||||
"dart-3.5",
|
||||
"dotnet-6.0",
|
||||
"dotnet-7.0",
|
||||
"dotnet-8.0",
|
||||
"java-8.0",
|
||||
"java-11.0",
|
||||
"java-17.0",
|
||||
"java-18.0",
|
||||
"java-21.0",
|
||||
"java-22",
|
||||
"swift-5.5",
|
||||
"swift-5.8",
|
||||
"swift-5.9",
|
||||
"swift-5.10",
|
||||
"kotlin-1.6",
|
||||
"kotlin-1.8",
|
||||
"kotlin-1.9",
|
||||
"kotlin-2.0",
|
||||
@@ -9611,7 +9596,8 @@
|
||||
"bun-1.1",
|
||||
"go-1.23",
|
||||
"static-1",
|
||||
"flutter-3.24"
|
||||
"flutter-3.24",
|
||||
"ssr-22"
|
||||
],
|
||||
"x-enum-name": null,
|
||||
"x-enum-keys": []
|
||||
@@ -10228,57 +10214,42 @@
|
||||
"type": "string",
|
||||
"description": "Execution runtime.",
|
||||
"default": "",
|
||||
"x-example": "node-14.5",
|
||||
"x-example": "node-18.0",
|
||||
"enum": [
|
||||
"node-14.5",
|
||||
"node-16.0",
|
||||
"node-18.0",
|
||||
"node-19.0",
|
||||
"node-20.0",
|
||||
"node-21.0",
|
||||
"node-22",
|
||||
"php-8.0",
|
||||
"php-8.1",
|
||||
"php-8.2",
|
||||
"php-8.3",
|
||||
"ruby-3.0",
|
||||
"ruby-3.1",
|
||||
"ruby-3.2",
|
||||
"ruby-3.3",
|
||||
"python-3.8",
|
||||
"python-3.9",
|
||||
"python-3.10",
|
||||
"python-3.11",
|
||||
"python-3.12",
|
||||
"python-ml-3.11",
|
||||
"deno-1.21",
|
||||
"deno-1.24",
|
||||
"deno-1.35",
|
||||
"deno-1.40",
|
||||
"deno-1.46",
|
||||
"deno-2.0",
|
||||
"dart-2.15",
|
||||
"dart-2.16",
|
||||
"dart-2.17",
|
||||
"dart-2.18",
|
||||
"dart-2.19",
|
||||
"dart-3.0",
|
||||
"dart-3.1",
|
||||
"dart-3.3",
|
||||
"dart-3.5",
|
||||
"dotnet-6.0",
|
||||
"dotnet-7.0",
|
||||
"dotnet-8.0",
|
||||
"java-8.0",
|
||||
"java-11.0",
|
||||
"java-17.0",
|
||||
"java-18.0",
|
||||
"java-21.0",
|
||||
"java-22",
|
||||
"swift-5.5",
|
||||
"swift-5.8",
|
||||
"swift-5.9",
|
||||
"swift-5.10",
|
||||
"kotlin-1.6",
|
||||
"kotlin-1.8",
|
||||
"kotlin-1.9",
|
||||
"kotlin-2.0",
|
||||
@@ -10288,7 +10259,8 @@
|
||||
"bun-1.1",
|
||||
"go-1.23",
|
||||
"static-1",
|
||||
"flutter-3.24"
|
||||
"flutter-3.24",
|
||||
"ssr-22"
|
||||
],
|
||||
"x-enum-name": null,
|
||||
"x-enum-keys": []
|
||||
@@ -35820,6 +35792,11 @@
|
||||
"type": "string"
|
||||
},
|
||||
"x-example": "amd64"
|
||||
},
|
||||
"deprecated": {
|
||||
"type": "boolean",
|
||||
"description": "Deprecated runtimes cannot be used during creation.",
|
||||
"x-example": false
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -35830,7 +35807,8 @@
|
||||
"base",
|
||||
"image",
|
||||
"logo",
|
||||
"supports"
|
||||
"supports",
|
||||
"deprecated"
|
||||
]
|
||||
},
|
||||
"deployment": {
|
||||
|
||||
@@ -8661,57 +8661,42 @@
|
||||
"type": "string",
|
||||
"description": "Execution runtime.",
|
||||
"default": null,
|
||||
"x-example": "node-14.5",
|
||||
"x-example": "node-18.0",
|
||||
"enum": [
|
||||
"node-14.5",
|
||||
"node-16.0",
|
||||
"node-18.0",
|
||||
"node-19.0",
|
||||
"node-20.0",
|
||||
"node-21.0",
|
||||
"node-22",
|
||||
"php-8.0",
|
||||
"php-8.1",
|
||||
"php-8.2",
|
||||
"php-8.3",
|
||||
"ruby-3.0",
|
||||
"ruby-3.1",
|
||||
"ruby-3.2",
|
||||
"ruby-3.3",
|
||||
"python-3.8",
|
||||
"python-3.9",
|
||||
"python-3.10",
|
||||
"python-3.11",
|
||||
"python-3.12",
|
||||
"python-ml-3.11",
|
||||
"deno-1.21",
|
||||
"deno-1.24",
|
||||
"deno-1.35",
|
||||
"deno-1.40",
|
||||
"deno-1.46",
|
||||
"deno-2.0",
|
||||
"dart-2.15",
|
||||
"dart-2.16",
|
||||
"dart-2.17",
|
||||
"dart-2.18",
|
||||
"dart-2.19",
|
||||
"dart-3.0",
|
||||
"dart-3.1",
|
||||
"dart-3.3",
|
||||
"dart-3.5",
|
||||
"dotnet-6.0",
|
||||
"dotnet-7.0",
|
||||
"dotnet-8.0",
|
||||
"java-8.0",
|
||||
"java-11.0",
|
||||
"java-17.0",
|
||||
"java-18.0",
|
||||
"java-21.0",
|
||||
"java-22",
|
||||
"swift-5.5",
|
||||
"swift-5.8",
|
||||
"swift-5.9",
|
||||
"swift-5.10",
|
||||
"kotlin-1.6",
|
||||
"kotlin-1.8",
|
||||
"kotlin-1.9",
|
||||
"kotlin-2.0",
|
||||
@@ -8721,7 +8706,8 @@
|
||||
"bun-1.1",
|
||||
"go-1.23",
|
||||
"static-1",
|
||||
"flutter-3.24"
|
||||
"flutter-3.24",
|
||||
"ssr-22"
|
||||
],
|
||||
"x-enum-name": null,
|
||||
"x-enum-keys": []
|
||||
@@ -9108,57 +9094,42 @@
|
||||
"type": "string",
|
||||
"description": "Execution runtime.",
|
||||
"default": "",
|
||||
"x-example": "node-14.5",
|
||||
"x-example": "node-18.0",
|
||||
"enum": [
|
||||
"node-14.5",
|
||||
"node-16.0",
|
||||
"node-18.0",
|
||||
"node-19.0",
|
||||
"node-20.0",
|
||||
"node-21.0",
|
||||
"node-22",
|
||||
"php-8.0",
|
||||
"php-8.1",
|
||||
"php-8.2",
|
||||
"php-8.3",
|
||||
"ruby-3.0",
|
||||
"ruby-3.1",
|
||||
"ruby-3.2",
|
||||
"ruby-3.3",
|
||||
"python-3.8",
|
||||
"python-3.9",
|
||||
"python-3.10",
|
||||
"python-3.11",
|
||||
"python-3.12",
|
||||
"python-ml-3.11",
|
||||
"deno-1.21",
|
||||
"deno-1.24",
|
||||
"deno-1.35",
|
||||
"deno-1.40",
|
||||
"deno-1.46",
|
||||
"deno-2.0",
|
||||
"dart-2.15",
|
||||
"dart-2.16",
|
||||
"dart-2.17",
|
||||
"dart-2.18",
|
||||
"dart-2.19",
|
||||
"dart-3.0",
|
||||
"dart-3.1",
|
||||
"dart-3.3",
|
||||
"dart-3.5",
|
||||
"dotnet-6.0",
|
||||
"dotnet-7.0",
|
||||
"dotnet-8.0",
|
||||
"java-8.0",
|
||||
"java-11.0",
|
||||
"java-17.0",
|
||||
"java-18.0",
|
||||
"java-21.0",
|
||||
"java-22",
|
||||
"swift-5.5",
|
||||
"swift-5.8",
|
||||
"swift-5.9",
|
||||
"swift-5.10",
|
||||
"kotlin-1.6",
|
||||
"kotlin-1.8",
|
||||
"kotlin-1.9",
|
||||
"kotlin-2.0",
|
||||
@@ -9168,7 +9139,8 @@
|
||||
"bun-1.1",
|
||||
"go-1.23",
|
||||
"static-1",
|
||||
"flutter-3.24"
|
||||
"flutter-3.24",
|
||||
"ssr-22"
|
||||
],
|
||||
"x-enum-name": null,
|
||||
"x-enum-keys": []
|
||||
@@ -26363,6 +26335,11 @@
|
||||
"type": "string"
|
||||
},
|
||||
"x-example": "amd64"
|
||||
},
|
||||
"deprecated": {
|
||||
"type": "boolean",
|
||||
"description": "Deprecated runtimes cannot be used during creation.",
|
||||
"x-example": false
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -26373,7 +26350,8 @@
|
||||
"base",
|
||||
"image",
|
||||
"logo",
|
||||
"supports"
|
||||
"supports",
|
||||
"deprecated"
|
||||
]
|
||||
},
|
||||
"deployment": {
|
||||
|
||||
@@ -151,7 +151,7 @@ App::post('/v1/functions')
|
||||
->label('sdk.response.model', Response::MODEL_FUNCTION)
|
||||
->param('functionId', '', new CustomId(), 'Function 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.')
|
||||
->param('name', '', new Text(128), 'Function name. Max length: 128 chars.')
|
||||
->param('runtime', '', new WhiteList(array_keys(Config::getParam('runtimes')), true), 'Execution runtime.')
|
||||
->param('runtime', '', new WhiteList(array_keys(Config::getParam('runtimes-active')), true), 'Execution runtime.')
|
||||
->param('execute', [], new Roles(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' roles are allowed, each 64 characters long.', true)
|
||||
->param('events', [], new ArrayList(new FunctionEvent(), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Events list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' events are allowed.', true)
|
||||
->param('schedule', '', new Cron(), 'Schedule CRON syntax.', true)
|
||||
@@ -808,7 +808,7 @@ App::put('/v1/functions/:functionId')
|
||||
->label('sdk.response.model', Response::MODEL_FUNCTION)
|
||||
->param('functionId', '', new UID(), 'Function ID.')
|
||||
->param('name', '', new Text(128), 'Function name. Max length: 128 chars.')
|
||||
->param('runtime', '', new WhiteList(array_keys(Config::getParam('runtimes')), true), 'Execution runtime.', true)
|
||||
->param('runtime', '', new WhiteList(array_keys(Config::getParam('runtimes-active')), true), 'Execution runtime.', true)
|
||||
->param('execute', [], new Roles(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' roles are allowed, each 64 characters long.', true)
|
||||
->param('events', [], new ArrayList(new FunctionEvent(), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Events list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' events are allowed.', true)
|
||||
->param('schedule', '', new Cron(), 'Schedule CRON syntax.', true)
|
||||
@@ -2631,7 +2631,7 @@ App::get('/v1/functions/templates')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_TEMPLATE_FUNCTION_LIST)
|
||||
->param('runtimes', [], new ArrayList(new WhiteList(array_keys(Config::getParam('runtimes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'List of runtimes allowed for filtering function templates. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' runtimes are allowed.', true)
|
||||
->param('runtimes', [], new ArrayList(new WhiteList(array_keys(Config::getParam('runtimes-active')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'List of runtimes allowed for filtering function templates. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' runtimes are allowed.', true)
|
||||
->param('useCases', [], new ArrayList(new WhiteList(['dev-tools','starter','databases','ai','messaging','utilities']), APP_LIMIT_ARRAY_PARAMS_SIZE), 'List of use cases allowed for filtering function templates. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' use cases are allowed.', true)
|
||||
->param('limit', 25, new Range(1, 5000), 'Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.', true)
|
||||
->param('offset', 0, new Range(0, 5000), 'Offset the list of returned templates. Maximum offset is 5000.', true)
|
||||
|
||||
@@ -150,7 +150,11 @@ App::patch('/v1/mock/functions-v2')
|
||||
throw new Exception(Exception::FUNCTION_NOT_FOUND);
|
||||
}
|
||||
|
||||
$dbForProject->updateDocument('functions', $function->getId(), $function->setAttribute('version', 'v2'));
|
||||
$function = $function
|
||||
->setAttribute('version', 'v2')
|
||||
->setAttribute('runtime', 'php-8.0');
|
||||
|
||||
$dbForProject->updateDocument('functions', $function->getId(), $function);
|
||||
|
||||
$response->noContent();
|
||||
});
|
||||
|
||||
@@ -334,6 +334,7 @@ Config::load('oAuthProviders', __DIR__ . '/config/oAuthProviders.php');
|
||||
Config::load('platforms', __DIR__ . '/config/platforms.php');
|
||||
Config::load('collections', __DIR__ . '/config/collections.php');
|
||||
Config::load('runtimes', __DIR__ . '/config/runtimes.php');
|
||||
Config::load('runtimes-active', __DIR__ . '/config/runtimes-active.php');
|
||||
Config::load('runtimes-v2', __DIR__ . '/config/runtimes-v2.php');
|
||||
Config::load('usage', __DIR__ . '/config/usage.php');
|
||||
Config::load('roles', __DIR__ . '/config/roles.php'); // User roles and scopes
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@
|
||||
"ext-openssl": "*",
|
||||
"ext-zlib": "*",
|
||||
"ext-sockets": "*",
|
||||
"appwrite/php-runtimes": "0.16.*",
|
||||
"appwrite/php-runtimes": "dev-feat-deprecated-runtimes as 0.16.99",
|
||||
"appwrite/php-clamav": "2.0.*",
|
||||
"utopia-php/abuse": "0.46.*",
|
||||
"utopia-php/analytics": "0.10.*",
|
||||
|
||||
Generated
+39
-30
@@ -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": "7b5b5926b452186543903eb539f59c2d",
|
||||
"content-hash": "dd79c2b955102247a6bd75e34969425b",
|
||||
"packages": [
|
||||
{
|
||||
"name": "adhocore/jwt",
|
||||
@@ -157,16 +157,16 @@
|
||||
},
|
||||
{
|
||||
"name": "appwrite/php-runtimes",
|
||||
"version": "0.16.5",
|
||||
"version": "dev-feat-deprecated-runtimes",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/appwrite/runtimes.git",
|
||||
"reference": "1e430646fdf847a7caf3c611dcf3d6d5a28c3fd9"
|
||||
"reference": "3248bf647f53c0ed3dc3a92679f4877de7b29fc6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/appwrite/runtimes/zipball/1e430646fdf847a7caf3c611dcf3d6d5a28c3fd9",
|
||||
"reference": "1e430646fdf847a7caf3c611dcf3d6d5a28c3fd9",
|
||||
"url": "https://api.github.com/repos/appwrite/runtimes/zipball/3248bf647f53c0ed3dc3a92679f4877de7b29fc6",
|
||||
"reference": "3248bf647f53c0ed3dc3a92679f4877de7b29fc6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -206,9 +206,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/appwrite/runtimes/issues",
|
||||
"source": "https://github.com/appwrite/runtimes/tree/0.16.5"
|
||||
"source": "https://github.com/appwrite/runtimes/tree/feat-deprecated-runtimes"
|
||||
},
|
||||
"time": "2024-11-25T15:17:06+00:00"
|
||||
"time": "2025-01-09T11:36:01+00:00"
|
||||
},
|
||||
{
|
||||
"name": "beberlei/assert",
|
||||
@@ -709,16 +709,16 @@
|
||||
},
|
||||
{
|
||||
"name": "google/protobuf",
|
||||
"version": "v4.29.2",
|
||||
"version": "v4.29.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/protocolbuffers/protobuf-php.git",
|
||||
"reference": "79aa5014efeeec3d137df5cdb0ae2fc163953945"
|
||||
"reference": "ab5077c2cfdd1f415f42d11fdbdf903ba8e3d9b7"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/79aa5014efeeec3d137df5cdb0ae2fc163953945",
|
||||
"reference": "79aa5014efeeec3d137df5cdb0ae2fc163953945",
|
||||
"url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/ab5077c2cfdd1f415f42d11fdbdf903ba8e3d9b7",
|
||||
"reference": "ab5077c2cfdd1f415f42d11fdbdf903ba8e3d9b7",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -747,9 +747,9 @@
|
||||
"proto"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.29.2"
|
||||
"source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.29.3"
|
||||
},
|
||||
"time": "2024-12-18T14:11:12+00:00"
|
||||
"time": "2025-01-08T21:00:13+00:00"
|
||||
},
|
||||
{
|
||||
"name": "jean85/pretty-package-versions",
|
||||
@@ -1237,16 +1237,16 @@
|
||||
},
|
||||
{
|
||||
"name": "open-telemetry/api",
|
||||
"version": "1.1.2",
|
||||
"version": "1.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/opentelemetry-php/api.git",
|
||||
"reference": "04c85a1e41a3d59fa9bdc801a5de1df6624b95ed"
|
||||
"reference": "351a30baa79699de3de3a814c8ccc7b52ccdfb1d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/opentelemetry-php/api/zipball/04c85a1e41a3d59fa9bdc801a5de1df6624b95ed",
|
||||
"reference": "04c85a1e41a3d59fa9bdc801a5de1df6624b95ed",
|
||||
"url": "https://api.github.com/repos/opentelemetry-php/api/zipball/351a30baa79699de3de3a814c8ccc7b52ccdfb1d",
|
||||
"reference": "351a30baa79699de3de3a814c8ccc7b52ccdfb1d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1303,7 +1303,7 @@
|
||||
"issues": "https://github.com/open-telemetry/opentelemetry-php/issues",
|
||||
"source": "https://github.com/open-telemetry/opentelemetry-php"
|
||||
},
|
||||
"time": "2024-11-16T04:32:30+00:00"
|
||||
"time": "2025-01-08T23:50:34+00:00"
|
||||
},
|
||||
{
|
||||
"name": "open-telemetry/context",
|
||||
@@ -1366,16 +1366,16 @@
|
||||
},
|
||||
{
|
||||
"name": "open-telemetry/exporter-otlp",
|
||||
"version": "1.1.0",
|
||||
"version": "1.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/opentelemetry-php/exporter-otlp.git",
|
||||
"reference": "9b6de12204f25f8ab9540b46d6e7b5151897ce18"
|
||||
"reference": "243d9657c44a06f740cf384f486afe954c2b725f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/opentelemetry-php/exporter-otlp/zipball/9b6de12204f25f8ab9540b46d6e7b5151897ce18",
|
||||
"reference": "9b6de12204f25f8ab9540b46d6e7b5151897ce18",
|
||||
"url": "https://api.github.com/repos/opentelemetry-php/exporter-otlp/zipball/243d9657c44a06f740cf384f486afe954c2b725f",
|
||||
"reference": "243d9657c44a06f740cf384f486afe954c2b725f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1426,7 +1426,7 @@
|
||||
"issues": "https://github.com/open-telemetry/opentelemetry-php/issues",
|
||||
"source": "https://github.com/open-telemetry/opentelemetry-php"
|
||||
},
|
||||
"time": "2024-04-30T18:28:30+00:00"
|
||||
"time": "2025-01-08T23:50:03+00:00"
|
||||
},
|
||||
{
|
||||
"name": "open-telemetry/gen-otlp-protobuf",
|
||||
@@ -1493,16 +1493,16 @@
|
||||
},
|
||||
{
|
||||
"name": "open-telemetry/sdk",
|
||||
"version": "1.1.2",
|
||||
"version": "1.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/opentelemetry-php/sdk.git",
|
||||
"reference": "fb0ff8d8279a3776bd604791e2531dd0cc147e8b"
|
||||
"reference": "9a1c3b866239dbff291e5cc555bb7793eab08127"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/fb0ff8d8279a3776bd604791e2531dd0cc147e8b",
|
||||
"reference": "fb0ff8d8279a3776bd604791e2531dd0cc147e8b",
|
||||
"url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/9a1c3b866239dbff291e5cc555bb7793eab08127",
|
||||
"reference": "9a1c3b866239dbff291e5cc555bb7793eab08127",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1579,7 +1579,7 @@
|
||||
"issues": "https://github.com/open-telemetry/opentelemetry-php/issues",
|
||||
"source": "https://github.com/open-telemetry/opentelemetry-php"
|
||||
},
|
||||
"time": "2024-10-18T21:01:35+00:00"
|
||||
"time": "2025-01-08T23:50:34+00:00"
|
||||
},
|
||||
{
|
||||
"name": "open-telemetry/sem-conv",
|
||||
@@ -8554,9 +8554,18 @@
|
||||
"time": "2024-03-07T20:33:40+00:00"
|
||||
}
|
||||
],
|
||||
"aliases": [],
|
||||
"aliases": [
|
||||
{
|
||||
"package": "appwrite/php-runtimes",
|
||||
"version": "dev-feat-deprecated-runtimes",
|
||||
"alias": "0.16.99",
|
||||
"alias_normalized": "0.16.99.0"
|
||||
}
|
||||
],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": {},
|
||||
"stability-flags": {
|
||||
"appwrite/php-runtimes": 20
|
||||
},
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
|
||||
@@ -59,6 +59,13 @@ class Runtime extends Model
|
||||
'example' => 'amd64',
|
||||
'array' => true,
|
||||
])
|
||||
->addRule('deprecated', [
|
||||
'type' => self::TYPE_BOOLEAN,
|
||||
'description' => 'Deprecated runtimes cannot be used during creation.',
|
||||
'default' => false,
|
||||
'example' => false,
|
||||
'array' => false,
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
@@ -862,7 +862,7 @@ class UsageTest extends Scope
|
||||
[
|
||||
'functionId' => 'unique()',
|
||||
'name' => 'Test',
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'vars' => [
|
||||
'funcKey1' => 'funcValue1',
|
||||
'funcKey2' => 'funcValue2',
|
||||
|
||||
@@ -72,6 +72,16 @@ trait FunctionsBase
|
||||
return $function;
|
||||
}
|
||||
|
||||
protected function updateFunction(string $functionId, mixed $params): mixed
|
||||
{
|
||||
$function = $this->client->call(Client::METHOD_PUT, '/functions/' . $functionId, array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), $params);
|
||||
|
||||
return $function;
|
||||
}
|
||||
|
||||
protected function createVariable(string $functionId, mixed $params): mixed
|
||||
{
|
||||
$variable = $this->client->call(Client::METHOD_POST, '/functions/' . $functionId . '/variables', array_merge([
|
||||
|
||||
@@ -21,7 +21,7 @@ class FunctionsConsoleClientTest extends Scope
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test',
|
||||
'execute' => [Role::user($this->getUser()['$id'])->toString()],
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'events' => [
|
||||
'users.*.create',
|
||||
@@ -39,7 +39,7 @@ class FunctionsConsoleClientTest extends Scope
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test Failure',
|
||||
'execute' => ['some-random-string'],
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
]);
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ class FunctionsCustomClientTest extends Scope
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test',
|
||||
'execute' => [Role::user($this->getUser()['$id'])->toString()],
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'events' => [
|
||||
'users.*.create',
|
||||
@@ -85,7 +85,7 @@ class FunctionsCustomClientTest extends Scope
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test',
|
||||
'execute' => [Role::any()->toString()],
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'timeout' => 10,
|
||||
]);
|
||||
@@ -109,7 +109,7 @@ class FunctionsCustomClientTest extends Scope
|
||||
$this->assertEquals($deploymentId, $output['APPWRITE_FUNCTION_DEPLOYMENT']);
|
||||
$this->assertEquals('http', $output['APPWRITE_FUNCTION_TRIGGER']);
|
||||
$this->assertEquals('PHP', $output['APPWRITE_FUNCTION_RUNTIME_NAME']);
|
||||
$this->assertEquals('8.0', $output['APPWRITE_FUNCTION_RUNTIME_VERSION']);
|
||||
$this->assertEquals('8.3', $output['APPWRITE_FUNCTION_RUNTIME_VERSION']);
|
||||
$this->assertEquals(APP_VERSION_STABLE, $output['APPWRITE_VERSION']);
|
||||
$this->assertEquals('default', $output['APPWRITE_REGION']);
|
||||
$this->assertEquals('', $output['APPWRITE_FUNCTION_EVENT']);
|
||||
@@ -145,7 +145,7 @@ class FunctionsCustomClientTest extends Scope
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test',
|
||||
'execute' => [Role::any()->toString()],
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'vars' => [
|
||||
'funcKey1' => 'funcValue1',
|
||||
@@ -176,7 +176,7 @@ class FunctionsCustomClientTest extends Scope
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test',
|
||||
'execute' => [],
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'timeout' => 10,
|
||||
]);
|
||||
@@ -196,7 +196,7 @@ class FunctionsCustomClientTest extends Scope
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test',
|
||||
'execute' => [Role::any()->toString()],
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'timeout' => 10,
|
||||
]);
|
||||
@@ -219,7 +219,7 @@ class FunctionsCustomClientTest extends Scope
|
||||
$this->assertEquals($deploymentId, $output['APPWRITE_FUNCTION_DEPLOYMENT']);
|
||||
$this->assertEquals('http', $output['APPWRITE_FUNCTION_TRIGGER']);
|
||||
$this->assertEquals('PHP', $output['APPWRITE_FUNCTION_RUNTIME_NAME']);
|
||||
$this->assertEquals('8.0', $output['APPWRITE_FUNCTION_RUNTIME_VERSION']);
|
||||
$this->assertEquals('8.3', $output['APPWRITE_FUNCTION_RUNTIME_VERSION']);
|
||||
$this->assertEquals(APP_VERSION_STABLE, $output['APPWRITE_VERSION']);
|
||||
$this->assertEquals('default', $output['APPWRITE_REGION']);
|
||||
$this->assertEquals('', $output['APPWRITE_FUNCTION_EVENT']);
|
||||
@@ -310,7 +310,7 @@ class FunctionsCustomClientTest extends Scope
|
||||
'content-type' => 'application/json',
|
||||
], $this->getHeaders()), [
|
||||
'useCases' => ['starter', 'ai'],
|
||||
'runtimes' => ['bun-1.0', 'dart-2.16']
|
||||
'runtimes' => ['bun-1.0', 'dart-2.18']
|
||||
]);
|
||||
$this->assertEquals(200, $templates['headers']['status-code']);
|
||||
$this->assertGreaterThanOrEqual(3, $templates['body']['total']);
|
||||
@@ -329,7 +329,7 @@ class FunctionsCustomClientTest extends Scope
|
||||
'limit' => 5,
|
||||
'offset' => 2,
|
||||
'useCases' => ['databases'],
|
||||
'runtimes' => ['node-16.0']
|
||||
'runtimes' => ['node-22']
|
||||
]);
|
||||
|
||||
$this->assertEquals(200, $templates['headers']['status-code']);
|
||||
@@ -341,7 +341,7 @@ class FunctionsCustomClientTest extends Scope
|
||||
$this->assertContains($template['useCases'][0], ['databases']);
|
||||
}
|
||||
|
||||
$this->assertContains('node-16.0', array_column($templates['body']['templates'][0]['runtimes'], 'name'));
|
||||
$this->assertContains('node-22', array_column($templates['body']['templates'][0]['runtimes'], 'name'));
|
||||
|
||||
/**
|
||||
* Test for FAILURE
|
||||
|
||||
@@ -29,7 +29,7 @@ class FunctionsCustomServerTest extends Scope
|
||||
$function = $this->createFunction([
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test',
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'events' => [
|
||||
'buckets.*.create',
|
||||
@@ -44,7 +44,7 @@ class FunctionsCustomServerTest extends Scope
|
||||
$this->assertEquals(201, $function['headers']['status-code']);
|
||||
$this->assertNotEmpty($function['body']['$id']);
|
||||
$this->assertEquals('Test', $function['body']['name']);
|
||||
$this->assertEquals('php-8.0', $function['body']['runtime']);
|
||||
$this->assertEquals('php-8.3', $function['body']['runtime']);
|
||||
$this->assertEquals(true, $dateValidator->isValid($function['body']['$createdAt']));
|
||||
$this->assertEquals(true, $dateValidator->isValid($function['body']['$updatedAt']));
|
||||
$this->assertEquals('', $function['body']['deployment']);
|
||||
@@ -145,7 +145,7 @@ class FunctionsCustomServerTest extends Scope
|
||||
|
||||
// Test search runtime
|
||||
$functions = $this->listFunctions([
|
||||
'search' => 'php-8.0'
|
||||
'search' => 'php-8.3'
|
||||
]);
|
||||
|
||||
$this->assertEquals($functions['headers']['status-code'], 200);
|
||||
@@ -158,7 +158,7 @@ class FunctionsCustomServerTest extends Scope
|
||||
$this->setupFunction([
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test 2',
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'events' => [
|
||||
'buckets.*.create',
|
||||
@@ -251,7 +251,7 @@ class FunctionsCustomServerTest extends Scope
|
||||
],
|
||||
'schedule' => '0 0 1 1 *',
|
||||
'timeout' => 15,
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
]);
|
||||
|
||||
@@ -287,7 +287,7 @@ class FunctionsCustomServerTest extends Scope
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test',
|
||||
'execute' => [Role::user($this->getUser()['$id'])->toString()],
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'events' => [
|
||||
'users.*.create',
|
||||
@@ -328,7 +328,7 @@ class FunctionsCustomServerTest extends Scope
|
||||
$this->assertEquals(200, $starterTemplate['headers']['status-code']);
|
||||
|
||||
$phpRuntime = array_values(array_filter($starterTemplate['body']['runtimes'], function ($runtime) {
|
||||
return $runtime['name'] === 'php-8.0';
|
||||
return $runtime['name'] === 'php-8.3';
|
||||
}))[0];
|
||||
|
||||
// If this fails, the template has variables, and this test needs to be updated
|
||||
@@ -338,7 +338,7 @@ class FunctionsCustomServerTest extends Scope
|
||||
[
|
||||
'functionId' => ID::unique(),
|
||||
'name' => $starterTemplate['body']['name'],
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'execute' => $starterTemplate['body']['permissions'],
|
||||
'entrypoint' => $phpRuntime['entrypoint'],
|
||||
'events' => $starterTemplate['body']['events'],
|
||||
@@ -683,7 +683,7 @@ class FunctionsCustomServerTest extends Scope
|
||||
$this->assertCount(0, $deployments['body']['deployments']);
|
||||
|
||||
$deployments = $this->listDeployments($functionId, [
|
||||
'search' => 'php-8.0'
|
||||
'search' => 'php-8.3'
|
||||
]);
|
||||
|
||||
$this->assertEquals($deployments['headers']['status-code'], 200);
|
||||
@@ -860,7 +860,7 @@ class FunctionsCustomServerTest extends Scope
|
||||
$this->assertStringContainsString('Test1', $execution['body']['responseBody']);
|
||||
$this->assertStringContainsString('http', $execution['body']['responseBody']);
|
||||
$this->assertStringContainsString('PHP', $execution['body']['responseBody']);
|
||||
$this->assertStringContainsString('8.0', $execution['body']['responseBody']);
|
||||
$this->assertStringContainsString('8.3', $execution['body']['responseBody']);
|
||||
$this->assertStringContainsString('Global Variable Value', $execution['body']['responseBody']);
|
||||
// $this->assertStringContainsString('êä', $execution['body']['responseBody']); // tests unknown utf-8 chars
|
||||
$this->assertNotEmpty($execution['body']['errors']);
|
||||
@@ -974,7 +974,7 @@ class FunctionsCustomServerTest extends Scope
|
||||
$this->assertStringContainsString('Test1', $execution['body']['responseBody']);
|
||||
$this->assertStringContainsString('http', $execution['body']['responseBody']);
|
||||
$this->assertStringContainsString('PHP', $execution['body']['responseBody']);
|
||||
$this->assertStringContainsString('8.0', $execution['body']['responseBody']);
|
||||
$this->assertStringContainsString('8.3', $execution['body']['responseBody']);
|
||||
// $this->assertStringContainsString('êä', $execution['body']['response']); // tests unknown utf-8 chars
|
||||
$this->assertLessThan(1.500, $execution['body']['duration']);
|
||||
|
||||
@@ -1076,7 +1076,7 @@ class FunctionsCustomServerTest extends Scope
|
||||
'users.*.update.email',
|
||||
],
|
||||
'timeout' => 15,
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'specification' => Specification::S_1VCPU_1GB,
|
||||
]);
|
||||
@@ -1104,7 +1104,7 @@ class FunctionsCustomServerTest extends Scope
|
||||
'users.*.update.email',
|
||||
],
|
||||
'timeout' => 15,
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'specification' => Specification::S_1VCPU_512MB,
|
||||
]);
|
||||
@@ -1134,7 +1134,7 @@ class FunctionsCustomServerTest extends Scope
|
||||
'users.*.update.email',
|
||||
],
|
||||
'timeout' => 15,
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'specification' => 's-2vcpu-512mb', // Invalid specification
|
||||
]);
|
||||
@@ -1192,8 +1192,8 @@ class FunctionsCustomServerTest extends Scope
|
||||
{
|
||||
$functionId = $this->setupFunction([
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test php-8.0',
|
||||
'runtime' => 'php-8.0',
|
||||
'name' => 'Test php-8.3',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'events' => [],
|
||||
'schedule' => '',
|
||||
@@ -1237,7 +1237,7 @@ class FunctionsCustomServerTest extends Scope
|
||||
public function provideCustomExecutions(): array
|
||||
{
|
||||
return [
|
||||
['folder' => 'php-fn', 'name' => 'php-8.0', 'entrypoint' => 'index.php', 'runtimeName' => 'PHP', 'runtimeVersion' => '8.0'],
|
||||
['folder' => 'php-fn', 'name' => 'php-8.3', 'entrypoint' => 'index.php', 'runtimeName' => 'PHP', 'runtimeVersion' => '8.3'],
|
||||
['folder' => 'node', 'name' => 'node-18.0', 'entrypoint' => 'index.js', 'runtimeName' => 'Node.js', 'runtimeVersion' => '18.0'],
|
||||
['folder' => 'python', 'name' => 'python-3.9', 'entrypoint' => 'main.py', 'runtimeName' => 'Python', 'runtimeVersion' => '3.9'],
|
||||
['folder' => 'ruby', 'name' => 'ruby-3.1', 'entrypoint' => 'main.rb', 'runtimeName' => 'Ruby', 'runtimeVersion' => '3.1'],
|
||||
@@ -1323,7 +1323,7 @@ class FunctionsCustomServerTest extends Scope
|
||||
$functionId = $this->setupFunction([
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test PHP Binary executions',
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'timeout' => 15,
|
||||
'execute' => ['any']
|
||||
@@ -1372,7 +1372,7 @@ class FunctionsCustomServerTest extends Scope
|
||||
$functionId = $this->setupFunction([
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test PHP Binary executions',
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'timeout' => 15,
|
||||
'execute' => ['any']
|
||||
@@ -1422,13 +1422,13 @@ class FunctionsCustomServerTest extends Scope
|
||||
$functionId = $this->setupFunction([
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test PHP V2',
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3', // Changed to php 8.0 in v2 update endpoint
|
||||
'entrypoint' => 'index.php',
|
||||
'events' => [],
|
||||
'timeout' => 15,
|
||||
]);
|
||||
|
||||
$variable = $this->client->call(Client::METHOD_PATCH, '/mock/functions-v2', [
|
||||
$function = $this->client->call(Client::METHOD_PATCH, '/mock/functions-v2', [
|
||||
'content-type' => 'application/json',
|
||||
'origin' => 'http://localhost',
|
||||
'cookie' => 'a_session_console=' . $this->getRoot()['session'],
|
||||
@@ -1437,7 +1437,13 @@ class FunctionsCustomServerTest extends Scope
|
||||
], [
|
||||
'functionId' => $functionId
|
||||
]);
|
||||
$this->assertEquals(204, $variable['headers']['status-code']);
|
||||
$this->assertEquals(204, $function['headers']['status-code']);
|
||||
|
||||
$function = $this->getFunction($functionId);
|
||||
|
||||
$this->assertEquals(200, $function['headers']['status-code']);
|
||||
$this->assertEquals('v2', $function['body']['version']);
|
||||
$this->assertEquals('php-8.0', $function['body']['runtime']);
|
||||
|
||||
$this->setupDeployment($functionId, [
|
||||
'entrypoint' => 'index.php',
|
||||
@@ -1488,7 +1494,7 @@ class FunctionsCustomServerTest extends Scope
|
||||
$functionId = $this->setupFunction([
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test PHP Event executions',
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'events' => [
|
||||
'users.*.create',
|
||||
@@ -1542,7 +1548,7 @@ class FunctionsCustomServerTest extends Scope
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test PHP Scopes executions',
|
||||
'commands' => 'sh setup.sh && composer install',
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'scopes' => ['users.read'],
|
||||
'timeout' => 15,
|
||||
@@ -1600,7 +1606,7 @@ class FunctionsCustomServerTest extends Scope
|
||||
$functionId = $this->setupFunction([
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test PHP Cookie executions',
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'timeout' => 15,
|
||||
]);
|
||||
@@ -1632,7 +1638,7 @@ class FunctionsCustomServerTest extends Scope
|
||||
$functionId = $this->setupFunction([
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test PHP Cookie executions',
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'timeout' => 15,
|
||||
'execute' => ['any']
|
||||
@@ -1708,7 +1714,7 @@ class FunctionsCustomServerTest extends Scope
|
||||
$functionId = $this->setupFunction([
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test PHP Binary executions',
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'timeout' => 15,
|
||||
'execute' => ['any']
|
||||
@@ -1758,7 +1764,7 @@ class FunctionsCustomServerTest extends Scope
|
||||
$functionId = $this->setupFunction([
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test PHP Binary executions',
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'timeout' => 15,
|
||||
'execute' => ['any']
|
||||
@@ -1810,7 +1816,7 @@ class FunctionsCustomServerTest extends Scope
|
||||
], $this->getHeaders()), [
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test',
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'timeout' => 15,
|
||||
]);
|
||||
@@ -1845,7 +1851,7 @@ class FunctionsCustomServerTest extends Scope
|
||||
$function1Id = $this->setupFunction([
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test',
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'timeout' => 15,
|
||||
'execute' => ['any']
|
||||
@@ -1854,7 +1860,7 @@ class FunctionsCustomServerTest extends Scope
|
||||
$function2Id = $this->setupFunction([
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test2',
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'timeout' => 15,
|
||||
'execute' => ['any']
|
||||
@@ -1984,4 +1990,37 @@ class FunctionsCustomServerTest extends Scope
|
||||
|
||||
$this->cleanupFunction($functionId);
|
||||
}
|
||||
|
||||
public function testFunctionDeprecatedRuntime(): void
|
||||
{
|
||||
$function = $this->createFunction([
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Deprecated runtime',
|
||||
'execute' => [Role::user($this->getUser()['$id'])->toString()],
|
||||
'runtime' => 'php-8.0',
|
||||
'entrypoint' => 'index.php',
|
||||
]);
|
||||
|
||||
$this->assertEquals(400, $function['headers']['status-code']);
|
||||
|
||||
$function = $this->createFunction([
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Active runtime',
|
||||
'execute' => [Role::user($this->getUser()['$id'])->toString()],
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
]);
|
||||
|
||||
$this->assertEquals(201, $function['headers']['status-code']);
|
||||
$functionId = $function['body']['$id'];
|
||||
|
||||
$function = $this->updateFunction($functionId, [
|
||||
'name' => 'Active runtime',
|
||||
'execute' => [Role::user($this->getUser()['$id'])->toString()],
|
||||
'runtime' => 'php-8.0',
|
||||
'entrypoint' => 'index.php',
|
||||
]);
|
||||
|
||||
$this->assertEquals(400, $function['headers']['status-code']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ class FunctionsScheduleTest extends Scope
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test',
|
||||
'execute' => [Role::user($this->getUser()['$id'])->toString()],
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'events' => [
|
||||
'users.*.create',
|
||||
@@ -77,7 +77,7 @@ class FunctionsScheduleTest extends Scope
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test',
|
||||
'execute' => [Role::user($this->getUser()['$id'])->toString()],
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'timeout' => 10,
|
||||
'logging' => true,
|
||||
@@ -179,7 +179,7 @@ class FunctionsScheduleTest extends Scope
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test',
|
||||
'execute' => [Role::user($this->getUser()['$id'])->toString()],
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'timeout' => 10,
|
||||
'logging' => true,
|
||||
|
||||
@@ -24,7 +24,7 @@ class FunctionsClientTest extends Scope
|
||||
'variables' => [
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test Function',
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'execute' => [Role::any()->toString()],
|
||||
]
|
||||
|
||||
@@ -25,7 +25,7 @@ class FunctionsServerTest extends Scope
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test Function',
|
||||
'entrypoint' => 'index.php',
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'execute' => [Role::any()->toString()],
|
||||
]
|
||||
];
|
||||
@@ -410,7 +410,7 @@ class FunctionsServerTest extends Scope
|
||||
'name' => 'Test Function Updated',
|
||||
'execute' => [Role::any()->toString()],
|
||||
'entrypoint' => 'index.php',
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'vars' => [
|
||||
'name' => 'John Doe',
|
||||
'age' => 42,
|
||||
|
||||
@@ -799,7 +799,7 @@ trait MigrationsBase
|
||||
$functionId = $this->setupFunction([
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test',
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php'
|
||||
]);
|
||||
|
||||
@@ -849,7 +849,7 @@ trait MigrationsBase
|
||||
|
||||
$this->assertEquals($functionId, $response['body']['$id']);
|
||||
$this->assertEquals('Test', $response['body']['name']);
|
||||
$this->assertEquals('php-8.0', $response['body']['runtime']);
|
||||
$this->assertEquals('php-8.3', $response['body']['runtime']);
|
||||
$this->assertEquals('index.php', $response['body']['entrypoint']);
|
||||
|
||||
|
||||
|
||||
@@ -524,7 +524,7 @@ class RealtimeConsoleClientTest extends Scope
|
||||
], $this->getHeaders()), [
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test',
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'events' => [
|
||||
'users.*.create',
|
||||
|
||||
@@ -1286,7 +1286,7 @@ class RealtimeCustomClientTest extends Scope
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test',
|
||||
'execute' => ['users'],
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'timeout' => 10,
|
||||
]);
|
||||
|
||||
@@ -279,7 +279,7 @@ class VCSConsoleClientTest extends Scope
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test',
|
||||
'execute' => [Role::user($this->getUser()['$id'])->toString()],
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'events' => [
|
||||
'users.*.create',
|
||||
@@ -294,7 +294,7 @@ class VCSConsoleClientTest extends Scope
|
||||
|
||||
$this->assertEquals(201, $function['headers']['status-code']);
|
||||
$this->assertEquals('Test', $function['body']['name']);
|
||||
$this->assertEquals('php-8.0', $function['body']['runtime']);
|
||||
$this->assertEquals('php-8.3', $function['body']['runtime']);
|
||||
$this->assertEquals('index.php', $function['body']['entrypoint']);
|
||||
$this->assertEquals('705764267', $function['body']['providerRepositoryId']);
|
||||
$this->assertEquals('main', $function['body']['providerBranch']);
|
||||
@@ -317,7 +317,7 @@ class VCSConsoleClientTest extends Scope
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test',
|
||||
'execute' => [Role::user($this->getUser()['$id'])->toString()],
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'events' => [
|
||||
'users.*.create',
|
||||
@@ -332,7 +332,7 @@ class VCSConsoleClientTest extends Scope
|
||||
|
||||
$this->assertEquals(200, $function['headers']['status-code']);
|
||||
$this->assertEquals('Test', $function['body']['name']);
|
||||
$this->assertEquals('php-8.0', $function['body']['runtime']);
|
||||
$this->assertEquals('php-8.3', $function['body']['runtime']);
|
||||
$this->assertEquals('index.php', $function['body']['entrypoint']);
|
||||
$this->assertEquals('708688544', $function['body']['providerRepositoryId']);
|
||||
$this->assertEquals('main', $function['body']['providerBranch']);
|
||||
|
||||
@@ -399,7 +399,7 @@ class WebhooksCustomServerTest extends Scope
|
||||
'functionId' => ID::unique(),
|
||||
'name' => 'Test',
|
||||
'execute' => [Role::any()->toString()],
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'timeout' => 10,
|
||||
]);
|
||||
@@ -439,7 +439,7 @@ class WebhooksCustomServerTest extends Scope
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), [
|
||||
'name' => 'Test',
|
||||
'runtime' => 'php-8.0',
|
||||
'runtime' => 'php-8.3',
|
||||
'entrypoint' => 'index.php',
|
||||
'execute' => [Role::any()->toString()],
|
||||
'vars' => [
|
||||
|
||||
Reference in New Issue
Block a user