Skip to content

Commit

Permalink
doc: update apis
Browse files Browse the repository at this point in the history
  • Loading branch information
Qolzam committed Jun 27, 2024
1 parent d304d54 commit c3967dd
Show file tree
Hide file tree
Showing 4 changed files with 142 additions and 198 deletions.
2 changes: 1 addition & 1 deletion static/apis/telar-web/actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"version": "1.0"
},
"host": "social.telar.dev",
"host": "social.faas.telar.dev",
"basePath": "/actions",
"paths": {
"/dispatch/{roomId}": {
Expand Down
2 changes: 1 addition & 1 deletion static/apis/telar-web/actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ definitions:
error:
$ref: '#/definitions/utils.ErrorCodeMessage'
type: object
host: social.telar.dev
host: social.faas.telar.dev
info:
contact:
email: [email protected]
Expand Down
194 changes: 79 additions & 115 deletions static/apis/telar-web/auth.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,98 +17,6 @@
"host": "social.faas.telar.dev",
"basePath": "/auth",
"paths": {
"/": {
"get": {
"description": "Renders the login page for Telar Social",
"produces": [
"text/html"
],
"tags": [
"auth"
],
"summary": "Login page",
"responses": {
"200": {
"description": "Login page HTML",
"schema": {
"type": "string"
}
}
}
},
"post": {
"description": "Authenticates a user with Telar Social credentials",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"auth"
],
"summary": "Login with Telar Social",
"parameters": [
{
"type": "string",
"description": "Username",
"name": "username",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "Password",
"name": "password",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "Response Type",
"name": "responseType",
"in": "formData"
},
{
"type": "string",
"description": "State",
"name": "state",
"in": "formData"
}
],
"responses": {
"200": {
"description": "User profile and access token",
"schema": {
"type": "object",
"properties": {
"accessToken": {
"type": "string"
},
"redirect": {
"type": "string"
},
"user": {
"$ref": "#/definitions/models.UserProfileModel"
}
}
}
},
"400": {
"description": "Bad request",
"schema": {
"$ref": "#/definitions/utils.TelarError"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/utils.TelarError"
}
}
}
}
},
"/admin/check": {
"post": {
"description": "handler to check whether admin user registered",
Expand Down Expand Up @@ -255,9 +163,27 @@
}
}
},
"/auth/login/telar/spa": {
"/login": {
"get": {
"description": "Renders the login page for Telar Social",
"produces": [
"text/html"
],
"tags": [
"auth"
],
"summary": "Login page",
"responses": {
"200": {
"description": "Login page HTML",
"schema": {
"type": "string"
}
}
}
},
"post": {
"description": "Authenticates a user with Telar Social credentials for Single Page Applications",
"description": "Authenticates a user with Telar Social credentials",
"consumes": [
"application/x-www-form-urlencoded"
],
Expand All @@ -267,7 +193,7 @@
"tags": [
"auth"
],
"summary": "Login with Telar Social (SPA)",
"summary": "Login with Telar Social",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -329,7 +255,7 @@
}
}
},
"/github": {
"/login/github": {
"get": {
"description": "Redirects the user to GitHub for authentication",
"produces": [
Expand All @@ -349,7 +275,7 @@
}
}
},
"/google": {
"/login/google": {
"get": {
"description": "Redirects the user to Google for authentication",
"produces": [
Expand Down Expand Up @@ -575,39 +501,77 @@
}
}
},
"/signup": {
"/signup/token": {
"post": {
"description": "return a token to verify user signup process",
"description": "Handles the generation of a signup token for email or phone verification.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"summary": "create a signup token",
"tags": [
"auth"
],
"summary": "Sign up token generation",
"parameters": [
{
"type": "string",
"description": "Full name of the user",
"name": "fullName",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "Email address of the user",
"name": "email",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "Password for the new user account",
"name": "newPassword",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "Type of verification (email or phone)",
"name": "verifyType",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "Google reCAPTCHA response token",
"name": "g-recaptcha-response",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "Response type indicating the desired response format (default or spa)",
"name": "responseType",
"in": "formData"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"properties": {
"token": {
"type": "string"
}
}
}
},
"400": {
"description": "Bad Request",
"description": "Returns a JSON object containing the generated token if responseType is 'spa', or renders a verification page otherwise.",
"schema": {
"$ref": "#/definitions/utils.TelarError"
}
},
"404": {
"description": "Not Found",
"400": {
"description": "Returns a JSON object describing the missing or invalid parameters.",
"schema": {
"$ref": "#/definitions/utils.TelarError"
}
},
"500": {
"description": "Internal Server Error",
"description": "Returns a JSON object indicating an internal server error, such as failure to create a user or verify captcha.",
"schema": {
"$ref": "#/definitions/utils.TelarError"
}
Expand Down
Loading

0 comments on commit c3967dd

Please sign in to comment.