From f9ac0b48c8fc92c03895a65dc2ca257ef21bb449 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 15 Sep 2025 10:28:34 +0530 Subject: [PATCH 01/17] fix: use 1.8.x --- app/config/specs/open-api3-1.8.x-client.json | 15 +- app/config/specs/open-api3-1.8.x-console.json | 188 ++++++++++++++++-- app/config/specs/open-api3-1.8.x-server.json | 163 +++++++++++++-- app/config/specs/open-api3-latest-client.json | 15 +- .../specs/open-api3-latest-console.json | 188 ++++++++++++++++-- app/config/specs/open-api3-latest-server.json | 163 +++++++++++++-- app/config/specs/swagger2-1.8.x-client.json | 15 +- app/config/specs/swagger2-1.8.x-console.json | 188 ++++++++++++++++-- app/config/specs/swagger2-1.8.x-server.json | 163 +++++++++++++-- app/config/specs/swagger2-latest-client.json | 15 +- app/config/specs/swagger2-latest-console.json | 188 ++++++++++++++++-- app/config/specs/swagger2-latest-server.json | 163 +++++++++++++-- .../SDK/Specification/Format/OpenAPI3.php | 11 + .../SDK/Specification/Format/Swagger2.php | 11 + src/Appwrite/Utopia/Response/Model.php | 1 + .../Utopia/Response/Model/Attribute.php | 3 +- .../Utopia/Response/Model/Deployment.php | 3 +- .../Utopia/Response/Model/Execution.php | 6 +- .../Utopia/Response/Model/HealthAntivirus.php | 3 +- .../Utopia/Response/Model/HealthStatus.php | 3 +- src/Appwrite/Utopia/Response/Model/Index.php | 3 +- .../Utopia/Response/Model/Platform.php | 3 +- src/Appwrite/Utopia/Response/Model/Rule.php | 6 +- 23 files changed, 1335 insertions(+), 182 deletions(-) diff --git a/app/config/specs/open-api3-1.8.x-client.json b/app/config/specs/open-api3-1.8.x-client.json index d226fcc4e1..aabc7d66fb 100644 --- a/app/config/specs/open-api3-1.8.x-client.json +++ b/app/config/specs/open-api3-1.8.x-client.json @@ -11393,12 +11393,23 @@ "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", - "x-example": "http" + "x-example": "http", + "enum": [ + "http", + "schedule", + "event" + ] }, "status": { "type": "string", "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", - "x-example": "processing" + "x-example": "processing", + "enum": [ + "waiting", + "processing", + "completed", + "failed" + ] }, "requestMethod": { "type": "string", diff --git a/app/config/specs/open-api3-1.8.x-console.json b/app/config/specs/open-api3-1.8.x-console.json index 02d97fffc7..1e3a876192 100644 --- a/app/config/specs/open-api3-1.8.x-console.json +++ b/app/config/specs/open-api3-1.8.x-console.json @@ -46461,7 +46461,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -46549,7 +46556,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -46639,7 +46653,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -46729,7 +46750,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -46802,7 +46830,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -46882,7 +46917,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -46972,7 +47014,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -47052,7 +47101,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -47132,7 +47188,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -47212,7 +47275,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -47320,7 +47390,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -47399,7 +47476,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -47490,7 +47574,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -48965,7 +49056,14 @@ "status": { "type": "string", "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -52191,7 +52289,14 @@ "status": { "type": "string", "description": "The deployment status. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", - "x-example": "ready" + "x-example": "ready", + "enum": [ + "waiting", + "processing", + "building", + "ready", + "failed" + ] }, "buildLogs": { "type": "string", @@ -52356,12 +52461,23 @@ "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", - "x-example": "http" + "x-example": "http", + "enum": [ + "http", + "schedule", + "event" + ] }, "status": { "type": "string", "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", - "x-example": "processing" + "x-example": "processing", + "enum": [ + "waiting", + "processing", + "completed", + "failed" + ] }, "requestMethod": { "type": "string", @@ -53312,7 +53428,16 @@ "type": { "type": "string", "description": "Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, ios, android, and unity.", - "x-example": "web" + "x-example": "web", + "enum": [ + "web", + "flutter-web", + "flutter-ios", + "flutter-android", + "ios", + "android", + "unity" + ] }, "key": { "type": "string", @@ -53614,7 +53739,12 @@ "status": { "type": "string", "description": "Antivirus status. Possible values can are: `disabled`, `offline`, `online`", - "x-example": "online" + "x-example": "online", + "enum": [ + "disabled", + "offline", + "online" + ] } }, "required": [ @@ -53662,7 +53792,11 @@ "status": { "type": "string", "description": "Service status. Possible values can are: `pass`, `fail`", - "x-example": "pass" + "x-example": "pass", + "enum": [ + "pass", + "fail" + ] } }, "required": [ @@ -55827,7 +55961,11 @@ "deploymentResourceType": { "type": "string", "description": "Type of deployment. Possible values are \"function\", \"site\". Used if rule's type is \"deployment\".", - "x-example": "function" + "x-example": "function", + "enum": [ + "function", + "site" + ] }, "deploymentResourceId": { "type": "string", @@ -55842,7 +55980,13 @@ "status": { "type": "string", "description": "Domain verification status. Possible values are \"created\", \"verifying\", \"verified\" and \"unverified\"", - "x-example": "verified" + "x-example": "verified", + "enum": [ + "created", + "verifying", + "verified", + "unverified" + ] }, "logs": { "type": "string", diff --git a/app/config/specs/open-api3-1.8.x-server.json b/app/config/specs/open-api3-1.8.x-server.json index 09d53dbdf0..af0ca8f886 100644 --- a/app/config/specs/open-api3-1.8.x-server.json +++ b/app/config/specs/open-api3-1.8.x-server.json @@ -35331,7 +35331,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -35419,7 +35426,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -35509,7 +35523,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -35599,7 +35620,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -35672,7 +35700,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -35752,7 +35787,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -35842,7 +35884,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -35922,7 +35971,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -36002,7 +36058,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -36082,7 +36145,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -36190,7 +36260,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -36269,7 +36346,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -36360,7 +36444,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -37835,7 +37926,14 @@ "status": { "type": "string", "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -40272,7 +40370,14 @@ "status": { "type": "string", "description": "The deployment status. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", - "x-example": "ready" + "x-example": "ready", + "enum": [ + "waiting", + "processing", + "building", + "ready", + "failed" + ] }, "buildLogs": { "type": "string", @@ -40437,12 +40542,23 @@ "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", - "x-example": "http" + "x-example": "http", + "enum": [ + "http", + "schedule", + "event" + ] }, "status": { "type": "string", "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", - "x-example": "processing" + "x-example": "processing", + "enum": [ + "waiting", + "processing", + "completed", + "failed" + ] }, "requestMethod": { "type": "string", @@ -40811,7 +40927,12 @@ "status": { "type": "string", "description": "Antivirus status. Possible values can are: `disabled`, `offline`, `online`", - "x-example": "online" + "x-example": "online", + "enum": [ + "disabled", + "offline", + "online" + ] } }, "required": [ @@ -40859,7 +40980,11 @@ "status": { "type": "string", "description": "Service status. Possible values can are: `pass`, `fail`", - "x-example": "pass" + "x-example": "pass", + "enum": [ + "pass", + "fail" + ] } }, "required": [ diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index d226fcc4e1..aabc7d66fb 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -11393,12 +11393,23 @@ "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", - "x-example": "http" + "x-example": "http", + "enum": [ + "http", + "schedule", + "event" + ] }, "status": { "type": "string", "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", - "x-example": "processing" + "x-example": "processing", + "enum": [ + "waiting", + "processing", + "completed", + "failed" + ] }, "requestMethod": { "type": "string", diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 02d97fffc7..1e3a876192 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -46461,7 +46461,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -46549,7 +46556,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -46639,7 +46653,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -46729,7 +46750,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -46802,7 +46830,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -46882,7 +46917,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -46972,7 +47014,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -47052,7 +47101,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -47132,7 +47188,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -47212,7 +47275,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -47320,7 +47390,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -47399,7 +47476,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -47490,7 +47574,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -48965,7 +49056,14 @@ "status": { "type": "string", "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -52191,7 +52289,14 @@ "status": { "type": "string", "description": "The deployment status. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", - "x-example": "ready" + "x-example": "ready", + "enum": [ + "waiting", + "processing", + "building", + "ready", + "failed" + ] }, "buildLogs": { "type": "string", @@ -52356,12 +52461,23 @@ "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", - "x-example": "http" + "x-example": "http", + "enum": [ + "http", + "schedule", + "event" + ] }, "status": { "type": "string", "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", - "x-example": "processing" + "x-example": "processing", + "enum": [ + "waiting", + "processing", + "completed", + "failed" + ] }, "requestMethod": { "type": "string", @@ -53312,7 +53428,16 @@ "type": { "type": "string", "description": "Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, ios, android, and unity.", - "x-example": "web" + "x-example": "web", + "enum": [ + "web", + "flutter-web", + "flutter-ios", + "flutter-android", + "ios", + "android", + "unity" + ] }, "key": { "type": "string", @@ -53614,7 +53739,12 @@ "status": { "type": "string", "description": "Antivirus status. Possible values can are: `disabled`, `offline`, `online`", - "x-example": "online" + "x-example": "online", + "enum": [ + "disabled", + "offline", + "online" + ] } }, "required": [ @@ -53662,7 +53792,11 @@ "status": { "type": "string", "description": "Service status. Possible values can are: `pass`, `fail`", - "x-example": "pass" + "x-example": "pass", + "enum": [ + "pass", + "fail" + ] } }, "required": [ @@ -55827,7 +55961,11 @@ "deploymentResourceType": { "type": "string", "description": "Type of deployment. Possible values are \"function\", \"site\". Used if rule's type is \"deployment\".", - "x-example": "function" + "x-example": "function", + "enum": [ + "function", + "site" + ] }, "deploymentResourceId": { "type": "string", @@ -55842,7 +55980,13 @@ "status": { "type": "string", "description": "Domain verification status. Possible values are \"created\", \"verifying\", \"verified\" and \"unverified\"", - "x-example": "verified" + "x-example": "verified", + "enum": [ + "created", + "verifying", + "verified", + "unverified" + ] }, "logs": { "type": "string", diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 09d53dbdf0..af0ca8f886 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -35331,7 +35331,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -35419,7 +35426,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -35509,7 +35523,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -35599,7 +35620,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -35672,7 +35700,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -35752,7 +35787,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -35842,7 +35884,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -35922,7 +35971,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -36002,7 +36058,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -36082,7 +36145,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -36190,7 +36260,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -36269,7 +36346,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -36360,7 +36444,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -37835,7 +37926,14 @@ "status": { "type": "string", "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -40272,7 +40370,14 @@ "status": { "type": "string", "description": "The deployment status. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", - "x-example": "ready" + "x-example": "ready", + "enum": [ + "waiting", + "processing", + "building", + "ready", + "failed" + ] }, "buildLogs": { "type": "string", @@ -40437,12 +40542,23 @@ "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", - "x-example": "http" + "x-example": "http", + "enum": [ + "http", + "schedule", + "event" + ] }, "status": { "type": "string", "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", - "x-example": "processing" + "x-example": "processing", + "enum": [ + "waiting", + "processing", + "completed", + "failed" + ] }, "requestMethod": { "type": "string", @@ -40811,7 +40927,12 @@ "status": { "type": "string", "description": "Antivirus status. Possible values can are: `disabled`, `offline`, `online`", - "x-example": "online" + "x-example": "online", + "enum": [ + "disabled", + "offline", + "online" + ] } }, "required": [ @@ -40859,7 +40980,11 @@ "status": { "type": "string", "description": "Service status. Possible values can are: `pass`, `fail`", - "x-example": "pass" + "x-example": "pass", + "enum": [ + "pass", + "fail" + ] } }, "required": [ diff --git a/app/config/specs/swagger2-1.8.x-client.json b/app/config/specs/swagger2-1.8.x-client.json index 55911e9556..61428740c1 100644 --- a/app/config/specs/swagger2-1.8.x-client.json +++ b/app/config/specs/swagger2-1.8.x-client.json @@ -11392,12 +11392,23 @@ "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", - "x-example": "http" + "x-example": "http", + "enum": [ + "http", + "schedule", + "event" + ] }, "status": { "type": "string", "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", - "x-example": "processing" + "x-example": "processing", + "enum": [ + "waiting", + "processing", + "completed", + "failed" + ] }, "requestMethod": { "type": "string", diff --git a/app/config/specs/swagger2-1.8.x-console.json b/app/config/specs/swagger2-1.8.x-console.json index 6d5721c73b..4f7abe599c 100644 --- a/app/config/specs/swagger2-1.8.x-console.json +++ b/app/config/specs/swagger2-1.8.x-console.json @@ -46398,7 +46398,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -46486,7 +46493,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -46576,7 +46590,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -46666,7 +46687,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -46739,7 +46767,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -46819,7 +46854,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -46909,7 +46951,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -46989,7 +47038,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -47069,7 +47125,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -47149,7 +47212,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -47257,7 +47327,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -47336,7 +47413,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -47427,7 +47511,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -48903,7 +48994,14 @@ "status": { "type": "string", "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -52139,7 +52237,14 @@ "status": { "type": "string", "description": "The deployment status. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", - "x-example": "ready" + "x-example": "ready", + "enum": [ + "waiting", + "processing", + "building", + "ready", + "failed" + ] }, "buildLogs": { "type": "string", @@ -52304,12 +52409,23 @@ "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", - "x-example": "http" + "x-example": "http", + "enum": [ + "http", + "schedule", + "event" + ] }, "status": { "type": "string", "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", - "x-example": "processing" + "x-example": "processing", + "enum": [ + "waiting", + "processing", + "completed", + "failed" + ] }, "requestMethod": { "type": "string", @@ -53268,7 +53384,16 @@ "type": { "type": "string", "description": "Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, ios, android, and unity.", - "x-example": "web" + "x-example": "web", + "enum": [ + "web", + "flutter-web", + "flutter-ios", + "flutter-android", + "ios", + "android", + "unity" + ] }, "key": { "type": "string", @@ -53570,7 +53695,12 @@ "status": { "type": "string", "description": "Antivirus status. Possible values can are: `disabled`, `offline`, `online`", - "x-example": "online" + "x-example": "online", + "enum": [ + "disabled", + "offline", + "online" + ] } }, "required": [ @@ -53618,7 +53748,11 @@ "status": { "type": "string", "description": "Service status. Possible values can are: `pass`, `fail`", - "x-example": "pass" + "x-example": "pass", + "enum": [ + "pass", + "fail" + ] } }, "required": [ @@ -55874,7 +56008,11 @@ "deploymentResourceType": { "type": "string", "description": "Type of deployment. Possible values are \"function\", \"site\". Used if rule's type is \"deployment\".", - "x-example": "function" + "x-example": "function", + "enum": [ + "function", + "site" + ] }, "deploymentResourceId": { "type": "string", @@ -55889,7 +56027,13 @@ "status": { "type": "string", "description": "Domain verification status. Possible values are \"created\", \"verifying\", \"verified\" and \"unverified\"", - "x-example": "verified" + "x-example": "verified", + "enum": [ + "created", + "verifying", + "verified", + "unverified" + ] }, "logs": { "type": "string", diff --git a/app/config/specs/swagger2-1.8.x-server.json b/app/config/specs/swagger2-1.8.x-server.json index 98077f1050..10f1fb323d 100644 --- a/app/config/specs/swagger2-1.8.x-server.json +++ b/app/config/specs/swagger2-1.8.x-server.json @@ -35359,7 +35359,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -35447,7 +35454,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -35537,7 +35551,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -35627,7 +35648,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -35700,7 +35728,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -35780,7 +35815,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -35870,7 +35912,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -35950,7 +35999,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -36030,7 +36086,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -36110,7 +36173,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -36218,7 +36288,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -36297,7 +36374,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -36388,7 +36472,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -37864,7 +37955,14 @@ "status": { "type": "string", "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -40307,7 +40405,14 @@ "status": { "type": "string", "description": "The deployment status. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", - "x-example": "ready" + "x-example": "ready", + "enum": [ + "waiting", + "processing", + "building", + "ready", + "failed" + ] }, "buildLogs": { "type": "string", @@ -40472,12 +40577,23 @@ "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", - "x-example": "http" + "x-example": "http", + "enum": [ + "http", + "schedule", + "event" + ] }, "status": { "type": "string", "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", - "x-example": "processing" + "x-example": "processing", + "enum": [ + "waiting", + "processing", + "completed", + "failed" + ] }, "requestMethod": { "type": "string", @@ -40848,7 +40964,12 @@ "status": { "type": "string", "description": "Antivirus status. Possible values can are: `disabled`, `offline`, `online`", - "x-example": "online" + "x-example": "online", + "enum": [ + "disabled", + "offline", + "online" + ] } }, "required": [ @@ -40896,7 +41017,11 @@ "status": { "type": "string", "description": "Service status. Possible values can are: `pass`, `fail`", - "x-example": "pass" + "x-example": "pass", + "enum": [ + "pass", + "fail" + ] } }, "required": [ diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 55911e9556..61428740c1 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -11392,12 +11392,23 @@ "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", - "x-example": "http" + "x-example": "http", + "enum": [ + "http", + "schedule", + "event" + ] }, "status": { "type": "string", "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", - "x-example": "processing" + "x-example": "processing", + "enum": [ + "waiting", + "processing", + "completed", + "failed" + ] }, "requestMethod": { "type": "string", diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 6d5721c73b..4f7abe599c 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -46398,7 +46398,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -46486,7 +46493,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -46576,7 +46590,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -46666,7 +46687,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -46739,7 +46767,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -46819,7 +46854,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -46909,7 +46951,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -46989,7 +47038,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -47069,7 +47125,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -47149,7 +47212,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -47257,7 +47327,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -47336,7 +47413,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -47427,7 +47511,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -48903,7 +48994,14 @@ "status": { "type": "string", "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -52139,7 +52237,14 @@ "status": { "type": "string", "description": "The deployment status. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", - "x-example": "ready" + "x-example": "ready", + "enum": [ + "waiting", + "processing", + "building", + "ready", + "failed" + ] }, "buildLogs": { "type": "string", @@ -52304,12 +52409,23 @@ "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", - "x-example": "http" + "x-example": "http", + "enum": [ + "http", + "schedule", + "event" + ] }, "status": { "type": "string", "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", - "x-example": "processing" + "x-example": "processing", + "enum": [ + "waiting", + "processing", + "completed", + "failed" + ] }, "requestMethod": { "type": "string", @@ -53268,7 +53384,16 @@ "type": { "type": "string", "description": "Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, ios, android, and unity.", - "x-example": "web" + "x-example": "web", + "enum": [ + "web", + "flutter-web", + "flutter-ios", + "flutter-android", + "ios", + "android", + "unity" + ] }, "key": { "type": "string", @@ -53570,7 +53695,12 @@ "status": { "type": "string", "description": "Antivirus status. Possible values can are: `disabled`, `offline`, `online`", - "x-example": "online" + "x-example": "online", + "enum": [ + "disabled", + "offline", + "online" + ] } }, "required": [ @@ -53618,7 +53748,11 @@ "status": { "type": "string", "description": "Service status. Possible values can are: `pass`, `fail`", - "x-example": "pass" + "x-example": "pass", + "enum": [ + "pass", + "fail" + ] } }, "required": [ @@ -55874,7 +56008,11 @@ "deploymentResourceType": { "type": "string", "description": "Type of deployment. Possible values are \"function\", \"site\". Used if rule's type is \"deployment\".", - "x-example": "function" + "x-example": "function", + "enum": [ + "function", + "site" + ] }, "deploymentResourceId": { "type": "string", @@ -55889,7 +56027,13 @@ "status": { "type": "string", "description": "Domain verification status. Possible values are \"created\", \"verifying\", \"verified\" and \"unverified\"", - "x-example": "verified" + "x-example": "verified", + "enum": [ + "created", + "verifying", + "verified", + "unverified" + ] }, "logs": { "type": "string", diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 98077f1050..10f1fb323d 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -35359,7 +35359,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -35447,7 +35454,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -35537,7 +35551,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -35627,7 +35648,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -35700,7 +35728,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -35780,7 +35815,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -35870,7 +35912,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -35950,7 +35999,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -36030,7 +36086,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -36110,7 +36173,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -36218,7 +36288,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -36297,7 +36374,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -36388,7 +36472,14 @@ "status": { "type": "string", "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -37864,7 +37955,14 @@ "status": { "type": "string", "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", - "x-example": "available" + "x-example": "available", + "enum": [ + "available", + "processing", + "deleting", + "stuck", + "failed" + ] }, "error": { "type": "string", @@ -40307,7 +40405,14 @@ "status": { "type": "string", "description": "The deployment status. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", - "x-example": "ready" + "x-example": "ready", + "enum": [ + "waiting", + "processing", + "building", + "ready", + "failed" + ] }, "buildLogs": { "type": "string", @@ -40472,12 +40577,23 @@ "trigger": { "type": "string", "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", - "x-example": "http" + "x-example": "http", + "enum": [ + "http", + "schedule", + "event" + ] }, "status": { "type": "string", "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", - "x-example": "processing" + "x-example": "processing", + "enum": [ + "waiting", + "processing", + "completed", + "failed" + ] }, "requestMethod": { "type": "string", @@ -40848,7 +40964,12 @@ "status": { "type": "string", "description": "Antivirus status. Possible values can are: `disabled`, `offline`, `online`", - "x-example": "online" + "x-example": "online", + "enum": [ + "disabled", + "offline", + "online" + ] } }, "required": [ @@ -40896,7 +41017,11 @@ "status": { "type": "string", "description": "Service status. Possible values can are: `pass`, `fail`", - "x-example": "pass" + "x-example": "pass", + "enum": [ + "pass", + "fail" + ] } }, "required": [ diff --git a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php index c9c2135ab3..c11e55e733 100644 --- a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php @@ -682,6 +682,10 @@ class OpenAPI3 extends Format $type = 'string'; break; + case 'enum': + $type = 'string'; + break; + case 'json': $type = 'object'; $output['components']['schemas'][$model->getType()]['properties'][$name]['additionalProperties'] = true; @@ -770,6 +774,13 @@ class OpenAPI3 extends Format if ($items) { $output['components']['schemas'][$model->getType()]['properties'][$name]['items'] = $items; } + if ($rule['type'] === 'enum' && !empty($rule['enum'])) { + if ($rule['array']) { + $output['components']['schemas'][$model->getType()]['properties'][$name]['items']['enum'] = $rule['enum']; + } else { + $output['components']['schemas'][$model->getType()]['properties'][$name]['enum'] = $rule['enum']; + } + } if (!in_array($name, $required)) { $output['components']['schemas'][$model->getType()]['properties'][$name]['nullable'] = true; } diff --git a/src/Appwrite/SDK/Specification/Format/Swagger2.php b/src/Appwrite/SDK/Specification/Format/Swagger2.php index a923f40ffa..4e784e8116 100644 --- a/src/Appwrite/SDK/Specification/Format/Swagger2.php +++ b/src/Appwrite/SDK/Specification/Format/Swagger2.php @@ -690,6 +690,10 @@ class Swagger2 extends Format $type = 'string'; break; + case 'enum': + $type = 'string'; + break; + case 'json': $type = 'object'; break; @@ -792,6 +796,13 @@ class Swagger2 extends Format if ($items) { $output['definitions'][$model->getType()]['properties'][$name]['items'] = $items; } + if ($rule['type'] === 'enum' && !empty($rule['enum'])) { + if ($rule['array']) { + $output['definitions'][$model->getType()]['properties'][$name]['items']['enum'] = $rule['enum']; + } else { + $output['definitions'][$model->getType()]['properties'][$name]['enum'] = $rule['enum']; + } + } if (!in_array($name, $required)) { $output['definitions'][$model->getType()]['properties'][$name]['x-nullable'] = true; } diff --git a/src/Appwrite/Utopia/Response/Model.php b/src/Appwrite/Utopia/Response/Model.php index 04468521b6..59c786ee1f 100644 --- a/src/Appwrite/Utopia/Response/Model.php +++ b/src/Appwrite/Utopia/Response/Model.php @@ -16,6 +16,7 @@ abstract class Model public const TYPE_RELATIONSHIP = 'relationship'; public const TYPE_PAYLOAD = 'payload'; public const TYPE_ARRAY = 'array'; + public const TYPE_ENUM = 'enum'; /** * @var bool diff --git a/src/Appwrite/Utopia/Response/Model/Attribute.php b/src/Appwrite/Utopia/Response/Model/Attribute.php index 8c43f8d21c..35de6bacc5 100644 --- a/src/Appwrite/Utopia/Response/Model/Attribute.php +++ b/src/Appwrite/Utopia/Response/Model/Attribute.php @@ -23,10 +23,11 @@ class Attribute extends Model 'example' => 'string', ]) ->addRule('status', [ - 'type' => self::TYPE_STRING, + 'type' => self::TYPE_ENUM, 'description' => 'Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`', 'default' => '', 'example' => 'available', + 'enum' => ['available', 'processing', 'deleting', 'stuck', 'failed'], ]) ->addRule('error', [ 'type' => self::TYPE_STRING, diff --git a/src/Appwrite/Utopia/Response/Model/Deployment.php b/src/Appwrite/Utopia/Response/Model/Deployment.php index 55c1589af0..45699f65d1 100644 --- a/src/Appwrite/Utopia/Response/Model/Deployment.php +++ b/src/Appwrite/Utopia/Response/Model/Deployment.php @@ -95,10 +95,11 @@ class Deployment extends Model 'example' => '5e5ea5c16897e', ]) ->addRule('status', [ - 'type' => self::TYPE_STRING, + 'type' => self::TYPE_ENUM, 'description' => 'The deployment status. Possible values are "waiting", "processing", "building", "ready", and "failed".', 'default' => '', 'example' => 'ready', + 'enum' => ['waiting', 'processing', 'building', 'ready', 'failed'], ]) ->addRule('buildLogs', [ 'type' => self::TYPE_STRING, diff --git a/src/Appwrite/Utopia/Response/Model/Execution.php b/src/Appwrite/Utopia/Response/Model/Execution.php index 39d2203bf9..f8e62fe824 100644 --- a/src/Appwrite/Utopia/Response/Model/Execution.php +++ b/src/Appwrite/Utopia/Response/Model/Execution.php @@ -52,16 +52,18 @@ class Execution extends Model 'example' => '5e5ea5c16897e', ]) ->addRule('trigger', [ - 'type' => self::TYPE_STRING, + 'type' => self::TYPE_ENUM, 'description' => 'The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.', 'default' => '', 'example' => 'http', + 'enum' => ['http', 'schedule', 'event'], ]) ->addRule('status', [ - 'type' => self::TYPE_STRING, + 'type' => self::TYPE_ENUM, 'description' => 'The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.', 'default' => '', 'example' => 'processing', + 'enum' => ['waiting', 'processing', 'completed', 'failed'], ]) ->addRule('requestMethod', [ 'type' => self::TYPE_STRING, diff --git a/src/Appwrite/Utopia/Response/Model/HealthAntivirus.php b/src/Appwrite/Utopia/Response/Model/HealthAntivirus.php index 7a74195371..d790dbc24c 100644 --- a/src/Appwrite/Utopia/Response/Model/HealthAntivirus.php +++ b/src/Appwrite/Utopia/Response/Model/HealthAntivirus.php @@ -17,10 +17,11 @@ class HealthAntivirus extends Model 'example' => '1.0.0', ]) ->addRule('status', [ - 'type' => self::TYPE_STRING, + 'type' => self::TYPE_ENUM, 'description' => 'Antivirus status. Possible values can are: `disabled`, `offline`, `online`', 'default' => '', 'example' => 'online', + 'enum' => ['disabled', 'offline', 'online'], ]) ; } diff --git a/src/Appwrite/Utopia/Response/Model/HealthStatus.php b/src/Appwrite/Utopia/Response/Model/HealthStatus.php index ba340107ac..89438c83f2 100644 --- a/src/Appwrite/Utopia/Response/Model/HealthStatus.php +++ b/src/Appwrite/Utopia/Response/Model/HealthStatus.php @@ -23,10 +23,11 @@ class HealthStatus extends Model 'example' => 128, ]) ->addRule('status', [ - 'type' => self::TYPE_STRING, + 'type' => self::TYPE_ENUM, 'description' => 'Service status. Possible values can are: `pass`, `fail`', 'default' => '', 'example' => 'pass', + 'enum' => ['pass', 'fail'], ]) ; } diff --git a/src/Appwrite/Utopia/Response/Model/Index.php b/src/Appwrite/Utopia/Response/Model/Index.php index 62661738c2..5a4d606408 100644 --- a/src/Appwrite/Utopia/Response/Model/Index.php +++ b/src/Appwrite/Utopia/Response/Model/Index.php @@ -41,10 +41,11 @@ class Index extends Model 'example' => 'primary', ]) ->addRule('status', [ - 'type' => self::TYPE_STRING, + 'type' => self::TYPE_ENUM, 'description' => 'Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`', 'default' => '', 'example' => 'available', + 'enum' => ['available', 'processing', 'deleting', 'stuck', 'failed'], ]) ->addRule('error', [ 'type' => self::TYPE_STRING, diff --git a/src/Appwrite/Utopia/Response/Model/Platform.php b/src/Appwrite/Utopia/Response/Model/Platform.php index 4b8ffb1486..5fc68ee808 100644 --- a/src/Appwrite/Utopia/Response/Model/Platform.php +++ b/src/Appwrite/Utopia/Response/Model/Platform.php @@ -40,10 +40,11 @@ class Platform extends Model 'example' => 'My Web App', ]) ->addRule('type', [ - 'type' => self::TYPE_STRING, + 'type' => self::TYPE_ENUM, 'description' => 'Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, ios, android, and unity.', 'default' => '', 'example' => 'web', + 'enum' => ['web', 'flutter-web', 'flutter-ios', 'flutter-android', 'ios', 'android', 'unity'], ]) ->addRule('key', [ 'type' => self::TYPE_STRING, diff --git a/src/Appwrite/Utopia/Response/Model/Rule.php b/src/Appwrite/Utopia/Response/Model/Rule.php index 12903b270e..67ba5db94d 100644 --- a/src/Appwrite/Utopia/Response/Model/Rule.php +++ b/src/Appwrite/Utopia/Response/Model/Rule.php @@ -65,10 +65,11 @@ class Rule extends Model 'example' => 'n3u9feiwmf', ]) ->addRule('deploymentResourceType', [ - 'type' => self::TYPE_STRING, + 'type' => self::TYPE_ENUM, 'description' => 'Type of deployment. Possible values are "function", "site". Used if rule\'s type is "deployment".', 'default' => '', 'example' => 'function', + 'enum' => ['function', 'site'], ]) ->addRule('deploymentResourceId', [ 'type' => self::TYPE_STRING, @@ -83,10 +84,11 @@ class Rule extends Model 'example' => 'function', ]) ->addRule('status', [ - 'type' => self::TYPE_STRING, + 'type' => self::TYPE_ENUM, 'description' => 'Domain verification status. Possible values are "created", "verifying", "verified" and "unverified"', 'default' => false, 'example' => 'verified', + 'enum' => ['created', 'verifying', 'verified', 'unverified'], ]) ->addRule('logs', [ 'type' => self::TYPE_STRING, From 0f5cb2611d15b3d43d2ce8e0a9c76456a34bd6b1 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 15 Sep 2025 10:32:06 +0530 Subject: [PATCH 02/17] fix: grammer --- app/config/specs/open-api3-1.8.x-console.json | 4 ++-- app/config/specs/open-api3-1.8.x-server.json | 4 ++-- app/config/specs/open-api3-latest-console.json | 4 ++-- app/config/specs/open-api3-latest-server.json | 4 ++-- app/config/specs/swagger2-1.8.x-console.json | 4 ++-- app/config/specs/swagger2-1.8.x-server.json | 4 ++-- app/config/specs/swagger2-latest-console.json | 4 ++-- app/config/specs/swagger2-latest-server.json | 4 ++-- src/Appwrite/Utopia/Response/Model/HealthAntivirus.php | 2 +- src/Appwrite/Utopia/Response/Model/HealthStatus.php | 2 +- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/app/config/specs/open-api3-1.8.x-console.json b/app/config/specs/open-api3-1.8.x-console.json index 1e3a876192..f72da9c18a 100644 --- a/app/config/specs/open-api3-1.8.x-console.json +++ b/app/config/specs/open-api3-1.8.x-console.json @@ -53738,7 +53738,7 @@ }, "status": { "type": "string", - "description": "Antivirus status. Possible values can are: `disabled`, `offline`, `online`", + "description": "Antivirus status. Possible values are: `disabled`, `offline`, `online`", "x-example": "online", "enum": [ "disabled", @@ -53791,7 +53791,7 @@ }, "status": { "type": "string", - "description": "Service status. Possible values can are: `pass`, `fail`", + "description": "Service status. Possible values are: `pass`, `fail`", "x-example": "pass", "enum": [ "pass", diff --git a/app/config/specs/open-api3-1.8.x-server.json b/app/config/specs/open-api3-1.8.x-server.json index af0ca8f886..926b3fa59f 100644 --- a/app/config/specs/open-api3-1.8.x-server.json +++ b/app/config/specs/open-api3-1.8.x-server.json @@ -40926,7 +40926,7 @@ }, "status": { "type": "string", - "description": "Antivirus status. Possible values can are: `disabled`, `offline`, `online`", + "description": "Antivirus status. Possible values are: `disabled`, `offline`, `online`", "x-example": "online", "enum": [ "disabled", @@ -40979,7 +40979,7 @@ }, "status": { "type": "string", - "description": "Service status. Possible values can are: `pass`, `fail`", + "description": "Service status. Possible values are: `pass`, `fail`", "x-example": "pass", "enum": [ "pass", diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 1e3a876192..f72da9c18a 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -53738,7 +53738,7 @@ }, "status": { "type": "string", - "description": "Antivirus status. Possible values can are: `disabled`, `offline`, `online`", + "description": "Antivirus status. Possible values are: `disabled`, `offline`, `online`", "x-example": "online", "enum": [ "disabled", @@ -53791,7 +53791,7 @@ }, "status": { "type": "string", - "description": "Service status. Possible values can are: `pass`, `fail`", + "description": "Service status. Possible values are: `pass`, `fail`", "x-example": "pass", "enum": [ "pass", diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index af0ca8f886..926b3fa59f 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -40926,7 +40926,7 @@ }, "status": { "type": "string", - "description": "Antivirus status. Possible values can are: `disabled`, `offline`, `online`", + "description": "Antivirus status. Possible values are: `disabled`, `offline`, `online`", "x-example": "online", "enum": [ "disabled", @@ -40979,7 +40979,7 @@ }, "status": { "type": "string", - "description": "Service status. Possible values can are: `pass`, `fail`", + "description": "Service status. Possible values are: `pass`, `fail`", "x-example": "pass", "enum": [ "pass", diff --git a/app/config/specs/swagger2-1.8.x-console.json b/app/config/specs/swagger2-1.8.x-console.json index 4f7abe599c..cd6c104c6e 100644 --- a/app/config/specs/swagger2-1.8.x-console.json +++ b/app/config/specs/swagger2-1.8.x-console.json @@ -53694,7 +53694,7 @@ }, "status": { "type": "string", - "description": "Antivirus status. Possible values can are: `disabled`, `offline`, `online`", + "description": "Antivirus status. Possible values are: `disabled`, `offline`, `online`", "x-example": "online", "enum": [ "disabled", @@ -53747,7 +53747,7 @@ }, "status": { "type": "string", - "description": "Service status. Possible values can are: `pass`, `fail`", + "description": "Service status. Possible values are: `pass`, `fail`", "x-example": "pass", "enum": [ "pass", diff --git a/app/config/specs/swagger2-1.8.x-server.json b/app/config/specs/swagger2-1.8.x-server.json index 10f1fb323d..f913753279 100644 --- a/app/config/specs/swagger2-1.8.x-server.json +++ b/app/config/specs/swagger2-1.8.x-server.json @@ -40963,7 +40963,7 @@ }, "status": { "type": "string", - "description": "Antivirus status. Possible values can are: `disabled`, `offline`, `online`", + "description": "Antivirus status. Possible values are: `disabled`, `offline`, `online`", "x-example": "online", "enum": [ "disabled", @@ -41016,7 +41016,7 @@ }, "status": { "type": "string", - "description": "Service status. Possible values can are: `pass`, `fail`", + "description": "Service status. Possible values are: `pass`, `fail`", "x-example": "pass", "enum": [ "pass", diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 4f7abe599c..cd6c104c6e 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -53694,7 +53694,7 @@ }, "status": { "type": "string", - "description": "Antivirus status. Possible values can are: `disabled`, `offline`, `online`", + "description": "Antivirus status. Possible values are: `disabled`, `offline`, `online`", "x-example": "online", "enum": [ "disabled", @@ -53747,7 +53747,7 @@ }, "status": { "type": "string", - "description": "Service status. Possible values can are: `pass`, `fail`", + "description": "Service status. Possible values are: `pass`, `fail`", "x-example": "pass", "enum": [ "pass", diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 10f1fb323d..f913753279 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -40963,7 +40963,7 @@ }, "status": { "type": "string", - "description": "Antivirus status. Possible values can are: `disabled`, `offline`, `online`", + "description": "Antivirus status. Possible values are: `disabled`, `offline`, `online`", "x-example": "online", "enum": [ "disabled", @@ -41016,7 +41016,7 @@ }, "status": { "type": "string", - "description": "Service status. Possible values can are: `pass`, `fail`", + "description": "Service status. Possible values are: `pass`, `fail`", "x-example": "pass", "enum": [ "pass", diff --git a/src/Appwrite/Utopia/Response/Model/HealthAntivirus.php b/src/Appwrite/Utopia/Response/Model/HealthAntivirus.php index d790dbc24c..29bd420ce5 100644 --- a/src/Appwrite/Utopia/Response/Model/HealthAntivirus.php +++ b/src/Appwrite/Utopia/Response/Model/HealthAntivirus.php @@ -18,7 +18,7 @@ class HealthAntivirus extends Model ]) ->addRule('status', [ 'type' => self::TYPE_ENUM, - 'description' => 'Antivirus status. Possible values can are: `disabled`, `offline`, `online`', + 'description' => 'Antivirus status. Possible values are: `disabled`, `offline`, `online`', 'default' => '', 'example' => 'online', 'enum' => ['disabled', 'offline', 'online'], diff --git a/src/Appwrite/Utopia/Response/Model/HealthStatus.php b/src/Appwrite/Utopia/Response/Model/HealthStatus.php index 89438c83f2..24fb8766ce 100644 --- a/src/Appwrite/Utopia/Response/Model/HealthStatus.php +++ b/src/Appwrite/Utopia/Response/Model/HealthStatus.php @@ -24,7 +24,7 @@ class HealthStatus extends Model ]) ->addRule('status', [ 'type' => self::TYPE_ENUM, - 'description' => 'Service status. Possible values can are: `pass`, `fail`', + 'description' => 'Service status. Possible values are: `pass`, `fail`', 'default' => '', 'example' => 'pass', 'enum' => ['pass', 'fail'], From 40eaf39d91dd6992b8957d67d9516715af575903 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 15 Sep 2025 11:39:00 +0530 Subject: [PATCH 03/17] fix: graphql --- src/Appwrite/GraphQL/Types/Mapper.php | 31 ++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/GraphQL/Types/Mapper.php b/src/Appwrite/GraphQL/Types/Mapper.php index f0394b2395..22a2c91d7e 100644 --- a/src/Appwrite/GraphQL/Types/Mapper.php +++ b/src/Appwrite/GraphQL/Types/Mapper.php @@ -6,6 +6,7 @@ use Appwrite\GraphQL\Resolvers; use Appwrite\GraphQL\Types; use Appwrite\SDK\Method; use Exception; +use GraphQL\Type\Definition\EnumType; use GraphQL\Type\Definition\ObjectType; use GraphQL\Type\Definition\Type; use GraphQL\Type\Definition\UnionType; @@ -58,7 +59,8 @@ class Mapper 'json' => Types::json(), 'none' => Types::json(), 'any' => Types::json(), - 'array' => Types::json() + 'array' => Types::json(), + 'enum' => Type::string() ]; foreach ($defaults as $type => $default) { @@ -213,6 +215,8 @@ class Mapper if (\is_array($rule['type'])) { $type = self::getUnionType($escapedKey, $rule); + } elseif ($rule['type'] === 'enum' && !empty($rule['enum'])) { + $type = self::createEnumType($rule, $escapedKey); } else { $type = self::getObjectType($rule); } @@ -387,6 +391,30 @@ class Mapper return $type; } + private static function createEnumType(array $rule, string $fieldName): Type + { + $enumTypeName = \ucfirst($fieldName) . 'Enum'; + + if (Registry::has($enumTypeName)) { + return Registry::get($enumTypeName); + } + + $values = []; + foreach ($rule['enum'] as $enumValue) { + $values[\strtoupper(\str_replace(['-', ' ', '.'], '_', $enumValue))] = [ + 'value' => $enumValue + ]; + } + + $enumType = new EnumType([ + 'name' => $enumTypeName, + 'values' => $values + ]); + + Registry::set($enumTypeName, $enumType); + return $enumType; + } + private static function getObjectType(array $rule): Type { $type = $rule['type']; @@ -460,6 +488,7 @@ class Mapper 'point' => static::model("{$prefix}Point"), 'linestring' => static::model("{$prefix}Line"), 'polygon' => static::model("{$prefix}Polygon"), + 'enum' => static::model("{$prefix}Enum"), default => throw new Exception('Unknown ' . strtolower($prefix) . ' implementation'), }; } From 579f6691f9111047263fa2246e6c17aa1fabf9f4 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 15 Sep 2025 11:42:23 +0530 Subject: [PATCH 04/17] fix: default to be created --- src/Appwrite/Utopia/Response/Model/Rule.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Utopia/Response/Model/Rule.php b/src/Appwrite/Utopia/Response/Model/Rule.php index 67ba5db94d..7974bc7f98 100644 --- a/src/Appwrite/Utopia/Response/Model/Rule.php +++ b/src/Appwrite/Utopia/Response/Model/Rule.php @@ -86,7 +86,7 @@ class Rule extends Model ->addRule('status', [ 'type' => self::TYPE_ENUM, 'description' => 'Domain verification status. Possible values are "created", "verifying", "verified" and "unverified"', - 'default' => false, + 'default' => 'created', 'example' => 'verified', 'enum' => ['created', 'verifying', 'verified', 'unverified'], ]) From ef69520f95d0469bf83532208119d8c210ac2157 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 15 Sep 2025 11:51:47 +0530 Subject: [PATCH 05/17] fix: nitpick comments --- app/config/specs/open-api3-1.8.x-client.json | 2 +- app/config/specs/open-api3-1.8.x-console.json | 24 +++++++++---------- app/config/specs/open-api3-1.8.x-server.json | 16 ++++++------- app/config/specs/open-api3-latest-client.json | 2 +- .../specs/open-api3-latest-console.json | 24 +++++++++---------- app/config/specs/open-api3-latest-server.json | 16 ++++++------- app/config/specs/swagger2-1.8.x-client.json | 2 +- app/config/specs/swagger2-1.8.x-console.json | 24 +++++++++---------- app/config/specs/swagger2-1.8.x-server.json | 16 ++++++------- app/config/specs/swagger2-latest-client.json | 2 +- app/config/specs/swagger2-latest-console.json | 24 +++++++++---------- app/config/specs/swagger2-latest-server.json | 16 ++++++------- .../Utopia/Response/Model/Deployment.php | 6 ----- .../Utopia/Response/Model/Execution.php | 2 +- .../Utopia/Response/Model/Platform.php | 2 +- src/Appwrite/Utopia/Response/Model/Rule.php | 4 ++-- 16 files changed, 88 insertions(+), 94 deletions(-) diff --git a/app/config/specs/open-api3-1.8.x-client.json b/app/config/specs/open-api3-1.8.x-client.json index aabc7d66fb..d57b9f83b2 100644 --- a/app/config/specs/open-api3-1.8.x-client.json +++ b/app/config/specs/open-api3-1.8.x-client.json @@ -11423,7 +11423,7 @@ }, "requestHeaders": { "type": "array", - "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "description": "HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", "items": { "$ref": "#\/components\/schemas\/headers" }, diff --git a/app/config/specs/open-api3-1.8.x-console.json b/app/config/specs/open-api3-1.8.x-console.json index f72da9c18a..1dd58c3261 100644 --- a/app/config/specs/open-api3-1.8.x-console.json +++ b/app/config/specs/open-api3-1.8.x-console.json @@ -52324,11 +52324,6 @@ "description": "The url of the vcs provider repository", "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function" }, - "providerBranch": { - "type": "string", - "description": "The branch of the vcs repository", - "x-example": "0.7.x" - }, "providerCommitHash": { "type": "string", "description": "The commit hash of the vcs commit", @@ -52354,6 +52349,11 @@ "description": "The url of the vcs commit", "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb" }, + "providerBranch": { + "type": "string", + "description": "The branch of the vcs repository", + "x-example": "0.7.x" + }, "providerBranchUrl": { "type": "string", "description": "The branch of the vcs repository", @@ -52381,12 +52381,12 @@ "providerRepositoryName", "providerRepositoryOwner", "providerRepositoryUrl", - "providerBranch", "providerCommitHash", "providerCommitAuthorUrl", "providerCommitAuthor", "providerCommitMessage", "providerCommitUrl", + "providerBranch", "providerBranchUrl" ], "example": { @@ -52410,12 +52410,12 @@ "providerRepositoryName": "database", "providerRepositoryOwner": "utopia", "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", - "providerBranch": "0.7.x", "providerCommitHash": "7c3f25d", "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", "providerCommitAuthor": "Khushboo Verma", "providerCommitMessage": "Update index.js", "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranch": "0.7.x", "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" } }, @@ -52491,7 +52491,7 @@ }, "requestHeaders": { "type": "array", - "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "description": "HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", "items": { "$ref": "#\/components\/schemas\/headers" }, @@ -53452,7 +53452,7 @@ "hostname": { "type": "string", "description": "Web app hostname. Empty string for other platforms.", - "x-example": true + "x-example": "app.example.com" }, "httpUser": { "type": "string", @@ -53485,7 +53485,7 @@ "type": "web", "key": "com.company.appname", "store": "", - "hostname": true, + "hostname": "app.example.com", "httpUser": "username", "httpPass": "password" } @@ -55975,7 +55975,7 @@ "deploymentVcsProviderBranch": { "type": "string", "description": "Name of Git branch that updates rule. Used if type is \"deployment\"", - "x-example": "function" + "x-example": "main" }, "status": { "type": "string", @@ -56028,7 +56028,7 @@ "deploymentId": "n3u9feiwmf", "deploymentResourceType": "function", "deploymentResourceId": "n3u9feiwmf", - "deploymentVcsProviderBranch": "function", + "deploymentVcsProviderBranch": "main", "status": "verified", "logs": "HTTP challegne failed.", "renewAt": "datetime" diff --git a/app/config/specs/open-api3-1.8.x-server.json b/app/config/specs/open-api3-1.8.x-server.json index 926b3fa59f..b437d56bfc 100644 --- a/app/config/specs/open-api3-1.8.x-server.json +++ b/app/config/specs/open-api3-1.8.x-server.json @@ -40405,11 +40405,6 @@ "description": "The url of the vcs provider repository", "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function" }, - "providerBranch": { - "type": "string", - "description": "The branch of the vcs repository", - "x-example": "0.7.x" - }, "providerCommitHash": { "type": "string", "description": "The commit hash of the vcs commit", @@ -40435,6 +40430,11 @@ "description": "The url of the vcs commit", "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb" }, + "providerBranch": { + "type": "string", + "description": "The branch of the vcs repository", + "x-example": "0.7.x" + }, "providerBranchUrl": { "type": "string", "description": "The branch of the vcs repository", @@ -40462,12 +40462,12 @@ "providerRepositoryName", "providerRepositoryOwner", "providerRepositoryUrl", - "providerBranch", "providerCommitHash", "providerCommitAuthorUrl", "providerCommitAuthor", "providerCommitMessage", "providerCommitUrl", + "providerBranch", "providerBranchUrl" ], "example": { @@ -40491,12 +40491,12 @@ "providerRepositoryName": "database", "providerRepositoryOwner": "utopia", "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", - "providerBranch": "0.7.x", "providerCommitHash": "7c3f25d", "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", "providerCommitAuthor": "Khushboo Verma", "providerCommitMessage": "Update index.js", "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranch": "0.7.x", "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" } }, @@ -40572,7 +40572,7 @@ }, "requestHeaders": { "type": "array", - "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "description": "HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", "items": { "$ref": "#\/components\/schemas\/headers" }, diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index aabc7d66fb..d57b9f83b2 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -11423,7 +11423,7 @@ }, "requestHeaders": { "type": "array", - "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "description": "HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", "items": { "$ref": "#\/components\/schemas\/headers" }, diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index f72da9c18a..1dd58c3261 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -52324,11 +52324,6 @@ "description": "The url of the vcs provider repository", "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function" }, - "providerBranch": { - "type": "string", - "description": "The branch of the vcs repository", - "x-example": "0.7.x" - }, "providerCommitHash": { "type": "string", "description": "The commit hash of the vcs commit", @@ -52354,6 +52349,11 @@ "description": "The url of the vcs commit", "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb" }, + "providerBranch": { + "type": "string", + "description": "The branch of the vcs repository", + "x-example": "0.7.x" + }, "providerBranchUrl": { "type": "string", "description": "The branch of the vcs repository", @@ -52381,12 +52381,12 @@ "providerRepositoryName", "providerRepositoryOwner", "providerRepositoryUrl", - "providerBranch", "providerCommitHash", "providerCommitAuthorUrl", "providerCommitAuthor", "providerCommitMessage", "providerCommitUrl", + "providerBranch", "providerBranchUrl" ], "example": { @@ -52410,12 +52410,12 @@ "providerRepositoryName": "database", "providerRepositoryOwner": "utopia", "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", - "providerBranch": "0.7.x", "providerCommitHash": "7c3f25d", "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", "providerCommitAuthor": "Khushboo Verma", "providerCommitMessage": "Update index.js", "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranch": "0.7.x", "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" } }, @@ -52491,7 +52491,7 @@ }, "requestHeaders": { "type": "array", - "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "description": "HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", "items": { "$ref": "#\/components\/schemas\/headers" }, @@ -53452,7 +53452,7 @@ "hostname": { "type": "string", "description": "Web app hostname. Empty string for other platforms.", - "x-example": true + "x-example": "app.example.com" }, "httpUser": { "type": "string", @@ -53485,7 +53485,7 @@ "type": "web", "key": "com.company.appname", "store": "", - "hostname": true, + "hostname": "app.example.com", "httpUser": "username", "httpPass": "password" } @@ -55975,7 +55975,7 @@ "deploymentVcsProviderBranch": { "type": "string", "description": "Name of Git branch that updates rule. Used if type is \"deployment\"", - "x-example": "function" + "x-example": "main" }, "status": { "type": "string", @@ -56028,7 +56028,7 @@ "deploymentId": "n3u9feiwmf", "deploymentResourceType": "function", "deploymentResourceId": "n3u9feiwmf", - "deploymentVcsProviderBranch": "function", + "deploymentVcsProviderBranch": "main", "status": "verified", "logs": "HTTP challegne failed.", "renewAt": "datetime" diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 926b3fa59f..b437d56bfc 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -40405,11 +40405,6 @@ "description": "The url of the vcs provider repository", "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function" }, - "providerBranch": { - "type": "string", - "description": "The branch of the vcs repository", - "x-example": "0.7.x" - }, "providerCommitHash": { "type": "string", "description": "The commit hash of the vcs commit", @@ -40435,6 +40430,11 @@ "description": "The url of the vcs commit", "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb" }, + "providerBranch": { + "type": "string", + "description": "The branch of the vcs repository", + "x-example": "0.7.x" + }, "providerBranchUrl": { "type": "string", "description": "The branch of the vcs repository", @@ -40462,12 +40462,12 @@ "providerRepositoryName", "providerRepositoryOwner", "providerRepositoryUrl", - "providerBranch", "providerCommitHash", "providerCommitAuthorUrl", "providerCommitAuthor", "providerCommitMessage", "providerCommitUrl", + "providerBranch", "providerBranchUrl" ], "example": { @@ -40491,12 +40491,12 @@ "providerRepositoryName": "database", "providerRepositoryOwner": "utopia", "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", - "providerBranch": "0.7.x", "providerCommitHash": "7c3f25d", "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", "providerCommitAuthor": "Khushboo Verma", "providerCommitMessage": "Update index.js", "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranch": "0.7.x", "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" } }, @@ -40572,7 +40572,7 @@ }, "requestHeaders": { "type": "array", - "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "description": "HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", "items": { "$ref": "#\/components\/schemas\/headers" }, diff --git a/app/config/specs/swagger2-1.8.x-client.json b/app/config/specs/swagger2-1.8.x-client.json index 61428740c1..c2628533d0 100644 --- a/app/config/specs/swagger2-1.8.x-client.json +++ b/app/config/specs/swagger2-1.8.x-client.json @@ -11422,7 +11422,7 @@ }, "requestHeaders": { "type": "array", - "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "description": "HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", "items": { "type": "object", "$ref": "#\/definitions\/headers" diff --git a/app/config/specs/swagger2-1.8.x-console.json b/app/config/specs/swagger2-1.8.x-console.json index cd6c104c6e..0f91a5433d 100644 --- a/app/config/specs/swagger2-1.8.x-console.json +++ b/app/config/specs/swagger2-1.8.x-console.json @@ -52272,11 +52272,6 @@ "description": "The url of the vcs provider repository", "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function" }, - "providerBranch": { - "type": "string", - "description": "The branch of the vcs repository", - "x-example": "0.7.x" - }, "providerCommitHash": { "type": "string", "description": "The commit hash of the vcs commit", @@ -52302,6 +52297,11 @@ "description": "The url of the vcs commit", "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb" }, + "providerBranch": { + "type": "string", + "description": "The branch of the vcs repository", + "x-example": "0.7.x" + }, "providerBranchUrl": { "type": "string", "description": "The branch of the vcs repository", @@ -52329,12 +52329,12 @@ "providerRepositoryName", "providerRepositoryOwner", "providerRepositoryUrl", - "providerBranch", "providerCommitHash", "providerCommitAuthorUrl", "providerCommitAuthor", "providerCommitMessage", "providerCommitUrl", + "providerBranch", "providerBranchUrl" ], "example": { @@ -52358,12 +52358,12 @@ "providerRepositoryName": "database", "providerRepositoryOwner": "utopia", "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", - "providerBranch": "0.7.x", "providerCommitHash": "7c3f25d", "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", "providerCommitAuthor": "Khushboo Verma", "providerCommitMessage": "Update index.js", "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranch": "0.7.x", "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" } }, @@ -52439,7 +52439,7 @@ }, "requestHeaders": { "type": "array", - "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "description": "HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", "items": { "type": "object", "$ref": "#\/definitions\/headers" @@ -53408,7 +53408,7 @@ "hostname": { "type": "string", "description": "Web app hostname. Empty string for other platforms.", - "x-example": true + "x-example": "app.example.com" }, "httpUser": { "type": "string", @@ -53441,7 +53441,7 @@ "type": "web", "key": "com.company.appname", "store": "", - "hostname": true, + "hostname": "app.example.com", "httpUser": "username", "httpPass": "password" } @@ -56022,7 +56022,7 @@ "deploymentVcsProviderBranch": { "type": "string", "description": "Name of Git branch that updates rule. Used if type is \"deployment\"", - "x-example": "function" + "x-example": "main" }, "status": { "type": "string", @@ -56075,7 +56075,7 @@ "deploymentId": "n3u9feiwmf", "deploymentResourceType": "function", "deploymentResourceId": "n3u9feiwmf", - "deploymentVcsProviderBranch": "function", + "deploymentVcsProviderBranch": "main", "status": "verified", "logs": "HTTP challegne failed.", "renewAt": "datetime" diff --git a/app/config/specs/swagger2-1.8.x-server.json b/app/config/specs/swagger2-1.8.x-server.json index f913753279..679da75e5d 100644 --- a/app/config/specs/swagger2-1.8.x-server.json +++ b/app/config/specs/swagger2-1.8.x-server.json @@ -40440,11 +40440,6 @@ "description": "The url of the vcs provider repository", "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function" }, - "providerBranch": { - "type": "string", - "description": "The branch of the vcs repository", - "x-example": "0.7.x" - }, "providerCommitHash": { "type": "string", "description": "The commit hash of the vcs commit", @@ -40470,6 +40465,11 @@ "description": "The url of the vcs commit", "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb" }, + "providerBranch": { + "type": "string", + "description": "The branch of the vcs repository", + "x-example": "0.7.x" + }, "providerBranchUrl": { "type": "string", "description": "The branch of the vcs repository", @@ -40497,12 +40497,12 @@ "providerRepositoryName", "providerRepositoryOwner", "providerRepositoryUrl", - "providerBranch", "providerCommitHash", "providerCommitAuthorUrl", "providerCommitAuthor", "providerCommitMessage", "providerCommitUrl", + "providerBranch", "providerBranchUrl" ], "example": { @@ -40526,12 +40526,12 @@ "providerRepositoryName": "database", "providerRepositoryOwner": "utopia", "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", - "providerBranch": "0.7.x", "providerCommitHash": "7c3f25d", "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", "providerCommitAuthor": "Khushboo Verma", "providerCommitMessage": "Update index.js", "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranch": "0.7.x", "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" } }, @@ -40607,7 +40607,7 @@ }, "requestHeaders": { "type": "array", - "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "description": "HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", "items": { "type": "object", "$ref": "#\/definitions\/headers" diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 61428740c1..c2628533d0 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -11422,7 +11422,7 @@ }, "requestHeaders": { "type": "array", - "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "description": "HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", "items": { "type": "object", "$ref": "#\/definitions\/headers" diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index cd6c104c6e..0f91a5433d 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -52272,11 +52272,6 @@ "description": "The url of the vcs provider repository", "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function" }, - "providerBranch": { - "type": "string", - "description": "The branch of the vcs repository", - "x-example": "0.7.x" - }, "providerCommitHash": { "type": "string", "description": "The commit hash of the vcs commit", @@ -52302,6 +52297,11 @@ "description": "The url of the vcs commit", "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb" }, + "providerBranch": { + "type": "string", + "description": "The branch of the vcs repository", + "x-example": "0.7.x" + }, "providerBranchUrl": { "type": "string", "description": "The branch of the vcs repository", @@ -52329,12 +52329,12 @@ "providerRepositoryName", "providerRepositoryOwner", "providerRepositoryUrl", - "providerBranch", "providerCommitHash", "providerCommitAuthorUrl", "providerCommitAuthor", "providerCommitMessage", "providerCommitUrl", + "providerBranch", "providerBranchUrl" ], "example": { @@ -52358,12 +52358,12 @@ "providerRepositoryName": "database", "providerRepositoryOwner": "utopia", "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", - "providerBranch": "0.7.x", "providerCommitHash": "7c3f25d", "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", "providerCommitAuthor": "Khushboo Verma", "providerCommitMessage": "Update index.js", "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranch": "0.7.x", "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" } }, @@ -52439,7 +52439,7 @@ }, "requestHeaders": { "type": "array", - "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "description": "HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", "items": { "type": "object", "$ref": "#\/definitions\/headers" @@ -53408,7 +53408,7 @@ "hostname": { "type": "string", "description": "Web app hostname. Empty string for other platforms.", - "x-example": true + "x-example": "app.example.com" }, "httpUser": { "type": "string", @@ -53441,7 +53441,7 @@ "type": "web", "key": "com.company.appname", "store": "", - "hostname": true, + "hostname": "app.example.com", "httpUser": "username", "httpPass": "password" } @@ -56022,7 +56022,7 @@ "deploymentVcsProviderBranch": { "type": "string", "description": "Name of Git branch that updates rule. Used if type is \"deployment\"", - "x-example": "function" + "x-example": "main" }, "status": { "type": "string", @@ -56075,7 +56075,7 @@ "deploymentId": "n3u9feiwmf", "deploymentResourceType": "function", "deploymentResourceId": "n3u9feiwmf", - "deploymentVcsProviderBranch": "function", + "deploymentVcsProviderBranch": "main", "status": "verified", "logs": "HTTP challegne failed.", "renewAt": "datetime" diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index f913753279..679da75e5d 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -40440,11 +40440,6 @@ "description": "The url of the vcs provider repository", "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function" }, - "providerBranch": { - "type": "string", - "description": "The branch of the vcs repository", - "x-example": "0.7.x" - }, "providerCommitHash": { "type": "string", "description": "The commit hash of the vcs commit", @@ -40470,6 +40465,11 @@ "description": "The url of the vcs commit", "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb" }, + "providerBranch": { + "type": "string", + "description": "The branch of the vcs repository", + "x-example": "0.7.x" + }, "providerBranchUrl": { "type": "string", "description": "The branch of the vcs repository", @@ -40497,12 +40497,12 @@ "providerRepositoryName", "providerRepositoryOwner", "providerRepositoryUrl", - "providerBranch", "providerCommitHash", "providerCommitAuthorUrl", "providerCommitAuthor", "providerCommitMessage", "providerCommitUrl", + "providerBranch", "providerBranchUrl" ], "example": { @@ -40526,12 +40526,12 @@ "providerRepositoryName": "database", "providerRepositoryOwner": "utopia", "providerRepositoryUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function", - "providerBranch": "0.7.x", "providerCommitHash": "7c3f25d", "providerCommitAuthorUrl": "https:\/\/github.com\/vermakhushboo", "providerCommitAuthor": "Khushboo Verma", "providerCommitMessage": "Update index.js", "providerCommitUrl": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb", + "providerBranch": "0.7.x", "providerBranchUrl": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" } }, @@ -40607,7 +40607,7 @@ }, "requestHeaders": { "type": "array", - "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "description": "HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", "items": { "type": "object", "$ref": "#\/definitions\/headers" diff --git a/src/Appwrite/Utopia/Response/Model/Deployment.php b/src/Appwrite/Utopia/Response/Model/Deployment.php index 45699f65d1..f0815630b3 100644 --- a/src/Appwrite/Utopia/Response/Model/Deployment.php +++ b/src/Appwrite/Utopia/Response/Model/Deployment.php @@ -131,12 +131,6 @@ class Deployment extends Model 'default' => '', 'example' => 'https://github.com/vermakhushboo/g4-node-function', ]) - ->addRule('providerBranch', [ - 'type' => self::TYPE_STRING, - 'description' => 'The branch name of the vcs provider repository', - 'default' => '', - 'example' => 'main', - ]) ->addRule('providerCommitHash', [ 'type' => self::TYPE_STRING, 'description' => 'The commit hash of the vcs commit', diff --git a/src/Appwrite/Utopia/Response/Model/Execution.php b/src/Appwrite/Utopia/Response/Model/Execution.php index f8e62fe824..f8ee32aa6e 100644 --- a/src/Appwrite/Utopia/Response/Model/Execution.php +++ b/src/Appwrite/Utopia/Response/Model/Execution.php @@ -79,7 +79,7 @@ class Execution extends Model ]) ->addRule('requestHeaders', [ 'type' => Response::MODEL_HEADERS, - 'description' => 'HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.', + 'description' => 'HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.', 'default' => [], 'example' => [['Content-Type' => 'application/json']], 'array' => true, diff --git a/src/Appwrite/Utopia/Response/Model/Platform.php b/src/Appwrite/Utopia/Response/Model/Platform.php index 5fc68ee808..65f3c343d4 100644 --- a/src/Appwrite/Utopia/Response/Model/Platform.php +++ b/src/Appwrite/Utopia/Response/Model/Platform.php @@ -61,7 +61,7 @@ class Platform extends Model 'type' => self::TYPE_STRING, 'description' => 'Web app hostname. Empty string for other platforms.', 'default' => '', - 'example' => true, + 'example' => 'app.example.com', ]) ->addRule('httpUser', [ 'type' => self::TYPE_STRING, diff --git a/src/Appwrite/Utopia/Response/Model/Rule.php b/src/Appwrite/Utopia/Response/Model/Rule.php index 7974bc7f98..d4b8ffd9e7 100644 --- a/src/Appwrite/Utopia/Response/Model/Rule.php +++ b/src/Appwrite/Utopia/Response/Model/Rule.php @@ -55,7 +55,7 @@ class Rule extends Model ->addRule('redirectStatusCode', [ 'type' => self::TYPE_INTEGER, 'description' => 'Status code to apply during redirect. Used if type is "redirect"', - 'default' => '', + 'default' => 301, 'example' => 301, ]) ->addRule('deploymentId', [ @@ -81,7 +81,7 @@ class Rule extends Model 'type' => self::TYPE_STRING, 'description' => 'Name of Git branch that updates rule. Used if type is "deployment"', 'default' => '', - 'example' => 'function', + 'example' => 'main', ]) ->addRule('status', [ 'type' => self::TYPE_ENUM, From 1f9bc650de2cdd2c8f17f0f6a0b841c9456839c0 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 15 Sep 2025 12:13:48 +0530 Subject: [PATCH 06/17] work in progress --- src/Appwrite/GraphQL/Types/Mapper.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Appwrite/GraphQL/Types/Mapper.php b/src/Appwrite/GraphQL/Types/Mapper.php index 22a2c91d7e..c6df475480 100644 --- a/src/Appwrite/GraphQL/Types/Mapper.php +++ b/src/Appwrite/GraphQL/Types/Mapper.php @@ -216,7 +216,7 @@ class Mapper if (\is_array($rule['type'])) { $type = self::getUnionType($escapedKey, $rule); } elseif ($rule['type'] === 'enum' && !empty($rule['enum'])) { - $type = self::createEnumType($rule, $escapedKey); + $type = self::getEnumType($escapedKey, $rule); } else { $type = self::getObjectType($rule); } @@ -391,9 +391,9 @@ class Mapper return $type; } - private static function createEnumType(array $rule, string $fieldName): Type + private static function getEnumType(string $name, array $rule): Type { - $enumTypeName = \ucfirst($fieldName) . 'Enum'; + $enumTypeName = \ucfirst($name) . 'Enum'; if (Registry::has($enumTypeName)) { return Registry::get($enumTypeName); From 31ed7264099c29dbb3c2646f12940a1b8dcc59c5 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 16 Sep 2025 09:48:17 +0530 Subject: [PATCH 07/17] keep graphql backwards --- src/Appwrite/GraphQL/Types/Mapper.php | 29 +-------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/src/Appwrite/GraphQL/Types/Mapper.php b/src/Appwrite/GraphQL/Types/Mapper.php index c6df475480..b74e2a7549 100644 --- a/src/Appwrite/GraphQL/Types/Mapper.php +++ b/src/Appwrite/GraphQL/Types/Mapper.php @@ -6,7 +6,6 @@ use Appwrite\GraphQL\Resolvers; use Appwrite\GraphQL\Types; use Appwrite\SDK\Method; use Exception; -use GraphQL\Type\Definition\EnumType; use GraphQL\Type\Definition\ObjectType; use GraphQL\Type\Definition\Type; use GraphQL\Type\Definition\UnionType; @@ -215,8 +214,6 @@ class Mapper if (\is_array($rule['type'])) { $type = self::getUnionType($escapedKey, $rule); - } elseif ($rule['type'] === 'enum' && !empty($rule['enum'])) { - $type = self::getEnumType($escapedKey, $rule); } else { $type = self::getObjectType($rule); } @@ -391,30 +388,6 @@ class Mapper return $type; } - private static function getEnumType(string $name, array $rule): Type - { - $enumTypeName = \ucfirst($name) . 'Enum'; - - if (Registry::has($enumTypeName)) { - return Registry::get($enumTypeName); - } - - $values = []; - foreach ($rule['enum'] as $enumValue) { - $values[\strtoupper(\str_replace(['-', ' ', '.'], '_', $enumValue))] = [ - 'value' => $enumValue - ]; - } - - $enumType = new EnumType([ - 'name' => $enumTypeName, - 'values' => $values - ]); - - Registry::set($enumTypeName, $enumType); - return $enumType; - } - private static function getObjectType(array $rule): Type { $type = $rule['type']; @@ -480,6 +453,7 @@ class Mapper 'ip' => static::model("{$prefix}Ip"), default => static::model("{$prefix}String"), }, + 'enum' => static::model("{$prefix}String"), // TODO: Add enum type (breaking change if added) 'integer' => static::model("{$prefix}Integer"), 'double' => static::model("{$prefix}Float"), 'boolean' => static::model("{$prefix}Boolean"), @@ -488,7 +462,6 @@ class Mapper 'point' => static::model("{$prefix}Point"), 'linestring' => static::model("{$prefix}Line"), 'polygon' => static::model("{$prefix}Polygon"), - 'enum' => static::model("{$prefix}Enum"), default => throw new Exception('Unknown ' . strtolower($prefix) . ' implementation'), }; } From 427c891e0fa28bc822cd3cfab8de41307d0e33fb Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 18 Sep 2025 10:13:23 +0530 Subject: [PATCH 08/17] update cli to 10.0.0 --- app/config/platforms.php | 2 +- composer.lock | 12 ++++++------ docs/sdks/cli/CHANGELOG.md | 9 +++++++++ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/app/config/platforms.php b/app/config/platforms.php index 7623bb896e..7aec82d1cf 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -226,7 +226,7 @@ return [ [ 'key' => 'cli', 'name' => 'Command Line', - 'version' => '9.1.0', + 'version' => '10.0.0', 'url' => 'https://github.com/appwrite/sdk-for-cli', 'package' => 'https://www.npmjs.com/package/appwrite-cli', 'enabled' => true, diff --git a/composer.lock b/composer.lock index d8c17fbc91..b31d0f78bd 100644 --- a/composer.lock +++ b/composer.lock @@ -5004,16 +5004,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "1.3.4", + "version": "1.3.5", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "d3b420dced42f1eec1f6d0aa98b7bbf8de4042ac" + "reference": "6fda9e58b37c9872c1a2a424e5467de8de1bc567" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/d3b420dced42f1eec1f6d0aa98b7bbf8de4042ac", - "reference": "d3b420dced42f1eec1f6d0aa98b7bbf8de4042ac", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/6fda9e58b37c9872c1a2a424e5467de8de1bc567", + "reference": "6fda9e58b37c9872c1a2a424e5467de8de1bc567", "shasum": "" }, "require": { @@ -5049,9 +5049,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.3.4" + "source": "https://github.com/appwrite/sdk-generator/tree/1.3.5" }, - "time": "2025-09-08T11:56:04+00:00" + "time": "2025-09-15T04:19:40+00:00" }, { "name": "doctrine/annotations", diff --git a/docs/sdks/cli/CHANGELOG.md b/docs/sdks/cli/CHANGELOG.md index 8964d059a9..000a7e0938 100644 --- a/docs/sdks/cli/CHANGELOG.md +++ b/docs/sdks/cli/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## 10.0.0 + +* **Breaking:** Removed Avatars CLI command and all related subcommands; corresponding examples deleted +* **Feat:** Geo defaults now accept coordinate arrays for Databases and Tables DB, with automatic normalization +* **Feat:** Pull command skips deprecated resources by default and shows clearer totals/messages +* **Feat:** Updated CLI descriptions: Databases marked legacy; added tables-db, projects, and project +* Fix TypeScript type generation now quotes invalid property names to produce valid typings +* Update documentation: Removed Avatars CLI examples and updated help text to reflect new geo defaults and terminology + ## 8.3.0 * **Feat:** Add support for `appwrite.config.json` file From 3e8211d6bd199cd731b0a637b6b5a9fe9beb000b Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Sat, 20 Sep 2025 19:45:44 +0530 Subject: [PATCH 09/17] refactor: improve code readability for schedules --- app/controllers/api/messaging.php | 13 +++++++------ src/Appwrite/Migration/Version/V19.php | 5 +++-- .../Modules/Functions/Http/Functions/Create.php | 3 ++- src/Appwrite/Platform/Tasks/ScheduleExecutions.php | 6 ++++++ src/Appwrite/Platform/Tasks/ScheduleFunctions.php | 7 ++++++- 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/app/controllers/api/messaging.php b/app/controllers/api/messaging.php index d22c5cb2c2..bde93305dd 100644 --- a/app/controllers/api/messaging.php +++ b/app/controllers/api/messaging.php @@ -10,6 +10,7 @@ use Appwrite\Extend\Exception; use Appwrite\Messaging\Status as MessageStatus; use Appwrite\Network\Validator\Email; use Appwrite\Permission; +use Appwrite\Platform\Tasks\ScheduleMessages; use Appwrite\Role; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; @@ -3102,7 +3103,7 @@ App::post('/v1/messaging/messages/email') case MessageStatus::SCHEDULED: $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => 'message', + 'resourceType' => ScheduleMessages::getSupportedResource(), 'resourceId' => $message->getId(), 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), @@ -3244,7 +3245,7 @@ App::post('/v1/messaging/messages/sms') case MessageStatus::SCHEDULED: $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => 'message', + 'resourceType' => ScheduleMessages::getSupportedResource(), 'resourceId' => $message->getId(), 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), @@ -3462,7 +3463,7 @@ App::post('/v1/messaging/messages/push') case MessageStatus::SCHEDULED: $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => 'message', + 'resourceType' => ScheduleMessages::getSupportedResource(), 'resourceId' => $message->getId(), 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), @@ -3863,7 +3864,7 @@ App::patch('/v1/messaging/messages/email/:messageId') if (\is_null($currentScheduledAt) && !\is_null($scheduledAt)) { $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => 'message', + 'resourceType' => ScheduleMessages::getSupportedResource(), 'resourceId' => $message->getId(), 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), @@ -4084,7 +4085,7 @@ App::patch('/v1/messaging/messages/sms/:messageId') if (\is_null($currentScheduledAt) && !\is_null($scheduledAt)) { $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => 'message', + 'resourceType' => ScheduleMessages::getSupportedResource(), 'resourceId' => $message->getId(), 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), @@ -4258,7 +4259,7 @@ App::patch('/v1/messaging/messages/push/:messageId') if (\is_null($currentScheduledAt) && !\is_null($scheduledAt)) { $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => 'message', + 'resourceType' => ScheduleMessages::getSupportedResource(), 'resourceId' => $message->getId(), 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), diff --git a/src/Appwrite/Migration/Version/V19.php b/src/Appwrite/Migration/Version/V19.php index d4dda02d75..790a2fdfb7 100644 --- a/src/Appwrite/Migration/Version/V19.php +++ b/src/Appwrite/Migration/Version/V19.php @@ -3,6 +3,7 @@ namespace Appwrite\Migration\Version; use Appwrite\Migration\Migration; +use Appwrite\Platform\Tasks\ScheduleFunctions; use Utopia\CLI\Console; use Utopia\Config\Config; use Utopia\Database\Database; @@ -730,8 +731,8 @@ class V19 extends Migration if (empty($document->getAttribute('scheduleId', null))) { $schedule = $this->dbForPlatform->createDocument('schedules', new Document([ - 'region' => $project->getAttribute('region'), - 'resourceType' => 'function', + 'region' => $this->project->getAttribute('region'), + 'resourceType' => ScheduleFunctions::getSupportedResource(), 'resourceId' => $document->getId(), 'resourceInternalId' => $document->getSequence(), 'resourceUpdatedAt' => DateTime::now(), diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php index 21a74f9a81..ccf5abc373 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php @@ -11,6 +11,7 @@ use Appwrite\Event\Webhook; use Appwrite\Extend\Exception; use Appwrite\Platform\Modules\Compute\Base; use Appwrite\Platform\Modules\Compute\Validator\Specification; +use Appwrite\Platform\Tasks\ScheduleFunctions; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; @@ -235,7 +236,7 @@ class Create extends Base $schedule = Authorization::skip( fn () => $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => 'function', + 'resourceType' => ScheduleFunctions::getSupportedResource(), 'resourceId' => $function->getId(), 'resourceInternalId' => $function->getSequence(), 'resourceUpdatedAt' => DateTime::now(), diff --git a/src/Appwrite/Platform/Tasks/ScheduleExecutions.php b/src/Appwrite/Platform/Tasks/ScheduleExecutions.php index 14a4259e17..438341ad47 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleExecutions.php +++ b/src/Appwrite/Platform/Tasks/ScheduleExecutions.php @@ -6,6 +6,12 @@ use Appwrite\Event\Func; use Swoole\Coroutine as Co; use Utopia\Database\Database; +/** + * ScheduleExecutions + * + * Handles delayed executions by processing one-time scheduled tasks + * that are executed at a specific future time. + */ class ScheduleExecutions extends ScheduleBase { public const UPDATE_TIMER = 3; // seconds diff --git a/src/Appwrite/Platform/Tasks/ScheduleFunctions.php b/src/Appwrite/Platform/Tasks/ScheduleFunctions.php index 6f072425e4..090adcbccf 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleFunctions.php +++ b/src/Appwrite/Platform/Tasks/ScheduleFunctions.php @@ -7,8 +7,13 @@ use Cron\CronExpression; use Utopia\CLI\Console; use Utopia\Database\Database; use Utopia\Database\DateTime; -use Utopia\Pools\Group; +/** + * ScheduleFunctions + * + * Handles cron job related executions by processing cron expressions + * and scheduling function executions based on recurring schedules. + */ class ScheduleFunctions extends ScheduleBase { public const UPDATE_TIMER = 10; // seconds From f09d5258ece14f4b3c9cf3ab9d0c82947269b47d Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 22 Sep 2025 14:20:58 +0530 Subject: [PATCH 10/17] use constants --- app/init/constants.php | 10 ++++++++++ src/Appwrite/Platform/Tasks/ScheduleExecutions.php | 4 ++-- src/Appwrite/Platform/Tasks/ScheduleFunctions.php | 4 ++-- src/Appwrite/Platform/Tasks/ScheduleMessages.php | 4 ++-- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/app/init/constants.php b/app/init/constants.php index 28cf8a4052..2c94041276 100644 --- a/app/init/constants.php +++ b/app/init/constants.php @@ -279,3 +279,13 @@ const TOKENS_RESOURCE_TYPE_FILES = 'files'; const TOKENS_RESOURCE_TYPE_SITES = 'sites'; const TOKENS_RESOURCE_TYPE_FUNCTIONS = 'functions'; const TOKENS_RESOURCE_TYPE_DATABASES = 'databases'; + +// schedules types +const SCHEDULE_TYPE_EXECUTION = 'execution'; +const SCHEDULE_TYPE_FUNCTION = 'function'; +const SCHEDULE_TYPE_MESSAGE = 'message'; + +// collections types +const COLLECTION_TYPE_EXECUTIONS = 'executions'; +const COLLECTION_TYPE_FUNCTIONS = 'functions'; +const COLLECTION_TYPE_MESSAGES = 'messages'; diff --git a/src/Appwrite/Platform/Tasks/ScheduleExecutions.php b/src/Appwrite/Platform/Tasks/ScheduleExecutions.php index 438341ad47..77cc056280 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleExecutions.php +++ b/src/Appwrite/Platform/Tasks/ScheduleExecutions.php @@ -24,12 +24,12 @@ class ScheduleExecutions extends ScheduleBase public static function getSupportedResource(): string { - return 'execution'; + return SCHEDULE_TYPE_EXECUTION; } public static function getCollectionId(): string { - return 'executions'; + return COLLECTION_TYPE_EXECUTIONS; } protected function enqueueResources(Database $dbForPlatform, callable $getProjectDB): void diff --git a/src/Appwrite/Platform/Tasks/ScheduleFunctions.php b/src/Appwrite/Platform/Tasks/ScheduleFunctions.php index 090adcbccf..09c7296f93 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleFunctions.php +++ b/src/Appwrite/Platform/Tasks/ScheduleFunctions.php @@ -28,12 +28,12 @@ class ScheduleFunctions extends ScheduleBase public static function getSupportedResource(): string { - return 'function'; + return SCHEDULE_TYPE_FUNCTION; } public static function getCollectionId(): string { - return 'functions'; + return COLLECTION_TYPE_FUNCTIONS; } protected function enqueueResources(Database $dbForPlatform, callable $getProjectDB): void diff --git a/src/Appwrite/Platform/Tasks/ScheduleMessages.php b/src/Appwrite/Platform/Tasks/ScheduleMessages.php index fe4afbe69c..87e5ba5730 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleMessages.php +++ b/src/Appwrite/Platform/Tasks/ScheduleMessages.php @@ -17,12 +17,12 @@ class ScheduleMessages extends ScheduleBase public static function getSupportedResource(): string { - return 'message'; + return SCHEDULE_TYPE_MESSAGE; } public static function getCollectionId(): string { - return 'messages'; + return COLLECTION_TYPE_MESSAGES; } protected function enqueueResources(Database $dbForPlatform, callable $getProjectDB): void From c52081dbed972c20686f343f7eb96d9d545dbb94 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 22 Sep 2025 19:58:18 +0530 Subject: [PATCH 11/17] fix: to use correct pattern --- app/init/constants.php | 15 ++++----------- .../Platform/Tasks/ScheduleExecutions.php | 4 ++-- src/Appwrite/Platform/Tasks/ScheduleFunctions.php | 4 ++-- src/Appwrite/Platform/Tasks/ScheduleMessages.php | 4 ++-- 4 files changed, 10 insertions(+), 17 deletions(-) diff --git a/app/init/constants.php b/app/init/constants.php index 2c94041276..5c75dc4ce2 100644 --- a/app/init/constants.php +++ b/app/init/constants.php @@ -262,7 +262,6 @@ const METRIC_SITES_ID_INBOUND = 'sites.{siteInternalId}.inbound'; const METRIC_SITES_ID_OUTBOUND = 'sites.{siteInternalId}.outbound'; // Resource types - const RESOURCE_TYPE_PROJECTS = 'projects'; const RESOURCE_TYPE_FUNCTIONS = 'functions'; const RESOURCE_TYPE_SITES = 'sites'; @@ -274,18 +273,12 @@ const RESOURCE_TYPE_SUBSCRIBERS = 'subscribers'; const RESOURCE_TYPE_MESSAGES = 'messages'; // Resource types for Tokens - const TOKENS_RESOURCE_TYPE_FILES = 'files'; const TOKENS_RESOURCE_TYPE_SITES = 'sites'; const TOKENS_RESOURCE_TYPE_FUNCTIONS = 'functions'; const TOKENS_RESOURCE_TYPE_DATABASES = 'databases'; -// schedules types -const SCHEDULE_TYPE_EXECUTION = 'execution'; -const SCHEDULE_TYPE_FUNCTION = 'function'; -const SCHEDULE_TYPE_MESSAGE = 'message'; - -// collections types -const COLLECTION_TYPE_EXECUTIONS = 'executions'; -const COLLECTION_TYPE_FUNCTIONS = 'functions'; -const COLLECTION_TYPE_MESSAGES = 'messages'; +// Resource types for Schedules +const SCHEDULE_RESOURCE_TYPE_EXECUTION = 'execution'; +const SCHEDULE_RESOURCE_TYPE_FUNCTION = 'function'; +const SCHEDULE_RESOURCE_TYPE_MESSAGE = 'message'; diff --git a/src/Appwrite/Platform/Tasks/ScheduleExecutions.php b/src/Appwrite/Platform/Tasks/ScheduleExecutions.php index 77cc056280..83a3f51b03 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleExecutions.php +++ b/src/Appwrite/Platform/Tasks/ScheduleExecutions.php @@ -24,12 +24,12 @@ class ScheduleExecutions extends ScheduleBase public static function getSupportedResource(): string { - return SCHEDULE_TYPE_EXECUTION; + return SCHEDULE_RESOURCE_TYPE_EXECUTION; } public static function getCollectionId(): string { - return COLLECTION_TYPE_EXECUTIONS; + return RESOURCE_TYPE_EXECUTIONS; } protected function enqueueResources(Database $dbForPlatform, callable $getProjectDB): void diff --git a/src/Appwrite/Platform/Tasks/ScheduleFunctions.php b/src/Appwrite/Platform/Tasks/ScheduleFunctions.php index 09c7296f93..7fda2f75df 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleFunctions.php +++ b/src/Appwrite/Platform/Tasks/ScheduleFunctions.php @@ -28,12 +28,12 @@ class ScheduleFunctions extends ScheduleBase public static function getSupportedResource(): string { - return SCHEDULE_TYPE_FUNCTION; + return SCHEDULE_RESOURCE_TYPE_FUNCTION; } public static function getCollectionId(): string { - return COLLECTION_TYPE_FUNCTIONS; + return RESOURCE_TYPE_FUNCTIONS; } protected function enqueueResources(Database $dbForPlatform, callable $getProjectDB): void diff --git a/src/Appwrite/Platform/Tasks/ScheduleMessages.php b/src/Appwrite/Platform/Tasks/ScheduleMessages.php index 87e5ba5730..57f6dd8002 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleMessages.php +++ b/src/Appwrite/Platform/Tasks/ScheduleMessages.php @@ -17,12 +17,12 @@ class ScheduleMessages extends ScheduleBase public static function getSupportedResource(): string { - return SCHEDULE_TYPE_MESSAGE; + return SCHEDULE_RESOURCE_TYPE_MESSAGE; } public static function getCollectionId(): string { - return COLLECTION_TYPE_MESSAGES; + return RESOURCE_TYPE_MESSAGES; } protected function enqueueResources(Database $dbForPlatform, callable $getProjectDB): void From 232b22b71eca4bc7b900b77b854dd539cfaf540d Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 23 Sep 2025 07:35:17 +0530 Subject: [PATCH 12/17] use constants --- app/controllers/api/messaging.php | 13 ++++++------- app/init/constants.php | 1 + src/Appwrite/Migration/Version/V19.php | 3 +-- .../Modules/Functions/Http/Executions/Create.php | 3 +-- .../Modules/Functions/Http/Executions/Delete.php | 3 +-- .../Modules/Functions/Http/Functions/Create.php | 3 +-- 6 files changed, 11 insertions(+), 15 deletions(-) diff --git a/app/controllers/api/messaging.php b/app/controllers/api/messaging.php index bde93305dd..fd1a92e364 100644 --- a/app/controllers/api/messaging.php +++ b/app/controllers/api/messaging.php @@ -10,7 +10,6 @@ use Appwrite\Extend\Exception; use Appwrite\Messaging\Status as MessageStatus; use Appwrite\Network\Validator\Email; use Appwrite\Permission; -use Appwrite\Platform\Tasks\ScheduleMessages; use Appwrite\Role; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; @@ -3103,7 +3102,7 @@ App::post('/v1/messaging/messages/email') case MessageStatus::SCHEDULED: $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => ScheduleMessages::getSupportedResource(), + 'resourceType' => RESOURCE_TYPE_MESSAGES, 'resourceId' => $message->getId(), 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), @@ -3245,7 +3244,7 @@ App::post('/v1/messaging/messages/sms') case MessageStatus::SCHEDULED: $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => ScheduleMessages::getSupportedResource(), + 'resourceType' => RESOURCE_TYPE_MESSAGES, 'resourceId' => $message->getId(), 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), @@ -3463,7 +3462,7 @@ App::post('/v1/messaging/messages/push') case MessageStatus::SCHEDULED: $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => ScheduleMessages::getSupportedResource(), + 'resourceType' => RESOURCE_TYPE_MESSAGES, 'resourceId' => $message->getId(), 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), @@ -3864,7 +3863,7 @@ App::patch('/v1/messaging/messages/email/:messageId') if (\is_null($currentScheduledAt) && !\is_null($scheduledAt)) { $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => ScheduleMessages::getSupportedResource(), + 'resourceType' => RESOURCE_TYPE_MESSAGES, 'resourceId' => $message->getId(), 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), @@ -4085,7 +4084,7 @@ App::patch('/v1/messaging/messages/sms/:messageId') if (\is_null($currentScheduledAt) && !\is_null($scheduledAt)) { $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => ScheduleMessages::getSupportedResource(), + 'resourceType' => RESOURCE_TYPE_MESSAGES, 'resourceId' => $message->getId(), 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), @@ -4259,7 +4258,7 @@ App::patch('/v1/messaging/messages/push/:messageId') if (\is_null($currentScheduledAt) && !\is_null($scheduledAt)) { $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => ScheduleMessages::getSupportedResource(), + 'resourceType' => RESOURCE_TYPE_MESSAGES, 'resourceId' => $message->getId(), 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), diff --git a/app/init/constants.php b/app/init/constants.php index 5c75dc4ce2..74f04f25e9 100644 --- a/app/init/constants.php +++ b/app/init/constants.php @@ -271,6 +271,7 @@ const RESOURCE_TYPE_PROVIDERS = 'providers'; const RESOURCE_TYPE_TOPICS = 'topics'; const RESOURCE_TYPE_SUBSCRIBERS = 'subscribers'; const RESOURCE_TYPE_MESSAGES = 'messages'; +const RESOURCE_TYPE_EXECUTIONS = 'executions'; // Resource types for Tokens const TOKENS_RESOURCE_TYPE_FILES = 'files'; diff --git a/src/Appwrite/Migration/Version/V19.php b/src/Appwrite/Migration/Version/V19.php index 790a2fdfb7..f5892f07bd 100644 --- a/src/Appwrite/Migration/Version/V19.php +++ b/src/Appwrite/Migration/Version/V19.php @@ -3,7 +3,6 @@ namespace Appwrite\Migration\Version; use Appwrite\Migration\Migration; -use Appwrite\Platform\Tasks\ScheduleFunctions; use Utopia\CLI\Console; use Utopia\Config\Config; use Utopia\Database\Database; @@ -732,7 +731,7 @@ class V19 extends Migration if (empty($document->getAttribute('scheduleId', null))) { $schedule = $this->dbForPlatform->createDocument('schedules', new Document([ 'region' => $this->project->getAttribute('region'), - 'resourceType' => ScheduleFunctions::getSupportedResource(), + 'resourceType' => RESOURCE_TYPE_FUNCTIONS, 'resourceId' => $document->getId(), 'resourceInternalId' => $document->getSequence(), 'resourceUpdatedAt' => DateTime::now(), diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Executions/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Executions/Create.php index 1603e8f997..69af3b7d04 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Executions/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Executions/Create.php @@ -11,7 +11,6 @@ use Appwrite\Extend\Exception; use Appwrite\Extend\Exception as AppwriteException; use Appwrite\Functions\Validator\Headers; use Appwrite\Platform\Modules\Compute\Base; -use Appwrite\Platform\Tasks\ScheduleExecutions; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; @@ -313,7 +312,7 @@ class Create extends Base $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => ScheduleExecutions::getSupportedResource(), + 'resourceType' => SCHEDULE_RESOURCE_TYPE_EXECUTION, 'resourceId' => $execution->getId(), 'resourceInternalId' => $execution->getSequence(), 'resourceUpdatedAt' => DateTime::now(), diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Executions/Delete.php b/src/Appwrite/Platform/Modules/Functions/Http/Executions/Delete.php index 9c818cfacc..666cb8310c 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Executions/Delete.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Executions/Delete.php @@ -5,7 +5,6 @@ namespace Appwrite\Platform\Modules\Functions\Http\Executions; use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\Platform\Modules\Compute\Base; -use Appwrite\Platform\Tasks\ScheduleExecutions; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; @@ -100,7 +99,7 @@ class Delete extends Base if ($status === 'scheduled') { $schedule = $dbForPlatform->findOne('schedules', [ Query::equal('resourceId', [$execution->getId()]), - Query::equal('resourceType', [ScheduleExecutions::getSupportedResource()]), + Query::equal('resourceType', [SCHEDULE_RESOURCE_TYPE_EXECUTION]), Query::equal('active', [true]), ]); diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php index ccf5abc373..13444634fb 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php @@ -11,7 +11,6 @@ use Appwrite\Event\Webhook; use Appwrite\Extend\Exception; use Appwrite\Platform\Modules\Compute\Base; use Appwrite\Platform\Modules\Compute\Validator\Specification; -use Appwrite\Platform\Tasks\ScheduleFunctions; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; @@ -236,7 +235,7 @@ class Create extends Base $schedule = Authorization::skip( fn () => $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => ScheduleFunctions::getSupportedResource(), + 'resourceType' => RESOURCE_TYPE_FUNCTIONS, 'resourceId' => $function->getId(), 'resourceInternalId' => $function->getSequence(), 'resourceUpdatedAt' => DateTime::now(), From 734d2ce51240845abafe0e536f538a81a6ec164b Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 23 Sep 2025 07:49:07 +0530 Subject: [PATCH 13/17] fix: use correct constant --- app/controllers/api/messaging.php | 12 ++++++------ src/Appwrite/Migration/Version/V19.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/controllers/api/messaging.php b/app/controllers/api/messaging.php index fd1a92e364..dbc384f3c4 100644 --- a/app/controllers/api/messaging.php +++ b/app/controllers/api/messaging.php @@ -3102,7 +3102,7 @@ App::post('/v1/messaging/messages/email') case MessageStatus::SCHEDULED: $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => RESOURCE_TYPE_MESSAGES, + 'resourceType' => SCHEDULE_RESOURCE_TYPE_MESSAGE, 'resourceId' => $message->getId(), 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), @@ -3244,7 +3244,7 @@ App::post('/v1/messaging/messages/sms') case MessageStatus::SCHEDULED: $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => RESOURCE_TYPE_MESSAGES, + 'resourceType' => SCHEDULE_RESOURCE_TYPE_MESSAGE, 'resourceId' => $message->getId(), 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), @@ -3462,7 +3462,7 @@ App::post('/v1/messaging/messages/push') case MessageStatus::SCHEDULED: $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => RESOURCE_TYPE_MESSAGES, + 'resourceType' => SCHEDULE_RESOURCE_TYPE_MESSAGE, 'resourceId' => $message->getId(), 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), @@ -3863,7 +3863,7 @@ App::patch('/v1/messaging/messages/email/:messageId') if (\is_null($currentScheduledAt) && !\is_null($scheduledAt)) { $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => RESOURCE_TYPE_MESSAGES, + 'resourceType' => SCHEDULE_RESOURCE_TYPE_MESSAGE, 'resourceId' => $message->getId(), 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), @@ -4084,7 +4084,7 @@ App::patch('/v1/messaging/messages/sms/:messageId') if (\is_null($currentScheduledAt) && !\is_null($scheduledAt)) { $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => RESOURCE_TYPE_MESSAGES, + 'resourceType' => SCHEDULE_RESOURCE_TYPE_MESSAGE, 'resourceId' => $message->getId(), 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), @@ -4258,7 +4258,7 @@ App::patch('/v1/messaging/messages/push/:messageId') if (\is_null($currentScheduledAt) && !\is_null($scheduledAt)) { $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => RESOURCE_TYPE_MESSAGES, + 'resourceType' => SCHEDULE_RESOURCE_TYPE_MESSAGE, 'resourceId' => $message->getId(), 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), diff --git a/src/Appwrite/Migration/Version/V19.php b/src/Appwrite/Migration/Version/V19.php index f5892f07bd..f5cf84c95e 100644 --- a/src/Appwrite/Migration/Version/V19.php +++ b/src/Appwrite/Migration/Version/V19.php @@ -731,7 +731,7 @@ class V19 extends Migration if (empty($document->getAttribute('scheduleId', null))) { $schedule = $this->dbForPlatform->createDocument('schedules', new Document([ 'region' => $this->project->getAttribute('region'), - 'resourceType' => RESOURCE_TYPE_FUNCTIONS, + 'resourceType' => SCHEDULE_RESOURCE_TYPE_FUNCTION, 'resourceId' => $document->getId(), 'resourceInternalId' => $document->getSequence(), 'resourceUpdatedAt' => DateTime::now(), From 421ec6f3f8c72eb528aecacae39be1556e16c763 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 23 Sep 2025 07:49:55 +0530 Subject: [PATCH 14/17] fix: use correct constant --- .../Platform/Modules/Functions/Http/Functions/Create.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php index 13444634fb..b00a2ad2bf 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php @@ -235,7 +235,7 @@ class Create extends Base $schedule = Authorization::skip( fn () => $dbForPlatform->createDocument('schedules', new Document([ 'region' => $project->getAttribute('region'), - 'resourceType' => RESOURCE_TYPE_FUNCTIONS, + 'resourceType' => SCHEDULE_RESOURCE_TYPE_FUNCTION, 'resourceId' => $function->getId(), 'resourceInternalId' => $function->getSequence(), 'resourceUpdatedAt' => DateTime::now(), From 84a4ef0bafe46163b5807db0781779e0eead6f00 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 23 Sep 2025 10:47:39 +0530 Subject: [PATCH 15/17] chore: include response model enum names --- app/config/specs/open-api3-1.8.x-console.json | 39 +++++--- app/config/specs/open-api3-1.8.x-server.json | 39 +++++--- .../specs/open-api3-latest-console.json | 39 +++++--- app/config/specs/open-api3-latest-server.json | 39 +++++--- app/config/specs/swagger2-1.8.x-console.json | 39 +++++--- app/config/specs/swagger2-1.8.x-server.json | 39 +++++--- app/config/specs/swagger2-latest-console.json | 39 +++++--- app/config/specs/swagger2-latest-server.json | 39 +++++--- src/Appwrite/SDK/Specification/Format.php | 89 ++++++++++++++++++- .../SDK/Specification/Format/OpenAPI3.php | 14 ++- .../SDK/Specification/Format/Swagger2.php | 14 ++- 11 files changed, 319 insertions(+), 110 deletions(-) diff --git a/app/config/specs/open-api3-1.8.x-console.json b/app/config/specs/open-api3-1.8.x-console.json index 1dd58c3261..d75265f552 100644 --- a/app/config/specs/open-api3-1.8.x-console.json +++ b/app/config/specs/open-api3-1.8.x-console.json @@ -46468,7 +46468,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -46563,7 +46564,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -46660,7 +46662,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -46757,7 +46760,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -46837,7 +46841,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -46924,7 +46929,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -47021,7 +47027,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -47108,7 +47115,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -47195,7 +47203,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -47282,7 +47291,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -47397,7 +47407,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -47483,7 +47494,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -47581,7 +47593,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", diff --git a/app/config/specs/open-api3-1.8.x-server.json b/app/config/specs/open-api3-1.8.x-server.json index b437d56bfc..3cb3f01ace 100644 --- a/app/config/specs/open-api3-1.8.x-server.json +++ b/app/config/specs/open-api3-1.8.x-server.json @@ -35338,7 +35338,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -35433,7 +35434,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -35530,7 +35532,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -35627,7 +35630,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -35707,7 +35711,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -35794,7 +35799,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -35891,7 +35897,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -35978,7 +35985,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36065,7 +36073,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36152,7 +36161,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36267,7 +36277,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36353,7 +36364,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36451,7 +36463,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 1dd58c3261..d75265f552 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -46468,7 +46468,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -46563,7 +46564,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -46660,7 +46662,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -46757,7 +46760,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -46837,7 +46841,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -46924,7 +46929,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -47021,7 +47027,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -47108,7 +47115,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -47195,7 +47203,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -47282,7 +47291,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -47397,7 +47407,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -47483,7 +47494,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -47581,7 +47593,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index b437d56bfc..3cb3f01ace 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -35338,7 +35338,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -35433,7 +35434,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -35530,7 +35532,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -35627,7 +35630,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -35707,7 +35711,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -35794,7 +35799,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -35891,7 +35897,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -35978,7 +35985,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36065,7 +36073,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36152,7 +36161,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36267,7 +36277,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36353,7 +36364,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36451,7 +36463,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", diff --git a/app/config/specs/swagger2-1.8.x-console.json b/app/config/specs/swagger2-1.8.x-console.json index 0f91a5433d..072da6a403 100644 --- a/app/config/specs/swagger2-1.8.x-console.json +++ b/app/config/specs/swagger2-1.8.x-console.json @@ -46405,7 +46405,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -46500,7 +46501,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -46597,7 +46599,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -46694,7 +46697,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -46774,7 +46778,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -46861,7 +46866,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -46958,7 +46964,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -47045,7 +47052,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -47132,7 +47140,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -47219,7 +47228,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -47334,7 +47344,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -47420,7 +47431,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -47518,7 +47530,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", diff --git a/app/config/specs/swagger2-1.8.x-server.json b/app/config/specs/swagger2-1.8.x-server.json index 679da75e5d..3e997b2341 100644 --- a/app/config/specs/swagger2-1.8.x-server.json +++ b/app/config/specs/swagger2-1.8.x-server.json @@ -35366,7 +35366,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -35461,7 +35462,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -35558,7 +35560,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -35655,7 +35658,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -35735,7 +35739,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -35822,7 +35827,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -35919,7 +35925,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36006,7 +36013,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36093,7 +36101,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36180,7 +36189,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36295,7 +36305,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36381,7 +36392,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36479,7 +36491,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 0f91a5433d..072da6a403 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -46405,7 +46405,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -46500,7 +46501,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -46597,7 +46599,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -46694,7 +46697,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -46774,7 +46778,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -46861,7 +46866,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -46958,7 +46964,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -47045,7 +47052,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -47132,7 +47140,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -47219,7 +47228,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -47334,7 +47344,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -47420,7 +47431,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -47518,7 +47530,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 679da75e5d..3e997b2341 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -35366,7 +35366,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -35461,7 +35462,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -35558,7 +35560,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -35655,7 +35658,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -35735,7 +35739,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -35822,7 +35827,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -35919,7 +35925,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36006,7 +36013,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36093,7 +36101,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36180,7 +36189,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36295,7 +36305,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36381,7 +36392,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", @@ -36479,7 +36491,8 @@ "deleting", "stuck", "failed" - ] + ], + "x-enum-name": "AttributeStatus" }, "error": { "type": "string", diff --git a/src/Appwrite/SDK/Specification/Format.php b/src/Appwrite/SDK/Specification/Format.php index 825f9bf01d..d52f36c40c 100644 --- a/src/Appwrite/SDK/Specification/Format.php +++ b/src/Appwrite/SDK/Specification/Format.php @@ -112,7 +112,7 @@ abstract class Format return $this->params[$key] ?? $default; } - protected function getEnumName(string $service, string $method, string $param): ?string + protected function getRequestEnumName(string $service, string $method, string $param): ?string { /* `$service` is `$namespace` */ switch ($service) { @@ -450,7 +450,7 @@ abstract class Format return null; } - public function getEnumKeys(string $service, string $method, string $param): array + public function getRequestEnumKeys(string $service, string $method, string $param): array { $values = []; switch ($service) { @@ -543,6 +543,91 @@ abstract class Format return $values; } + public function getResponseEnumName(string $model, string $param): ?string + { + switch ($model) { + case 'attributeString': + switch ($param) { + case 'status': + return 'AttributeStatus'; + } + break; + case 'attributeInteger': + switch ($param) { + case 'status': + return 'AttributeStatus'; + } + break; + case 'attributeFloat': + switch ($param) { + case 'status': + return 'AttributeStatus'; + } + break; + case 'attributeBoolean': + switch ($param) { + case 'status': + return 'AttributeStatus'; + } + break; + case 'attributeEmail': + switch ($param) { + case 'status': + return 'AttributeStatus'; + } + break; + case 'attributeEnum': + switch ($param) { + case 'status': + return 'AttributeStatus'; + } + break; + case 'attributeIp': + switch ($param) { + case 'status': + return 'AttributeStatus'; + } + break; + case 'attributeUrl': + switch ($param) { + case 'status': + return 'AttributeStatus'; + } + break; + case 'attributeDatetime': + switch ($param) { + case 'status': + return 'AttributeStatus'; + } + break; + case 'attributeRelationship': + switch ($param) { + case 'status': + return 'AttributeStatus'; + } + break; + case 'attributePoint': + switch ($param) { + case 'status': + return 'AttributeStatus'; + } + break; + case 'attributeLine': + switch ($param) { + case 'status': + return 'AttributeStatus'; + } + break; + case 'attributePolygon': + switch ($param) { + case 'status': + return 'AttributeStatus'; + } + break; + } + return null; + } + protected function getNestedModels(Model $model, array &$usedModels): void { foreach ($model->getRules() as $rule) { diff --git a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php index c11e55e733..2380f03920 100644 --- a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php @@ -9,6 +9,7 @@ use Appwrite\SDK\Response; use Appwrite\SDK\Specification\Format; use Appwrite\Template\Template; use Appwrite\Utopia\Response\Model; +use Appwrite\Utopia\Response\Model\Any; use Utopia\Database\Database; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; @@ -559,8 +560,8 @@ class OpenAPI3 extends Format if ($allowed) { $node['schema']['enum'] = $validator->getList(); - $node['schema']['x-enum-name'] = $this->getEnumName($sdk->getNamespace() ?? '', $methodName, $name); - $node['schema']['x-enum-keys'] = $this->getEnumKeys($sdk->getNamespace() ?? '', $methodName, $name); + $node['schema']['x-enum-name'] = $this->getRequestEnumName($sdk->getNamespace() ?? '', $methodName, $name); + $node['schema']['x-enum-keys'] = $this->getRequestEnumKeys($sdk->getNamespace() ?? '', $methodName, $name); } if ($validator->getType() === 'integer') { $node['format'] = 'int32'; @@ -777,8 +778,16 @@ class OpenAPI3 extends Format if ($rule['type'] === 'enum' && !empty($rule['enum'])) { if ($rule['array']) { $output['components']['schemas'][$model->getType()]['properties'][$name]['items']['enum'] = $rule['enum']; + $enumName = $this->getResponseEnumName($model->getType(), $name); + if ($enumName) { + $output['components']['schemas'][$model->getType()]['properties'][$name]['items']['x-enum-name'] = $enumName; + } } else { $output['components']['schemas'][$model->getType()]['properties'][$name]['enum'] = $rule['enum']; + $enumName = $this->getResponseEnumName($model->getType(), $name); + if ($enumName) { + $output['components']['schemas'][$model->getType()]['properties'][$name]['x-enum-name'] = $enumName; + } } } if (!in_array($name, $required)) { @@ -786,6 +795,7 @@ class OpenAPI3 extends Format } } + /** @var Any $model */ if ($model->isAny() && !empty($model->getSampleData())) { $examples = array_merge($examples, $model->getSampleData()); } diff --git a/src/Appwrite/SDK/Specification/Format/Swagger2.php b/src/Appwrite/SDK/Specification/Format/Swagger2.php index 4e784e8116..ed1217d86c 100644 --- a/src/Appwrite/SDK/Specification/Format/Swagger2.php +++ b/src/Appwrite/SDK/Specification/Format/Swagger2.php @@ -9,6 +9,7 @@ use Appwrite\SDK\Response; use Appwrite\SDK\Specification\Format; use Appwrite\Template\Template; use Appwrite\Utopia\Response\Model; +use Appwrite\Utopia\Response\Model\Any; use Utopia\Database\Database; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; @@ -565,8 +566,8 @@ class Swagger2 extends Format if ($allowed && $validator->getType() === 'string') { $node['enum'] = $validator->getList(); - $node['x-enum-name'] = $this->getEnumName($namespace, $methodName, $name); - $node['x-enum-keys'] = $this->getEnumKeys($namespace, $methodName, $name); + $node['x-enum-name'] = $this->getRequestEnumName($namespace, $methodName, $name); + $node['x-enum-keys'] = $this->getRequestEnumKeys($namespace, $methodName, $name); } if ($validator->getType() === 'integer') { @@ -799,8 +800,16 @@ class Swagger2 extends Format if ($rule['type'] === 'enum' && !empty($rule['enum'])) { if ($rule['array']) { $output['definitions'][$model->getType()]['properties'][$name]['items']['enum'] = $rule['enum']; + $enumName = $this->getResponseEnumName($model->getType(), $name); + if ($enumName) { + $output['definitions'][$model->getType()]['properties'][$name]['items']['x-enum-name'] = $enumName; + } } else { $output['definitions'][$model->getType()]['properties'][$name]['enum'] = $rule['enum']; + $enumName = $this->getResponseEnumName($model->getType(), $name); + if ($enumName) { + $output['definitions'][$model->getType()]['properties'][$name]['x-enum-name'] = $enumName; + } } } if (!in_array($name, $required)) { @@ -808,6 +817,7 @@ class Swagger2 extends Format } } + /** @var Any $model */ if ($model->isAny() && !empty($model->getSampleData())) { $examples = array_merge($examples, $model->getSampleData()); } From 17f1cb214fbea4784a316488224d6929a0bcc54d Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 23 Sep 2025 10:57:35 +0530 Subject: [PATCH 16/17] override healthstatus --- app/config/specs/open-api3-1.8.x-console.json | 3 ++- app/config/specs/open-api3-1.8.x-server.json | 3 ++- app/config/specs/open-api3-latest-console.json | 3 ++- app/config/specs/open-api3-latest-server.json | 3 ++- app/config/specs/swagger2-1.8.x-console.json | 3 ++- app/config/specs/swagger2-1.8.x-server.json | 3 ++- app/config/specs/swagger2-latest-console.json | 3 ++- app/config/specs/swagger2-latest-server.json | 3 ++- src/Appwrite/SDK/Specification/Format.php | 6 ++++++ 9 files changed, 22 insertions(+), 8 deletions(-) diff --git a/app/config/specs/open-api3-1.8.x-console.json b/app/config/specs/open-api3-1.8.x-console.json index d75265f552..86b5f3ba6f 100644 --- a/app/config/specs/open-api3-1.8.x-console.json +++ b/app/config/specs/open-api3-1.8.x-console.json @@ -53809,7 +53809,8 @@ "enum": [ "pass", "fail" - ] + ], + "x-enum-name": "HealthStatus" } }, "required": [ diff --git a/app/config/specs/open-api3-1.8.x-server.json b/app/config/specs/open-api3-1.8.x-server.json index 3cb3f01ace..b9270ad857 100644 --- a/app/config/specs/open-api3-1.8.x-server.json +++ b/app/config/specs/open-api3-1.8.x-server.json @@ -40997,7 +40997,8 @@ "enum": [ "pass", "fail" - ] + ], + "x-enum-name": "HealthStatus" } }, "required": [ diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index d75265f552..86b5f3ba6f 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -53809,7 +53809,8 @@ "enum": [ "pass", "fail" - ] + ], + "x-enum-name": "HealthStatus" } }, "required": [ diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 3cb3f01ace..b9270ad857 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -40997,7 +40997,8 @@ "enum": [ "pass", "fail" - ] + ], + "x-enum-name": "HealthStatus" } }, "required": [ diff --git a/app/config/specs/swagger2-1.8.x-console.json b/app/config/specs/swagger2-1.8.x-console.json index 072da6a403..f682fc8670 100644 --- a/app/config/specs/swagger2-1.8.x-console.json +++ b/app/config/specs/swagger2-1.8.x-console.json @@ -53765,7 +53765,8 @@ "enum": [ "pass", "fail" - ] + ], + "x-enum-name": "HealthStatus" } }, "required": [ diff --git a/app/config/specs/swagger2-1.8.x-server.json b/app/config/specs/swagger2-1.8.x-server.json index 3e997b2341..bade0bae90 100644 --- a/app/config/specs/swagger2-1.8.x-server.json +++ b/app/config/specs/swagger2-1.8.x-server.json @@ -41034,7 +41034,8 @@ "enum": [ "pass", "fail" - ] + ], + "x-enum-name": "HealthStatus" } }, "required": [ diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 072da6a403..f682fc8670 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -53765,7 +53765,8 @@ "enum": [ "pass", "fail" - ] + ], + "x-enum-name": "HealthStatus" } }, "required": [ diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 3e997b2341..bade0bae90 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -41034,7 +41034,8 @@ "enum": [ "pass", "fail" - ] + ], + "x-enum-name": "HealthStatus" } }, "required": [ diff --git a/src/Appwrite/SDK/Specification/Format.php b/src/Appwrite/SDK/Specification/Format.php index d52f36c40c..7db5d5f559 100644 --- a/src/Appwrite/SDK/Specification/Format.php +++ b/src/Appwrite/SDK/Specification/Format.php @@ -624,6 +624,12 @@ abstract class Format return 'AttributeStatus'; } break; + case 'healthStatus': + switch ($param) { + case 'status': + return 'HealthStatus'; + } + break; } return null; } From 5d8ac0a5b0628b7b3b9b6b3eca4205eaf5420b91 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 23 Sep 2025 11:31:29 +0530 Subject: [PATCH 17/17] add message status --- app/config/specs/open-api3-1.8.x-console.json | 9 ++++++++- app/config/specs/open-api3-1.8.x-server.json | 9 ++++++++- app/config/specs/open-api3-latest-console.json | 9 ++++++++- app/config/specs/open-api3-latest-server.json | 9 ++++++++- app/config/specs/swagger2-1.8.x-console.json | 9 ++++++++- app/config/specs/swagger2-1.8.x-server.json | 9 ++++++++- app/config/specs/swagger2-latest-console.json | 9 ++++++++- app/config/specs/swagger2-latest-server.json | 9 ++++++++- src/Appwrite/Utopia/Response/Model/Message.php | 6 ++++-- 9 files changed, 68 insertions(+), 10 deletions(-) diff --git a/app/config/specs/open-api3-1.8.x-console.json b/app/config/specs/open-api3-1.8.x-console.json index 86b5f3ba6f..31471b170c 100644 --- a/app/config/specs/open-api3-1.8.x-console.json +++ b/app/config/specs/open-api3-1.8.x-console.json @@ -56549,7 +56549,14 @@ "status": { "type": "string", "description": "Status of delivery.", - "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed.", + "enum": [ + "draft", + "processing", + "scheduled", + "sent", + "failed" + ] } }, "required": [ diff --git a/app/config/specs/open-api3-1.8.x-server.json b/app/config/specs/open-api3-1.8.x-server.json index b9270ad857..259485c793 100644 --- a/app/config/specs/open-api3-1.8.x-server.json +++ b/app/config/specs/open-api3-1.8.x-server.json @@ -41463,7 +41463,14 @@ "status": { "type": "string", "description": "Status of delivery.", - "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed.", + "enum": [ + "draft", + "processing", + "scheduled", + "sent", + "failed" + ] } }, "required": [ diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 86b5f3ba6f..31471b170c 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -56549,7 +56549,14 @@ "status": { "type": "string", "description": "Status of delivery.", - "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed.", + "enum": [ + "draft", + "processing", + "scheduled", + "sent", + "failed" + ] } }, "required": [ diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index b9270ad857..259485c793 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -41463,7 +41463,14 @@ "status": { "type": "string", "description": "Status of delivery.", - "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed.", + "enum": [ + "draft", + "processing", + "scheduled", + "sent", + "failed" + ] } }, "required": [ diff --git a/app/config/specs/swagger2-1.8.x-console.json b/app/config/specs/swagger2-1.8.x-console.json index f682fc8670..1abb7c4ef8 100644 --- a/app/config/specs/swagger2-1.8.x-console.json +++ b/app/config/specs/swagger2-1.8.x-console.json @@ -56598,7 +56598,14 @@ "status": { "type": "string", "description": "Status of delivery.", - "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed.", + "enum": [ + "draft", + "processing", + "scheduled", + "sent", + "failed" + ] } }, "required": [ diff --git a/app/config/specs/swagger2-1.8.x-server.json b/app/config/specs/swagger2-1.8.x-server.json index bade0bae90..f350d10c54 100644 --- a/app/config/specs/swagger2-1.8.x-server.json +++ b/app/config/specs/swagger2-1.8.x-server.json @@ -41502,7 +41502,14 @@ "status": { "type": "string", "description": "Status of delivery.", - "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed.", + "enum": [ + "draft", + "processing", + "scheduled", + "sent", + "failed" + ] } }, "required": [ diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index f682fc8670..1abb7c4ef8 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -56598,7 +56598,14 @@ "status": { "type": "string", "description": "Status of delivery.", - "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed.", + "enum": [ + "draft", + "processing", + "scheduled", + "sent", + "failed" + ] } }, "required": [ diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index bade0bae90..f350d10c54 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -41502,7 +41502,14 @@ "status": { "type": "string", "description": "Status of delivery.", - "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed.", + "enum": [ + "draft", + "processing", + "scheduled", + "sent", + "failed" + ] } }, "required": [ diff --git a/src/Appwrite/Utopia/Response/Model/Message.php b/src/Appwrite/Utopia/Response/Model/Message.php index e52b6836c5..4c1e08b9cb 100644 --- a/src/Appwrite/Utopia/Response/Model/Message.php +++ b/src/Appwrite/Utopia/Response/Model/Message.php @@ -34,6 +34,7 @@ class Message extends Model 'description' => 'Message provider type.', 'default' => '', 'example' => MESSAGE_TYPE_EMAIL, + 'enum' => [MESSAGE_TYPE_EMAIL, MESSAGE_TYPE_SMS, MESSAGE_TYPE_PUSH], ]) ->addRule('topics', [ 'type' => self::TYPE_STRING, @@ -50,7 +51,7 @@ class Message extends Model 'example' => ['5e5ea5c16897e'], ]) ->addRule('targets', [ - 'type' => self::TYPE_STRING, + 'type' => self::TYPE_ENUM, 'description' => 'Target IDs set as recipients.', 'default' => '', 'array' => true, @@ -94,10 +95,11 @@ class Message extends Model ], ]) ->addRule('status', [ - 'type' => self::TYPE_STRING, + 'type' => self::TYPE_ENUM, 'description' => 'Status of delivery.', 'default' => 'draft', 'example' => 'Message status can be one of the following: draft, processing, scheduled, sent, or failed.', + 'enum' => ['draft', 'processing', 'scheduled', 'sent', 'failed'], ]); }