mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Merge branch '1.7.x' into feat-sites
This commit is contained in:
+2
-4
@@ -12,7 +12,7 @@ RUN composer install --ignore-platform-reqs --optimize-autoloader \
|
||||
--no-plugins --no-scripts --prefer-dist \
|
||||
`if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi`
|
||||
|
||||
FROM appwrite/base:0.9.5 AS final
|
||||
FROM appwrite/base:0.10.1 AS final
|
||||
|
||||
LABEL maintainer="team@appwrite.io"
|
||||
|
||||
@@ -89,9 +89,7 @@ RUN chmod +x /usr/local/bin/doctor && \
|
||||
chmod +x /usr/local/bin/worker-stats-usage && \
|
||||
chmod +x /usr/local/bin/worker-stats-usage-dump && \
|
||||
chmod +x /usr/local/bin/stats-resources && \
|
||||
chmod +x /usr/local/bin/worker-stats-resources && \
|
||||
chmod +x /usr/local/bin/worker-usage && \
|
||||
chmod +x /usr/local/bin/worker-usage-dump
|
||||
chmod +x /usr/local/bin/worker-stats-resources
|
||||
|
||||
# Letsencrypt Permissions
|
||||
RUN mkdir -p /etc/letsencrypt/live/ && chmod -Rf 755 /etc/letsencrypt/live/
|
||||
|
||||
+3
-3
@@ -72,7 +72,7 @@ docker run -it --rm \
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock \
|
||||
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
|
||||
--entrypoint="install" \
|
||||
appwrite/appwrite:1.6.1
|
||||
appwrite/appwrite:1.6.2
|
||||
```
|
||||
|
||||
### Windows
|
||||
@@ -84,7 +84,7 @@ docker run -it --rm ^
|
||||
--volume //var/run/docker.sock:/var/run/docker.sock ^
|
||||
--volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
|
||||
--entrypoint="install" ^
|
||||
appwrite/appwrite:1.6.1
|
||||
appwrite/appwrite:1.6.2
|
||||
```
|
||||
|
||||
#### PowerShell
|
||||
@@ -94,7 +94,7 @@ docker run -it --rm `
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock `
|
||||
--volume ${pwd}/appwrite:/usr/src/code/appwrite:rw `
|
||||
--entrypoint="install" `
|
||||
appwrite/appwrite:1.6.1
|
||||
appwrite/appwrite:1.6.2
|
||||
```
|
||||
|
||||
运行后,可以在浏览器上访问 http://localhost 找到 Appwrite 控制台。在非 Linux 的本机主机上完成安装后,服务器可能需要几分钟才能启动。
|
||||
|
||||
@@ -79,7 +79,7 @@ docker run -it --rm \
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock \
|
||||
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
|
||||
--entrypoint="install" \
|
||||
appwrite/appwrite:1.6.1
|
||||
appwrite/appwrite:1.6.2
|
||||
```
|
||||
|
||||
### Windows
|
||||
@@ -91,7 +91,7 @@ docker run -it --rm ^
|
||||
--volume //var/run/docker.sock:/var/run/docker.sock ^
|
||||
--volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
|
||||
--entrypoint="install" ^
|
||||
appwrite/appwrite:1.6.1
|
||||
appwrite/appwrite:1.6.2
|
||||
```
|
||||
|
||||
#### PowerShell
|
||||
@@ -101,7 +101,7 @@ docker run -it --rm `
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock `
|
||||
--volume ${pwd}/appwrite:/usr/src/code/appwrite:rw `
|
||||
--entrypoint="install" `
|
||||
appwrite/appwrite:1.6.1
|
||||
appwrite/appwrite:1.6.2
|
||||
```
|
||||
|
||||
Once the Docker installation is complete, go to http://localhost to access the Appwrite console from your browser. Please note that on non-Linux native hosts, the server might take a few minutes to start after completing the installation.
|
||||
|
||||
@@ -99,6 +99,10 @@ CLI::setResource('dbForPlatform', function ($pools, $cache) {
|
||||
return $dbForPlatform;
|
||||
}, ['pools', 'cache']);
|
||||
|
||||
CLI::setResource('console', function () {
|
||||
return new Document(Config::getParam('console'));
|
||||
}, []);
|
||||
|
||||
CLI::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform, $cache) {
|
||||
$databases = []; // TODO: @Meldiron This should probably be responsibility of utopia-php/pools
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Initializes console project document.
|
||||
*/
|
||||
|
||||
use Appwrite\Auth\Auth;
|
||||
use Appwrite\Network\Validator\Origin;
|
||||
use Utopia\Database\Helpers\ID;
|
||||
use Utopia\System\System;
|
||||
|
||||
$console = [
|
||||
'$id' => ID::custom('console'),
|
||||
'$internalId' => ID::custom('console'),
|
||||
'name' => 'Appwrite',
|
||||
'$collection' => ID::custom('projects'),
|
||||
'description' => 'Appwrite core engine',
|
||||
'logo' => '',
|
||||
'teamId' => null,
|
||||
'webhooks' => [],
|
||||
'keys' => [],
|
||||
'platforms' => [
|
||||
[
|
||||
'$collection' => ID::custom('platforms'),
|
||||
'name' => 'Localhost',
|
||||
'type' => Origin::CLIENT_TYPE_WEB,
|
||||
'hostname' => 'localhost',
|
||||
], // Current host is added on app init
|
||||
],
|
||||
'legalName' => '',
|
||||
'legalCountry' => '',
|
||||
'legalState' => '',
|
||||
'legalCity' => '',
|
||||
'legalAddress' => '',
|
||||
'legalTaxId' => '',
|
||||
'auths' => [
|
||||
'mockNumbers' => [],
|
||||
'invites' => System::getEnv('_APP_CONSOLE_INVITES', 'enabled') === 'enabled',
|
||||
'limit' => (System::getEnv('_APP_CONSOLE_WHITELIST_ROOT', 'enabled') === 'enabled') ? 1 : 0, // limit signup to 1 user
|
||||
'duration' => Auth::TOKEN_EXPIRATION_LOGIN_LONG, // 1 Year in seconds
|
||||
'sessionAlerts' => System::getEnv('_APP_CONSOLE_SESSION_ALERTS', 'disabled') === 'enabled'
|
||||
],
|
||||
'authWhitelistEmails' => (!empty(System::getEnv('_APP_CONSOLE_WHITELIST_EMAILS', null))) ? \explode(',', System::getEnv('_APP_CONSOLE_WHITELIST_EMAILS', null)) : [],
|
||||
'authWhitelistIPs' => (!empty(System::getEnv('_APP_CONSOLE_WHITELIST_IPS', null))) ? \explode(',', System::getEnv('_APP_CONSOLE_WHITELIST_IPS', null)) : [],
|
||||
'oAuthProviders' => [
|
||||
'githubEnabled' => true,
|
||||
'githubSecret' => System::getEnv('_APP_CONSOLE_GITHUB_SECRET', ''),
|
||||
'githubAppid' => System::getEnv('_APP_CONSOLE_GITHUB_APP_ID', '')
|
||||
],
|
||||
];
|
||||
|
||||
return $console;
|
||||
@@ -3383,7 +3383,7 @@
|
||||
"parameters": [
|
||||
{
|
||||
"name": "code",
|
||||
"description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.",
|
||||
"description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
@@ -3404,7 +3404,8 @@
|
||||
"union-china-pay",
|
||||
"visa",
|
||||
"mir",
|
||||
"maestro"
|
||||
"maestro",
|
||||
"rupay"
|
||||
],
|
||||
"x-enum-name": "CreditCard",
|
||||
"x-enum-keys": [
|
||||
@@ -3423,7 +3424,8 @@
|
||||
"Union China Pay",
|
||||
"Visa",
|
||||
"MIR",
|
||||
"Maestro"
|
||||
"Maestro",
|
||||
"Rupay"
|
||||
]
|
||||
},
|
||||
"in": "path"
|
||||
@@ -4365,7 +4367,7 @@
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
"description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.",
|
||||
"description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n",
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "Document",
|
||||
|
||||
@@ -3387,7 +3387,7 @@
|
||||
"parameters": [
|
||||
{
|
||||
"name": "code",
|
||||
"description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.",
|
||||
"description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
@@ -3408,7 +3408,8 @@
|
||||
"union-china-pay",
|
||||
"visa",
|
||||
"mir",
|
||||
"maestro"
|
||||
"maestro",
|
||||
"rupay"
|
||||
],
|
||||
"x-enum-name": "CreditCard",
|
||||
"x-enum-keys": [
|
||||
@@ -3427,7 +3428,8 @@
|
||||
"Union China Pay",
|
||||
"Visa",
|
||||
"MIR",
|
||||
"Maestro"
|
||||
"Maestro",
|
||||
"Rupay"
|
||||
]
|
||||
},
|
||||
"in": "path"
|
||||
@@ -6407,8 +6409,6 @@
|
||||
},
|
||||
"required": [
|
||||
"required",
|
||||
"min",
|
||||
"max",
|
||||
"default"
|
||||
]
|
||||
}
|
||||
@@ -6644,8 +6644,6 @@
|
||||
},
|
||||
"required": [
|
||||
"required",
|
||||
"min",
|
||||
"max",
|
||||
"default"
|
||||
]
|
||||
}
|
||||
@@ -7823,7 +7821,7 @@
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
"description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.",
|
||||
"description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n",
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "Document",
|
||||
@@ -11585,7 +11583,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getCertificate",
|
||||
"weight": 134,
|
||||
"weight": 133,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -11692,7 +11690,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getPubSub",
|
||||
"weight": 130,
|
||||
"weight": 129,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -11718,54 +11716,6 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/health\/queue": {
|
||||
"get": {
|
||||
"summary": "Get queue",
|
||||
"operationId": "healthGetQueue",
|
||||
"tags": [
|
||||
"health"
|
||||
],
|
||||
"description": "Check the Appwrite queue messaging servers are up and connection is successful.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Health Status",
|
||||
"content": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/healthStatus"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueue",
|
||||
"weight": 129,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "health\/get-queue.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "health.read",
|
||||
"platforms": [
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Key": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/health\/queue\/builds": {
|
||||
"get": {
|
||||
"summary": "Get builds queue",
|
||||
@@ -11788,7 +11738,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueBuilds",
|
||||
"weight": 136,
|
||||
"weight": 135,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -11849,7 +11799,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueCertificates",
|
||||
"weight": 135,
|
||||
"weight": 134,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -11910,7 +11860,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueDatabases",
|
||||
"weight": 137,
|
||||
"weight": 136,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -11982,7 +11932,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueDeletes",
|
||||
"weight": 138,
|
||||
"weight": 137,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -12081,8 +12031,9 @@
|
||||
"v1-audits",
|
||||
"v1-mails",
|
||||
"v1-functions",
|
||||
"v1-usage",
|
||||
"v1-usage-dump",
|
||||
"v1-stats-resources",
|
||||
"v1-stats-usage",
|
||||
"v1-stats-usage-dump",
|
||||
"v1-webhooks",
|
||||
"v1-certificates",
|
||||
"v1-builds",
|
||||
@@ -12130,7 +12081,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueFunctions",
|
||||
"weight": 142,
|
||||
"weight": 141,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -12191,7 +12142,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueLogs",
|
||||
"weight": 133,
|
||||
"weight": 132,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -12252,7 +12203,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueMails",
|
||||
"weight": 139,
|
||||
"weight": 138,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -12313,7 +12264,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueMessaging",
|
||||
"weight": 140,
|
||||
"weight": 139,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -12374,7 +12325,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueMigrations",
|
||||
"weight": 141,
|
||||
"weight": 140,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -12413,14 +12364,14 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/health\/queue\/usage": {
|
||||
"\/health\/queue\/stats-resources": {
|
||||
"get": {
|
||||
"summary": "Get usage queue",
|
||||
"operationId": "healthGetQueueUsage",
|
||||
"summary": "Get stats resources queue",
|
||||
"operationId": "healthGetQueueStatsResources",
|
||||
"tags": [
|
||||
"health"
|
||||
],
|
||||
"description": "Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.",
|
||||
"description": "Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Health Queue",
|
||||
@@ -12434,13 +12385,13 @@
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueUsage",
|
||||
"weight": 143,
|
||||
"method": "getQueueStatsResources",
|
||||
"weight": 142,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "health\/get-queue-usage.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage.md",
|
||||
"demo": "health\/get-queue-stats-resources.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-resources.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
@@ -12474,10 +12425,71 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/health\/queue\/usage-dump": {
|
||||
"\/health\/queue\/stats-usage": {
|
||||
"get": {
|
||||
"summary": "Get stats usage queue",
|
||||
"operationId": "healthGetQueueUsage",
|
||||
"tags": [
|
||||
"health"
|
||||
],
|
||||
"description": "Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Health Queue",
|
||||
"content": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/healthQueue"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueUsage",
|
||||
"weight": 143,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "health\/get-queue-usage.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "health.read",
|
||||
"platforms": [
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Key": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "threshold",
|
||||
"description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"default": 5000
|
||||
},
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/health\/queue\/stats-usage-dump": {
|
||||
"get": {
|
||||
"summary": "Get usage dump queue",
|
||||
"operationId": "healthGetQueueUsageDump",
|
||||
"operationId": "healthGetQueueStatsUsageDump",
|
||||
"tags": [
|
||||
"health"
|
||||
],
|
||||
@@ -12495,13 +12507,13 @@
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueUsageDump",
|
||||
"method": "getQueueStatsUsageDump",
|
||||
"weight": 144,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "health\/get-queue-usage-dump.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage-dump.md",
|
||||
"demo": "health\/get-queue-stats-usage-dump.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage-dump.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
@@ -12557,7 +12569,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueWebhooks",
|
||||
"weight": 132,
|
||||
"weight": 131,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -12714,7 +12726,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getTime",
|
||||
"weight": 131,
|
||||
"weight": 130,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -17609,17 +17621,17 @@
|
||||
},
|
||||
"endpoint": {
|
||||
"type": "string",
|
||||
"description": "Source's Appwrite Endpoint",
|
||||
"description": "Source Appwrite endpoint",
|
||||
"x-example": "https:\/\/example.com"
|
||||
},
|
||||
"projectId": {
|
||||
"type": "string",
|
||||
"description": "Source's Project ID",
|
||||
"description": "Source Project ID",
|
||||
"x-example": "<PROJECT_ID>"
|
||||
},
|
||||
"apiKey": {
|
||||
"type": "string",
|
||||
"description": "Source's API Key",
|
||||
"description": "Source API Key",
|
||||
"x-example": "<API_KEY>"
|
||||
}
|
||||
},
|
||||
@@ -36052,6 +36064,20 @@
|
||||
"$ref": "#\/components\/schemas\/metric"
|
||||
},
|
||||
"x-example": []
|
||||
},
|
||||
"imageTransformations": {
|
||||
"type": "array",
|
||||
"description": "Aggregated number of files transformations per period.",
|
||||
"items": {
|
||||
"$ref": "#\/components\/schemas\/metric"
|
||||
},
|
||||
"x-example": []
|
||||
},
|
||||
"imageTransformationsTotal": {
|
||||
"type": "integer",
|
||||
"description": "Total aggregated number of files transformations.",
|
||||
"x-example": 0,
|
||||
"format": "int32"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -36059,7 +36085,9 @@
|
||||
"filesTotal",
|
||||
"filesStorageTotal",
|
||||
"files",
|
||||
"storage"
|
||||
"storage",
|
||||
"imageTransformations",
|
||||
"imageTransformationsTotal"
|
||||
]
|
||||
},
|
||||
"usageFunctions": {
|
||||
@@ -36597,6 +36625,20 @@
|
||||
"$ref": "#\/components\/schemas\/metric"
|
||||
},
|
||||
"x-example": []
|
||||
},
|
||||
"imageTransformations": {
|
||||
"type": "array",
|
||||
"description": "An array of aggregated number of image transformations.",
|
||||
"items": {
|
||||
"$ref": "#\/components\/schemas\/metric"
|
||||
},
|
||||
"x-example": []
|
||||
},
|
||||
"imageTransformationsTotal": {
|
||||
"type": "integer",
|
||||
"description": "Total aggregated number of image transformations.",
|
||||
"x-example": 0,
|
||||
"format": "int32"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -36628,7 +36670,9 @@
|
||||
"authPhoneEstimate",
|
||||
"authPhoneCountryBreakdown",
|
||||
"databasesReads",
|
||||
"databasesWrites"
|
||||
"databasesWrites",
|
||||
"imageTransformations",
|
||||
"imageTransformationsTotal"
|
||||
]
|
||||
},
|
||||
"headers": {
|
||||
|
||||
@@ -3077,7 +3077,7 @@
|
||||
"parameters": [
|
||||
{
|
||||
"name": "code",
|
||||
"description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.",
|
||||
"description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
@@ -3098,7 +3098,8 @@
|
||||
"union-china-pay",
|
||||
"visa",
|
||||
"mir",
|
||||
"maestro"
|
||||
"maestro",
|
||||
"rupay"
|
||||
],
|
||||
"x-enum-name": "CreditCard",
|
||||
"x-enum-keys": [
|
||||
@@ -3117,7 +3118,8 @@
|
||||
"Union China Pay",
|
||||
"Visa",
|
||||
"MIR",
|
||||
"Maestro"
|
||||
"Maestro",
|
||||
"Rupay"
|
||||
]
|
||||
},
|
||||
"in": "path"
|
||||
@@ -5951,8 +5953,6 @@
|
||||
},
|
||||
"required": [
|
||||
"required",
|
||||
"min",
|
||||
"max",
|
||||
"default"
|
||||
]
|
||||
}
|
||||
@@ -6190,8 +6190,6 @@
|
||||
},
|
||||
"required": [
|
||||
"required",
|
||||
"min",
|
||||
"max",
|
||||
"default"
|
||||
]
|
||||
}
|
||||
@@ -7381,7 +7379,7 @@
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
"description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.",
|
||||
"description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n",
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "Document",
|
||||
@@ -10461,7 +10459,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getCertificate",
|
||||
"weight": 134,
|
||||
"weight": 133,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -10570,7 +10568,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getPubSub",
|
||||
"weight": 130,
|
||||
"weight": 129,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -10597,55 +10595,6 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/health\/queue": {
|
||||
"get": {
|
||||
"summary": "Get queue",
|
||||
"operationId": "healthGetQueue",
|
||||
"tags": [
|
||||
"health"
|
||||
],
|
||||
"description": "Check the Appwrite queue messaging servers are up and connection is successful.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Health Status",
|
||||
"content": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/healthStatus"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueue",
|
||||
"weight": 129,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "health\/get-queue.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "health.read",
|
||||
"platforms": [
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": [],
|
||||
"Key": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Key": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/health\/queue\/builds": {
|
||||
"get": {
|
||||
"summary": "Get builds queue",
|
||||
@@ -10668,7 +10617,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueBuilds",
|
||||
"weight": 136,
|
||||
"weight": 135,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -10730,7 +10679,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueCertificates",
|
||||
"weight": 135,
|
||||
"weight": 134,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -10792,7 +10741,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueDatabases",
|
||||
"weight": 137,
|
||||
"weight": 136,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -10865,7 +10814,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueDeletes",
|
||||
"weight": 138,
|
||||
"weight": 137,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -10966,8 +10915,9 @@
|
||||
"v1-audits",
|
||||
"v1-mails",
|
||||
"v1-functions",
|
||||
"v1-usage",
|
||||
"v1-usage-dump",
|
||||
"v1-stats-resources",
|
||||
"v1-stats-usage",
|
||||
"v1-stats-usage-dump",
|
||||
"v1-webhooks",
|
||||
"v1-certificates",
|
||||
"v1-builds",
|
||||
@@ -11015,7 +10965,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueFunctions",
|
||||
"weight": 142,
|
||||
"weight": 141,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -11077,7 +11027,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueLogs",
|
||||
"weight": 133,
|
||||
"weight": 132,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -11139,7 +11089,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueMails",
|
||||
"weight": 139,
|
||||
"weight": 138,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -11201,7 +11151,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueMessaging",
|
||||
"weight": 140,
|
||||
"weight": 139,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -11263,7 +11213,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueMigrations",
|
||||
"weight": 141,
|
||||
"weight": 140,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -11303,14 +11253,14 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/health\/queue\/usage": {
|
||||
"\/health\/queue\/stats-resources": {
|
||||
"get": {
|
||||
"summary": "Get usage queue",
|
||||
"operationId": "healthGetQueueUsage",
|
||||
"summary": "Get stats resources queue",
|
||||
"operationId": "healthGetQueueStatsResources",
|
||||
"tags": [
|
||||
"health"
|
||||
],
|
||||
"description": "Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.",
|
||||
"description": "Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Health Queue",
|
||||
@@ -11324,13 +11274,13 @@
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueUsage",
|
||||
"weight": 143,
|
||||
"method": "getQueueStatsResources",
|
||||
"weight": 142,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "health\/get-queue-usage.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage.md",
|
||||
"demo": "health\/get-queue-stats-resources.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-resources.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
@@ -11365,10 +11315,72 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/health\/queue\/usage-dump": {
|
||||
"\/health\/queue\/stats-usage": {
|
||||
"get": {
|
||||
"summary": "Get stats usage queue",
|
||||
"operationId": "healthGetQueueUsage",
|
||||
"tags": [
|
||||
"health"
|
||||
],
|
||||
"description": "Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Health Queue",
|
||||
"content": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/healthQueue"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueUsage",
|
||||
"weight": 143,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "health\/get-queue-usage.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "health.read",
|
||||
"platforms": [
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": [],
|
||||
"Key": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Key": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "threshold",
|
||||
"description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"default": 5000
|
||||
},
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/health\/queue\/stats-usage-dump": {
|
||||
"get": {
|
||||
"summary": "Get usage dump queue",
|
||||
"operationId": "healthGetQueueUsageDump",
|
||||
"operationId": "healthGetQueueStatsUsageDump",
|
||||
"tags": [
|
||||
"health"
|
||||
],
|
||||
@@ -11386,13 +11398,13 @@
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueUsageDump",
|
||||
"method": "getQueueStatsUsageDump",
|
||||
"weight": 144,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "health\/get-queue-usage-dump.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage-dump.md",
|
||||
"demo": "health\/get-queue-stats-usage-dump.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage-dump.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
@@ -11449,7 +11461,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueWebhooks",
|
||||
"weight": 132,
|
||||
"weight": 131,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -11609,7 +11621,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getTime",
|
||||
"weight": 131,
|
||||
"weight": 130,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
|
||||
@@ -3557,7 +3557,7 @@
|
||||
"parameters": [
|
||||
{
|
||||
"name": "code",
|
||||
"description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.",
|
||||
"description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.",
|
||||
"required": true,
|
||||
"type": "string",
|
||||
"x-example": "amex",
|
||||
@@ -3577,7 +3577,8 @@
|
||||
"union-china-pay",
|
||||
"visa",
|
||||
"mir",
|
||||
"maestro"
|
||||
"maestro",
|
||||
"rupay"
|
||||
],
|
||||
"x-enum-name": "CreditCard",
|
||||
"x-enum-keys": [
|
||||
@@ -3596,7 +3597,8 @@
|
||||
"Union China Pay",
|
||||
"Visa",
|
||||
"MIR",
|
||||
"Maestro"
|
||||
"Maestro",
|
||||
"Rupay"
|
||||
],
|
||||
"in": "path"
|
||||
},
|
||||
@@ -4547,7 +4549,7 @@
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
"description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.",
|
||||
"description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n",
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "Document",
|
||||
|
||||
@@ -3577,7 +3577,7 @@
|
||||
"parameters": [
|
||||
{
|
||||
"name": "code",
|
||||
"description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.",
|
||||
"description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.",
|
||||
"required": true,
|
||||
"type": "string",
|
||||
"x-example": "amex",
|
||||
@@ -3597,7 +3597,8 @@
|
||||
"union-china-pay",
|
||||
"visa",
|
||||
"mir",
|
||||
"maestro"
|
||||
"maestro",
|
||||
"rupay"
|
||||
],
|
||||
"x-enum-name": "CreditCard",
|
||||
"x-enum-keys": [
|
||||
@@ -3616,7 +3617,8 @@
|
||||
"Union China Pay",
|
||||
"Visa",
|
||||
"MIR",
|
||||
"Maestro"
|
||||
"Maestro",
|
||||
"Rupay"
|
||||
],
|
||||
"in": "path"
|
||||
},
|
||||
@@ -6607,8 +6609,6 @@
|
||||
},
|
||||
"required": [
|
||||
"required",
|
||||
"min",
|
||||
"max",
|
||||
"default"
|
||||
]
|
||||
}
|
||||
@@ -6845,8 +6845,6 @@
|
||||
},
|
||||
"required": [
|
||||
"required",
|
||||
"min",
|
||||
"max",
|
||||
"default"
|
||||
]
|
||||
}
|
||||
@@ -8012,7 +8010,7 @@
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
"description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.",
|
||||
"description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n",
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "Document",
|
||||
@@ -11810,7 +11808,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getCertificate",
|
||||
"weight": 134,
|
||||
"weight": 133,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -11919,7 +11917,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getPubSub",
|
||||
"weight": 130,
|
||||
"weight": 129,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -11945,56 +11943,6 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/health\/queue": {
|
||||
"get": {
|
||||
"summary": "Get queue",
|
||||
"operationId": "healthGetQueue",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"health"
|
||||
],
|
||||
"description": "Check the Appwrite queue messaging servers are up and connection is successful.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Health Status",
|
||||
"schema": {
|
||||
"$ref": "#\/definitions\/healthStatus"
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueue",
|
||||
"weight": 129,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "health\/get-queue.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "health.read",
|
||||
"platforms": [
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Key": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/health\/queue\/builds": {
|
||||
"get": {
|
||||
"summary": "Get builds queue",
|
||||
@@ -12019,7 +11967,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueBuilds",
|
||||
"weight": 136,
|
||||
"weight": 135,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -12080,7 +12028,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueCertificates",
|
||||
"weight": 135,
|
||||
"weight": 134,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -12141,7 +12089,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueDatabases",
|
||||
"weight": 137,
|
||||
"weight": 136,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -12211,7 +12159,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueDeletes",
|
||||
"weight": 138,
|
||||
"weight": 137,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -12309,8 +12257,9 @@
|
||||
"v1-audits",
|
||||
"v1-mails",
|
||||
"v1-functions",
|
||||
"v1-usage",
|
||||
"v1-usage-dump",
|
||||
"v1-stats-resources",
|
||||
"v1-stats-usage",
|
||||
"v1-stats-usage-dump",
|
||||
"v1-webhooks",
|
||||
"v1-certificates",
|
||||
"v1-builds",
|
||||
@@ -12357,7 +12306,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueFunctions",
|
||||
"weight": 142,
|
||||
"weight": 141,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -12418,7 +12367,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueLogs",
|
||||
"weight": 133,
|
||||
"weight": 132,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -12479,7 +12428,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueMails",
|
||||
"weight": 139,
|
||||
"weight": 138,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -12540,7 +12489,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueMessaging",
|
||||
"weight": 140,
|
||||
"weight": 139,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -12601,7 +12550,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueMigrations",
|
||||
"weight": 141,
|
||||
"weight": 140,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -12638,10 +12587,10 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/health\/queue\/usage": {
|
||||
"\/health\/queue\/stats-resources": {
|
||||
"get": {
|
||||
"summary": "Get usage queue",
|
||||
"operationId": "healthGetQueueUsage",
|
||||
"summary": "Get stats resources queue",
|
||||
"operationId": "healthGetQueueStatsResources",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
@@ -12651,7 +12600,7 @@
|
||||
"tags": [
|
||||
"health"
|
||||
],
|
||||
"description": "Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.",
|
||||
"description": "Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Health Queue",
|
||||
@@ -12661,13 +12610,13 @@
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueUsage",
|
||||
"weight": 143,
|
||||
"method": "getQueueStatsResources",
|
||||
"weight": 142,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "health\/get-queue-usage.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage.md",
|
||||
"demo": "health\/get-queue-stats-resources.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-resources.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
@@ -12699,10 +12648,71 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/health\/queue\/usage-dump": {
|
||||
"\/health\/queue\/stats-usage": {
|
||||
"get": {
|
||||
"summary": "Get stats usage queue",
|
||||
"operationId": "healthGetQueueUsage",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"health"
|
||||
],
|
||||
"description": "Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Health Queue",
|
||||
"schema": {
|
||||
"$ref": "#\/definitions\/healthQueue"
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueUsage",
|
||||
"weight": 143,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "health\/get-queue-usage.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "health.read",
|
||||
"platforms": [
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Key": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "threshold",
|
||||
"description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.",
|
||||
"required": false,
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"default": 5000,
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/health\/queue\/stats-usage-dump": {
|
||||
"get": {
|
||||
"summary": "Get usage dump queue",
|
||||
"operationId": "healthGetQueueUsageDump",
|
||||
"operationId": "healthGetQueueStatsUsageDump",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
@@ -12722,13 +12732,13 @@
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueUsageDump",
|
||||
"method": "getQueueStatsUsageDump",
|
||||
"weight": 144,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "health\/get-queue-usage-dump.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage-dump.md",
|
||||
"demo": "health\/get-queue-stats-usage-dump.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage-dump.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
@@ -12784,7 +12794,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueWebhooks",
|
||||
"weight": 132,
|
||||
"weight": 131,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -12945,7 +12955,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getTime",
|
||||
"weight": 131,
|
||||
"weight": 130,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -18070,19 +18080,19 @@
|
||||
},
|
||||
"endpoint": {
|
||||
"type": "string",
|
||||
"description": "Source's Appwrite Endpoint",
|
||||
"description": "Source Appwrite endpoint",
|
||||
"default": null,
|
||||
"x-example": "https:\/\/example.com"
|
||||
},
|
||||
"projectId": {
|
||||
"type": "string",
|
||||
"description": "Source's Project ID",
|
||||
"description": "Source Project ID",
|
||||
"default": null,
|
||||
"x-example": "<PROJECT_ID>"
|
||||
},
|
||||
"apiKey": {
|
||||
"type": "string",
|
||||
"description": "Source's API Key",
|
||||
"description": "Source API Key",
|
||||
"default": null,
|
||||
"x-example": "<API_KEY>"
|
||||
}
|
||||
@@ -36608,6 +36618,21 @@
|
||||
"$ref": "#\/definitions\/metric"
|
||||
},
|
||||
"x-example": []
|
||||
},
|
||||
"imageTransformations": {
|
||||
"type": "array",
|
||||
"description": "Aggregated number of files transformations per period.",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#\/definitions\/metric"
|
||||
},
|
||||
"x-example": []
|
||||
},
|
||||
"imageTransformationsTotal": {
|
||||
"type": "integer",
|
||||
"description": "Total aggregated number of files transformations.",
|
||||
"x-example": 0,
|
||||
"format": "int32"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -36615,7 +36640,9 @@
|
||||
"filesTotal",
|
||||
"filesStorageTotal",
|
||||
"files",
|
||||
"storage"
|
||||
"storage",
|
||||
"imageTransformations",
|
||||
"imageTransformationsTotal"
|
||||
]
|
||||
},
|
||||
"usageFunctions": {
|
||||
@@ -37185,6 +37212,21 @@
|
||||
"$ref": "#\/definitions\/metric"
|
||||
},
|
||||
"x-example": []
|
||||
},
|
||||
"imageTransformations": {
|
||||
"type": "array",
|
||||
"description": "An array of aggregated number of image transformations.",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#\/definitions\/metric"
|
||||
},
|
||||
"x-example": []
|
||||
},
|
||||
"imageTransformationsTotal": {
|
||||
"type": "integer",
|
||||
"description": "Total aggregated number of image transformations.",
|
||||
"x-example": 0,
|
||||
"format": "int32"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -37216,7 +37258,9 @@
|
||||
"authPhoneEstimate",
|
||||
"authPhoneCountryBreakdown",
|
||||
"databasesReads",
|
||||
"databasesWrites"
|
||||
"databasesWrites",
|
||||
"imageTransformations",
|
||||
"imageTransformationsTotal"
|
||||
]
|
||||
},
|
||||
"headers": {
|
||||
|
||||
@@ -3261,7 +3261,7 @@
|
||||
"parameters": [
|
||||
{
|
||||
"name": "code",
|
||||
"description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.",
|
||||
"description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.",
|
||||
"required": true,
|
||||
"type": "string",
|
||||
"x-example": "amex",
|
||||
@@ -3281,7 +3281,8 @@
|
||||
"union-china-pay",
|
||||
"visa",
|
||||
"mir",
|
||||
"maestro"
|
||||
"maestro",
|
||||
"rupay"
|
||||
],
|
||||
"x-enum-name": "CreditCard",
|
||||
"x-enum-keys": [
|
||||
@@ -3300,7 +3301,8 @@
|
||||
"Union China Pay",
|
||||
"Visa",
|
||||
"MIR",
|
||||
"Maestro"
|
||||
"Maestro",
|
||||
"Rupay"
|
||||
],
|
||||
"in": "path"
|
||||
},
|
||||
@@ -6133,8 +6135,6 @@
|
||||
},
|
||||
"required": [
|
||||
"required",
|
||||
"min",
|
||||
"max",
|
||||
"default"
|
||||
]
|
||||
}
|
||||
@@ -6373,8 +6373,6 @@
|
||||
},
|
||||
"required": [
|
||||
"required",
|
||||
"min",
|
||||
"max",
|
||||
"default"
|
||||
]
|
||||
}
|
||||
@@ -7552,7 +7550,7 @@
|
||||
"tags": [
|
||||
"databases"
|
||||
],
|
||||
"description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.",
|
||||
"description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n",
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "Document",
|
||||
@@ -10689,7 +10687,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getCertificate",
|
||||
"weight": 134,
|
||||
"weight": 133,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -10800,7 +10798,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getPubSub",
|
||||
"weight": 130,
|
||||
"weight": 129,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -10827,57 +10825,6 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/health\/queue": {
|
||||
"get": {
|
||||
"summary": "Get queue",
|
||||
"operationId": "healthGetQueue",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"health"
|
||||
],
|
||||
"description": "Check the Appwrite queue messaging servers are up and connection is successful.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Health Status",
|
||||
"schema": {
|
||||
"$ref": "#\/definitions\/healthStatus"
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueue",
|
||||
"weight": 129,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "health\/get-queue.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "health.read",
|
||||
"platforms": [
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": [],
|
||||
"Key": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Key": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/health\/queue\/builds": {
|
||||
"get": {
|
||||
"summary": "Get builds queue",
|
||||
@@ -10902,7 +10849,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueBuilds",
|
||||
"weight": 136,
|
||||
"weight": 135,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -10964,7 +10911,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueCertificates",
|
||||
"weight": 135,
|
||||
"weight": 134,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -11026,7 +10973,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueDatabases",
|
||||
"weight": 137,
|
||||
"weight": 136,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -11097,7 +11044,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueDeletes",
|
||||
"weight": 138,
|
||||
"weight": 137,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -11197,8 +11144,9 @@
|
||||
"v1-audits",
|
||||
"v1-mails",
|
||||
"v1-functions",
|
||||
"v1-usage",
|
||||
"v1-usage-dump",
|
||||
"v1-stats-resources",
|
||||
"v1-stats-usage",
|
||||
"v1-stats-usage-dump",
|
||||
"v1-webhooks",
|
||||
"v1-certificates",
|
||||
"v1-builds",
|
||||
@@ -11245,7 +11193,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueFunctions",
|
||||
"weight": 142,
|
||||
"weight": 141,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -11307,7 +11255,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueLogs",
|
||||
"weight": 133,
|
||||
"weight": 132,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -11369,7 +11317,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueMails",
|
||||
"weight": 139,
|
||||
"weight": 138,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -11431,7 +11379,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueMessaging",
|
||||
"weight": 140,
|
||||
"weight": 139,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -11493,7 +11441,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueMigrations",
|
||||
"weight": 141,
|
||||
"weight": 140,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -11531,10 +11479,10 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/health\/queue\/usage": {
|
||||
"\/health\/queue\/stats-resources": {
|
||||
"get": {
|
||||
"summary": "Get usage queue",
|
||||
"operationId": "healthGetQueueUsage",
|
||||
"summary": "Get stats resources queue",
|
||||
"operationId": "healthGetQueueStatsResources",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
@@ -11544,7 +11492,7 @@
|
||||
"tags": [
|
||||
"health"
|
||||
],
|
||||
"description": "Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.",
|
||||
"description": "Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Health Queue",
|
||||
@@ -11554,13 +11502,13 @@
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueUsage",
|
||||
"weight": 143,
|
||||
"method": "getQueueStatsResources",
|
||||
"weight": 142,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "health\/get-queue-usage.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage.md",
|
||||
"demo": "health\/get-queue-stats-resources.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-resources.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
@@ -11593,10 +11541,72 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/health\/queue\/usage-dump": {
|
||||
"\/health\/queue\/stats-usage": {
|
||||
"get": {
|
||||
"summary": "Get stats usage queue",
|
||||
"operationId": "healthGetQueueUsage",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"health"
|
||||
],
|
||||
"description": "Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Health Queue",
|
||||
"schema": {
|
||||
"$ref": "#\/definitions\/healthQueue"
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueUsage",
|
||||
"weight": 143,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "health\/get-queue-usage.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "health.read",
|
||||
"platforms": [
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": [],
|
||||
"Key": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Key": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "threshold",
|
||||
"description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.",
|
||||
"required": false,
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"default": 5000,
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/health\/queue\/stats-usage-dump": {
|
||||
"get": {
|
||||
"summary": "Get usage dump queue",
|
||||
"operationId": "healthGetQueueUsageDump",
|
||||
"operationId": "healthGetQueueStatsUsageDump",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
@@ -11616,13 +11626,13 @@
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueUsageDump",
|
||||
"method": "getQueueStatsUsageDump",
|
||||
"weight": 144,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "health\/get-queue-usage-dump.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage-dump.md",
|
||||
"demo": "health\/get-queue-stats-usage-dump.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage-dump.md",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
@@ -11679,7 +11689,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getQueueWebhooks",
|
||||
"weight": 132,
|
||||
"weight": 131,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -11843,7 +11853,7 @@
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getTime",
|
||||
"weight": 131,
|
||||
"weight": 130,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
|
||||
@@ -2400,7 +2400,7 @@ App::put('/v1/account/sessions/phone')
|
||||
App::post('/v1/account/tokens/phone')
|
||||
->alias('/v1/account/sessions/phone')
|
||||
->desc('Create phone token')
|
||||
->groups(['api', 'account'])
|
||||
->groups(['api', 'account', 'auth'])
|
||||
->label('scope', 'sessions.write')
|
||||
->label('auth.type', 'phone')
|
||||
->label('audits.event', 'session.create')
|
||||
@@ -2715,13 +2715,15 @@ App::get('/v1/account/logs')
|
||||
throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage());
|
||||
}
|
||||
|
||||
$grouped = Query::groupByType($queries);
|
||||
$limit = $grouped['limit'] ?? APP_LIMIT_COUNT;
|
||||
$offset = $grouped['offset'] ?? 0;
|
||||
// Temp fix for logs
|
||||
$queries[] = Query::or([
|
||||
Query::greaterThan('$createdAt', DateTime::format(new \DateTime('2025-02-26T01:30+00:00'))),
|
||||
Query::lessThan('$createdAt', DateTime::format(new \DateTime('2025-02-13T00:00+00:00'))),
|
||||
]);
|
||||
|
||||
$audit = new EventAudit($dbForProject);
|
||||
|
||||
$logs = $audit->getLogsByUser($user->getInternalId(), $limit, $offset);
|
||||
$logs = $audit->getLogsByUser($user->getInternalId(), $queries);
|
||||
|
||||
$output = [];
|
||||
|
||||
@@ -2750,7 +2752,7 @@ App::get('/v1/account/logs')
|
||||
}
|
||||
|
||||
$response->dynamic(new Document([
|
||||
'total' => $audit->countLogsByUser($user->getInternalId()),
|
||||
'total' => $audit->countLogsByUser($user->getInternalId(), $queries),
|
||||
'logs' => $output,
|
||||
]), Response::MODEL_LOG_LIST);
|
||||
});
|
||||
|
||||
@@ -23,6 +23,7 @@ use Utopia\App;
|
||||
use Utopia\Audit\Audit;
|
||||
use Utopia\Config\Config;
|
||||
use Utopia\Database\Database;
|
||||
use Utopia\Database\DateTime;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Database\Exception\Authorization as AuthorizationException;
|
||||
use Utopia\Database\Exception\Conflict as ConflictException;
|
||||
@@ -242,8 +243,8 @@ function updateAttribute(
|
||||
string $filter = null,
|
||||
string|bool|int|float $default = null,
|
||||
bool $required = null,
|
||||
int|float $min = null,
|
||||
int|float $max = null,
|
||||
int|float|null $min = null,
|
||||
int|float|null $max = null,
|
||||
array $elements = null,
|
||||
array $options = [],
|
||||
string $newKey = null,
|
||||
@@ -299,6 +300,9 @@ function updateAttribute(
|
||||
switch ($attribute->getAttribute('format')) {
|
||||
case APP_DATABASE_ATTRIBUTE_INT_RANGE:
|
||||
case APP_DATABASE_ATTRIBUTE_FLOAT_RANGE:
|
||||
$min ??= $attribute->getAttribute('formatOptions')['min'];
|
||||
$max ??= $attribute->getAttribute('formatOptions')['max'];
|
||||
|
||||
if ($min > $max) {
|
||||
throw new Exception(Exception::ATTRIBUTE_VALUE_INVALID, 'Minimum value must be lesser than maximum value');
|
||||
}
|
||||
@@ -669,13 +673,15 @@ App::get('/v1/databases/:databaseId/logs')
|
||||
throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage());
|
||||
}
|
||||
|
||||
$grouped = Query::groupByType($queries);
|
||||
$limit = $grouped['limit'] ?? APP_LIMIT_COUNT;
|
||||
$offset = $grouped['offset'] ?? 0;
|
||||
// Temp fix for logs
|
||||
$queries[] = Query::or([
|
||||
Query::greaterThan('$createdAt', DateTime::format(new \DateTime('2025-02-26T01:30+00:00'))),
|
||||
Query::lessThan('$createdAt', DateTime::format(new \DateTime('2025-02-13T00:00+00:00'))),
|
||||
]);
|
||||
|
||||
$audit = new Audit($dbForProject);
|
||||
$resource = 'database/' . $databaseId;
|
||||
$logs = $audit->getLogsByResource($resource, $limit, $offset);
|
||||
$logs = $audit->getLogsByResource($resource, $queries);
|
||||
|
||||
$output = [];
|
||||
|
||||
@@ -723,7 +729,7 @@ App::get('/v1/databases/:databaseId/logs')
|
||||
}
|
||||
|
||||
$response->dynamic(new Document([
|
||||
'total' => $audit->countLogsByResource($resource),
|
||||
'total' => $audit->countLogsByResource($resource, $queries),
|
||||
'logs' => $output,
|
||||
]), Response::MODEL_LOG_LIST);
|
||||
});
|
||||
@@ -1057,14 +1063,21 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/logs')
|
||||
throw new Exception(Exception::COLLECTION_NOT_FOUND);
|
||||
}
|
||||
|
||||
$queries = Query::parseQueries($queries);
|
||||
$grouped = Query::groupByType($queries);
|
||||
$limit = $grouped['limit'] ?? APP_LIMIT_COUNT;
|
||||
$offset = $grouped['offset'] ?? 0;
|
||||
try {
|
||||
$queries = Query::parseQueries($queries);
|
||||
} catch (QueryException $e) {
|
||||
throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage());
|
||||
}
|
||||
|
||||
// Temp fix for logs
|
||||
$queries[] = Query::or([
|
||||
Query::greaterThan('$createdAt', DateTime::format(new \DateTime('2025-02-26T01:30+00:00'))),
|
||||
Query::lessThan('$createdAt', DateTime::format(new \DateTime('2025-02-13T00:00+00:00'))),
|
||||
]);
|
||||
|
||||
$audit = new Audit($dbForProject);
|
||||
$resource = 'database/' . $databaseId . '/collection/' . $collectionId;
|
||||
$logs = $audit->getLogsByResource($resource, $limit, $offset);
|
||||
$logs = $audit->getLogsByResource($resource, $queries);
|
||||
|
||||
$output = [];
|
||||
|
||||
@@ -1112,7 +1125,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/logs')
|
||||
}
|
||||
|
||||
$response->dynamic(new Document([
|
||||
'total' => $audit->countLogsByResource($resource),
|
||||
'total' => $audit->countLogsByResource($resource, $queries),
|
||||
'logs' => $output,
|
||||
]), Response::MODEL_LOG_LIST);
|
||||
});
|
||||
@@ -1550,8 +1563,8 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/intege
|
||||
->action(function (string $databaseId, string $collectionId, string $key, ?bool $required, ?int $min, ?int $max, ?int $default, bool $array, Response $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents) {
|
||||
|
||||
// Ensure attribute default is within range
|
||||
$min = \is_null($min) ? PHP_INT_MIN : $min;
|
||||
$max = \is_null($max) ? PHP_INT_MAX : $max;
|
||||
$min ??= PHP_INT_MIN;
|
||||
$max ??= PHP_INT_MAX;
|
||||
|
||||
if ($min > $max) {
|
||||
throw new Exception(Exception::ATTRIBUTE_VALUE_INVALID, 'Minimum value must be lesser than maximum value');
|
||||
@@ -1627,8 +1640,8 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/float'
|
||||
->action(function (string $databaseId, string $collectionId, string $key, ?bool $required, ?float $min, ?float $max, ?float $default, bool $array, Response $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents) {
|
||||
|
||||
// Ensure attribute default is within range
|
||||
$min = \is_null($min) ? -PHP_FLOAT_MAX : $min;
|
||||
$max = \is_null($max) ? PHP_FLOAT_MAX : $max;
|
||||
$min ??= -PHP_FLOAT_MAX;
|
||||
$max ??= PHP_FLOAT_MAX;
|
||||
|
||||
if ($min > $max) {
|
||||
throw new Exception(Exception::ATTRIBUTE_VALUE_INVALID, 'Minimum value must be lesser than maximum value');
|
||||
@@ -2339,8 +2352,8 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/integ
|
||||
->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).')
|
||||
->param('key', '', new Key(), 'Attribute Key.')
|
||||
->param('required', null, new Boolean(), 'Is attribute required?')
|
||||
->param('min', null, new Integer(), 'Minimum value to enforce on new documents')
|
||||
->param('max', null, new Integer(), 'Maximum value to enforce on new documents')
|
||||
->param('min', null, new Integer(), 'Minimum value to enforce on new documents', true)
|
||||
->param('max', null, new Integer(), 'Maximum value to enforce on new documents', true)
|
||||
->param('default', null, new Nullable(new Integer()), 'Default value for attribute when not provided. Cannot be set when attribute is required.')
|
||||
->param('newKey', null, new Key(), 'New attribute key.', true)
|
||||
->inject('response')
|
||||
@@ -2398,8 +2411,8 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/float
|
||||
->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).')
|
||||
->param('key', '', new Key(), 'Attribute Key.')
|
||||
->param('required', null, new Boolean(), 'Is attribute required?')
|
||||
->param('min', null, new FloatValidator(), 'Minimum value to enforce on new documents')
|
||||
->param('max', null, new FloatValidator(), 'Maximum value to enforce on new documents')
|
||||
->param('min', null, new FloatValidator(), 'Minimum value to enforce on new documents', true)
|
||||
->param('max', null, new FloatValidator(), 'Maximum value to enforce on new documents', true)
|
||||
->param('default', null, new Nullable(new FloatValidator()), 'Default value for attribute when not provided. Cannot be set when attribute is required.')
|
||||
->param('newKey', null, new Key(), 'New attribute key.', true)
|
||||
->inject('response')
|
||||
@@ -3709,13 +3722,15 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen
|
||||
throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage());
|
||||
}
|
||||
|
||||
$grouped = Query::groupByType($queries);
|
||||
$limit = $grouped['limit'] ?? APP_LIMIT_COUNT;
|
||||
$offset = $grouped['offset'] ?? 0;
|
||||
// Temp fix for logs
|
||||
$queries[] = Query::or([
|
||||
Query::greaterThan('$createdAt', DateTime::format(new \DateTime('2025-02-26T01:30+00:00'))),
|
||||
Query::lessThan('$createdAt', DateTime::format(new \DateTime('2025-02-13T00:00+00:00'))),
|
||||
]);
|
||||
|
||||
$audit = new Audit($dbForProject);
|
||||
$resource = 'database/' . $databaseId . '/collection/' . $collectionId . '/document/' . $document->getId();
|
||||
$logs = $audit->getLogsByResource($resource, $limit, $offset);
|
||||
$logs = $audit->getLogsByResource($resource, $queries);
|
||||
|
||||
$output = [];
|
||||
|
||||
@@ -3763,7 +3778,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen
|
||||
}
|
||||
|
||||
$response->dynamic(new Document([
|
||||
'total' => $audit->countLogsByResource($resource),
|
||||
'total' => $audit->countLogsByResource($resource, $queries),
|
||||
'logs' => $output,
|
||||
]), Response::MODEL_LOG_LIST);
|
||||
});
|
||||
|
||||
@@ -994,13 +994,15 @@ App::get('/v1/messaging/providers/:providerId/logs')
|
||||
throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage());
|
||||
}
|
||||
|
||||
$grouped = Query::groupByType($queries);
|
||||
$limit = $grouped['limit'] ?? APP_LIMIT_COUNT;
|
||||
$offset = $grouped['offset'] ?? 0;
|
||||
// Temp fix for logs
|
||||
$queries[] = Query::or([
|
||||
Query::greaterThan('$createdAt', DateTime::format(new \DateTime('2025-02-26T01:30+00:00'))),
|
||||
Query::lessThan('$createdAt', DateTime::format(new \DateTime('2025-02-13T00:00+00:00'))),
|
||||
]);
|
||||
|
||||
$audit = new Audit($dbForProject);
|
||||
$resource = 'provider/' . $providerId;
|
||||
$logs = $audit->getLogsByResource($resource, $limit, $offset);
|
||||
$logs = $audit->getLogsByResource($resource, $queries);
|
||||
$output = [];
|
||||
|
||||
foreach ($logs as $i => &$log) {
|
||||
@@ -1047,7 +1049,7 @@ App::get('/v1/messaging/providers/:providerId/logs')
|
||||
}
|
||||
|
||||
$response->dynamic(new Document([
|
||||
'total' => $audit->countLogsByResource($resource),
|
||||
'total' => $audit->countLogsByResource($resource, $queries),
|
||||
'logs' => $output,
|
||||
]), Response::MODEL_LOG_LIST);
|
||||
});
|
||||
@@ -2222,13 +2224,15 @@ App::get('/v1/messaging/topics/:topicId/logs')
|
||||
throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage());
|
||||
}
|
||||
|
||||
$grouped = Query::groupByType($queries);
|
||||
$limit = $grouped['limit'] ?? APP_LIMIT_COUNT;
|
||||
$offset = $grouped['offset'] ?? 0;
|
||||
// Temp fix for logs
|
||||
$queries[] = Query::or([
|
||||
Query::greaterThan('$createdAt', DateTime::format(new \DateTime('2025-02-26T01:30+00:00'))),
|
||||
Query::lessThan('$createdAt', DateTime::format(new \DateTime('2025-02-13T00:00+00:00'))),
|
||||
]);
|
||||
|
||||
$audit = new Audit($dbForProject);
|
||||
$resource = 'topic/' . $topicId;
|
||||
$logs = $audit->getLogsByResource($resource, $limit, $offset);
|
||||
$logs = $audit->getLogsByResource($resource, $queries);
|
||||
|
||||
$output = [];
|
||||
|
||||
@@ -2276,7 +2280,7 @@ App::get('/v1/messaging/topics/:topicId/logs')
|
||||
}
|
||||
|
||||
$response->dynamic(new Document([
|
||||
'total' => $audit->countLogsByResource($resource),
|
||||
'total' => $audit->countLogsByResource($resource, $queries),
|
||||
'logs' => $output,
|
||||
]), Response::MODEL_LOG_LIST);
|
||||
});
|
||||
@@ -2632,13 +2636,15 @@ App::get('/v1/messaging/subscribers/:subscriberId/logs')
|
||||
throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage());
|
||||
}
|
||||
|
||||
$grouped = Query::groupByType($queries);
|
||||
$limit = $grouped['limit'] ?? APP_LIMIT_COUNT;
|
||||
$offset = $grouped['offset'] ?? 0;
|
||||
// Temp fix for logs
|
||||
$queries[] = Query::or([
|
||||
Query::greaterThan('$createdAt', DateTime::format(new \DateTime('2025-02-26T01:30+00:00'))),
|
||||
Query::lessThan('$createdAt', DateTime::format(new \DateTime('2025-02-13T00:00+00:00'))),
|
||||
]);
|
||||
|
||||
$audit = new Audit($dbForProject);
|
||||
$resource = 'subscriber/' . $subscriberId;
|
||||
$logs = $audit->getLogsByResource($resource, $limit, $offset);
|
||||
$logs = $audit->getLogsByResource($resource, $queries);
|
||||
|
||||
$output = [];
|
||||
|
||||
@@ -2686,7 +2692,7 @@ App::get('/v1/messaging/subscribers/:subscriberId/logs')
|
||||
}
|
||||
|
||||
$response->dynamic(new Document([
|
||||
'total' => $audit->countLogsByResource($resource),
|
||||
'total' => $audit->countLogsByResource($resource, $queries),
|
||||
'logs' => $output,
|
||||
]), Response::MODEL_LOG_LIST);
|
||||
});
|
||||
@@ -3397,13 +3403,15 @@ App::get('/v1/messaging/messages/:messageId/logs')
|
||||
throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage());
|
||||
}
|
||||
|
||||
$grouped = Query::groupByType($queries);
|
||||
$limit = $grouped['limit'] ?? APP_LIMIT_COUNT;
|
||||
$offset = $grouped['offset'] ?? 0;
|
||||
// Temp fix for logs
|
||||
$queries[] = Query::or([
|
||||
Query::greaterThan('$createdAt', DateTime::format(new \DateTime('2025-02-26T01:30+00:00'))),
|
||||
Query::lessThan('$createdAt', DateTime::format(new \DateTime('2025-02-13T00:00+00:00'))),
|
||||
]);
|
||||
|
||||
$audit = new Audit($dbForProject);
|
||||
$resource = 'message/' . $messageId;
|
||||
$logs = $audit->getLogsByResource($resource, $limit, $offset);
|
||||
$logs = $audit->getLogsByResource($resource, $queries);
|
||||
|
||||
$output = [];
|
||||
|
||||
@@ -3451,7 +3459,7 @@ App::get('/v1/messaging/messages/:messageId/logs')
|
||||
}
|
||||
|
||||
$response->dynamic(new Document([
|
||||
'total' => $audit->countLogsByResource($resource),
|
||||
'total' => $audit->countLogsByResource($resource, $queries),
|
||||
'logs' => $output,
|
||||
]), Response::MODEL_LOG_LIST);
|
||||
});
|
||||
|
||||
@@ -41,14 +41,18 @@ App::get('/v1/project/usage')
|
||||
->param('endDate', '', new DateTimeValidator(), 'End date for the usage')
|
||||
->param('period', '1d', new WhiteList(['1h', '1d']), 'Period used', true)
|
||||
->inject('response')
|
||||
->inject('project')
|
||||
->inject('dbForProject')
|
||||
->inject('getLogsDB')
|
||||
->inject('smsRates')
|
||||
->action(function (string $startDate, string $endDate, string $period, Response $response, Database $dbForProject, array $smsRates) {
|
||||
->action(function (string $startDate, string $endDate, string $period, Response $response, Document $project, Database $dbForProject, callable $getLogsDB, array $smsRates) {
|
||||
$stats = $total = $usage = [];
|
||||
$format = 'Y-m-d 00:00:00';
|
||||
$firstDay = (new DateTime($startDate))->format($format);
|
||||
$lastDay = (new DateTime($endDate))->format($format);
|
||||
|
||||
$dbForLogs = call_user_func($getLogsDB, $project);
|
||||
|
||||
$metrics = [
|
||||
'total' => [
|
||||
METRIC_EXECUTIONS,
|
||||
@@ -64,6 +68,7 @@ App::get('/v1/project/usage')
|
||||
METRIC_BUILDS_STORAGE,
|
||||
METRIC_DATABASES_OPERATIONS_READS,
|
||||
METRIC_DATABASES_OPERATIONS_WRITES,
|
||||
METRIC_FILES_IMAGES_TRANSFORMED,
|
||||
],
|
||||
'period' => [
|
||||
METRIC_NETWORK_REQUESTS,
|
||||
@@ -76,6 +81,7 @@ App::get('/v1/project/usage')
|
||||
METRIC_BUILDS_MB_SECONDS,
|
||||
METRIC_DATABASES_OPERATIONS_READS,
|
||||
METRIC_DATABASES_OPERATIONS_WRITES,
|
||||
METRIC_FILES_IMAGES_TRANSFORMED,
|
||||
]
|
||||
];
|
||||
|
||||
@@ -94,9 +100,11 @@ App::get('/v1/project/usage')
|
||||
'1d' => 'Y-m-d\T00:00:00.000P',
|
||||
};
|
||||
|
||||
Authorization::skip(function () use ($dbForProject, $firstDay, $lastDay, $period, $metrics, $limit, &$total, &$stats) {
|
||||
Authorization::skip(function () use ($dbForProject, $dbForLogs, $firstDay, $lastDay, $period, $metrics, $limit, &$total, &$stats) {
|
||||
foreach ($metrics['total'] as $metric) {
|
||||
$result = $dbForProject->findOne('stats', [
|
||||
$db = ($metric === METRIC_FILES_IMAGES_TRANSFORMED) ? $dbForLogs : $dbForProject;
|
||||
|
||||
$result = $db->findOne('stats', [
|
||||
Query::equal('metric', [$metric]),
|
||||
Query::equal('period', ['inf'])
|
||||
]);
|
||||
@@ -104,7 +112,9 @@ App::get('/v1/project/usage')
|
||||
}
|
||||
|
||||
foreach ($metrics['period'] as $metric) {
|
||||
$results = $dbForProject->find('stats', [
|
||||
$db = ($metric === METRIC_FILES_IMAGES_TRANSFORMED) ? $dbForLogs : $dbForProject;
|
||||
|
||||
$results = $db->find('stats', [
|
||||
Query::equal('metric', [$metric]),
|
||||
Query::equal('period', [$period]),
|
||||
Query::greaterThanEqual('time', $firstDay),
|
||||
@@ -364,6 +374,8 @@ App::get('/v1/project/usage')
|
||||
'authPhoneTotal' => $authPhoneTotal,
|
||||
'authPhoneEstimate' => $authPhoneEstimate,
|
||||
'authPhoneCountryBreakdown' => $authPhoneCountryBreakdown,
|
||||
'imageTransformations' => $usage[METRIC_FILES_IMAGES_TRANSFORMED],
|
||||
'imageTransformationsTotal' => $total[METRIC_FILES_IMAGES_TRANSFORMED],
|
||||
]), Response::MODEL_USAGE_PROJECT);
|
||||
});
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ use Appwrite\Auth\Auth;
|
||||
use Appwrite\ClamAV\Network;
|
||||
use Appwrite\Event\Delete;
|
||||
use Appwrite\Event\Event;
|
||||
use Appwrite\Event\StatsUsage;
|
||||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\OpenSSL\OpenSSL;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -935,15 +934,11 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
|
||||
->param('rotation', 0, new Range(-360, 360), 'Preview image rotation in degrees. Pass an integer between -360 and 360.', true)
|
||||
->param('background', '', new HexColor(), 'Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.', true)
|
||||
->param('output', '', new WhiteList(\array_keys(Config::getParam('storage-outputs')), true), 'Output format type (jpeg, jpg, png, gif and webp).', true)
|
||||
->inject('request')
|
||||
->inject('response')
|
||||
->inject('project')
|
||||
->inject('dbForProject')
|
||||
->inject('mode')
|
||||
->inject('deviceForFiles')
|
||||
->inject('deviceForLocal')
|
||||
->inject('queueForStatsUsage')
|
||||
->action(function (string $bucketId, string $fileId, int $width, int $height, string $gravity, int $quality, int $borderWidth, string $borderColor, int $borderRadius, float $opacity, int $rotation, string $background, string $output, Request $request, Response $response, Document $project, Database $dbForProject, string $mode, Device $deviceForFiles, Device $deviceForLocal, StatsUsage $queueForStatsUsage) {
|
||||
->action(function (string $bucketId, string $fileId, int $width, int $height, string $gravity, int $quality, int $borderWidth, string $borderColor, int $borderRadius, float $opacity, int $rotation, string $background, string $output, Response $response, Database $dbForProject, Device $deviceForFiles, Device $deviceForLocal) {
|
||||
|
||||
if (!\extension_loaded('imagick')) {
|
||||
throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Imagick extension is missing');
|
||||
@@ -1071,22 +1066,19 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
|
||||
|
||||
$contentType = (\array_key_exists($output, $outputs)) ? $outputs[$output] : $outputs['jpg'];
|
||||
|
||||
$queueForStatsUsage
|
||||
->addMetric(METRIC_FILES_TRANSFORMATIONS, 1)
|
||||
->addMetric(str_replace('{bucketInternalId}', $bucket->getInternalId(), METRIC_BUCKET_ID_FILES_TRANSFORMATIONS), 1)
|
||||
;
|
||||
|
||||
$transformedAt = $file->getAttribute('transformedAt', '');
|
||||
if (DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -APP_PROJECT_ACCESS)) > $transformedAt) {
|
||||
$file->setAttribute('transformedAt', DateTime::now());
|
||||
Authorization::skip(fn () => $dbForProject->updateDocument('bucket_' . $file->getAttribute('bucketInternalId'), $file->getId(), $file));
|
||||
//Do not update transformedAt if it's a console user
|
||||
if (!Auth::isPrivilegedUser(Authorization::getRoles())) {
|
||||
$transformedAt = $file->getAttribute('transformedAt', '');
|
||||
if (DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -APP_PROJECT_ACCESS)) > $transformedAt) {
|
||||
$file->setAttribute('transformedAt', DateTime::now());
|
||||
Authorization::skip(fn () => $dbForProject->updateDocument('bucket_' . $file->getAttribute('bucketInternalId'), $file->getId(), $file));
|
||||
}
|
||||
}
|
||||
|
||||
$response
|
||||
->addHeader('Cache-Control', 'private, max-age=2592000') // 30 days
|
||||
->setContentType($contentType)
|
||||
->file($data)
|
||||
;
|
||||
->file($data);
|
||||
|
||||
unset($image);
|
||||
});
|
||||
@@ -1879,9 +1871,12 @@ App::get('/v1/storage/:bucketId/usage')
|
||||
->param('bucketId', '', new UID(), 'Bucket ID.')
|
||||
->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true)
|
||||
->inject('response')
|
||||
->inject('project')
|
||||
->inject('dbForProject')
|
||||
->action(function (string $bucketId, string $range, Response $response, Database $dbForProject) {
|
||||
->inject('getLogsDB')
|
||||
->action(function (string $bucketId, string $range, Response $response, Document $project, Database $dbForProject, callable $getLogsDB) {
|
||||
|
||||
$dbForLogs = call_user_func($getLogsDB, $project);
|
||||
$bucket = $dbForProject->getDocument('buckets', $bucketId);
|
||||
|
||||
if ($bucket->isEmpty()) {
|
||||
@@ -1894,12 +1889,16 @@ App::get('/v1/storage/:bucketId/usage')
|
||||
$metrics = [
|
||||
str_replace('{bucketInternalId}', $bucket->getInternalId(), METRIC_BUCKET_ID_FILES),
|
||||
str_replace('{bucketInternalId}', $bucket->getInternalId(), METRIC_BUCKET_ID_FILES_STORAGE),
|
||||
str_replace('{bucketInternalId}', $bucket->getInternalId(), METRIC_BUCKET_ID_FILES_IMAGES_TRANSFORMED),
|
||||
];
|
||||
|
||||
|
||||
Authorization::skip(function () use ($dbForProject, $days, $metrics, &$stats, &$total) {
|
||||
Authorization::skip(function () use ($dbForProject, $dbForLogs, $bucket, $days, $metrics, &$stats) {
|
||||
foreach ($metrics as $metric) {
|
||||
$result = $dbForProject->findOne('stats', [
|
||||
$db = ($metric === str_replace('{bucketInternalId}', $bucket->getInternalId(), METRIC_BUCKET_ID_FILES_IMAGES_TRANSFORMED))
|
||||
? $dbForLogs
|
||||
: $dbForProject;
|
||||
|
||||
$result = $db->findOne('stats', [
|
||||
Query::equal('metric', [$metric]),
|
||||
Query::equal('period', ['inf'])
|
||||
]);
|
||||
@@ -1907,7 +1906,7 @@ App::get('/v1/storage/:bucketId/usage')
|
||||
$stats[$metric]['total'] = $result['value'] ?? 0;
|
||||
$limit = $days['limit'];
|
||||
$period = $days['period'];
|
||||
$results = $dbForProject->find('stats', [
|
||||
$results = $db->find('stats', [
|
||||
Query::equal('metric', [$metric]),
|
||||
Query::equal('period', [$period]),
|
||||
Query::limit($limit),
|
||||
@@ -1948,5 +1947,7 @@ App::get('/v1/storage/:bucketId/usage')
|
||||
'filesStorageTotal' => $usage[$metrics[1]]['total'],
|
||||
'files' => $usage[$metrics[0]]['data'],
|
||||
'storage' => $usage[$metrics[1]]['data'],
|
||||
'imageTransformations' => $usage[$metrics[2]]['data'],
|
||||
'imageTransformationsTotal' => $usage[$metrics[2]]['total'],
|
||||
]), Response::MODEL_USAGE_BUCKETS);
|
||||
});
|
||||
|
||||
@@ -488,7 +488,7 @@ App::post('/v1/teams/:teamId/memberships')
|
||||
}
|
||||
|
||||
$email = \strtolower($email);
|
||||
$name = (empty($name)) ? $email : $name;
|
||||
$name = empty($name) ? $email : $name;
|
||||
$team = $dbForProject->getDocument('teams', $teamId);
|
||||
|
||||
if ($team->isEmpty()) {
|
||||
@@ -507,7 +507,7 @@ App::post('/v1/teams/:teamId/memberships')
|
||||
}
|
||||
$email = $invitee->getAttribute('email', '');
|
||||
$phone = $invitee->getAttribute('phone', '');
|
||||
$name = empty($name) ? $invitee->getAttribute('name', '') : $name;
|
||||
$name = $invitee->getAttribute('name', '') ?: $name;
|
||||
} elseif (!empty($email)) {
|
||||
$invitee = $dbForProject->findOne('users', [Query::equal('email', [$email])]); // Get user by email address
|
||||
if (!$invitee->isEmpty() && !empty($phone) && $invitee->getAttribute('phone', '') !== $phone) {
|
||||
@@ -715,7 +715,7 @@ App::post('/v1/teams/:teamId/memberships')
|
||||
->setSubject($subject)
|
||||
->setBody($body)
|
||||
->setRecipient($invitee->getAttribute('email'))
|
||||
->setName($invitee->getAttribute('name'))
|
||||
->setName($invitee->getAttribute('name', ''))
|
||||
->setVariables($emailVariables)
|
||||
->trigger();
|
||||
|
||||
@@ -1362,13 +1362,15 @@ App::get('/v1/teams/:teamId/logs')
|
||||
throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage());
|
||||
}
|
||||
|
||||
$grouped = Query::groupByType($queries);
|
||||
$limit = $grouped['limit'] ?? APP_LIMIT_COUNT;
|
||||
$offset = $grouped['offset'] ?? 0;
|
||||
// Temp fix for logs
|
||||
$queries[] = Query::or([
|
||||
Query::greaterThan('$createdAt', DateTime::format(new \DateTime('2025-02-26T01:30+00:00'))),
|
||||
Query::lessThan('$createdAt', DateTime::format(new \DateTime('2025-02-13T00:00+00:00'))),
|
||||
]);
|
||||
|
||||
$audit = new Audit($dbForProject);
|
||||
$resource = 'team/' . $team->getId();
|
||||
$logs = $audit->getLogsByResource($resource, $limit, $offset);
|
||||
$logs = $audit->getLogsByResource($resource, $queries);
|
||||
|
||||
$output = [];
|
||||
|
||||
@@ -1415,7 +1417,7 @@ App::get('/v1/teams/:teamId/logs')
|
||||
}
|
||||
}
|
||||
$response->dynamic(new Document([
|
||||
'total' => $audit->countLogsByResource($resource),
|
||||
'total' => $audit->countLogsByResource($resource, $queries),
|
||||
'logs' => $output,
|
||||
]), Response::MODEL_LOG_LIST);
|
||||
});
|
||||
|
||||
@@ -862,13 +862,15 @@ App::get('/v1/users/:userId/logs')
|
||||
throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage());
|
||||
}
|
||||
|
||||
$grouped = Query::groupByType($queries);
|
||||
$limit = $grouped['limit'] ?? APP_LIMIT_COUNT;
|
||||
$offset = $grouped['offset'] ?? 0;
|
||||
// Temp fix for logs
|
||||
$queries[] = Query::or([
|
||||
Query::greaterThan('$createdAt', DateTime::format(new \DateTime('2025-02-26T01:30+00:00'))),
|
||||
Query::lessThan('$createdAt', DateTime::format(new \DateTime('2025-02-13T00:00+00:00'))),
|
||||
]);
|
||||
|
||||
$audit = new Audit($dbForProject);
|
||||
|
||||
$logs = $audit->getLogsByUser($user->getInternalId(), $limit, $offset);
|
||||
$logs = $audit->getLogsByUser($user->getInternalId(), $queries);
|
||||
|
||||
$output = [];
|
||||
|
||||
@@ -915,7 +917,7 @@ App::get('/v1/users/:userId/logs')
|
||||
}
|
||||
|
||||
$response->dynamic(new Document([
|
||||
'total' => $audit->countLogsByUser($user->getInternalId()),
|
||||
'total' => $audit->countLogsByUser($user->getInternalId(), $queries),
|
||||
'logs' => $output,
|
||||
]), Response::MODEL_LOG_LIST);
|
||||
});
|
||||
|
||||
@@ -912,8 +912,9 @@ App::options()
|
||||
->inject('geodb')
|
||||
->inject('isResourceBlocked')
|
||||
->inject('previewHostname')
|
||||
->inject('project')
|
||||
->inject('apiKey')
|
||||
->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Reader $geodb, callable $isResourceBlocked, string $previewHostname, ?Key $apiKey) {
|
||||
->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Reader $geodb, callable $isResourceBlocked, string $previewHostname, Document $project, ?Key $apiKey) {
|
||||
/*
|
||||
* Appwrite Router
|
||||
*/
|
||||
@@ -936,6 +937,16 @@ App::options()
|
||||
->addHeader('Access-Control-Allow-Origin', $origin)
|
||||
->addHeader('Access-Control-Allow-Credentials', 'true')
|
||||
->noContent();
|
||||
|
||||
/** OPTIONS requests in utopia do not execute shutdown handlers, as a result we need to track the OPTIONS requests explicitly
|
||||
* @see https://github.com/utopia-php/http/blob/0.33.16/src/App.php#L825-L855
|
||||
*/
|
||||
$queueForStatsUsage
|
||||
->addMetric(METRIC_NETWORK_REQUESTS, 1)
|
||||
->addMetric(METRIC_NETWORK_INBOUND, $request->getSize())
|
||||
->addMetric(METRIC_NETWORK_OUTBOUND, $response->getSize())
|
||||
->setProject($project)
|
||||
->trigger();
|
||||
});
|
||||
|
||||
App::error()
|
||||
@@ -1024,11 +1035,9 @@ App::error()
|
||||
$publish = $error->getCode() === 0 || $error->getCode() >= 500;
|
||||
}
|
||||
|
||||
if ($error->getCode() >= 400 && $error->getCode() < 500) {
|
||||
$providerConfig = System::getEnv('_APP_EXPERIMENT_LOGGING_CONFIG', '');
|
||||
if (!empty($providerConfig) && $error->getCode() >= 400 && $error->getCode() < 500) {
|
||||
// Register error logger
|
||||
$providerName = System::getEnv('_APP_EXPERIMENT_LOGGING_PROVIDER', '');
|
||||
$providerConfig = System::getEnv('_APP_EXPERIMENT_LOGGING_CONFIG', '');
|
||||
|
||||
try {
|
||||
$loggingProvider = new DSN($providerConfig ?? '');
|
||||
$providerName = $loggingProvider->getScheme();
|
||||
@@ -1050,7 +1059,10 @@ App::error()
|
||||
}
|
||||
}
|
||||
|
||||
if ($publish && $project->getId() !== 'console') {
|
||||
/**
|
||||
* If its not a publishable error, track usage stats. Publishable errors are >= 500 or those explicitly marked as publish=true in errors.php
|
||||
*/
|
||||
if (!$publish && $project->getId() !== 'console') {
|
||||
if (!Auth::isPrivilegedUser(Authorization::getRoles())) {
|
||||
$fileSize = 0;
|
||||
$file = $request->getFiles('file');
|
||||
|
||||
@@ -543,7 +543,7 @@ App::init()
|
||||
|
||||
if ($type === 'bucket') {
|
||||
$bucketId = $parts[1] ?? null;
|
||||
$bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId));
|
||||
$bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId));
|
||||
|
||||
if ($bucket->isEmpty() || (!$bucket->getAttribute('enabled') && !$isAppUser && !$isPrivilegedUser)) {
|
||||
throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND);
|
||||
@@ -569,11 +569,13 @@ App::init()
|
||||
if ($file->isEmpty()) {
|
||||
throw new Exception(Exception::STORAGE_FILE_NOT_FOUND);
|
||||
}
|
||||
|
||||
$transformedAt = $file->getAttribute('transformedAt', '');
|
||||
if (DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -APP_PROJECT_ACCESS)) > $transformedAt) {
|
||||
$file->setAttribute('transformedAt', DateTime::now());
|
||||
Authorization::skip(fn () => $dbForProject->updateDocument('bucket_' . $file->getAttribute('bucketInternalId'), $file->getId(), $file));
|
||||
//Do not update transformedAt if it's a console user
|
||||
if (!Auth::isPrivilegedUser(Authorization::getRoles())) {
|
||||
$transformedAt = $file->getAttribute('transformedAt', '');
|
||||
if (DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -APP_PROJECT_ACCESS)) > $transformedAt) {
|
||||
$file->setAttribute('transformedAt', DateTime::now());
|
||||
Authorization::skip(fn () => $dbForProject->updateDocument('bucket_' . $file->getAttribute('bucketInternalId'), $file->getId(), $file));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -354,6 +354,54 @@ $http->on(Constant::EVENT_START, function (Server $http) use ($payloadSize, $reg
|
||||
}
|
||||
});
|
||||
|
||||
$projectCollections = $collections['projects'];
|
||||
$sharedTables = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES', ''));
|
||||
$sharedTablesV1 = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES_V1', ''));
|
||||
$sharedTablesV2 = \array_diff($sharedTables, $sharedTablesV1);
|
||||
|
||||
$cache = $app->getResource('cache');
|
||||
|
||||
foreach ($sharedTablesV2 as $hostname) {
|
||||
$adapter = $pools
|
||||
->get($hostname)
|
||||
->pop()
|
||||
->getResource();
|
||||
|
||||
$dbForProject = (new Database($adapter, $cache))
|
||||
->setDatabase('appwrite')
|
||||
->setSharedTables(true)
|
||||
->setTenant(null)
|
||||
->setNamespace(System::getEnv('_APP_DATABASE_SHARED_NAMESPACE', ''));
|
||||
|
||||
try {
|
||||
Console::success('[Setup] - Creating project database: ' . $hostname . '...');
|
||||
$dbForProject->create();
|
||||
} catch (Duplicate) {
|
||||
Console::success('[Setup] - Skip: metadata table already exists');
|
||||
}
|
||||
|
||||
if ($dbForProject->getCollection(Audit::COLLECTION)->isEmpty()) {
|
||||
$audit = new Audit($dbForProject);
|
||||
$audit->setup();
|
||||
}
|
||||
|
||||
foreach ($projectCollections as $key => $collection) {
|
||||
if (($collection['$collection'] ?? '') !== Database::METADATA) {
|
||||
continue;
|
||||
}
|
||||
if (!$dbForProject->getCollection($key)->isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$attributes = \array_map(fn ($attribute) => new Document($attribute), $collection['attributes']);
|
||||
$indexes = \array_map(fn (array $index) => new Document($index), $collection['indexes']);
|
||||
|
||||
Console::success('[Setup] - Creating project collection: ' . $collection['$id'] . '...');
|
||||
|
||||
$dbForProject->createCollection($key, $attributes, $indexes);
|
||||
}
|
||||
}
|
||||
|
||||
$pools->reclaim();
|
||||
Console::success('[Setup] - Server database init completed...');
|
||||
});
|
||||
|
||||
+8
-42
@@ -326,6 +326,8 @@ const METRIC_WEBHOOKS = 'webhooks';
|
||||
const METRIC_PLATFORMS = 'platforms';
|
||||
const METRIC_PROVIDERS = 'providers';
|
||||
const METRIC_TOPICS = 'topics';
|
||||
const METRIC_TARGETS = 'targets';
|
||||
const METRIC_PROVIDER_TYPE_TARGETS = '{providerType}.targets';
|
||||
const METRIC_KEYS = 'keys';
|
||||
const METRIC_RESOURCE_TYPE_ID_BUILDS = '{resourceType}.{resourceInternalId}.builds';
|
||||
const METRIC_RESOURCE_TYPE_ID_BUILDS_STORAGE = '{resourceType}.{resourceInternalId}.builds.storage';
|
||||
@@ -364,6 +366,7 @@ Config::load('apis', __DIR__ . '/config/apis.php'); // List of APIs
|
||||
Config::load('errors', __DIR__ . '/config/errors.php');
|
||||
Config::load('oAuthProviders', __DIR__ . '/config/oAuthProviders.php');
|
||||
Config::load('platforms', __DIR__ . '/config/platforms.php');
|
||||
Config::load('console', __DIR__ . '/config/console.php');
|
||||
Config::load('collections', __DIR__ . '/config/collections.php');
|
||||
Config::load('frameworks', __DIR__ . '/config/frameworks.php');
|
||||
Config::load('runtimes', __DIR__ . '/config/runtimes.php');
|
||||
@@ -836,6 +839,10 @@ $register->set('logger', function () {
|
||||
$providerName = System::getEnv('_APP_LOGGING_PROVIDER', '');
|
||||
$providerConfig = System::getEnv('_APP_LOGGING_CONFIG', '');
|
||||
|
||||
if (empty($providerConfig)) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
$loggingProvider = new DSN($providerConfig ?? '');
|
||||
|
||||
@@ -1219,9 +1226,6 @@ App::setResource('queueForAudits', function (Queue\Publisher $publisher) {
|
||||
App::setResource('queueForFunctions', function (Queue\Publisher $publisher) {
|
||||
return new Func($publisher);
|
||||
}, ['publisher']);
|
||||
App::setResource('queueForUsage', function (Queue\Publisher $publisher) {
|
||||
return new Usage($publisher);
|
||||
}, ['publisher']);
|
||||
App::setResource('queueForCertificates', function (Queue\Publisher $publisher) {
|
||||
return new Certificate($publisher);
|
||||
}, ['publisher']);
|
||||
@@ -1426,45 +1430,7 @@ App::setResource('session', function (Document $user) {
|
||||
}, ['user']);
|
||||
|
||||
App::setResource('console', function () {
|
||||
return new Document([
|
||||
'$id' => ID::custom('console'),
|
||||
'$internalId' => ID::custom('console'),
|
||||
'name' => 'Appwrite',
|
||||
'$collection' => ID::custom('projects'),
|
||||
'description' => 'Appwrite core engine',
|
||||
'logo' => '',
|
||||
'teamId' => null,
|
||||
'webhooks' => [],
|
||||
'keys' => [],
|
||||
'platforms' => [
|
||||
[
|
||||
'$collection' => ID::custom('platforms'),
|
||||
'name' => 'Localhost',
|
||||
'type' => Origin::CLIENT_TYPE_WEB,
|
||||
'hostname' => 'localhost',
|
||||
], // Current host is added on app init
|
||||
],
|
||||
'legalName' => '',
|
||||
'legalCountry' => '',
|
||||
'legalState' => '',
|
||||
'legalCity' => '',
|
||||
'legalAddress' => '',
|
||||
'legalTaxId' => '',
|
||||
'auths' => [
|
||||
'mockNumbers' => [],
|
||||
'invites' => System::getEnv('_APP_CONSOLE_INVITES', 'enabled') === 'enabled',
|
||||
'limit' => (System::getEnv('_APP_CONSOLE_WHITELIST_ROOT', 'enabled') === 'enabled') ? 1 : 0, // limit signup to 1 user
|
||||
'duration' => Auth::TOKEN_EXPIRATION_LOGIN_LONG, // 1 Year in seconds
|
||||
'sessionAlerts' => System::getEnv('_APP_CONSOLE_SESSION_ALERTS', 'disabled') === 'enabled'
|
||||
],
|
||||
'authWhitelistEmails' => (!empty(System::getEnv('_APP_CONSOLE_WHITELIST_EMAILS', null))) ? \explode(',', System::getEnv('_APP_CONSOLE_WHITELIST_EMAILS', null)) : [],
|
||||
'authWhitelistIPs' => (!empty(System::getEnv('_APP_CONSOLE_WHITELIST_IPS', null))) ? \explode(',', System::getEnv('_APP_CONSOLE_WHITELIST_IPS', null)) : [],
|
||||
'oAuthProviders' => [
|
||||
'githubEnabled' => true,
|
||||
'githubSecret' => System::getEnv('_APP_CONSOLE_GITHUB_SECRET', ''),
|
||||
'githubAppid' => System::getEnv('_APP_CONSOLE_GITHUB_APP_ID', '')
|
||||
],
|
||||
]);
|
||||
return new Document(Config::getParam('console'));
|
||||
}, []);
|
||||
|
||||
App::setResource('dbForProject', function (Group $pools, Database $dbForPlatform, Cache $cache, Document $project) {
|
||||
|
||||
+10
-10
@@ -13,12 +13,12 @@ use Appwrite\Event\Func;
|
||||
use Appwrite\Event\Mail;
|
||||
use Appwrite\Event\Messaging;
|
||||
use Appwrite\Event\Migration;
|
||||
use Appwrite\Event\Realtime;
|
||||
use Appwrite\Event\StatsUsage;
|
||||
use Appwrite\Event\StatsUsageDump;
|
||||
/** remove */
|
||||
use Appwrite\Event\Usage;
|
||||
use Appwrite\Event\UsageDump;
|
||||
/** /remove */
|
||||
use Appwrite\Event\Webhook;
|
||||
use Appwrite\Platform\Appwrite;
|
||||
use Swoole\Runtime;
|
||||
use Utopia\Abuse\Adapters\TimeLimit\Redis as TimeLimitRedis;
|
||||
@@ -269,14 +269,6 @@ Server::setResource('consumer', function (Group $pools) {
|
||||
return $pools->get('consumer')->pop()->getResource();
|
||||
}, ['pools']);
|
||||
|
||||
Server::setResource('queueForUsage', function (Publisher $publisher) {
|
||||
return new Usage($publisher);
|
||||
}, ['publisher']);
|
||||
|
||||
Server::setResource('queueForUsageDump', function (Publisher $publisher) {
|
||||
return new UsageDump($publisher);
|
||||
}, ['publisher']);
|
||||
|
||||
Server::setResource('queueForStatsUsage', function (Publisher $publisher) {
|
||||
return new StatsUsage($publisher);
|
||||
}, ['publisher']);
|
||||
@@ -313,10 +305,18 @@ Server::setResource('queueForAudits', function (Publisher $publisher) {
|
||||
return new Audit($publisher);
|
||||
}, ['publisher']);
|
||||
|
||||
Server::setResource('queueForWebhooks', function (Publisher $publisher) {
|
||||
return new Webhook($publisher);
|
||||
}, ['publisher']);
|
||||
|
||||
Server::setResource('queueForFunctions', function (Publisher $publisher) {
|
||||
return new Func($publisher);
|
||||
}, ['publisher']);
|
||||
|
||||
Server::setResource('queueForRealtime', function () {
|
||||
return new Realtime();
|
||||
}, []);
|
||||
|
||||
Server::setResource('queueForCertificates', function (Publisher $publisher) {
|
||||
return new Certificate($publisher);
|
||||
}, ['publisher']);
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
php /usr/src/code/app/worker.php usage $@
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
php /usr/src/code/app/worker.php usage-dump $@
|
||||
+12
-12
@@ -46,22 +46,22 @@
|
||||
"ext-sockets": "*",
|
||||
"appwrite/php-runtimes": "0.18.*",
|
||||
"appwrite/php-clamav": "2.0.*",
|
||||
"utopia-php/abuse": "0.50.*",
|
||||
"utopia-php/abuse": "0.51.*",
|
||||
"utopia-php/analytics": "0.10.*",
|
||||
"utopia-php/audit": "0.51.*",
|
||||
"utopia-php/cache": "0.11.*",
|
||||
"utopia-php/audit": "0.54.0",
|
||||
"utopia-php/cache": "0.12.*",
|
||||
"utopia-php/cli": "0.15.*",
|
||||
"utopia-php/config": "0.2.*",
|
||||
"utopia-php/database": "0.59.0",
|
||||
"utopia-php/detector": "0.1.*",
|
||||
"utopia-php/database": "0.60.*",
|
||||
"utopia-php/domains": "0.5.*",
|
||||
"utopia-php/dsn": "0.2.1",
|
||||
"utopia-php/framework": "0.33.*",
|
||||
"utopia-php/fetch": "0.3.*",
|
||||
"utopia-php/image": "0.7.*",
|
||||
"utopia-php/image": "0.8.*",
|
||||
"utopia-php/locale": "0.4.*",
|
||||
"utopia-php/logger": "0.6.*",
|
||||
"utopia-php/messaging": "0.14.*",
|
||||
"utopia-php/messaging": "0.16.*",
|
||||
"utopia-php/migration": "0.6.*",
|
||||
"utopia-php/orchestration": "0.9.*",
|
||||
"utopia-php/platform": "0.7.3",
|
||||
@@ -73,7 +73,7 @@
|
||||
"utopia-php/swoole": "0.8.*",
|
||||
"utopia-php/system": "0.9.*",
|
||||
"utopia-php/telemetry": "0.1.*",
|
||||
"utopia-php/vcs": "0.8.*",
|
||||
"utopia-php/vcs": "0.9.*",
|
||||
"utopia-php/websocket": "0.1.*",
|
||||
"matomo/device-detector": "6.1.*",
|
||||
"dragonmantank/cron-expression": "3.3.2",
|
||||
@@ -87,12 +87,12 @@
|
||||
"require-dev": {
|
||||
"ext-fileinfo": "*",
|
||||
"appwrite/sdk-generator": "0.40.*",
|
||||
"phpunit/phpunit": "9.5.20",
|
||||
"phpunit/phpunit": "9.*",
|
||||
"swoole/ide-helper": "5.1.2",
|
||||
"textalk/websocket": "1.5.7",
|
||||
"laravel/pint": "^1.14",
|
||||
"phpbench/phpbench": "^1.2",
|
||||
"phpstan/phpstan": "1.8.*"
|
||||
"phpstan/phpstan": "1.8.*",
|
||||
"textalk/websocket": "1.5.*",
|
||||
"laravel/pint": "1.*",
|
||||
"phpbench/phpbench": "1.*"
|
||||
},
|
||||
"provide": {
|
||||
"ext-phpiredis": "*"
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
import io.appwrite.Client;
|
||||
import io.appwrite.coroutines.CoroutineCallback;
|
||||
import io.appwrite.services.Functions;
|
||||
|
||||
Client client = new Client(context)
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
|
||||
|
||||
Functions functions = new Functions(client);
|
||||
|
||||
functions.getDeploymentDownload(
|
||||
"<FUNCTION_ID>", // functionId
|
||||
"<DEPLOYMENT_ID>", // deploymentId
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
Log.d("Appwrite", result.toString());
|
||||
})
|
||||
);
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
import io.appwrite.Client;
|
||||
import io.appwrite.coroutines.CoroutineCallback;
|
||||
import io.appwrite.services.Functions;
|
||||
|
||||
Client client = new Client(context)
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
|
||||
|
||||
Functions functions = new Functions(client);
|
||||
|
||||
functions.getTemplate(
|
||||
"<TEMPLATE_ID>", // templateId
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
Log.d("Appwrite", result.toString());
|
||||
})
|
||||
);
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
import io.appwrite.Client;
|
||||
import io.appwrite.coroutines.CoroutineCallback;
|
||||
import io.appwrite.services.Functions;
|
||||
|
||||
Client client = new Client(context)
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
|
||||
|
||||
Functions functions = new Functions(client);
|
||||
|
||||
functions.listTemplates(
|
||||
listOf(), // runtimes (optional)
|
||||
listOf(), // useCases (optional)
|
||||
1, // limit (optional)
|
||||
0, // offset (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
Log.d("Appwrite", result.toString());
|
||||
})
|
||||
);
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
import io.appwrite.Client
|
||||
import io.appwrite.coroutines.CoroutineCallback
|
||||
import io.appwrite.services.Functions
|
||||
|
||||
val client = Client(context)
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
|
||||
val functions = Functions(client)
|
||||
|
||||
val result = functions.getDeploymentDownload(
|
||||
functionId = "<FUNCTION_ID>",
|
||||
deploymentId = "<DEPLOYMENT_ID>",
|
||||
)
|
||||
@@ -1,13 +0,0 @@
|
||||
import io.appwrite.Client
|
||||
import io.appwrite.coroutines.CoroutineCallback
|
||||
import io.appwrite.services.Functions
|
||||
|
||||
val client = Client(context)
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
|
||||
val functions = Functions(client)
|
||||
|
||||
val result = functions.getTemplate(
|
||||
templateId = "<TEMPLATE_ID>",
|
||||
)
|
||||
@@ -1,16 +0,0 @@
|
||||
import io.appwrite.Client
|
||||
import io.appwrite.coroutines.CoroutineCallback
|
||||
import io.appwrite.services.Functions
|
||||
|
||||
val client = Client(context)
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
|
||||
val functions = Functions(client)
|
||||
|
||||
val result = functions.listTemplates(
|
||||
runtimes = listOf(), // (optional)
|
||||
useCases = listOf(), // (optional)
|
||||
limit = 1, // (optional)
|
||||
offset = 0, // (optional)
|
||||
)
|
||||
@@ -6,7 +6,7 @@ let client = Client()
|
||||
|
||||
let account = Account(client)
|
||||
|
||||
let result = try await account.updateMfaChallenge(
|
||||
let session = try await account.updateMfaChallenge(
|
||||
challengeId: "<CHALLENGE_ID>",
|
||||
otp: "<OTP>"
|
||||
)
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
import Appwrite
|
||||
|
||||
let client = Client()
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
|
||||
let functions = Functions(client)
|
||||
|
||||
let bytes = try await functions.getDeploymentDownload(
|
||||
functionId: "<FUNCTION_ID>",
|
||||
deploymentId: "<DEPLOYMENT_ID>"
|
||||
)
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
import Appwrite
|
||||
|
||||
let client = Client()
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
|
||||
let functions = Functions(client)
|
||||
|
||||
let templateFunction = try await functions.getTemplate(
|
||||
templateId: "<TEMPLATE_ID>"
|
||||
)
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import Appwrite
|
||||
|
||||
let client = Client()
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
|
||||
let functions = Functions(client)
|
||||
|
||||
let templateFunctionList = try await functions.listTemplates(
|
||||
runtimes: [], // optional
|
||||
useCases: [], // optional
|
||||
limit: 1, // optional
|
||||
offset: 0 // optional
|
||||
)
|
||||
|
||||
@@ -6,7 +6,7 @@ Client client = Client()
|
||||
|
||||
Account account = Account(client);
|
||||
|
||||
result = await account.updateMfaChallenge(
|
||||
Session result = await account.updateMfaChallenge(
|
||||
challengeId: '<CHALLENGE_ID>',
|
||||
otp: '<OTP>',
|
||||
);
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Functions functions = Functions(client);
|
||||
|
||||
// Downloading file
|
||||
UInt8List bytes = await functions.getDeploymentDownload(
|
||||
functionId: '<FUNCTION_ID>',
|
||||
deploymentId: '<DEPLOYMENT_ID>',
|
||||
)
|
||||
|
||||
final file = File('path_to_file/filename.ext');
|
||||
file.writeAsBytesSync(bytes);
|
||||
|
||||
// Displaying image preview
|
||||
FutureBuilder(
|
||||
future: functions.getDeploymentDownload(
|
||||
functionId:'<FUNCTION_ID>' ,
|
||||
deploymentId:'<DEPLOYMENT_ID>' ,
|
||||
), // Works for both public file and private file, for private files you need to be logged in
|
||||
builder: (context, snapshot) {
|
||||
return snapshot.hasData && snapshot.data != null
|
||||
? Image.memory(snapshot.data)
|
||||
: CircularProgressIndicator();
|
||||
}
|
||||
);
|
||||
@@ -1,11 +0,0 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Functions functions = Functions(client);
|
||||
|
||||
TemplateFunction result = await functions.getTemplate(
|
||||
templateId: '<TEMPLATE_ID>',
|
||||
);
|
||||
@@ -1,14 +0,0 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Functions functions = Functions(client);
|
||||
|
||||
TemplateFunctionList result = await functions.listTemplates(
|
||||
runtimes: [], // optional
|
||||
useCases: [], // optional
|
||||
limit: 1, // optional
|
||||
offset: 0, // optional
|
||||
);
|
||||
@@ -3,6 +3,34 @@ mutation {
|
||||
challengeId: "<CHALLENGE_ID>",
|
||||
otp: "<OTP>"
|
||||
) {
|
||||
status
|
||||
_id
|
||||
_createdAt
|
||||
_updatedAt
|
||||
userId
|
||||
expire
|
||||
provider
|
||||
providerUid
|
||||
providerAccessToken
|
||||
providerAccessTokenExpiry
|
||||
providerRefreshToken
|
||||
ip
|
||||
osCode
|
||||
osName
|
||||
osVersion
|
||||
clientType
|
||||
clientCode
|
||||
clientName
|
||||
clientVersion
|
||||
clientEngine
|
||||
clientEngineVersion
|
||||
deviceName
|
||||
deviceBrand
|
||||
deviceModel
|
||||
countryCode
|
||||
countryName
|
||||
current
|
||||
factors
|
||||
secret
|
||||
mfaUpdatedAt
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
query {
|
||||
functionsGetDeploymentDownload(
|
||||
functionId: "<FUNCTION_ID>",
|
||||
deploymentId: "<DEPLOYMENT_ID>"
|
||||
) {
|
||||
status
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
query {
|
||||
functionsGetTemplate(
|
||||
templateId: "<TEMPLATE_ID>"
|
||||
) {
|
||||
icon
|
||||
id
|
||||
name
|
||||
tagline
|
||||
permissions
|
||||
events
|
||||
cron
|
||||
timeout
|
||||
useCases
|
||||
runtimes {
|
||||
name
|
||||
commands
|
||||
entrypoint
|
||||
providerRootDirectory
|
||||
}
|
||||
instructions
|
||||
vcsProvider
|
||||
providerRepositoryId
|
||||
providerOwner
|
||||
providerVersion
|
||||
variables {
|
||||
name
|
||||
description
|
||||
value
|
||||
placeholder
|
||||
required
|
||||
type
|
||||
}
|
||||
scopes
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
query {
|
||||
functionsListTemplates(
|
||||
runtimes: [],
|
||||
useCases: [],
|
||||
limit: 1,
|
||||
offset: 0
|
||||
) {
|
||||
total
|
||||
templates {
|
||||
icon
|
||||
id
|
||||
name
|
||||
tagline
|
||||
permissions
|
||||
events
|
||||
cron
|
||||
timeout
|
||||
useCases
|
||||
runtimes {
|
||||
name
|
||||
commands
|
||||
entrypoint
|
||||
providerRootDirectory
|
||||
}
|
||||
instructions
|
||||
vcsProvider
|
||||
providerRepositoryId
|
||||
providerOwner
|
||||
providerVersion
|
||||
variables {
|
||||
name
|
||||
description
|
||||
value
|
||||
placeholder
|
||||
required
|
||||
type
|
||||
}
|
||||
scopes
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
import { Client, Functions } from "react-native-appwrite";
|
||||
|
||||
const client = new Client()
|
||||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
const functions = new Functions(client);
|
||||
|
||||
const result = functions.getDeploymentDownload(
|
||||
'<FUNCTION_ID>', // functionId
|
||||
'<DEPLOYMENT_ID>' // deploymentId
|
||||
);
|
||||
|
||||
console.log(result);
|
||||
@@ -1,13 +0,0 @@
|
||||
import { Client, Functions } from "react-native-appwrite";
|
||||
|
||||
const client = new Client()
|
||||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
const functions = new Functions(client);
|
||||
|
||||
const result = await functions.getTemplate(
|
||||
'<TEMPLATE_ID>' // templateId
|
||||
);
|
||||
|
||||
console.log(result);
|
||||
@@ -1,16 +0,0 @@
|
||||
import { Client, Functions } from "react-native-appwrite";
|
||||
|
||||
const client = new Client()
|
||||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
const functions = new Functions(client);
|
||||
|
||||
const result = await functions.listTemplates(
|
||||
[], // runtimes (optional)
|
||||
[], // useCases (optional)
|
||||
1, // limit (optional)
|
||||
0 // offset (optional)
|
||||
);
|
||||
|
||||
console.log(result);
|
||||
@@ -1,8 +0,0 @@
|
||||
GET /v1/functions/{functionId}/deployments/{deploymentId}/download HTTP/1.1
|
||||
Host: cloud.appwrite.io
|
||||
Content-Type: application/json
|
||||
X-Appwrite-Response-Format: 1.6.0
|
||||
X-Appwrite-Project: <YOUR_PROJECT_ID>
|
||||
X-Appwrite-Session:
|
||||
X-Appwrite-JWT: <YOUR_JWT>
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
GET /v1/functions/templates/{templateId} HTTP/1.1
|
||||
Host: cloud.appwrite.io
|
||||
Content-Type: application/json
|
||||
X-Appwrite-Response-Format: 1.6.0
|
||||
X-Appwrite-Project: <YOUR_PROJECT_ID>
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
GET /v1/functions/templates HTTP/1.1
|
||||
Host: cloud.appwrite.io
|
||||
Content-Type: application/json
|
||||
X-Appwrite-Response-Format: 1.6.0
|
||||
X-Appwrite-Project: <YOUR_PROJECT_ID>
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
import { Client, Functions } from "appwrite";
|
||||
|
||||
const client = new Client()
|
||||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
const functions = new Functions(client);
|
||||
|
||||
const result = functions.getDeploymentDownload(
|
||||
'<FUNCTION_ID>', // functionId
|
||||
'<DEPLOYMENT_ID>' // deploymentId
|
||||
);
|
||||
|
||||
console.log(result);
|
||||
@@ -1,13 +0,0 @@
|
||||
import { Client, Functions } from "appwrite";
|
||||
|
||||
const client = new Client()
|
||||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
const functions = new Functions(client);
|
||||
|
||||
const result = await functions.getTemplate(
|
||||
'<TEMPLATE_ID>' // templateId
|
||||
);
|
||||
|
||||
console.log(result);
|
||||
@@ -1,16 +0,0 @@
|
||||
import { Client, Functions } from "appwrite";
|
||||
|
||||
const client = new Client()
|
||||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
const functions = new Functions(client);
|
||||
|
||||
const result = await functions.listTemplates(
|
||||
[], // runtimes (optional)
|
||||
[], // useCases (optional)
|
||||
1, // limit (optional)
|
||||
0 // offset (optional)
|
||||
);
|
||||
|
||||
console.log(result);
|
||||
@@ -1,3 +0,0 @@
|
||||
appwrite functions downloadDeployment \
|
||||
--functionId <FUNCTION_ID> \
|
||||
--deploymentId <DEPLOYMENT_ID>
|
||||
@@ -1 +0,0 @@
|
||||
appwrite functions getSpecifications
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
appwrite migrations createFirebaseOAuthMigration \
|
||||
--resources one two three \
|
||||
--projectId <PROJECT_ID>
|
||||
@@ -1 +0,0 @@
|
||||
appwrite migrations deleteFirebaseAuth
|
||||
@@ -1,3 +0,0 @@
|
||||
appwrite migrations getFirebaseReportOAuth \
|
||||
--resources one two three \
|
||||
--projectId <PROJECT_ID>
|
||||
@@ -1 +0,0 @@
|
||||
appwrite migrations listFirebaseProjects
|
||||
@@ -1,14 +0,0 @@
|
||||
import { Client, Functions } from "@appwrite.io/console";
|
||||
|
||||
const client = new Client()
|
||||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
const functions = new Functions(client);
|
||||
|
||||
const result = functions.downloadDeployment(
|
||||
'<FUNCTION_ID>', // functionId
|
||||
'<DEPLOYMENT_ID>' // deploymentId
|
||||
);
|
||||
|
||||
console.log(result);
|
||||
@@ -1,11 +0,0 @@
|
||||
import { Client, Functions } from "@appwrite.io/console";
|
||||
|
||||
const client = new Client()
|
||||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
const functions = new Functions(client);
|
||||
|
||||
const result = await functions.getSpecifications();
|
||||
|
||||
console.log(result);
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
import { Client, Migrations } from "@appwrite.io/console";
|
||||
|
||||
const client = new Client()
|
||||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
const migrations = new Migrations(client);
|
||||
|
||||
const result = await migrations.createFirebaseOAuthMigration(
|
||||
[], // resources
|
||||
'<PROJECT_ID>' // projectId
|
||||
);
|
||||
|
||||
console.log(result);
|
||||
@@ -1,11 +0,0 @@
|
||||
import { Client, Migrations } from "@appwrite.io/console";
|
||||
|
||||
const client = new Client()
|
||||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
const migrations = new Migrations(client);
|
||||
|
||||
const result = await migrations.deleteFirebaseAuth();
|
||||
|
||||
console.log(result);
|
||||
@@ -1,14 +0,0 @@
|
||||
import { Client, Migrations } from "@appwrite.io/console";
|
||||
|
||||
const client = new Client()
|
||||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
const migrations = new Migrations(client);
|
||||
|
||||
const result = await migrations.getFirebaseReportOAuth(
|
||||
[], // resources
|
||||
'<PROJECT_ID>' // projectId
|
||||
);
|
||||
|
||||
console.log(result);
|
||||
@@ -1,11 +0,0 @@
|
||||
import { Client, Migrations } from "@appwrite.io/console";
|
||||
|
||||
const client = new Client()
|
||||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
const migrations = new Migrations(client);
|
||||
|
||||
const result = await migrations.listFirebaseProjects();
|
||||
|
||||
console.log(result);
|
||||
@@ -7,7 +7,7 @@ Client client = Client()
|
||||
|
||||
Account account = Account(client);
|
||||
|
||||
result = await account.updateMfaChallenge(
|
||||
Session result = await account.updateMfaChallenge(
|
||||
challengeId: '<CHALLENGE_ID>',
|
||||
otp: '<OTP>',
|
||||
);
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
import 'package:dart_appwrite/dart_appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>') // Your project ID
|
||||
.setKey('<YOUR_API_KEY>'); // Your secret API key
|
||||
|
||||
Functions functions = Functions(client);
|
||||
|
||||
UInt8List result = await functions.downloadDeployment(
|
||||
functionId: '<FUNCTION_ID>',
|
||||
deploymentId: '<DEPLOYMENT_ID>',
|
||||
);
|
||||
@@ -1,11 +0,0 @@
|
||||
import 'package:dart_appwrite/dart_appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Functions functions = Functions(client);
|
||||
|
||||
TemplateFunction result = await functions.getTemplate(
|
||||
templateId: '<TEMPLATE_ID>',
|
||||
);
|
||||
@@ -1,14 +0,0 @@
|
||||
import 'package:dart_appwrite/dart_appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Functions functions = Functions(client);
|
||||
|
||||
TemplateFunctionList result = await functions.listTemplates(
|
||||
runtimes: [], // (optional)
|
||||
useCases: [], // (optional)
|
||||
limit: 1, // (optional)
|
||||
offset: 0, // (optional)
|
||||
);
|
||||
@@ -1,13 +0,0 @@
|
||||
import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts";
|
||||
|
||||
const client = new Client()
|
||||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>') // Your project ID
|
||||
.setKey('<YOUR_API_KEY>'); // Your secret API key
|
||||
|
||||
const functions = new Functions(client);
|
||||
|
||||
const result = functions.downloadDeployment(
|
||||
'<FUNCTION_ID>', // functionId
|
||||
'<DEPLOYMENT_ID>' // deploymentId
|
||||
);
|
||||
@@ -1,11 +0,0 @@
|
||||
import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts";
|
||||
|
||||
const client = new Client()
|
||||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
const functions = new Functions(client);
|
||||
|
||||
const response = await functions.getTemplate(
|
||||
'<TEMPLATE_ID>' // templateId
|
||||
);
|
||||
@@ -1,14 +0,0 @@
|
||||
import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts";
|
||||
|
||||
const client = new Client()
|
||||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
const functions = new Functions(client);
|
||||
|
||||
const response = await functions.listTemplates(
|
||||
[], // runtimes (optional)
|
||||
[], // useCases (optional)
|
||||
1, // limit (optional)
|
||||
0 // offset (optional)
|
||||
);
|
||||
@@ -9,7 +9,7 @@ Client client = new Client()
|
||||
|
||||
Account account = new Account(client);
|
||||
|
||||
result = await account.UpdateMfaChallenge(
|
||||
Session result = await account.UpdateMfaChallenge(
|
||||
challengeId: "<CHALLENGE_ID>",
|
||||
otp: "<OTP>"
|
||||
);
|
||||
@@ -1,15 +0,0 @@
|
||||
using Appwrite;
|
||||
using Appwrite.Models;
|
||||
using Appwrite.Services;
|
||||
|
||||
Client client = new Client()
|
||||
.SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
.SetKey("<YOUR_API_KEY>"); // Your secret API key
|
||||
|
||||
Functions functions = new Functions(client);
|
||||
|
||||
byte[] result = await functions.DownloadDeployment(
|
||||
functionId: "<FUNCTION_ID>",
|
||||
deploymentId: "<DEPLOYMENT_ID>"
|
||||
);
|
||||
@@ -1,13 +0,0 @@
|
||||
using Appwrite;
|
||||
using Appwrite.Models;
|
||||
using Appwrite.Services;
|
||||
|
||||
Client client = new Client()
|
||||
.SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.SetProject("<YOUR_PROJECT_ID>"); // Your project ID
|
||||
|
||||
Functions functions = new Functions(client);
|
||||
|
||||
TemplateFunction result = await functions.GetTemplate(
|
||||
templateId: "<TEMPLATE_ID>"
|
||||
);
|
||||
@@ -1,16 +0,0 @@
|
||||
using Appwrite;
|
||||
using Appwrite.Models;
|
||||
using Appwrite.Services;
|
||||
|
||||
Client client = new Client()
|
||||
.SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.SetProject("<YOUR_PROJECT_ID>"); // Your project ID
|
||||
|
||||
Functions functions = new Functions(client);
|
||||
|
||||
TemplateFunctionList result = await functions.ListTemplates(
|
||||
runtimes: new List<string>(), // optional
|
||||
useCases: new List<string>(), // optional
|
||||
limit: 1, // optional
|
||||
offset: 0 // optional
|
||||
);
|
||||
@@ -1,27 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/appwrite/sdk-for-go/client"
|
||||
"github.com/appwrite/sdk-for-go/functions"
|
||||
)
|
||||
|
||||
func main() {
|
||||
client := client.NewClient()
|
||||
|
||||
client.SetEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
client.SetProject("") // Your project ID
|
||||
client.SetKey("") // Your secret API key
|
||||
|
||||
service := functions.NewFunctions(client)
|
||||
response, error := service.DownloadDeployment(
|
||||
"<FUNCTION_ID>",
|
||||
"<DEPLOYMENT_ID>",
|
||||
)
|
||||
|
||||
if error != nil {
|
||||
panic(error)
|
||||
}
|
||||
|
||||
fmt.Println(response)
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/appwrite/sdk-for-go/client"
|
||||
"github.com/appwrite/sdk-for-go/functions"
|
||||
)
|
||||
|
||||
func main() {
|
||||
client := client.NewClient()
|
||||
|
||||
client.SetEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
client.SetProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
|
||||
service := functions.NewFunctions(client)
|
||||
response, error := service.GetTemplate(
|
||||
"<TEMPLATE_ID>",
|
||||
)
|
||||
|
||||
if error != nil {
|
||||
panic(error)
|
||||
}
|
||||
|
||||
fmt.Println(response)
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/appwrite/sdk-for-go/client"
|
||||
"github.com/appwrite/sdk-for-go/functions"
|
||||
)
|
||||
|
||||
func main() {
|
||||
client := client.NewClient()
|
||||
|
||||
client.SetEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
client.SetProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
|
||||
service := functions.NewFunctions(client)
|
||||
response, error := service.ListTemplates(
|
||||
functions.WithListTemplatesRuntimes([]interface{}{}),
|
||||
functions.WithListTemplatesUseCases([]interface{}{}),
|
||||
functions.WithListTemplatesLimit(1),
|
||||
functions.WithListTemplatesOffset(0),
|
||||
)
|
||||
|
||||
if error != nil {
|
||||
panic(error)
|
||||
}
|
||||
|
||||
fmt.Println(response)
|
||||
}
|
||||
@@ -3,6 +3,34 @@ mutation {
|
||||
challengeId: "<CHALLENGE_ID>",
|
||||
otp: "<OTP>"
|
||||
) {
|
||||
status
|
||||
_id
|
||||
_createdAt
|
||||
_updatedAt
|
||||
userId
|
||||
expire
|
||||
provider
|
||||
providerUid
|
||||
providerAccessToken
|
||||
providerAccessTokenExpiry
|
||||
providerRefreshToken
|
||||
ip
|
||||
osCode
|
||||
osName
|
||||
osVersion
|
||||
clientType
|
||||
clientCode
|
||||
clientName
|
||||
clientVersion
|
||||
clientEngine
|
||||
clientEngineVersion
|
||||
deviceName
|
||||
deviceBrand
|
||||
deviceModel
|
||||
countryCode
|
||||
countryName
|
||||
current
|
||||
factors
|
||||
secret
|
||||
mfaUpdatedAt
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
query {
|
||||
functionsDownloadDeployment(
|
||||
functionId: "<FUNCTION_ID>",
|
||||
deploymentId: "<DEPLOYMENT_ID>"
|
||||
) {
|
||||
status
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
query {
|
||||
functionsGetTemplate(
|
||||
templateId: "<TEMPLATE_ID>"
|
||||
) {
|
||||
icon
|
||||
id
|
||||
name
|
||||
tagline
|
||||
permissions
|
||||
events
|
||||
cron
|
||||
timeout
|
||||
useCases
|
||||
runtimes {
|
||||
name
|
||||
commands
|
||||
entrypoint
|
||||
providerRootDirectory
|
||||
}
|
||||
instructions
|
||||
vcsProvider
|
||||
providerRepositoryId
|
||||
providerOwner
|
||||
providerVersion
|
||||
variables {
|
||||
name
|
||||
description
|
||||
value
|
||||
placeholder
|
||||
required
|
||||
type
|
||||
}
|
||||
scopes
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
query {
|
||||
functionsListTemplates(
|
||||
runtimes: [],
|
||||
useCases: [],
|
||||
limit: 1,
|
||||
offset: 0
|
||||
) {
|
||||
total
|
||||
templates {
|
||||
icon
|
||||
id
|
||||
name
|
||||
tagline
|
||||
permissions
|
||||
events
|
||||
cron
|
||||
timeout
|
||||
useCases
|
||||
runtimes {
|
||||
name
|
||||
commands
|
||||
entrypoint
|
||||
providerRootDirectory
|
||||
}
|
||||
instructions
|
||||
vcsProvider
|
||||
providerRepositoryId
|
||||
providerOwner
|
||||
providerVersion
|
||||
variables {
|
||||
name
|
||||
description
|
||||
value
|
||||
placeholder
|
||||
required
|
||||
type
|
||||
}
|
||||
scopes
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,36 +3,6 @@ mutation {
|
||||
userId: "<USER_ID>",
|
||||
type: "totp"
|
||||
) {
|
||||
_id
|
||||
_createdAt
|
||||
_updatedAt
|
||||
name
|
||||
password
|
||||
hash
|
||||
hashOptions
|
||||
registration
|
||||
status
|
||||
labels
|
||||
passwordUpdate
|
||||
email
|
||||
phone
|
||||
emailVerification
|
||||
phoneVerification
|
||||
mfa
|
||||
prefs {
|
||||
data
|
||||
}
|
||||
targets {
|
||||
_id
|
||||
_createdAt
|
||||
_updatedAt
|
||||
name
|
||||
userId
|
||||
providerId
|
||||
providerType
|
||||
identifier
|
||||
expired
|
||||
}
|
||||
accessedAt
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
import io.appwrite.Client;
|
||||
import io.appwrite.coroutines.CoroutineCallback;
|
||||
import io.appwrite.services.Functions;
|
||||
|
||||
Client client = new Client()
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
.setKey("<YOUR_API_KEY>"); // Your secret API key
|
||||
|
||||
Functions functions = new Functions(client);
|
||||
|
||||
functions.downloadDeployment(
|
||||
"<FUNCTION_ID>", // functionId
|
||||
"<DEPLOYMENT_ID>", // deploymentId
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println(result);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
import io.appwrite.Client;
|
||||
import io.appwrite.coroutines.CoroutineCallback;
|
||||
import io.appwrite.services.Functions;
|
||||
|
||||
Client client = new Client()
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
|
||||
|
||||
Functions functions = new Functions(client);
|
||||
|
||||
functions.getTemplate(
|
||||
"<TEMPLATE_ID>", // templateId
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println(result);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
import io.appwrite.Client;
|
||||
import io.appwrite.coroutines.CoroutineCallback;
|
||||
import io.appwrite.services.Functions;
|
||||
|
||||
Client client = new Client()
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
|
||||
|
||||
Functions functions = new Functions(client);
|
||||
|
||||
functions.listTemplates(
|
||||
listOf(), // runtimes (optional)
|
||||
listOf(), // useCases (optional)
|
||||
1, // limit (optional)
|
||||
0, // offset (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println(result);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import io.appwrite.Client
|
||||
import io.appwrite.coroutines.CoroutineCallback
|
||||
import io.appwrite.services.Functions
|
||||
|
||||
val client = Client()
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
.setKey("<YOUR_API_KEY>") // Your secret API key
|
||||
|
||||
val functions = Functions(client)
|
||||
|
||||
val result = functions.downloadDeployment(
|
||||
functionId = "<FUNCTION_ID>",
|
||||
deploymentId = "<DEPLOYMENT_ID>"
|
||||
)
|
||||
@@ -1,13 +0,0 @@
|
||||
import io.appwrite.Client
|
||||
import io.appwrite.coroutines.CoroutineCallback
|
||||
import io.appwrite.services.Functions
|
||||
|
||||
val client = Client()
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
|
||||
val functions = Functions(client)
|
||||
|
||||
val response = functions.getTemplate(
|
||||
templateId = "<TEMPLATE_ID>"
|
||||
)
|
||||
@@ -1,16 +0,0 @@
|
||||
import io.appwrite.Client
|
||||
import io.appwrite.coroutines.CoroutineCallback
|
||||
import io.appwrite.services.Functions
|
||||
|
||||
val client = Client()
|
||||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
|
||||
val functions = Functions(client)
|
||||
|
||||
val response = functions.listTemplates(
|
||||
runtimes = listOf(), // optional
|
||||
useCases = listOf(), // optional
|
||||
limit = 1, // optional
|
||||
offset = 0 // optional
|
||||
)
|
||||
@@ -1,13 +0,0 @@
|
||||
const sdk = require('node-appwrite');
|
||||
|
||||
const client = new sdk.Client()
|
||||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>') // Your project ID
|
||||
.setKey('<YOUR_API_KEY>'); // Your secret API key
|
||||
|
||||
const functions = new sdk.Functions(client);
|
||||
|
||||
const result = await functions.downloadDeployment(
|
||||
'<FUNCTION_ID>', // functionId
|
||||
'<DEPLOYMENT_ID>' // deploymentId
|
||||
);
|
||||
@@ -1,11 +0,0 @@
|
||||
const sdk = require('node-appwrite');
|
||||
|
||||
const client = new sdk.Client()
|
||||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
const functions = new sdk.Functions(client);
|
||||
|
||||
const result = await functions.getTemplate(
|
||||
'<TEMPLATE_ID>' // templateId
|
||||
);
|
||||
@@ -1,14 +0,0 @@
|
||||
const sdk = require('node-appwrite');
|
||||
|
||||
const client = new sdk.Client()
|
||||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
const functions = new sdk.Functions(client);
|
||||
|
||||
const result = await functions.listTemplates(
|
||||
[], // runtimes (optional)
|
||||
[], // useCases (optional)
|
||||
1, // limit (optional)
|
||||
0 // offset (optional)
|
||||
);
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Appwrite\Client;
|
||||
use Appwrite\Services\Functions;
|
||||
|
||||
$client = (new Client())
|
||||
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
->setProject('<YOUR_PROJECT_ID>') // Your project ID
|
||||
->setKey('<YOUR_API_KEY>'); // Your secret API key
|
||||
|
||||
$functions = new Functions($client);
|
||||
|
||||
$result = $functions->downloadDeployment(
|
||||
functionId: '<FUNCTION_ID>',
|
||||
deploymentId: '<DEPLOYMENT_ID>'
|
||||
);
|
||||
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Appwrite\Client;
|
||||
use Appwrite\Services\Functions;
|
||||
|
||||
$client = (new Client())
|
||||
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
->setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
$functions = new Functions($client);
|
||||
|
||||
$result = $functions->getTemplate(
|
||||
templateId: '<TEMPLATE_ID>'
|
||||
);
|
||||
@@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Appwrite\Client;
|
||||
use Appwrite\Services\Functions;
|
||||
|
||||
$client = (new Client())
|
||||
->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
->setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
$functions = new Functions($client);
|
||||
|
||||
$result = $functions->listTemplates(
|
||||
runtimes: [], // optional
|
||||
useCases: [], // optional
|
||||
limit: 1, // optional
|
||||
offset: 0 // optional
|
||||
);
|
||||
@@ -1,13 +0,0 @@
|
||||
from appwrite.client import Client
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
client.set_key('<YOUR_API_KEY>') # Your secret API key
|
||||
|
||||
functions = Functions(client)
|
||||
|
||||
result = functions.download_deployment(
|
||||
function_id = '<FUNCTION_ID>',
|
||||
deployment_id = '<DEPLOYMENT_ID>'
|
||||
)
|
||||
@@ -1,11 +0,0 @@
|
||||
from appwrite.client import Client
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
|
||||
functions = Functions(client)
|
||||
|
||||
result = functions.get_template(
|
||||
template_id = '<TEMPLATE_ID>'
|
||||
)
|
||||
@@ -1,14 +0,0 @@
|
||||
from appwrite.client import Client
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
|
||||
functions = Functions(client)
|
||||
|
||||
result = functions.list_templates(
|
||||
runtimes = [], # optional
|
||||
use_cases = [], # optional
|
||||
limit = 1, # optional
|
||||
offset = 0 # optional
|
||||
)
|
||||
@@ -1,7 +0,0 @@
|
||||
GET /v1/functions/{functionId}/deployments/{deploymentId}/download HTTP/1.1
|
||||
Host: cloud.appwrite.io
|
||||
Content-Type: application/json
|
||||
X-Appwrite-Response-Format: 1.5.0
|
||||
X-Appwrite-Project: <YOUR_PROJECT_ID>
|
||||
X-Appwrite-Key: <YOUR_API_KEY>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user