mirror of
https://github.com/appwrite/appwrite
synced 2026-05-15 04:59:01 +00:00
chore: update descriptions for token endpoints
This commit is contained in:
parent
c269fc22ed
commit
d1502bc7d6
9 changed files with 32 additions and 12 deletions
|
|
@ -47,7 +47,9 @@ class Create extends Action
|
|||
->label('sdk', new Method(
|
||||
namespace: 'tokens',
|
||||
name: 'createFileToken',
|
||||
description: '',
|
||||
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.
|
||||
EOT,
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
|
|
|
|||
|
|
@ -37,7 +37,9 @@ class XList extends Action
|
|||
->label('sdk', new Method(
|
||||
namespace: 'tokens',
|
||||
name: 'list',
|
||||
description: '',
|
||||
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],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
|
|
|
|||
|
|
@ -41,7 +41,9 @@ class Delete extends Action
|
|||
->label('sdk', new Method(
|
||||
namespace: 'tokens',
|
||||
name: 'delete',
|
||||
description: '',
|
||||
description: <<<EOT
|
||||
Delete a token by its unique ID.
|
||||
EOT,
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
|
|
|
|||
|
|
@ -34,7 +34,9 @@ class Get extends Action
|
|||
->label('sdk', new Method(
|
||||
namespace: 'tokens',
|
||||
name: 'get',
|
||||
description: '',
|
||||
description: <<<EOT
|
||||
Get a token by its unique ID.
|
||||
EOT,
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
|
|
|
|||
|
|
@ -37,7 +37,9 @@ class Get extends Action
|
|||
->label('sdk', new Method(
|
||||
namespace: 'tokens',
|
||||
name: 'getJWT',
|
||||
description: '',
|
||||
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(
|
||||
|
|
|
|||
|
|
@ -48,7 +48,9 @@ class Update extends Action
|
|||
->label('sdk', new Method(
|
||||
namespace: 'tokens',
|
||||
name: 'update',
|
||||
description: '',
|
||||
description: <<<EOT
|
||||
Update a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.
|
||||
EOT,
|
||||
auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
|
|
|
|||
|
|
@ -87,11 +87,13 @@ class Method
|
|||
return;
|
||||
}
|
||||
|
||||
$descPath = $this->getDescriptionFilePath();
|
||||
if (\str_ends_with($desc, '.md')) {
|
||||
$descPath = $this->getDescriptionFilePath();
|
||||
|
||||
if (empty($descPath)) {
|
||||
self::$errors[] = "Error with {$this->getRouteName()} method: Description file not found at {$desc}";
|
||||
return;
|
||||
if (empty($descPath)) {
|
||||
self::$errors[] = "Error with {$this->getRouteName()} method: Description file not found at {$desc}";
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -177,11 +177,14 @@ class OpenAPI3 extends Format
|
|||
|
||||
$namespace = $sdk->getNamespace() ?? 'default';
|
||||
|
||||
$desc = $desc ?? '';
|
||||
$descContents = \str_ends_with($desc, '.md') ? \file_get_contents($desc) : $desc;
|
||||
|
||||
$temp = [
|
||||
'summary' => $route->getDesc(),
|
||||
'operationId' => $namespace . ucfirst($method),
|
||||
'tags' => [$namespace],
|
||||
'description' => ($desc) ? \file_get_contents($desc) : '',
|
||||
'description' => $descContents,
|
||||
'responses' => [],
|
||||
'x-appwrite' => [ // Appwrite related metadata
|
||||
'method' => $method,
|
||||
|
|
|
|||
|
|
@ -173,13 +173,16 @@ class Swagger2 extends Format
|
|||
|
||||
$namespace = $sdk->getNamespace() ?? 'default';
|
||||
|
||||
$desc = $desc ?? '';
|
||||
$descContents = \str_ends_with($desc, '.md') ? \file_get_contents($desc) : $desc;
|
||||
|
||||
$temp = [
|
||||
'summary' => $route->getDesc(),
|
||||
'operationId' => $namespace . ucfirst($method),
|
||||
'consumes' => [],
|
||||
'produces' => [],
|
||||
'tags' => [$namespace],
|
||||
'description' => ($desc) ? \file_get_contents($desc) : '',
|
||||
'description' => $descContents,
|
||||
'responses' => [],
|
||||
'x-appwrite' => [ // Appwrite related metadata
|
||||
'method' => $method,
|
||||
|
|
|
|||
Loading…
Reference in a new issue