Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/interactions/getRestrictionsForAuthenticatedUser.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Get interaction restrictions for your public repositories
example: octokit.interactions.getRestrictionsForAuthenticatedUser()
route: GET /user/interaction-limits
scope: interactions
type: API method
---

# Get interaction restrictions for your public repositories

Shows which type of GitHub user can interact with your public repositories and when the restriction expires. If there are no restrictions, you will see an empty response.

```js
octokit.interactions.getRestrictionsForAuthenticatedUser();
```

## Parameters

This endpoint has no parameters

See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/interactions#get-interaction-restrictions-for-your-public-repositories).
2 changes: 2 additions & 0 deletions docs/interactions/getRestrictionsForYourPublicRepos.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ type: API method

# Get interaction restrictions for your public repositories

**Deprecated:** This method has been renamed to interactions.getRestrictionsForAuthenticatedUser

Shows which type of GitHub user can interact with your public repositories and when the restriction expires. If there are no restrictions, you will see an empty response.

```js
Expand Down
21 changes: 21 additions & 0 deletions docs/interactions/removeRestrictionsForAuthenticatedUser.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Remove interaction restrictions from your public repositories
example: octokit.interactions.removeRestrictionsForAuthenticatedUser()
route: DELETE /user/interaction-limits
scope: interactions
type: API method
---

# Remove interaction restrictions from your public repositories

Removes any interaction restrictions from your public repositories.

```js
octokit.interactions.removeRestrictionsForAuthenticatedUser();
```

## Parameters

This endpoint has no parameters

See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/interactions#remove-interaction-restrictions-from-your-public-repositories).
2 changes: 2 additions & 0 deletions docs/interactions/removeRestrictionsForYourPublicRepos.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ type: API method

# Remove interaction restrictions from your public repositories

**Deprecated:** This method has been renamed to interactions.removeRestrictionsForAuthenticatedUser

Removes any interaction restrictions from your public repositories.

```js
Expand Down
43 changes: 43 additions & 0 deletions docs/interactions/setRestrictionsForAuthenticatedUser.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Set interaction restrictions for your public repositories
example: octokit.interactions.setRestrictionsForAuthenticatedUser({ limit })
route: PUT /user/interaction-limits
scope: interactions
type: API method
---

# Set interaction restrictions for your public repositories

Temporarily restricts which type of GitHub user can interact with your public repositories. Setting the interaction limit at the user level will overwrite any interaction limits that are set for individual repositories owned by the user.

```js
octokit.interactions.setRestrictionsForAuthenticatedUser({
limit,
});
```

## Parameters

<table>
<thead>
<tr>
<th>name</th>
<th>required</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr><td>limit</td><td>yes</td><td>

The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. Can be one of: `existing_users`, `contributors_only`, `collaborators_only`.

</td></tr>
<tr><td>expiry</td><td>no</td><td>

The duration of the interaction restriction. Can be one of: `one_day`, `three_days`, `one_week`, `one_month`, `six_months`. Default: `one_day`.

</td></tr>
</tbody>
</table>

See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/interactions#set-interaction-restrictions-for-your-public-repositories).
2 changes: 2 additions & 0 deletions docs/interactions/setRestrictionsForYourPublicRepos.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ type: API method

# Set interaction restrictions for your public repositories

**Deprecated:** This method has been renamed to interactions.setRestrictionsForAuthenticatedUser

Temporarily restricts which type of GitHub user can interact with your public repositories. Setting the interaction limit at the user level will overwrite any interaction limits that are set for individual repositories owned by the user.

