This resource represents package dependencies. Use this resource to associate package dependencies with a component.
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>
string
Requiredstring
Requiredstring
Requiredstring
RequiredReturned if the file upload is successful.
string
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: */*'
Delete all the package dependencies associated with a particular source
string
Requiredstring
RequiredReturned if the file upload is successful.
string
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: