Skip to content

Commit

Permalink
Merge branch '801-ui-fix-hamburger-menu-remove-breakpoint-and-closeop…
Browse files Browse the repository at this point in the history
…en-on-click-in-storybook' of github.com:IT-Academy-BCN/ita-wiki into 801-ui-fix-hamburger-menu-remove-breakpoint-and-closeopen-on-click-in-storybook
  • Loading branch information
Cristian-Moller committed Jul 2, 2024
2 parents ac859ea + 5efdf9e commit afbe2a9
Show file tree
Hide file tree
Showing 28 changed files with 57 additions and 5 deletions.
6 changes: 6 additions & 0 deletions services/wiki/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file.

## [0.18.1] - 2024-07-01

### Added

- Added `operationId` to all endpoints in the Swagger documentation generated by Zod.

## [0.18.0] - 2024-06-26

### Changed
Expand Down
25 changes: 24 additions & 1 deletion services/wiki/openapi.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
info:
version: 0.17.0
version: 0.18.1
title: IT Academy Wiki
description: Our app implements a Wiki to be used as a knowledge base by the
students of the Barcelona Activa's IT Academy
Expand Down Expand Up @@ -138,6 +138,7 @@ paths:
post:
tags:
- auth
operationId: postLogin
description: Takes a DNI and a password and returns a session cookie
summary: Logs in a user
requestBody:
Expand Down Expand Up @@ -203,6 +204,7 @@ paths:
post:
tags:
- auth
operationId: postRegister
description: Takes a DNI, a password, a name and an email an registers a user to
the system
summary: Registers a new user
Expand Down Expand Up @@ -274,6 +276,7 @@ paths:
get:
tags:
- auth
operationId: getMe
description: Returns information of a logged in user. Token recieved in the
login necessary.
summary: Get user information
Expand Down Expand Up @@ -344,6 +347,7 @@ paths:
get:
tags:
- auth
operationId: getLogout
description: Deletes cookie and logouts user
summary: Logs out user
responses:
Expand All @@ -353,6 +357,7 @@ paths:
get:
tags:
- categories
operationId: listCategories
description: Get all categories saved in the database
summary: Get all categories
responses:
Expand Down Expand Up @@ -380,6 +385,7 @@ paths:
post:
tags:
- categories
operationId: postCategories
description: Creates a new category. The requestor has to be logged in and with
role ADMIN.
summary: Creates a new category.
Expand Down Expand Up @@ -432,6 +438,7 @@ paths:
patch:
tags:
- categories
operationId: patchCategories
summary: Patch a category by its ID.
description: Modifies an existing category. The requestor has to be logged in
and with role ADMIN.
Expand Down Expand Up @@ -493,6 +500,7 @@ paths:
get:
tags:
- topics
operationId: listTopics
description: Returns a list of all topics. Filter by category id or category
slug possible. If both filters are sent, will only search by category
id.
Expand Down Expand Up @@ -545,6 +553,7 @@ paths:
post:
tags:
- topics
operationId: postTopics
description: Creates a new topic. The requestor has to be logged in and with
role MENTOR or higher.
summary: Creates a new topic.
Expand Down Expand Up @@ -598,6 +607,7 @@ paths:
patch:
tags:
- topics
operationId: patchTopics
description: Modifies an existing topic. The requestor has to be logged in and
with role MENTOR or higher.
summary: Patch a topic.
Expand Down Expand Up @@ -656,6 +666,7 @@ paths:
get:
tags:
- resources
operationId: listFavoritesResources
description: Retrieves the users favorite resources when logged in
summary: Returns favorite resources by user and category
parameters:
Expand Down Expand Up @@ -810,6 +821,7 @@ paths:
get:
tags:
- resources
operationId: listResources
description: Returns a collection of resources. Filters by resource type, topic
name and category slug are optional. Resources that match all filters
are fetched.
Expand Down Expand Up @@ -1014,6 +1026,7 @@ paths:
post:
tags:
- resources
operationId: postResources
description: Allows a logged in user to post a resource.
summary: Post a resource
security:
Expand Down Expand Up @@ -1066,6 +1079,7 @@ paths:
patch:
tags:
- resources
operationId: patchResources
description: Allows a logged in user to modify his resources.
summary: Patch a resource
security:
Expand Down Expand Up @@ -1112,6 +1126,7 @@ paths:
post:
tags:
- seen
operationId: postUserSeenResourcesById
description: Allows a logged in user to mark a resource as viewed.
summary: Mark a resource as viewed
security:
Expand Down Expand Up @@ -1140,6 +1155,7 @@ paths:
get:
tags:
- resources
operationId: getResourcesById
summary: Returns a resource by its ID
description: Takes in a valid resource ID and returns the resource related to it.
parameters:
Expand Down Expand Up @@ -1303,6 +1319,7 @@ paths:
get:
tags:
- resources
operationId: listUserMeResources
summary: Get resources by logged in user
description: Returns all the posted resources by a logged in user. In addition,
if categorySlug query provided, returns only the resources posted in
Expand Down Expand Up @@ -1465,6 +1482,7 @@ paths:
get:
tags:
- vote
operationId: listVotes
description: Retrieve a detailed vote count for a specified resource, including
the number of upvotes, downvotes, and the overall vote balance.
summary: Fetch detailed vote statistics for a resource.
Expand Down Expand Up @@ -1680,6 +1698,7 @@ paths:
get:
tags:
- types
operationId: listResourceTypes
description: Returns an array of all the resource types
summary: Returns resource types
responses:
Expand All @@ -1699,6 +1718,7 @@ paths:
get:
tags:
- users
operationId: listUsers
description: Returns information of all users. User must be ADMIN and logged in.
summary: Get all users
security:
Expand Down Expand Up @@ -1783,6 +1803,7 @@ paths:
patch:
tags:
- users
operationId: patchUsersById
description: Allows a logged in ADMIN user to modify another user.
summary: Patch a user.
security:
Expand Down Expand Up @@ -1879,6 +1900,7 @@ paths:
put:
tags:
- favorites
operationId: putFavorites
description: Allows a logged in users to add/remove favorite resources.
summary: Put or delete a favorite resource by userId.
security:
Expand Down Expand Up @@ -1922,6 +1944,7 @@ paths:
get:
tags:
- itinerary
operationId: listItineraries
description: Fetches all available itineraries
summary: Get all itineraries
responses:
Expand Down
4 changes: 2 additions & 2 deletions services/wiki/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion services/wiki/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "service_wiki",
"private": true,
"version": "0.18.0",
"version": "0.18.1",
"prisma": {
"seed": "tsx prisma/seed.ts"
},
Expand Down
2 changes: 1 addition & 1 deletion services/wiki/src/openapi/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const openapiFilename = 'openapi.yaml'

