Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Issue 45 - Rename search endpoint to skill search #46

Merged
merged 1 commit into from
Sep 11, 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
84 changes: 53 additions & 31 deletions docs/UBahn_API.postman_collection.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"info": {
"_postman_id": "2e9d0d1e-22b4-4b5c-af7d-8e5d407de79b",
"_postman_id": "6d99ffc9-3c8b-4c0a-a006-5f1d3d23801d",
"name": "UBahn_API",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "search",
"name": "skillSearch",
"item": [
{
"name": "{{HOST}}/search/userAttributes",
"name": "{{HOST}}/skill-search/userAttributes",
"event": [
{
"listen": "test",
"script": {
"id": "256b27ab-e629-429f-ad93-372eaaa46239",
"id": "769b9779-be21-4518-9276-f8b13c44c0d0",
"exec": [
"var rsp = pm.response.json();",
"if(rsp.id) pm.environment.set(\"userId\", rsp.id);"
Expand All @@ -39,12 +39,12 @@
}
],
"url": {
"raw": "{{HOST}}/search/userAttributes?attributeId=c44d4bee-1356-46d6-9f1f-991936dec297&attributeValue=support",
"raw": "{{HOST}}/skill-search/userAttributes?attributeId=c44d4bee-1356-46d6-9f1f-991936dec297&attributeValue=support",
"host": [
"{{HOST}}"
],
"path": [
"search",
"skill-search",
"userAttributes"
],
"query": [
Expand All @@ -62,12 +62,12 @@
"response": []
},
{
"name": "{{HOST}}/search/userAchievements",
"name": "{{HOST}}/skill-search/userAchievements",
"event": [
{
"listen": "test",
"script": {
"id": "d1951826-476c-4149-bfa7-2a853c30df4e",
"id": "b2b52a88-23c3-4547-89b5-0a0afa0dad19",
"exec": [
""
],
Expand All @@ -91,12 +91,12 @@
}
],
"url": {
"raw": "{{HOST}}/search/userAchievements?organizationId=36ed815b-3da1-49f1-a043-aaed0a4e81ad&keyword=Topcoder",
"raw": "{{HOST}}/skill-search/userAchievements?organizationId=36ed815b-3da1-49f1-a043-aaed0a4e81ad&keyword=Topcoder",
"host": [
"{{HOST}}"
],
"path": [
"search",
"skill-search",
"userAchievements"
],
"query": [
Expand All @@ -114,12 +114,12 @@
"response": []
},
{
"name": "{{HOST}}/search/skills",
"name": "{{HOST}}/skill-search/skills",
"event": [
{
"listen": "test",
"script": {
"id": "d56349bd-a797-47cf-b6bf-2ecfbd342815",
"id": "35cfaef0-78f5-4ff9-83f3-c2a705dc0e9d",
"exec": [
""
],
Expand All @@ -143,12 +143,12 @@
}
],
"url": {
"raw": "{{HOST}}/search/skills?organizationId=36ed815b-3da1-49f1-a043-aaed0a4e81ad&keyword=net",
"raw": "{{HOST}}/skill-search/skills?organizationId=36ed815b-3da1-49f1-a043-aaed0a4e81ad&keyword=net",
"host": [
"{{HOST}}"
],
"path": [
"search",
"skill-search",
"skills"
],
"query": [
Expand All @@ -166,12 +166,12 @@
"response": []
},
{
"name": "{{HOST}}/search/users",
"name": "{{HOST}}/skill-search/users",
"event": [
{
"listen": "test",
"script": {
"id": "75560f72-efeb-438e-ac29-24d7c6ab540e",
"id": "23733012-4565-480e-9c0c-66b7c2fd2933",
"exec": [
"var rsp = pm.response.json();",
"if(rsp.id) pm.environment.set(\"userId\", rsp.id);"
Expand Down Expand Up @@ -203,19 +203,41 @@
}
},
"url": {
"raw": "{{HOST}}/search/users",
"raw": "{{HOST}}/skill-search/users",
"host": [
"{{HOST}}"
],
"path": [
"search",
"skill-search",
"users"
]
}
},
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"id": "e1951d10-6818-4d2d-8d49-452f3eb31f74",
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"id": "bb0d8108-d90a-4b16-ac59-7d0720a86c81",
"type": "text/javascript",
"exec": [
""
]
}
}
],
"protocolProfileBehavior": {}
},
{
Expand All @@ -227,7 +249,7 @@
{
"listen": "test",
"script": {
"id": "5db9dc16-daad-4768-a3af-ea8983487bec",
"id": "a80d76a2-572f-47e8-bb5b-7594906e6f17",
"exec": [
"var rsp = pm.response.json();",
"if(rsp.id) pm.environment.set(\"userId\", rsp.id);"
Expand Down Expand Up @@ -594,7 +616,7 @@
{
"listen": "test",
"script": {
"id": "8469c20d-3ef5-4868-af50-d603584ed8a7",
"id": "021253da-d913-43df-b490-28001f14b233",
"exec": [
"var rsp = pm.response.json();",
"if(rsp.id) pm.environment.set(\"roleId\", rsp.id);"
Expand Down Expand Up @@ -829,7 +851,7 @@
{
"listen": "test",
"script": {
"id": "d4ca59b9-f350-4c91-9667-a5e749eed956",
"id": "4a70f27f-df1b-43cf-a0fa-a2ca58a5521a",
"exec": [
""
],
Expand Down Expand Up @@ -1071,7 +1093,7 @@
{
"listen": "test",
"script": {
"id": "ff10985c-75c8-48ba-b522-2c8213b0c6cd",
"id": "9194de70-291f-4660-82d3-5883c23d12bb",
"exec": [
"var rsp = pm.response.json();",
"if(rsp.id) pm.environment.set(\"organizationId\", rsp.id);"
Expand Down Expand Up @@ -1306,7 +1328,7 @@
{
"listen": "test",
"script": {
"id": "0a875ba8-b4dc-42cc-b8ba-deb560b73556",
"id": "f40cae85-9ad1-4c54-ad87-b592395027ac",
"exec": [
"var rsp = pm.response.json();",
"if(rsp.id) pm.environment.set(\"skillsProviderId\", rsp.id);"
Expand Down Expand Up @@ -1541,7 +1563,7 @@
{
"listen": "test",
"script": {
"id": "909e2488-3801-4b57-90c5-6a6ae2e91f13",
"id": "a0153fe7-82ee-4a03-af43-19cf44fab4f0",
"exec": [
"var rsp = pm.response.json();",
"if(rsp.id) pm.environment.set(\"skillId\", rsp.id);"
Expand Down Expand Up @@ -1777,7 +1799,7 @@
{
"listen": "test",
"script": {
"id": "e3241acb-646f-4ec8-83fb-8a3d63da4990",
"id": "b4d7a5cc-9e17-4d45-84c3-6dfbdcf09579",
"exec": [
""
],
Expand Down Expand Up @@ -2025,7 +2047,7 @@
{
"listen": "test",
"script": {
"id": "ee9256b0-cdc2-4194-9da7-c0b363082385",
"id": "08a6d74a-268c-403b-8cb1-85bee3c88855",
"exec": [
""
],
Expand Down Expand Up @@ -2273,7 +2295,7 @@
{
"listen": "test",
"script": {
"id": "3c959e64-93e9-480d-b92e-44eacb46c2b1",
"id": "680443d3-c817-4939-8461-445fbeea6b00",
"exec": [
"var rsp = pm.response.json();",
"if(rsp.id) pm.environment.set(\"achievementsProviderId\", rsp.id);"
Expand Down Expand Up @@ -2508,7 +2530,7 @@
{
"listen": "test",
"script": {
"id": "9b4f70b8-3ca8-4c1c-a65a-8a8b37e2fa62",
"id": "4ccce827-71ed-4373-b14f-e103b334e73f",
"exec": [
""
],
Expand Down Expand Up @@ -2757,7 +2779,7 @@
{
"listen": "test",
"script": {
"id": "fb796928-9848-47a3-be88-61a8fc9e60f7",
"id": "6670cb30-0276-4625-9688-8cb1aa78d8fb",
"exec": [
"var rsp = pm.response.json();",
"if (rsp.id) pm.environment.set(\"attributeGroupId\", rsp.id);"
Expand Down Expand Up @@ -2998,7 +3020,7 @@
{
"listen": "test",
"script": {
"id": "eb028137-ee03-496c-a812-2966380bca42",
"id": "bad538df-7c33-4d34-a90e-9e60e279f40d",
"exec": [
"var rsp = pm.response.json();",
"if (rsp.id) pm.environment.set(\"attributeId\", rsp.id);"
Expand Down Expand Up @@ -3238,7 +3260,7 @@
{
"listen": "test",
"script": {
"id": "06c18b73-b9e6-46a8-acfa-74fc7ae68ac5",
"id": "b91ea1ce-88a2-48fa-8e90-ed689232b5e5",
"exec": [
""
],
Expand Down
18 changes: 9 additions & 9 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ tags:
description: "Attributes registered in the system"
- name: "Attribute Groups"
description: "Attribute groups registered in the system"
- name: "Search"
- name: "Skill Search"
description: "Search info registered in the system"
schemes:
- "https"
Expand Down Expand Up @@ -3718,10 +3718,10 @@ paths:
security:
- Bearer: []
x-swagger-router-controller: "AttributeGroups"
/search/users:
/skill-search/users:
post:
tags:
- "Search"
- "Skill Search"
description: "Search for users in the application. If no results, then empty\
\ array is returned. Multiple filters are\nsupported.\n\n**Security** - Note\
\ that for non-admin users, this endpoint will only return entities that\n\
Expand Down Expand Up @@ -3758,10 +3758,10 @@ paths:
security:
- Bearer: []
x-swagger-router-controller: "Search"
/search/userAttributes:
/skill-search/userAttributes:
get:
tags:
- "Search"
- "Skill Search"
description: "Search for user attributes in the application. If no results, then empty\
\ array is returned. Multiple filters are\nsupported.\n\n**Security** - Note\
\ that for non-admin users, this endpoint will only return entities that\n\
Expand Down Expand Up @@ -3795,10 +3795,10 @@ paths:
security:
- Bearer: []
x-swagger-router-controller: "Search"
/search/userAchievements:
/skill-search/userAchievements:
get:
tags:
- "Search"
- "Skill Search"
description: "Search for user achievements in the application. If no results, then empty\
\ array is returned. Multiple filters are\nsupported.\n\n**Security** - Note\
\ that for non-admin users, this endpoint will only return entities that\n\
Expand Down Expand Up @@ -3833,10 +3833,10 @@ paths:
security:
- Bearer: []
x-swagger-router-controller: "Search"
/search/skills:
/skill-search/skills:
get:
tags:
- "Search"
- "Skill Search"
description: "Search for skills associated with an org in the application. If no results, then empty\
\ array is returned. Multiple filters are\nsupported.\n\n**Security** - Note\
\ that for non-admin users, this endpoint will only return entities that\n\
Expand Down
8 changes: 4 additions & 4 deletions src/modules/search/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@ const Controller = require('./controller')
const consts = require('../../consts')

module.exports = {
'/search/users': {
'/skill-search/users': {
post: {
method: Controller.searchUsers,
auth: 'jwt',
access: [...consts.AdminUser, consts.UserRoles.ubahn],
scopes: ['read:user', 'all:user']
}
},
'/search/skills': {
'/skill-search/skills': {
get: {
method: Controller.searchSkills,
auth: 'jwt',
access: [...consts.AdminUser, consts.UserRoles.ubahn],
scopes: ['create:userAttribute', 'all:userAttribute']
}
},
'/search/userAttributes': {
'/skill-search/userAttributes': {
get: {
method: Controller.searchAttributeValues,
auth: 'jwt',
access: [...consts.AdminUser, consts.UserRoles.ubahn],
scopes: ['create:userAttribute', 'all:userAttribute']
}
},
'/search/userAchievements': {
'/skill-search/userAchievements': {
get: {
method: Controller.searchAchievementValues,
auth: 'jwt',
Expand Down