mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Merge branch '1.7.x' into generak-sdk-1.7.x
This commit is contained in:
@@ -81,7 +81,7 @@ return [
|
||||
],
|
||||
Exception::GENERAL_ROUTE_NOT_FOUND => [
|
||||
'name' => Exception::GENERAL_ROUTE_NOT_FOUND,
|
||||
'description' => 'The requested route was not found. Please refer to the API docs and try again.',
|
||||
'description' => 'Route not found. Please ensure the endpoint is configured correctly and that the API route is valid for this SDK version. Refer to the API docs for more details.',
|
||||
'code' => 404,
|
||||
],
|
||||
Exception::GENERAL_CURSOR_NOT_FOUND => [
|
||||
@@ -499,6 +499,11 @@ return [
|
||||
'description' => 'The requested file token has expired.',
|
||||
'code' => 401,
|
||||
],
|
||||
Exception::TOKEN_RESOURCE_TYPE_INVALID => [
|
||||
'name' => Exception::TOKEN_RESOURCE_TYPE_INVALID,
|
||||
'description' => 'The resource type for the token is invalid.',
|
||||
'code' => 400,
|
||||
],
|
||||
|
||||
/** VCS */
|
||||
Exception::INSTALLATION_NOT_FOUND => [
|
||||
|
||||
@@ -253,13 +253,30 @@ return [
|
||||
'adapters' => [
|
||||
'static' => [
|
||||
'key' => 'static',
|
||||
'buildCommand' => 'flutter build web',
|
||||
'installCommand' => '',
|
||||
'buildCommand' => 'flutter build web --release -t lib/main.dart',
|
||||
'installCommand' => 'flutter pub get',
|
||||
'outputDirectory' => './build/web',
|
||||
'startCommand' => 'bash helpers/server.sh',
|
||||
],
|
||||
],
|
||||
],
|
||||
'react-native' => [
|
||||
'key' => 'react-native',
|
||||
'name' => 'React Native',
|
||||
'screenshotSleep' => 3000,
|
||||
'buildRuntime' => 'node-22',
|
||||
'runtimes' => getVersions($templateRuntimes['NODE']['versions'], 'node'),
|
||||
'adapters' => [
|
||||
'static' => [
|
||||
'key' => 'static',
|
||||
'buildCommand' => 'npm run build',
|
||||
'installCommand' => 'npm install',
|
||||
'outputDirectory' => './dist',
|
||||
'startCommand' => 'bash helpers/server.sh',
|
||||
'fallbackFile' => 'index.html'
|
||||
]
|
||||
]
|
||||
],
|
||||
'vite' => [
|
||||
'key' => 'vite',
|
||||
'name' => 'Vite',
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
<style>
|
||||
a.button {
|
||||
display: inline-block;
|
||||
background: #fd366e;
|
||||
background: {{accentColor}};
|
||||
color: #ffffff;
|
||||
border-radius: 8px;
|
||||
height: 48px;
|
||||
@@ -88,7 +88,7 @@
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
border-color: #fd366e;
|
||||
border-color: {{accentColor}};
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
margin-right: 24px;
|
||||
@@ -126,7 +126,7 @@
|
||||
<td>
|
||||
<img
|
||||
height="32px"
|
||||
src="https://cloud.appwrite.io/images/mails/logo.png"
|
||||
src="{{logoUrl}}"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -164,7 +164,7 @@
|
||||
<tr>
|
||||
<td style="padding-left: 4px; padding-right: 4px">
|
||||
<a
|
||||
href="https://twitter.com/appwrite"
|
||||
href="{{twitterUrl}}"
|
||||
class="social-icon"
|
||||
title="Twitter"
|
||||
>
|
||||
@@ -173,7 +173,7 @@
|
||||
</td>
|
||||
<td style="padding-left: 4px; padding-right: 4px">
|
||||
<a
|
||||
href="https://appwrite.io/discord"
|
||||
href="{{discordUrl}}"
|
||||
class="social-icon"
|
||||
>
|
||||
<img src="https://cloud.appwrite.io/images/mails/discord.png" height="24" width="24" />
|
||||
@@ -181,7 +181,7 @@
|
||||
</td>
|
||||
<td style="padding-left: 4px; padding-right: 4px">
|
||||
<a
|
||||
href="https://github.com/appwrite/appwrite"
|
||||
href="{{githubUrl}}"
|
||||
class="social-icon"
|
||||
>
|
||||
<img src="https://cloud.appwrite.io/images/mails/github.png" height="24" width="24" />
|
||||
@@ -191,11 +191,11 @@
|
||||
</table>
|
||||
<table style="width: auto; margin: 0 auto; margin-top: 60px">
|
||||
<tr>
|
||||
<td><a href="https://appwrite.io/terms">Terms</a></td>
|
||||
<td><a href="{{termsUrl}}">Terms</a></td>
|
||||
<td style="color: #e8e9f0">
|
||||
<div style="margin: 0 8px">|</div>
|
||||
</td>
|
||||
<td><a href="https://appwrite.io/privacy">Privacy</a></td>
|
||||
<td><a href="{{privacyUrl}}">Privacy</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p style="text-align: center" align="center">
|
||||
|
||||
@@ -134,7 +134,7 @@ return [
|
||||
[
|
||||
'key' => 'react-native',
|
||||
'name' => 'React Native',
|
||||
'version' => '0.7.3',
|
||||
'version' => '0.7.4',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-react-native',
|
||||
'package' => 'https://npmjs.com/package/react-native-appwrite',
|
||||
'enabled' => true,
|
||||
|
||||
@@ -4485,26 +4485,6 @@
|
||||
}
|
||||
],
|
||||
"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."
|
||||
},
|
||||
{
|
||||
"name": "createDocuments",
|
||||
"parameters": [
|
||||
"databaseId",
|
||||
"collectionId",
|
||||
"documents"
|
||||
],
|
||||
"required": [
|
||||
"databaseId",
|
||||
"collectionId",
|
||||
"documents"
|
||||
],
|
||||
"responses": [
|
||||
{
|
||||
"code": 201,
|
||||
"model": "#\/components\/schemas\/documentList"
|
||||
}
|
||||
],
|
||||
"description": "Create new Documents. 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"
|
||||
}
|
||||
],
|
||||
"auth": {
|
||||
|
||||
@@ -7976,26 +7976,6 @@
|
||||
}
|
||||
],
|
||||
"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."
|
||||
},
|
||||
{
|
||||
"name": "createDocuments",
|
||||
"parameters": [
|
||||
"databaseId",
|
||||
"collectionId",
|
||||
"documents"
|
||||
],
|
||||
"required": [
|
||||
"databaseId",
|
||||
"collectionId",
|
||||
"documents"
|
||||
],
|
||||
"responses": [
|
||||
{
|
||||
"code": 201,
|
||||
"model": "#\/components\/schemas\/documentList"
|
||||
}
|
||||
],
|
||||
"description": "Create new Documents. 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"
|
||||
}
|
||||
],
|
||||
"auth": {
|
||||
|
||||
@@ -7525,26 +7525,6 @@
|
||||
}
|
||||
],
|
||||
"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."
|
||||
},
|
||||
{
|
||||
"name": "createDocuments",
|
||||
"parameters": [
|
||||
"databaseId",
|
||||
"collectionId",
|
||||
"documents"
|
||||
],
|
||||
"required": [
|
||||
"databaseId",
|
||||
"collectionId",
|
||||
"documents"
|
||||
],
|
||||
"responses": [
|
||||
{
|
||||
"code": 201,
|
||||
"model": "#\/components\/schemas\/documentList"
|
||||
}
|
||||
],
|
||||
"description": "Create new Documents. 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"
|
||||
}
|
||||
],
|
||||
"auth": {
|
||||
|
||||
@@ -3381,13 +3381,13 @@
|
||||
},
|
||||
{
|
||||
"name": "quality",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to 100.",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"x-example": 0,
|
||||
"default": 100
|
||||
"x-example": -1,
|
||||
"default": -1
|
||||
},
|
||||
"in": "query"
|
||||
}
|
||||
@@ -3513,13 +3513,13 @@
|
||||
},
|
||||
{
|
||||
"name": "quality",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to 100.",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"x-example": 0,
|
||||
"default": 100
|
||||
"x-example": -1,
|
||||
"default": -1
|
||||
},
|
||||
"in": "query"
|
||||
}
|
||||
@@ -4059,13 +4059,13 @@
|
||||
},
|
||||
{
|
||||
"name": "quality",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to 100.",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"x-example": 0,
|
||||
"default": 100
|
||||
"x-example": -1,
|
||||
"default": -1
|
||||
},
|
||||
"in": "query"
|
||||
}
|
||||
@@ -4485,26 +4485,6 @@
|
||||
}
|
||||
],
|
||||
"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."
|
||||
},
|
||||
{
|
||||
"name": "createDocuments",
|
||||
"parameters": [
|
||||
"databaseId",
|
||||
"collectionId",
|
||||
"documents"
|
||||
],
|
||||
"required": [
|
||||
"databaseId",
|
||||
"collectionId",
|
||||
"documents"
|
||||
],
|
||||
"responses": [
|
||||
{
|
||||
"code": 201,
|
||||
"model": "#\/components\/schemas\/documentList"
|
||||
}
|
||||
],
|
||||
"description": "Create new Documents. 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."
|
||||
}
|
||||
],
|
||||
"auth": {
|
||||
@@ -6281,6 +6261,17 @@
|
||||
"x-example": "<FILE_ID>"
|
||||
},
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "token",
|
||||
"description": "File token for accessing this file.",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN>",
|
||||
"default": ""
|
||||
},
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -6399,13 +6390,13 @@
|
||||
},
|
||||
{
|
||||
"name": "quality",
|
||||
"description": "Preview image quality. Pass an integer between 0 to 100. Defaults to 100.",
|
||||
"description": "Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"x-example": 0,
|
||||
"default": 100
|
||||
"x-example": -1,
|
||||
"default": -1
|
||||
},
|
||||
"in": "query"
|
||||
},
|
||||
@@ -6498,6 +6489,17 @@
|
||||
"default": ""
|
||||
},
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"name": "token",
|
||||
"description": "File token for accessing this file.",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN>",
|
||||
"default": ""
|
||||
},
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -6565,6 +6567,17 @@
|
||||
"x-example": "<FILE_ID>"
|
||||
},
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "token",
|
||||
"description": "File token for accessing this file.",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN>",
|
||||
"default": ""
|
||||
},
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -7600,457 +7613,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"\/tokens\/buckets\/{bucketId}\/files\/{fileId}": {
|
||||
"get": {
|
||||
"summary": "List tokens",
|
||||
"operationId": "tokensList",
|
||||
"tags": [
|
||||
"tokens"
|
||||
],
|
||||
"description": "List all the tokens created for a specific file or bucket. You can use the query params to filter your results.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Resource Tokens List",
|
||||
"content": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/resourceTokenList"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "list",
|
||||
"group": "files",
|
||||
"weight": 439,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "tokens\/list.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the tokens created for a specific file or bucket. You can use the query params to filter your results.",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "tokens.read",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Session": [],
|
||||
"JWT": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "bucketId",
|
||||
"description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"x-example": "<BUCKET_ID>"
|
||||
},
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "fileId",
|
||||
"description": "File unique ID.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"x-example": "<FILE_ID>"
|
||||
},
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "queries",
|
||||
"description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"default": []
|
||||
},
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
},
|
||||
"post": {
|
||||
"summary": "Create file token",
|
||||
"operationId": "tokensCreateFileToken",
|
||||
"tags": [
|
||||
"tokens"
|
||||
],
|
||||
"description": "Create a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.",
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "ResourceToken",
|
||||
"content": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/resourceToken"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createFileToken",
|
||||
"group": "files",
|
||||
"weight": 436,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "tokens\/create-file-token.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.",
|
||||
"rate-limit": 60,
|
||||
"rate-time": 60,
|
||||
"rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}",
|
||||
"scope": "tokens.write",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Session": [],
|
||||
"JWT": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "bucketId",
|
||||
"description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"x-example": "<BUCKET_ID>"
|
||||
},
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "fileId",
|
||||
"description": "File unique ID.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"x-example": "<FILE_ID>"
|
||||
},
|
||||
"in": "path"
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"expire": {
|
||||
"type": "string",
|
||||
"description": "Token expiry date",
|
||||
"x-example": null,
|
||||
"x-nullable": true
|
||||
},
|
||||
"permissions": {
|
||||
"type": "array",
|
||||
"description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
|
||||
"x-example": "[\"read(\"any\")\"]",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"\/tokens\/{tokenId}": {
|
||||
"get": {
|
||||
"summary": "Get token",
|
||||
"operationId": "tokensGet",
|
||||
"tags": [
|
||||
"tokens"
|
||||
],
|
||||
"description": "Get a token by its unique ID.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "ResourceToken",
|
||||
"content": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/resourceToken"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "get",
|
||||
"group": "tokens",
|
||||
"weight": 437,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "tokens\/get.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a token by its unique ID.",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "tokens.read",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Session": [],
|
||||
"JWT": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "tokenId",
|
||||
"description": "Token ID.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN_ID>"
|
||||
},
|
||||
"in": "path"
|
||||
}
|
||||
]
|
||||
},
|
||||
"patch": {
|
||||
"summary": "Update token",
|
||||
"operationId": "tokensUpdate",
|
||||
"tags": [
|
||||
"tokens"
|
||||
],
|
||||
"description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "ResourceToken",
|
||||
"content": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/resourceToken"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "update",
|
||||
"group": "tokens",
|
||||
"weight": 440,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "tokens\/update.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.",
|
||||
"rate-limit": 60,
|
||||
"rate-time": 60,
|
||||
"rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}",
|
||||
"scope": "tokens.write",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Session": [],
|
||||
"JWT": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "tokenId",
|
||||
"description": "Token unique ID.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN_ID>"
|
||||
},
|
||||
"in": "path"
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"expire": {
|
||||
"type": "string",
|
||||
"description": "File token expiry date",
|
||||
"x-example": null,
|
||||
"x-nullable": true
|
||||
},
|
||||
"permissions": {
|
||||
"type": "array",
|
||||
"description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
|
||||
"x-example": "[\"read(\"any\")\"]",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"delete": {
|
||||
"summary": "Delete token",
|
||||
"operationId": "tokensDelete",
|
||||
"tags": [
|
||||
"tokens"
|
||||
],
|
||||
"description": "Delete a token by its unique ID.",
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": "No content"
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "delete",
|
||||
"group": "tokens",
|
||||
"weight": 441,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "tokens\/delete.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a token by its unique ID.",
|
||||
"rate-limit": 60,
|
||||
"rate-time": 60,
|
||||
"rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}",
|
||||
"scope": "tokens.write",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Session": [],
|
||||
"JWT": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "tokenId",
|
||||
"description": "Token ID.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN_ID>"
|
||||
},
|
||||
"in": "path"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/tokens\/{tokenId}\/jwt": {
|
||||
"get": {
|
||||
"summary": "Get token as JWT",
|
||||
"operationId": "tokensGetJWT",
|
||||
"tags": [
|
||||
"tokens"
|
||||
],
|
||||
"description": "Get a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "JWT",
|
||||
"content": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/jwt"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getJWT",
|
||||
"group": "tokens",
|
||||
"weight": 438,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "tokens\/get-j-w-t.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "tokens.read",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Session": [],
|
||||
"JWT": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "tokenId",
|
||||
"description": "File token ID.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN_ID>"
|
||||
},
|
||||
"in": "path"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"tags": [
|
||||
@@ -8282,30 +7844,6 @@
|
||||
"files"
|
||||
]
|
||||
},
|
||||
"resourceTokenList": {
|
||||
"description": "Resource Tokens List",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"total": {
|
||||
"type": "integer",
|
||||
"description": "Total number of tokens documents that matched your query.",
|
||||
"x-example": 5,
|
||||
"format": "int32"
|
||||
},
|
||||
"tokens": {
|
||||
"type": "array",
|
||||
"description": "List of tokens.",
|
||||
"items": {
|
||||
"$ref": "#\/components\/schemas\/resourceToken"
|
||||
},
|
||||
"x-example": ""
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"total",
|
||||
"tokens"
|
||||
]
|
||||
},
|
||||
"teamList": {
|
||||
"description": "Teams List",
|
||||
"type": "object",
|
||||
@@ -9502,61 +9040,6 @@
|
||||
"chunksUploaded"
|
||||
]
|
||||
},
|
||||
"resourceToken": {
|
||||
"description": "ResourceToken",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"$id": {
|
||||
"type": "string",
|
||||
"description": "Token ID.",
|
||||
"x-example": "bb8ea5c16897e"
|
||||
},
|
||||
"$createdAt": {
|
||||
"type": "string",
|
||||
"description": "Token creation date in ISO 8601 format.",
|
||||
"x-example": "2020-10-15T06:38:00.000+00:00"
|
||||
},
|
||||
"$permissions": {
|
||||
"type": "array",
|
||||
"description": "Token permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"x-example": [
|
||||
"read(\"any\")"
|
||||
]
|
||||
},
|
||||
"resourceId": {
|
||||
"type": "string",
|
||||
"description": "Resource ID.",
|
||||
"x-example": "5e5ea5c168bb8:5e5ea5c168bb8"
|
||||
},
|
||||
"resourceType": {
|
||||
"type": "string",
|
||||
"description": "Resource type.",
|
||||
"x-example": "files"
|
||||
},
|
||||
"expire": {
|
||||
"type": "string",
|
||||
"description": "Token expiration date in ISO 8601 format.",
|
||||
"x-example": "2020-10-15T06:38:00.000+00:00"
|
||||
},
|
||||
"accessedAt": {
|
||||
"type": "string",
|
||||
"description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.",
|
||||
"x-example": "2020-10-15T06:38:00.000+00:00"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"$id",
|
||||
"$createdAt",
|
||||
"$permissions",
|
||||
"resourceId",
|
||||
"resourceType",
|
||||
"expire",
|
||||
"accessedAt"
|
||||
]
|
||||
},
|
||||
"team": {
|
||||
"description": "Team",
|
||||
"type": "object",
|
||||
|
||||
@@ -3386,13 +3386,13 @@
|
||||
},
|
||||
{
|
||||
"name": "quality",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to 100.",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"x-example": 0,
|
||||
"default": 100
|
||||
"x-example": -1,
|
||||
"default": -1
|
||||
},
|
||||
"in": "query"
|
||||
}
|
||||
@@ -3518,13 +3518,13 @@
|
||||
},
|
||||
{
|
||||
"name": "quality",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to 100.",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"x-example": 0,
|
||||
"default": 100
|
||||
"x-example": -1,
|
||||
"default": -1
|
||||
},
|
||||
"in": "query"
|
||||
}
|
||||
@@ -4064,13 +4064,13 @@
|
||||
},
|
||||
{
|
||||
"name": "quality",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to 100.",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"x-example": 0,
|
||||
"default": 100
|
||||
"x-example": -1,
|
||||
"default": -1
|
||||
},
|
||||
"in": "query"
|
||||
}
|
||||
@@ -8044,26 +8044,6 @@
|
||||
}
|
||||
],
|
||||
"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."
|
||||
},
|
||||
{
|
||||
"name": "createDocuments",
|
||||
"parameters": [
|
||||
"databaseId",
|
||||
"collectionId",
|
||||
"documents"
|
||||
],
|
||||
"required": [
|
||||
"databaseId",
|
||||
"collectionId",
|
||||
"documents"
|
||||
],
|
||||
"responses": [
|
||||
{
|
||||
"code": 201,
|
||||
"model": "#\/components\/schemas\/documentList"
|
||||
}
|
||||
],
|
||||
"description": "Create new Documents. 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."
|
||||
}
|
||||
],
|
||||
"auth": {
|
||||
@@ -8967,6 +8947,14 @@
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"lengths": {
|
||||
"type": "array",
|
||||
"description": "Length of index. Maximum of 100",
|
||||
"x-example": null,
|
||||
"items": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -25729,6 +25717,7 @@
|
||||
"remix",
|
||||
"lynx",
|
||||
"flutter",
|
||||
"react-native",
|
||||
"vite",
|
||||
"other"
|
||||
],
|
||||
@@ -26372,6 +26361,7 @@
|
||||
"remix",
|
||||
"lynx",
|
||||
"flutter",
|
||||
"react-native",
|
||||
"vite",
|
||||
"other"
|
||||
],
|
||||
@@ -29014,6 +29004,17 @@
|
||||
"x-example": "<FILE_ID>"
|
||||
},
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "token",
|
||||
"description": "File token for accessing this file.",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN>",
|
||||
"default": ""
|
||||
},
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -29132,13 +29133,13 @@
|
||||
},
|
||||
{
|
||||
"name": "quality",
|
||||
"description": "Preview image quality. Pass an integer between 0 to 100. Defaults to 100.",
|
||||
"description": "Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"x-example": 0,
|
||||
"default": 100
|
||||
"x-example": -1,
|
||||
"default": -1
|
||||
},
|
||||
"in": "query"
|
||||
},
|
||||
@@ -29231,6 +29232,17 @@
|
||||
"default": ""
|
||||
},
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"name": "token",
|
||||
"description": "File token for accessing this file.",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN>",
|
||||
"default": ""
|
||||
},
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -29298,6 +29310,17 @@
|
||||
"x-example": "<FILE_ID>"
|
||||
},
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "token",
|
||||
"description": "File token for accessing this file.",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN>",
|
||||
"default": ""
|
||||
},
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -30581,7 +30604,7 @@
|
||||
"x-appwrite": {
|
||||
"method": "list",
|
||||
"group": "files",
|
||||
"weight": 439,
|
||||
"weight": 438,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -30592,8 +30615,7 @@
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "tokens.read",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"console",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
@@ -30604,8 +30626,7 @@
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Key": [],
|
||||
"JWT": []
|
||||
"Key": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
@@ -30647,7 +30668,7 @@
|
||||
"tags": [
|
||||
"tokens"
|
||||
],
|
||||
"description": "Create a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.",
|
||||
"description": "Create a new token. A token is linked to a file. Token can be passed as a header or request get parameter.",
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "ResourceToken",
|
||||
@@ -30668,14 +30689,13 @@
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "tokens\/create-file-token.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file. Token can be passed as a header or request get parameter.",
|
||||
"rate-limit": 60,
|
||||
"rate-time": 60,
|
||||
"rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}",
|
||||
"scope": "tokens.write",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"console",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
@@ -30686,8 +30706,7 @@
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Key": [],
|
||||
"JWT": []
|
||||
"Key": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
@@ -30723,14 +30742,6 @@
|
||||
"description": "Token expiry date",
|
||||
"x-example": null,
|
||||
"x-nullable": true
|
||||
},
|
||||
"permissions": {
|
||||
"type": "array",
|
||||
"description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
|
||||
"x-example": "[\"read(\"any\")\"]",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30773,8 +30784,7 @@
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "tokens.read",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"console",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
@@ -30785,8 +30795,7 @@
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Key": [],
|
||||
"JWT": []
|
||||
"Key": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
@@ -30808,7 +30817,7 @@
|
||||
"tags": [
|
||||
"tokens"
|
||||
],
|
||||
"description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.",
|
||||
"description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "ResourceToken",
|
||||
@@ -30824,19 +30833,18 @@
|
||||
"x-appwrite": {
|
||||
"method": "update",
|
||||
"group": "tokens",
|
||||
"weight": 440,
|
||||
"weight": 439,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "tokens\/update.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date.",
|
||||
"rate-limit": 60,
|
||||
"rate-time": 60,
|
||||
"rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}",
|
||||
"scope": "tokens.write",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"console",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
@@ -30847,8 +30855,7 @@
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Key": [],
|
||||
"JWT": []
|
||||
"Key": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
@@ -30874,14 +30881,6 @@
|
||||
"description": "File token expiry date",
|
||||
"x-example": null,
|
||||
"x-nullable": true
|
||||
},
|
||||
"permissions": {
|
||||
"type": "array",
|
||||
"description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
|
||||
"x-example": "[\"read(\"any\")\"]",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30904,7 +30903,7 @@
|
||||
"x-appwrite": {
|
||||
"method": "delete",
|
||||
"group": "tokens",
|
||||
"weight": 441,
|
||||
"weight": 440,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -30915,8 +30914,7 @@
|
||||
"rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}",
|
||||
"scope": "tokens.write",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"console",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
@@ -30927,8 +30925,7 @@
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Key": [],
|
||||
"JWT": []
|
||||
"Key": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
@@ -30945,70 +30942,6 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/tokens\/{tokenId}\/jwt": {
|
||||
"get": {
|
||||
"summary": "Get token as JWT",
|
||||
"operationId": "tokensGetJWT",
|
||||
"tags": [
|
||||
"tokens"
|
||||
],
|
||||
"description": "Get a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "JWT",
|
||||
"content": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/jwt"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getJWT",
|
||||
"group": "tokens",
|
||||
"weight": 438,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "tokens\/get-j-w-t.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "tokens.read",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Key": [],
|
||||
"JWT": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "tokenId",
|
||||
"description": "File token ID.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN_ID>"
|
||||
},
|
||||
"in": "path"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/users": {
|
||||
"get": {
|
||||
"summary": "List users",
|
||||
@@ -37220,6 +37153,15 @@
|
||||
},
|
||||
"x-example": []
|
||||
},
|
||||
"lengths": {
|
||||
"type": "array",
|
||||
"description": "Index attributes length.",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"x-example": []
|
||||
},
|
||||
"orders": {
|
||||
"type": "array",
|
||||
"description": "Index orders.",
|
||||
@@ -37246,6 +37188,7 @@
|
||||
"status",
|
||||
"error",
|
||||
"attributes",
|
||||
"lengths",
|
||||
"$createdAt",
|
||||
"$updatedAt"
|
||||
]
|
||||
@@ -38336,16 +38279,6 @@
|
||||
"description": "Token creation date in ISO 8601 format.",
|
||||
"x-example": "2020-10-15T06:38:00.000+00:00"
|
||||
},
|
||||
"$permissions": {
|
||||
"type": "array",
|
||||
"description": "Token permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"x-example": [
|
||||
"read(\"any\")"
|
||||
]
|
||||
},
|
||||
"resourceId": {
|
||||
"type": "string",
|
||||
"description": "Resource ID.",
|
||||
@@ -38361,6 +38294,11 @@
|
||||
"description": "Token expiration date in ISO 8601 format.",
|
||||
"x-example": "2020-10-15T06:38:00.000+00:00"
|
||||
},
|
||||
"secret": {
|
||||
"type": "string",
|
||||
"description": "JWT encoded string.",
|
||||
"x-example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
|
||||
},
|
||||
"accessedAt": {
|
||||
"type": "string",
|
||||
"description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.",
|
||||
@@ -38370,10 +38308,10 @@
|
||||
"required": [
|
||||
"$id",
|
||||
"$createdAt",
|
||||
"$permissions",
|
||||
"resourceId",
|
||||
"resourceType",
|
||||
"expire",
|
||||
"secret",
|
||||
"accessedAt"
|
||||
]
|
||||
},
|
||||
|
||||
@@ -3068,13 +3068,13 @@
|
||||
},
|
||||
{
|
||||
"name": "quality",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to 100.",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"x-example": 0,
|
||||
"default": 100
|
||||
"x-example": -1,
|
||||
"default": -1
|
||||
},
|
||||
"in": "query"
|
||||
}
|
||||
@@ -3202,13 +3202,13 @@
|
||||
},
|
||||
{
|
||||
"name": "quality",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to 100.",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"x-example": 0,
|
||||
"default": 100
|
||||
"x-example": -1,
|
||||
"default": -1
|
||||
},
|
||||
"in": "query"
|
||||
}
|
||||
@@ -3752,13 +3752,13 @@
|
||||
},
|
||||
{
|
||||
"name": "quality",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to 100.",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"x-example": 0,
|
||||
"default": 100
|
||||
"x-example": -1,
|
||||
"default": -1
|
||||
},
|
||||
"in": "query"
|
||||
}
|
||||
@@ -7525,26 +7525,6 @@
|
||||
}
|
||||
],
|
||||
"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."
|
||||
},
|
||||
{
|
||||
"name": "createDocuments",
|
||||
"parameters": [
|
||||
"databaseId",
|
||||
"collectionId",
|
||||
"documents"
|
||||
],
|
||||
"required": [
|
||||
"databaseId",
|
||||
"collectionId",
|
||||
"documents"
|
||||
],
|
||||
"responses": [
|
||||
{
|
||||
"code": 201,
|
||||
"model": "#\/components\/schemas\/documentList"
|
||||
}
|
||||
],
|
||||
"description": "Create new Documents. 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."
|
||||
}
|
||||
],
|
||||
"auth": {
|
||||
@@ -8368,6 +8348,14 @@
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"lengths": {
|
||||
"type": "array",
|
||||
"description": "Length of index. Maximum of 100",
|
||||
"x-example": null,
|
||||
"items": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -17281,6 +17269,7 @@
|
||||
"remix",
|
||||
"lynx",
|
||||
"flutter",
|
||||
"react-native",
|
||||
"vite",
|
||||
"other"
|
||||
],
|
||||
@@ -17696,6 +17685,7 @@
|
||||
"remix",
|
||||
"lynx",
|
||||
"flutter",
|
||||
"react-native",
|
||||
"vite",
|
||||
"other"
|
||||
],
|
||||
@@ -20292,6 +20282,17 @@
|
||||
"x-example": "<FILE_ID>"
|
||||
},
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "token",
|
||||
"description": "File token for accessing this file.",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN>",
|
||||
"default": ""
|
||||
},
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -20412,13 +20413,13 @@
|
||||
},
|
||||
{
|
||||
"name": "quality",
|
||||
"description": "Preview image quality. Pass an integer between 0 to 100. Defaults to 100.",
|
||||
"description": "Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"x-example": 0,
|
||||
"default": 100
|
||||
"x-example": -1,
|
||||
"default": -1
|
||||
},
|
||||
"in": "query"
|
||||
},
|
||||
@@ -20511,6 +20512,17 @@
|
||||
"default": ""
|
||||
},
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"name": "token",
|
||||
"description": "File token for accessing this file.",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN>",
|
||||
"default": ""
|
||||
},
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -20580,6 +20592,17 @@
|
||||
"x-example": "<FILE_ID>"
|
||||
},
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "token",
|
||||
"description": "File token for accessing this file.",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN>",
|
||||
"default": ""
|
||||
},
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -21662,7 +21685,7 @@
|
||||
"x-appwrite": {
|
||||
"method": "list",
|
||||
"group": "files",
|
||||
"weight": 439,
|
||||
"weight": 438,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -21673,22 +21696,19 @@
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "tokens.read",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"console",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": [],
|
||||
"Session": []
|
||||
"Key": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Session": [],
|
||||
"Key": [],
|
||||
"JWT": []
|
||||
"Key": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
@@ -21730,7 +21750,7 @@
|
||||
"tags": [
|
||||
"tokens"
|
||||
],
|
||||
"description": "Create a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.",
|
||||
"description": "Create a new token. A token is linked to a file. Token can be passed as a header or request get parameter.",
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "ResourceToken",
|
||||
@@ -21751,28 +21771,25 @@
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "tokens\/create-file-token.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file. Token can be passed as a header or request get parameter.",
|
||||
"rate-limit": 60,
|
||||
"rate-time": 60,
|
||||
"rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}",
|
||||
"scope": "tokens.write",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"console",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": [],
|
||||
"Session": []
|
||||
"Key": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Session": [],
|
||||
"Key": [],
|
||||
"JWT": []
|
||||
"Key": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
@@ -21808,14 +21825,6 @@
|
||||
"description": "Token expiry date",
|
||||
"x-example": null,
|
||||
"x-nullable": true
|
||||
},
|
||||
"permissions": {
|
||||
"type": "array",
|
||||
"description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
|
||||
"x-example": "[\"read(\"any\")\"]",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21858,22 +21867,19 @@
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "tokens.read",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"console",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": [],
|
||||
"Session": []
|
||||
"Key": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Session": [],
|
||||
"Key": [],
|
||||
"JWT": []
|
||||
"Key": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
@@ -21895,7 +21901,7 @@
|
||||
"tags": [
|
||||
"tokens"
|
||||
],
|
||||
"description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.",
|
||||
"description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "ResourceToken",
|
||||
@@ -21911,33 +21917,30 @@
|
||||
"x-appwrite": {
|
||||
"method": "update",
|
||||
"group": "tokens",
|
||||
"weight": 440,
|
||||
"weight": 439,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "tokens\/update.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date.",
|
||||
"rate-limit": 60,
|
||||
"rate-time": 60,
|
||||
"rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}",
|
||||
"scope": "tokens.write",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"console",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": [],
|
||||
"Session": []
|
||||
"Key": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Session": [],
|
||||
"Key": [],
|
||||
"JWT": []
|
||||
"Key": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
@@ -21963,14 +21966,6 @@
|
||||
"description": "File token expiry date",
|
||||
"x-example": null,
|
||||
"x-nullable": true
|
||||
},
|
||||
"permissions": {
|
||||
"type": "array",
|
||||
"description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
|
||||
"x-example": "[\"read(\"any\")\"]",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21993,7 +21988,7 @@
|
||||
"x-appwrite": {
|
||||
"method": "delete",
|
||||
"group": "tokens",
|
||||
"weight": 441,
|
||||
"weight": 440,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -22004,22 +21999,19 @@
|
||||
"rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}",
|
||||
"scope": "tokens.write",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"console",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": [],
|
||||
"Session": []
|
||||
"Key": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Session": [],
|
||||
"Key": [],
|
||||
"JWT": []
|
||||
"Key": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
@@ -22036,72 +22028,6 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/tokens\/{tokenId}\/jwt": {
|
||||
"get": {
|
||||
"summary": "Get token as JWT",
|
||||
"operationId": "tokensGetJWT",
|
||||
"tags": [
|
||||
"tokens"
|
||||
],
|
||||
"description": "Get a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "JWT",
|
||||
"content": {
|
||||
"application\/json": {
|
||||
"schema": {
|
||||
"$ref": "#\/components\/schemas\/jwt"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getJWT",
|
||||
"group": "tokens",
|
||||
"weight": 438,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "tokens\/get-j-w-t.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "tokens.read",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": [],
|
||||
"Session": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Session": [],
|
||||
"Key": [],
|
||||
"JWT": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "tokenId",
|
||||
"description": "File token ID.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN_ID>"
|
||||
},
|
||||
"in": "path"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/users": {
|
||||
"get": {
|
||||
"summary": "List users",
|
||||
@@ -27193,6 +27119,15 @@
|
||||
},
|
||||
"x-example": []
|
||||
},
|
||||
"lengths": {
|
||||
"type": "array",
|
||||
"description": "Index attributes length.",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"x-example": []
|
||||
},
|
||||
"orders": {
|
||||
"type": "array",
|
||||
"description": "Index orders.",
|
||||
@@ -27219,6 +27154,7 @@
|
||||
"status",
|
||||
"error",
|
||||
"attributes",
|
||||
"lengths",
|
||||
"$createdAt",
|
||||
"$updatedAt"
|
||||
]
|
||||
@@ -28309,16 +28245,6 @@
|
||||
"description": "Token creation date in ISO 8601 format.",
|
||||
"x-example": "2020-10-15T06:38:00.000+00:00"
|
||||
},
|
||||
"$permissions": {
|
||||
"type": "array",
|
||||
"description": "Token permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"x-example": [
|
||||
"read(\"any\")"
|
||||
]
|
||||
},
|
||||
"resourceId": {
|
||||
"type": "string",
|
||||
"description": "Resource ID.",
|
||||
@@ -28334,6 +28260,11 @@
|
||||
"description": "Token expiration date in ISO 8601 format.",
|
||||
"x-example": "2020-10-15T06:38:00.000+00:00"
|
||||
},
|
||||
"secret": {
|
||||
"type": "string",
|
||||
"description": "JWT encoded string.",
|
||||
"x-example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
|
||||
},
|
||||
"accessedAt": {
|
||||
"type": "string",
|
||||
"description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.",
|
||||
@@ -28343,10 +28274,10 @@
|
||||
"required": [
|
||||
"$id",
|
||||
"$createdAt",
|
||||
"$permissions",
|
||||
"resourceId",
|
||||
"resourceType",
|
||||
"expire",
|
||||
"secret",
|
||||
"accessedAt"
|
||||
]
|
||||
},
|
||||
|
||||
@@ -4625,26 +4625,6 @@
|
||||
}
|
||||
],
|
||||
"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."
|
||||
},
|
||||
{
|
||||
"name": "createDocuments",
|
||||
"parameters": [
|
||||
"databaseId",
|
||||
"collectionId",
|
||||
"documents"
|
||||
],
|
||||
"required": [
|
||||
"databaseId",
|
||||
"collectionId",
|
||||
"documents"
|
||||
],
|
||||
"responses": [
|
||||
{
|
||||
"code": 201,
|
||||
"model": "#\/definitions\/documentList"
|
||||
}
|
||||
],
|
||||
"description": "Create new Documents. 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"
|
||||
}
|
||||
],
|
||||
"auth": {
|
||||
|
||||
@@ -8107,26 +8107,6 @@
|
||||
}
|
||||
],
|
||||
"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."
|
||||
},
|
||||
{
|
||||
"name": "createDocuments",
|
||||
"parameters": [
|
||||
"databaseId",
|
||||
"collectionId",
|
||||
"documents"
|
||||
],
|
||||
"required": [
|
||||
"databaseId",
|
||||
"collectionId",
|
||||
"documents"
|
||||
],
|
||||
"responses": [
|
||||
{
|
||||
"code": 201,
|
||||
"model": "#\/definitions\/documentList"
|
||||
}
|
||||
],
|
||||
"description": "Create new Documents. 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"
|
||||
}
|
||||
],
|
||||
"auth": {
|
||||
|
||||
@@ -7644,26 +7644,6 @@
|
||||
}
|
||||
],
|
||||
"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."
|
||||
},
|
||||
{
|
||||
"name": "createDocuments",
|
||||
"parameters": [
|
||||
"databaseId",
|
||||
"collectionId",
|
||||
"documents"
|
||||
],
|
||||
"required": [
|
||||
"databaseId",
|
||||
"collectionId",
|
||||
"documents"
|
||||
],
|
||||
"responses": [
|
||||
{
|
||||
"code": 201,
|
||||
"model": "#\/definitions\/documentList"
|
||||
}
|
||||
],
|
||||
"description": "Create new Documents. 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"
|
||||
}
|
||||
],
|
||||
"auth": {
|
||||
|
||||
@@ -3530,12 +3530,12 @@
|
||||
},
|
||||
{
|
||||
"name": "quality",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to 100.",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.",
|
||||
"required": false,
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"x-example": 0,
|
||||
"default": 100,
|
||||
"x-example": -1,
|
||||
"default": -1,
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
@@ -3661,12 +3661,12 @@
|
||||
},
|
||||
{
|
||||
"name": "quality",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to 100.",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.",
|
||||
"required": false,
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"x-example": 0,
|
||||
"default": 100,
|
||||
"x-example": -1,
|
||||
"default": -1,
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
@@ -4211,12 +4211,12 @@
|
||||
},
|
||||
{
|
||||
"name": "quality",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to 100.",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.",
|
||||
"required": false,
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"x-example": 0,
|
||||
"default": 100,
|
||||
"x-example": -1,
|
||||
"default": -1,
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
@@ -4631,26 +4631,6 @@
|
||||
}
|
||||
],
|
||||
"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."
|
||||
},
|
||||
{
|
||||
"name": "createDocuments",
|
||||
"parameters": [
|
||||
"databaseId",
|
||||
"collectionId",
|
||||
"documents"
|
||||
],
|
||||
"required": [
|
||||
"databaseId",
|
||||
"collectionId",
|
||||
"documents"
|
||||
],
|
||||
"responses": [
|
||||
{
|
||||
"code": 201,
|
||||
"model": "#\/definitions\/documentList"
|
||||
}
|
||||
],
|
||||
"description": "Create new Documents. 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."
|
||||
}
|
||||
],
|
||||
"auth": {
|
||||
@@ -6439,6 +6419,15 @@
|
||||
"type": "string",
|
||||
"x-example": "<FILE_ID>",
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "token",
|
||||
"description": "File token for accessing this file.",
|
||||
"required": false,
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN>",
|
||||
"default": "",
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -6554,12 +6543,12 @@
|
||||
},
|
||||
{
|
||||
"name": "quality",
|
||||
"description": "Preview image quality. Pass an integer between 0 to 100. Defaults to 100.",
|
||||
"description": "Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.",
|
||||
"required": false,
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"x-example": 0,
|
||||
"default": 100,
|
||||
"x-example": -1,
|
||||
"default": -1,
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
@@ -6637,6 +6626,15 @@
|
||||
"x-enum-keys": [],
|
||||
"default": "",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"name": "token",
|
||||
"description": "File token for accessing this file.",
|
||||
"required": false,
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN>",
|
||||
"default": "",
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -6707,6 +6705,15 @@
|
||||
"type": "string",
|
||||
"x-example": "<FILE_ID>",
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "token",
|
||||
"description": "File token for accessing this file.",
|
||||
"required": false,
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN>",
|
||||
"default": "",
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -7732,451 +7739,6 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/tokens\/buckets\/{bucketId}\/files\/{fileId}": {
|
||||
"get": {
|
||||
"summary": "List tokens",
|
||||
"operationId": "tokensList",
|
||||
"consumes": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"tokens"
|
||||
],
|
||||
"description": "List all the tokens created for a specific file or bucket. You can use the query params to filter your results.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Resource Tokens List",
|
||||
"schema": {
|
||||
"$ref": "#\/definitions\/resourceTokenList"
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "list",
|
||||
"group": "files",
|
||||
"weight": 439,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "tokens\/list.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the tokens created for a specific file or bucket. You can use the query params to filter your results.",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "tokens.read",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Session": [],
|
||||
"JWT": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "bucketId",
|
||||
"description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).",
|
||||
"required": true,
|
||||
"type": "string",
|
||||
"x-example": "<BUCKET_ID>",
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "fileId",
|
||||
"description": "File unique ID.",
|
||||
"required": true,
|
||||
"type": "string",
|
||||
"x-example": "<FILE_ID>",
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "queries",
|
||||
"description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire",
|
||||
"required": false,
|
||||
"type": "array",
|
||||
"collectionFormat": "multi",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"default": [],
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
},
|
||||
"post": {
|
||||
"summary": "Create file token",
|
||||
"operationId": "tokensCreateFileToken",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"tokens"
|
||||
],
|
||||
"description": "Create a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.",
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "ResourceToken",
|
||||
"schema": {
|
||||
"$ref": "#\/definitions\/resourceToken"
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "createFileToken",
|
||||
"group": "files",
|
||||
"weight": 436,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "tokens\/create-file-token.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.",
|
||||
"rate-limit": 60,
|
||||
"rate-time": 60,
|
||||
"rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}",
|
||||
"scope": "tokens.write",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Session": [],
|
||||
"JWT": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "bucketId",
|
||||
"description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).",
|
||||
"required": true,
|
||||
"type": "string",
|
||||
"x-example": "<BUCKET_ID>",
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "fileId",
|
||||
"description": "File unique ID.",
|
||||
"required": true,
|
||||
"type": "string",
|
||||
"x-example": "<FILE_ID>",
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "payload",
|
||||
"in": "body",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"expire": {
|
||||
"type": "string",
|
||||
"description": "Token expiry date",
|
||||
"default": null,
|
||||
"x-example": null,
|
||||
"x-nullable": true
|
||||
},
|
||||
"permissions": {
|
||||
"type": "array",
|
||||
"description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
|
||||
"default": [],
|
||||
"x-example": "[\"read(\"any\")\"]",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/tokens\/{tokenId}": {
|
||||
"get": {
|
||||
"summary": "Get token",
|
||||
"operationId": "tokensGet",
|
||||
"consumes": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"tokens"
|
||||
],
|
||||
"description": "Get a token by its unique ID.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "ResourceToken",
|
||||
"schema": {
|
||||
"$ref": "#\/definitions\/resourceToken"
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "get",
|
||||
"group": "tokens",
|
||||
"weight": 437,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "tokens\/get.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a token by its unique ID.",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "tokens.read",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Session": [],
|
||||
"JWT": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "tokenId",
|
||||
"description": "Token ID.",
|
||||
"required": true,
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN_ID>",
|
||||
"in": "path"
|
||||
}
|
||||
]
|
||||
},
|
||||
"patch": {
|
||||
"summary": "Update token",
|
||||
"operationId": "tokensUpdate",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"tokens"
|
||||
],
|
||||
"description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "ResourceToken",
|
||||
"schema": {
|
||||
"$ref": "#\/definitions\/resourceToken"
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "update",
|
||||
"group": "tokens",
|
||||
"weight": 440,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "tokens\/update.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.",
|
||||
"rate-limit": 60,
|
||||
"rate-time": 60,
|
||||
"rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}",
|
||||
"scope": "tokens.write",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Session": [],
|
||||
"JWT": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "tokenId",
|
||||
"description": "Token unique ID.",
|
||||
"required": true,
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN_ID>",
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "payload",
|
||||
"in": "body",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"expire": {
|
||||
"type": "string",
|
||||
"description": "File token expiry date",
|
||||
"default": null,
|
||||
"x-example": null,
|
||||
"x-nullable": true
|
||||
},
|
||||
"permissions": {
|
||||
"type": "array",
|
||||
"description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
|
||||
"default": null,
|
||||
"x-example": "[\"read(\"any\")\"]",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"delete": {
|
||||
"summary": "Delete token",
|
||||
"operationId": "tokensDelete",
|
||||
"consumes": [
|
||||
"application\/json"
|
||||
],
|
||||
"produces": [],
|
||||
"tags": [
|
||||
"tokens"
|
||||
],
|
||||
"description": "Delete a token by its unique ID.",
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": "No content"
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "delete",
|
||||
"group": "tokens",
|
||||
"weight": 441,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "tokens\/delete.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a token by its unique ID.",
|
||||
"rate-limit": 60,
|
||||
"rate-time": 60,
|
||||
"rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}",
|
||||
"scope": "tokens.write",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Session": [],
|
||||
"JWT": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "tokenId",
|
||||
"description": "Token ID.",
|
||||
"required": true,
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN_ID>",
|
||||
"in": "path"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/tokens\/{tokenId}\/jwt": {
|
||||
"get": {
|
||||
"summary": "Get token as JWT",
|
||||
"operationId": "tokensGetJWT",
|
||||
"consumes": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"tokens"
|
||||
],
|
||||
"description": "Get a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "JWT",
|
||||
"schema": {
|
||||
"$ref": "#\/definitions\/jwt"
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getJWT",
|
||||
"group": "tokens",
|
||||
"weight": 438,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "tokens\/get-j-w-t.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "tokens.read",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Session": [],
|
||||
"JWT": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "tokenId",
|
||||
"description": "File token ID.",
|
||||
"required": true,
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN_ID>",
|
||||
"in": "path"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"tags": [
|
||||
@@ -8380,31 +7942,6 @@
|
||||
"files"
|
||||
]
|
||||
},
|
||||
"resourceTokenList": {
|
||||
"description": "Resource Tokens List",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"total": {
|
||||
"type": "integer",
|
||||
"description": "Total number of tokens documents that matched your query.",
|
||||
"x-example": 5,
|
||||
"format": "int32"
|
||||
},
|
||||
"tokens": {
|
||||
"type": "array",
|
||||
"description": "List of tokens.",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#\/definitions\/resourceToken"
|
||||
},
|
||||
"x-example": ""
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"total",
|
||||
"tokens"
|
||||
]
|
||||
},
|
||||
"teamList": {
|
||||
"description": "Teams List",
|
||||
"type": "object",
|
||||
@@ -9612,61 +9149,6 @@
|
||||
"chunksUploaded"
|
||||
]
|
||||
},
|
||||
"resourceToken": {
|
||||
"description": "ResourceToken",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"$id": {
|
||||
"type": "string",
|
||||
"description": "Token ID.",
|
||||
"x-example": "bb8ea5c16897e"
|
||||
},
|
||||
"$createdAt": {
|
||||
"type": "string",
|
||||
"description": "Token creation date in ISO 8601 format.",
|
||||
"x-example": "2020-10-15T06:38:00.000+00:00"
|
||||
},
|
||||
"$permissions": {
|
||||
"type": "array",
|
||||
"description": "Token permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"x-example": [
|
||||
"read(\"any\")"
|
||||
]
|
||||
},
|
||||
"resourceId": {
|
||||
"type": "string",
|
||||
"description": "Resource ID.",
|
||||
"x-example": "5e5ea5c168bb8:5e5ea5c168bb8"
|
||||
},
|
||||
"resourceType": {
|
||||
"type": "string",
|
||||
"description": "Resource type.",
|
||||
"x-example": "files"
|
||||
},
|
||||
"expire": {
|
||||
"type": "string",
|
||||
"description": "Token expiration date in ISO 8601 format.",
|
||||
"x-example": "2020-10-15T06:38:00.000+00:00"
|
||||
},
|
||||
"accessedAt": {
|
||||
"type": "string",
|
||||
"description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.",
|
||||
"x-example": "2020-10-15T06:38:00.000+00:00"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"$id",
|
||||
"$createdAt",
|
||||
"$permissions",
|
||||
"resourceId",
|
||||
"resourceType",
|
||||
"expire",
|
||||
"accessedAt"
|
||||
]
|
||||
},
|
||||
"team": {
|
||||
"description": "Team",
|
||||
"type": "object",
|
||||
|
||||
@@ -3551,12 +3551,12 @@
|
||||
},
|
||||
{
|
||||
"name": "quality",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to 100.",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.",
|
||||
"required": false,
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"x-example": 0,
|
||||
"default": 100,
|
||||
"x-example": -1,
|
||||
"default": -1,
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
@@ -3682,12 +3682,12 @@
|
||||
},
|
||||
{
|
||||
"name": "quality",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to 100.",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.",
|
||||
"required": false,
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"x-example": 0,
|
||||
"default": 100,
|
||||
"x-example": -1,
|
||||
"default": -1,
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
@@ -4232,12 +4232,12 @@
|
||||
},
|
||||
{
|
||||
"name": "quality",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to 100.",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.",
|
||||
"required": false,
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"x-example": 0,
|
||||
"default": 100,
|
||||
"x-example": -1,
|
||||
"default": -1,
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
@@ -8179,26 +8179,6 @@
|
||||
}
|
||||
],
|
||||
"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."
|
||||
},
|
||||
{
|
||||
"name": "createDocuments",
|
||||
"parameters": [
|
||||
"databaseId",
|
||||
"collectionId",
|
||||
"documents"
|
||||
],
|
||||
"required": [
|
||||
"databaseId",
|
||||
"collectionId",
|
||||
"documents"
|
||||
],
|
||||
"responses": [
|
||||
{
|
||||
"code": 201,
|
||||
"model": "#\/definitions\/documentList"
|
||||
}
|
||||
],
|
||||
"description": "Create new Documents. 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."
|
||||
}
|
||||
],
|
||||
"auth": {
|
||||
@@ -9068,6 +9048,15 @@
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"lengths": {
|
||||
"type": "array",
|
||||
"description": "Length of index. Maximum of 100",
|
||||
"default": [],
|
||||
"x-example": null,
|
||||
"items": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -25998,6 +25987,7 @@
|
||||
"remix",
|
||||
"lynx",
|
||||
"flutter",
|
||||
"react-native",
|
||||
"vite",
|
||||
"other"
|
||||
],
|
||||
@@ -26644,6 +26634,7 @@
|
||||
"remix",
|
||||
"lynx",
|
||||
"flutter",
|
||||
"react-native",
|
||||
"vite",
|
||||
"other"
|
||||
],
|
||||
@@ -29283,6 +29274,15 @@
|
||||
"type": "string",
|
||||
"x-example": "<FILE_ID>",
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "token",
|
||||
"description": "File token for accessing this file.",
|
||||
"required": false,
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN>",
|
||||
"default": "",
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -29398,12 +29398,12 @@
|
||||
},
|
||||
{
|
||||
"name": "quality",
|
||||
"description": "Preview image quality. Pass an integer between 0 to 100. Defaults to 100.",
|
||||
"description": "Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.",
|
||||
"required": false,
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"x-example": 0,
|
||||
"default": 100,
|
||||
"x-example": -1,
|
||||
"default": -1,
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
@@ -29481,6 +29481,15 @@
|
||||
"x-enum-keys": [],
|
||||
"default": "",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"name": "token",
|
||||
"description": "File token for accessing this file.",
|
||||
"required": false,
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN>",
|
||||
"default": "",
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -29551,6 +29560,15 @@
|
||||
"type": "string",
|
||||
"x-example": "<FILE_ID>",
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "token",
|
||||
"description": "File token for accessing this file.",
|
||||
"required": false,
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN>",
|
||||
"default": "",
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -30815,7 +30833,7 @@
|
||||
"x-appwrite": {
|
||||
"method": "list",
|
||||
"group": "files",
|
||||
"weight": 439,
|
||||
"weight": 438,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -30826,8 +30844,7 @@
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "tokens.read",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"console",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
@@ -30838,8 +30855,7 @@
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Key": [],
|
||||
"JWT": []
|
||||
"Key": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
@@ -30885,7 +30901,7 @@
|
||||
"tags": [
|
||||
"tokens"
|
||||
],
|
||||
"description": "Create a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.",
|
||||
"description": "Create a new token. A token is linked to a file. Token can be passed as a header or request get parameter.",
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "ResourceToken",
|
||||
@@ -30902,14 +30918,13 @@
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "tokens\/create-file-token.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file. Token can be passed as a header or request get parameter.",
|
||||
"rate-limit": 60,
|
||||
"rate-time": 60,
|
||||
"rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}",
|
||||
"scope": "tokens.write",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"console",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
@@ -30920,8 +30935,7 @@
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Key": [],
|
||||
"JWT": []
|
||||
"Key": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
@@ -30953,15 +30967,6 @@
|
||||
"default": null,
|
||||
"x-example": null,
|
||||
"x-nullable": true
|
||||
},
|
||||
"permissions": {
|
||||
"type": "array",
|
||||
"description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
|
||||
"default": [],
|
||||
"x-example": "[\"read(\"any\")\"]",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31003,8 +31008,7 @@
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "tokens.read",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"console",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
@@ -31015,8 +31019,7 @@
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Key": [],
|
||||
"JWT": []
|
||||
"Key": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
@@ -31042,7 +31045,7 @@
|
||||
"tags": [
|
||||
"tokens"
|
||||
],
|
||||
"description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.",
|
||||
"description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "ResourceToken",
|
||||
@@ -31054,19 +31057,18 @@
|
||||
"x-appwrite": {
|
||||
"method": "update",
|
||||
"group": "tokens",
|
||||
"weight": 440,
|
||||
"weight": 439,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "tokens\/update.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date.",
|
||||
"rate-limit": 60,
|
||||
"rate-time": 60,
|
||||
"rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}",
|
||||
"scope": "tokens.write",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"console",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
@@ -31077,8 +31079,7 @@
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Key": [],
|
||||
"JWT": []
|
||||
"Key": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
@@ -31102,15 +31103,6 @@
|
||||
"default": null,
|
||||
"x-example": null,
|
||||
"x-nullable": true
|
||||
},
|
||||
"permissions": {
|
||||
"type": "array",
|
||||
"description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
|
||||
"default": null,
|
||||
"x-example": "[\"read(\"any\")\"]",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31136,7 +31128,7 @@
|
||||
"x-appwrite": {
|
||||
"method": "delete",
|
||||
"group": "tokens",
|
||||
"weight": 441,
|
||||
"weight": 440,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -31147,8 +31139,7 @@
|
||||
"rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}",
|
||||
"scope": "tokens.write",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"console",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
@@ -31159,8 +31150,7 @@
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Key": [],
|
||||
"JWT": []
|
||||
"Key": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
@@ -31175,68 +31165,6 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/tokens\/{tokenId}\/jwt": {
|
||||
"get": {
|
||||
"summary": "Get token as JWT",
|
||||
"operationId": "tokensGetJWT",
|
||||
"consumes": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"tokens"
|
||||
],
|
||||
"description": "Get a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "JWT",
|
||||
"schema": {
|
||||
"$ref": "#\/definitions\/jwt"
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getJWT",
|
||||
"group": "tokens",
|
||||
"weight": 438,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "tokens\/get-j-w-t.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "tokens.read",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Key": [],
|
||||
"JWT": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "tokenId",
|
||||
"description": "File token ID.",
|
||||
"required": true,
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN_ID>",
|
||||
"in": "path"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/users": {
|
||||
"get": {
|
||||
"summary": "List users",
|
||||
@@ -37464,6 +37392,15 @@
|
||||
},
|
||||
"x-example": []
|
||||
},
|
||||
"lengths": {
|
||||
"type": "array",
|
||||
"description": "Index attributes length.",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"x-example": []
|
||||
},
|
||||
"orders": {
|
||||
"type": "array",
|
||||
"description": "Index orders.",
|
||||
@@ -37490,6 +37427,7 @@
|
||||
"status",
|
||||
"error",
|
||||
"attributes",
|
||||
"lengths",
|
||||
"$createdAt",
|
||||
"$updatedAt"
|
||||
]
|
||||
@@ -38582,16 +38520,6 @@
|
||||
"description": "Token creation date in ISO 8601 format.",
|
||||
"x-example": "2020-10-15T06:38:00.000+00:00"
|
||||
},
|
||||
"$permissions": {
|
||||
"type": "array",
|
||||
"description": "Token permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"x-example": [
|
||||
"read(\"any\")"
|
||||
]
|
||||
},
|
||||
"resourceId": {
|
||||
"type": "string",
|
||||
"description": "Resource ID.",
|
||||
@@ -38607,6 +38535,11 @@
|
||||
"description": "Token expiration date in ISO 8601 format.",
|
||||
"x-example": "2020-10-15T06:38:00.000+00:00"
|
||||
},
|
||||
"secret": {
|
||||
"type": "string",
|
||||
"description": "JWT encoded string.",
|
||||
"x-example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
|
||||
},
|
||||
"accessedAt": {
|
||||
"type": "string",
|
||||
"description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.",
|
||||
@@ -38616,10 +38549,10 @@
|
||||
"required": [
|
||||
"$id",
|
||||
"$createdAt",
|
||||
"$permissions",
|
||||
"resourceId",
|
||||
"resourceType",
|
||||
"expire",
|
||||
"secret",
|
||||
"accessedAt"
|
||||
]
|
||||
},
|
||||
|
||||
@@ -3223,12 +3223,12 @@
|
||||
},
|
||||
{
|
||||
"name": "quality",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to 100.",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.",
|
||||
"required": false,
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"x-example": 0,
|
||||
"default": 100,
|
||||
"x-example": -1,
|
||||
"default": -1,
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
@@ -3356,12 +3356,12 @@
|
||||
},
|
||||
{
|
||||
"name": "quality",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to 100.",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.",
|
||||
"required": false,
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"x-example": 0,
|
||||
"default": 100,
|
||||
"x-example": -1,
|
||||
"default": -1,
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
@@ -3910,12 +3910,12 @@
|
||||
},
|
||||
{
|
||||
"name": "quality",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to 100.",
|
||||
"description": "Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.",
|
||||
"required": false,
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"x-example": 0,
|
||||
"default": 100,
|
||||
"x-example": -1,
|
||||
"default": -1,
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
@@ -7644,26 +7644,6 @@
|
||||
}
|
||||
],
|
||||
"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."
|
||||
},
|
||||
{
|
||||
"name": "createDocuments",
|
||||
"parameters": [
|
||||
"databaseId",
|
||||
"collectionId",
|
||||
"documents"
|
||||
],
|
||||
"required": [
|
||||
"databaseId",
|
||||
"collectionId",
|
||||
"documents"
|
||||
],
|
||||
"responses": [
|
||||
{
|
||||
"code": 201,
|
||||
"model": "#\/definitions\/documentList"
|
||||
}
|
||||
],
|
||||
"description": "Create new Documents. 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."
|
||||
}
|
||||
],
|
||||
"auth": {
|
||||
@@ -8460,6 +8440,15 @@
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"lengths": {
|
||||
"type": "array",
|
||||
"description": "Length of index. Maximum of 100",
|
||||
"default": [],
|
||||
"x-example": null,
|
||||
"items": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -17579,6 +17568,7 @@
|
||||
"remix",
|
||||
"lynx",
|
||||
"flutter",
|
||||
"react-native",
|
||||
"vite",
|
||||
"other"
|
||||
],
|
||||
@@ -18007,6 +17997,7 @@
|
||||
"remix",
|
||||
"lynx",
|
||||
"flutter",
|
||||
"react-native",
|
||||
"vite",
|
||||
"other"
|
||||
],
|
||||
@@ -20604,6 +20595,15 @@
|
||||
"type": "string",
|
||||
"x-example": "<FILE_ID>",
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "token",
|
||||
"description": "File token for accessing this file.",
|
||||
"required": false,
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN>",
|
||||
"default": "",
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -20721,12 +20721,12 @@
|
||||
},
|
||||
{
|
||||
"name": "quality",
|
||||
"description": "Preview image quality. Pass an integer between 0 to 100. Defaults to 100.",
|
||||
"description": "Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.",
|
||||
"required": false,
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"x-example": 0,
|
||||
"default": 100,
|
||||
"x-example": -1,
|
||||
"default": -1,
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
@@ -20804,6 +20804,15 @@
|
||||
"x-enum-keys": [],
|
||||
"default": "",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"name": "token",
|
||||
"description": "File token for accessing this file.",
|
||||
"required": false,
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN>",
|
||||
"default": "",
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -20876,6 +20885,15 @@
|
||||
"type": "string",
|
||||
"x-example": "<FILE_ID>",
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"name": "token",
|
||||
"description": "File token for accessing this file.",
|
||||
"required": false,
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN>",
|
||||
"default": "",
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -21948,7 +21966,7 @@
|
||||
"x-appwrite": {
|
||||
"method": "list",
|
||||
"group": "files",
|
||||
"weight": 439,
|
||||
"weight": 438,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -21959,22 +21977,19 @@
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "tokens.read",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"console",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": [],
|
||||
"Session": []
|
||||
"Key": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Session": [],
|
||||
"Key": [],
|
||||
"JWT": []
|
||||
"Key": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
@@ -22020,7 +22035,7 @@
|
||||
"tags": [
|
||||
"tokens"
|
||||
],
|
||||
"description": "Create a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.",
|
||||
"description": "Create a new token. A token is linked to a file. Token can be passed as a header or request get parameter.",
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "ResourceToken",
|
||||
@@ -22037,28 +22052,25 @@
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "tokens\/create-file-token.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file. Token can be passed as a header or request get parameter.",
|
||||
"rate-limit": 60,
|
||||
"rate-time": 60,
|
||||
"rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}",
|
||||
"scope": "tokens.write",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"console",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": [],
|
||||
"Session": []
|
||||
"Key": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Session": [],
|
||||
"Key": [],
|
||||
"JWT": []
|
||||
"Key": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
@@ -22090,15 +22102,6 @@
|
||||
"default": null,
|
||||
"x-example": null,
|
||||
"x-nullable": true
|
||||
},
|
||||
"permissions": {
|
||||
"type": "array",
|
||||
"description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
|
||||
"default": [],
|
||||
"x-example": "[\"read(\"any\")\"]",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22140,22 +22143,19 @@
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "tokens.read",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"console",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": [],
|
||||
"Session": []
|
||||
"Key": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Session": [],
|
||||
"Key": [],
|
||||
"JWT": []
|
||||
"Key": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
@@ -22181,7 +22181,7 @@
|
||||
"tags": [
|
||||
"tokens"
|
||||
],
|
||||
"description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.",
|
||||
"description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "ResourceToken",
|
||||
@@ -22193,33 +22193,30 @@
|
||||
"x-appwrite": {
|
||||
"method": "update",
|
||||
"group": "tokens",
|
||||
"weight": 440,
|
||||
"weight": 439,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "tokens\/update.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date.",
|
||||
"rate-limit": 60,
|
||||
"rate-time": 60,
|
||||
"rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}",
|
||||
"scope": "tokens.write",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"console",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": [],
|
||||
"Session": []
|
||||
"Key": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Session": [],
|
||||
"Key": [],
|
||||
"JWT": []
|
||||
"Key": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
@@ -22243,15 +22240,6 @@
|
||||
"default": null,
|
||||
"x-example": null,
|
||||
"x-nullable": true
|
||||
},
|
||||
"permissions": {
|
||||
"type": "array",
|
||||
"description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
|
||||
"default": null,
|
||||
"x-example": "[\"read(\"any\")\"]",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22277,7 +22265,7 @@
|
||||
"x-appwrite": {
|
||||
"method": "delete",
|
||||
"group": "tokens",
|
||||
"weight": 441,
|
||||
"weight": 440,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
@@ -22288,22 +22276,19 @@
|
||||
"rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}",
|
||||
"scope": "tokens.write",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"console",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": [],
|
||||
"Session": []
|
||||
"Key": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Session": [],
|
||||
"Key": [],
|
||||
"JWT": []
|
||||
"Key": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
@@ -22318,70 +22303,6 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/tokens\/{tokenId}\/jwt": {
|
||||
"get": {
|
||||
"summary": "Get token as JWT",
|
||||
"operationId": "tokensGetJWT",
|
||||
"consumes": [],
|
||||
"produces": [
|
||||
"application\/json"
|
||||
],
|
||||
"tags": [
|
||||
"tokens"
|
||||
],
|
||||
"description": "Get a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "JWT",
|
||||
"schema": {
|
||||
"$ref": "#\/definitions\/jwt"
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
"method": "getJWT",
|
||||
"group": "tokens",
|
||||
"weight": 438,
|
||||
"cookies": false,
|
||||
"type": "",
|
||||
"deprecated": false,
|
||||
"demo": "tokens\/get-j-w-t.md",
|
||||
"edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.",
|
||||
"rate-limit": 0,
|
||||
"rate-time": 3600,
|
||||
"rate-key": "url:{url},ip:{ip}",
|
||||
"scope": "tokens.read",
|
||||
"platforms": [
|
||||
"client",
|
||||
"server",
|
||||
"server"
|
||||
],
|
||||
"packaging": false,
|
||||
"auth": {
|
||||
"Project": [],
|
||||
"Session": []
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"Project": [],
|
||||
"Session": [],
|
||||
"Key": [],
|
||||
"JWT": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "tokenId",
|
||||
"description": "File token ID.",
|
||||
"required": true,
|
||||
"type": "string",
|
||||
"x-example": "<TOKEN_ID>",
|
||||
"in": "path"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"\/users": {
|
||||
"get": {
|
||||
"summary": "List users",
|
||||
@@ -27498,6 +27419,15 @@
|
||||
},
|
||||
"x-example": []
|
||||
},
|
||||
"lengths": {
|
||||
"type": "array",
|
||||
"description": "Index attributes length.",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"x-example": []
|
||||
},
|
||||
"orders": {
|
||||
"type": "array",
|
||||
"description": "Index orders.",
|
||||
@@ -27524,6 +27454,7 @@
|
||||
"status",
|
||||
"error",
|
||||
"attributes",
|
||||
"lengths",
|
||||
"$createdAt",
|
||||
"$updatedAt"
|
||||
]
|
||||
@@ -28616,16 +28547,6 @@
|
||||
"description": "Token creation date in ISO 8601 format.",
|
||||
"x-example": "2020-10-15T06:38:00.000+00:00"
|
||||
},
|
||||
"$permissions": {
|
||||
"type": "array",
|
||||
"description": "Token permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"x-example": [
|
||||
"read(\"any\")"
|
||||
]
|
||||
},
|
||||
"resourceId": {
|
||||
"type": "string",
|
||||
"description": "Resource ID.",
|
||||
@@ -28641,6 +28562,11 @@
|
||||
"description": "Token expiration date in ISO 8601 format.",
|
||||
"x-example": "2020-10-15T06:38:00.000+00:00"
|
||||
},
|
||||
"secret": {
|
||||
"type": "string",
|
||||
"description": "JWT encoded string.",
|
||||
"x-example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
|
||||
},
|
||||
"accessedAt": {
|
||||
"type": "string",
|
||||
"description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.",
|
||||
@@ -28650,10 +28576,10 @@
|
||||
"required": [
|
||||
"$id",
|
||||
"$createdAt",
|
||||
"$permissions",
|
||||
"resourceId",
|
||||
"resourceType",
|
||||
"expire",
|
||||
"secret",
|
||||
"accessedAt"
|
||||
]
|
||||
},
|
||||
|
||||
@@ -106,6 +106,16 @@ const TEMPLATE_FRAMEWORKS = [
|
||||
'outputDirectory' => './dist',
|
||||
'fallbackFile' => 'index.html',
|
||||
],
|
||||
'REACT_NATIVE' => [
|
||||
'key' => 'react-native',
|
||||
'name' => 'React Native',
|
||||
'installCommand' => 'npm install',
|
||||
'buildCommand' => 'npm run build',
|
||||
'buildRuntime' => 'node-22',
|
||||
'adapter' => 'static',
|
||||
'outputDirectory' => './dist',
|
||||
'fallbackFile' => '+not-found.html',
|
||||
],
|
||||
'ANGULAR' => [
|
||||
'key' => 'angular',
|
||||
'name' => 'Angular',
|
||||
@@ -866,9 +876,8 @@ return [
|
||||
'screenshotDark' => $url . '/images/sites/templates/starter-for-react-native-dark.png',
|
||||
'screenshotLight' => $url . '/images/sites/templates/starter-for-react-native-light.png',
|
||||
'frameworks' => [
|
||||
getFramework('REACT', [
|
||||
getFramework('REACT_NATIVE', [
|
||||
'providerRootDirectory' => './',
|
||||
'fallbackFile' => '+not-found.html',
|
||||
]),
|
||||
],
|
||||
'vcsProvider' => 'github',
|
||||
@@ -1332,7 +1341,7 @@ return [
|
||||
'screenshotDark' => $url . '/images/sites/templates/playground-for-react-native-dark.png',
|
||||
'screenshotLight' => $url . '/images/sites/templates/playground-for-react-native-light.png',
|
||||
'frameworks' => [
|
||||
getFramework('REACT', [
|
||||
getFramework('REACT_NATIVE', [
|
||||
'providerRootDirectory' => './react-native/starter',
|
||||
]),
|
||||
],
|
||||
|
||||
@@ -187,7 +187,7 @@ App::get('/v1/avatars/credit-cards/:code')
|
||||
->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-credit-cards'))), 'Credit Card Code. Possible values: ' . \implode(', ', \array_keys(Config::getParam('avatar-credit-cards'))) . '.')
|
||||
->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true)
|
||||
->param('height', 100, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true)
|
||||
->param('quality', 100, new Range(0, 100), 'Image quality. Pass an integer between 0 to 100. Defaults to 100.', true)
|
||||
->param('quality', -1, new Range(-1, 100), 'Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.', true)
|
||||
->inject('response')
|
||||
->action(fn (string $code, int $width, int $height, int $quality, Response $response) => $avatarCallback('credit-cards', $code, $width, $height, $quality, $response));
|
||||
|
||||
@@ -215,7 +215,7 @@ App::get('/v1/avatars/browsers/:code')
|
||||
->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-browsers'))), 'Browser Code.')
|
||||
->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true)
|
||||
->param('height', 100, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true)
|
||||
->param('quality', 100, new Range(0, 100), 'Image quality. Pass an integer between 0 to 100. Defaults to 100.', true)
|
||||
->param('quality', -1, new Range(-1, 100), 'Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.', true)
|
||||
->inject('response')
|
||||
->action(fn (string $code, int $width, int $height, int $quality, Response $response) => $avatarCallback('browsers', $code, $width, $height, $quality, $response));
|
||||
|
||||
@@ -243,7 +243,7 @@ App::get('/v1/avatars/flags/:code')
|
||||
->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-flags'))), 'Country Code. ISO Alpha-2 country code format.')
|
||||
->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true)
|
||||
->param('height', 100, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true)
|
||||
->param('quality', 100, new Range(0, 100), 'Image quality. Pass an integer between 0 to 100. Defaults to 100.', true)
|
||||
->param('quality', -1, new Range(-1, 100), 'Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.', true)
|
||||
->inject('response')
|
||||
->action(fn (string $code, int $width, int $height, int $quality, Response $response) => $avatarCallback('flags', $code, $width, $height, $quality, $response));
|
||||
|
||||
|
||||
@@ -2813,11 +2813,12 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/indexes')
|
||||
->param('type', null, new WhiteList([Database::INDEX_KEY, Database::INDEX_FULLTEXT, Database::INDEX_UNIQUE]), 'Index type.')
|
||||
->param('attributes', null, new ArrayList(new Key(true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of attributes to index. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' attributes are allowed, each 32 characters long.')
|
||||
->param('orders', [], new ArrayList(new WhiteList(['ASC', 'DESC'], false, Database::VAR_STRING), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of index orders. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' orders are allowed.', true)
|
||||
->param('lengths', [], new ArrayList(new Nullable(new Integer()), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Length of index. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE, optional:true)
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
->inject('queueForDatabase')
|
||||
->inject('queueForEvents')
|
||||
->action(function (string $databaseId, string $collectionId, string $key, string $type, array $attributes, array $orders, Response $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents) {
|
||||
->action(function (string $databaseId, string $collectionId, string $key, string $type, array $attributes, array $orders, array $lengths, Response $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents) {
|
||||
|
||||
$db = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId));
|
||||
|
||||
@@ -2877,9 +2878,6 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/indexes')
|
||||
'size' => 0
|
||||
];
|
||||
|
||||
// lengths hidden by default
|
||||
$lengths = [];
|
||||
|
||||
foreach ($attributes as $i => $attribute) {
|
||||
// find attribute metadata in collection document
|
||||
$attributeIndex = \array_search($attribute, array_column($oldAttributes, 'key'));
|
||||
@@ -2901,8 +2899,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/indexes')
|
||||
throw new Exception(Exception::ATTRIBUTE_NOT_AVAILABLE, 'Attribute not available: ' . $oldAttributes[$attributeIndex]['key']);
|
||||
}
|
||||
|
||||
$lengths[$i] = null;
|
||||
|
||||
$lengths[$i] ??= null;
|
||||
if ($attributeArray === true) {
|
||||
$lengths[$i] = Database::ARRAY_INDEX_LENGTH;
|
||||
$orders[$i] = null;
|
||||
@@ -3204,25 +3201,25 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents')
|
||||
new Parameter('permissions', optional: true),
|
||||
]
|
||||
),
|
||||
new Method(
|
||||
namespace: 'databases',
|
||||
group: 'documents',
|
||||
name: 'createDocuments',
|
||||
description: '/docs/references/databases/create-documents.md',
|
||||
auth: [AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_CREATED,
|
||||
model: Response::MODEL_DOCUMENT_LIST,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON,
|
||||
parameters: [
|
||||
new Parameter('databaseId', optional: false),
|
||||
new Parameter('collectionId', optional: false),
|
||||
new Parameter('documents', optional: false),
|
||||
]
|
||||
)
|
||||
// new Method(
|
||||
// namespace: 'databases',
|
||||
// group: 'documents',
|
||||
// name: 'createDocuments',
|
||||
// description: '/docs/references/databases/create-documents.md',
|
||||
// auth: [AuthType::KEY],
|
||||
// responses: [
|
||||
// new SDKResponse(
|
||||
// code: Response::STATUS_CODE_CREATED,
|
||||
// model: Response::MODEL_DOCUMENT_LIST,
|
||||
// )
|
||||
// ],
|
||||
// contentType: ContentType::JSON,
|
||||
// parameters: [
|
||||
// new Parameter('databaseId', optional: false),
|
||||
// new Parameter('collectionId', optional: false),
|
||||
// new Parameter('documents', optional: false),
|
||||
// ]
|
||||
// )
|
||||
]
|
||||
)
|
||||
->param('databaseId', '', new UID(), 'Database ID.')
|
||||
@@ -4742,8 +4739,8 @@ App::get('/v1/databases/:databaseId/usage')
|
||||
str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_COLLECTIONS),
|
||||
str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_DOCUMENTS),
|
||||
str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_STORAGE),
|
||||
str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASES_OPERATIONS_READS),
|
||||
str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASES_OPERATIONS_WRITES)
|
||||
str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_READS),
|
||||
str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES)
|
||||
];
|
||||
|
||||
Authorization::skip(function () use ($dbForProject, $days, $metrics, &$stats) {
|
||||
|
||||
@@ -2139,7 +2139,8 @@ App::post('/v1/projects/:projectId/smtp/tests')
|
||||
->inject('response')
|
||||
->inject('dbForPlatform')
|
||||
->inject('queueForMails')
|
||||
->action(function (string $projectId, array $emails, string $senderName, string $senderEmail, string $replyTo, string $host, int $port, string $username, string $password, string $secure, Response $response, Database $dbForPlatform, Mail $queueForMails) {
|
||||
->inject('plan')
|
||||
->action(function (string $projectId, array $emails, string $senderName, string $senderEmail, string $replyTo, string $host, int $port, string $username, string $password, string $secure, Response $response, Database $dbForPlatform, Mail $queueForMails, array $plan) {
|
||||
$project = $dbForPlatform->getDocument('projects', $projectId);
|
||||
|
||||
if ($project->isEmpty()) {
|
||||
@@ -2152,7 +2153,14 @@ App::post('/v1/projects/:projectId/smtp/tests')
|
||||
$template = Template::fromFile(__DIR__ . '/../../config/locale/templates/email-smtp-test.tpl');
|
||||
$template
|
||||
->setParam('{{from}}', "{$senderName} ({$senderEmail})")
|
||||
->setParam('{{replyTo}}', "{$senderName} ({$replyToEmail})");
|
||||
->setParam('{{replyTo}}', "{$senderName} ({$replyToEmail})")
|
||||
->setParam('{{logoUrl}}', $plan['logoUrl'] ?? APP_EMAIL_LOGO_URL)
|
||||
->setParam('{{accentColor}}', $plan['accentColor'] ?? APP_EMAIL_ACCENT_COLOR)
|
||||
->setParam('{{twitterUrl}}', $plan['twitterUrl'] ?? APP_SOCIAL_TWITTER)
|
||||
->setParam('{{discordUrl}}', $plan['discordUrl'] ?? APP_SOCIAL_DISCORD)
|
||||
->setParam('{{githubUrl}}', $plan['githubUrl'] ?? APP_SOCIAL_GITHUB_APPWRITE)
|
||||
->setParam('{{termsUrl}}', $plan['termsUrl'] ?? APP_EMAIL_TERMS_URL)
|
||||
->setParam('{{privacyUrl}}', $plan['privacyUrl'] ?? APP_EMAIL_PRIVACY_URL);
|
||||
|
||||
foreach ($emails as $email) {
|
||||
$queueForMails
|
||||
|
||||
@@ -943,7 +943,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
|
||||
->param('width', 0, new Range(0, 4000), 'Resize preview image width, Pass an integer between 0 to 4000.', true)
|
||||
->param('height', 0, new Range(0, 4000), 'Resize preview image height, Pass an integer between 0 to 4000.', true)
|
||||
->param('gravity', Image::GRAVITY_CENTER, new WhiteList(Image::getGravityTypes()), 'Image crop gravity. Can be one of ' . implode(",", Image::getGravityTypes()), true)
|
||||
->param('quality', 100, new Range(0, 100), 'Preview image quality. Pass an integer between 0 to 100. Defaults to 100.', true)
|
||||
->param('quality', -1, new Range(-1, 100), 'Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.', true)
|
||||
->param('borderWidth', 0, new Range(0, 100), 'Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.', true)
|
||||
->param('borderColor', '', new HexColor(), 'Preview image border color. Use a valid HEX color, no # is needed for prefix.', true)
|
||||
->param('borderRadius', 0, new Range(0, 4000), 'Preview image border radius in pixels. Pass an integer between 0 to 4000.', true)
|
||||
@@ -951,12 +951,14 @@ 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)
|
||||
// NOTE: this is only for the sdk generator and is not used in the action below and is utilised in `resources.php` for `resourceToken`.
|
||||
->param('token', '', new Text(512), 'File token for accessing this file.', true)
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
->inject('resourceToken')
|
||||
->inject('deviceForFiles')
|
||||
->inject('deviceForLocal')
|
||||
->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, Document $resourceToken, Device $deviceForFiles, Device $deviceForLocal) {
|
||||
->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, ?string $token, Response $response, Database $dbForProject, Document $resourceToken, Device $deviceForFiles, Device $deviceForLocal) {
|
||||
|
||||
if (!\extension_loaded('imagick')) {
|
||||
throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Imagick extension is missing');
|
||||
@@ -1129,13 +1131,15 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/download')
|
||||
))
|
||||
->param('bucketId', '', new UID(), 'Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).')
|
||||
->param('fileId', '', new UID(), 'File ID.')
|
||||
// NOTE: this is only for the sdk generator and is not used in the action below and is utilised in `resources.php` for `resourceToken`.
|
||||
->param('token', '', new Text(512), 'File token for accessing this file.', true)
|
||||
->inject('request')
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
->inject('mode')
|
||||
->inject('resourceToken')
|
||||
->inject('deviceForFiles')
|
||||
->action(function (string $bucketId, string $fileId, Request $request, Response $response, Database $dbForProject, string $mode, Document $resourceToken, Device $deviceForFiles) {
|
||||
->action(function (string $bucketId, string $fileId, ?string $token, Request $request, Response $response, Database $dbForProject, string $mode, Document $resourceToken, Device $deviceForFiles) {
|
||||
|
||||
$bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId));
|
||||
|
||||
@@ -1284,13 +1288,15 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/view')
|
||||
))
|
||||
->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).')
|
||||
->param('fileId', '', new UID(), 'File ID.')
|
||||
// NOTE: this is only for the sdk generator and is not used in the action below and is utilised in `resources.php` for `resourceToken`.
|
||||
->param('token', '', new Text(512), 'File token for accessing this file.', true)
|
||||
->inject('response')
|
||||
->inject('request')
|
||||
->inject('dbForProject')
|
||||
->inject('mode')
|
||||
->inject('resourceToken')
|
||||
->inject('deviceForFiles')
|
||||
->action(function (string $bucketId, string $fileId, Response $response, Request $request, Database $dbForProject, string $mode, Document $resourceToken, Device $deviceForFiles) {
|
||||
->action(function (string $bucketId, string $fileId, ?string $token, Response $response, Request $request, Database $dbForProject, string $mode, Document $resourceToken, Device $deviceForFiles) {
|
||||
$bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId));
|
||||
|
||||
$isAPIKey = Auth::isAppUser(Authorization::getRoles());
|
||||
|
||||
@@ -1090,7 +1090,10 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId')
|
||||
// Quick check: fetch up to 2 owners to determine if only one exists
|
||||
$ownersCount = $dbForProject->count(
|
||||
collection: 'memberships',
|
||||
queries: [Query::contains('roles', ['owner'])],
|
||||
queries: [
|
||||
Query::contains('roles', ['owner']),
|
||||
Query::equal('teamInternalId', [$team->getInternalId()])
|
||||
],
|
||||
max: 2
|
||||
);
|
||||
|
||||
|
||||
@@ -6,6 +6,10 @@ const APP_NAME = 'Appwrite';
|
||||
const APP_DOMAIN = 'appwrite.io';
|
||||
const APP_EMAIL_TEAM = 'team@localhost.test'; // Default email address
|
||||
const APP_EMAIL_SECURITY = ''; // Default security email address
|
||||
const APP_EMAIL_LOGO_URL = 'https://cloud.appwrite.io/images/mails/logo.png';
|
||||
const APP_EMAIL_ACCENT_COLOR = '#fd366e';
|
||||
const APP_EMAIL_TERMS_URL = 'https://appwrite.io/terms';
|
||||
const APP_EMAIL_PRIVACY_URL = 'https://appwrite.io/privacy';
|
||||
const APP_USERAGENT = APP_NAME . '-Server v%s. Please report abuse at %s';
|
||||
const APP_MODE_DEFAULT = 'default';
|
||||
const APP_MODE_ADMIN = 'admin';
|
||||
@@ -62,6 +66,7 @@ const APP_SOCIAL_FACEBOOK = 'https://www.facebook.com/appwrite.io';
|
||||
const APP_SOCIAL_LINKEDIN = 'https://www.linkedin.com/company/appwrite';
|
||||
const APP_SOCIAL_INSTAGRAM = 'https://www.instagram.com/appwrite.io';
|
||||
const APP_SOCIAL_GITHUB = 'https://github.com/appwrite';
|
||||
const APP_SOCIAL_GITHUB_APPWRITE = 'https://github.com/appwrite/appwrite';
|
||||
const APP_SOCIAL_DISCORD = 'https://appwrite.io/discord';
|
||||
const APP_SOCIAL_DISCORD_CHANNEL = '564160730845151244';
|
||||
const APP_SOCIAL_DEV = 'https://dev.to/appwrite';
|
||||
|
||||
+52
-41
@@ -509,29 +509,26 @@ App::setResource('timelimit', function (\Redis $redis) {
|
||||
};
|
||||
}, ['redis']);
|
||||
|
||||
App::setResource('deviceForLocal', function () {
|
||||
return new Local();
|
||||
});
|
||||
App::setResource('deviceForLocal', function (Telemetry $telemetry) {
|
||||
return new Device\Telemetry($telemetry, new Local());
|
||||
}, ['telemetry']);
|
||||
|
||||
App::setResource('deviceForFiles', function ($project) {
|
||||
return getDevice(APP_STORAGE_UPLOADS . '/app-' . $project->getId());
|
||||
}, ['project']);
|
||||
App::setResource('deviceForFiles', function ($project, Telemetry $telemetry) {
|
||||
return new Device\Telemetry($telemetry, getDevice(APP_STORAGE_UPLOADS . '/app-' . $project->getId()));
|
||||
}, ['project', 'telemetry']);
|
||||
App::setResource('deviceForSites', function ($project, Telemetry $telemetry) {
|
||||
return new Device\Telemetry($telemetry, getDevice(APP_STORAGE_SITES . '/app-' . $project->getId()));
|
||||
}, ['project', 'telemetry']);
|
||||
App::setResource('deviceForImports', function ($project, Telemetry $telemetry) {
|
||||
return new Device\Telemetry($telemetry, getDevice(APP_STORAGE_IMPORTS . '/app-' . $project->getId()));
|
||||
}, ['project', 'telemetry']);
|
||||
App::setResource('deviceForFunctions', function ($project, Telemetry $telemetry) {
|
||||
return new Device\Telemetry($telemetry, getDevice(APP_STORAGE_FUNCTIONS . '/app-' . $project->getId()));
|
||||
}, ['project', 'telemetry']);
|
||||
|
||||
App::setResource('deviceForSites', function ($project) {
|
||||
return getDevice(APP_STORAGE_SITES . '/app-' . $project->getId());
|
||||
}, ['project']);
|
||||
|
||||
App::setResource('deviceForImports', function (Document $project) {
|
||||
return getDevice(APP_STORAGE_IMPORTS . '/app-' . $project->getId());
|
||||
}, ['project']);
|
||||
|
||||
App::setResource('deviceForFunctions', function ($project) {
|
||||
return getDevice(APP_STORAGE_FUNCTIONS . '/app-' . $project->getId());
|
||||
}, ['project']);
|
||||
|
||||
App::setResource('deviceForBuilds', function ($project) {
|
||||
return getDevice(APP_STORAGE_BUILDS . '/app-' . $project->getId());
|
||||
}, ['project']);
|
||||
App::setResource('deviceForBuilds', function ($project, Telemetry $telemetry) {
|
||||
return new Device\Telemetry($telemetry, getDevice(APP_STORAGE_BUILDS . '/app-' . $project->getId()));
|
||||
}, ['project', 'telemetry']);
|
||||
|
||||
function getDevice(string $root, string $connection = ''): Device
|
||||
{
|
||||
@@ -918,38 +915,52 @@ App::setResource('resourceToken', function ($project, $dbForProject, $request) {
|
||||
}
|
||||
|
||||
$tokenId = $payload['tokenId'] ?? '';
|
||||
$secret = $payload['secret'] ?? '';
|
||||
if (empty($tokenId) || empty($secret)) {
|
||||
if (empty($tokenId)) {
|
||||
return new Document([]);
|
||||
}
|
||||
|
||||
$token = Authorization::skip(fn () => $dbForProject->getDocument('resourceTokens', $tokenId));
|
||||
|
||||
if ($token->isEmpty() || $token->getAttribute('secret') !== $secret) {
|
||||
if ($token->isEmpty()) {
|
||||
return new Document([]);
|
||||
}
|
||||
|
||||
if ($token->getAttribute('resourceType') === TOKENS_RESOURCE_TYPE_FILES) {
|
||||
$internalIds = explode(':', $token->getAttribute('resourceInternalId'));
|
||||
$ids = explode(':', $token->getAttribute('resourceId'));
|
||||
$expiry = $token->getAttribute('expire');
|
||||
|
||||
if (count($internalIds) !== 2 || count($ids) !== 2) {
|
||||
if ($expiry !== null) {
|
||||
$now = new \DateTime();
|
||||
$expiryDate = new \DateTime($expiry);
|
||||
|
||||
if ($expiryDate < $now) {
|
||||
return new Document([]);
|
||||
}
|
||||
|
||||
$accessedAt = $token->getAttribute('accessedAt', 0);
|
||||
if (empty($accessedAt) || DatabaseDateTime::formatTz(DatabaseDateTime::addSeconds(new \DateTime(), - APP_RESOURCE_TOKEN_ACCESS)) > $accessedAt) {
|
||||
$token->setAttribute('accessedAt', DatabaseDateTime::now());
|
||||
Authorization::skip(fn () => $dbForProject->updateDocument('resourceTokens', $token->getId(), $token));
|
||||
}
|
||||
|
||||
return new Document([
|
||||
'bucketId' => $ids[0],
|
||||
'fileId' => $ids[1],
|
||||
'bucketInternalId' => $internalIds[0],
|
||||
'fileInternalId' => $internalIds[1],
|
||||
]);
|
||||
}
|
||||
|
||||
return match ($token->getAttribute('resourceType')) {
|
||||
TOKENS_RESOURCE_TYPE_FILES => (function () use ($token, $dbForProject) {
|
||||
$internalIds = explode(':', $token->getAttribute('resourceInternalId'));
|
||||
$ids = explode(':', $token->getAttribute('resourceId'));
|
||||
|
||||
if (count($internalIds) !== 2 || count($ids) !== 2) {
|
||||
return new Document([]);
|
||||
}
|
||||
|
||||
$accessedAt = $token->getAttribute('accessedAt', 0);
|
||||
if (empty($accessedAt) || DatabaseDateTime::formatTz(DatabaseDateTime::addSeconds(new \DateTime(), - APP_RESOURCE_TOKEN_ACCESS)) > $accessedAt) {
|
||||
$token->setAttribute('accessedAt', DatabaseDateTime::now());
|
||||
Authorization::skip(fn () => $dbForProject->updateDocument('resourceTokens', $token->getId(), $token));
|
||||
}
|
||||
|
||||
return new Document([
|
||||
'bucketId' => $ids[0],
|
||||
'fileId' => $ids[1],
|
||||
'bucketInternalId' => $internalIds[0],
|
||||
'fileInternalId' => $internalIds[1],
|
||||
]);
|
||||
})(),
|
||||
|
||||
default => throw new Exception(Exception::TOKEN_RESOURCE_TYPE_INVALID),
|
||||
};
|
||||
}
|
||||
return new Document([]);
|
||||
}, ['project', 'dbForProject', 'request']);
|
||||
|
||||
+27
-18
@@ -37,7 +37,10 @@ use Utopia\Queue\Message;
|
||||
use Utopia\Queue\Publisher;
|
||||
use Utopia\Queue\Server;
|
||||
use Utopia\Registry\Registry;
|
||||
use Utopia\Storage\Device;
|
||||
use Utopia\System\System;
|
||||
use Utopia\Telemetry\Adapter as Telemetry;
|
||||
use Utopia\Telemetry\Adapter\None as NoTelemetry;
|
||||
|
||||
Authorization::disable();
|
||||
Runtime::enableCoroutine(SWOOLE_HOOK_ALL);
|
||||
@@ -334,35 +337,41 @@ Server::setResource('pools', function (Registry $register) {
|
||||
return $register->get('pools');
|
||||
}, ['register']);
|
||||
|
||||
Server::setResource('deviceForSites', function (Document $project) {
|
||||
return getDevice(APP_STORAGE_SITES . '/app-' . $project->getId());
|
||||
}, ['project']);
|
||||
Server::setResource('telemetry', fn () => new NoTelemetry());
|
||||
|
||||
Server::setResource('deviceForImports', function (Document $project) {
|
||||
return getDevice(APP_STORAGE_IMPORTS . '/app-' . $project->getId());
|
||||
}, ['project']);
|
||||
Server::setResource('deviceForSites', function (Document $project, Telemetry $telemetry) {
|
||||
return new Device\Telemetry($telemetry, getDevice(APP_STORAGE_SITES . '/app-' . $project->getId()));
|
||||
}, ['project', 'telemetry']);
|
||||
|
||||
Server::setResource('deviceForFunctions', function (Document $project) {
|
||||
return getDevice(APP_STORAGE_FUNCTIONS . '/app-' . $project->getId());
|
||||
}, ['project']);
|
||||
Server::setResource('deviceForImports', function (Document $project, Telemetry $telemetry) {
|
||||
return new Device\Telemetry($telemetry, getDevice(APP_STORAGE_IMPORTS . '/app-' . $project->getId()));
|
||||
}, ['project', 'telemetry']);
|
||||
|
||||
Server::setResource('deviceForFiles', function (Document $project) {
|
||||
return getDevice(APP_STORAGE_UPLOADS . '/app-' . $project->getId());
|
||||
}, ['project']);
|
||||
Server::setResource('deviceForFunctions', function (Document $project, Telemetry $telemetry) {
|
||||
return new Device\Telemetry($telemetry, getDevice(APP_STORAGE_FUNCTIONS . '/app-' . $project->getId()));
|
||||
}, ['project', 'telemetry']);
|
||||
|
||||
Server::setResource('deviceForBuilds', function (Document $project) {
|
||||
return getDevice(APP_STORAGE_BUILDS . '/app-' . $project->getId());
|
||||
}, ['project']);
|
||||
Server::setResource('deviceForFiles', function (Document $project, Telemetry $telemetry) {
|
||||
return new Device\Telemetry($telemetry, getDevice(APP_STORAGE_UPLOADS . '/app-' . $project->getId()));
|
||||
}, ['project', 'telemetry']);
|
||||
|
||||
Server::setResource('deviceForCache', function (Document $project) {
|
||||
return getDevice(APP_STORAGE_CACHE . '/app-' . $project->getId());
|
||||
}, ['project']);
|
||||
Server::setResource('deviceForBuilds', function (Document $project, Telemetry $telemetry) {
|
||||
return new Device\Telemetry($telemetry, getDevice(APP_STORAGE_BUILDS . '/app-' . $project->getId()));
|
||||
}, ['project', 'telemetry']);
|
||||
|
||||
Server::setResource('deviceForCache', function (Document $project, Telemetry $telemetry) {
|
||||
return new Device\Telemetry($telemetry, getDevice(APP_STORAGE_CACHE . '/app-' . $project->getId()));
|
||||
}, ['project', 'telemetry']);
|
||||
|
||||
Server::setResource(
|
||||
'isResourceBlocked',
|
||||
fn () => fn (Document $project, string $resourceType, ?string $resourceId) => false
|
||||
);
|
||||
|
||||
Server::setResource('plan', function (array $plan = []) {
|
||||
return [];
|
||||
});
|
||||
|
||||
Server::setResource('certificates', function () {
|
||||
$email = System::getEnv('_APP_EMAIL_CERTIFICATES', System::getEnv('_APP_SYSTEM_SECURITY_EMAIL_ADDRESS'));
|
||||
if (empty($email)) {
|
||||
|
||||
+2
-2
@@ -53,7 +53,7 @@
|
||||
"utopia-php/cli": "0.15.*",
|
||||
"utopia-php/config": "0.2.*",
|
||||
"utopia-php/detector": "0.1.*",
|
||||
"utopia-php/database": "0.68.*",
|
||||
"utopia-php/database": "0.69.*",
|
||||
"utopia-php/domains": "0.5.*",
|
||||
"utopia-php/dsn": "0.2.1",
|
||||
"utopia-php/framework": "0.33.*",
|
||||
@@ -61,7 +61,7 @@
|
||||
"utopia-php/image": "0.8.*",
|
||||
"utopia-php/locale": "0.4.*",
|
||||
"utopia-php/logger": "0.6.*",
|
||||
"utopia-php/messaging": "0.16.*",
|
||||
"utopia-php/messaging": "0.17.*",
|
||||
"utopia-php/migration": "0.9.*",
|
||||
"utopia-php/orchestration": "0.9.*",
|
||||
"utopia-php/platform": "0.7.*",
|
||||
|
||||
Generated
+36
-35
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "18d31817580d569f001c88d865dcbfc6",
|
||||
"content-hash": "735023e2b70ce47fe65985f195b257bd",
|
||||
"packages": [
|
||||
{
|
||||
"name": "adhocore/jwt",
|
||||
@@ -709,16 +709,16 @@
|
||||
},
|
||||
{
|
||||
"name": "google/protobuf",
|
||||
"version": "v4.30.2",
|
||||
"version": "v4.31.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/protocolbuffers/protobuf-php.git",
|
||||
"reference": "a4c4d8565b40b9f76debc9dfeb221412eacb8ced"
|
||||
"reference": "d59e31ce4bf0e4b48728e90c4d880839edb5be07"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/a4c4d8565b40b9f76debc9dfeb221412eacb8ced",
|
||||
"reference": "a4c4d8565b40b9f76debc9dfeb221412eacb8ced",
|
||||
"url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/d59e31ce4bf0e4b48728e90c4d880839edb5be07",
|
||||
"reference": "d59e31ce4bf0e4b48728e90c4d880839edb5be07",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -747,9 +747,9 @@
|
||||
"proto"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.30.2"
|
||||
"source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.31.0"
|
||||
},
|
||||
"time": "2025-03-26T18:01:50+00:00"
|
||||
"time": "2025-05-14T16:17:23+00:00"
|
||||
},
|
||||
{
|
||||
"name": "league/csv",
|
||||
@@ -3499,16 +3499,16 @@
|
||||
},
|
||||
{
|
||||
"name": "utopia-php/database",
|
||||
"version": "0.68.1",
|
||||
"version": "0.69.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/utopia-php/database.git",
|
||||
"reference": "72b2e2c0b875028f7d9dd755f6d4524b693c6507"
|
||||
"reference": "60591ab073bb80bb9843338754b679bb8169e4ed"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/utopia-php/database/zipball/72b2e2c0b875028f7d9dd755f6d4524b693c6507",
|
||||
"reference": "72b2e2c0b875028f7d9dd755f6d4524b693c6507",
|
||||
"url": "https://api.github.com/repos/utopia-php/database/zipball/60591ab073bb80bb9843338754b679bb8169e4ed",
|
||||
"reference": "60591ab073bb80bb9843338754b679bb8169e4ed",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3549,9 +3549,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/utopia-php/database/issues",
|
||||
"source": "https://github.com/utopia-php/database/tree/0.68.1"
|
||||
"source": "https://github.com/utopia-php/database/tree/0.69.2"
|
||||
},
|
||||
"time": "2025-05-09T10:08:53+00:00"
|
||||
"time": "2025-05-14T07:51:44+00:00"
|
||||
},
|
||||
{
|
||||
"name": "utopia-php/detector",
|
||||
@@ -3793,16 +3793,16 @@
|
||||
},
|
||||
{
|
||||
"name": "utopia-php/image",
|
||||
"version": "0.8.2",
|
||||
"version": "0.8.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/utopia-php/image.git",
|
||||
"reference": "6c736965177f9a9e71311e22b80cfa88511768e9"
|
||||
"reference": "8820b0e53b3636b7bdf815e92394d333fef06f26"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/utopia-php/image/zipball/6c736965177f9a9e71311e22b80cfa88511768e9",
|
||||
"reference": "6c736965177f9a9e71311e22b80cfa88511768e9",
|
||||
"url": "https://api.github.com/repos/utopia-php/image/zipball/8820b0e53b3636b7bdf815e92394d333fef06f26",
|
||||
"reference": "8820b0e53b3636b7bdf815e92394d333fef06f26",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3836,9 +3836,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/utopia-php/image/issues",
|
||||
"source": "https://github.com/utopia-php/image/tree/0.8.2"
|
||||
"source": "https://github.com/utopia-php/image/tree/0.8.3"
|
||||
},
|
||||
"time": "2025-04-08T11:31:45+00:00"
|
||||
"time": "2025-05-15T10:39:28+00:00"
|
||||
},
|
||||
{
|
||||
"name": "utopia-php/locale",
|
||||
@@ -3947,16 +3947,16 @@
|
||||
},
|
||||
{
|
||||
"name": "utopia-php/messaging",
|
||||
"version": "0.16.0",
|
||||
"version": "0.17.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/utopia-php/messaging.git",
|
||||
"reference": "5f3083697102b1821d6624938186761b1e09c54e"
|
||||
"reference": "c51915d0e030db3a3add37f1561751d18b2d9a85"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/utopia-php/messaging/zipball/5f3083697102b1821d6624938186761b1e09c54e",
|
||||
"reference": "5f3083697102b1821d6624938186761b1e09c54e",
|
||||
"url": "https://api.github.com/repos/utopia-php/messaging/zipball/c51915d0e030db3a3add37f1561751d18b2d9a85",
|
||||
"reference": "c51915d0e030db3a3add37f1561751d18b2d9a85",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3992,9 +3992,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/utopia-php/messaging/issues",
|
||||
"source": "https://github.com/utopia-php/messaging/tree/0.16.0"
|
||||
"source": "https://github.com/utopia-php/messaging/tree/0.17.0"
|
||||
},
|
||||
"time": "2025-02-18T08:27:00+00:00"
|
||||
"time": "2025-05-12T16:14:08+00:00"
|
||||
},
|
||||
{
|
||||
"name": "utopia-php/migration",
|
||||
@@ -4376,16 +4376,16 @@
|
||||
},
|
||||
{
|
||||
"name": "utopia-php/storage",
|
||||
"version": "0.18.10",
|
||||
"version": "0.18.12",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/utopia-php/storage.git",
|
||||
"reference": "76f31158f4251abb207f7a9b16f7cb0bfdb3b39e"
|
||||
"reference": "9a2556c39b5f4d9f8e79111fd34ec889b7bb1e97"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/utopia-php/storage/zipball/76f31158f4251abb207f7a9b16f7cb0bfdb3b39e",
|
||||
"reference": "76f31158f4251abb207f7a9b16f7cb0bfdb3b39e",
|
||||
"url": "https://api.github.com/repos/utopia-php/storage/zipball/9a2556c39b5f4d9f8e79111fd34ec889b7bb1e97",
|
||||
"reference": "9a2556c39b5f4d9f8e79111fd34ec889b7bb1e97",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -4398,9 +4398,10 @@
|
||||
"ext-xz": "*",
|
||||
"ext-zlib": "*",
|
||||
"ext-zstd": "*",
|
||||
"php": ">=8.0",
|
||||
"php": ">=8.1",
|
||||
"utopia-php/framework": "0.*.*",
|
||||
"utopia-php/system": "0.*.*"
|
||||
"utopia-php/system": "0.*.*",
|
||||
"utopia-php/telemetry": "0.1.*"
|
||||
},
|
||||
"require-dev": {
|
||||
"laravel/pint": "1.2.*",
|
||||
@@ -4427,9 +4428,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/utopia-php/storage/issues",
|
||||
"source": "https://github.com/utopia-php/storage/tree/0.18.10"
|
||||
"source": "https://github.com/utopia-php/storage/tree/0.18.12"
|
||||
},
|
||||
"time": "2025-03-03T10:47:54+00:00"
|
||||
"time": "2025-05-15T07:55:58+00:00"
|
||||
},
|
||||
{
|
||||
"name": "utopia-php/swoole",
|
||||
@@ -8239,7 +8240,7 @@
|
||||
],
|
||||
"aliases": [],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": {},
|
||||
"stability-flags": [],
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
@@ -8263,5 +8264,5 @@
|
||||
"platform-overrides": {
|
||||
"php": "8.3"
|
||||
},
|
||||
"plugin-api-version": "2.6.0"
|
||||
"plugin-api-version": "2.3.0"
|
||||
}
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
# Change log
|
||||
# Change log
|
||||
|
||||
## 0.7.4
|
||||
|
||||
* Upgrade dependencies to resolve PlatformConstants error with Expo 53
|
||||
* Update doc examples to use new multi-region endpoint
|
||||
@@ -322,7 +322,7 @@ class Exception extends \Exception
|
||||
/** Tokens */
|
||||
public const TOKEN_NOT_FOUND = 'token_not_found';
|
||||
public const TOKEN_EXPIRED = 'token_expired';
|
||||
|
||||
public const TOKEN_RESOURCE_TYPE_INVALID = 'token_resource_type_invalid';
|
||||
|
||||
protected string $type = '';
|
||||
protected array $errors = [];
|
||||
|
||||
@@ -15,7 +15,6 @@ use Utopia\Database\Document;
|
||||
use Utopia\Database\Helpers\ID;
|
||||
use Utopia\Database\Validator\Authorization;
|
||||
use Utopia\Database\Validator\Datetime as DatetimeValidator;
|
||||
use Utopia\Database\Validator\Permissions;
|
||||
use Utopia\Database\Validator\UID;
|
||||
use Utopia\Platform\Scope\HTTP;
|
||||
use Utopia\Validator\Nullable;
|
||||
@@ -49,9 +48,9 @@ class Create extends Action
|
||||
group: 'files',
|
||||
name: 'createFileToken',
|
||||
description: <<<EOT
|
||||
Create a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.
|
||||
Create a new token. A token is linked to a file. Token can be passed as a header or request get parameter.
|
||||
EOT,
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_CREATED,
|
||||
@@ -63,15 +62,13 @@ class Create extends Action
|
||||
->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).')
|
||||
->param('fileId', '', new UID(), 'File unique ID.')
|
||||
->param('expire', null, new Nullable(new DatetimeValidator()), 'Token expiry date', true)
|
||||
->param('permissions', [], new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true)
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
->inject('user')
|
||||
->inject('queueForEvents')
|
||||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $bucketId, string $fileId, ?string $expire, ?array $permissions, Response $response, Database $dbForProject, Document $user, Event $queueForEvents)
|
||||
public function action(string $bucketId, string $fileId, ?string $expire, Response $response, Database $dbForProject, Event $queueForEvents): void
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -100,7 +97,6 @@ class Create extends Action
|
||||
'resourceInternalId' => $bucket->getInternalId() . ':' . $file->getInternalId(),
|
||||
'resourceType' => TOKENS_RESOURCE_TYPE_FILES,
|
||||
'expire' => $expire,
|
||||
'$permissions' => $permissions
|
||||
]));
|
||||
|
||||
$queueForEvents
|
||||
|
||||
@@ -41,7 +41,7 @@ class XList extends Action
|
||||
description: <<<EOT
|
||||
List all the tokens created for a specific file or bucket. You can use the query params to filter your results.
|
||||
EOT,
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
|
||||
@@ -45,7 +45,7 @@ class Delete extends Action
|
||||
description: <<<EOT
|
||||
Delete a token by its unique ID.
|
||||
EOT,
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_NOCONTENT,
|
||||
|
||||
@@ -38,7 +38,7 @@ class Get extends Action
|
||||
description: <<<EOT
|
||||
Get a token by its unique ID.
|
||||
EOT,
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Tokens\Http\Tokens\JWT;
|
||||
|
||||
use Ahc\Jwt\JWT;
|
||||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\Database\Database;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Database\Validator\UID;
|
||||
use Utopia\Platform\Action;
|
||||
use Utopia\Platform\Scope\HTTP;
|
||||
use Utopia\System\System;
|
||||
|
||||
class Get extends Action
|
||||
{
|
||||
use HTTP;
|
||||
|
||||
public static function getName()
|
||||
{
|
||||
return 'getTokenJWT';
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->setHttpMethod(Action::HTTP_REQUEST_METHOD_GET)
|
||||
->setHttpPath('/v1/tokens/:tokenId/jwt')
|
||||
->desc('Get token as JWT')
|
||||
->groups(['api', 'tokens'])
|
||||
->label('scope', 'tokens.read')
|
||||
->label('usage.metric', 'tokens.{scope}.requests.read')
|
||||
->label('usage.params', ['tokenId:{request.tokenId}'])
|
||||
->label('sdk', new Method(
|
||||
namespace: 'tokens',
|
||||
group: 'tokens',
|
||||
name: 'getJWT',
|
||||
description: <<<EOT
|
||||
Get a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.
|
||||
EOT,
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_JWT,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON
|
||||
))
|
||||
->param('tokenId', '', new UID(), 'File token ID.')
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $tokenId, Response $response, Database $dbForProject)
|
||||
{
|
||||
$token = $dbForProject->getDocument('resourceTokens', $tokenId);
|
||||
|
||||
if ($token->isEmpty()) {
|
||||
throw new Exception(Exception::TOKEN_NOT_FOUND);
|
||||
}
|
||||
|
||||
// calculate maxAge based on expiry date
|
||||
$maxAge = PHP_INT_MAX;
|
||||
$expire = $token->getAttribute('expire');
|
||||
if ($expire !== null) {
|
||||
$now = new \DateTime();
|
||||
$expiryDate = new \DateTime($expire);
|
||||
if ($expiryDate < $now) {
|
||||
throw new Exception(Exception::TOKEN_EXPIRED);
|
||||
}
|
||||
$maxAge = $expiryDate->getTimestamp() - $now->getTimestamp();
|
||||
}
|
||||
|
||||
$jwt = new JWT(System::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', $maxAge, 10); // Instantiate with key, algo, maxAge and leeway.
|
||||
|
||||
$response
|
||||
->setStatusCode(Response::STATUS_CODE_OK)
|
||||
->dynamic(new Document(['jwt' => $jwt->encode([
|
||||
'resourceType' => $token->getAttribute('resourceType'),
|
||||
'resourceId' => $token->getAttribute('resourceId'),
|
||||
'resourceInternalId' => $token->getAttribute('resourceInternalId'),
|
||||
'tokenId' => $token->getId(),
|
||||
'secret' => $token->getAttribute('secret')
|
||||
])]), Response::MODEL_JWT);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace Appwrite\Platform\Modules\Tokens\Http\Tokens;
|
||||
|
||||
use Appwrite\Auth\Auth;
|
||||
use Appwrite\Event\Event;
|
||||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -11,11 +10,7 @@ use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\Database\Database;
|
||||
use Utopia\Database\Helpers\Permission;
|
||||
use Utopia\Database\Helpers\Role;
|
||||
use Utopia\Database\Validator\Authorization;
|
||||
use Utopia\Database\Validator\Datetime as DatetimeValidator;
|
||||
use Utopia\Database\Validator\Permissions;
|
||||
use Utopia\Database\Validator\UID;
|
||||
use Utopia\Platform\Action;
|
||||
use Utopia\Platform\Scope\HTTP;
|
||||
@@ -50,9 +45,9 @@ class Update extends Action
|
||||
group: 'tokens',
|
||||
name: 'update',
|
||||
description: <<<EOT
|
||||
Update a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.
|
||||
Update a token by its unique ID. Use this endpoint to update a token's expiry date.
|
||||
EOT,
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
@@ -63,14 +58,13 @@ class Update extends Action
|
||||
))
|
||||
->param('tokenId', '', new UID(), 'Token unique ID.')
|
||||
->param('expire', null, new Nullable(new DatetimeValidator()), 'File token expiry date', true)
|
||||
->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).', true)
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
->inject('queueForEvents')
|
||||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $tokenId, ?string $expire, ?array $permissions, Response $response, Database $dbForProject, Event $queueForEvents)
|
||||
public function action(string $tokenId, ?string $expire, Response $response, Database $dbForProject, Event $queueForEvents)
|
||||
{
|
||||
$token = $dbForProject->getDocument('resourceTokens', $tokenId);
|
||||
|
||||
@@ -78,47 +72,11 @@ class Update extends Action
|
||||
throw new Exception(Exception::TOKEN_NOT_FOUND);
|
||||
}
|
||||
|
||||
// Map aggregate permissions into the multiple permissions they represent.
|
||||
$permissions = Permission::aggregate($permissions, [
|
||||
Database::PERMISSION_READ,
|
||||
Database::PERMISSION_UPDATE,
|
||||
Database::PERMISSION_DELETE,
|
||||
]);
|
||||
|
||||
// Users can only manage their own roles, API keys and Admin users can manage any
|
||||
$roles = Authorization::getRoles();
|
||||
if (!Auth::isAppUser($roles) && !Auth::isPrivilegedUser($roles) && !\is_null($permissions)) {
|
||||
foreach (Database::PERMISSIONS as $type) {
|
||||
foreach ($permissions as $permission) {
|
||||
$permission = Permission::parse($permission);
|
||||
if ($permission->getPermission() != $type) {
|
||||
continue;
|
||||
}
|
||||
$role = (new Role(
|
||||
$permission->getRole(),
|
||||
$permission->getIdentifier(),
|
||||
$permission->getDimension()
|
||||
))->toString();
|
||||
if (!Authorization::isRole($role)) {
|
||||
throw new Exception(Exception::USER_UNAUTHORIZED, 'Permissions must be one of: (' . \implode(', ', $roles) . ')');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (\is_null($permissions)) {
|
||||
$permissions = $token->getPermissions() ?? [];
|
||||
}
|
||||
|
||||
$token
|
||||
->setAttribute('expire', $expire)
|
||||
->setAttribute('$permissions', $permissions);
|
||||
$token->setAttribute('expire', $expire);
|
||||
|
||||
$token = $dbForProject->updateDocument('resourceTokens', $tokenId, $token);
|
||||
|
||||
$queueForEvents
|
||||
->setParam('tokenId', $token->getId())
|
||||
;
|
||||
$queueForEvents->setParam('tokenId', $token->getId());
|
||||
|
||||
$response->dynamic($token, Response::MODEL_RESOURCE_TOKEN);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ use Appwrite\Platform\Modules\Tokens\Http\Tokens\Buckets\Files\Create as CreateF
|
||||
use Appwrite\Platform\Modules\Tokens\Http\Tokens\Buckets\Files\XList as ListFileTokens;
|
||||
use Appwrite\Platform\Modules\Tokens\Http\Tokens\Delete as DeleteToken;
|
||||
use Appwrite\Platform\Modules\Tokens\Http\Tokens\Get as GetToken;
|
||||
use Appwrite\Platform\Modules\Tokens\Http\Tokens\JWT\Get as GetTokenJWT;
|
||||
use Appwrite\Platform\Modules\Tokens\Http\Tokens\Update as UpdateToken;
|
||||
use Utopia\Platform\Service;
|
||||
|
||||
@@ -18,7 +17,6 @@ class Http extends Service
|
||||
$this
|
||||
->addAction(CreateFileToken::getName(), new CreateFileToken())
|
||||
->addAction(GetToken::getName(), new GetToken())
|
||||
->addAction(GetTokenJWT::getName(), new GetTokenJWT())
|
||||
->addAction(ListFileTokens::getName(), new ListFileTokens())
|
||||
->addAction(UpdateToken::getName(), new UpdateToken())
|
||||
->addAction(DeleteToken::getName(), new DeleteToken())
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace Appwrite\Platform\Tasks;
|
||||
|
||||
use Swoole\Runtime;
|
||||
use Swoole\Timer;
|
||||
use Utopia\CLI\Console;
|
||||
use Utopia\Database\Database;
|
||||
@@ -66,8 +65,6 @@ abstract class ScheduleBase extends Action
|
||||
*/
|
||||
public function action(Group $pools, Database $dbForPlatform, callable $getProjectDB, Telemetry $telemetry): void
|
||||
{
|
||||
Runtime::enableCoroutine();
|
||||
|
||||
Console::title(\ucfirst(static::getSupportedResource()) . ' scheduler V1');
|
||||
Console::success(APP_NAME . ' ' . \ucfirst(static::getSupportedResource()) . ' scheduler v1 has started');
|
||||
|
||||
@@ -91,13 +88,18 @@ abstract class ScheduleBase extends Action
|
||||
});
|
||||
|
||||
while (true) {
|
||||
$this->enqueueResources($pools, $dbForPlatform, $getProjectDB);
|
||||
$this->scheduleTelemetryCount->record(count($this->schedules), ['resourceType' => static::getSupportedResource()]);
|
||||
sleep(static::ENQUEUE_TIMER);
|
||||
try {
|
||||
go(fn () => $this->enqueueResources($pools, $dbForPlatform, $getProjectDB));
|
||||
$this->scheduleTelemetryCount->record(count($this->schedules), ['resourceType' => static::getSupportedResource()]);
|
||||
sleep(static::ENQUEUE_TIMER);
|
||||
} catch (\Throwable $th) {
|
||||
Console::error('Failed to enqueue resources: ' . $th->getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private function collectSchedules(Group $pools, Database $dbForPlatform, callable $getProjectDB, ?string &$lastSyncUpdate): void
|
||||
private function collectSchedules(Group $pools, Database $dbForPlatform, callable $getProjectDB, string &$lastSyncUpdate): void
|
||||
{
|
||||
// If we haven't synced yet, load all active schedules
|
||||
$initialLoad = $lastSyncUpdate === "0";
|
||||
@@ -202,10 +204,8 @@ abstract class ScheduleBase extends Action
|
||||
Console::success("{$total} resources were loaded in " . $duration . " seconds");
|
||||
}
|
||||
|
||||
protected function recordEnqueueDelay(string $expectedExecutionSchedule): void
|
||||
protected function recordEnqueueDelay(\DateTime $expectedExecutionSchedule): void
|
||||
{
|
||||
$now = strtotime('now');
|
||||
$scheduledAt = strtotime($expectedExecutionSchedule);
|
||||
$this->enqueueDelayTelemetry->record($now - $scheduledAt, ['resourceType' => static::getSupportedResource()]);
|
||||
$this->enqueueDelayTelemetry->record(time() - $expectedExecutionSchedule->getTimestamp(), ['resourceType' => static::getSupportedResource()]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ class ScheduleExecutions extends ScheduleBase
|
||||
|
||||
$this->updateProjectAccess($schedule['project'], $dbForPlatform);
|
||||
|
||||
\go(function () use ($queueForFunctions, $schedule, $delay, $data) {
|
||||
\go(function () use ($queueForFunctions, $schedule, $scheduledAt, $delay, $data) {
|
||||
Co::sleep($delay);
|
||||
|
||||
$queueForFunctions->setType('schedule')
|
||||
@@ -75,7 +75,7 @@ class ScheduleExecutions extends ScheduleBase
|
||||
->setUserId($data['userId'] ?? '')
|
||||
->trigger();
|
||||
|
||||
$this->recordEnqueueDelay($schedule['schedule']);
|
||||
$this->recordEnqueueDelay($scheduledAt);
|
||||
});
|
||||
|
||||
$dbForPlatform->deleteDocument(
|
||||
|
||||
@@ -46,7 +46,13 @@ class ScheduleFunctions extends ScheduleBase
|
||||
$delayedExecutions = []; // Group executions with same delay to share one coroutine
|
||||
|
||||
foreach ($this->schedules as $key => $schedule) {
|
||||
$cron = new CronExpression($schedule['schedule']);
|
||||
try {
|
||||
$cron = new CronExpression($schedule['schedule']);
|
||||
} catch (\InvalidArgumentException) {
|
||||
// ignore invalid cron expressions
|
||||
continue;
|
||||
}
|
||||
|
||||
$nextDate = $cron->getNextRunDate();
|
||||
$next = DateTime::format($nextDate);
|
||||
|
||||
@@ -66,17 +72,18 @@ class ScheduleFunctions extends ScheduleBase
|
||||
$delayedExecutions[$delay] = [];
|
||||
}
|
||||
|
||||
$delayedExecutions[$delay][] = $key;
|
||||
$delayedExecutions[$delay][] = ['key' => $key, 'nextDate' => $nextDate];
|
||||
}
|
||||
|
||||
foreach ($delayedExecutions as $delay => $scheduleKeys) {
|
||||
\go(function () use ($delay, $scheduleKeys, $pools, $dbForPlatform) {
|
||||
foreach ($delayedExecutions as $delay => $schedules) {
|
||||
\go(function () use ($delay, $schedules, $pools, $dbForPlatform) {
|
||||
\sleep($delay); // in seconds
|
||||
|
||||
$queue = $pools->get('publisher')->pop();
|
||||
$connection = $queue->getResource();
|
||||
|
||||
foreach ($scheduleKeys as $scheduleKey) {
|
||||
foreach ($schedules as $delayConfig) {
|
||||
$scheduleKey = $delayConfig['key'];
|
||||
// Ensure schedule was not deleted
|
||||
if (!\array_key_exists($scheduleKey, $this->schedules)) {
|
||||
return;
|
||||
@@ -96,7 +103,7 @@ class ScheduleFunctions extends ScheduleBase
|
||||
->setProject($schedule['project'])
|
||||
->trigger();
|
||||
|
||||
$this->recordEnqueueDelay($schedule['schedule']);
|
||||
$this->recordEnqueueDelay($delayConfig['nextDate']);
|
||||
}
|
||||
|
||||
$queue->reclaim();
|
||||
|
||||
@@ -40,7 +40,7 @@ class ScheduleMessages extends ScheduleBase
|
||||
continue;
|
||||
}
|
||||
|
||||
\go(function () use ($schedule, $pools, $dbForPlatform) {
|
||||
\go(function () use ($schedule, $scheduledAt, $pools, $dbForPlatform) {
|
||||
$queue = $pools->get('publisher')->pop();
|
||||
$connection = $queue->getResource();
|
||||
$queueForMessaging = new Messaging($connection);
|
||||
@@ -59,7 +59,7 @@ class ScheduleMessages extends ScheduleBase
|
||||
);
|
||||
|
||||
$queue->reclaim();
|
||||
$this->recordEnqueueDelay($schedule['schedule']);
|
||||
$this->recordEnqueueDelay($scheduledAt);
|
||||
unset($this->schedules[$schedule['$internalId']]);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ class Certificates extends Action
|
||||
->inject('queueForRealtime')
|
||||
->inject('log')
|
||||
->inject('certificates')
|
||||
->inject('plan')
|
||||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
@@ -80,7 +81,8 @@ class Certificates extends Action
|
||||
Func $queueForFunctions,
|
||||
Realtime $queueForRealtime,
|
||||
Log $log,
|
||||
CertificatesAdapter $certificates
|
||||
CertificatesAdapter $certificates,
|
||||
array $plan
|
||||
): void {
|
||||
$payload = $message->getPayload() ?? [];
|
||||
|
||||
@@ -94,7 +96,7 @@ class Certificates extends Action
|
||||
|
||||
$log->addTag('domain', $domain->get());
|
||||
|
||||
$this->execute($domain, $dbForPlatform, $queueForMails, $queueForEvents, $queueForWebhooks, $queueForFunctions, $queueForRealtime, $log, $certificates, $skipRenewCheck);
|
||||
$this->execute($domain, $dbForPlatform, $queueForMails, $queueForEvents, $queueForWebhooks, $queueForFunctions, $queueForRealtime, $log, $certificates, $skipRenewCheck, $plan);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -106,6 +108,7 @@ class Certificates extends Action
|
||||
* @param Realtime $queueForRealtime
|
||||
* @param CertificatesAdapter $certificates
|
||||
* @param bool $skipRenewCheck
|
||||
* @param array $plan
|
||||
* @return void
|
||||
* @throws Throwable
|
||||
* @throws \Utopia\Database\Exception
|
||||
@@ -120,7 +123,8 @@ class Certificates extends Action
|
||||
Realtime $queueForRealtime,
|
||||
Log $log,
|
||||
CertificatesAdapter $certificates,
|
||||
bool $skipRenewCheck = false
|
||||
bool $skipRenewCheck = false,
|
||||
array $plan = []
|
||||
): void {
|
||||
/**
|
||||
* 1. Read arguments and validate domain
|
||||
@@ -202,7 +206,7 @@ class Certificates extends Action
|
||||
$certificate->setAttribute('renewDate', DateTime::now());
|
||||
|
||||
// Send email to security email
|
||||
$this->notifyError($domain->get(), $e->getMessage(), $attempts, $queueForMails);
|
||||
$this->notifyError($domain->get(), $e->getMessage(), $attempts, $queueForMails, $plan);
|
||||
|
||||
throw $e;
|
||||
} finally {
|
||||
@@ -342,10 +346,11 @@ class Certificates extends Action
|
||||
* @param string $errorMessage Verbose error message
|
||||
* @param int $attempt How many times it failed already
|
||||
* @param Mail $queueForMails
|
||||
* @param array $plan
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
private function notifyError(string $domain, string $errorMessage, int $attempt, Mail $queueForMails): void
|
||||
private function notifyError(string $domain, string $errorMessage, int $attempt, Mail $queueForMails, array $plan): void
|
||||
{
|
||||
// Log error into console
|
||||
Console::warning('Cannot renew domain (' . $domain . ') on attempt no. ' . $attempt . ' certificate: ' . $errorMessage);
|
||||
@@ -357,6 +362,15 @@ class Certificates extends Action
|
||||
$template->setParam('{{domain}}', $domain);
|
||||
$template->setParam('{{error}}', \nl2br($errorMessage));
|
||||
$template->setParam('{{attempts}}', $attempt);
|
||||
|
||||
$template->setParam('{{logoUrl}}', $plan['logoUrl'] ?? APP_EMAIL_LOGO_URL);
|
||||
$template->setParam('{{accentColor}}', $plan['accentColor'] ?? APP_EMAIL_ACCENT_COLOR);
|
||||
$template->setParam('{{twitterUrl}}', $plan['twitterUrl'] ?? APP_SOCIAL_TWITTER);
|
||||
$template->setParam('{{discordUrl}}', $plan['discordUrl'] ?? APP_SOCIAL_DISCORD);
|
||||
$template->setParam('{{githubUrl}}', $plan['githubUrl'] ?? APP_SOCIAL_GITHUB_APPWRITE);
|
||||
$template->setParam('{{termsUrl}}', $plan['termsUrl'] ?? APP_EMAIL_TERMS_URL);
|
||||
$template->setParam('{{privacyUrl}}', $plan['privacyUrl'] ?? APP_EMAIL_PRIVACY_URL);
|
||||
|
||||
$body = $template->render();
|
||||
|
||||
$emailVariables = [
|
||||
|
||||
@@ -24,6 +24,7 @@ use Utopia\Messaging\Adapter\Push\FCM;
|
||||
use Utopia\Messaging\Adapter\SMS as SMSAdapter;
|
||||
use Utopia\Messaging\Adapter\SMS\Fast2SMS;
|
||||
use Utopia\Messaging\Adapter\SMS\GEOSMS;
|
||||
use Utopia\Messaging\Adapter\SMS\Inforu;
|
||||
use Utopia\Messaging\Adapter\SMS\Mock;
|
||||
use Utopia\Messaging\Adapter\SMS\Msg91;
|
||||
use Utopia\Messaging\Adapter\SMS\Telesign;
|
||||
@@ -455,6 +456,10 @@ class Messaging extends Action
|
||||
$credentials['messageId'] ?? '',
|
||||
$credentials['useDLT'] ?? true
|
||||
),
|
||||
'inforu' => new Inforu(
|
||||
$credentials['senderId'] ?? '',
|
||||
$credentials['apiKey'] ?? '',
|
||||
),
|
||||
default => null
|
||||
};
|
||||
}
|
||||
@@ -780,6 +785,10 @@ class Messaging extends Action
|
||||
'messageId' => $dsn->getParam('messageId'),
|
||||
'useDLT' => $dsn->getParam('useDLT'),
|
||||
],
|
||||
'inforu' => [
|
||||
'senderId' => $user,
|
||||
'apiKey' => $password,
|
||||
],
|
||||
default => null
|
||||
},
|
||||
'options' => match ($host) {
|
||||
|
||||
@@ -37,6 +37,7 @@ class Webhooks extends Action
|
||||
->inject('queueForMails')
|
||||
->inject('queueForStatsUsage')
|
||||
->inject('log')
|
||||
->inject('plan')
|
||||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
@@ -45,11 +46,13 @@ class Webhooks extends Action
|
||||
* @param Document $project
|
||||
* @param Database $dbForPlatform
|
||||
* @param Mail $queueForMails
|
||||
* @param StatsUsage $queueForStatsUsage
|
||||
* @param Log $log
|
||||
* @param array $plan
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
public function action(Message $message, Document $project, Database $dbForPlatform, Mail $queueForMails, StatsUsage $queueForStatsUsage, Log $log): void
|
||||
public function action(Message $message, Document $project, Database $dbForPlatform, Mail $queueForMails, StatsUsage $queueForStatsUsage, Log $log, array $plan): void
|
||||
{
|
||||
$this->errors = [];
|
||||
$payload = $message->getPayload() ?? [];
|
||||
@@ -68,7 +71,7 @@ class Webhooks extends Action
|
||||
|
||||
foreach ($project->getAttribute('webhooks', []) as $webhook) {
|
||||
if (array_intersect($webhook->getAttribute('events', []), $events)) {
|
||||
$this->execute($events, $webhookPayload, $webhook, $user, $project, $dbForPlatform, $queueForMails, $queueForStatsUsage);
|
||||
$this->execute($events, $webhookPayload, $webhook, $user, $project, $dbForPlatform, $queueForMails, $queueForStatsUsage, $plan);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,9 +88,10 @@ class Webhooks extends Action
|
||||
* @param Document $project
|
||||
* @param Database $dbForPlatform
|
||||
* @param Mail $queueForMails
|
||||
* @param array $plan
|
||||
* @return void
|
||||
*/
|
||||
private function execute(array $events, string $payload, Document $webhook, Document $user, Document $project, Database $dbForPlatform, Mail $queueForMails, StatsUsage $queueForStatsUsage): void
|
||||
private function execute(array $events, string $payload, Document $webhook, Document $user, Document $project, Database $dbForPlatform, Mail $queueForMails, StatsUsage $queueForStatsUsage, array $plan): void
|
||||
{
|
||||
if ($webhook->getAttribute('enabled') !== true) {
|
||||
return;
|
||||
@@ -163,7 +167,7 @@ class Webhooks extends Action
|
||||
|
||||
if ($attempts >= \intval(System::getEnv('_APP_WEBHOOK_MAX_FAILED_ATTEMPTS', '10'))) {
|
||||
$webhook->setAttribute('enabled', false);
|
||||
$this->sendEmailAlert($attempts, $statusCode, $webhook, $project, $dbForPlatform, $queueForMails);
|
||||
$this->sendEmailAlert($attempts, $statusCode, $webhook, $project, $dbForPlatform, $queueForMails, $plan);
|
||||
}
|
||||
|
||||
$dbForPlatform->updateDocument('webhooks', $webhook->getId(), $webhook);
|
||||
@@ -198,9 +202,10 @@ class Webhooks extends Action
|
||||
* @param Document $project
|
||||
* @param Database $dbForPlatform
|
||||
* @param Mail $queueForMails
|
||||
* @param array $plan
|
||||
* @return void
|
||||
*/
|
||||
public function sendEmailAlert(int $attempts, mixed $statusCode, Document $webhook, Document $project, Database $dbForPlatform, Mail $queueForMails): void
|
||||
public function sendEmailAlert(int $attempts, mixed $statusCode, Document $webhook, Document $project, Database $dbForPlatform, Mail $queueForMails, array $plan): void
|
||||
{
|
||||
$memberships = $dbForPlatform->find('memberships', [
|
||||
Query::equal('teamInternalId', [$project->getAttribute('teamInternalId')]),
|
||||
@@ -225,6 +230,14 @@ class Webhooks extends Action
|
||||
$template->setParam('{{path}}', "/console/project-$projectId/settings/webhooks/$webhookId");
|
||||
$template->setParam('{{attempts}}', $attempts);
|
||||
|
||||
$template->setParam('{{logoUrl}}', $plan['logoUrl'] ?? APP_EMAIL_LOGO_URL);
|
||||
$template->setParam('{{accentColor}}', $plan['accentColor'] ?? APP_EMAIL_ACCENT_COLOR);
|
||||
$template->setParam('{{twitterUrl}}', $plan['twitterUrl'] ?? APP_SOCIAL_TWITTER);
|
||||
$template->setParam('{{discordUrl}}', $plan['discordUrl'] ?? APP_SOCIAL_DISCORD);
|
||||
$template->setParam('{{githubUrl}}', $plan['githubUrl'] ?? APP_SOCIAL_GITHUB_APPWRITE);
|
||||
$template->setParam('{{termsUrl}}', $plan['termsUrl'] ?? APP_EMAIL_TERMS_URL);
|
||||
$template->setParam('{{privacyUrl}}', $plan['privacyUrl'] ?? APP_EMAIL_PRIVACY_URL);
|
||||
|
||||
// TODO: Use setbodyTemplate once #7307 is merged
|
||||
$subject = 'Webhook deliveries have been paused';
|
||||
$body = Template::fromFile(__DIR__ . '/../../../../app/config/locale/templates/email-base-styled.tpl');
|
||||
|
||||
@@ -41,6 +41,13 @@ class Index extends Model
|
||||
'example' => [],
|
||||
'array' => true,
|
||||
])
|
||||
->addRule('lengths', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Index attributes length.',
|
||||
'default' => [],
|
||||
'example' => [],
|
||||
'array' => true,
|
||||
])
|
||||
->addRule('orders', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Index orders.',
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
|
||||
namespace Appwrite\Utopia\Response\Model;
|
||||
|
||||
use Ahc\Jwt\JWT;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Appwrite\Utopia\Response\Model;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\System\System;
|
||||
|
||||
class ResourceToken extends Model
|
||||
{
|
||||
@@ -22,13 +25,6 @@ class ResourceToken extends Model
|
||||
'default' => '',
|
||||
'example' => self::TYPE_DATETIME_EXAMPLE,
|
||||
])
|
||||
->addRule('$permissions', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Token permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).',
|
||||
'default' => '',
|
||||
'example' => ['read("any")'],
|
||||
'array' => true,
|
||||
])
|
||||
->addRule('resourceId', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Resource ID.',
|
||||
@@ -47,6 +43,13 @@ class ResourceToken extends Model
|
||||
'default' => '',
|
||||
'example' => self::TYPE_DATETIME_EXAMPLE,
|
||||
])
|
||||
->addRule('secret', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'JWT encoded string.',
|
||||
'default' => '',
|
||||
// this is a secret but is converted to a JWT token when sent back to the client after filter.
|
||||
'example' => 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c',
|
||||
])
|
||||
->addRule('accessedAt', [
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => 'Most recent access date in ISO 8601 format. This attribute is only updated again after ' . APP_RESOURCE_TOKEN_ACCESS / 60 / 60 . ' hours.',
|
||||
@@ -56,6 +59,32 @@ class ResourceToken extends Model
|
||||
;
|
||||
}
|
||||
|
||||
public function filter(Document $document): Document
|
||||
{
|
||||
$maxAge = PHP_INT_MAX;
|
||||
$expire = $document->getAttribute('expire');
|
||||
|
||||
if ($expire !== null) {
|
||||
$now = new \DateTime();
|
||||
$expiryDate = new \DateTime($expire);
|
||||
|
||||
// set 1 min if expired, we check for expiry later on route hooks for validation!
|
||||
$maxAge = min(60, $expiryDate->getTimestamp() - $now->getTimestamp());
|
||||
}
|
||||
|
||||
$jwt = new JWT(System::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', $maxAge, 10);
|
||||
$secret = $jwt->encode([
|
||||
'tokenId' => $document->getId(),
|
||||
'resourceId' => $document->getAttribute('resourceId'),
|
||||
'resourceType' => $document->getAttribute('resourceType'),
|
||||
'resourceInternalId' => $document->getAttribute('resourceInternalId'),
|
||||
]);
|
||||
|
||||
$document->setAttribute('secret', $secret);
|
||||
|
||||
return $document;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Name
|
||||
*
|
||||
|
||||
@@ -1422,9 +1422,102 @@ trait DatabasesBase
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @depends testCreateIndexes
|
||||
*/
|
||||
* @depends testCreateAttributes
|
||||
*/
|
||||
public function testGetIndexByKeyWithLengths(array $data): void
|
||||
{
|
||||
$databaseId = $data['databaseId'];
|
||||
$collectionId = $data['moviesId'];
|
||||
|
||||
// Test case for valid lengths
|
||||
$create = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collectionId}/indexes", [
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
'x-appwrite-key' => $this->getProject()['apiKey']
|
||||
], [
|
||||
'key' => 'lengthTestIndex',
|
||||
'type' => 'key',
|
||||
'attributes' => ['title','description'],
|
||||
'lengths' => [128,200]
|
||||
]);
|
||||
$this->assertEquals(202, $create['headers']['status-code']);
|
||||
|
||||
// Fetch index and check correct lengths
|
||||
$index = $this->client->call(Client::METHOD_GET, "/databases/{$databaseId}/collections/{$collectionId}/indexes/lengthTestIndex", [
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
'x-appwrite-key' => $this->getProject()['apiKey']
|
||||
]);
|
||||
$this->assertEquals(200, $index['headers']['status-code']);
|
||||
$this->assertEquals('lengthTestIndex', $index['body']['key']);
|
||||
$this->assertEquals([128, 200], $index['body']['lengths']);
|
||||
|
||||
// Test case for lengths array overriding
|
||||
// set a length for an array attribute, it should get overriden with Database::ARRAY_INDEX_LENGTH
|
||||
$create = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collectionId}/indexes", [
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
'x-appwrite-key' => $this->getProject()['apiKey']
|
||||
], [
|
||||
'key' => 'lengthOverrideTestIndex',
|
||||
'type' => 'key',
|
||||
'attributes' => ['actors'],
|
||||
'lengths' => [120]
|
||||
]);
|
||||
$this->assertEquals(202, $create['headers']['status-code']);
|
||||
|
||||
$index = $this->client->call(Client::METHOD_GET, "/databases/{$databaseId}/collections/{$collectionId}/indexes/lengthOverrideTestIndex", [
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
'x-appwrite-key' => $this->getProject()['apiKey']
|
||||
]);
|
||||
$this->assertEquals([Database::ARRAY_INDEX_LENGTH], $index['body']['lengths']);
|
||||
|
||||
// Test case for count of lengths greater than attributes (should throw 400)
|
||||
$create = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collectionId}/indexes", [
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
'x-appwrite-key' => $this->getProject()['apiKey']
|
||||
], [
|
||||
'key' => 'lengthCountExceededIndex',
|
||||
'type' => 'key',
|
||||
'attributes' => ['title'],
|
||||
'lengths' => [128, 128]
|
||||
]);
|
||||
$this->assertEquals(400, $create['headers']['status-code']);
|
||||
|
||||
// Test case for lengths exceeding total of 768
|
||||
$create = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collectionId}/indexes", [
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
'x-appwrite-key' => $this->getProject()['apiKey']
|
||||
], [
|
||||
'key' => 'lengthTooLargeIndex',
|
||||
'type' => 'key',
|
||||
'attributes' => ['title','description','tagline','actors'],
|
||||
'lengths' => [256,256,256,20]
|
||||
]);
|
||||
|
||||
$this->assertEquals(400, $create['headers']['status-code']);
|
||||
|
||||
// Test case for negative length values
|
||||
$create = $this->client->call(Client::METHOD_POST, "/databases/{$databaseId}/collections/{$collectionId}/indexes", [
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
'x-appwrite-key' => $this->getProject()['apiKey']
|
||||
], [
|
||||
'key' => 'negativeLengthIndex',
|
||||
'type' => 'key',
|
||||
'attributes' => ['title'],
|
||||
'lengths' => [-1]
|
||||
]);
|
||||
$this->assertEquals(400, $create['headers']['status-code']);
|
||||
}
|
||||
/**
|
||||
* @depends testCreateIndexes
|
||||
*/
|
||||
public function testListIndexes(array $data): void
|
||||
{
|
||||
$databaseId = $data['databaseId'];
|
||||
|
||||
@@ -110,7 +110,7 @@ class TeamsConsoleClientTest extends Scope
|
||||
$session = $data['session'] ?? '';
|
||||
|
||||
/**
|
||||
* Test for SUCCESS
|
||||
* Test for FAILURE
|
||||
*/
|
||||
$roles = ['developer'];
|
||||
$response = $this->client->call(Client::METHOD_PATCH, '/teams/' . $teamUid . '/memberships/' . $membershipUid, array_merge([
|
||||
@@ -121,12 +121,8 @@ class TeamsConsoleClientTest extends Scope
|
||||
'roles' => $roles
|
||||
]);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertNotEmpty($response['body']['$id']);
|
||||
$this->assertNotEmpty($response['body']['userId']);
|
||||
$this->assertNotEmpty($response['body']['teamId']);
|
||||
$this->assertCount(count($roles), $response['body']['roles']);
|
||||
$this->assertEquals($roles[0], $response['body']['roles'][0]);
|
||||
$this->assertEquals(400, $response['headers']['status-code']);
|
||||
$this->assertEquals('There must be at least one owner in the organization.', $response['body']['message']);
|
||||
|
||||
/**
|
||||
* Test for unknown team
|
||||
|
||||
@@ -66,7 +66,7 @@ trait TokensBase
|
||||
return [
|
||||
'fileId' => $fileId,
|
||||
'bucketId' => $bucketId,
|
||||
'tokenId' => $token['body']['$id'],
|
||||
'token' => $token['body'],
|
||||
'guestHeaders' => [
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
@@ -143,22 +143,12 @@ trait TokensBase
|
||||
*/
|
||||
public function testPreviewFileWithToken(array $data): array
|
||||
{
|
||||
$token = $data['token'];
|
||||
$fileId = $data['fileId'];
|
||||
$tokenId = $data['tokenId'];
|
||||
$bucketId = $data['bucketId'];
|
||||
$guestHeaders = $data['guestHeaders'];
|
||||
$adminHeaders = array_merge($guestHeaders, ['x-appwrite-key' => $this->getProject()['apiKey']]);
|
||||
|
||||
// Generate JWT as an admin user.
|
||||
$tokenJWT = $this->client->call(
|
||||
Client::METHOD_GET,
|
||||
'/tokens/' . $tokenId . '/jwt/',
|
||||
$adminHeaders
|
||||
);
|
||||
$this->assertEquals(200, $tokenJWT['headers']['status-code']);
|
||||
$this->assertArrayHasKey('jwt', $tokenJWT['body']);
|
||||
|
||||
$tokenJWT = $tokenJWT['body']['jwt'];
|
||||
$tokenJWT = $token['secret'];
|
||||
|
||||
// Generate a preview
|
||||
$filePreview = $this->client->call(
|
||||
|
||||
@@ -2,13 +2,143 @@
|
||||
|
||||
namespace Tests\E2E\Services\Tokens;
|
||||
|
||||
use CURLFile;
|
||||
use Tests\E2E\Client;
|
||||
use Tests\E2E\Scopes\ProjectCustom;
|
||||
use Tests\E2E\Scopes\Scope;
|
||||
use Tests\E2E\Scopes\SideConsole;
|
||||
use Tests\E2E\Scopes\SideServer;
|
||||
use Utopia\Database\DateTime;
|
||||
use Utopia\Database\Helpers\ID;
|
||||
use Utopia\Database\Helpers\Permission;
|
||||
use Utopia\Database\Helpers\Role;
|
||||
use Utopia\Database\Validator\Datetime as DatetimeValidator;
|
||||
|
||||
class TokensConsoleClientTest extends Scope
|
||||
{
|
||||
use SideConsole;
|
||||
use TokensBase;
|
||||
use ProjectCustom;
|
||||
use SideServer;
|
||||
|
||||
public function testCreateToken(): array
|
||||
{
|
||||
|
||||
$bucket = $this->client->call(Client::METHOD_POST, '/storage/buckets', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id']
|
||||
], $this->getHeaders()), [
|
||||
'bucketId' => ID::unique(),
|
||||
'name' => 'Test Bucket',
|
||||
'fileSecurity' => true,
|
||||
'maximumFileSize' => 2000000, //2MB
|
||||
'allowedFileExtensions' => ['jpg', 'png', 'jfif'],
|
||||
'permissions' => [
|
||||
Permission::read(Role::any()),
|
||||
Permission::create(Role::any()),
|
||||
Permission::update(Role::any()),
|
||||
Permission::delete(Role::any()),
|
||||
],
|
||||
]);
|
||||
$this->assertEquals(201, $bucket['headers']['status-code']);
|
||||
$this->assertNotEmpty($bucket['body']['$id']);
|
||||
|
||||
$bucketId = $bucket['body']['$id'];
|
||||
|
||||
$file = $this->client->call(Client::METHOD_POST, '/storage/buckets/' . $bucketId . '/files', array_merge([
|
||||
'content-type' => 'multipart/form-data',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), [
|
||||
'fileId' => ID::unique(),
|
||||
'file' => new CURLFile(realpath(__DIR__ . '/../../../resources/logo.png'), 'image/png', 'logo.png'),
|
||||
'permissions' => [
|
||||
Permission::read(Role::any()),
|
||||
Permission::update(Role::any()),
|
||||
Permission::delete(Role::any()),
|
||||
],
|
||||
]);
|
||||
$this->assertEquals(201, $file['headers']['status-code']);
|
||||
$this->assertNotEmpty($file['body']['$id']);
|
||||
|
||||
$fileId = $file['body']['$id'];
|
||||
|
||||
$token = $this->client->call(Client::METHOD_POST, '/tokens/buckets/' . $bucketId . '/files/' . $fileId, array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id']
|
||||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals(201, $token['headers']['status-code']);
|
||||
$this->assertEquals('files', $token['body']['resourceType']);
|
||||
|
||||
return [
|
||||
'fileId' => $fileId,
|
||||
'bucketId' => $bucketId,
|
||||
'tokenId' => $token['body']['$id'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreateToken
|
||||
*/
|
||||
public function testUpdateToken(array $data): array
|
||||
{
|
||||
$tokenId = $data['tokenId'];
|
||||
|
||||
// Finite expiry
|
||||
$expiry = DateTime::addSeconds(new \DateTime(), 3600);
|
||||
$token = $this->client->call(Client::METHOD_PATCH, '/tokens/' . $tokenId, array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id']
|
||||
], $this->getHeaders()), [
|
||||
'expire' => $expiry,
|
||||
]);
|
||||
|
||||
$dateValidator = new DatetimeValidator();
|
||||
$this->assertTrue($dateValidator->isValid($token['body']['expire']));
|
||||
|
||||
// Infinite expiry
|
||||
$token = $this->client->call(Client::METHOD_PATCH, '/tokens/' . $tokenId, array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id']
|
||||
], $this->getHeaders()), [
|
||||
'expire' => null,
|
||||
]);
|
||||
|
||||
$this->assertEmpty($token['body']['expire']);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreateToken
|
||||
*/
|
||||
public function testListTokens(array $data): array
|
||||
{
|
||||
$res = $this->client->call(
|
||||
Client::METHOD_GET,
|
||||
'/tokens/buckets/' . $data['bucketId'] . '/files/' . $data['fileId'],
|
||||
array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id']
|
||||
], $this->getHeaders())
|
||||
);
|
||||
|
||||
$this->assertIsArray($res['body']);
|
||||
$this->assertEquals(200, $res['headers']['status-code']);
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testUpdateToken
|
||||
*/
|
||||
public function testDeleteToken(array $data): array
|
||||
{
|
||||
$tokenId = $data['tokenId'];
|
||||
|
||||
$res = $this->client->call(Client::METHOD_DELETE, '/tokens/' . $tokenId, array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id']
|
||||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals(204, $res['headers']['status-code']);
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,10 +85,11 @@ class TokensCustomServerTest extends Scope
|
||||
|
||||
// Finite expiry
|
||||
$expiry = DateTime::addSeconds(new \DateTime(), 3600);
|
||||
$token = $this->client->call(Client::METHOD_PATCH, '/tokens/' . $tokenId, array_merge([
|
||||
$token = $this->client->call(Client::METHOD_PATCH, '/tokens/' . $tokenId, [
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), [
|
||||
'x-appwrite-key' => $this->getProject()['apiKey'],
|
||||
], [
|
||||
'expire' => $expiry,
|
||||
]);
|
||||
|
||||
@@ -108,6 +109,26 @@ class TokensCustomServerTest extends Scope
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreateToken
|
||||
*/
|
||||
public function testListTokens(array $data): array
|
||||
{
|
||||
$res = $this->client->call(
|
||||
Client::METHOD_GET,
|
||||
'/tokens/buckets/' . $data['bucketId'] . '/files/' . $data['fileId'],
|
||||
[
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
'x-appwrite-key' => $this->getProject()['apiKey'],
|
||||
]
|
||||
);
|
||||
|
||||
$this->assertIsArray($res['body']);
|
||||
$this->assertEquals(200, $res['headers']['status-code']);
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testUpdateToken
|
||||
*/
|
||||
@@ -115,10 +136,11 @@ class TokensCustomServerTest extends Scope
|
||||
{
|
||||
$tokenId = $data['tokenId'];
|
||||
|
||||
$res = $this->client->call(Client::METHOD_DELETE, '/tokens/' . $tokenId, array_merge([
|
||||
$res = $this->client->call(Client::METHOD_DELETE, '/tokens/' . $tokenId, [
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()));
|
||||
'x-appwrite-key' => $this->getProject()['apiKey'],
|
||||
]);
|
||||
|
||||
$this->assertEquals(204, $res['headers']['status-code']);
|
||||
return $data;
|
||||
|
||||
Reference in New Issue
Block a user