export const generatorConfig = {
info: {
version: '0.18.0',
version: '0.18.1',
title: 'IT Academy Wiki',
description:
"Our app implements a Wiki to be used as a knowledge base by the students of the Barcelona Activa's IT Academy",
Expand Down
1 change: 1 addition & 0 deletions services/wiki/src/openapi/routes/auth/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ registry.registerPath({
method: 'post',
tags: ['auth'],
path: `${pathRoot.v1.auth}/login`,
operationId: 'postLogin',
description: 'Takes a DNI and a password and returns a session cookie',
summary: 'Logs in a user',
request: {
Expand Down
1 change: 1 addition & 0 deletions services/wiki/src/openapi/routes/auth/logout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { registry } from '../../registry'
registry.registerPath({
method: 'get',
tags: ['auth'],
operationId: 'getLogout',
path: `${pathRoot.v1.auth}/logout`,
description: 'Deletes cookie and logouts user',
summary: 'Logs out user',
Expand Down
1 change: 1 addition & 0 deletions services/wiki/src/openapi/routes/auth/me.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ registry.registerPath({
method: 'get',
tags: ['auth'],
path: `${pathRoot.v1.auth}/me`,
operationId: 'getMe',
description:
'Returns information of a logged in user. Token recieved in the login necessary.',
summary: 'Get user information',
Expand Down
1 change: 1 addition & 0 deletions services/wiki/src/openapi/routes/auth/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ registry.registerPath({
method: 'post',
tags: ['auth'],
path: `${pathRoot.v1.auth}/register`,
operationId: 'postRegister',
description:
'Takes a DNI, a password, a name and an email an registers a user to the system',
summary: 'Registers a new user',
Expand Down
1 change: 1 addition & 0 deletions services/wiki/src/openapi/routes/categories/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ registry.registerPath({
method: 'post',
tags: ['categories'],
path: `${pathRoot.v1.categories}`,
operationId: 'postCategories',
description:
'Creates a new category. The requestor has to be logged in and with role ADMIN.',
summary: 'Creates a new category.',
Expand Down
1 change: 1 addition & 0 deletions services/wiki/src/openapi/routes/categories/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ registry.registerPath({
method: 'get',
tags: ['categories'],
path: `${pathRoot.v1.categories}`,
operationId: 'listCategories',
description: 'Get all categories saved in the database',
summary: 'Get all categories',
responses: {
Expand Down
1 change: 1 addition & 0 deletions services/wiki/src/openapi/routes/categories/patch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ registry.registerPath({
method: 'patch',
tags: ['categories'],
path: `${pathRoot.v1.categories}/id/{id}`,
operationId: 'patchCategories',
summary: 'Patch a category by its ID.',
description:
'Modifies an existing category. The requestor has to be logged in and with role ADMIN.',
Expand Down
1 change: 1 addition & 0 deletions services/wiki/src/openapi/routes/favorites/put.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ registry.registerPath({
method: 'put',
tags: ['favorites'],
path: `${pathRoot.v1.favorites}`,
operationId: 'putFavorites',
description: 'Allows a logged in users to add/remove favorite resources.',
summary: 'Put or delete a favorite resource by userId.',
security: [{ [cookieAuth.name]: [] }],
Expand Down
1 change: 1 addition & 0 deletions services/wiki/src/openapi/routes/itinerary/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ registry.registerPath({
method: 'get',
tags: ['itinerary'],
path: `${pathRoot.v1.itinerary}`,
operationId: 'listItineraries',
description: 'Fetches all available itineraries',
summary: 'Get all itineraries',
responses: {
Expand Down
1 change: 1 addition & 0 deletions services/wiki/src/openapi/routes/resources/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ registry.registerPath({
method: 'post',
tags: ['resources'],
path: `${pathRoot.v1.resources}`,
operationId: 'postResources',
description: 'Allows a logged in user to post a resource.',
summary: 'Post a resource',
security: [{ [cookieAuth.name]: [] }],
Expand Down
1 change: 1 addition & 0 deletions services/wiki/src/openapi/routes/resources/favorites.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ registry.registerPath({
method: 'get',
tags: ['resources'],
path: `${pathRoot.v1.resources}/favorites`,
operationId: 'listFavoritesResources',
description: 'Retrieves the users favorite resources when logged in',
summary: 'Returns favorite resources by user and category',
parameters: [
Expand Down
1 change: 1 addition & 0 deletions services/wiki/src/openapi/routes/resources/id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ registry.registerPath({
method: 'get',
tags: ['resources'],
path: `${pathRoot.v1.resources}/{resourceId}`,
operationId: 'getResourcesById',
summary: 'Returns a resource by its ID',
description:
'Takes in a valid resource ID and returns the resource related to it.',
Expand Down
1 change: 1 addition & 0 deletions services/wiki/src/openapi/routes/resources/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ registry.registerPath({
method: 'get',
tags: ['resources'],
path: `${pathRoot.v1.resources}`,
operationId: 'listResources',
description:
'Returns a collection of resources. Filters by resource type, topic name and category slug are optional. Resources that match all filters are fetched.',
summary: 'Returns a collection of resources',
Expand Down
1 change: 1 addition & 0 deletions services/wiki/src/openapi/routes/resources/me.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ registry.registerPath({
method: 'get',
tags: ['resources'],
path: `${pathRoot.v1.resources}/me`,
operationId: 'listUserMeResources',
summary: 'Get resources by logged in user',
description:
'Returns all the posted resources by a logged in user. In addition, if categorySlug query provided, returns only the resources posted in that category.',
Expand Down
1 change: 1 addition & 0 deletions services/wiki/src/openapi/routes/resources/patch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ registry.registerPath({
method: 'patch',
tags: ['resources'],
path: `${pathRoot.v1.resources}`,
operationId: 'patchResources',
description: 'Allows a logged in user to modify his resources.',
summary: 'Patch a resource',
security: [{ [cookieAuth.name]: [] }],
Expand Down
1 change: 1 addition & 0 deletions services/wiki/src/openapi/routes/seen/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ registry.registerPath({
method: 'post',
tags: ['seen'],
path: `${pathRoot.v1.seen}/{resourceId}`,
operationId: 'postUserSeenResourcesById',
description: 'Allows a logged in user to mark a resource as viewed.',
summary: 'Mark a resource as viewed',
security: [{ [cookieAuth.name]: [] }],
Expand Down
1 change: 1 addition & 0 deletions services/wiki/src/openapi/routes/topics/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ registry.registerPath({
method: 'post',
tags: ['topics'],
path: `${pathRoot.v1.topics}`,
operationId: 'postTopics',
description:
'Creates a new topic. The requestor has to be logged in and with role MENTOR or higher.',
summary: 'Creates a new topic.',
Expand Down
1 change: 1 addition & 0 deletions services/wiki/src/openapi/routes/topics/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ registry.registerPath({
method: 'get',
tags: ['topics'],
path: `${pathRoot.v1.topics}`,
operationId: 'listTopics',
description:
'Returns a list of all topics. Filter by category id or category slug possible. If both filters are sent, will only search by category id.',
summary: 'Returns topics. Filter by category possible.',
Expand Down
1 change: 1 addition & 0 deletions services/wiki/src/openapi/routes/topics/patch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ registry.registerPath({
method: 'patch',
tags: ['topics'],
path: `${pathRoot.v1.topics}`,
operationId: 'patchTopics',
description:
'Modifies an existing topic. The requestor has to be logged in and with role MENTOR or higher.',
summary: 'Patch a topic.',
Expand Down
1 change: 1 addition & 0 deletions services/wiki/src/openapi/routes/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ registry.registerPath({
method: 'get',
tags: ['types'],
path: `${pathRoot.v1.types}`,
operationId: 'listResourceTypes',
description: 'Returns an array of all the resource types',
summary: 'Returns resource types',
responses: {
Expand Down
Loading

0 comments on commit afbe2a9

Please sign in to comment.