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 org’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 org id the session was issued for. A token for one org can never read another.

string
Example
org_9f3c

The org id the session was issued for. A token for one org 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 org’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 org’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 org’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
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 is expired, revoked or no longer resolves to a member.

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, or it was issued for a different org.

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"
}

Report a problem with this page