npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

equella-cli

v3.0.7

Published

access EQUELLA functions with its REST API

Downloads

56

Readme

EQUELLA CLI

npm version

Command line interface to the openEQUELLA REST APIs.

WARNING use at your own risk. In particular, PUT and POST requests do not lock the resources they're editing. Safe for GETting information, though.

Setup

Install node, install equella-cli globally with npm i -g equella-cli, and configure an .equellarc file. The rc file can live in your user's home directory, the working directory where you're running eq commands, or any parent of the working directory. Really, anywhere that rc looks. At a bare minimum, the rc file looks like:

{
    "root": "https://equella.mydomain.edu",
    "token": "abcd1234-ab12-1234-12ab-abcd1234abcd"
}

Any option listed in the endpoints documentation can also be given a default in the rc file; the name of the configuration option is simply the command line flag minus the two leading hyphens. Values specified on the command line override rc values. Here are some potential options:

{
    "debug": true, // log URLs of all requests to stderr
    "fullterm": false, // don't search full taxonomy term path
    "collections": "6b755832-4070-73d2-77b3-3febcc1f5fad", // search only this collection
}

Consult the openEQUELLA REST API guide for instructions on generating an OAUTH token. It involves configuring a client, then visiting https://equella.mydomain.edu/oauth/authorize?response_type=token&client_id=$CLIENT_ID&redirect_uri=default

Usage

Endpoints

See the endpoints document for documentation on options and shortcuts related to specific API endpoints like taxonomy, groups, search, and items.

Miscellaneous

Helpful things. URLs open in your default browser.

eq help - help docs for the command itself

eq login — sign into EQUELLA using credentials in .equellarc file or --username and --password flags passed on the command line

eq docs, eq apidocs — open the API documentation URL

eq launch - run the new admin console launcher, requires a launcherPath option that points to the script.

eq admin, eq console — opens the download URL for the EQUELLA admin console Java app

Raw URL Mode

If you don't use one of the shortcuts for the various API endpoints, eq defaults to making HTTP requests to your server. It defaults to HTTP GET but you can specify other methods with the --method flag. This fallback allows eq to work with API functionality that hasn't been implemented yet.

eq 'taxonomy/1234-4321-asda-asda-1231' # get specific taxonomy
eq 'collection/?privilege=VIEW_ITEM' # get collections for which you have VIEW_ITEM privilege
eq --method del 'taxonomy/1234-asdasd-1234/term/1231231-1231231' # delete a term
eq settings/advancedsearch # see a list of advanced searches

You can combine the endpoint shortcuts below with raw URL requests by appending the rest of the URL onto a shortcut. For instance:

# list all taxonomy terms using both a shortcut & a specific path
eq tax '1234-4321-asda/term'

The --path flag is also available for specifying a path that comes after the API endpoint and any UUID. So eq tax '1234-4321-asda/term is equivalent to eq tax 1234-4321-asda --path term.

Use jq

eq is at its best in combination with a UNIX JSON utility like jq. By piping API results through jq, it's easier to extract the specific information we want as well as to iterate over results. For this reason, eq will not focus on tooling for extracting common fields from EQUELLA's JSON responses. Instead, we use jq in combination to achieve want we want, e.g.

# get the text of all top-level terms in a taxonomy
eq tax --name 'semesters' --terms | jq '.[].term'
# retrieve all the members of a group by its name
# then iterate over them printing out all their usernames (FISH loop, not BASH)
for user in (eq group --name 'system administrators' | jq '.users[]' | tr -d '"'); eq user $user | jq '.username'; end

LICENSE

ECL Version 2.0