From cae8816a7832f176e519cfd8b067bcaf68db7ee0 Mon Sep 17 00:00:00 2001 From: shahryar tavakkoli Date: Sat, 2 Apr 2022 22:40:53 +0430 Subject: [PATCH 1/3] fix urls of api to check user acl --- apps/mishka_user/lib/acl/action.ex | 46 +++++++++++++++--------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/apps/mishka_user/lib/acl/action.ex b/apps/mishka_user/lib/acl/action.ex index 1843cdda..6f3e298d 100644 --- a/apps/mishka_user/lib/acl/action.ex +++ b/apps/mishka_user/lib/acl/action.ex @@ -32,29 +32,29 @@ defmodule MishkaUser.Acl.Action do def actions(:api) do %{ - "api/content/v1/editor-posts/" => "blog:edit", - "api/content/v1/editor-post/" => "blog:edit", - "api/content/v1/editor-categories/" => "blog:edit", - "api/content/v1/editor-comment/" => "blog:edit", - "api/content/v1/editor-comments/" => "blog:edit", - "api/content/v1/category/" => "blog:edit", - "api/content/v1/edit-comment/" => "blog:edit", - "api/content/v1/delete-comment/" => "blog:edit", - "api/content/v1/destroy-comment/" => "admin:edit", - "api/content/v1/create-tag/" => "admin:edit", - "api/content/v1/edit-tag/" => "admin:edit", - "api/content/v1/delete-tag/" => "admin:edit", - "api/content/v1/add-tag-to-post/" => "blog:edit", - "api/content/v1/remove-post-tag/" => "blog:edit", - "api/content/v1/editor-tag-posts/" => "blog:edit", - "api/content/v1/create-blog-link/" => "blog:edit", - "api/content/v1/edit-blog-link/" => "blog:edit", - "api/content/v1/delete-blog-link/" => "blog:edit", - "api/content/v1/editor-links/" => "blog:edit", - "api/content/v1/editor-notifs/" => "blog:edit", - "api/content/v1/send-notif/" => "*", - "api/content/v1/create-author/" => "blog:edit", - "api/content/v1/delete-author/" => "blog:edit", + "api/content/v1/editor-posts" => "blog:edit", + "api/content/v1/editor-post" => "blog:edit", + "api/content/v1/editor-categories" => "blog:edit", + "api/content/v1/editor-comment" => "blog:edit", + "api/content/v1/editor-comments" => "blog:edit", + "api/content/v1/category" => "blog:edit", + "api/content/v1/edit-comment" => "blog:edit", + "api/content/v1/delete-comment" => "blog:edit", + "api/content/v1/destroy-comment" => "admin:edit", + "api/content/v1/create-tag" => "admin:edit", + "api/content/v1/edit-tag" => "admin:edit", + "api/content/v1/delete-tag" => "admin:edit", + "api/content/v1/add-tag-to-post" => "blog:edit", + "api/content/v1/remove-post-tag" => "blog:edit", + "api/content/v1/editor-tag-posts" => "blog:edit", + "api/content/v1/create-blog-link" => "blog:edit", + "api/content/v1/edit-blog-link" => "blog:edit", + "api/content/v1/delete-blog-link" => "blog:edit", + "api/content/v1/editor-links" => "blog:edit", + "api/content/v1/editor-notifs" => "blog:edit", + "api/content/v1/send-notif" => "*", + "api/content/v1/create-author" => "blog:edit", + "api/content/v1/delete-author" => "blog:edit", "api/content/v1/create-category/" => "admin:edit", From f44237e678d82b7f493ff9d007518f79590ef59e Mon Sep 17 00:00:00 2001 From: shahryar tavakkoli Date: Sun, 3 Apr 2022 00:05:41 +0430 Subject: [PATCH 2/3] add handle info to update post activity and update the page --- .../lib/mishka_html_web/live/home_live.ex | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/apps/mishka_html/lib/mishka_html_web/live/home_live.ex b/apps/mishka_html/lib/mishka_html_web/live/home_live.ex index a0137e65..9aa4334b 100644 --- a/apps/mishka_html/lib/mishka_html_web/live/home_live.ex +++ b/apps/mishka_html/lib/mishka_html_web/live/home_live.ex @@ -10,6 +10,10 @@ defmodule MishkaHtmlWeb.HomeLive do @impl true def mount(_params, session, socket) do + if connected?(socket) do + subscribe() + Post.subscribe() + end Process.send_after(self(), :menu, 100) socket = assign(socket, @@ -34,11 +38,26 @@ defmodule MishkaHtmlWeb.HomeLive do {:noreply, socket} end + @impl true + def handle_info({:post, :ok, _repo_record}, socket) do + {:noreply, update_post_temporary_assigns(socket, socket.assigns.page, socket.assigns.filters, socket.assigns.user_id)} + end + @impl true def handle_info(_params, socket) do {:noreply, socket} end + defp update_post_temporary_assigns(socket, page, _filters, user_id) do + update(socket, :posts, fn _posts -> + Post.posts(conditions: {page, socket.assigns.page_size}, filters: %{}, user_id: user_id) + end) + end + + def subscribe do + Phoenix.PubSub.subscribe(MishkaHtml.PubSub, "client_home") + end + defp seo_tags(socket) do site_link = MishkaHtmlWeb.Router.Helpers.url(socket) %{ From dd16a23a6c0669375374861dd307094e52f7200b Mon Sep 17 00:00:00 2001 From: shahryar tavakkoli Date: Mon, 4 Apr 2022 13:05:10 +0430 Subject: [PATCH 3/3] add some basic router of content --- .../postman/v1/mishkacms-api.json | 1002 +++++++++++++++-- 1 file changed, 927 insertions(+), 75 deletions(-) diff --git a/integration_test/postman/v1/mishkacms-api.json b/integration_test/postman/v1/mishkacms-api.json index d2009781..4c968d21 100644 --- a/integration_test/postman/v1/mishkacms-api.json +++ b/integration_test/postman/v1/mishkacms-api.json @@ -145,7 +145,7 @@ "formdata": [ { "key": "email", - "value": "{{testMail}}", + "value": "{{testMailAddress}}", "type": "text" }, { @@ -856,82 +856,934 @@ } } ] - } - ], - "description": "This folder contains `API` for external software and includes almost all the developed sections. This section uses Token in most “endpoints” to connect, and data send and receive are based on JSON.", - "auth": { - "type": "noauth" - }, - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ], - "variable": [ - { - "key": "baseUrl", - "value": "localhost:4001/api" - }, - { - "key": "testMailAddress", - "value": "testmail@test.com" - }, - { - "key": "testPassword", - "value": "TestUserPassword123" - }, - { - "key": "testUsername", - "value": "testUser" - }, - { - "key": "testFullName", - "value": "testName" - }, - { - "key": "accessToken", - "value": "" - }, - { - "key": "refreshToken", - "value": "" + "name": "Content", + "item": [ + { + "name": "Create Category", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + " var jsonData = pm.response.json();", + " pm.collectionVariables.set(\"categoryID\", jsonData.category_info.id);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{accessToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "warning": "This is a duplicate header and will be overridden by the Content-Type header generated by Postman.", + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "title", + "value": "Category test", + "type": "text" + }, + { + "key": "short_description", + "value": "This is a test text for a Category API", + "type": "text" + }, + { + "key": "main_image", + "value": "../test.png", + "type": "text" + }, + { + "key": "header_image", + "value": "../test.png", + "type": "text" + }, + { + "key": "description", + "value": "This is a test text for a Category API", + "type": "text" + }, + { + "key": "alias_link", + "value": "test-category", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/content/v1/create-category", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "create-category" + ] + }, + "description": "The first step of publishing a post is category creation, hence you need to be authorized. The action of this part is `blog:edit`\n\n* Needs ACL\n* Needs access token" + }, + "response": [] + }, + { + "name": "Edit category", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{accessToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "warning": "This is a duplicate header and will be overridden by the Content-Type header generated by Postman.", + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "category_id", + "value": "{{categoryID}}", + "type": "text" + }, + { + "key": "title", + "value": "Category test edit", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/content/v1/edit-category", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "edit-category" + ] + }, + "description": "After creating a category, this endpoint helps you to edit this every time, but you need to be authorized. The action of this part is \\`blog:edit\\`\n\n* Needs ACL\n* Needs access token" + }, + "response": [] + }, + { + "name": "Delete Category", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{accessToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "warning": "This is a duplicate header and will be overridden by the Content-Type header generated by Postman.", + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "category_id", + "value": "{{categoryID}}", + "type": "text" + }, + { + "key": "title", + "value": "test2", + "type": "text", + "disabled": true + } + ] + }, + "url": { + "raw": "{{baseUrl}}/content/v1/delete-category", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "delete-category" + ] + }, + "description": "After creating a category, this endpoint helps you to change status of a post to `soft_delete` this every time, but you need to be authorized. The action of this part is `blog:edit` \nit does not delete your post from database.\n\n* Needs ACL\n* Needs access token" + }, + "response": [] + }, + { + "name": "Destroy Category", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{accessToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "warning": "This is a duplicate header and will be overridden by the Content-Type header generated by Postman.", + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "category_id", + "value": "{{categoryID}}", + "type": "text" + }, + { + "key": "title", + "value": "test2", + "type": "text", + "disabled": true + } + ] + }, + "url": { + "raw": "{{baseUrl}}/content/v1/destroy-category", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "destroy-category" + ] + }, + "description": "After creating a category, this endpoint helps you to delete a post every time you want, but you need to be authorized. The action of this part is `blog:edit` \nit deletes your post from database and you cannot undo.\n\n* Needs ACL\n* Needs access token" + }, + "response": [] + }, + { + "name": "Category", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{accessToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "warning": "This is a duplicate header and will be overridden by the Content-Type header generated by Postman.", + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "category_id", + "value": "{{categoryID}}", + "type": "text" + }, + { + "key": "alias_link", + "value": "trahi-sakhte-rahbordi4", + "type": "text", + "disabled": true + } + ] + }, + "url": { + "raw": "{{baseUrl}}/content/v1/category", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "category" + ] + }, + "description": "This endpoint helps you to a category and it's information of the `cms`.\n\n* Does not need any ACL\n* Needs access token" + }, + "response": [] + }, + { + "name": "Categories", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{accessToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"filters\": {\n \"status\": \"active\",\n \"show_location\": true\n }\n}" + }, + "url": { + "raw": "{{baseUrl}}/content/v1/categories", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "categories" + ] + }, + "description": "This endpoint helps you to show all categories and their information of the `cms`.\n\n* Does not need any ACL\n* Needs access token" + }, + "response": [] + }, + { + "name": "Create Post", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + " var jsonData = pm.response.json();", + " pm.collectionVariables.set(\"postID\", jsonData.post_info.id);", + " pm.collectionVariables.set(\"postAliasLink\", jsonData.post_info.alias_link);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{accessToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "warning": "This is a duplicate header and will be overridden by the Content-Type header generated by Postman.", + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "title", + "value": "this is a post test title", + "type": "text" + }, + { + "key": "short_description", + "value": "this is a post short description", + "type": "text" + }, + { + "key": "main_image", + "value": "../image.png", + "type": "text" + }, + { + "key": "header_image", + "value": "../image.png", + "type": "text" + }, + { + "key": "description", + "value": "this is a post description", + "type": "text" + }, + { + "key": "alias_link", + "value": "post-2-test", + "type": "text" + }, + { + "key": "category_id", + "value": "{{categoryID}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/content/v1/create-post", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "create-post" + ] + }, + "description": "It should be noted that your content management at least needs one category to let you create a new post. Every new post should have a CategoryID\n\n* Needs ACL\n* Needs access token" + }, + "response": [] + }, + { + "name": "Edit Post", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{accessToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "warning": "This is a duplicate header and will be overridden by the Content-Type header generated by Postman.", + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "title", + "value": "edited post 1", + "type": "text" + }, + { + "key": "post_id", + "value": "{{postID}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/content/v1/edit-post", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "edit-post" + ] + }, + "description": "* Needs ACL\n* Needs access token" + }, + "response": [] + }, + { + "name": "Delete Post", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{accessToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "warning": "This is a duplicate header and will be overridden by the Content-Type header generated by Postman.", + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "post_id", + "value": "{{postID}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/content/v1/delete-post", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "delete-post" + ] + }, + "description": "* Needs ACL\n* Needs access token\n* It just edits the post status to `soft_delete`, it does not delete your post from database." + }, + "response": [] + }, + { + "name": "Destroy Post", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{accessToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "warning": "This is a duplicate header and will be overridden by the Content-Type header generated by Postman.", + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "post_id", + "value": "{{postID}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/content/v1/destroy-post", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "destroy-post" + ] + }, + "description": "* Needs ACL\n* Needs access token\n* It deletes your post from database" + }, + "response": [] + }, + { + "name": "Posts", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{accessToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"page\": 1,\n \"filters\": {\n \"status\": \"active\"\n }\n}" + }, + "url": { + "raw": "{{baseUrl}}/content/v1/posts", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "posts" + ] + }, + "description": "This endpoint helps you to see information of all post were created\n\n* Does not need ACL\n* Needs access token" + }, + "response": [] + }, + { + "name": "Post", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{accessToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "warning": "This is a duplicate header and will be overridden by the Content-Type header generated by Postman.", + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "alias_link", + "value": "{{postAliasLink}}", + "type": "text" + }, + { + "key": "status", + "value": "active", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/content/v1/post", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "post" + ] + }, + "description": "This endpoint helps you to see information of a post were created\n\n* Does not need ACL\n* Needs access token" + }, + "response": [] + }, + { + "name": "Create Comment", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + " var jsonData = pm.response.json();", + " pm.collectionVariables.set(\"commentID\", jsonData.comment_info.id);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{accessToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "warning": "This is a duplicate header and will be overridden by the Content-Type header generated by Postman.", + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "section_id", + "value": "{{postID}}", + "type": "text" + }, + { + "key": "description", + "value": "this is a test", + "type": "text" + } + ] + }, + "url": { + "raw": "{{baseUrl}}/content/v1/create-comment", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "create-comment" + ] + }, + "description": "This endpoint helps you to send a comment for a post.\n\n* Does not need ACL\n* Needs access token" + }, + "response": [] + }, + { + "name": "Comment", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{accessToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"filters\": {\n \"comment_id\": \"{{commentAliasLink}}\",\n \"status\": \"active\",\n \"section\": \"blog_post\"\n }\n}" + }, + "url": { + "raw": "{{baseUrl}}/content/v1/comment", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "comment" + ] + }, + "description": "This endpoint helps you to see information of a comment.\n\n* Does not need ACL\n* Needs access token" + }, + "response": [] + }, + { + "name": "Comments", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{accessToken}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"page\": 1,\n \"filters\": {\n \"id\": \"{{commentID}}\",\n \"status\": \"active\",\n \"section\": \"blog_post\"\n }\n}" + }, + "url": { + "raw": "{{baseUrl}}/content/v1/comments", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "content", + "v1", + "comments" + ] + }, + "description": "This endpoint helps you to see information of comments.\n\n* Does not need ACL\n* Needs access token" + }, + "response": [] + } + ], + "description": "``` erlang\n\n# We have PostMan for these routers\ndef create_category(conn, params) do\ndef edit_category(conn, %{\"category_id\" => category_id})\ndef delete_category(conn, %{\"category_id\" => category_id})\ndef destroy_category(conn, %{\"category_id\" => category_id}) \ndef category(conn, %{\"category_id\" => id})\ndef category(conn, %{\"alias_link\" => alias_link})\ndef categories(conn, _params) # It loads all categories without paginate\n\ndef create_post(conn, params)\ndef edit_post(conn, %{\"post_id\" => post_id})\ndef delete_post(conn, %{\"post_id\" => post_id})\ndef destroy_post(conn, %{\"post_id\" => post_id}) \ndef posts(conn, %{\"page\" => page, \"filters\" => %{\"status\" => status}}) when status in [\"active\", \"archived\"] do\ndef post(conn, %{\"alias_link\" => alias_link, \"status\" => status, \"comment\" => %{\"page\" => _page, \"filters\" => %{\"status\" => status}}}) when status in [\"active\", \"archive\"]\ndef post(conn, %{\"alias_link\" => alias_link, \"status\" => status}) when status in [\"active\", \"archived\"]\n\ndef create_comment(conn, %{\"section_id\" => _section_id, \"description\" => _description})\ndef comment(conn, %{\"filters\" => %{\"comment_id\" => comment_id, \"status\" => status}}) when status in [\"active\", \"archived\"]\ndef comments(conn, %{\"page\" => page, \"filters\" => %{\"status\" => status} = params}) when status in [\"active\", \"archived\"]\n\n\n\n\n# We have no PostMan for these routers\ndef editor_post(conn, %{\"alias_link\" => alias_link, \"status\" => status, \"comment\" => %{\"page\" => _page, \"filters\" => _filters}})\ndef editor_post(conn, %{\"post_id\" => post_id, \"status\" => status})\ndef editor_posts(conn, %{\"page\" => page, \"filters\" => params})\ndef editor_post(conn, %{\"alias_link\" => alias_link, \"status\" => status, \"comment\" => %{\"page\" => _page, \"filters\" => _filters}})\ndef editor_post(conn, %{\"post_id\" => post_id, \"status\" => status})\ndef like_post(conn, %{\"post_id\" => post_id})\ndef delete_post_like(conn, %{\"post_id\" => post_id})\n\ndef editor_categories(conn, %{\"filters\" => params}) when is_map(params)\n\ndef editor_comment(conn, %{\"filters\" => params})\ndef editor_comments(conn, %{\"page\" => page, \"filters\" => params})\ndef edit_comment(conn, params)\ndef delete_comment(conn, %{\"comment_id\" => comment_id})\ndef delete_comment(conn, %{\"user_id\" => user_id,\"comment_id\" => comment_id})\ndef destroy_comment(conn, %{\"comment_id\" => comment_id})\ndef like_comment(conn, %{\"comment_id\" => comment_id})\ndef delete_comment_like(conn, %{\"comment_id\" => comment_id})\n\n\ndef create_tag(conn, %{\"title\" => _title, \"alias_link\" => _alias_link, \"robots\" => _robots})\ndef edit_tag(conn, %{\"tag_id\" => tag_id})\ndef delete_tag(conn, %{\"tag_id\" => tag_id})\ndef add_tag_to_post(conn, %{\"post_id\" => post_id, \"tag_id\" => tag_id})\ndef remove_post_tag(conn, %{\"post_id\" => post_id, \"tag_id\" => tag_id})\ndef tags(conn, %{\"page\" => page, \"filters\" => params})\ndef post_tags(conn, %{\"post_id\" => post_id})d\ndef tag_posts(conn, %{\"page\" => page, \"filters\" => %{\"post_status\" => post_status} = params}) when post_status in [\"active\", \"archived\"]\ndef editor_tag_posts(conn, %{\"page\" => page, \"filters\" => params})\n\n\ndef create_bookmark(conn, %{\"section\" => section, \"section_id\" => section_id})\ndef delete_bookmark(conn, %{\"section_id\" => section_id})\n\n\ndef create_subscription(conn, %{\"section\" => section, \"section_id\" => section_id})\ndef delete_subscription(conn, %{\"section_id\" => section_id})\n\ndef create_blog_link(conn, params)\ndef edit_blog_link(conn, %{\"blog_link_id\" => id} = params)\ndef delete_blog_link(conn, %{\"blog_link_id\" => id})\ndef links(conn, %{\"page\" => page, \"filters\" => %{\"status\" => status} = params}) when status in [\"active\", \"archived\"]\ndef editor_links(conn, %{\"page\" => page, \"filters\" => params})\n\n\ndef notifs(conn, %{\"type\" => \"client\", \"page\" => page, \"filters\" => params})\ndef editor_notifs(conn, %{\"page\" => page, \"filters\" => params})\ndef send_notif(conn, params)\n\n\ndef authors(conn, %{\"post_id\" => post_id})\ndef create_author(conn, params)\ndef delete_author(conn, %{\"post_id\" => post_id, \"user_id\" => user_id})\n\n\n```" + } + ], + "description": "This folder contains `API` for external software and includes almost all the developed sections. This section uses Token in most “endpoints” to connect, and data send and receive are based on JSON.", + "auth": { + "type": "noauth" + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ], + "variable": [ + { + "key": "baseUrl", + "value": "localhost:4001/api" + }, + { + "key": "testMailAddress", + "value": "testmail@test.com" + }, + { + "key": "testPassword", + "value": "TestUserPassword123" + }, + { + "key": "testUsername", + "value": "testUser" + }, + { + "key": "testFullName", + "value": "testName" + }, + { + "key": "accessToken", + "value": "" + }, + { + "key": "refreshToken", + "value": "" + }, + { + "key": "categoryID", + "value": "" + }, + { + "key": "postID", + "value": "", + "type": "string" + }, + { + "key": "postAliasLink", + "value": "", + "type": "string" + }, + { + "key": "commentID", + "value": "", + "type": "string" } ] } \ No newline at end of file