<commit_before># Imaginary API of a GitHub knockoff

exports.media_type = media_type = (name) ->
  "application/vnd.gh-knockoff.#{name}+json;version=1.0"

 
  authenticated_user:
    path: "/user"
    resource: "user"
 
  user:
    resource: "user"
    template: "/user/:login"

  user_search:
    path: "/user"
    resource: "user_search"
    query: search_query
 
  repositories:
    description: "Repositories for the authenticated user"
    path: "/user/repos"
    resource: "repositories"
  
  user_repositories:
    path: "/user/:login/repos"
    resource: "repositories"
  
  repository:
    template: "/repos/:login/:name"
    resource: "repository"
  
  repo_search:
    path: "/repos"
    query: search_query
    resource: "repo_search"


exports.resources =

  user:
    actions:
      get:
        method: "GET"
        response_schema: "user"
        status: 200
      update:
        method: "PUT"
        request_schema: "user"
        response_schema: "user"
        status: 200

  user_search:
    actions:
      get:
        method: "GET"
        response_schema: "user_list"
        status: 200

  repository:
    actions:
      get:
        method: "GET"
        response_schema: "repository"
        status: 200

      update:
        method: "PUT"
        response_schema: "repository"
        status: 200

      delete:
        method: "DELETE", status: 204

  repo_search:
    actions:
      get:
        method: "GET"
        response_schema: "repository_list"
        status: 200

  repositories:
    actions:
      create:
        method: "POST"
        request_schema: "repository"
        status: 201

  ref:
    actions:
      get:
        method: "GET"
        response_schema: "reference"
        status: 200

  branch:
    actions:
      get:
        method: "GET"
        response_schema: "reference"
        status: 200
      rename:
        method: "POST"
        status: 200
      delete:
        method: "DELETE"
        status: 204

  tag:
    actions:
      get:
        method: "GET"
        response_schema: "reference"
        status: 200
      delete:
        method: "DELETE"
        status: 204


exports.schema =
  id: "gh-knockoff"
  # This is the conventional place to store schema definitions,
  # becoming official as of Draft 04
  definitions:

    resource:
      type: "object"
      properties:
        url:<commit_msg>added stuff missing from example API<commit_after># Imaginary API of a GitHub knockoff

search_query =
  match:
    type: "string"
  limit:
    type: "integer"
  offset:
    type: "integer"
  sort:
    type: "string"
    enum: ["asc", "desc"]


exports.media_type = media_type = (name) ->
  "application/vnd.gh-knockoff.#{name}+json;version=1.0"

 
  authenticated_user:
    path: "/user"
    resource: "user"
 
  user:
    resource: "user"
    template: "/user/:login"

  user_search:
    path: "/user"
    resource: "user_search"
    query: search_query
 
  repositories:
    description: "Repositories for the authenticated user"
    path: "/user/repos"
    resource: "repositories"
  
  user_repositories:
    path: "/user/:login/repos"
    resource: "repositories"
  
  repository:
    template: "/repos/:login/:name"
    resource: "repository"
  
  repo_search:
    path: "/repos"
    query: search_query
    resource: "repo_search"


exports.resources =

  user:
    actions:
      get:
        method: "GET"
        response_schema: "user"
        status: 200
      update:
        method: "PUT"
        request_schema: "user"
        response_schema: "user"
        status: 200

  user_search:
    actions:
      get:
        method: "GET"
        response_schema: "user_list"
        status: 200

  repository:
    actions:
      get:
        method: "GET"
        response_schema: "repository"
        status: 200

      update:
        method: "PUT"
        response_schema: "repository"
        status: 200

      delete:
        method: "DELETE", status: 204

  repo_search:
    actions:
      get:
        method: "GET"
        response_schema: "repository_list"
        status: 200

  repositories:
    actions:
      create:
        method: "POST"
        request_schema: "repository"
        status: 201

  ref:
    actions:
      get:
        method: "GET"
        response_schema: "reference"
        status: 200

  branch:
    actions:
      get:
        method: "GET"
        response_schema: "reference"
        status: 200
      rename:
        method: "POST"
        status: 200
      delete:
        method: "DELETE"
        status: 204

  tag:
    actions:
      get:
        method: "GET"
        response_schema: "reference"
        status: 200
      delete:
        method: "DELETE"
        status: 204


exports.schema =
  id: "urn:gh-knockoff"
  # This is the conventional place to store schema definitions,
  # becoming official as of Draft 04
  definitions:

    resource:
      type: "object"
      properties:
        url:
{'fraction_non_alphanumeric': 0.09975669099756691, 'fraction_numerical': 0.0186536901865369, 'mean_word_length': 1.9734779987944544, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5794788', 'n_tokens_mistral': 1647, 'n_tokens_neox': 1495, 'n_words': 398}