Skip to content

Commit 082b7c1

Browse files
authored
Merge pull request #1396 from nextcloud/docs/enhance
2 parents b32b8a6 + 7462a85 commit 082b7c1

4 files changed

Lines changed: 69 additions & 15 deletions

File tree

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55

66
Deck is a kanban style organization tool aimed at personal planning and project organization for teams integrated with Nextcloud.
77

8-
- :inbox_tray: Add your tasks to cards and put them in order
9-
- :page_facing_up: Write down additional notes in markdown
10-
- :bookmark: Assign labels for even better organization
11-
- :busts_in_silhouette: Share with your team, friends or family
12-
- :family: Integrates with the [Circles](https://github.com/nextcloud/circles) app!
13-
- :paperclip: Attach files and embed them in your markdown description
14-
- :speech_balloon: Discuss with your team using comments
15-
- :zap: Keep track of changes in the activity stream
16-
- :rocket: Get your project organized
8+
- Add your tasks to cards and put them in order
9+
- Write down additional notes in markdown
10+
- Assign labels for even better organization
11+
- Share with your team, friends or family
12+
- Integrates with the [Circles](https://github.com/nextcloud/circles) app!
13+
- Attach files and embed them in your markdown description
14+
- Discuss with your team using comments
15+
- Keep track of changes in the activity stream
16+
- Get your project organized
1717

1818
### Mobile apps
1919

docs/API-Nextcloud.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
# Nextcloud APIs
22

3+
## Capabilities
4+
5+
The [Nextcloud Capabilities API](https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-api-overview.html#capabilities-api) provides the following information for the Deck app:
6+
7+
- `version` Current version of the Deck app running
8+
- `canCreateBoards` Ability of the current user to create new boards for themselves
9+
10+
```
11+
{
12+
"ocs": {
13+
"meta": {
14+
"status": "ok",
15+
"statuscode": 200,
16+
"message": "OK"
17+
},
18+
"data": {
19+
"capabilities": {
20+
"deck": {
21+
"version": "0.8.0",
22+
"canCreateBoards": true
23+
},
24+
}
25+
}
26+
}
27+
}
28+
```
29+
30+
31+
332
## Available sharees
433

534
When sharing a board to a user, group or circle, the possible sharees can be obtained though the files_sharing API.

docs/API.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ The REST API provides access for authenticated users to their data inside the De
55

66
- All requests require a `OCS-APIRequest` HTTP header to be set to `true` and a `Content-Type` of `application/json`.
77
- The API is located at https://nextcloud.local/index.php/apps/deck/api/v1.0
8+
- All request parameters are required, unless otherwise specified
89

910
## Naming
1011

@@ -20,7 +21,7 @@ The REST API provides access for authenticated users to their data inside the De
2021

2122
### 400 Bad request
2223

23-
In case the request is invalid, e.g. because a parameter is missing, a 400 error will be returned:
24+
In case the request is invalid, e.g. because a parameter is missing or an invalid value has been transmitted, a 400 error will be returned:
2425

2526
```json
2627
{
@@ -40,6 +41,12 @@ In any case a user doesn't have access to a requested entity, a 403 error will b
4041
}
4142
```
4243

44+
## Formats
45+
46+
### Date
47+
48+
Datetime values in request data need to be provided in ISO-8601. Example: 2020-01-20T09:52:43+00:00
49+
4350
## Headers
4451

4552
### If-Modified-Since
@@ -51,7 +58,7 @@ The supported date formats are:
5158
* (obsolete) RFC 850: `Sunday, 03-Aug-19 10:34:12 GMT`
5259
* (obsolete) ANSI C asctime(): `Sun Aug 3 10:34:12 2019`
5360

54-
It is highly recommended to only use the IMF-fixdate format.
61+
It is highly recommended to only use the IMF-fixdate format. Note that according to [RFC2616](https://tools.ietf.org/html/rfc2616#section-3.3) all HTTP date/time stamps MUST be represented in Greenwich Mean Time (GMT), without exception.
5562

5663
Example curl request:
5764

@@ -197,6 +204,10 @@ Returns an array of board items
197204
}
198205
```
199206

207+
##### 403 Forbidden
208+
209+
A 403 response might be returned if the users ability to create new boards has been disabled by the administrator. For checking this before, see the `canCreateBoards` value in the [Nextcloud capabilties](./API-Nextcloud.md).
210+
200211
### GET /boards/{boardId} - Get board details
201212

202213
#### Request parameters
@@ -548,7 +559,7 @@ The board list endpoint supports setting an `If-Modified-Since` header to limit
548559
"owner":"admin",
549560
"order":999,
550561
"archived":false,
551-
"duedate":null,
562+
"duedate": "2019-12-24T19:29:30+00:00",
552563
"deletedAt":0,
553564
"commentsUnread":0,
554565
"id":10,
@@ -576,7 +587,7 @@ The board list endpoint supports setting an `If-Modified-Since` header to limit
576587
| description | String | The markdown description of the card |
577588
| type | String | Type of the card (for later use) use 'plain' for now |
578589
| order | Integer | Order for sorting the stacks |
579-
| duedate | timestamp | The duedate of the card or null |
590+
| duedate | timestamp | The ISO-8601 formatted duedate of the card or null |
580591

581592

582593
```
@@ -585,7 +596,7 @@ The board list endpoint supports setting an `If-Modified-Since` header to limit
585596
"description": "A card description",
586597
"type": "plain",
587598
"order": 999,
588-
"duedate": null,
599+
"duedate": "2019-12-24T19:29:30+00:00",
589600
}
590601
```
591602

lib/Capabilities.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,23 @@
2323

2424
namespace OCA\Deck;
2525

26+
use OCA\Deck\Service\PermissionService;
27+
use OCP\App\IAppManager;
2628
use OCP\Capabilities\ICapability;
2729

2830
class Capabilities implements ICapability {
2931

32+
/** @var IAppManager */
33+
private $appManager;
34+
/** @var PermissionService */
35+
private $permissionService;
36+
37+
38+
public function __construct(IAppManager $appManager, PermissionService $permissionService) {
39+
$this->appManager = $appManager;
40+
$this->permissionService = $permissionService;
41+
}
42+
3043
/**
3144
* Function an app uses to return the capabilities
3245
*
@@ -36,7 +49,8 @@ class Capabilities implements ICapability {
3649
public function getCapabilities() {
3750
return [
3851
'deck' => [
39-
'version' => \OC::$server->getAppManager()->getAppVersion('deck')
52+
'version' => $this->appManager->getAppVersion('deck'),
53+
'canCreateBoards' => $this->permissionService->canCreate()
4054
]
4155
];
4256
}

0 commit comments

Comments
 (0)