• Metrics
  • Events
  • Package Dependencies
  • Other operations
Cloud
Compass / Reference / REST API

Package Dependencies

Postman Collection
OpenAPI

This resource represents package dependencies. Use this resource to associate package dependencies with a component.

PUT

Upload Package Dependencies via Lock File

Upload package dependencies for a component.

The file with package dependency information. Currently, we only accept package-lock.json files.

The baseSourceUrl should be a url link to your lock file, ideally with "#lines-" appended at the end, if from Bitbucket, or "#L" appended if a GitHub link. This will let link to specific lines in your lock file where dependencies were found.

The sourceId should be a string that uniquely identifies the given lock file. We recommend using the filepath to the lock file, with the "/" characters replaced with "_" characters.

Example: This curl command uploads a lock file to populate package dependencies for the component.

1 2 3 4 5 6 7 8 curl --request PUT \ --url 'https://your-domain.atlassian.net/gateway/api/compass/v1/package_dependencies/lock_file' \ --user 'email@example.com:<api_token>' \ --header 'Content-Type: multipart/form-data' \ --form file=@/path/to/file/package-lock.json;type=application/json --form componentId=<componentId> --form baseSourceUrl=<url to your lock file> --form sourceId=<a unique identifier for your file>

Request

Query parameters

sourceId

string

Required
baseSourceUrl

string

Required
componentId

string

Required

Request bodymultipart/form-data

file

string

Required

Responses

Returned if the file upload is successful.

*/*

string

PUT/compass/v1/package_dependencies/lock_file
1 2 3 4 curl --request PUT \ --url 'https://your-domain.atlassian.net/gateway/api/compass/v1/package_dependencies/lock_file?sourceId={sourceId}&baseSourceUrl={baseSourceUrl}&componentId={componentId}' \ --user 'email@example.com:<api_token>' \ --header 'Accept: */*'
DEL

Delete Package Dependencies given a Source

Delete all the package dependencies associated with a particular source

Request

Path parameters

componentId

string

Required
sourceId

string

Required

Responses

Returned if the file upload is successful.

*/*

string

DEL/compass/v1/package_dependencies/lock_file/{componentId}/{sourceId}
1 2 3 4 curl --request DELETE \ --url 'https://your-domain.atlassian.net/gateway/api/compass/v1/package_dependencies/lock_file/{componentId}/{sourceId}' \ --user 'email@example.com:<api_token>' \ --header 'Accept: */*'

Rate this page: