Skip to content

A library’s versions

GET
/orgs/{org}/libraries/{namespace}/versions
curl --request GET \
--url 'https://api.sloose.com/orgs/org_9f3c/libraries/acme/versions?limit=50' \
--header 'Authorization: Bearer <token>'

Every publish of the organisation’s library, newest first, each with who published it and from where, and which one is current. A page at a time — limit and cursor, answering nextCursor.

org
required

The organisation id the session was issued for. A token for one organisation can never read another.

string
Example
org_9f3c

The organisation id the session was issued for. A token for one organisation can never read another.

namespace
required

The library namespace, as it appears in expressions.

string
Example
acme

The library namespace, as it appears in expressions.

limit

How many to return, at most 200; 50 when absent. Anything but a whole number above zero — 0, negative, a fraction, not a number — is the default, never an error.

string
Example
50

How many to return, at most 200; 50 when absent. Anything but a whole number above zero — 0, negative, a fraction, not a number — is the default, never an error.

cursor

The nextCursor of the page before this one; absent for the first page. Opaque: it names a place in the list’s number order, and a malformed one is 400 INVALID_CURSOR.

string

The nextCursor of the page before this one; absent for the first page. Opaque: it names a place in the list’s number order, and a malformed one is 400 INVALID_CURSOR.

A page of its versions, newest first.

Media typeapplication/json
object
versions
required
Array<object>
object
number
required

Which publish: 1 for v1.

number
origin
required

browser: published from the library’s page. push: sent by a program — a configuration repository’s push, or an API token. restore: an older version made current again (restoredFrom).

string
Allowed values: browser push restore
restoredFrom
required
number | null
current
required
boolean
publishedAt
required
string
publishedBy
required

Null when nobody is recorded — written with an API token.

object
userId
required
string
name
required
string | null
email
required
string | null
functions
required

The functions its manifest declares.

Array<string>
nextCursor
required

Pass as cursor for the next page; null when this was the last.

string | null
registryVersion
required

The configuration version this page was read at, in the same transaction as its versions. Send it as If-Match to make one of them current again: a publish since is then refused rather than replaced unseen.

number
publishing
required

Whether this organisation’s plan lets it publish libraries — and so make a version current again (403 FEATURE_HELPER_LIBRARIES when false).

boolean
managedBy
required

Who publishes the library, read with its versions: sdk when the configuration repository does, and no version is made current again here (409 LIBRARY_MANAGED) until it is taken over.

string | null
Allowed values: sdk
usage
required

Who uses the library: the current version is what every template, and every import not finished that keeps no older version of it, uses; an import that keeps one is under kept, and a run in progress keeps the version it started with.

object
namespace
required
string
templates
required

The organisation’s templates, which each run whichever version is current.

object
uses
required

How many call one of its functions by name.

number
mayUse
required

How many may reach it without naming the function (helpers[name], or the library read whole), or could not be read: never counted as not using it.

number
imports
required

Its imports not finished.

object
uses
required

How many call one of its functions by name.

number
mayUse
required

How many may reach it without naming the function (helpers[name], or the library read whole), or could not be read: never counted as not using it.

number
connections
required

Its connections, by their own defaults: a module’s default match rule and a field’s default mapping, which a run takes from the connection rather than its recipe. A connection that is somebody else’s own is counted, never named.

object
uses
required

How many call one of its functions by name.

number
mayUse
required

How many may reach it without naming the function (helpers[name], or the library read whole), or could not be read: never counted as not using it.

number
running
required

The organisation’s runs in progress.

Array<object>
object
importId
required
string | null
importName
required
string | null
version
required

The version of this library the run started with, which it keeps until it ends — 0 for what came before v1 (the one Sloose ships, or one stored before versions were kept); null when the run did not say which libraries it holds. A run that said, and named no version of this one, holds none of it and is not listed.

number | null
removed
required

True when what the run holds is of a library since removed — its record names another library’s id — so version is no version of this one.

boolean
kept
required

Imports not finished that keep an older version of this library instead of the current one (“Keep v3 for this import”): counted in no use of the current version, and broken by no publish.

Array<object>
object
importId
required
string
importName
required
string
version
required

The version it keeps.

number
usesShipped

Only on the answer to a removal where Sloose ships a library under the same name: the functions this import calls that the Sloose library also has, which it will use instead of the version it keeps.

Array<string>
Example
{
"versions": [
{
"origin": "browser"
}
],
"managedBy": "sdk"
}

cursor is malformed (code: INVALID_CURSOR).

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

No bearer, or one that no longer resolves: a session that is unknown or expired (code: AUTH_REQUIRED), or an API token that was revoked or expired (TOKEN_REVOKED, TOKEN_EXPIRED), whose organisation is gone (ORG_NOT_FOUND) or whose member or user row is (MEMBERSHIP_GONE).

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

The bearer’s role is too low (code: ROLE_REQUIRED), or it was issued for a different organisation; the organisation has been closed (code: ORG_CLOSED, either kind of bearer); the person is banned (code: BANNED, a session); or it is a session that is signed in but in no organisation (code: NO_ORG): one that never joined one, or whose person was taken out of the one it was in, or left it. Signing in again changes nothing for NO_ORG; choosing or making an organisation does.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

No such library, or it is not visible to this session.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

The restore switch is on (code: MAINTENANCE): every route but /health and /robots.txt is refused before anything is read, except the operator’s own POST /staff/people/{id}/delete with the ADMIN_TOKEN. Sloose is down for maintenance. Please try again in a few minutes.

Media typeapplication/json
object
error
required
string
code
required
string
Allowed value: MAINTENANCE
Example
{
"code": "MAINTENANCE"
}
Retry-After
integer

Seconds until asking again is worth it (300 while the switch is on).

Report a problem with this page

sloose.com