Skip to content

Commit

Permalink
deploy: a5059a7
Browse files Browse the repository at this point in the history
  • Loading branch information
dborovcanin committed Nov 8, 2024
1 parent 96144cf commit d42287f
Showing 1 changed file with 58 additions and 25 deletions.
83 changes: 58 additions & 25 deletions apis/api/openapi/invitations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,14 @@ tags:
url: https://docs.magistrala.abstractmachines.fr/

paths:
/{domainID}/invitations:
/invitations:
post:
operationId: sendInvitation
tags:
- Invitations
summary: Send invitation
description: |
Send invitation to user to join domain.
parameters:
- $ref: "auth.yml#/components/parameters/DomainID"
requestBody:
$ref: "#/components/requestBodies/SendInvitationReq"
security:
Expand All @@ -49,7 +47,7 @@ paths:
"401":
description: Missing or invalid access token provided.
"403":
description: Unauthorized access to the domain ID.
description: Failed to perform authorization over the entity.
"404":
description: A non-existent entity request.
"409":
Expand All @@ -74,7 +72,7 @@ paths:
- $ref: "#/components/parameters/Offset"
- $ref: "#/components/parameters/UserID"
- $ref: "#/components/parameters/InvitedBy"
- $ref: "auth.yml#/components/parameters/DomainID"
- $ref: "#/components/parameters/DomainID"
- $ref: "#/components/parameters/Relation"
- $ref: "#/components/parameters/State"
security:
Expand All @@ -89,15 +87,15 @@ paths:
Missing or invalid access token provided.
This endpoint is available only for administrators.
"403":
description: Unauthorized access to the domain ID.
description: Failed to perform authorization over the entity.
"404":
description: A non-existent entity request.
"422":
description: Database can't process request.
"500":
$ref: "#/components/responses/ServiceError"

/{domainID}/invitations/accept:
/invitations/accept:
post:
operationId: acceptInvitation
summary: Accept invitation
Expand All @@ -107,8 +105,8 @@ paths:
- Invitations
security:
- bearerAuth: []
parameters:
- $ref: "auth.yml#/components/parameters/DomainID"
requestBody:
$ref: "#/components/requestBodies/AcceptInvitationReq"
responses:
"204":
description: Invitation accepted.
Expand All @@ -118,12 +116,10 @@ paths:
description: Missing or invalid access token provided.
"404":
description: A non-existent entity request.
"415":
description: Missing or invalid content type.
"500":
$ref: "#/components/responses/ServiceError"

/{domainID}/invitations/reject:
/invitations/reject:
post:
operationId: rejectInvitation
summary: Reject invitation
Expand All @@ -133,8 +129,8 @@ paths:
- Invitations
security:
- bearerAuth: []
parameters:
- $ref: "auth.yml#/components/parameters/DomainID"
requestBody:
$ref: "#/components/requestBodies/AcceptInvitationReq"
responses:
"204":
description: Invitation rejected.
Expand All @@ -144,12 +140,10 @@ paths:
description: Missing or invalid access token provided.
"404":
description: A non-existent entity request.
"415":
description: Missing or invalid content type.
"500":
$ref: "#/components/responses/ServiceError"

/{domainID}/invitations/users/{user_id}:
/invitations/{user_id}/{domain_id}:
get:
operationId: getInvitation
summary: Retrieves a specific invitation
Expand All @@ -159,7 +153,7 @@ paths:
- Invitations
parameters:
- $ref: "#/components/parameters/user_id"
- $ref: "auth.yml#/components/parameters/DomainID"
- $ref: "#/components/parameters/domain_id"
security:
- bearerAuth: []
responses:
Expand All @@ -170,11 +164,9 @@ paths:
"401":
description: Missing or invalid access token provided.
"403":
description: Unauthorized access to the domain ID.
description: Failed to perform authorization over the entity.
"404":
description: A non-existent entity request.
"415":
description: Missing or invalid content type.
"422":
description: Database can't process request.
"500":
Expand All @@ -189,7 +181,7 @@ paths:
- Invitations
parameters:
- $ref: "#/components/parameters/user_id"
- $ref: "auth.yml#/components/parameters/DomainID"
- $ref: "#/components/parameters/domain_id"
security:
- bearerAuth: []
responses:
Expand All @@ -198,13 +190,11 @@ paths:
"400":
description: Failed due to malformed JSON.
"403":
description: Unauthorized access to the domain ID.
description: Failed to perform authorization over the entity.
"404":
description: Failed due to non existing user.
"401":
description: Missing or invalid access token provided.
"415":
description: Missing or invalid content type.
"500":
$ref: "#/components/responses/ServiceError"

Expand All @@ -230,6 +220,11 @@ components:
format: uuid
example: bb7edb32-2eac-4aad-aebe-ed96fe073879
description: User unique identifier.
domain_id:
type: string
format: uuid
example: bb7edb32-2eac-4aad-aebe-ed96fe073879
description: Domain unique identifier.
relation:
type: string
enum:
Expand All @@ -251,6 +246,7 @@ components:
description: Resend invitation.
required:
- user_id
- domain_id
- relation

Invitation:
Expand Down Expand Up @@ -406,6 +402,26 @@ components:
required: true
example: bb7edb32-2eac-4aad-aebe-ed96fe073879

DomainID:
name: domain_id
description: Unique identifier for a domain.
in: query
schema:
type: string
format: uuid
required: false
example: bb7edb32-2eac-4aad-aebe-ed96fe073879

domain_id:
name: domain_id
description: Unique identifier for a domain.
in: path
schema:
type: string
format: uuid
required: true
example: bb7edb32-2eac-4aad-aebe-ed96fe073879

InvitedBy:
name: invited_by
description: Unique identifier for a user that invited the user.
Expand Down Expand Up @@ -458,6 +474,22 @@ components:
schema:
$ref: "#/components/schemas/SendInvitationReqObj"

AcceptInvitationReq:
description: JSON-formatted document describing request for accepting invitation
required: true
content:
application/json:
schema:
type: object
properties:
domain_id:
type: string
format: uuid
example: bb7edb32-2eac-4aad-aebe-ed96fe073879
description: Domain unique identifier.
required:
- domain_id

responses:
InvitationRes:
description: Data retrieved.
Expand All @@ -470,6 +502,7 @@ components:
operationId: deleteInvitation
parameters:
user_id: $response.body#/user_id
domain_id: $response.body#/domain_id

InvitationPageRes:
description: Data retrieved.
Expand Down

0 comments on commit d42287f

Please sign in to comment.