Skip to content

Commit e7988d9

Browse files
committedDec 1, 2020
feat: octokit.interactions.{getRestrictionsForYourPublicRepos,removeRestrictionsForYourPublicRepos,setRestrictionsForYourPublicRepos}
1 parent ddaa863 commit e7988d9

File tree

3 files changed

+76
-8
lines changed

3 files changed

+76
-8
lines changed
 

‎src/generated/endpoints.ts

+3
Original file line numberDiff line numberDiff line change
@@ -382,12 +382,15 @@ const Endpoints: EndpointsDefaultsAndDecorations = {
382382
interactions: {
383383
getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"],
384384
getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"],
385+
getRestrictionsForYourPublicRepos: ["GET /user/interaction-limits"],
385386
removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"],
386387
removeRestrictionsForRepo: [
387388
"DELETE /repos/{owner}/{repo}/interaction-limits",
388389
],
390+
removeRestrictionsForYourPublicRepos: ["DELETE /user/interaction-limits"],
389391
setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"],
390392
setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"],
393+
setRestrictionsForYourPublicRepos: ["PUT /user/interaction-limits"],
391394
},
392395
issues: {
393396
addAssignees: [

‎src/generated/method-types.ts

+49-8
Original file line numberDiff line numberDiff line change
@@ -2105,7 +2105,7 @@ export type RestEndpointMethods = {
21052105
endpoint: EndpointInterface<{ url: string }>;
21062106
};
21072107
/**
2108-
* Lists all open code scanning alerts for the default branch (usually `master`) and protected branches in a repository. For private repos, you must use an access token with the `repo` scope. For public repos, you must use an access token with `public_repo` and `repo:security_events` scopes. GitHub Apps must have the `security_events` read permission to use this endpoint.
2108+
* Lists all open code scanning alerts for the default branch (usually `main` or `master`). For private repos, you must use an access token with the `repo` scope. For public repos, you must use an access token with `public_repo` and `repo:security_events` scopes. GitHub Apps must have the `security_events` read permission to use this endpoint.
21092109
*/
21102110
listAlertsForRepo: {
21112111
(
@@ -2781,7 +2781,7 @@ export type RestEndpointMethods = {
27812781
};
27822782
interactions: {
27832783
/**
2784-
* Shows which group of GitHub users can interact with this organization and when the restriction expires. If there are no restrictions, you will see an empty response.
2784+
* 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.
27852785
*/
27862786
getRestrictionsForOrg: {
27872787
(
@@ -2793,7 +2793,7 @@ export type RestEndpointMethods = {
27932793
endpoint: EndpointInterface<{ url: string }>;
27942794
};
27952795
/**
2796-
* Shows which group of GitHub users can interact with this repository and when the restriction expires. If there are no restrictions, you will see an empty response.
2796+
* Shows which type of GitHub user can interact with this repository and when the restriction expires. If there are no restrictions, you will see an empty response.
27972797
*/
27982798
getRestrictionsForRepo: {
27992799
(
@@ -2804,6 +2804,18 @@ export type RestEndpointMethods = {
28042804
defaults: RequestInterface["defaults"];
28052805
endpoint: EndpointInterface<{ url: string }>;
28062806
};
2807+
/**
2808+
* 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.
2809+
*/
2810+
getRestrictionsForYourPublicRepos: {
2811+
(
2812+
params?: RestEndpointMethodTypes["interactions"]["getRestrictionsForYourPublicRepos"]["parameters"]
2813+
): Promise<
2814+
RestEndpointMethodTypes["interactions"]["getRestrictionsForYourPublicRepos"]["response"]
2815+
>;
2816+
defaults: RequestInterface["defaults"];
2817+
endpoint: EndpointInterface<{ url: string }>;
2818+
};
28072819
/**
28082820
* Removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions.
28092821
*/
@@ -2817,7 +2829,7 @@ export type RestEndpointMethods = {
28172829
endpoint: EndpointInterface<{ url: string }>;
28182830
};
28192831
/**
2820-
* Removes all interaction restrictions from the given repository. You must have owner or admin access to remove restrictions.
2832+
* Removes all interaction restrictions from the given repository. You must have owner or admin access to remove restrictions. If the interaction limit is set for the user or organization that owns this repository, you will receive a `409 Conflict` response and will not be able to use this endpoint to change the interaction limit for a single repository.
28212833
*/
28222834
removeRestrictionsForRepo: {
28232835
(
@@ -2829,7 +2841,19 @@ export type RestEndpointMethods = {
28292841
endpoint: EndpointInterface<{ url: string }>;
28302842
};
28312843
/**
2832-
* Temporarily restricts interactions to certain GitHub users in any public repository in the given organization. You must be an organization owner to set these restrictions.
2844+
* Removes any interaction restrictions from your public repositories.
2845+
*/
2846+
removeRestrictionsForYourPublicRepos: {
2847+
(
2848+
params?: RestEndpointMethodTypes["interactions"]["removeRestrictionsForYourPublicRepos"]["parameters"]
2849+
): Promise<
2850+
RestEndpointMethodTypes["interactions"]["removeRestrictionsForYourPublicRepos"]["response"]
2851+
>;
2852+
defaults: RequestInterface["defaults"];
2853+
endpoint: EndpointInterface<{ url: string }>;
2854+
};
2855+
/**
2856+
* 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.
28332857
*/
28342858
setRestrictionsForOrg: {
28352859
(
@@ -2841,7 +2865,7 @@ export type RestEndpointMethods = {
28412865
endpoint: EndpointInterface<{ url: string }>;
28422866
};
28432867
/**
2844-
* Temporarily restricts interactions to certain GitHub users within the given repository. You must have owner or admin access to set restrictions.
2868+
* Temporarily restricts interactions to a certain type of GitHub user within the given repository. You must have owner or admin access to set these restrictions. If an interaction limit is set for the user or organization that owns this repository, you will receive a `409 Conflict` response and will not be able to use this endpoint to change the interaction limit for a single repository.
28452869
*/
28462870
setRestrictionsForRepo: {
28472871
(
@@ -2852,6 +2876,18 @@ export type RestEndpointMethods = {
28522876
defaults: RequestInterface["defaults"];
28532877
endpoint: EndpointInterface<{ url: string }>;
28542878
};
2879+
/**
2880+
* 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.
2881+
*/
2882+
setRestrictionsForYourPublicRepos: {
2883+
(
2884+
params?: RestEndpointMethodTypes["interactions"]["setRestrictionsForYourPublicRepos"]["parameters"]
2885+
): Promise<
2886+
RestEndpointMethodTypes["interactions"]["setRestrictionsForYourPublicRepos"]["response"]
2887+
>;
2888+
defaults: RequestInterface["defaults"];
2889+
endpoint: EndpointInterface<{ url: string }>;
2890+
};
28552891
};
28562892
issues: {
28572893
/**
@@ -6023,7 +6059,12 @@ export type RestEndpointMethods = {
60236059
endpoint: EndpointInterface<{ url: string }>;
60246060
};
60256061
/**
6026-
* This endpoint will return all community profile metrics, including an overall health score, repository description, the presence of documentation, detected code of conduct, detected license, and the presence of ISSUE\_TEMPLATE, PULL\_REQUEST\_TEMPLATE, README, and CONTRIBUTING files.
6062+
* This endpoint will return all community profile metrics, including an
6063+
* overall health score, repository description, the presence of documentation, detected
6064+
* code of conduct, detected license, and the presence of ISSUE\_TEMPLATE, PULL\_REQUEST\_TEMPLATE,
6065+
* README, and CONTRIBUTING files.
6066+
*
6067+
* `content_reports_enabled` is only returned for organization-owned repositories.
60276068
*/
60286069
getCommunityProfileMetrics: {
60296070
(
@@ -7133,7 +7174,7 @@ export type RestEndpointMethods = {
71337174
*
71347175
* `q=windows+label:bug+language:python+state:open&sort=created&order=asc`
71357176
*
7136-
* This query searches for the keyword `windows`, within any open issue that is labeled as `bug`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, whick means the oldest issues appear first in the search results.
7177+
* This query searches for the keyword `windows`, within any open issue that is labeled as `bug`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results.
71377178
*
71387179
* **Note:** For [user-to-server](https://docs.github.com/developers/apps/identifying-and-authorizing-users-for-github-apps#user-to-server-requests) GitHub App requests, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the `is:issue` or `is:pull-request` qualifier will receive an HTTP `422 Unprocessable Entity` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the `is` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)."
71397180
*/

‎src/generated/parameters-and-response-types.ts

+24
Original file line numberDiff line numberDiff line change
@@ -1602,6 +1602,14 @@ export type RestEndpointMethodTypes = {
16021602
>;
16031603
response: Endpoints["GET /repos/{owner}/{repo}/interaction-limits"]["response"];
16041604
};
1605+
getRestrictionsForYourPublicRepos: {
1606+
parameters: RequestParameters &
1607+
Omit<
1608+
Endpoints["GET /user/interaction-limits"]["parameters"],
1609+
"baseUrl" | "headers" | "mediaType"
1610+
>;
1611+
response: Endpoints["GET /user/interaction-limits"]["response"];
1612+
};
16051613
removeRestrictionsForOrg: {
16061614
parameters: RequestParameters &
16071615
Omit<
@@ -1618,6 +1626,14 @@ export type RestEndpointMethodTypes = {
16181626
>;
16191627
response: Endpoints["DELETE /repos/{owner}/{repo}/interaction-limits"]["response"];
16201628
};
1629+
removeRestrictionsForYourPublicRepos: {
1630+
parameters: RequestParameters &
1631+
Omit<
1632+
Endpoints["DELETE /user/interaction-limits"]["parameters"],
1633+
"baseUrl" | "headers" | "mediaType"
1634+
>;
1635+
response: Endpoints["DELETE /user/interaction-limits"]["response"];
1636+
};
16211637
setRestrictionsForOrg: {
16221638
parameters: RequestParameters &
16231639
Omit<
@@ -1634,6 +1650,14 @@ export type RestEndpointMethodTypes = {
16341650
>;
16351651
response: Endpoints["PUT /repos/{owner}/{repo}/interaction-limits"]["response"];
16361652
};
1653+
setRestrictionsForYourPublicRepos: {
1654+
parameters: RequestParameters &
1655+
Omit<
1656+
Endpoints["PUT /user/interaction-limits"]["parameters"],
1657+
"baseUrl" | "headers" | "mediaType"
1658+
>;
1659+
response: Endpoints["PUT /user/interaction-limits"]["response"];
1660+
};
16371661
};
16381662
issues: {
16391663
addAssignees: {

0 commit comments

Comments
 (0)
Please sign in to comment.