mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
chore: update specs and tests
This commit is contained in:
@@ -20352,7 +20352,7 @@
|
||||
],
|
||||
"description": "",
|
||||
"responses": {
|
||||
"201": {
|
||||
"200": {
|
||||
"description": "Dev Keys List",
|
||||
"content": {
|
||||
"application\/json": {
|
||||
@@ -20398,6 +20398,27 @@
|
||||
"x-example": "<PROJECT_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). Only supported methods are limit, offset and cursor",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"default": []
|
||||
},
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"name": "search",
|
||||
"description": "Search term to filter your list results. Max length: 256 chars.",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"x-example": "<SEARCH>",
|
||||
"default": ""
|
||||
},
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -20560,7 +20581,7 @@
|
||||
],
|
||||
"description": "",
|
||||
"responses": {
|
||||
"201": {
|
||||
"200": {
|
||||
"description": "DevKey",
|
||||
"content": {
|
||||
"application\/json": {
|
||||
@@ -20652,8 +20673,8 @@
|
||||
],
|
||||
"description": "",
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "File"
|
||||
"204": {
|
||||
"description": "No content"
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
@@ -31497,13 +31518,13 @@
|
||||
"properties": {
|
||||
"total": {
|
||||
"type": "integer",
|
||||
"description": "Total number of keys documents that matched your query.",
|
||||
"description": "Total number of devKeys documents that matched your query.",
|
||||
"x-example": 5,
|
||||
"format": "int32"
|
||||
},
|
||||
"keys": {
|
||||
"devKeys": {
|
||||
"type": "array",
|
||||
"description": "List of keys.",
|
||||
"description": "List of devKeys.",
|
||||
"items": {
|
||||
"$ref": "#\/components\/schemas\/devKey"
|
||||
},
|
||||
@@ -31512,7 +31533,7 @@
|
||||
},
|
||||
"required": [
|
||||
"total",
|
||||
"keys"
|
||||
"devKeys"
|
||||
]
|
||||
},
|
||||
"platformList": {
|
||||
@@ -35626,7 +35647,7 @@
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "Key name.",
|
||||
"x-example": "My API Key"
|
||||
"x-example": "Dev API Key"
|
||||
},
|
||||
"expire": {
|
||||
"type": "string",
|
||||
|
||||
@@ -20833,7 +20833,7 @@
|
||||
],
|
||||
"description": "",
|
||||
"responses": {
|
||||
"201": {
|
||||
"200": {
|
||||
"description": "Dev Keys List",
|
||||
"schema": {
|
||||
"$ref": "#\/definitions\/devKeyList"
|
||||
@@ -20873,6 +20873,27 @@
|
||||
"type": "string",
|
||||
"x-example": "<PROJECT_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). Only supported methods are limit, offset and cursor",
|
||||
"required": false,
|
||||
"type": "array",
|
||||
"collectionFormat": "multi",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"default": [],
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"name": "search",
|
||||
"description": "Search term to filter your list results. Max length: 256 chars.",
|
||||
"required": false,
|
||||
"type": "string",
|
||||
"x-example": "<SEARCH>",
|
||||
"default": "",
|
||||
"in": "query"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -21039,7 +21060,7 @@
|
||||
],
|
||||
"description": "",
|
||||
"responses": {
|
||||
"201": {
|
||||
"200": {
|
||||
"description": "DevKey",
|
||||
"schema": {
|
||||
"$ref": "#\/definitions\/devKey"
|
||||
@@ -21127,11 +21148,8 @@
|
||||
],
|
||||
"description": "",
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "File",
|
||||
"schema": {
|
||||
"type": "file"
|
||||
}
|
||||
"204": {
|
||||
"description": "No content"
|
||||
}
|
||||
},
|
||||
"x-appwrite": {
|
||||
@@ -31999,13 +32017,13 @@
|
||||
"properties": {
|
||||
"total": {
|
||||
"type": "integer",
|
||||
"description": "Total number of keys documents that matched your query.",
|
||||
"description": "Total number of devKeys documents that matched your query.",
|
||||
"x-example": 5,
|
||||
"format": "int32"
|
||||
},
|
||||
"keys": {
|
||||
"devKeys": {
|
||||
"type": "array",
|
||||
"description": "List of keys.",
|
||||
"description": "List of devKeys.",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#\/definitions\/devKey"
|
||||
@@ -32015,7 +32033,7 @@
|
||||
},
|
||||
"required": [
|
||||
"total",
|
||||
"keys"
|
||||
"devKeys"
|
||||
]
|
||||
},
|
||||
"platformList": {
|
||||
@@ -36161,7 +36179,7 @@
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "Key name.",
|
||||
"x-example": "My API Key"
|
||||
"x-example": "Dev API Key"
|
||||
},
|
||||
"expire": {
|
||||
"type": "string",
|
||||
|
||||
@@ -119,6 +119,17 @@ trait ProjectsDevKeys
|
||||
$this->assertEquals(1, $response['body']['total']);
|
||||
$this->assertEquals('Dev Key Test', $response['body']['devKeys'][0]['name']);
|
||||
|
||||
/** List dev keys with querying `expire` */
|
||||
$response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/dev-keys', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), [
|
||||
'queries' => [Query::lessThan('expire', (new \DateTime())->format('Y-m-d H:i:s'))->toString()]
|
||||
]);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertEquals(0, $response['body']['total']); // No dev keys expired
|
||||
|
||||
/**
|
||||
* Test for FAILURE
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user