Skip to content

Commit

Permalink
Update CHANGELOG.rst and api doc #508
Browse files Browse the repository at this point in the history
Signed-off-by: Jono Yang <[email protected]>
  • Loading branch information
JonoYang committed Aug 2, 2024
1 parent 80fdb93 commit 4e07db0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ Next Release
`/api/scan_queue/index_package_scan/` endpoint.
`/api/scan_queue/update_status/` is now an action on a ScannableURI.
https://github.com/nexB/purldb/issues/504

- The packages collected via the `/api/collect/` endpoint can be ordered in an
ascending or descending fashion on fields using the ``sort`` query parameter.
This parameter takes in the same fields as ``sort`` from `/api/packages/`.
https://github.com/nexB/purldb/issues/508

v5.0.0
---------
Expand Down
26 changes: 26 additions & 0 deletions docs/source/purldb/rest_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,25 @@ For example:
curl -X GET "$api_url?$payload" -H "$content_type"
The packages list can be ordered by the following fields:

- ``type``
- ``namespace``
- ``name``
- ``version``
- ``qualifiers``
- ``subpath``
- ``download_url``
- ``filename``
- ``size``
- ``release_date``

To sort a field in a descending fashion, prefix the field name with ``-``.
Packages can be sorted by multiple fields.

For example:

``GET /api/packages/?sort=type,-size``

package details
^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -867,6 +886,13 @@ package. Find all addon pipelines `here. <https://scancodeio.readthedocs.io/en/l
"history": "https://public.purldb.io/api/packages/4f3a57de-e367-43c6-a7f1-51633d0ecd45/history/"
}
The ordering of the packages returned by ``/api/collect/`` can be set using the
``sort`` query parameter.
``GET /api/collect/?purl=pkg:npm/[email protected]&sort=qualifiers,-size``
The same sort fields from ``/api/packages/`` is also used here.
collect actions
---------------
Expand Down

0 comments on commit 4e07db0

Please sign in to comment.