A library’s versions
const url = 'https://api.sloose.com/orgs/org_9f3c/libraries/acme/versions?limit=50';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The org id the session was issued for. A token for one org can never read another.
Example
org_9f3cThe org id the session was issued for. A token for one org can never read another.
The library namespace, as it appears in expressions.
Example
acmeThe library namespace, as it appears in expressions.
Query Parameters
Section titled “Query Parameters”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.
Example
50How 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.
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.
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.
Responses
Section titled “Responses”A page of its versions, newest first.
object
object
Which publish: 1 for v1.
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).
Null when nobody is recorded — written with an API token.
object
The functions its manifest declares.
Pass as cursor for the next page; null when this was the last.
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.
Whether this org’s plan lets it publish libraries — and so make a version current again (403 FEATURE_HELPER_LIBRARIES when false).
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.
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
The org’s templates, which each run whichever version is current.
object
How many call one of its functions by name.
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.
Its imports not finished.
object
How many call one of its functions by name.
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.
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
How many call one of its functions by name.
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.
The org’s runs in progress.
object
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.
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.
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.
object
The version it keeps.
Example
{ "versions": [ { "origin": "browser" } ], "managedBy": "sdk"}cursor is malformed (code: INVALID_CURSOR).
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}No bearer, or one that is expired, revoked or no longer resolves to a member.
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}The bearer’s role is too low, or it was issued for a different org.
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}No such library, or it is not visible to this session.
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}