diff --git a/docs/interactions/getRestrictionsForAuthenticatedUser.md b/docs/interactions/getRestrictionsForAuthenticatedUser.md
new file mode 100644
index 000000000..34050cfed
--- /dev/null
+++ b/docs/interactions/getRestrictionsForAuthenticatedUser.md
@@ -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).
diff --git a/docs/interactions/getRestrictionsForYourPublicRepos.md b/docs/interactions/getRestrictionsForYourPublicRepos.md
index 800bae772..51f165c2d 100644
--- a/docs/interactions/getRestrictionsForYourPublicRepos.md
+++ b/docs/interactions/getRestrictionsForYourPublicRepos.md
@@ -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
diff --git a/docs/interactions/removeRestrictionsForAuthenticatedUser.md b/docs/interactions/removeRestrictionsForAuthenticatedUser.md
new file mode 100644
index 000000000..83fdbef4f
--- /dev/null
+++ b/docs/interactions/removeRestrictionsForAuthenticatedUser.md
@@ -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).
diff --git a/docs/interactions/removeRestrictionsForYourPublicRepos.md b/docs/interactions/removeRestrictionsForYourPublicRepos.md
index 3b054e89c..45efc0e96 100644
--- a/docs/interactions/removeRestrictionsForYourPublicRepos.md
+++ b/docs/interactions/removeRestrictionsForYourPublicRepos.md
@@ -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
diff --git a/docs/interactions/setRestrictionsForAuthenticatedUser.md b/docs/interactions/setRestrictionsForAuthenticatedUser.md
new file mode 100644
index 000000000..2eb3fc7e0
--- /dev/null
+++ b/docs/interactions/setRestrictionsForAuthenticatedUser.md
@@ -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
+
+
+
+
+ | name |
+ required |
+ description |
+
+
+
+ | limit | yes |
+
+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`.
+
+ |
+| expiry | no |
+
+The duration of the interaction restriction. Can be one of: `one_day`, `three_days`, `one_week`, `one_month`, `six_months`. Default: `one_day`.
+
+ |
+
+
+
+See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/interactions#set-interaction-restrictions-for-your-public-repositories).
diff --git a/docs/interactions/setRestrictionsForYourPublicRepos.md b/docs/interactions/setRestrictionsForYourPublicRepos.md
index 5368252d5..bf215742b 100644
--- a/docs/interactions/setRestrictionsForYourPublicRepos.md
+++ b/docs/interactions/setRestrictionsForYourPublicRepos.md
@@ -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
diff --git a/package-lock.json b/package-lock.json
index badd653a5..e8ce172b6 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1749,9 +1749,9 @@
}
},
"@octokit/openapi-types": {
- "version": "3.5.0",
- "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-3.5.0.tgz",
- "integrity": "sha512-LP15nQhxVblxoA9sKxSnrnJVIZEwTV9DZ16s01DtpttKWvg2lfg+zSWjveuO81c7CiX+HpBYPdUuzM2rvv1+Sw=="
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-4.0.0.tgz",
+ "integrity": "sha512-o4Q9VPYaIdzxskfVuWk7Dcb6Ldq2xbd1QKmPCRx29nFdFxm+2Py74QLfbB3CgankZerHnNJ9wgINOkwa/O2qRg=="
},
"@octokit/plugin-paginate-rest": {
"version": "2.9.0",
@@ -1818,11 +1818,11 @@
}
},
"@octokit/types": {
- "version": "6.8.0",
- "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.8.0.tgz",
- "integrity": "sha512-YZ/IKzpGhgeveAZ/OF1a6iCgBEDYx6p27/+mgj9/Xe+iBMVanQYWJ2XzgrI/pDEKZvxfNbK+X7eibxa0JpyZjg==",
+ "version": "6.8.1",
+ "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.8.1.tgz",
+ "integrity": "sha512-FJk8S+UbchvZ6CNAcqNR5mK88f0LWoC6rlVEoZ81gGIzfZsePHqnm5TvXcOQ/0PaClLxO+Fd2SvjWeuGE6PEgA==",
"requires": {
- "@octokit/openapi-types": "^3.5.0",
+ "@octokit/openapi-types": "^4.0.0",
"@types/node": ">= 8"
}
},
diff --git a/package.json b/package.json
index c8a2d570f..383fb30bb 100644
--- a/package.json
+++ b/package.json
@@ -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": {
diff --git a/scripts/update-endpoints/generated/endpoints.json b/scripts/update-endpoints/generated/endpoints.json
index 84fd80eba..255c72bea 100644
--- a/scripts/update-endpoints/generated/endpoints.json
+++ b/scripts/update-endpoints/generated/endpoints.json
@@ -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",
@@ -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
},
{
@@ -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
},
{
@@ -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",
diff --git a/src/generated/endpoints.ts b/src/generated/endpoints.ts
index 16d07a636..dd6bc6613 100644
--- a/src/generated/endpoints.ts
+++ b/src/generated/endpoints.ts
@@ -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: [
diff --git a/src/generated/method-types.ts b/src/generated/method-types.ts
index 2bbfa0593..5b95ab1b7 100644
--- a/src/generated/method-types.ts
+++ b/src/generated/method-types.ts
@@ -2782,6 +2782,18 @@ export type RestEndpointMethods = {
};
};
interactions: {
+ /**
+ * 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.
+ */
+ getRestrictionsForAuthenticatedUser: {
+ (
+ params?: RestEndpointMethodTypes["interactions"]["getRestrictionsForAuthenticatedUser"]["parameters"]
+ ): Promise<
+ RestEndpointMethodTypes["interactions"]["getRestrictionsForAuthenticatedUser"]["response"]
+ >;
+ defaults: RequestInterface["defaults"];
+ endpoint: EndpointInterface<{ url: string }>;
+ };
/**
* Shows which type of GitHub user can interact with this organization and when the restriction expires. If there is no restrictions, you will see an empty response.
*/
@@ -2808,6 +2820,7 @@ export type RestEndpointMethods = {
};
/**
* 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.
+ * @deprecated octokit.interactions.getRestrictionsForYourPublicRepos() has been renamed to octokit.interactions.getRestrictionsForAuthenticatedUser() (2021-02-02)
*/
getRestrictionsForYourPublicRepos: {
(
@@ -2818,6 +2831,18 @@ export type RestEndpointMethods = {
defaults: RequestInterface["defaults"];
endpoint: EndpointInterface<{ url: string }>;
};
+ /**
+ * Removes any interaction restrictions from your public repositories.
+ */
+ removeRestrictionsForAuthenticatedUser: {
+ (
+ params?: RestEndpointMethodTypes["interactions"]["removeRestrictionsForAuthenticatedUser"]["parameters"]
+ ): Promise<
+ RestEndpointMethodTypes["interactions"]["removeRestrictionsForAuthenticatedUser"]["response"]
+ >;
+ defaults: RequestInterface["defaults"];
+ endpoint: EndpointInterface<{ url: string }>;
+ };
/**
* Removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions.
*/
@@ -2844,6 +2869,7 @@ export type RestEndpointMethods = {
};
/**
* Removes any interaction restrictions from your public repositories.
+ * @deprecated octokit.interactions.removeRestrictionsForYourPublicRepos() has been renamed to octokit.interactions.removeRestrictionsForAuthenticatedUser() (2021-02-02)
*/
removeRestrictionsForYourPublicRepos: {
(
@@ -2854,6 +2880,18 @@ export type RestEndpointMethods = {
defaults: RequestInterface["defaults"];
endpoint: EndpointInterface<{ url: string }>;
};
+ /**
+ * 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.
+ */
+ setRestrictionsForAuthenticatedUser: {
+ (
+ params?: RestEndpointMethodTypes["interactions"]["setRestrictionsForAuthenticatedUser"]["parameters"]
+ ): Promise<
+ RestEndpointMethodTypes["interactions"]["setRestrictionsForAuthenticatedUser"]["response"]
+ >;
+ defaults: RequestInterface["defaults"];
+ endpoint: EndpointInterface<{ url: string }>;
+ };
/**
* Temporarily restricts interactions to a certain type of GitHub user in any public repository in the given organization. You must be an organization owner to set these restrictions. Setting the interaction limit at the organization level will overwrite any interaction limits that are set for individual repositories owned by the organization.
*/
@@ -2880,6 +2918,7 @@ export type RestEndpointMethods = {
};
/**
* 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.
+ * @deprecated octokit.interactions.setRestrictionsForYourPublicRepos() has been renamed to octokit.interactions.setRestrictionsForAuthenticatedUser() (2021-02-02)
*/
setRestrictionsForYourPublicRepos: {
(
diff --git a/src/generated/parameters-and-response-types.ts b/src/generated/parameters-and-response-types.ts
index de8d26789..d5ec21a6c 100644
--- a/src/generated/parameters-and-response-types.ts
+++ b/src/generated/parameters-and-response-types.ts
@@ -1594,6 +1594,14 @@ export type RestEndpointMethodTypes = {
};
};
interactions: {
+ getRestrictionsForAuthenticatedUser: {
+ parameters: RequestParameters &
+ Omit<
+ Endpoints["GET /user/interaction-limits"]["parameters"],
+ "baseUrl" | "headers" | "mediaType"
+ >;
+ response: Endpoints["GET /user/interaction-limits"]["response"];
+ };
getRestrictionsForOrg: {
parameters: RequestParameters &
Omit<
@@ -1618,6 +1626,14 @@ export type RestEndpointMethodTypes = {
>;
response: Endpoints["GET /user/interaction-limits"]["response"];
};
+ removeRestrictionsForAuthenticatedUser: {
+ parameters: RequestParameters &
+ Omit<
+ Endpoints["DELETE /user/interaction-limits"]["parameters"],
+ "baseUrl" | "headers" | "mediaType"
+ >;
+ response: Endpoints["DELETE /user/interaction-limits"]["response"];
+ };
removeRestrictionsForOrg: {
parameters: RequestParameters &
Omit<
@@ -1642,6 +1658,14 @@ export type RestEndpointMethodTypes = {
>;
response: Endpoints["DELETE /user/interaction-limits"]["response"];
};
+ setRestrictionsForAuthenticatedUser: {
+ parameters: RequestParameters &
+ Omit<
+ Endpoints["PUT /user/interaction-limits"]["parameters"],
+ "baseUrl" | "headers" | "mediaType"
+ >;
+ response: Endpoints["PUT /user/interaction-limits"]["response"];
+ };
setRestrictionsForOrg: {
parameters: RequestParameters &
Omit<