diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index dcd742c..a85b1d1 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -2,7 +2,6 @@ name: 🐹 lint on: pull_request: - push: paths: - '**.go' - 'go.mod' diff --git a/docs/public/API/openapi.yml b/docs/public/API/openapi.yml index 49cbd80..7bd3b76 100644 --- a/docs/public/API/openapi.yml +++ b/docs/public/API/openapi.yml @@ -16,13 +16,15 @@ info: url: https://forkbomb.solutions servers: - - url: https://s.api.didimo.forkbomb.eu/v1 - description: Staging server + - url: http://localhost:8090/ + description: Localhost server - url: https://t.api.didimo.forkbomb.eu/v1 description: Test server + - url: https://s.api.didimo.forkbomb.eu/v1 + description: Staging server paths: - /auth/register: + /api/collections/users/records: post: summary: Register a new user description: > @@ -37,32 +39,95 @@ paths: schema: $ref: '#/components/schemas/RegisterRequest' responses: - '201': - description: User registered successfully. + '200': + description: Successfully created the record content: application/json: schema: - $ref: '#/components/schemas/SuccessResponse' + type: object + properties: + id: + type: string + description: Unique identifier for the user record + collectionId: + type: string + description: Identifier of the user collection + collectionName: + type: string + description: Name of the user collection + username: + type: string + description: Username of the registered user + verified: + type: boolean + description: Whether the user is verified + emailVisibility: + type: boolean + description: Whether the user's email is visible + email: + type: string + format: email + description: Email of the registered user + created: + type: string + format: date-time + description: Timestamp when the user was created + updated: + type: string + format: date-time + description: Timestamp when the user was last updated + name: + type: string + description: Name of the user + avatar: + type: string + description: Avatar filename for the user '400': - description: Invalid registration data. + description: Bad request - validation error content: application/json: schema: - $ref: '#/components/schemas/ErrorResponse' - '409': - description: User already exists. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - '500': - description: Internal server error during registration. + type: object + properties: + code: + type: integer + example: 400 + message: + type: string + description: Error message + example: "Failed to create record." + data: + type: object + additionalProperties: + type: object + properties: + code: + type: string + description: Validation error code + example: "validation_required" + message: + type: string + description: Validation error message + example: "Missing required value." + '403': + description: Forbidden - access denied content: application/json: schema: - $ref: '#/components/schemas/ErrorResponse' - - /auth/login: + type: object + properties: + code: + type: integer + example: 403 + message: + type: string + description: Error message + example: "You are not allowed to perform this request." + data: + type: object + description: Additional data (if any) + additionalProperties: false + /api/collections/users/auth-with-password: post: summary: Log in user description: > @@ -947,34 +1012,41 @@ components: RegisterRequest: type: object properties: - username: + name: type: string - description: The username of the user to register. + description: The name of the user to register. password: type: string format: password description: The password for the user. + passwordConfirm: + type: string + format: password + description: The password confirmation for the user. email: type: string format: email description: The email address of the user. + emailVisibility: + type: boolean + description: Whether to show/hide the auth record email when fetching the record data. required: - - username + - name - password - - email + - passwordConfirm LoginRequest: type: object properties: - username: + identiry: type: string - description: The username of the user. + description: The username or the email of the user. password: type: string format: password description: The password for the user. required: - - username + - identity - password LoginResponse: