-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #122 from ember-nexus/github-issue/49
GitHub issue/49
- Loading branch information
Showing
60 changed files
with
933 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,6 @@ | |
"default": true, | ||
"MD013": false, | ||
"MD033": false, | ||
"MD038": false, | ||
"MD041": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
# <span class="method-delete">DELETE</span>` /<uuid> -` Delete Element | ||
|
||
<!-- panels:start --> | ||
<!-- div:left-panel --> | ||
|
||
Deletes a single element. If the deleted element is a node, all connected relationships are deleted. | ||
|
||
!> **Note**: In order to avoid orphaned nodes, children need to be deleted first or get other parents added. | ||
This behaviour might be changed, see issue [#64: HTTP DELETE /<uuid> - DeleteElementController](https://github.com/ember-nexus/api/issues/64). | ||
|
||
## Request Example | ||
|
||
```bash | ||
curl \ | ||
-X DELETE | ||
-H "Authorization: Bearer secret-token:PIPeJGUt7c00ENn8a5uDlc" \ | ||
https://api.localhost/2f99440e-ca4c-4e83-bf86-1cd27a4b1b70 | ||
``` | ||
|
||
<!-- tabs:start --> | ||
|
||
### **Success 204** | ||
|
||
The element is now deleted. No content is returned. | ||
|
||
### **Error 401** | ||
|
||
This error can only be thrown, if the token is invalid or if there is no default anonymous user. | ||
|
||
```problem+json | ||
{ | ||
"type": "Invalid authorization token", | ||
"title": "Unauthorized", | ||
"status": "401", | ||
"detail": "Request requires authorization." | ||
} | ||
``` | ||
|
||
### **Error 404** | ||
|
||
Error 404 is thrown if the element to be deleted does not exist, or if the use does not have permissions to delete the | ||
element. | ||
|
||
```problem+json | ||
{ | ||
"type": "Invalid authorization token", | ||
"title": "wip", | ||
"status": "404", | ||
"detail": "wip" | ||
} | ||
``` | ||
|
||
### **Error 429** | ||
|
||
```problem+json | ||
{ | ||
"type": "429-too-many-requests", | ||
"title": "Too Many Requests", | ||
"status": "429", | ||
"detail": "The client sent too many requests in a given timeframe; rate limiting is active." | ||
} | ||
``` | ||
|
||
<!-- tabs:end --> | ||
|
||
<!-- div:right-panel --> | ||
|
||
## Internal Workflow | ||
|
||
Once the server receives such a request, it checks several things internally: | ||
|
||
<div id="graph-container-1" class="graph-container" style="height:1200px"></div> | ||
|
||
<!-- panels:end --> | ||
|
||
<script> | ||
G6.registerEdge('polyline-edge', { | ||
draw(cfg, group) { | ||
const { startPoint, endPoint } = cfg; | ||
const hgap = Math.abs(endPoint.x - startPoint.x); | ||
|
||
const path = [ | ||
['M', startPoint.x, startPoint.y], | ||
[ | ||
'C', | ||
startPoint.x + hgap / 4, | ||
startPoint.y, | ||
endPoint.x - hgap / 2, | ||
endPoint.y, | ||
endPoint.x, | ||
endPoint.y, | ||
], | ||
]; | ||
const shape = group.addShape('path', { | ||
attrs: { | ||
stroke: '#AAB7C4', | ||
path, | ||
}, | ||
name: 'path-shape', | ||
}); | ||
const midPoint = { | ||
x: (startPoint.x + endPoint.x) / 2, | ||
y: (startPoint.y + endPoint.y) / 2, | ||
}; | ||
const label = group.addShape('text', { | ||
attrs: { | ||
text: cfg.label + '###########', | ||
x: midPoint.x, | ||
y: midPoint.y, | ||
textAlign: 'center', | ||
textBaseline: 'middle', | ||
fill: '#000', | ||
fontSize: 14, | ||
}, | ||
name: 'label-shape', | ||
}); | ||
return shape; | ||
}, | ||
}); | ||
renderWorkflow(document.getElementById('graph-container-1'), { | ||
nodes: [ | ||
{ id: 'init', ...workflowStart, label: 'server receives DELETE-request' }, | ||
{ id: 'checkToken', ...workflowDecision, label: 'does request contain token?' }, | ||
{ id: 'noTokenAction', ...workflowStep, label: "use default anonymous\nuser for auth" }, | ||
{ id: 'checkTokenValidity', ...workflowDecision, label: 'is token valid?' }, | ||
{ id: 'checkRateLimit', ...workflowDecision, label: "does request exceed\nrate limit?" }, | ||
{ id: 'checkExistence', ...workflowDecision, label: 'does element exist?' }, | ||
{ id: 'checkAccess', ...workflowDecision, label: 'has user permission\nto delete element?' }, | ||
{ id: 'deleteElement', ...workflowStep, label: 'delete element' }, | ||
{ id: 'error401', ...workflowEndError, label: "return 401" }, | ||
{ id: 'error404', ...workflowEndError, label: "return 404" }, | ||
{ id: 'error429', ...workflowEndError, label: 'return 429' }, | ||
{ id: 'success204', ...workflowEndSuccess , label: "return 204"}, | ||
], | ||
edges: [ | ||
{ source: 'init', target: 'checkToken', label: '' }, | ||
{ source: 'checkToken', target: 'checkTokenValidity', label: 'yes' }, | ||
{ source: 'checkToken', target: 'noTokenAction', label: 'no' }, | ||
{ source: 'checkTokenValidity', target: 'checkRateLimit', label: 'yes' }, | ||
{ source: 'checkTokenValidity', target: 'error401', label: 'no' }, | ||
{ source: 'checkRateLimit', target: 'checkExistence', label: 'no' }, | ||
{ source: 'checkRateLimit', target: 'error429', label: 'yes' }, | ||
{ source: 'checkExistence', target: 'checkAccess', label: 'yes' }, | ||
{ source: 'checkExistence', target: 'error404', label: 'no' }, | ||
{ source: 'checkAccess', target: 'deleteElement', label: 'yes' }, | ||
{ source: 'checkAccess', target: 'error404', label: 'no' }, | ||
{ source: 'deleteElement', target: 'success204' }, | ||
{ source: 'noTokenAction', target: 'checkRateLimit', label: '', type2: 'polyline-edge' } | ||
], | ||
}, 'TB'); | ||
</script> |
2 changes: 1 addition & 1 deletion
2
docs/api-endpoints/get-children.md → docs/api-endpoints/element/get-children.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
docs/api-endpoints/get-element.md → docs/api-endpoints/element/get-element.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
docs/api-endpoints/get-index.md → docs/api-endpoints/element/get-index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
docs/api-endpoints/get-parents.md → docs/api-endpoints/element/get-parents.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
docs/api-endpoints/get-related.md → docs/api-endpoints/element/get-related.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
docs/api-endpoints/patch-element.md → docs/api-endpoints/element/patch-element.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# <span class="method-post">POST</span>` /<uuid> -` Create Element | ||
|
||
Creates a new data element. It is owned by the referenced node. |
2 changes: 1 addition & 1 deletion
2
docs/api-endpoints/post-index.md → docs/api-endpoints/element/post-index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# POST / - Create Root Element | ||
# <span class="method-post">POST</span>` / -` Create Root Element | ||
|
||
Creates a new data element. If the data element is a node, it is directly owned by the current user. |
2 changes: 1 addition & 1 deletion
2
docs/api-endpoints/put-element.md → docs/api-endpoints/element/put-element.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# <span class="method-get">GET</span>` /error/400/bad-content` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# <span class="method-get">GET</span>` /error/400/forbidden-property` |
1 change: 1 addition & 0 deletions
1
docs/api-endpoints/error/get-400-incomplete-mutual-dependency.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# <span class="method-get">GET</span>` /error/400/incomplete-mutual-dependency` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# <span class="method-get">GET</span>` /error/400/missing-property` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# <span class="method-delete">🚧 DELETE</span>` /<uuid>/file -` Delete Element File | ||
|
||
!> **Currently not implemented.** | ||
This feature is reserved for the version [0.2.0](https://github.com/ember-nexus/api/milestone/1). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# <span class="method-get">🚧 GET</span>` /<uuid>/file -` Get Element File | ||
|
||
!> **Currently not implemented.** | ||
This feature is reserved for the version [0.2.0](https://github.com/ember-nexus/api/milestone/1). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# <span class="method-patch">🚧 PATCH</span>` /<uuid>/file -` Update Element File | ||
|
||
!> **Currently not implemented.** | ||
This feature is reserved for the version [0.2.0](https://github.com/ember-nexus/api/milestone/1). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# <span class="method-post">🚧 POST</span>` /<uuid>/file -` Create Element File | ||
|
||
!> **Currently not implemented.** | ||
This feature is reserved for the version [0.2.0](https://github.com/ember-nexus/api/milestone/1). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# <span class="method-put">🚧 PUT</span>` /<uuid>/file -` Replace Element File | ||
|
||
!> **Currently not implemented.** | ||
This feature is reserved for the version [0.2.0](https://github.com/ember-nexus/api/milestone/1). |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
5 changes: 4 additions & 1 deletion
5
docs/api-endpoints/post-search.md → docs/api-endpoints/search/post-search.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...i-endpoints/get-instance-configuration.md → ...ints/system/get-instance-configuration.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# <span class="method-delete">DELETE</span>` /token -` Delete Token | ||
|
||
Deletes the currently used token. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# <span class="method-get">GET</span>` /token -` Get Token | ||
|
||
Returns the currently used token. | ||
|
||
To display all tokens, you can return all root elements and filter for the `Token` type. | ||
|
||
Currently under development. |
Oops, something went wrong.