Skip to content

Commit 16d8ba5

Browse files
authored
feat: octokit.packages.deletePackageForAuthenticatedUser(), octokit.packages.deletePackageForOrg(), octokit.packages.deletePackageVersionForAuthenticatedUser(), octokit.packages.deletePackageVersionForOrg(), octokit.packages.getAllPackageVersionsForAPackageOwnedByAnOrg(), octokit.packages.getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser(), octokit.packages.getAllPackageVersionsForPackageOwnedByUser(), octokit.packages.getPackageForAuthenticatedUser(), octokit.packages.getPackageForOrganization(), octokit.packages.getPackageForUser(), octokit.packages.getPackageVersionForAuthenticatedUser(), octokit.packages.getPackageVersionForOrganization(), octokit.packages.getPackageVersionForUser(), octokit.packages.restorePackageForAuthenticatedUser(), octokit.packages.restorePackageForOrg(), octokit.packages.restorePackageVersionForAuthenticatedUser(), octokit.packages.restorePackageVersionForOrg() (#347)
1 parent d34f479 commit 16d8ba5

22 files changed

+2511
-3
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
name: Delete a package for the authenticated user
3+
example: octokit.packages.deletePackageForAuthenticatedUser({ package_type, package_name })
4+
route: DELETE /user/packages/{package_type}/{package_name}
5+
scope: packages
6+
type: API method
7+
---
8+
9+
# Delete a package for the authenticated user
10+
11+
Deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 25 downloads. In this scenario, contact GitHub support for further assistance.
12+
13+
To use this endpoint, you must authenticate using an access token with the `packages:read` and `packages:delete` scope.
14+
If `package_type` is not `container`, your token must also include the `repo` scope.
15+
16+
```js
17+
octokit.packages.deletePackageForAuthenticatedUser({
18+
package_type,
19+
package_name,
20+
});
21+
```
22+
23+
## Parameters
24+
25+
<table>
26+
<thead>
27+
<tr>
28+
<th>name</th>
29+
<th>required</th>
30+
<th>description</th>
31+
</tr>
32+
</thead>
33+
<tbody>
34+
<tr><td>package_type</td><td>yes</td><td>
35+
36+
The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. For Docker images that use the package namespace `https://ghcr.io/owner/package-name`, use `container`.
37+
38+
</td></tr>
39+
<tr><td>package_name</td><td>yes</td><td>
40+
41+
The name of the package.
42+
43+
</td></tr>
44+
</tbody>
45+
</table>
46+
47+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/packages#delete-a-package-for-the-authenticated-user).
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
name: Delete a package for an organization
3+
example: octokit.packages.deletePackageForOrg({ package_type, package_name, org })
4+
route: DELETE /orgs/{org}/packages/{package_type}/{package_name}
5+
scope: packages
6+
type: API method
7+
---
8+
9+
# Delete a package for an organization
10+
11+
Deletes an entire package in an organization. You cannot delete a public package if any version of the package has more than 25 downloads. In this scenario, contact GitHub support for further assistance.
12+
13+
To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `packages:read` scope. In addition:
14+
15+
- If `package_type` is not `container`, your token must also include the `repo` scope.
16+
- If `package_type` is `container`, you must also have admin permissions to the container you want to delete.
17+
18+
```js
19+
octokit.packages.deletePackageForOrg({
20+
package_type,
21+
package_name,
22+
org,
23+
});
24+
```
25+
26+
## Parameters
27+
28+
<table>
29+
<thead>
30+
<tr>
31+
<th>name</th>
32+
<th>required</th>
33+
<th>description</th>
34+
</tr>
35+
</thead>
36+
<tbody>
37+
<tr><td>package_type</td><td>yes</td><td>
38+
39+
The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. For Docker images that use the package namespace `https://ghcr.io/owner/package-name`, use `container`.
40+
41+
</td></tr>
42+
<tr><td>package_name</td><td>yes</td><td>
43+
44+
The name of the package.
45+
46+
</td></tr>
47+
<tr><td>org</td><td>yes</td><td>
48+
49+
</td></tr>
50+
</tbody>
51+
</table>
52+
53+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/packages#delete-a-package-for-an-organization).
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
name: Delete a package version for the authenticated user
3+
example: octokit.packages.deletePackageVersionForAuthenticatedUser({ package_type, package_name, package_version_id })
4+
route: DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}
5+
scope: packages
6+
type: API method
7+
---
8+
9+
# Delete a package version for the authenticated user
10+
11+
Deletes a specific package version for a package owned by the authenticated user. If the package is public and the package version has more than 25 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.
12+
13+
To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `packages:read` scope.
14+
If `package_type` is not `container`, your token must also include the `repo` scope.
15+
16+
```js
17+
octokit.packages.deletePackageVersionForAuthenticatedUser({
18+
package_type,
19+
package_name,
20+
package_version_id,
21+
});
22+
```
23+
24+
## Parameters
25+
26+
<table>
27+
<thead>
28+
<tr>
29+
<th>name</th>
30+
<th>required</th>
31+
<th>description</th>
32+
</tr>
33+
</thead>
34+
<tbody>
35+
<tr><td>package_type</td><td>yes</td><td>
36+
37+
The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. For Docker images that use the package namespace `https://ghcr.io/owner/package-name`, use `container`.
38+
39+
</td></tr>
40+
<tr><td>package_name</td><td>yes</td><td>
41+
42+
The name of the package.
43+
44+
</td></tr>
45+
<tr><td>package_version_id</td><td>yes</td><td>
46+
47+
Unique identifier of the package version.
48+
49+
</td></tr>
50+
</tbody>
51+
</table>
52+
53+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/packages#delete-a-package-version-for-the-authenticated-user).
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
name: Delete package version for an organization
3+
example: octokit.packages.deletePackageVersionForOrg({ package_type, package_name, org, package_version_id })
4+
route: DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}
5+
scope: packages
6+
type: API method
7+
---
8+
9+
# Delete package version for an organization
10+
11+
Deletes a specific package version in an organization. If the package is public and the package version has more than 25 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.
12+
13+
To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `packages:read` scope. In addition:
14+
15+
- If `package_type` is not `container`, your token must also include the `repo` scope.
16+
- If `package_type` is `container`, you must also have admin permissions to the container you want to delete.
17+
18+
```js
19+
octokit.packages.deletePackageVersionForOrg({
20+
package_type,
21+
package_name,
22+
org,
23+
package_version_id,
24+
});
25+
```
26+
27+
## Parameters
28+
29+
<table>
30+
<thead>
31+
<tr>
32+
<th>name</th>
33+
<th>required</th>
34+
<th>description</th>
35+
</tr>
36+
</thead>
37+
<tbody>
38+
<tr><td>package_type</td><td>yes</td><td>
39+
40+
The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. For Docker images that use the package namespace `https://ghcr.io/owner/package-name`, use `container`.
41+
42+
</td></tr>
43+
<tr><td>package_name</td><td>yes</td><td>
44+
45+
The name of the package.
46+
47+
</td></tr>
48+
<tr><td>org</td><td>yes</td><td>
49+
50+
</td></tr>
51+
<tr><td>package_version_id</td><td>yes</td><td>
52+
53+
Unique identifier of the package version.
54+
55+
</td></tr>
56+
</tbody>
57+
</table>
58+
59+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/packages#delete-a-package-version-for-an-organization).
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
name: Get all package versions for a package owned by an organization
3+
example: octokit.packages.getAllPackageVersionsForAPackageOwnedByAnOrg({ package_type, package_name, org })
4+
route: GET /orgs/{org}/packages/{package_type}/{package_name}/versions
5+
scope: packages
6+
type: API method
7+
---
8+
9+
# Get all package versions for a package owned by an organization
10+
11+
Returns all package versions for a package owned by an organization.
12+
13+
To use this endpoint, you must authenticate using an access token with the `packages:read` scope.
14+
If `package_type` is not `container`, your token must also include the `repo` scope.
15+
16+
```js
17+
octokit.packages.getAllPackageVersionsForAPackageOwnedByAnOrg({
18+
package_type,
19+
package_name,
20+
org,
21+
});
22+
```
23+
24+
## Parameters
25+
26+
<table>
27+
<thead>
28+
<tr>
29+
<th>name</th>
30+
<th>required</th>
31+
<th>description</th>
32+
</tr>
33+
</thead>
34+
<tbody>
35+
<tr><td>package_type</td><td>yes</td><td>
36+
37+
The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. For Docker images that use the package namespace `https://ghcr.io/owner/package-name`, use `container`.
38+
39+
</td></tr>
40+
<tr><td>package_name</td><td>yes</td><td>
41+
42+
The name of the package.
43+
44+
</td></tr>
45+
<tr><td>org</td><td>yes</td><td>
46+
47+
</td></tr>
48+
</tbody>
49+
</table>
50+
51+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/packages#get-all-package-versions-for-a-package-owned-by-the-authenticated-user).
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
name: Get all package versions for a package owned by the authenticated user
3+
example: octokit.packages.getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser({ package_type, package_name })
4+
route: GET /user/packages/{package_type}/{package_name}/versions
5+
scope: packages
6+
type: API method
7+
---
8+
9+
# Get all package versions for a package owned by the authenticated user
10+
11+
Returns all package versions for a package owned by the authenticated user.
12+
13+
To use this endpoint, you must authenticate using an access token with the `packages:read` scope.
14+
If `package_type` is not `container`, your token must also include the `repo` scope.
15+
16+
```js
17+
octokit.packages.getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser({
18+
package_type,
19+
package_name,
20+
});
21+
```
22+
23+
## Parameters
24+
25+
<table>
26+
<thead>
27+
<tr>
28+
<th>name</th>
29+
<th>required</th>
30+
<th>description</th>
31+
</tr>
32+
</thead>
33+
<tbody>
34+
<tr><td>package_type</td><td>yes</td><td>
35+
36+
The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. For Docker images that use the package namespace `https://ghcr.io/owner/package-name`, use `container`.
37+
38+
</td></tr>
39+
<tr><td>package_name</td><td>yes</td><td>
40+
41+
The name of the package.
42+
43+
</td></tr>
44+
</tbody>
45+
</table>
46+
47+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/packages#get-all-package-versions-for-a-package-owned-by-the-authenticated-user).
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
name: Get all package versions for a package owned by a user
3+
example: octokit.packages.getAllPackageVersionsForPackageOwnedByUser({ package_type, package_name, username })
4+
route: GET /users/{username}/packages/{package_type}/{package_name}/versions
5+
scope: packages
6+
type: API method
7+
---
8+
9+
# Get all package versions for a package owned by a user
10+
11+
Returns all package versions for a public package owned by a specified user.
12+
13+
To use this endpoint, you must authenticate using an access token with the `packages:read` scope.
14+
If `package_type` is not `container`, your token must also include the `repo` scope.
15+
16+
```js
17+
octokit.packages.getAllPackageVersionsForPackageOwnedByUser({
18+
package_type,
19+
package_name,
20+
username,
21+
});
22+
```
23+
24+
## Parameters
25+
26+
<table>
27+
<thead>
28+
<tr>
29+
<th>name</th>
30+
<th>required</th>
31+
<th>description</th>
32+
</tr>
33+
</thead>
34+
<tbody>
35+
<tr><td>package_type</td><td>yes</td><td>
36+
37+
The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. For Docker images that use the package namespace `https://ghcr.io/owner/package-name`, use `container`.
38+
39+
</td></tr>
40+
<tr><td>package_name</td><td>yes</td><td>
41+
42+
The name of the package.
43+
44+
</td></tr>
45+
<tr><td>username</td><td>yes</td><td>
46+
47+
</td></tr>
48+
</tbody>
49+
</table>
50+
51+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/packages#get-all-package-versions-for-a-package-owned-by-a-user).

0 commit comments

Comments
 (0)