sourcegraph/cmd/precise-code-intel/docs/api/manager.yaml

463 lines
12 KiB
YAML

openapi: 3.0.0
info:
title: LSIF Bundle Manager
description: An internal Sourcegraph microservice that serves LSIF-powered code intelligence for a single processed dump.
version: 1.0.0
contact:
name: Eric Fritz
email: eric@sourcegraph.com
url: https://sourcegraph.com
servers:
- url: http://localhost:3187
tags:
- name: Uploads
description: Upload operations
- name: Query
description: Query operations
paths:
/uploads/{id}:
get:
description: Retrieve raw LSIF content.
tags:
- Uploads
parameters:
- name: id
in: query
description: The upload identifier.
required: true
schema:
type: number
responses:
'200':
description: OK
content:
application/octet-stream:
schema:
type: string
format: binary
post:
description: Upload raw LSIF content.
tags:
- Uploads
parameters:
- name: id
in: query
description: The upload identifier.
required: true
schema:
type: number
requestBody:
content:
application/octet-stream:
schema:
type: string
format: binary
responses:
'200':
description: OK
/dbs/{id}:
post:
description: Upload a processed LSIF database.
tags:
- Uploads
parameters:
- name: id
in: query
description: The database identifier.
required: true
schema:
type: number
requestBody:
content:
application/octet-stream:
schema:
type: string
format: binary
responses:
'200':
description: OK
/dbs/{id}/exists:
get:
description: Determine if a file path exists in the given database.
tags:
- Query
parameters:
- name: id
in: query
description: The database identifier.
required: true
schema:
type: number
- name: path
in: query
description: The file path within the repository (relative to the repository root).
required: true
schema:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ExistsResponse'
/dbs/{id}/definitions:
get:
description: Retrieve a list of definition locations for a position in the given database.
tags:
- Query
parameters:
- name: id
in: query
description: The database identifier.
required: true
schema:
type: number
- name: path
in: query
description: The file path within the repository (relative to the repository root).
required: true
schema:
type: string
- name: line
in: query
description: The line index (zero-indexed).
required: true
schema:
type: number
- name: character
in: query
description: The character index (zero-indexed).
required: true
schema:
type: number
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/DefinitionsResponse'
/dbs/{id}/references:
get:
description: Retrieve a list of reference locations for a position in the given database.
tags:
- Query
parameters:
- name: id
in: query
description: The database identifier.
required: true
schema:
type: number
- name: path
in: query
description: The file path within the repository (relative to the repository root).
required: true
schema:
type: string
- name: line
in: query
description: The line index (zero-indexed).
required: true
schema:
type: number
- name: character
in: query
description: The character index (zero-indexed).
required: true
schema:
type: number
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ReferencesResponse'
/dbs/{id}/hover:
get:
description: Retrieve hover data for a position in the given database.
tags:
- Query
parameters:
- name: id
in: query
description: The database identifier.
required: true
schema:
type: number
- name: path
in: query
description: The file path within the repository (relative to the repository root).
required: true
schema:
type: string
- name: line
in: query
description: The line index (zero-indexed).
required: true
schema:
type: number
- name: character
in: query
description: The character index (zero-indexed).
required: true
schema:
type: number
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/HoverResponse'
/dbs/{id}/monikersByPosition:
get:
description: Retrieve a list of monikers for a position in the given database.
tags:
- Query
parameters:
- name: id
in: query
description: The database identifier.
required: true
schema:
type: number
- name: path
in: query
description: The file path within the repository (relative to the repository root).
required: true
schema:
type: string
- name: line
in: query
description: The line index (zero-indexed).
required: true
schema:
type: number
- name: character
in: query
description: The character index (zero-indexed).
required: true
schema:
type: number
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/MonikersByPositionResponse'
/dbs/{id}/monikerResults:
get:
description: Retrieve a list of locations associated with the given moniker in the given database.
tags:
- Query
parameters:
- name: id
in: query
description: The database identifier.
required: true
schema:
type: number
- name: modelType
in: query
description: The type of query.
required: true
schema:
type: string
enum:
- definition
- reference
- name: scheme
in: query
description: The moniker scheme.
required: true
schema:
type: string
- name: identifier
in: query
description: The moniker identifier.
required: true
schema:
type: string
- name: skip
in: query
description: The number of results to skip.
required: false
schema:
type: number
- name: take
in: query
description: The maximum number of results to return.
required: false
schema:
type: number
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/MonikerResultsResponse'
/dbs/{id}/packageInformation:
get:
description: Retrieve package information data by identifier.
tags:
- Query
parameters:
- name: id
in: query
description: The database identifier.
required: true
schema:
type: number
- name: path
in: query
description: The file path within the repository (relative to the repository root).
required: true
schema:
type: string
- name: packageInformationId
in: query
description: The identifier of the target package information data.
required: true
schema:
oneOf:
- type: number
- type: string
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/PackageInformationResponse'
components:
schemas:
Position:
type: object
description: A cursor position in a source file.
properties:
line:
type: number
description: The (zero-index) line index.
character:
type: number
description: The (zero-index) character index.
required:
- line
- character
additionalProperties: false
Range:
type: object
description: A half-open range of positions in a source file.
properties:
start:
$ref: '#/components/schemas/Position'
end:
$ref: '#/components/schemas/Position'
required:
- start
- end
additionalProperties: false
Location:
type: object
description: A position in a file of a code base.
properties:
path:
type: string
description: The root-relative path to the file.
range:
$ref: '#/components/schemas/Range'
required:
- path
- range
additionalProperties: false
ExistsResponse:
type: boolean
DefinitionsResponse:
type: array
items:
$ref: '#/components/schemas/Location'
ReferencesResponse:
type: array
items:
$ref: '#/components/schemas/Location'
HoverResponse:
type: object
properties:
text:
type: string
description: The hover text.
range:
$ref: '#/components/schemas/Range'
description: The range that the hover text describes.
additionalProperties: false
required:
- text
- range
nullable: true
MonikersByPositionResponse:
type: array
description: A list of monikers grouped by matching ranges.
items:
type: array
description: A list of monikers for a single range.
items:
type: object
properties:
kind:
type: string
description: The kind of moniker.
enum:
- import
- export
- local
scheme:
type: string
description: The moniker scheme.
identifier:
type: string
description: The moniker identifier.
packageInformationId:
type: number
description: The identifier of any associated package information.
nullable: true
additionalProperties: false
required:
- kind
- scheme
- identifier
- packageInformationId
MonikerResultsResponse:
type: object
properties:
locations:
type: array
items:
$ref: '#/components/schemas/Location'
count:
type: number
description: The total number of matching locations for this moniker.
additionalProperties: false
required:
- locations
- count
PackageInformationResponse:
type: object
properties:
name:
type: string
description: The name of the package.
version:
type: string
description: The package version.
nullable: true
additionalProperties: false
required:
- name
- version
nullable: true