Merge pull request #10722 from appwrite/feat-per-bucket-image-transformations

feat: per bucket image transformations flag
This commit is contained in:
Jake Barnby 2025-11-18 06:10:00 +00:00 committed by GitHub
commit 275ff3dbf2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
96 changed files with 1035 additions and 166 deletions

View file

@ -1582,6 +1582,17 @@ return [
'required' => true,
'array' => false,
],
[
'$id' => ID::custom('transformations'),
'type' => Database::VAR_BOOLEAN,
'signed' => true,
'size' => 0,
'format' => '',
'filters' => [],
'required' => false,
'array' => false,
'default' => true,
],
[
'$id' => ID::custom('search'),
'type' => Database::VAR_STRING,

View file

@ -522,6 +522,11 @@ return [
'description' => 'The requested file is not publicly readable.',
'code' => 403,
],
Exception::STORAGE_BUCKET_TRANSFORMATIONS_DISABLED => [
'name' => Exception::STORAGE_BUCKET_TRANSFORMATIONS_DISABLED,
'description' => 'Image transformations are disabled for the requested bucket.',
'code' => 403,
],
/** Tokens */
Exception::TOKEN_NOT_FOUND => [

View file

@ -7753,7 +7753,8 @@
"default": {
"type": "string",
"description": "Default value for the attribute in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.",
"x-example": null
"x-example": null,
"x-nullable": true
},
"array": {
"type": "boolean",
@ -14414,10 +14415,22 @@
"description": "Path to function code in the template repo.",
"x-example": "<ROOT_DIRECTORY>"
},
"version": {
"type": {
"type": "string",
"description": "Version (tag) for the repo linked to the function template.",
"x-example": "<VERSION>"
"description": "Type for the reference provided. Can be commit, branch, or tag",
"x-example": "commit",
"enum": [
"commit",
"branch",
"tag"
],
"x-enum-name": null,
"x-enum-keys": []
},
"reference": {
"type": "string",
"description": "Reference value, can be a commit hash, branch name, or release tag",
"x-example": "<REFERENCE>"
},
"activate": {
"type": "boolean",
@ -14429,7 +14442,8 @@
"repository",
"owner",
"rootDirectory",
"version"
"type",
"reference"
]
}
}
@ -32314,10 +32328,22 @@
"description": "Path to site code in the template repo.",
"x-example": "<ROOT_DIRECTORY>"
},
"version": {
"type": {
"type": "string",
"description": "Version (tag) for the repo linked to the site template.",
"x-example": "<VERSION>"
"description": "Type for the reference provided. Can be commit, branch, or tag",
"x-example": "branch",
"enum": [
"branch",
"commit",
"tag"
],
"x-enum-name": null,
"x-enum-keys": []
},
"reference": {
"type": "string",
"description": "Reference value, can be a commit hash, branch name, or release tag",
"x-example": "<REFERENCE>"
},
"activate": {
"type": "boolean",
@ -32329,7 +32355,8 @@
"repository",
"owner",
"rootDirectory",
"version"
"type",
"reference"
]
}
}
@ -33455,7 +33482,7 @@
"parameters": [
{
"name": "queries",
"description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus",
"description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus, transformations",
"required": false,
"schema": {
"type": "array",
@ -33605,6 +33632,11 @@
"type": "boolean",
"description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled",
"x-example": false
},
"transformations": {
"type": "boolean",
"description": "Are image transformations enabled?",
"x-example": false
}
},
"required": [
@ -33799,6 +33831,11 @@
"type": "boolean",
"description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled",
"x-example": false
},
"transformations": {
"type": "boolean",
"description": "Are image transformations enabled?",
"x-example": false
}
},
"required": [
@ -36096,7 +36133,7 @@
},
"rowSecurity": {
"type": "boolean",
"description": "Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
"description": "Enables configuring permissions for individual rows. A user needs one of row or table-level permissions to access a row. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
"x-example": false
},
"enabled": {
@ -36593,7 +36630,8 @@
"default": {
"type": "string",
"description": "Default value for the column in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when column is required.",
"x-example": null
"x-example": null,
"x-nullable": true
},
"array": {
"type": "boolean",
@ -53579,6 +53617,11 @@
"type": "boolean",
"description": "Virus scanning is enabled.",
"x-example": false
},
"transformations": {
"type": "boolean",
"description": "Image transformations are enabled.",
"x-example": false
}
},
"required": [
@ -53593,7 +53636,8 @@
"allowedFileExtensions",
"compression",
"encryption",
"antivirus"
"antivirus",
"transformations"
],
"example": {
"$id": "5e5ea5c16897e",
@ -53612,7 +53656,8 @@
],
"compression": "gzip",
"encryption": false,
"antivirus": false
"antivirus": false,
"transformations": false
}
},
"resourceToken": {
@ -54798,6 +54843,17 @@
"type": "string",
"description": "Last commit date in ISO 8601 format.",
"x-example": "datetime"
},
"variables": {
"type": "array",
"description": "Environment variables found in .env files",
"items": {
"type": "string"
},
"x-example": [
"PORT",
"NODE_ENV"
]
}
},
"required": [
@ -54807,7 +54863,8 @@
"provider",
"private",
"defaultBranch",
"pushedAt"
"pushedAt",
"variables"
],
"example": {
"id": "5e5ea5c16897e",
@ -54816,7 +54873,11 @@
"provider": "github",
"private": true,
"defaultBranch": "main",
"pushedAt": "datetime"
"pushedAt": "datetime",
"variables": [
"PORT",
"NODE_ENV"
]
}
},
"providerRepositoryFramework": {
@ -54858,6 +54919,17 @@
"description": "Last commit date in ISO 8601 format.",
"x-example": "datetime"
},
"variables": {
"type": "array",
"description": "Environment variables found in .env files",
"items": {
"type": "string"
},
"x-example": [
"PORT",
"NODE_ENV"
]
},
"framework": {
"type": "string",
"description": "Auto-detected framework. Empty if type is not \"framework\".",
@ -54872,6 +54944,7 @@
"private",
"defaultBranch",
"pushedAt",
"variables",
"framework"
],
"example": {
@ -54882,6 +54955,10 @@
"private": true,
"defaultBranch": "main",
"pushedAt": "datetime",
"variables": [
"PORT",
"NODE_ENV"
],
"framework": "nextjs"
}
},
@ -54924,6 +55001,17 @@
"description": "Last commit date in ISO 8601 format.",
"x-example": "datetime"
},
"variables": {
"type": "array",
"description": "Environment variables found in .env files",
"items": {
"type": "string"
},
"x-example": [
"PORT",
"NODE_ENV"
]
},
"runtime": {
"type": "string",
"description": "Auto-detected runtime. Empty if type is not \"runtime\".",
@ -54938,6 +55026,7 @@
"private",
"defaultBranch",
"pushedAt",
"variables",
"runtime"
],
"example": {
@ -54948,6 +55037,10 @@
"private": true,
"defaultBranch": "main",
"pushedAt": "datetime",
"variables": [
"PORT",
"NODE_ENV"
],
"runtime": "node-22"
}
},
@ -54955,6 +55048,15 @@
"description": "DetectionFramework",
"type": "object",
"properties": {
"variables": {
"type": "array",
"description": "Environment variables found in .env files",
"items": {
"$ref": "#\/components\/schemas\/detectionVariable"
},
"x-example": {},
"nullable": true
},
"framework": {
"type": "string",
"description": "Framework",
@ -54983,6 +55085,7 @@
"outputDirectory"
],
"example": {
"variables": {},
"framework": "nuxt",
"installCommand": "npm install",
"buildCommand": "npm run build",
@ -54993,6 +55096,15 @@
"description": "DetectionRuntime",
"type": "object",
"properties": {
"variables": {
"type": "array",
"description": "Environment variables found in .env files",
"items": {
"$ref": "#\/components\/schemas\/detectionVariable"
},
"x-example": {},
"nullable": true
},
"runtime": {
"type": "string",
"description": "Runtime",
@ -55015,11 +55127,36 @@
"commands"
],
"example": {
"variables": {},
"runtime": "node",
"entrypoint": "index.js",
"commands": "npm install && npm run build"
}
},
"detectionVariable": {
"description": "DetectionVariable",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of environment variable",
"x-example": "NODE_ENV"
},
"value": {
"type": "string",
"description": "Value of environment variable",
"x-example": "production"
}
},
"required": [
"name",
"value"
],
"example": {
"name": "NODE_ENV",
"value": "production"
}
},
"vcsContent": {
"description": "VcsContents",
"type": "object",

View file

@ -7222,7 +7222,8 @@
"default": {
"type": "string",
"description": "Default value for the attribute in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.",
"x-example": null
"x-example": null,
"x-nullable": true
},
"array": {
"type": "boolean",
@ -13203,10 +13204,22 @@
"description": "Path to function code in the template repo.",
"x-example": "<ROOT_DIRECTORY>"
},
"version": {
"type": {
"type": "string",
"description": "Version (tag) for the repo linked to the function template.",
"x-example": "<VERSION>"
"description": "Type for the reference provided. Can be commit, branch, or tag",
"x-example": "commit",
"enum": [
"commit",
"branch",
"tag"
],
"x-enum-name": null,
"x-enum-keys": []
},
"reference": {
"type": "string",
"description": "Reference value, can be a commit hash, branch name, or release tag",
"x-example": "<REFERENCE>"
},
"activate": {
"type": "boolean",
@ -13218,7 +13231,8 @@
"repository",
"owner",
"rootDirectory",
"version"
"type",
"reference"
]
}
}
@ -22838,10 +22852,22 @@
"description": "Path to site code in the template repo.",
"x-example": "<ROOT_DIRECTORY>"
},
"version": {
"type": {
"type": "string",
"description": "Version (tag) for the repo linked to the site template.",
"x-example": "<VERSION>"
"description": "Type for the reference provided. Can be commit, branch, or tag",
"x-example": "branch",
"enum": [
"branch",
"commit",
"tag"
],
"x-enum-name": null,
"x-enum-keys": []
},
"reference": {
"type": "string",
"description": "Reference value, can be a commit hash, branch name, or release tag",
"x-example": "<REFERENCE>"
},
"activate": {
"type": "boolean",
@ -22853,7 +22879,8 @@
"repository",
"owner",
"rootDirectory",
"version"
"type",
"reference"
]
}
}
@ -23911,7 +23938,7 @@
"parameters": [
{
"name": "queries",
"description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus",
"description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus, transformations",
"required": false,
"schema": {
"type": "array",
@ -24062,6 +24089,11 @@
"type": "boolean",
"description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled",
"x-example": false
},
"transformations": {
"type": "boolean",
"description": "Are image transformations enabled?",
"x-example": false
}
},
"required": [
@ -24258,6 +24290,11 @@
"type": "boolean",
"description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled",
"x-example": false
},
"transformations": {
"type": "boolean",
"description": "Are image transformations enabled?",
"x-example": false
}
},
"required": [
@ -26342,7 +26379,7 @@
},
"rowSecurity": {
"type": "boolean",
"description": "Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
"description": "Enables configuring permissions for individual rows. A user needs one of row or table-level permissions to access a row. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
"x-example": false
},
"enabled": {
@ -26844,7 +26881,8 @@
"default": {
"type": "string",
"description": "Default value for the column in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when column is required.",
"x-example": null
"x-example": null,
"x-nullable": true
},
"array": {
"type": "boolean",
@ -42256,6 +42294,11 @@
"type": "boolean",
"description": "Virus scanning is enabled.",
"x-example": false
},
"transformations": {
"type": "boolean",
"description": "Image transformations are enabled.",
"x-example": false
}
},
"required": [
@ -42270,7 +42313,8 @@
"allowedFileExtensions",
"compression",
"encryption",
"antivirus"
"antivirus",
"transformations"
],
"example": {
"$id": "5e5ea5c16897e",
@ -42289,7 +42333,8 @@
],
"compression": "gzip",
"encryption": false,
"antivirus": false
"antivirus": false,
"transformations": false
}
},
"resourceToken": {

View file

@ -7753,7 +7753,8 @@
"default": {
"type": "string",
"description": "Default value for the attribute in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.",
"x-example": null
"x-example": null,
"x-nullable": true
},
"array": {
"type": "boolean",
@ -33481,7 +33482,7 @@
"parameters": [
{
"name": "queries",
"description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus",
"description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus, transformations",
"required": false,
"schema": {
"type": "array",
@ -33631,6 +33632,11 @@
"type": "boolean",
"description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled",
"x-example": false
},
"transformations": {
"type": "boolean",
"description": "Are image transformations enabled?",
"x-example": false
}
},
"required": [
@ -33825,6 +33831,11 @@
"type": "boolean",
"description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled",
"x-example": false
},
"transformations": {
"type": "boolean",
"description": "Are image transformations enabled?",
"x-example": false
}
},
"required": [
@ -36122,7 +36133,7 @@
},
"rowSecurity": {
"type": "boolean",
"description": "Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
"description": "Enables configuring permissions for individual rows. A user needs one of row or table-level permissions to access a row. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
"x-example": false
},
"enabled": {
@ -36619,7 +36630,8 @@
"default": {
"type": "string",
"description": "Default value for the column in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when column is required.",
"x-example": null
"x-example": null,
"x-nullable": true
},
"array": {
"type": "boolean",
@ -53605,6 +53617,11 @@
"type": "boolean",
"description": "Virus scanning is enabled.",
"x-example": false
},
"transformations": {
"type": "boolean",
"description": "Image transformations are enabled.",
"x-example": false
}
},
"required": [
@ -53619,7 +53636,8 @@
"allowedFileExtensions",
"compression",
"encryption",
"antivirus"
"antivirus",
"transformations"
],
"example": {
"$id": "5e5ea5c16897e",
@ -53638,7 +53656,8 @@
],
"compression": "gzip",
"encryption": false,
"antivirus": false
"antivirus": false,
"transformations": false
}
},
"resourceToken": {
@ -54824,6 +54843,17 @@
"type": "string",
"description": "Last commit date in ISO 8601 format.",
"x-example": "datetime"
},
"variables": {
"type": "array",
"description": "Environment variables found in .env files",
"items": {
"type": "string"
},
"x-example": [
"PORT",
"NODE_ENV"
]
}
},
"required": [
@ -54833,7 +54863,8 @@
"provider",
"private",
"defaultBranch",
"pushedAt"
"pushedAt",
"variables"
],
"example": {
"id": "5e5ea5c16897e",
@ -54842,7 +54873,11 @@
"provider": "github",
"private": true,
"defaultBranch": "main",
"pushedAt": "datetime"
"pushedAt": "datetime",
"variables": [
"PORT",
"NODE_ENV"
]
}
},
"providerRepositoryFramework": {
@ -54884,6 +54919,17 @@
"description": "Last commit date in ISO 8601 format.",
"x-example": "datetime"
},
"variables": {
"type": "array",
"description": "Environment variables found in .env files",
"items": {
"type": "string"
},
"x-example": [
"PORT",
"NODE_ENV"
]
},
"framework": {
"type": "string",
"description": "Auto-detected framework. Empty if type is not \"framework\".",
@ -54898,6 +54944,7 @@
"private",
"defaultBranch",
"pushedAt",
"variables",
"framework"
],
"example": {
@ -54908,6 +54955,10 @@
"private": true,
"defaultBranch": "main",
"pushedAt": "datetime",
"variables": [
"PORT",
"NODE_ENV"
],
"framework": "nextjs"
}
},
@ -54950,6 +55001,17 @@
"description": "Last commit date in ISO 8601 format.",
"x-example": "datetime"
},
"variables": {
"type": "array",
"description": "Environment variables found in .env files",
"items": {
"type": "string"
},
"x-example": [
"PORT",
"NODE_ENV"
]
},
"runtime": {
"type": "string",
"description": "Auto-detected runtime. Empty if type is not \"runtime\".",
@ -54964,6 +55026,7 @@
"private",
"defaultBranch",
"pushedAt",
"variables",
"runtime"
],
"example": {
@ -54974,6 +55037,10 @@
"private": true,
"defaultBranch": "main",
"pushedAt": "datetime",
"variables": [
"PORT",
"NODE_ENV"
],
"runtime": "node-22"
}
},
@ -54981,6 +55048,15 @@
"description": "DetectionFramework",
"type": "object",
"properties": {
"variables": {
"type": "array",
"description": "Environment variables found in .env files",
"items": {
"$ref": "#\/components\/schemas\/detectionVariable"
},
"x-example": {},
"nullable": true
},
"framework": {
"type": "string",
"description": "Framework",
@ -55009,6 +55085,7 @@
"outputDirectory"
],
"example": {
"variables": {},
"framework": "nuxt",
"installCommand": "npm install",
"buildCommand": "npm run build",
@ -55019,6 +55096,15 @@
"description": "DetectionRuntime",
"type": "object",
"properties": {
"variables": {
"type": "array",
"description": "Environment variables found in .env files",
"items": {
"$ref": "#\/components\/schemas\/detectionVariable"
},
"x-example": {},
"nullable": true
},
"runtime": {
"type": "string",
"description": "Runtime",
@ -55041,11 +55127,36 @@
"commands"
],
"example": {
"variables": {},
"runtime": "node",
"entrypoint": "index.js",
"commands": "npm install && npm run build"
}
},
"detectionVariable": {
"description": "DetectionVariable",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of environment variable",
"x-example": "NODE_ENV"
},
"value": {
"type": "string",
"description": "Value of environment variable",
"x-example": "production"
}
},
"required": [
"name",
"value"
],
"example": {
"name": "NODE_ENV",
"value": "production"
}
},
"vcsContent": {
"description": "VcsContents",
"type": "object",

View file

@ -7222,7 +7222,8 @@
"default": {
"type": "string",
"description": "Default value for the attribute in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.",
"x-example": null
"x-example": null,
"x-nullable": true
},
"array": {
"type": "boolean",
@ -23937,7 +23938,7 @@
"parameters": [
{
"name": "queries",
"description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus",
"description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus, transformations",
"required": false,
"schema": {
"type": "array",
@ -24088,6 +24089,11 @@
"type": "boolean",
"description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled",
"x-example": false
},
"transformations": {
"type": "boolean",
"description": "Are image transformations enabled?",
"x-example": false
}
},
"required": [
@ -24284,6 +24290,11 @@
"type": "boolean",
"description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled",
"x-example": false
},
"transformations": {
"type": "boolean",
"description": "Are image transformations enabled?",
"x-example": false
}
},
"required": [
@ -26368,7 +26379,7 @@
},
"rowSecurity": {
"type": "boolean",
"description": "Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
"description": "Enables configuring permissions for individual rows. A user needs one of row or table-level permissions to access a row. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
"x-example": false
},
"enabled": {
@ -26870,7 +26881,8 @@
"default": {
"type": "string",
"description": "Default value for the column in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when column is required.",
"x-example": null
"x-example": null,
"x-nullable": true
},
"array": {
"type": "boolean",
@ -42282,6 +42294,11 @@
"type": "boolean",
"description": "Virus scanning is enabled.",
"x-example": false
},
"transformations": {
"type": "boolean",
"description": "Image transformations are enabled.",
"x-example": false
}
},
"required": [
@ -42296,7 +42313,8 @@
"allowedFileExtensions",
"compression",
"encryption",
"antivirus"
"antivirus",
"transformations"
],
"example": {
"$id": "5e5ea5c16897e",
@ -42315,7 +42333,8 @@
],
"compression": "gzip",
"encryption": false,
"antivirus": false
"antivirus": false,
"transformations": false
}
},
"resourceToken": {

View file

@ -7851,7 +7851,8 @@
"type": "string",
"description": "Default value for the attribute in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.",
"default": null,
"x-example": null
"x-example": null,
"x-nullable": true
},
"array": {
"type": "boolean",
@ -14355,11 +14356,24 @@
"default": null,
"x-example": "<ROOT_DIRECTORY>"
},
"version": {
"type": {
"type": "string",
"description": "Version (tag) for the repo linked to the function template.",
"description": "Type for the reference provided. Can be commit, branch, or tag",
"default": null,
"x-example": "<VERSION>"
"x-example": "commit",
"enum": [
"commit",
"branch",
"tag"
],
"x-enum-name": null,
"x-enum-keys": []
},
"reference": {
"type": "string",
"description": "Reference value, can be a commit hash, branch name, or release tag",
"default": null,
"x-example": "<REFERENCE>"
},
"activate": {
"type": "boolean",
@ -14372,7 +14386,8 @@
"repository",
"owner",
"rootDirectory",
"version"
"type",
"reference"
]
}
}
@ -32416,11 +32431,24 @@
"default": null,
"x-example": "<ROOT_DIRECTORY>"
},
"version": {
"type": {
"type": "string",
"description": "Version (tag) for the repo linked to the site template.",
"description": "Type for the reference provided. Can be commit, branch, or tag",
"default": null,
"x-example": "<VERSION>"
"x-example": "branch",
"enum": [
"branch",
"commit",
"tag"
],
"x-enum-name": null,
"x-enum-keys": []
},
"reference": {
"type": "string",
"description": "Reference value, can be a commit hash, branch name, or release tag",
"default": null,
"x-example": "<REFERENCE>"
},
"activate": {
"type": "boolean",
@ -32433,7 +32461,8 @@
"repository",
"owner",
"rootDirectory",
"version"
"type",
"reference"
]
}
}
@ -33536,7 +33565,7 @@
"parameters": [
{
"name": "queries",
"description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus",
"description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus, transformations",
"required": false,
"type": "array",
"collectionFormat": "multi",
@ -33694,6 +33723,12 @@
"description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled",
"default": true,
"x-example": false
},
"transformations": {
"type": "boolean",
"description": "Are image transformations enabled?",
"default": true,
"x-example": false
}
},
"required": [
@ -33893,6 +33928,12 @@
"description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled",
"default": true,
"x-example": false
},
"transformations": {
"type": "boolean",
"description": "Are image transformations enabled?",
"default": true,
"x-example": false
}
},
"required": [
@ -36122,7 +36163,7 @@
},
"rowSecurity": {
"type": "boolean",
"description": "Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
"description": "Enables configuring permissions for individual rows. A user needs one of row or table-level permissions to access a row. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
"default": false,
"x-example": false
},
@ -36610,7 +36651,8 @@
"type": "string",
"description": "Default value for the column in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when column is required.",
"default": null,
"x-example": null
"x-example": null,
"x-nullable": true
},
"array": {
"type": "boolean",
@ -53397,6 +53439,11 @@
"type": "boolean",
"description": "Virus scanning is enabled.",
"x-example": false
},
"transformations": {
"type": "boolean",
"description": "Image transformations are enabled.",
"x-example": false
}
},
"required": [
@ -53411,7 +53458,8 @@
"allowedFileExtensions",
"compression",
"encryption",
"antivirus"
"antivirus",
"transformations"
],
"example": {
"$id": "5e5ea5c16897e",
@ -53430,7 +53478,8 @@
],
"compression": "gzip",
"encryption": false,
"antivirus": false
"antivirus": false,
"transformations": false
}
},
"resourceToken": {
@ -54623,6 +54672,17 @@
"type": "string",
"description": "Last commit date in ISO 8601 format.",
"x-example": "datetime"
},
"variables": {
"type": "array",
"description": "Environment variables found in .env files",
"items": {
"type": "string"
},
"x-example": [
"PORT",
"NODE_ENV"
]
}
},
"required": [
@ -54632,7 +54692,8 @@
"provider",
"private",
"defaultBranch",
"pushedAt"
"pushedAt",
"variables"
],
"example": {
"id": "5e5ea5c16897e",
@ -54641,7 +54702,11 @@
"provider": "github",
"private": true,
"defaultBranch": "main",
"pushedAt": "datetime"
"pushedAt": "datetime",
"variables": [
"PORT",
"NODE_ENV"
]
}
},
"providerRepositoryFramework": {
@ -54683,6 +54748,17 @@
"description": "Last commit date in ISO 8601 format.",
"x-example": "datetime"
},
"variables": {
"type": "array",
"description": "Environment variables found in .env files",
"items": {
"type": "string"
},
"x-example": [
"PORT",
"NODE_ENV"
]
},
"framework": {
"type": "string",
"description": "Auto-detected framework. Empty if type is not \"framework\".",
@ -54697,6 +54773,7 @@
"private",
"defaultBranch",
"pushedAt",
"variables",
"framework"
],
"example": {
@ -54707,6 +54784,10 @@
"private": true,
"defaultBranch": "main",
"pushedAt": "datetime",
"variables": [
"PORT",
"NODE_ENV"
],
"framework": "nextjs"
}
},
@ -54749,6 +54830,17 @@
"description": "Last commit date in ISO 8601 format.",
"x-example": "datetime"
},
"variables": {
"type": "array",
"description": "Environment variables found in .env files",
"items": {
"type": "string"
},
"x-example": [
"PORT",
"NODE_ENV"
]
},
"runtime": {
"type": "string",
"description": "Auto-detected runtime. Empty if type is not \"runtime\".",
@ -54763,6 +54855,7 @@
"private",
"defaultBranch",
"pushedAt",
"variables",
"runtime"
],
"example": {
@ -54773,6 +54866,10 @@
"private": true,
"defaultBranch": "main",
"pushedAt": "datetime",
"variables": [
"PORT",
"NODE_ENV"
],
"runtime": "node-22"
}
},
@ -54780,6 +54877,16 @@
"description": "DetectionFramework",
"type": "object",
"properties": {
"variables": {
"type": "array",
"description": "Environment variables found in .env files",
"items": {
"type": "object",
"$ref": "#\/definitions\/detectionVariable"
},
"x-example": {},
"x-nullable": true
},
"framework": {
"type": "string",
"description": "Framework",
@ -54808,6 +54915,7 @@
"outputDirectory"
],
"example": {
"variables": {},
"framework": "nuxt",
"installCommand": "npm install",
"buildCommand": "npm run build",
@ -54818,6 +54926,16 @@
"description": "DetectionRuntime",
"type": "object",
"properties": {
"variables": {
"type": "array",
"description": "Environment variables found in .env files",
"items": {
"type": "object",
"$ref": "#\/definitions\/detectionVariable"
},
"x-example": {},
"x-nullable": true
},
"runtime": {
"type": "string",
"description": "Runtime",
@ -54840,11 +54958,36 @@
"commands"
],
"example": {
"variables": {},
"runtime": "node",
"entrypoint": "index.js",
"commands": "npm install && npm run build"
}
},
"detectionVariable": {
"description": "DetectionVariable",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of environment variable",
"x-example": "NODE_ENV"
},
"value": {
"type": "string",
"description": "Value of environment variable",
"x-example": "production"
}
},
"required": [
"name",
"value"
],
"example": {
"name": "NODE_ENV",
"value": "production"
}
},
"vcsContent": {
"description": "VcsContents",
"type": "object",

View file

@ -7310,7 +7310,8 @@
"type": "string",
"description": "Default value for the attribute in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.",
"default": null,
"x-example": null
"x-example": null,
"x-nullable": true
},
"array": {
"type": "boolean",
@ -13171,11 +13172,24 @@
"default": null,
"x-example": "<ROOT_DIRECTORY>"
},
"version": {
"type": {
"type": "string",
"description": "Version (tag) for the repo linked to the function template.",
"description": "Type for the reference provided. Can be commit, branch, or tag",
"default": null,
"x-example": "<VERSION>"
"x-example": "commit",
"enum": [
"commit",
"branch",
"tag"
],
"x-enum-name": null,
"x-enum-keys": []
},
"reference": {
"type": "string",
"description": "Reference value, can be a commit hash, branch name, or release tag",
"default": null,
"x-example": "<REFERENCE>"
},
"activate": {
"type": "boolean",
@ -13188,7 +13202,8 @@
"repository",
"owner",
"rootDirectory",
"version"
"type",
"reference"
]
}
}
@ -22989,11 +23004,24 @@
"default": null,
"x-example": "<ROOT_DIRECTORY>"
},
"version": {
"type": {
"type": "string",
"description": "Version (tag) for the repo linked to the site template.",
"description": "Type for the reference provided. Can be commit, branch, or tag",
"default": null,
"x-example": "<VERSION>"
"x-example": "branch",
"enum": [
"branch",
"commit",
"tag"
],
"x-enum-name": null,
"x-enum-keys": []
},
"reference": {
"type": "string",
"description": "Reference value, can be a commit hash, branch name, or release tag",
"default": null,
"x-example": "<REFERENCE>"
},
"activate": {
"type": "boolean",
@ -23006,7 +23034,8 @@
"repository",
"owner",
"rootDirectory",
"version"
"type",
"reference"
]
}
}
@ -24045,7 +24074,7 @@
"parameters": [
{
"name": "queries",
"description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus",
"description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus, transformations",
"required": false,
"type": "array",
"collectionFormat": "multi",
@ -24204,6 +24233,12 @@
"description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled",
"default": true,
"x-example": false
},
"transformations": {
"type": "boolean",
"description": "Are image transformations enabled?",
"default": true,
"x-example": false
}
},
"required": [
@ -24405,6 +24440,12 @@
"description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled",
"default": true,
"x-example": false
},
"transformations": {
"type": "boolean",
"description": "Are image transformations enabled?",
"default": true,
"x-example": false
}
},
"required": [
@ -26429,7 +26470,7 @@
},
"rowSecurity": {
"type": "boolean",
"description": "Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
"description": "Enables configuring permissions for individual rows. A user needs one of row or table-level permissions to access a row. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
"default": false,
"x-example": false
},
@ -26922,7 +26963,8 @@
"type": "string",
"description": "Default value for the column in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when column is required.",
"default": null,
"x-example": null
"x-example": null,
"x-nullable": true
},
"array": {
"type": "boolean",
@ -42175,6 +42217,11 @@
"type": "boolean",
"description": "Virus scanning is enabled.",
"x-example": false
},
"transformations": {
"type": "boolean",
"description": "Image transformations are enabled.",
"x-example": false
}
},
"required": [
@ -42189,7 +42236,8 @@
"allowedFileExtensions",
"compression",
"encryption",
"antivirus"
"antivirus",
"transformations"
],
"example": {
"$id": "5e5ea5c16897e",
@ -42208,7 +42256,8 @@
],
"compression": "gzip",
"encryption": false,
"antivirus": false
"antivirus": false,
"transformations": false
}
},
"resourceToken": {

View file

@ -7851,7 +7851,8 @@
"type": "string",
"description": "Default value for the attribute in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.",
"default": null,
"x-example": null
"x-example": null,
"x-nullable": true
},
"array": {
"type": "boolean",
@ -33564,7 +33565,7 @@
"parameters": [
{
"name": "queries",
"description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus",
"description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus, transformations",
"required": false,
"type": "array",
"collectionFormat": "multi",
@ -33722,6 +33723,12 @@
"description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled",
"default": true,
"x-example": false
},
"transformations": {
"type": "boolean",
"description": "Are image transformations enabled?",
"default": true,
"x-example": false
}
},
"required": [
@ -33921,6 +33928,12 @@
"description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled",
"default": true,
"x-example": false
},
"transformations": {
"type": "boolean",
"description": "Are image transformations enabled?",
"default": true,
"x-example": false
}
},
"required": [
@ -36150,7 +36163,7 @@
},
"rowSecurity": {
"type": "boolean",
"description": "Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
"description": "Enables configuring permissions for individual rows. A user needs one of row or table-level permissions to access a row. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
"default": false,
"x-example": false
},
@ -36638,7 +36651,8 @@
"type": "string",
"description": "Default value for the column in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when column is required.",
"default": null,
"x-example": null
"x-example": null,
"x-nullable": true
},
"array": {
"type": "boolean",
@ -53425,6 +53439,11 @@
"type": "boolean",
"description": "Virus scanning is enabled.",
"x-example": false
},
"transformations": {
"type": "boolean",
"description": "Image transformations are enabled.",
"x-example": false
}
},
"required": [
@ -53439,7 +53458,8 @@
"allowedFileExtensions",
"compression",
"encryption",
"antivirus"
"antivirus",
"transformations"
],
"example": {
"$id": "5e5ea5c16897e",
@ -53458,7 +53478,8 @@
],
"compression": "gzip",
"encryption": false,
"antivirus": false
"antivirus": false,
"transformations": false
}
},
"resourceToken": {
@ -54651,6 +54672,17 @@
"type": "string",
"description": "Last commit date in ISO 8601 format.",
"x-example": "datetime"
},
"variables": {
"type": "array",
"description": "Environment variables found in .env files",
"items": {
"type": "string"
},
"x-example": [
"PORT",
"NODE_ENV"
]
}
},
"required": [
@ -54660,7 +54692,8 @@
"provider",
"private",
"defaultBranch",
"pushedAt"
"pushedAt",
"variables"
],
"example": {
"id": "5e5ea5c16897e",
@ -54669,7 +54702,11 @@
"provider": "github",
"private": true,
"defaultBranch": "main",
"pushedAt": "datetime"
"pushedAt": "datetime",
"variables": [
"PORT",
"NODE_ENV"
]
}
},
"providerRepositoryFramework": {
@ -54711,6 +54748,17 @@
"description": "Last commit date in ISO 8601 format.",
"x-example": "datetime"
},
"variables": {
"type": "array",
"description": "Environment variables found in .env files",
"items": {
"type": "string"
},
"x-example": [
"PORT",
"NODE_ENV"
]
},
"framework": {
"type": "string",
"description": "Auto-detected framework. Empty if type is not \"framework\".",
@ -54725,6 +54773,7 @@
"private",
"defaultBranch",
"pushedAt",
"variables",
"framework"
],
"example": {
@ -54735,6 +54784,10 @@
"private": true,
"defaultBranch": "main",
"pushedAt": "datetime",
"variables": [
"PORT",
"NODE_ENV"
],
"framework": "nextjs"
}
},
@ -54777,6 +54830,17 @@
"description": "Last commit date in ISO 8601 format.",
"x-example": "datetime"
},
"variables": {
"type": "array",
"description": "Environment variables found in .env files",
"items": {
"type": "string"
},
"x-example": [
"PORT",
"NODE_ENV"
]
},
"runtime": {
"type": "string",
"description": "Auto-detected runtime. Empty if type is not \"runtime\".",
@ -54791,6 +54855,7 @@
"private",
"defaultBranch",
"pushedAt",
"variables",
"runtime"
],
"example": {
@ -54801,6 +54866,10 @@
"private": true,
"defaultBranch": "main",
"pushedAt": "datetime",
"variables": [
"PORT",
"NODE_ENV"
],
"runtime": "node-22"
}
},
@ -54808,6 +54877,16 @@
"description": "DetectionFramework",
"type": "object",
"properties": {
"variables": {
"type": "array",
"description": "Environment variables found in .env files",
"items": {
"type": "object",
"$ref": "#\/definitions\/detectionVariable"
},
"x-example": {},
"x-nullable": true
},
"framework": {
"type": "string",
"description": "Framework",
@ -54836,6 +54915,7 @@
"outputDirectory"
],
"example": {
"variables": {},
"framework": "nuxt",
"installCommand": "npm install",
"buildCommand": "npm run build",
@ -54846,6 +54926,16 @@
"description": "DetectionRuntime",
"type": "object",
"properties": {
"variables": {
"type": "array",
"description": "Environment variables found in .env files",
"items": {
"type": "object",
"$ref": "#\/definitions\/detectionVariable"
},
"x-example": {},
"x-nullable": true
},
"runtime": {
"type": "string",
"description": "Runtime",
@ -54868,11 +54958,36 @@
"commands"
],
"example": {
"variables": {},
"runtime": "node",
"entrypoint": "index.js",
"commands": "npm install && npm run build"
}
},
"detectionVariable": {
"description": "DetectionVariable",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of environment variable",
"x-example": "NODE_ENV"
},
"value": {
"type": "string",
"description": "Value of environment variable",
"x-example": "production"
}
},
"required": [
"name",
"value"
],
"example": {
"name": "NODE_ENV",
"value": "production"
}
},
"vcsContent": {
"description": "VcsContents",
"type": "object",

View file

@ -7310,7 +7310,8 @@
"type": "string",
"description": "Default value for the attribute in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.",
"default": null,
"x-example": null
"x-example": null,
"x-nullable": true
},
"array": {
"type": "boolean",
@ -24073,7 +24074,7 @@
"parameters": [
{
"name": "queries",
"description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus",
"description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus, transformations",
"required": false,
"type": "array",
"collectionFormat": "multi",
@ -24232,6 +24233,12 @@
"description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled",
"default": true,
"x-example": false
},
"transformations": {
"type": "boolean",
"description": "Are image transformations enabled?",
"default": true,
"x-example": false
}
},
"required": [
@ -24433,6 +24440,12 @@
"description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled",
"default": true,
"x-example": false
},
"transformations": {
"type": "boolean",
"description": "Are image transformations enabled?",
"default": true,
"x-example": false
}
},
"required": [
@ -26457,7 +26470,7 @@
},
"rowSecurity": {
"type": "boolean",
"description": "Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
"description": "Enables configuring permissions for individual rows. A user needs one of row or table-level permissions to access a row. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
"default": false,
"x-example": false
},
@ -26950,7 +26963,8 @@
"type": "string",
"description": "Default value for the column in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when column is required.",
"default": null,
"x-example": null
"x-example": null,
"x-nullable": true
},
"array": {
"type": "boolean",
@ -42203,6 +42217,11 @@
"type": "boolean",
"description": "Virus scanning is enabled.",
"x-example": false
},
"transformations": {
"type": "boolean",
"description": "Image transformations are enabled.",
"x-example": false
}
},
"required": [
@ -42217,7 +42236,8 @@
"allowedFileExtensions",
"compression",
"encryption",
"antivirus"
"antivirus",
"transformations"
],
"example": {
"$id": "5e5ea5c16897e",
@ -42236,7 +42256,8 @@
],
"compression": "gzip",
"encryption": false,
"antivirus": false
"antivirus": false,
"transformations": false
}
},
"resourceToken": {

View file

@ -87,10 +87,11 @@ App::post('/v1/storage/buckets')
->param('compression', Compression::NONE, new WhiteList([Compression::NONE, Compression::GZIP, Compression::ZSTD], true), 'Compression algorithm choosen for compression. Can be one of ' . Compression::NONE . ', [' . Compression::GZIP . '](https://en.wikipedia.org/wiki/Gzip), or [' . Compression::ZSTD . '](https://en.wikipedia.org/wiki/Zstd), For file size above ' . Storage::human(APP_STORAGE_READ_BUFFER, 0) . ' compression is skipped even if it\'s enabled', true)
->param('encryption', true, new Boolean(true), 'Is encryption enabled? For file size above ' . Storage::human(APP_STORAGE_READ_BUFFER, 0) . ' encryption is skipped even if it\'s enabled', true)
->param('antivirus', true, new Boolean(true), 'Is virus scanning enabled? For file size above ' . Storage::human(APP_LIMIT_ANTIVIRUS, 0) . ' AntiVirus scanning is skipped even if it\'s enabled', true)
->param('transformations', true, new Boolean(true), 'Are image transformations enabled?', true)
->inject('response')
->inject('dbForProject')
->inject('queueForEvents')
->action(function (string $bucketId, string $name, ?array $permissions, bool $fileSecurity, bool $enabled, int $maximumFileSize, array $allowedFileExtensions, ?string $compression, ?bool $encryption, bool $antivirus, Response $response, Database $dbForProject, Event $queueForEvents) {
->action(function (string $bucketId, string $name, ?array $permissions, bool $fileSecurity, bool $enabled, int $maximumFileSize, array $allowedFileExtensions, ?string $compression, ?bool $encryption, bool $antivirus, bool $transformations, Response $response, Database $dbForProject, Event $queueForEvents) {
$bucketId = $bucketId === 'unique()' ? ID::unique() : $bucketId;
@ -143,6 +144,7 @@ App::post('/v1/storage/buckets')
'compression' => $compression,
'encryption' => $encryption,
'antivirus' => $antivirus,
'transformations' => $transformations,
'search' => implode(' ', [$bucketId, $name]),
]));
@ -300,10 +302,11 @@ App::put('/v1/storage/buckets/:bucketId')
->param('compression', Compression::NONE, new WhiteList([Compression::NONE, Compression::GZIP, Compression::ZSTD], true), 'Compression algorithm choosen for compression. Can be one of ' . Compression::NONE . ', [' . Compression::GZIP . '](https://en.wikipedia.org/wiki/Gzip), or [' . Compression::ZSTD . '](https://en.wikipedia.org/wiki/Zstd), For file size above ' . Storage::human(APP_STORAGE_READ_BUFFER, 0) . ' compression is skipped even if it\'s enabled', true)
->param('encryption', true, new Boolean(true), 'Is encryption enabled? For file size above ' . Storage::human(APP_STORAGE_READ_BUFFER, 0) . ' encryption is skipped even if it\'s enabled', true)
->param('antivirus', true, new Boolean(true), 'Is virus scanning enabled? For file size above ' . Storage::human(APP_LIMIT_ANTIVIRUS, 0) . ' AntiVirus scanning is skipped even if it\'s enabled', true)
->param('transformations', true, new Boolean(true), 'Are image transformations enabled?', true)
->inject('response')
->inject('dbForProject')
->inject('queueForEvents')
->action(function (string $bucketId, string $name, ?array $permissions, bool $fileSecurity, bool $enabled, ?int $maximumFileSize, array $allowedFileExtensions, ?string $compression, ?bool $encryption, bool $antivirus, Response $response, Database $dbForProject, Event $queueForEvents) {
->action(function (string $bucketId, string $name, ?array $permissions, bool $fileSecurity, bool $enabled, ?int $maximumFileSize, array $allowedFileExtensions, ?string $compression, ?bool $encryption, bool $antivirus, bool $transformations, Response $response, Database $dbForProject, Event $queueForEvents) {
$bucket = $dbForProject->getDocument('buckets', $bucketId);
if ($bucket->isEmpty()) {
@ -317,6 +320,7 @@ App::put('/v1/storage/buckets/:bucketId')
$encryption ??= $bucket->getAttribute('encryption', true);
$antivirus ??= $bucket->getAttribute('antivirus', true);
$compression ??= $bucket->getAttribute('compression', Compression::NONE);
$transformations ??= $bucket->getAttribute('transformations', true);
// Map aggregate permissions into the multiple permissions they represent.
$permissions = Permission::aggregate($permissions);
@ -330,7 +334,8 @@ App::put('/v1/storage/buckets/:bucketId')
->setAttribute('enabled', $enabled)
->setAttribute('encryption', $encryption)
->setAttribute('compression', $compression)
->setAttribute('antivirus', $antivirus));
->setAttribute('antivirus', $antivirus)
->setAttribute('transformations', $transformations));
$dbForProject->updateCollection('bucket_' . $bucket->getSequence(), $permissions, $fileSecurity);
@ -982,6 +987,10 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND);
}
if (!$bucket->getAttribute('transformations', true) && !$isAPIKey && !$isPrivilegedUser) {
throw new Exception(Exception::STORAGE_BUCKET_TRANSFORMATIONS_DISABLED);
}
$isToken = !$resourceToken->isEmpty() && $resourceToken->getAttribute('bucketInternalId') === $bucket->getSequence();
$fileSecurity = $bucket->getAttribute('fileSecurity', false);
$valid = $authorization->isValid(new Input(Database::PERMISSION_READ, $bucket->getRead()));

View file

@ -616,6 +616,10 @@ App::init()
throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND);
}
if (!$bucket->getAttribute('transformations', true) && !$isAppUser && !$isPrivilegedUser) {
throw new Exception(Exception::STORAGE_BUCKET_TRANSFORMATIONS_DISABLED);
}
$fileSecurity = $bucket->getAttribute('fileSecurity', false);
$valid = $authorization->isValid(new Input(Database::PERMISSION_READ, $bucket->getRead()));
if (!$fileSecurity && !$valid && !$isToken) {

View file

@ -7,7 +7,7 @@ Client client = Client()
Avatars avatars = Avatars(client);
// Downloading file
UInt8List bytes = await avatars.getBrowser(
Uint8List bytes = await avatars.getBrowser(
code: Browser.avantBrowser,
width: 0, // optional
height: 0, // optional

View file

@ -7,7 +7,7 @@ Client client = Client()
Avatars avatars = Avatars(client);
// Downloading file
UInt8List bytes = await avatars.getCreditCard(
Uint8List bytes = await avatars.getCreditCard(
code: CreditCard.americanExpress,
width: 0, // optional
height: 0, // optional

View file

@ -7,7 +7,7 @@ Client client = Client()
Avatars avatars = Avatars(client);
// Downloading file
UInt8List bytes = await avatars.getFavicon(
Uint8List bytes = await avatars.getFavicon(
url: 'https://example.com',
)

View file

@ -7,7 +7,7 @@ Client client = Client()
Avatars avatars = Avatars(client);
// Downloading file
UInt8List bytes = await avatars.getFlag(
Uint8List bytes = await avatars.getFlag(
code: Flag.afghanistan,
width: 0, // optional
height: 0, // optional

View file

@ -7,7 +7,7 @@ Client client = Client()
Avatars avatars = Avatars(client);
// Downloading file
UInt8List bytes = await avatars.getImage(
Uint8List bytes = await avatars.getImage(
url: 'https://example.com',
width: 0, // optional
height: 0, // optional

View file

@ -7,7 +7,7 @@ Client client = Client()
Avatars avatars = Avatars(client);
// Downloading file
UInt8List bytes = await avatars.getInitials(
Uint8List bytes = await avatars.getInitials(
name: '<NAME>', // optional
width: 0, // optional
height: 0, // optional

View file

@ -7,7 +7,7 @@ Client client = Client()
Avatars avatars = Avatars(client);
// Downloading file
UInt8List bytes = await avatars.getQR(
Uint8List bytes = await avatars.getQR(
text: '<TEXT>',
size: 1, // optional
margin: 0, // optional

View file

@ -7,7 +7,7 @@ Client client = Client()
Avatars avatars = Avatars(client);
// Downloading file
UInt8List bytes = await avatars.getScreenshot(
Uint8List bytes = await avatars.getScreenshot(
url: 'https://example.com',
headers: {}, // optional
viewportWidth: 1, // optional

View file

@ -7,7 +7,7 @@ Client client = Client()
Storage storage = Storage(client);
// Downloading file
UInt8List bytes = await storage.getFileDownload(
Uint8List bytes = await storage.getFileDownload(
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
token: '<TOKEN>', // optional

View file

@ -7,7 +7,7 @@ Client client = Client()
Storage storage = Storage(client);
// Downloading file
UInt8List bytes = await storage.getFilePreview(
Uint8List bytes = await storage.getFilePreview(
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
width: 0, // optional

View file

@ -7,7 +7,7 @@ Client client = Client()
Storage storage = Storage(client);
// Downloading file
UInt8List bytes = await storage.getFileView(
Uint8List bytes = await storage.getFileView(
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
token: '<TOKEN>', // optional

View file

@ -3,4 +3,5 @@ appwrite functions create-template-deployment \
--repository <REPOSITORY> \
--owner <OWNER> \
--root-directory <ROOT_DIRECTORY> \
--version <VERSION>
--type commit \
--reference <REFERENCE>

View file

@ -3,4 +3,5 @@ appwrite sites create-template-deployment \
--repository <REPOSITORY> \
--owner <OWNER> \
--root-directory <ROOT_DIRECTORY> \
--version <VERSION>
--type branch \
--reference <REFERENCE>

View file

@ -1,4 +1,4 @@
import { Client, Functions } from "@appwrite.io/console";
import { Client, Functions, } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@ -11,7 +11,8 @@ const result = await functions.createTemplateDeployment({
repository: '<REPOSITORY>',
owner: '<OWNER>',
rootDirectory: '<ROOT_DIRECTORY>',
version: '<VERSION>',
type: .Commit,
reference: '<REFERENCE>',
activate: false // optional
});

View file

@ -1,4 +1,4 @@
import { Client, Sites } from "@appwrite.io/console";
import { Client, Sites, } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@ -11,7 +11,8 @@ const result = await sites.createTemplateDeployment({
repository: '<REPOSITORY>',
owner: '<OWNER>',
rootDirectory: '<ROOT_DIRECTORY>',
version: '<VERSION>',
type: .Branch,
reference: '<REFERENCE>',
activate: false // optional
});

View file

@ -16,7 +16,8 @@ const result = await storage.createBucket({
allowedFileExtensions: [], // optional
compression: .None, // optional
encryption: false, // optional
antivirus: false // optional
antivirus: false, // optional
transformations: false // optional
});
console.log(result);

View file

@ -16,7 +16,8 @@ const result = await storage.updateBucket({
allowedFileExtensions: [], // optional
compression: .None, // optional
encryption: false, // optional
antivirus: false // optional
antivirus: false, // optional
transformations: false // optional
});
console.log(result);

View file

@ -7,7 +7,7 @@ Client client = Client()
Avatars avatars = Avatars(client);
UInt8List result = await avatars.getBrowser(
Uint8List result = await avatars.getBrowser(
code: Browser.avantBrowser,
width: 0, // (optional)
height: 0, // (optional)

View file

@ -7,7 +7,7 @@ Client client = Client()
Avatars avatars = Avatars(client);
UInt8List result = await avatars.getCreditCard(
Uint8List result = await avatars.getCreditCard(
code: CreditCard.americanExpress,
width: 0, // (optional)
height: 0, // (optional)

View file

@ -7,6 +7,6 @@ Client client = Client()
Avatars avatars = Avatars(client);
UInt8List result = await avatars.getFavicon(
Uint8List result = await avatars.getFavicon(
url: 'https://example.com',
);

View file

@ -7,7 +7,7 @@ Client client = Client()
Avatars avatars = Avatars(client);
UInt8List result = await avatars.getFlag(
Uint8List result = await avatars.getFlag(
code: Flag.afghanistan,
width: 0, // (optional)
height: 0, // (optional)

View file

@ -7,7 +7,7 @@ Client client = Client()
Avatars avatars = Avatars(client);
UInt8List result = await avatars.getImage(
Uint8List result = await avatars.getImage(
url: 'https://example.com',
width: 0, // (optional)
height: 0, // (optional)

View file

@ -7,7 +7,7 @@ Client client = Client()
Avatars avatars = Avatars(client);
UInt8List result = await avatars.getInitials(
Uint8List result = await avatars.getInitials(
name: '<NAME>', // (optional)
width: 0, // (optional)
height: 0, // (optional)

View file

@ -7,7 +7,7 @@ Client client = Client()
Avatars avatars = Avatars(client);
UInt8List result = await avatars.getQR(
Uint8List result = await avatars.getQR(
text: '<TEXT>',
size: 1, // (optional)
margin: 0, // (optional)

View file

@ -7,7 +7,7 @@ Client client = Client()
Avatars avatars = Avatars(client);
UInt8List result = await avatars.getScreenshot(
Uint8List result = await avatars.getScreenshot(
url: 'https://example.com',
headers: {}, // (optional)
viewportWidth: 1, // (optional)

View file

@ -12,6 +12,7 @@ Deployment result = await functions.createTemplateDeployment(
repository: '<REPOSITORY>',
owner: '<OWNER>',
rootDirectory: '<ROOT_DIRECTORY>',
version: '<VERSION>',
type: .commit,
reference: '<REFERENCE>',
activate: false, // (optional)
);

View file

@ -7,7 +7,7 @@ Client client = Client()
Functions functions = Functions(client);
UInt8List result = await functions.getDeploymentDownload(
Uint8List result = await functions.getDeploymentDownload(
functionId: '<FUNCTION_ID>',
deploymentId: '<DEPLOYMENT_ID>',
type: DeploymentDownloadType.source, // (optional)

View file

@ -12,6 +12,7 @@ Deployment result = await sites.createTemplateDeployment(
repository: '<REPOSITORY>',
owner: '<OWNER>',
rootDirectory: '<ROOT_DIRECTORY>',
version: '<VERSION>',
type: .branch,
reference: '<REFERENCE>',
activate: false, // (optional)
);

View file

@ -7,7 +7,7 @@ Client client = Client()
Sites sites = Sites(client);
UInt8List result = await sites.getDeploymentDownload(
Uint8List result = await sites.getDeploymentDownload(
siteId: '<SITE_ID>',
deploymentId: '<DEPLOYMENT_ID>',
type: DeploymentDownloadType.source, // (optional)

View file

@ -20,4 +20,5 @@ Bucket result = await storage.createBucket(
compression: .none, // (optional)
encryption: false, // (optional)
antivirus: false, // (optional)
transformations: false, // (optional)
);

View file

@ -7,7 +7,7 @@ Client client = Client()
Storage storage = Storage(client);
UInt8List result = await storage.getFileDownload(
Uint8List result = await storage.getFileDownload(
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
token: '<TOKEN>', // (optional)

View file

@ -7,7 +7,7 @@ Client client = Client()
Storage storage = Storage(client);
UInt8List result = await storage.getFilePreview(
Uint8List result = await storage.getFilePreview(
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
width: 0, // (optional)

View file

@ -7,7 +7,7 @@ Client client = Client()
Storage storage = Storage(client);
UInt8List result = await storage.getFileView(
Uint8List result = await storage.getFileView(
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
token: '<TOKEN>', // (optional)

View file

@ -20,4 +20,5 @@ Bucket result = await storage.updateBucket(
compression: .none, // (optional)
encryption: false, // (optional)
antivirus: false, // (optional)
transformations: false, // (optional)
);

View file

@ -1,4 +1,5 @@
using Appwrite;
using Appwrite.Enums;
using Appwrite.Models;
using Appwrite.Services;
@ -14,6 +15,7 @@ Deployment result = await functions.CreateTemplateDeployment(
repository: "<REPOSITORY>",
owner: "<OWNER>",
rootDirectory: "<ROOT_DIRECTORY>",
version: "<VERSION>",
type: .Commit,
reference: "<REFERENCE>",
activate: false // optional
);

View file

@ -1,4 +1,5 @@
using Appwrite;
using Appwrite.Enums;
using Appwrite.Models;
using Appwrite.Services;
@ -14,6 +15,7 @@ Deployment result = await sites.CreateTemplateDeployment(
repository: "<REPOSITORY>",
owner: "<OWNER>",
rootDirectory: "<ROOT_DIRECTORY>",
version: "<VERSION>",
type: .Branch,
reference: "<REFERENCE>",
activate: false // optional
);

View file

@ -20,5 +20,6 @@ Bucket result = await storage.CreateBucket(
allowedFileExtensions: new List<string>(), // optional
compression: .None, // optional
encryption: false, // optional
antivirus: false // optional
antivirus: false, // optional
transformations: false // optional
);

View file

@ -20,5 +20,6 @@ Bucket result = await storage.UpdateBucket(
allowedFileExtensions: new List<string>(), // optional
compression: .None, // optional
encryption: false, // optional
antivirus: false // optional
antivirus: false, // optional
transformations: false // optional
);

View file

@ -19,6 +19,7 @@ response, error := service.CreateTemplateDeployment(
"<REPOSITORY>",
"<OWNER>",
"<ROOT_DIRECTORY>",
"<VERSION>",
"commit",
"<REFERENCE>",
functions.WithCreateTemplateDeploymentActivate(false),
)

View file

@ -19,6 +19,7 @@ response, error := service.CreateTemplateDeployment(
"<REPOSITORY>",
"<OWNER>",
"<ROOT_DIRECTORY>",
"<VERSION>",
"branch",
"<REFERENCE>",
sites.WithCreateTemplateDeploymentActivate(false),
)

View file

@ -25,4 +25,5 @@ response, error := service.CreateBucket(
storage.WithCreateBucketCompression("none"),
storage.WithCreateBucketEncryption(false),
storage.WithCreateBucketAntivirus(false),
storage.WithCreateBucketTransformations(false),
)

View file

@ -25,4 +25,5 @@ response, error := service.UpdateBucket(
storage.WithUpdateBucketCompression("none"),
storage.WithUpdateBucketEncryption(false),
storage.WithUpdateBucketAntivirus(false),
storage.WithUpdateBucketTransformations(false),
)

View file

@ -4,7 +4,8 @@ mutation {
repository: "<REPOSITORY>",
owner: "<OWNER>",
rootDirectory: "<ROOT_DIRECTORY>",
version: "<VERSION>",
type: "commit",
reference: "<REFERENCE>",
activate: false
) {
_id

View file

@ -4,7 +4,8 @@ mutation {
repository: "<REPOSITORY>",
owner: "<OWNER>",
rootDirectory: "<ROOT_DIRECTORY>",
version: "<VERSION>",
type: "branch",
reference: "<REFERENCE>",
activate: false
) {
_id

View file

@ -9,7 +9,8 @@ mutation {
allowedFileExtensions: [],
compression: "none",
encryption: false,
antivirus: false
antivirus: false,
transformations: false
) {
_id
_createdAt
@ -23,5 +24,6 @@ mutation {
compression
encryption
antivirus
transformations
}
}

View file

@ -9,7 +9,8 @@ mutation {
allowedFileExtensions: [],
compression: "none",
encryption: false,
antivirus: false
antivirus: false,
transformations: false
) {
_id
_createdAt
@ -23,5 +24,6 @@ mutation {
compression
encryption
antivirus
transformations
}
}

View file

@ -1,6 +1,7 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Functions;
import io.appwrite.enums.Type;
Client client = new Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
@ -14,7 +15,8 @@ functions.createTemplateDeployment(
"<REPOSITORY>", // repository
"<OWNER>", // owner
"<ROOT_DIRECTORY>", // rootDirectory
"<VERSION>", // version
.COMMIT, // type
"<REFERENCE>", // reference
false, // activate (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {

View file

@ -1,6 +1,7 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Sites;
import io.appwrite.enums.Type;
Client client = new Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
@ -14,7 +15,8 @@ sites.createTemplateDeployment(
"<REPOSITORY>", // repository
"<OWNER>", // owner
"<ROOT_DIRECTORY>", // rootDirectory
"<VERSION>", // version
.BRANCH, // type
"<REFERENCE>", // reference
false, // activate (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {

View file

@ -22,6 +22,7 @@ storage.createBucket(
.NONE, // compression (optional)
false, // encryption (optional)
false, // antivirus (optional)
false, // transformations (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();

View file

@ -22,6 +22,7 @@ storage.updateBucket(
.NONE, // compression (optional)
false, // encryption (optional)
false, // antivirus (optional)
false, // transformations (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();

View file

@ -1,6 +1,7 @@
import io.appwrite.Client
import io.appwrite.coroutines.CoroutineCallback
import io.appwrite.services.Functions
import io.appwrite.enums.Type
val client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
@ -14,6 +15,7 @@ val response = functions.createTemplateDeployment(
repository = "<REPOSITORY>",
owner = "<OWNER>",
rootDirectory = "<ROOT_DIRECTORY>",
version = "<VERSION>",
type = .COMMIT,
reference = "<REFERENCE>",
activate = false // optional
)

View file

@ -1,6 +1,7 @@
import io.appwrite.Client
import io.appwrite.coroutines.CoroutineCallback
import io.appwrite.services.Sites
import io.appwrite.enums.Type
val client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
@ -14,6 +15,7 @@ val response = sites.createTemplateDeployment(
repository = "<REPOSITORY>",
owner = "<OWNER>",
rootDirectory = "<ROOT_DIRECTORY>",
version = "<VERSION>",
type = .BRANCH,
reference = "<REFERENCE>",
activate = false // optional
)

View file

@ -21,5 +21,6 @@ val response = storage.createBucket(
allowedFileExtensions = listOf(), // optional
compression = "none", // optional
encryption = false, // optional
antivirus = false // optional
antivirus = false, // optional
transformations = false // optional
)

View file

@ -21,5 +21,6 @@ val response = storage.updateBucket(
allowedFileExtensions = listOf(), // optional
compression = "none", // optional
encryption = false, // optional
antivirus = false // optional
antivirus = false, // optional
transformations = false // optional
)

View file

@ -12,6 +12,7 @@ const result = await functions.createTemplateDeployment({
repository: '<REPOSITORY>',
owner: '<OWNER>',
rootDirectory: '<ROOT_DIRECTORY>',
version: '<VERSION>',
type: sdk..Commit,
reference: '<REFERENCE>',
activate: false // optional
});

View file

@ -12,6 +12,7 @@ const result = await sites.createTemplateDeployment({
repository: '<REPOSITORY>',
owner: '<OWNER>',
rootDirectory: '<ROOT_DIRECTORY>',
version: '<VERSION>',
type: sdk..Branch,
reference: '<REFERENCE>',
activate: false // optional
});

View file

@ -17,5 +17,6 @@ const result = await storage.createBucket({
allowedFileExtensions: [], // optional
compression: sdk..None, // optional
encryption: false, // optional
antivirus: false // optional
antivirus: false, // optional
transformations: false // optional
});

View file

@ -17,5 +17,6 @@ const result = await storage.updateBucket({
allowedFileExtensions: [], // optional
compression: sdk..None, // optional
encryption: false, // optional
antivirus: false // optional
antivirus: false, // optional
transformations: false // optional
});

View file

@ -2,6 +2,7 @@
use Appwrite\Client;
use Appwrite\Services\Functions;
use Appwrite\Enums\Type;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@ -15,6 +16,7 @@ $result = $functions->createTemplateDeployment(
repository: '<REPOSITORY>',
owner: '<OWNER>',
rootDirectory: '<ROOT_DIRECTORY>',
version: '<VERSION>',
type: Type::COMMIT(),
reference: '<REFERENCE>',
activate: false // optional
);

View file

@ -2,6 +2,7 @@
use Appwrite\Client;
use Appwrite\Services\Sites;
use Appwrite\Enums\Type;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@ -15,6 +16,7 @@ $result = $sites->createTemplateDeployment(
repository: '<REPOSITORY>',
owner: '<OWNER>',
rootDirectory: '<ROOT_DIRECTORY>',
version: '<VERSION>',
type: Type::BRANCH(),
reference: '<REFERENCE>',
activate: false // optional
);

View file

@ -23,5 +23,6 @@ $result = $storage->createBucket(
allowedFileExtensions: [], // optional
compression: Compression::NONE(), // optional
encryption: false, // optional
antivirus: false // optional
antivirus: false, // optional
transformations: false // optional
);

View file

@ -23,5 +23,6 @@ $result = $storage->updateBucket(
allowedFileExtensions: [], // optional
compression: Compression::NONE(), // optional
encryption: false, // optional
antivirus: false // optional
antivirus: false, // optional
transformations: false // optional
);

View file

@ -1,5 +1,6 @@
from appwrite.client import Client
from appwrite.services.functions import Functions
from appwrite.enums import
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
@ -13,6 +14,7 @@ result = functions.create_template_deployment(
repository = '<REPOSITORY>',
owner = '<OWNER>',
root_directory = '<ROOT_DIRECTORY>',
version = '<VERSION>',
type = .COMMIT,
reference = '<REFERENCE>',
activate = False # optional
)

View file

@ -1,5 +1,6 @@
from appwrite.client import Client
from appwrite.services.sites import Sites
from appwrite.enums import
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
@ -13,6 +14,7 @@ result = sites.create_template_deployment(
repository = '<REPOSITORY>',
owner = '<OWNER>',
root_directory = '<ROOT_DIRECTORY>',
version = '<VERSION>',
type = .BRANCH,
reference = '<REFERENCE>',
activate = False # optional
)

View file

@ -20,5 +20,6 @@ result = storage.create_bucket(
allowed_file_extensions = [], # optional
compression = .NONE, # optional
encryption = False, # optional
antivirus = False # optional
antivirus = False, # optional
transformations = False # optional
)

View file

@ -20,5 +20,6 @@ result = storage.update_bucket(
allowed_file_extensions = [], # optional
compression = .NONE, # optional
encryption = False, # optional
antivirus = False # optional
antivirus = False, # optional
transformations = False # optional
)

View file

@ -9,6 +9,7 @@ X-Appwrite-Key: <YOUR_API_KEY>
"repository": "<REPOSITORY>",
"owner": "<OWNER>",
"rootDirectory": "<ROOT_DIRECTORY>",
"version": "<VERSION>",
"type": "commit",
"reference": "<REFERENCE>",
"activate": false
}

View file

@ -9,6 +9,7 @@ X-Appwrite-Key: <YOUR_API_KEY>
"repository": "<REPOSITORY>",
"owner": "<OWNER>",
"rootDirectory": "<ROOT_DIRECTORY>",
"version": "<VERSION>",
"type": "branch",
"reference": "<REFERENCE>",
"activate": false
}

View file

@ -15,5 +15,6 @@ X-Appwrite-Key: <YOUR_API_KEY>
"allowedFileExtensions": [],
"compression": "none",
"encryption": false,
"antivirus": false
"antivirus": false,
"transformations": false
}

View file

@ -14,5 +14,6 @@ X-Appwrite-Key: <YOUR_API_KEY>
"allowedFileExtensions": [],
"compression": "none",
"encryption": false,
"antivirus": false
"antivirus": false,
"transformations": false
}

View file

@ -1,6 +1,7 @@
require 'appwrite'
include Appwrite
include Appwrite::Enums
client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
@ -14,6 +15,7 @@ result = functions.create_template_deployment(
repository: '<REPOSITORY>',
owner: '<OWNER>',
root_directory: '<ROOT_DIRECTORY>',
version: '<VERSION>',
type: ::COMMIT,
reference: '<REFERENCE>',
activate: false # optional
)

View file

@ -1,6 +1,7 @@
require 'appwrite'
include Appwrite
include Appwrite::Enums
client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
@ -14,6 +15,7 @@ result = sites.create_template_deployment(
repository: '<REPOSITORY>',
owner: '<OWNER>',
root_directory: '<ROOT_DIRECTORY>',
version: '<VERSION>',
type: ::BRANCH,
reference: '<REFERENCE>',
activate: false # optional
)

View file

@ -21,5 +21,6 @@ result = storage.create_bucket(
allowed_file_extensions: [], # optional
compression: ::NONE, # optional
encryption: false, # optional
antivirus: false # optional
antivirus: false, # optional
transformations: false # optional
)

View file

@ -21,5 +21,6 @@ result = storage.update_bucket(
allowed_file_extensions: [], # optional
compression: ::NONE, # optional
encryption: false, # optional
antivirus: false # optional
antivirus: false, # optional
transformations: false # optional
)

View file

@ -1,4 +1,5 @@
import Appwrite
import AppwriteEnums
let client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
@ -12,7 +13,8 @@ let deployment = try await functions.createTemplateDeployment(
repository: "<REPOSITORY>",
owner: "<OWNER>",
rootDirectory: "<ROOT_DIRECTORY>",
version: "<VERSION>",
type: .commit,
reference: "<REFERENCE>",
activate: false // optional
)

View file

@ -1,4 +1,5 @@
import Appwrite
import AppwriteEnums
let client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
@ -12,7 +13,8 @@ let deployment = try await sites.createTemplateDeployment(
repository: "<REPOSITORY>",
owner: "<OWNER>",
rootDirectory: "<ROOT_DIRECTORY>",
version: "<VERSION>",
type: .branch,
reference: "<REFERENCE>",
activate: false // optional
)

View file

@ -18,6 +18,7 @@ let bucket = try await storage.createBucket(
allowedFileExtensions: [], // optional
compression: .none, // optional
encryption: false, // optional
antivirus: false // optional
antivirus: false, // optional
transformations: false // optional
)

View file

@ -18,6 +18,7 @@ let bucket = try await storage.updateBucket(
allowedFileExtensions: [], // optional
compression: .none, // optional
encryption: false, // optional
antivirus: false // optional
antivirus: false, // optional
transformations: false // optional
)

View file

@ -150,6 +150,7 @@ class Exception extends \Exception
public const string STORAGE_INVALID_RANGE = 'storage_invalid_range';
public const string STORAGE_INVALID_APPWRITE_ID = 'storage_invalid_appwrite_id';
public const string STORAGE_FILE_NOT_PUBLIC = 'storage_file_not_public';
public const string STORAGE_BUCKET_TRANSFORMATIONS_DISABLED = 'storage_bucket_transformations_disabled';
/** VCS */
public const string INSTALLATION_NOT_FOUND = 'installation_not_found';

View file

@ -140,6 +140,14 @@ class V23 extends Migration
Console::warning("Failed to migration error attribute size in collection {$id}: {$th->getMessage()}");
}
case 'buckets':
try {
$this->createAttributeFromCollection($this->dbForProject, $id, 'transformations');
} catch (Throwable $th) {
Console::warning("'transformations' from {$id}: {$th->getMessage()}");
}
$this->dbForProject->purgeCachedCollection($id);
break;
default:
break;
}

View file

@ -10,7 +10,8 @@ class Buckets extends Base
'fileSecurity',
'maximumFileSize',
'encryption',
'antivirus'
'antivirus',
'transformations',
];
/**

View file

@ -86,6 +86,12 @@ class Bucket extends Model
'default' => true,
'example' => false,
])
->addRule('transformations', [
'type' => self::TYPE_BOOLEAN,
'description' => 'Image transformations are enabled.',
'default' => true,
'example' => false,
])
;
}

View file

@ -2,6 +2,7 @@
namespace Tests\E2E\Services\Storage;
use CURLFile;
use Tests\E2E\Client;
use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\Scope;
@ -107,4 +108,56 @@ class StorageConsoleClientTest extends Scope
$this->assertIsArray($response['body']['imageTransformations']);
$this->assertIsNumeric($response['body']['imageTransformationsTotal']);
}
public function testCreateBucketTransformationsDisabledConsole(): void
{
// Create a bucket with default settings
$bucket = $this->client->call(Client::METHOD_POST, '/storage/buckets', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [
'bucketId' => ID::unique(),
'name' => 'Test Console Bucket Transformations Disabled',
]);
$this->assertEquals(201, $bucket['headers']['status-code']);
// Create a file in the bucket
$file = $this->client->call(Client::METHOD_POST, '/storage/buckets/' . $bucket['body']['$id'] . '/files', array_merge([
'content-type' => 'multipart/form-data',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [
'fileId' => ID::unique(),
'file' => new CURLFile(realpath(__DIR__ . '/../../../resources/logo.png'), 'image/png', 'transformations.png'),
]);
$this->assertEquals(201, $file['headers']['status-code']);
// Try to get the file preview
$preview = $this->client->call(Client::METHOD_GET, '/storage/buckets/' . $bucket['body']['$id'] . '/files/' . $file['body']['$id'] . '/preview', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()));
$this->assertEquals(200, $preview['headers']['status-code']);
// Update the bucket to disable transformations
$bucket = $this->client->call(Client::METHOD_PUT, '/storage/buckets/' . $bucket['body']['$id'], array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [
'name' => 'Test Bucket Transformations Disabled',
'transformations' => false,
]);
// Try to get the file preview again
$preview = $this->client->call(Client::METHOD_GET, '/storage/buckets/' . $bucket['body']['$id'] . '/files/' . $file['body']['$id'] . '/preview', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()));
$this->assertEquals(200, $preview['headers']['status-code']); // Returns 200 since image transformations are not counted for console requests
// Delete the bucket
$response = $this->client->call(Client::METHOD_DELETE, '/storage/buckets/' . $bucket['body']['$id'], array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()));
$this->assertEquals(204, $response['headers']['status-code']);
}
}

View file

@ -1386,4 +1386,65 @@ class StorageCustomClientTest extends Scope
$this->assertStringContainsString('users', $file['body']['message']);
$this->assertStringContainsString('user:' . $this->getUser()['$id'], $file['body']['message']);
}
public function testCreateBucketTransformationsDisabled(): void
{
// Create a bucket with default settings
$bucket = $this->client->call(Client::METHOD_POST, '/storage/buckets', [
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-key' => $this->getProject()['apiKey'],
], [
'bucketId' => ID::unique(),
'name' => 'Test Bucket Transformations Disabled',
'permissions' => [
Permission::read(Role::any())
],
]);
$this->assertEquals(201, $bucket['headers']['status-code']);
// Create a file in the bucket
$file = $this->client->call(Client::METHOD_POST, '/storage/buckets/' . $bucket['body']['$id'] . '/files', [
'content-type' => 'multipart/form-data',
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-key' => $this->getProject()['apiKey'],
], [
'fileId' => ID::unique(),
'file' => new CURLFile(realpath(__DIR__ . '/../../../resources/logo.png'), 'image/png', 'transformations.png'),
]);
$this->assertEquals(201, $file['headers']['status-code']);
// Try to get the file preview
$preview = $this->client->call(Client::METHOD_GET, '/storage/buckets/' . $bucket['body']['$id'] . '/files/' . $file['body']['$id'] . '/preview', [
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
]);
$this->assertEquals(200, $preview['headers']['status-code']);
// Update the bucket to disable transformations
$bucket = $this->client->call(Client::METHOD_PUT, '/storage/buckets/' . $bucket['body']['$id'], [
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-key' => $this->getProject()['apiKey'],
], [
'name' => 'Test Bucket Transformations Disabled',
'transformations' => false,
]);
// Try to get the file preview again
$preview = $this->client->call(Client::METHOD_GET, '/storage/buckets/' . $bucket['body']['$id'] . '/files/' . $file['body']['$id'] . '/preview', [
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
]);
$this->assertEquals(403, $preview['headers']['status-code']);
$this->assertStringContainsString('Image transformations are disabled for the requested bucket.', $preview['body']['message']);
// Delete the bucket
$response = $this->client->call(Client::METHOD_DELETE, '/storage/buckets/' . $bucket['body']['$id'], [
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-key' => $this->getProject()['apiKey'],
]);
$this->assertEquals(204, $response['headers']['status-code']);
}
}