```js
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"author": "Gregor Martynus (https://twitter.com/gr2m)",
"license": "MIT",
"dependencies": {
"@octokit/types": "^6.8.0",
"@octokit/types": "^6.8.1",
"deprecation": "^2.3.1"
},
"devDependencies": {
Expand Down
139 changes: 138 additions & 1 deletion scripts/update-endpoints/generated/endpoints.json
Original file line number Diff line number Diff line change
Expand Up @@ -14450,6 +14450,32 @@
],
"renamed": null
},
{
"name": "Get interaction restrictions for your public repositories",
"scope": "interactions",
"id": "getRestrictionsForAuthenticatedUser",
"method": "GET",
"url": "/user/interaction-limits",
"isDeprecated": false,
"deprecationDate": null,
"description": "Shows which type of GitHub user can interact with your public repositories and when the restriction expires. If there are no restrictions, you will see an empty response.",
"documentationUrl": "https://docs.github.com/rest/reference/interactions#get-interaction-restrictions-for-your-public-repositories",
"previews": [],
"headers": [],
"parameters": [],
"responses": [
{
"code": 200,
"description": "response",
"examples": [
{
"data": "{\"limit\":\"collaborators_only\",\"origin\":\"user\",\"expires_at\":\"2018-08-17T04:18:39Z\"}"
}
]
}
],
"renamed": null
},
{
"name": "Get interaction restrictions for an organization",
"scope": "interactions",
Expand Down Expand Up @@ -14567,6 +14593,35 @@
]
}
],
"renamed": {
"before": {
"scope": "interactions",
"id": "getRestrictionsForYourPublicRepos"
},
"after": {
"scope": "interactions",
"id": "getRestrictionsForAuthenticatedUser"
},
"date": "2021-02-02",
"note": null
}
},
{
"name": "Remove interaction restrictions from your public repositories",
"scope": "interactions",
"id": "removeRestrictionsForAuthenticatedUser",
"method": "DELETE",
"url": "/user/interaction-limits",
"isDeprecated": false,
"deprecationDate": null,
"description": "Removes any interaction restrictions from your public repositories.",
"documentationUrl": "https://docs.github.com/rest/reference/interactions#remove-interaction-restrictions-from-your-public-repositories",
"previews": [],
"headers": [],
"parameters": [],
"responses": [
{ "code": 204, "description": "Empty response", "examples": null }
],
"renamed": null
},
{
Expand Down Expand Up @@ -14663,6 +14718,77 @@
"responses": [
{ "code": 204, "description": "Empty response", "examples": null }
],
"renamed": {
"before": {
"scope": "interactions",
"id": "removeRestrictionsForYourPublicRepos"
},
"after": {
"scope": "interactions",
"id": "removeRestrictionsForAuthenticatedUser"
},
"date": "2021-02-02",
"note": null
}
},
{
"name": "Set interaction restrictions for your public repositories",
"scope": "interactions",
"id": "setRestrictionsForAuthenticatedUser",
"method": "PUT",
"url": "/user/interaction-limits",
"isDeprecated": false,
"deprecationDate": null,
"description": "Temporarily restricts which type of GitHub user can interact with your public repositories. Setting the interaction limit at the user level will overwrite any interaction limits that are set for individual repositories owned by the user.",
"documentationUrl": "https://docs.github.com/rest/reference/interactions#set-interaction-restrictions-for-your-public-repositories",
"previews": [],
"headers": [],
"parameters": [
{
"name": "limit",
"description": "The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. Can be one of: `existing_users`, `contributors_only`, `collaborators_only`.",
"in": "BODY",
"type": "string",
"required": true,
"enum": ["existing_users", "contributors_only", "collaborators_only"],
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "expiry",
"description": "The duration of the interaction restriction. Can be one of: `one_day`, `three_days`, `one_week`, `one_month`, `six_months`. Default: `one_day`.",
"in": "BODY",
"type": "string",
"required": false,
"enum": [
"one_day",
"three_days",
"one_week",
"one_month",
"six_months"
],
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [
{
"code": 200,
"description": "response",
"examples": [
{
"data": "{\"limit\":\"collaborators_only\",\"origin\":\"user\",\"expires_at\":\"2018-08-17T04:18:39Z\"}"
}
]
},
{ "code": 422, "description": "Validation Failed", "examples": null }
],
"renamed": null
},
{
Expand Down Expand Up @@ -14882,7 +15008,18 @@
},
{ "code": 422, "description": "Validation Failed", "examples": null }
],
"renamed": null
"renamed": {
"before": {
"scope": "interactions",
"id": "setRestrictionsForYourPublicRepos"
},
"after": {
"scope": "interactions",
"id": "setRestrictionsForAuthenticatedUser"
},
"date": "2021-02-02",
"note": null
}
},
{
"name": "Add assignees to an issue",
Expand Down
21 changes: 18 additions & 3 deletions src/generated/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,17 +381,32 @@ const Endpoints: EndpointsDefaultsAndDecorations = {
getTemplate: ["GET /gitignore/templates/{name}"],
},
interactions: {
getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"],
getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"],
getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"],
getRestrictionsForYourPublicRepos: ["GET /user/interaction-limits"],
getRestrictionsForYourPublicRepos: [
"GET /user/interaction-limits",
{},
{ renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] },
],
removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"],
removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"],
removeRestrictionsForRepo: [
"DELETE /repos/{owner}/{repo}/interaction-limits",
],
removeRestrictionsForYourPublicRepos: ["DELETE /user/interaction-limits"],
removeRestrictionsForYourPublicRepos: [
"DELETE /user/interaction-limits",
{},
{ renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] },
],
setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"],
setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"],
setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"],
setRestrictionsForYourPublicRepos: ["PUT /user/interaction-limits"],
setRestrictionsForYourPublicRepos: [
"PUT /user/interaction-limits",
{},
{ renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] },
],
},
issues: {
addAssignees: [
Expand Down
Loading