All new code requires tests to ensure against regressions.
However, if your PR contains zero code changes, feel free to select the checkmark below to indicate so.
[X] Have you ran tests against this code?
[ ] This PR contains zero code changes.
Description of the Change
This PR adds the capability to filter packages results by the provided, or consumed service.
Allowing the editor to take advantage of this functionality to help users find packages that meet the consumed services of a package they install, or vice versa.
This PR extends the already existing GET /api/packages API endpoint with new query parameters to include this functionality.
The new query parameters for this endpoint are as follows:
service: This is the actual string based service we will want to filter by. If you intend to filter by a service this is a required value. Otherwise can be omitted.
serviceType: This determines if you want to filter by either a consumer or provider of the aforementioned service. Again, if you intend to filter services, this is a required value, or otherwise may be omitted. The following are valid values for this query parameter:
provided: To filter by providedServices
consumed: To filter by consumedServices
serviceVersion: A fully optional parameter, even when filtering by services, let's you further filter by a specific version of the service.
Any and all results of this endpoint will continue to match the existing standards, and the return should not have changed at all from this new feature inclusion.
All other previous query parameter for this endpoint are still supported when filtering, and will still take effect. Meaning you can still take these results and sort them by 'downloads', 'created_at', 'updated_at', 'stars' and then change the direction of their ordering in 'desc', or 'asc'.
The above example on our current database returns the autocomplete-plus package as it's the only provider.
But if we use https://api.pulsar-edit.dev/api/packages?service=autocomplete.watchEditor&serviceType=consumed
Requirements
Filling out the template is required.
All new code requires tests to ensure against regressions.
[X] Have you ran tests against this code?
[ ] This PR contains zero code changes.
Description of the Change
This PR adds the capability to filter packages results by the provided, or consumed service.
Allowing the editor to take advantage of this functionality to help users find packages that meet the consumed services of a package they install, or vice versa.
This PR extends the already existing
GET /api/packages
API endpoint with new query parameters to include this functionality.The new query parameters for this endpoint are as follows:
service
: This is the actual string based service we will want to filter by. If you intend to filter by a service this is a required value. Otherwise can be omitted.serviceType
: This determines if you want to filter by either a consumer or provider of the aforementioned service. Again, if you intend to filter services, this is a required value, or otherwise may be omitted. The following are valid values for this query parameter:provided
: To filter byprovidedServices
consumed
: To filter byconsumedServices
serviceVersion
: A fully optional parameter, even when filtering by services, let's you further filter by a specific version of the service.Any and all results of this endpoint will continue to match the existing standards, and the return should not have changed at all from this new feature inclusion.
An example request would look like so:
https://api.pulsar-edit.dev/api/packages?service=autocomplete.watchEditor&serviceType=provided
All other previous query parameter for this endpoint are still supported when filtering, and will still take effect. Meaning you can still take these results and sort them by 'downloads', 'created_at', 'updated_at', 'stars' and then change the direction of their ordering in 'desc', or 'asc'.
The above example on our current database returns the
autocomplete-plus
package as it's the only provider.But if we use
https://api.pulsar-edit.dev/api/packages?service=autocomplete.watchEditor&serviceType=consumed
We get:
Hydrogen
find-and-replace
ide-haskell-repl
atom-ide-console
autocomplete-oracle