jsr API (1.0.0)

Download OpenAPI specification:Download

Create a new scope

Creates a new scope

SecuritybearerAuth
Request
Request Body schema: application/json
required

Scope properties

scope
string (ScopeName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of a scope. This must not be @ prefixed.

Responses
200

OK

400

Invalid request

401

Unauthorized

post/scopes
Request samples
application/json
{
  • "scope": "denoland"
}
Response samples
application/json
{
  • "scope": "denoland",
  • "creator": {
    },
  • "quotas": {
    },
  • "ghActionsVerifyActor": true,
  • "requirePublishingFromCI": true,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Get scope details

Returns details of a scope

SecuritybearerAuth
Request
path Parameters
scope
required
string (ScopeName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the scope

Example: denoland
Responses
200

OK

400

Invalid request

401

Unauthorized

404

Scope not found

get/scopes/{scope}
Request samples
Response samples
application/json
{
  • "scope": "denoland",
  • "creator": {
    },
  • "quotas": {
    },
  • "ghActionsVerifyActor": true,
  • "requirePublishingFromCI": true,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Update scope

Updates the details of a scope

SecuritybearerAuth
Request
path Parameters
scope
required
string (ScopeName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the scope

Example: denoland
Request Body schema: application/json
required

Scope properties

One of:
ghActionsVerifyActor
required
boolean

Whether to verify the actor of a GitHub Actions run when authenticating publishing with a GitHub Actions OIDC token.

Responses
200

OK

400

Invalid request

401

Unauthorized

403

User is not scope admin

404

Scope not found

patch/scopes/{scope}
Request samples
application/json
{
  • "requirePublishingFromCI": true
}
Response samples
application/json
{
  • "scope": "denoland",
  • "creator": {
    },
  • "quotas": {
    },
  • "ghActionsVerifyActor": true,
  • "requirePublishingFromCI": true,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Delete scope

Deletes a scope if the scope has no packages

SecuritybearerAuth
Request
path Parameters
scope
required
string (ScopeName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the scope

Example: denoland
Responses
204

OK, no content

400

Invalid request / Scope has packages

401

Unauthorized

403

User is not scope admin

404

Scope not found

delete/scopes/{scope}
Request samples
Response samples
application/json
{
  • "code": "string",
  • "message": "string"
}

List scope members

Returns a list of members of a scope

SecuritybearerAuth
Request
path Parameters
scope
required
string (ScopeName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the scope

Example: denoland
Responses
200

OK

400

Invalid request

401

Unauthorized

404

Scope not found

get/scopes/{scope}/members
Request samples
Response samples
application/json
[
  • {
    }
]

Add scope member

Invites a user to a scope

SecuritybearerAuth
Request
path Parameters
scope
required
string (ScopeName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the scope

Example: denoland
Request Body schema: application/json
required

Scope member properties

githubLogin
required
string

The GitHub login of the user to add to the scope.

Responses
200

OK

400

Invalid request

401

Unauthorized

403

User is not scope admin

404

Scope not found

post/scopes/{scope}/members
Request samples
application/json
{
  • "githubLogin": "ry"
}
Response samples
application/json
{
  • "scope": "denoland",
  • "targetUser": {
    },
  • "inviter": {
    },
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Update scope member

Updates the roles of a scope member

SecuritybearerAuth
Request
path Parameters
scope
required
string (ScopeName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the scope

Example: denoland
userId
required
string <uuid> (UserId)

The ID of the user

Request Body schema: application/json
required

Scope member properties

isAdmin
required
boolean

Whether the user should be an admin of the scope.

Responses
200

OK

400

Invalid request / Can not remove last scope admin

401

Unauthorized

403

User is not a scope admin

404

Scope or scope member not found

patch/scopes/{scope}/members/{userId}
Request samples
application/json
{
  • "isAdmin": true
}
Response samples
application/json
{
  • "scope": "denoland",
  • "user": {
    },
  • "isAdmin": true,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Remove scope member

Removes a member from a scope

SecuritybearerAuth
Request
path Parameters
scope
required
string (ScopeName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the scope

Example: denoland
userId
required
string <uuid> (UserId)

The ID of the user

Responses
204

OK, no content

400

Invalid request / Can not remove last scope admin

401

Unauthorized

403

User is not a scope admin

404

Scope or scope member not found

delete/scopes/{scope}/members/{userId}
Request samples
Response samples
application/json
{
  • "code": "string",
  • "message": "string"
}

List scope invites

Returns a list of invites to a scope

SecuritybearerAuth
Request
path Parameters
scope
required
string (ScopeName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the scope

Example: denoland
Responses
200

OK

401

Unauthorized

403

User is not a scope admin

404

Scope not found

get/scopes/{scope}/invites
Request samples
Response samples
application/json
[
  • {
    }
]

Delete scope invite

Deletes an invite to a scope

SecuritybearerAuth
Request
path Parameters
scope
required
string (ScopeName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the scope

Example: denoland
userId
required
string <uuid> (UserId)

The ID of the user

Responses
204

OK, no content

401

Unauthorized

403

User is not a scope admin

404

Scope or scope invite not found

delete/scopes/{scope}/invites/{userId}
Request samples
Response samples
application/json
{
  • "code": "string",
  • "message": "string"
}

List packages

Returns a list of packages

SecuritybearerAuth
Request
query Parameters
limit
integer [ 1 .. 100 ]
Default: 20

The maximum number of packages to return

page
integer >= 1
Default: 1

The page number of packages to return

Responses
200

OK

400

Invalid request

get/packages
Request samples
Response samples
application/json
{
  • "items": [
    ],
  • "total": 0
}

List scope packages

Returns a list of packages in a scope

SecuritybearerAuth
Request
path Parameters
scope
required
string (ScopeName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the scope

Example: denoland
query Parameters
limit
integer [ 1 .. 100 ]
Default: 20

The maximum number of packages to return

page
integer >= 1
Default: 1

The page number of packages to return

Responses
200

OK

400

Invalid request

404

Scope not found

get/scopes/{scope}/packages
Request samples
Response samples
application/json
{
  • "items": [
    ],
  • "total": 0
}

Create a new package

Creates a new package in a scope

SecuritybearerAuth
Request
path Parameters
scope
required
string (ScopeName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the scope

Example: denoland
Request Body schema: application/json
required

Package properties

package
required
string (PackageName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of a package.

Responses
200

OK

400

Invalid request

401

Unauthorized

403

User is not a scope member

404

Scope not found

post/scopes/{scope}/packages
Request samples
application/json
{
  • "package": "fmt"
}
Response samples
application/json
{
  • "scope": "denoland",
  • "name": "fmt",
  • "description": "A module for formatting strings.",
  • "runtimeCompat": {
    },
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "githubRepository": {
    }
}

Get package details

Returns details of a package

SecuritybearerAuth
Request
path Parameters
scope
required
string (ScopeName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the scope

Example: denoland
package
required
string (PackageName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the package

Example: fmt
Responses
200

OK

400

Invalid request

404

Package not found

get/scopes/{scope}/packages/{package}
Request samples
Response samples
application/json
{
  • "scope": "denoland",
  • "name": "fmt",
  • "description": "A module for formatting strings.",
  • "runtimeCompat": {
    },
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "githubRepository": {
    }
}

Update package

Updates the details of a package

SecuritybearerAuth
Request
path Parameters
scope
required
string (ScopeName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the scope

Example: denoland
package
required
string (PackageName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the package

Example: fmt
Request Body schema: application/json
required

Package properties

One of:
description
required
string^.{0,250}$

The description of the package.

Responses
200

OK

400

Invalid request

401

Unauthorized

403

User is not a scope member / User is not a scope admin

404

Package not found

patch/scopes/{scope}/packages/{package}
Request samples
application/json
{
  • "runtimeCompat": {
    }
}
Response samples
application/json
{
  • "scope": "denoland",
  • "name": "fmt",
  • "description": "A module for formatting strings.",
  • "runtimeCompat": {
    },
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "githubRepository": {
    }
}

Delete package

Deletes a package if the package has no versions

SecuritybearerAuth
Request
path Parameters
scope
required
string (ScopeName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the scope

Example: denoland
package
required
string (PackageName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the package

Example: fmt
Responses
204

OK, no content

400

Invalid request / Package has versions

401

Unauthorized

403

User is not a scope admin

404

Package not found

delete/scopes/{scope}/packages/{package}
Request samples
Response samples
application/json
{
  • "code": "string",
  • "message": "string"
}

List package dependents

Returns a list of packages that depend on a package

SecuritybearerAuth
Request
path Parameters
scope
required
string (ScopeName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the scope

Example: denoland
package
required
string (PackageName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the package

Example: fmt
query Parameters
limit
integer [ 1 .. 100 ]
Default: 20

The maximum number of dependents to return

page
integer >= 1
Default: 1

The page number of dependents to return

versions_per_package_limit
integer [ 1 .. 10 ]
Default: 10

The maximum number of versions per package to return

Responses
200

OK

400

Invalid request

404

Package not found

get/scopes/{scope}/packages/{package}/dependents
Request samples
Response samples
application/json
{
  • "items": [
    ],
  • "total": 0
}

List package versions

Returns a list of versions of a package

SecuritybearerAuth
Request
path Parameters
scope
required
string (ScopeName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the scope

Example: denoland
package
required
string (PackageName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the package

Example: fmt
Responses
200

OK

400

Invalid request

404

Package not found

get/scopes/{scope}/packages/{package}/versions
Request samples
Response samples
application/json
[
  • {
    }
]

Get package version details

Returns details of a package version

SecuritybearerAuth
Request
path Parameters
scope
required
string (ScopeName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the scope

Example: denoland
package
required
string (PackageName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the package

Example: fmt
version
required
string (Version)

The version of the package

Example: 1.2.3
Responses
200

OK

400

Invalid request

404

Package version not found

get/scopes/{scope}/packages/{package}/versions/{version}
Request samples
Response samples
application/json
{
  • "scope": "denoland",
  • "name": "fmt",
  • "version": "1.2.3",
  • "yanked": true,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Create a new package version

Creates a new version of a package

SecuritybearerAuth
Request
path Parameters
scope
required
string (ScopeName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the scope

Example: denoland
package
required
string (PackageName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the package

Example: fmt
version
required
string (Version)

The version of the package

Example: 1.2.3
query Parameters
config
required
string

The path to the config file

Request Body schema: application/octet-stream
required

A gzipped tarball containing all files in the package version

Schema not provided
Responses
200

OK

400

Invalid request / Package version already exists

401

Unauthorized / User is not a scope member

403

User is not a scope member

404

Package not found

post/scopes/{scope}/packages/{package}/versions/{version}
Request samples
Response samples
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "status": "pending",
  • "error": {
    },
  • "userId": "2c4a230c-5085-4924-a3e1-25fb4fc5965b",
  • "packageScope": "denoland",
  • "packageName": "fmt",
  • "packageVersion": "1.2.3",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Update package version

Updates the details of a package version

SecuritybearerAuth
Request
path Parameters
scope
required
string (ScopeName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the scope

Example: denoland
package
required
string (PackageName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the package

Example: fmt
version
required
string (Version)

The version of the package

Example: 1.2.3
Request Body schema: application/json
required

Package version properties

yanked
required
boolean

Whether the version is yanked or not.

Responses
200

OK

400

Invalid request / Package version already exists

401

Unauthorized / User is not a scope member

403

User is not a scope member

404

Package not found

patch/scopes/{scope}/packages/{package}/versions/{version}
Request samples
application/json
{
  • "yanked": true
}
Response samples
application/json
{
  • "scope": "denoland",
  • "name": "fmt",
  • "version": "1.2.3",
  • "yanked": true,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

List the dependencies of a package version

Returns a list of dependencies of a package

SecuritybearerAuth
Request
path Parameters
scope
required
string (ScopeName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the scope

Example: denoland
package
required
string (PackageName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the package

Example: fmt
version
required
string (Version)

The version of the package

Example: 1.2.3
Responses
200

OK

400

Invalid request

404

Package not found

get/scopes/{scope}/packages/{package}/versions/{version}/dependencies
Request samples
Response samples
application/json
[
  • {
    }
]

Get authenticated user's details

Returns details of the authenticated user

SecuritybearerAuth
Responses
200

OK

401

Unauthorized

get/user
Request samples
Response samples
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "name": "Ryan Dahl",
  • "email": "ry@example.com",
  • "githubId": 80,
  • "isBlocked": true,
  • "isStaff": true,
  • "scopeUsage": 3,
  • "scopeLimit": 10,
  • "inviteCount": 3,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

List authenticated user's scopes

Returns a list of scopes that the authenticated user is a member of

SecuritybearerAuth
Responses
200

OK

401

Unauthorized

get/user/scopes
Request samples
Response samples
application/json
[
  • {
    }
]

Get authenticated user's scope member details

Returns details of the authenticated user's membership of a scope

SecuritybearerAuth
Request
path Parameters
scope
required
string (ScopeName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the scope

Example: denoland
Responses
200

OK

401

Unauthorized

get/user/member/{scope}
Request samples
Response samples
application/json
{
  • "scope": "denoland",
  • "user": {
    },
  • "isAdmin": true,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

List authenticated user's scope invites

Returns a list of invites to scopes that the authenticated user has received

SecuritybearerAuth
Responses
200

OK

401

Unauthorized

get/user/invites
Request samples
Response samples
application/json
[
  • {
    }
]

Accept scope invite

Accepts an invite to a scope

SecuritybearerAuth
Request
path Parameters
scope
required
string (ScopeName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the scope to accept the invite for

Example: denoland
Responses
200

OK

401

Unauthorized

404

Scope invite not found

post/user/invites/{scope}
Request samples
Response samples
application/json
{
  • "scope": "denoland",
  • "user": {
    },
  • "isAdmin": true,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Decline scope invite

Declines an invite to a scope

SecuritybearerAuth
Request
path Parameters
scope
required
string (ScopeName) /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/

The name of the scope to decline the invite for

Example: denoland
Responses
204

OK, no content

401

Unauthorized

404

Scope invite not found

delete/user/invites/{scope}
Request samples
Response samples
application/json
{
  • "code": "string",
  • "message": "string"
}

Get user details

Returns details of a user

SecuritybearerAuth
Request
path Parameters
id
required
string <uuid> (UserId)

The ID of the user

Responses
200

OK

404

User not found

get/users/{id}
Request samples
Response samples
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "name": "Ryan Dahl",
  • "email": "ry@example.com",
  • "githubId": 80,
  • "isBlocked": true,
  • "isStaff": true,
  • "scopeUsage": 3,
  • "scopeLimit": 10,
  • "inviteCount": 3,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

List user's scopes

Returns a list of scopes that a user is a member of

SecuritybearerAuth
Request
path Parameters
id
required
string <uuid> (UserId)

The ID of the user

Responses
200

OK

404

User not found

get/users/{id}/scopes
Request samples
Response samples
application/json
[
  • {
    }
]

Create authorization

Starts an authorization flow

SecuritybearerAuth
Request
Request Body schema: application/json
required

Authorization properties

challenge
required
string

The challenge that will later be needed to retrieve the token after authorization.

Array of objects or objects or objects (Permission)

The permissions that the token will have.

Responses
200

OK

400

Invalid request

post/authorizations
Request samples
application/json
{
  • "challenge": "1234567890abcdef",
  • "permissions": [
    ]
}
Response samples
application/json
{
  • "verificationUrl": "string",
  • "code": "string",
  • "exchangeToken": "string",
  • "pollInterval": 0,
  • "expiresAt": "2019-08-24T14:15:22Z"
}

Get authorization details

Returns details of an authorization

SecuritybearerAuth
Request
path Parameters
code
required
string

The code of the authorization

Responses
200

OK

404

Authorization not found

get/authorizations/details/{code}
Request samples
Response samples
application/json
{
  • "code": "string",
  • "permissions": [
    ],
  • "expiresAt": "2019-08-24T14:15:22Z"
}

Approve authorization

Approves an authorization

SecuritybearerAuth
Request
path Parameters
code
required
string

The code of the authorization

Responses
204

OK, no content

401

Unauthorized

404

Authorization not found

post/authorizations/approve/{code}
Request samples
Response samples
application/json
{
  • "code": "string",
  • "message": "string"
}

Deny authorization

Denies an authorization

SecuritybearerAuth
Request
path Parameters
code
required
string

The code of the authorization

Responses
204

OK, no content

401

Unauthorized

404

Authorization not found

post/authorizations/deny/{code}
Request samples
Response samples
application/json
{
  • "code": "string",
  • "message": "string"
}

Exchange authorization code for access token

Exchanges an authorization code for an access token

SecuritybearerAuth
Request
Request Body schema: application/json
required
exchangeToken
required
string

The token that can be used to exchange for a device token after the authorization has been approved.

verifier
required
string

The verifier that was used to generate the challenge.

Responses
200

OK

400

Invalid request

post/authorizations/exchange
Request samples
application/json
{
  • "exchangeToken": "string",
  • "verifier": "string"
}
Response samples
application/json
{
  • "token": "string",
  • "user": {
    }
}

Get publishing task details

Returns details of a publishing task

SecuritybearerAuth
Request
path Parameters
id
required
string

The ID of the publishing task

Responses
200

OK

404

Publishing task not found

get/publishing_tasks/{id}
Request samples
Response samples
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "status": "pending",
  • "error": {
    },
  • "userId": "2c4a230c-5085-4924-a3e1-25fb4fc5965b",
  • "packageScope": "denoland",
  • "packageName": "fmt",
  • "packageVersion": "1.2.3",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Get stats

Returns stats about the registry

SecuritybearerAuth
Responses
200

OK

get/stats
Request samples
Response samples
application/json
{
  • "newest": [
    ],
  • "updated": [
    ]
}