openapi: 3.0.0
info:
  title: Free-Commit
  version: 1.0.0
servers:
  - url: http://{{host}}
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
tags:
  - name: secret
  - name: project
  - name: credential
  - name: developer
  - name: build
  - name: build > webhook
  - name: pagination
  - name: configuration
  - name: log
paths:
  /api/admin/secrets:
    post:
      tags:
        - secret
      summary: CreateSecret
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                secret:
                  name: API_TOKEN
                  value: ABCD
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /api/developer/secrets/{id}:
    get:
      tags:
        - secret
      summary: GetSecret
      security:
        - bearerAuth: []
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          example: '3'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /api/developer/secrets:
    get:
      tags:
        - secret
      summary: GetAllSecret
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /api/admin/secrets/{id}:
    delete:
      tags:
        - secret
      summary: DeleteSecret
      security:
        - bearerAuth: []
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          example: '2'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /api/developer/projects/{id}:
    get:
      tags:
        - project
      summary: GetProject
      security:
        - bearerAuth: []
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          example: '9'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /api/developer/projects:
    get:
      tags:
        - project
      summary: GetAllProjects
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /api/admin/projects:
    post:
      tags:
        - project
      summary: CreateProject
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                project:
                  name: service-user
                  description: null
                  repository: git@github.com:fairfair-cloud/service-user.git
                  branch: develop
                  spec_file_path: /.deploy/develop.yaml
                  keep_number_build: 3
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /api/admin/credentials:
    post:
      tags:
        - credential
      summary: CreateCredential
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                credential:
                  name: Github
                  ssh_key: KEY
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /api/developer/credentials/{id}:
    get:
      tags:
        - credential
      summary: GetCredential
      security:
        - bearerAuth: []
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          example: '2'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /api/developer/credentials:
    get:
      tags:
        - credential
      summary: GetAllCredentials
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /api/admin/developers:
    post:
      tags:
        - developer
      summary: CreateDeveloper
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                developer:
                  username: evan
                  password: '0000'
                  github_username: evan-mart
                  email: evan.martinez@fairfair.com
                  roles:
                    - ROLE_DEVELOPER
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /api/developer/developers/{id}:
    get:
      tags:
        - developer
      summary: GetDeveloper
      security:
        - bearerAuth: []
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          example: '9'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /api/developer/developers:
    get:
      tags:
        - developer
      summary: GetAllDevelopers
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /api/admin/developers/{id}/github_username:
    patch:
      tags:
        - developer
      summary: UpdateGithubUsername
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                developer:
                  github_username: romainlavabre
      security:
        - bearerAuth: []
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          example: '2'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /api/admin/developers/{id}/roles:
    patch:
      tags:
        - developer
      summary: UpdateRoles
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                developer:
                  roles:
                    - ROLE_ADMIN
                    - ROLE_DEVELOPER
      security:
        - bearerAuth: []
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          example: '9'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /api/guest/webhooks/build/3:
    post:
      tags:
        - build > webhook
      summary: Github
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                ref: refs/heads/master
                before: da9efe0a111ba4c6959ae4ea693605ca209a4174
                after: 7af56503cf9cbe01486df5a17a58e22328745203
                repository:
                  id: 376116669
                  node_id: MDEwOlJlcG9zaXRvcnkzNzYxMTY2Njk=
                  name: test
                  full_name: romainlavabre/test
                  private: true
                  owner:
                    name: romainlavabre
                    email: null
                    login: romainlavabre
                    id: 85732047
                    node_id: MDEyOk9yZ2FuaXphdGlvbjg1NzMyMDQ3
                    avatar_url: https://avatars.githubusercontent.com/u/85732047?v=4
                    gravatar_id: ''
                    url: https://api.github.com/users/fairfair-cloud
                    html_url: https://github.com/fairfair-cloud
                    followers_url: https://api.github.com/users/fairfair-cloud/followers
                    following_url: >-
                      https://api.github.com/users/fairfair-cloud/following{/other_user}
                    gists_url: >-
                      https://api.github.com/users/fairfair-cloud/gists{/gist_id}
                    starred_url: >-
                      https://api.github.com/users/fairfair-cloud/starred{/owner}{/repo}
                    subscriptions_url: https://api.github.com/users/fairfair-cloud/subscriptions
                    organizations_url: https://api.github.com/users/fairfair-cloud/orgs
                    repos_url: https://api.github.com/users/fairfair-cloud/repos
                    events_url: >-
                      https://api.github.com/users/fairfair-cloud/events{/privacy}
                    received_events_url: >-
                      https://api.github.com/users/fairfair-cloud/received_events
                    type: Organization
                    site_admin: false
                  html_url: https://github.com/romainlavabre/test
                  description: null
                  fork: false
                  url: https://github.com/fairfair-cloud/service-emergency
                  forks_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/forks
                  keys_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/keys{/key_id}
                  collaborators_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/collaborators{/collaborator}
                  teams_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/teams
                  hooks_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/hooks
                  issue_events_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/issues/events{/number}
                  events_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/events
                  assignees_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/assignees{/user}
                  branches_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/branches{/branch}
                  tags_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/tags
                  blobs_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/git/blobs{/sha}
                  git_tags_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/git/tags{/sha}
                  git_refs_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/git/refs{/sha}
                  trees_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/git/trees{/sha}
                  statuses_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/statuses/{sha}
                  languages_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/languages
                  stargazers_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/stargazers
                  contributors_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/contributors
                  subscribers_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/subscribers
                  subscription_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/subscription
                  commits_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/commits{/sha}
                  git_commits_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/git/commits{/sha}
                  comments_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/comments{/number}
                  issue_comment_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/issues/comments{/number}
                  contents_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/contents/{+path}
                  compare_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/compare/{base}...{head}
                  merges_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/merges
                  archive_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/{archive_format}{/ref}
                  downloads_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/downloads
                  issues_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/issues{/number}
                  pulls_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/pulls{/number}
                  milestones_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/milestones{/number}
                  notifications_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/notifications{?since,all,participating}
                  labels_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/labels{/name}
                  releases_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/releases{/id}
                  deployments_url: >-
                    https://api.github.com/repos/fairfair-cloud/service-emergency/deployments
                  created_at: 1623437605
                  updated_at: '2022-01-09T14:57:39Z'
                  pushed_at: 1645025622
                  git_url: git://github.com/fairfair-cloud/service-emergency.git
                  ssh_url: git@github.com:fairfair-cloud/service-emergency.git
                  clone_url: https://github.com/fairfair-cloud/service-emergency.git
                  svn_url: https://github.com/fairfair-cloud/service-emergency
                  homepage: null
                  size: 2023
                  stargazers_count: 0
                  watchers_count: 0
                  language: Java
                  has_issues: true
                  has_projects: true
                  has_downloads: true
                  has_wiki: true
                  has_pages: false
                  forks_count: 0
                  mirror_url: null
                  archived: false
                  disabled: false
                  open_issues_count: 0
                  license: null
                  allow_forking: false
                  is_template: false
                  topics: []
                  visibility: private
                  forks: 0
                  open_issues: 0
                  watchers: 0
                  default_branch: master
                  stargazers: 0
                  master_branch: master
                  organization: fairfair-cloud
                pusher:
                  name: romainlavabre
                  email: 68106520+romainlavabre@users.noreply.github.com
                organization:
                  login: fairfair-cloud
                  id: 85732047
                  node_id: MDEyOk9yZ2FuaXphdGlvbjg1NzMyMDQ3
                  url: https://api.github.com/orgs/fairfair-cloud
                  repos_url: https://api.github.com/orgs/fairfair-cloud/repos
                  events_url: https://api.github.com/orgs/fairfair-cloud/events
                  hooks_url: https://api.github.com/orgs/fairfair-cloud/hooks
                  issues_url: https://api.github.com/orgs/fairfair-cloud/issues
                  members_url: https://api.github.com/orgs/fairfair-cloud/members{/member}
                  public_members_url: >-
                    https://api.github.com/orgs/fairfair-cloud/public_members{/member}
                  avatar_url: https://avatars.githubusercontent.com/u/85732047?v=4
                  description: ''
                sender:
                  login: romainlavabre
                  id: 68106520
                  node_id: MDQ6VXNlcjY4MTA2NTIw
                  avatar_url: https://avatars.githubusercontent.com/u/68106520?v=4
                  gravatar_id: ''
                  url: https://api.github.com/users/romainlavabre
                  html_url: https://github.com/romainlavabre
                  followers_url: https://api.github.com/users/romainlavabre/followers
                  following_url: >-
                    https://api.github.com/users/romainlavabre/following{/other_user}
                  gists_url: https://api.github.com/users/romainlavabre/gists{/gist_id}
                  starred_url: >-
                    https://api.github.com/users/romainlavabre/starred{/owner}{/repo}
                  subscriptions_url: https://api.github.com/users/romainlavabre/subscriptions
                  organizations_url: https://api.github.com/users/romainlavabre/orgs
                  repos_url: https://api.github.com/users/romainlavabre/repos
                  events_url: https://api.github.com/users/romainlavabre/events{/privacy}
                  received_events_url: https://api.github.com/users/romainlavabre/received_events
                  type: User
                  site_admin: false
                created: false
                deleted: false
                forced: false
                base_ref: null
                compare: >-
                  https://github.com/fairfair-cloud/service-emergency/compare/da9efe0a111b...7af56503cf9c
                commits:
                  - id: 7af56503cf9cbe01486df5a17a58e22328745203
                    tree_id: 02724303d3ab8d6966699c71bbe77e6a091b594d
                    distinct: true
                    message: FIX dev.deploy.sh
                    timestamp: '2022-02-16T16:33:39+01:00'
                    url: >-
                      https://github.com/fairfair-cloud/service-emergency/commit/7af56503cf9cbe01486df5a17a58e22328745203
                    author:
                      name: romainlavabre
                      email: romainlavabre98@gmail.com
                      username: romainlavabre
                    committer:
                      name: romainlavabre
                      email: romainlavabre98@gmail.com
                      username: romainlavabre
                    added: []
                    removed: []
                    modified:
                      - .free-commit/dev/deploy.sh
                head_commit:
                  id: 7af56503cf9cbe01486df5a17a58e22328745203
                  tree_id: 02724303d3ab8d6966699c71bbe77e6a091b594d
                  distinct: true
                  message: FIX dev.deploy.sh
                  timestamp: '2022-02-16T16:33:39+01:00'
                  url: >-
                    https://github.com/fairfair-cloud/service-emergency/commit/7af56503cf9cbe01486df5a17a58e22328745203
                  author:
                    name: romainlavabre
                    email: romainlavabre98@gmail.com
                    username: romainlavabre
                  committer:
                    name: romainlavabre
                    email: romainlavabre98@gmail.com
                    username: romainlavabre
                  added: []
                  removed: []
                  modified:
                    - .free-commit/dev/deploy.sh
      parameters:
        - name: X-GitHub-Event
          in: header
          schema:
            type: string
          example: push
        - name: X-Hub-Signature-256
          in: header
          schema:
            type: string
          example: >-
            sha256=fc2024eeff84a001f3b1c76af36a5236081e2b9d56a706fae4b7d5deeea73c1a
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /api/developer/builds/{projectId}:
    post:
      tags:
        - build
      summary: LaunchBuildByProjectId
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                build:
                  ignore_steps: []
      security:
        - bearerAuth: []
      parameters:
        - name: projectId
          in: path
          schema:
            type: integer
          required: true
          example: '3'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /api/developer/builds/output/{executorId}:
    get:
      tags:
        - log
      summary: GetLogByExecutorId
      security:
        - bearerAuth: []
      parameters:
        - name: executorId
          in: path
          schema:
            type: string
          required: true
          example: '{{current_executor}}'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /api/developer/builds/queueds:
    get:
      tags:
        - build
      summary: GetQueueds
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /api/developer/builds/executeds:
    get:
      tags:
        - build
      summary: GetExecuteds
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /api/developer/paginations/project:
    get:
      tags:
        - pagination
      summary: ProjectPagination
      security:
        - bearerAuth: []
      parameters:
        - name: page
          in: query
          schema:
            type: integer
          example: '1'
        - name: orderBy
          in: query
          schema:
            type: string
          example: DESC
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /api/admin/config/mail/test/{recipient}:
    post:
      tags:
        - configuration
      summary: TestEmail
      requestBody:
        content: {}
      security:
        - bearerAuth: []
      parameters:
        - name: recipient
          in: path
          schema:
            type: string
          required: true
          example: romainlavabre98@gmail.com
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /api/auth:
    post:
      tags:
        - General
      summary: Authentication
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                auth:
                  username: '{{username}}'
                  password: '{{password}}'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /api/user/info:
    get:
      tags:
        - General
      summary: UserInfo
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /api/guest/ping:
    get:
      tags:
        - General
      summary: Ping
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
