Skip to content

Links as Attachments + Tags #519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Mar 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,4 +275,5 @@ docker exec -it tc-projects-kafka /opt/kafka/bin/kafka-console-producer.sh --bro

## References

- [Projects Service Architecture](./docs/guides/architercture/architecture.md)
- [Projects Service Architecture](./docs/guides/architercture/architecture.md)
- [Projects Service Architecture](./docs/guides/architercture/architecture.md)
1 change: 1 addition & 0 deletions config/test.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"logLevel": "debug",
"captureLogs": "false",
"logentriesToken": "",
"enableFileUpload": "false",
"elasticsearchConfig": {
"host": "http://localhost:9200",
"apiVersion": "6.8",
Expand Down
183 changes: 168 additions & 15 deletions docs/Project API.postman_collection.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"info": {
"_postman_id": "a0a9f1a7-84b1-45ad-a4c0-baa3552118cb",
"_postman_id": "c69ab4dd-8c6a-48c9-ba48-c6663b1a0c81",
"name": "Project API",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
Expand Down Expand Up @@ -248,7 +248,7 @@
"_postman_isSubFolder": true
},
{
"name": "Upload attachment",
"name": "Upload file attachment",
"event": [
{
"listen": "test",
Expand All @@ -257,7 +257,7 @@
"exec": [
"pm.test(\"Status code is 201\", function () {",
" pm.response.to.have.status(201);",
" pm.environment.set(\"attachmentId\", pm.response.json().id);",
" pm.environment.set(\"fileAttachmentId\", pm.response.json().id);",
"});"
],
"type": "text/javascript"
Expand All @@ -278,7 +278,7 @@
],
"body": {
"mode": "raw",
"raw": "{\n\t\t\"title\": \"first attachment submission\",\n\t\t\"filePath\": \"/home/phoenix/a.png\",\n\t\t\"s3Bucket\": \"topcoder-project-service\",\n\t\t\"contentType\": \"application/png\"\n\t}"
"raw": "{\n\t\"title\": \"first file attachment\",\n\t\"path\": \"/home/files/phoenix/a.png\",\n\t\"type\": \"file\",\n\t\"s3Bucket\": \"topcoder-project-service\",\n\t\"contentType\": \"application/png\",\n\t\"tags\": [\"design preview\"]\n}"
},
"url": {
"raw": "{{api-url}}/projects/{{projectId}}/attachments",
Expand All @@ -296,7 +296,55 @@
"response": []
},
{
"name": "Update attachment",
"name": "Create link as attachment",
"event": [
{
"listen": "test",
"script": {
"id": "6547ada6-53f5-4e2d-bda0-f0ec5bfbe38f",
"exec": [
"pm.test(\"Status code is 201\", function () {",
" pm.response.to.have.status(201);",
" pm.environment.set(\"linkAttachmentId\", pm.response.json().id);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{jwt-token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"title\": \"link attachment\",\n\t\"path\": \"https://connect.topcoder-dev.com/projects/8600/assets.zip\",\n\t\"type\": \"link\",\n\t\"tags\": [\"specification\", \"design preview\", \"billing information\"]\n}"
},
"url": {
"raw": "{{api-url}}/projects/{{projectId}}/attachments",
"host": [
"{{api-url}}"
],
"path": [
"projects",
"{{projectId}}",
"attachments"
]
},
"description": "Create an project attachment"
},
"response": []
},
{
"name": "Update file attachment",
"request": {
"method": "PATCH",
"header": [
Expand All @@ -311,28 +359,65 @@
],
"body": {
"mode": "raw",
"raw": "{\n\t\t\"title\": \"first attachment submission updated\",\n\t\t\"description\": \"updated project attachment\"\n\t}"
"raw": "{\n\t\t\"title\": \"first attachment submission updated\",\n\t\t\"description\": \"updated project attachment\",\n\t\t\"tags\": [\"anotherTag\"]\n\t}"
},
"url": {
"raw": "{{api-url}}/projects/{{projectId}}/attachments/{{attachmentId}}",
"raw": "{{api-url}}/projects/{{projectId}}/attachments/{{fileAttachmentId}}",
"host": [
"{{api-url}}"
],
"path": [
"projects",
"{{projectId}}",
"attachments",
"{{attachmentId}}"
"{{fileAttachmentId}}"
]
},
"description": "Update project attachment"
},
"response": []
},
{
"name": "Delete attachment",
"name": "Update link attachment",
"request": {
"method": "DELETE",
"method": "PATCH",
"header": [
{
"key": "Authorization",
"value": "Bearer {{jwt-token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\t\"title\": \"updated link title\",\n\t\t\"description\": \"updated link description\",\n\t\t\"tags\": [\"linkTag1\"]\n\t}"
},
"url": {
"raw": "{{api-url}}/projects/{{projectId}}/attachments/{{linkAttachmentId}}",
"host": [
"{{api-url}}"
],
"path": [
"projects",
"{{projectId}}",
"attachments",
"{{linkAttachmentId}}"
]
},
"description": "Update project attachment"
},
"response": []
},
{
"name": "Get file attachment",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
Expand All @@ -348,23 +433,23 @@
"raw": ""
},
"url": {
"raw": "{{api-url}}/projects/{{projectId}}/attachments/{{attachmentId}}",
"raw": "{{api-url}}/projects/{{projectId}}/attachments/{{fileAttachmentId}}",
"host": [
"{{api-url}}"
],
"path": [
"projects",
"{{projectId}}",
"attachments",
"{{attachmentId}}"
"{{fileAttachmentId}}"
]
},
"description": "Delete a project attachment"
},
"response": []
},
{
"name": "Download attachment",
"name": "Get link attachment",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
Expand All @@ -385,15 +470,15 @@
"raw": ""
},
"url": {
"raw": "{{api-url}}/projects/{{projectId}}/attachments/{{attachmentId}}",
"raw": "{{api-url}}/projects/{{projectId}}/attachments/{{linkAttachmentId}}",
"host": [
"{{api-url}}"
],
"path": [
"projects",
"{{projectId}}",
"attachments",
"{{attachmentId}}"
"{{linkAttachmentId}}"
]
},
"description": "Delete a project attachment"
Expand Down Expand Up @@ -435,6 +520,74 @@
"description": "Delete a project attachment"
},
"response": []
},
{
"name": "Delete link attachment",
"request": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{jwt-token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{api-url}}/projects/{{projectId}}/attachments/{{linkAttachmentId}}",
"host": [
"{{api-url}}"
],
"path": [
"projects",
"{{projectId}}",
"attachments",
"{{linkAttachmentId}}"
]
},
"description": "Delete a project attachment"
},
"response": []
},
{
"name": "Delete file attachment",
"request": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{jwt-token}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{api-url}}/projects/{{projectId}}/attachments/{{fileAttachmentId}}",
"host": [
"{{api-url}}"
],
"path": [
"projects",
"{{projectId}}",
"attachments",
"{{fileAttachmentId}}"
]
},
"description": "Delete a project attachment"
},
"response": []
}
],
"protocolProfileBehavior": {}
Expand Down
Loading