Skip to content

Commit

Permalink
Merge pull request #141 from runlightyear/github-beta
Browse files Browse the repository at this point in the history
GitHub beta
  • Loading branch information
ebouck authored Sep 11, 2023
2 parents 8b39eb8 + 131a0d6 commit a272ad6
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 196 deletions.
7 changes: 7 additions & 0 deletions packages/@runlightyear/github/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @runlightyear/github

## 0.20.0

### Minor Changes

- Removed problematic createReviewCommentForPullRequest method for now
- Fixed some type-related bugs

## 0.19.7

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/@runlightyear/github/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@runlightyear/github",
"version": "0.19.7",
"version": "0.20.0",
"publishConfig": {
"access": "public"
},
Expand Down
26 changes: 1 addition & 25 deletions packages/@runlightyear/github/src/GitHub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ import updateIssue, { UpdateIssueProps } from "./issues/updateIssue";
import createPullRequest, {
CreatePullRequestProps,
} from "./pulls/createPullRequest";
import createReviewCommentForPullRequest, {
CreatePullRequestCommentProps,
} from "./pulls/createReviewCommentForPullRequest";
import updatePullRequest, {
UpdatePullRequestProps,
} from "./pulls/updatePullRequest";
Expand Down Expand Up @@ -350,27 +347,6 @@ export class GitHub extends RestConnector {
return createPullRequest(this)(props);
}

/**
* Create a review comment for a pull request
*
* @group Pull Request
*
* Creates a review comment in the pull request diff. To add a regular comment to a pull request timeline, see "Create an issue comment." We recommend creating a review comment using line, side, and optionally start_line and start_side if your comment applies to more than one line in the pull request diff.
*
* The position parameter is deprecated. If you use position, the line, side, start_line, and start_side parameters are not required.
*
* Note: The position value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file.
*
* This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See "Secondary rate limits" and "Dealing with secondary rate limits" for details.
*
* @param props props
*/
async createReviewCommentForPullRequest(
props: CreatePullRequestCommentProps
) {
return createReviewCommentForPullRequest(this)(props);
}

/**
* Update a pull request
*
Expand Down Expand Up @@ -411,7 +387,7 @@ export class GitHub extends RestConnector {
* @param props props
*/
async listRepositoriesForAuthenticatedUser(
props: ListRepositoriesForAuthenticatedUserProps
props?: ListRepositoriesForAuthenticatedUserProps
) {
return listRepositoriesForAuthenticatedUser(this)(props);
}
Expand Down
220 changes: 58 additions & 162 deletions packages/@runlightyear/github/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
/** GitHub **/

import { GitHub } from "./GitHub";
import type { GitHubConnectorProps, GitHubDefineAuthProps } from "./GitHub";
export { GitHub } from "./GitHub";
export type { GitHubConnectorProps, GitHubDefineAuthProps } from "./GitHub";

/** GitHubOAuth **/

import { GitHubOAuth } from "./GitHubOAuth";
import type { GitHubOAuthProps } from "./GitHubOAuth";
export { GitHubOAuth } from "./GitHubOAuth";
export type { GitHubOAuthProps } from "./GitHubOAuth";

/** Commits **/

import type {
export type {
CompareTwoCommitsProps,
CompareTwoCommitsResponse,
CompareTwoCommitsResponseData,
} from "./commits/compareTwoCommits";

/** Gists **/

import { CreateGistProps } from "./gists/createGist";
export type { CreateGistProps } from "./gists/createGist";

/** Helpers **/

export type { MatchAllCommitsProps } from "./helpers/matchAllCommits";

/** Issues **/

import { CreateIssueProps } from "./issues/createIssue";
import { UpdateIssueProps } from "./issues/updateIssue";
export type { CreateIssueProps } from "./issues/createIssue";
export type { UpdateIssueProps } from "./issues/updateIssue";

/** Listeners **/

Expand All @@ -39,60 +39,59 @@ export type {

/** Pulls **/

import { CreatePullRequestProps } from "./pulls/createPullRequest";
import { CreatePullRequestCommentProps } from "./pulls/createReviewCommentForPullRequest";
import { UpdatePullRequestProps } from "./pulls/updatePullRequest";
export type { CreatePullRequestProps } from "./pulls/createPullRequest";
export type { UpdatePullRequestProps } from "./pulls/updatePullRequest";

/** Repositories **/

import { DownloadRepoArchiveTarProps } from "./repositories/contents/downloadRepoArchiveTar";
import { DownloadRepoArchiveZipProps } from "./repositories/contents/downloadRepoArchiveZip";
import { ListOrganizationRepositoriesProps } from "./repositories/listOrganizationRepositories";
import { ListRepositoriesForAuthenticatedUserProps } from "./repositories/listRepositoriesForAuthenticatedUser";
import { ListRepositoriesForUserProps } from "./repositories/listRepositoriesForUser";
export type { DownloadRepoArchiveTarProps } from "./repositories/contents/downloadRepoArchiveTar";
export type { DownloadRepoArchiveZipProps } from "./repositories/contents/downloadRepoArchiveZip";
export type { ListOrganizationRepositoriesProps } from "./repositories/listOrganizationRepositories";
export type { ListRepositoriesForAuthenticatedUserProps } from "./repositories/listRepositoriesForAuthenticatedUser";
export type { ListRepositoriesForUserProps } from "./repositories/listRepositoriesForUser";

/** Types **/

import type { Commit } from "./types/Commit";
import type { CommitComment } from "./types/CommitComment";
import type { Deployment } from "./types/Deployment";
import type { GitHubScope } from "./types/GitHubScope";
import type { Issue } from "./types/Issue";
import type { IssueComment } from "./types/IssueComment";
import type { Label } from "./types/Label";
import type { Member } from "./types/Member";
import type { Milestone } from "./types/Milestone";
import type { PushCommit } from "./types/PushCommit";
import type { Reactions } from "./types/Reactions";
import type { Repository } from "./types/Repository";
import type { User } from "./types/User";
import type WebhookConfig from "./types/WebhookConfig";
import type WebhookEvent from "./types/WebhookEvent";
import type { Workflow } from "./types/Workflow";
import type { WorkflowJob } from "./types/WorkflowJob";
import type { WorkflowRun } from "./types/WorkflowRun";
export type { Commit } from "./types/Commit";
export type { CommitComment } from "./types/CommitComment";
export type { Deployment } from "./types/Deployment";
export type { GitHubScope } from "./types/GitHubScope";
export type { Issue } from "./types/Issue";
export type { IssueComment } from "./types/IssueComment";
export type { Label } from "./types/Label";
export type { Member } from "./types/Member";
export type { Milestone } from "./types/Milestone";
export type { PushCommit } from "./types/PushCommit";
export type { Reactions } from "./types/Reactions";
export type { Repository } from "./types/Repository";
export type { User } from "./types/User";
export type { WebhookConfig } from "./types/WebhookConfig";
export type { WebhookEvent } from "./types/WebhookEvent";
export type { Workflow } from "./types/Workflow";
export type { WorkflowJob } from "./types/WorkflowJob";
export type { WorkflowRun } from "./types/WorkflowRun";

/** Webhooks **/

import type {
export type {
DefineGitHubWebhookProps,
GitHubWebhookSubscribeProps,
GitHubWebhookSubscribePropsFunc,
} from "./webhooks/defineGitHubWebhook";

/** Webhooks Payloads **/

import type { CommitCommentPayload } from "./webhooks/payloads/asCommitCommentPayload";
import type { CommonPayload } from "./webhooks/payloads/commonPayload";
import type { CreatePayload } from "./webhooks/payloads/asCreatePayload";
import type { DeletePayload } from "./webhooks/payloads/asDeletePayload";
import type {
export type { CommitCommentPayload } from "./webhooks/payloads/asCommitCommentPayload";
export type { CommonPayload } from "./webhooks/payloads/commonPayload";
export type { CreatePayload } from "./webhooks/payloads/asCreatePayload";
export type { DeletePayload } from "./webhooks/payloads/asDeletePayload";
export type {
IssueCommentPayload,
IssueCommentCreatedPayload,
IssueCommentDeletedPayload,
IssueCommentEditedPayload,
} from "./webhooks/payloads/asIssueCommentPayload";
import type {
export type {
IssuesPayload,
IssueAssignedPayload,
IssueClosedPayload,
Expand All @@ -111,23 +110,23 @@ import type {
IssueUnlockedPayload,
IssueUnpinnedPayload,
} from "./webhooks/payloads/asIssuesPayload";
import type {
export type {
LabelPayload,
LabelCreatedPayload,
LabelDeletedPayload,
LabelEditedPayload,
} from "./webhooks/payloads/asLabelPayload";
import type {
export type {
MemberPayload,
MemberAddedPayload,
MemberEditedPayload,
MemberRemovedPayload,
} from "./webhooks/payloads/asMemberPayload";
import type { PingPayload } from "./webhooks/payloads/asPingPayload";
import type { PullRequestPayload } from "./webhooks/payloads/asPullRequestPayload";
import type { PullRequestReviewPayload } from "./webhooks/payloads/asPullRequestReviewPayload";
import type { PushPayload } from "./webhooks/payloads/asPushPayload";
import type {
export type { PingPayload } from "./webhooks/payloads/asPingPayload";
export type { PullRequestPayload } from "./webhooks/payloads/asPullRequestPayload";
export type { PullRequestReviewPayload } from "./webhooks/payloads/asPullRequestReviewPayload";
export type { PushPayload } from "./webhooks/payloads/asPushPayload";
export type {
RepositoryPayload,
RepositoryArchivedPayload,
RepositoryCreatedPayload,
Expand All @@ -139,129 +138,26 @@ import type {
RepositoryTransferredPayload,
RepositoryUnarchivedPayload,
} from "./webhooks/payloads/asRepositoryPayload";
import type { StatusPayload } from "./webhooks/payloads/asStatusPayload";
import type { WorkflowDispatchPayload } from "./webhooks/payloads/asWorkflowDispatchPayload";
import type { WorkflowJobPayload } from "./webhooks/payloads/asWorkflowJobPayload";
import type { WorkflowRunPayload } from "./webhooks/payloads/asWorkflowRunPayload";
export type { StatusPayload } from "./webhooks/payloads/asStatusPayload";
export type { WorkflowDispatchPayload } from "./webhooks/payloads/asWorkflowDispatchPayload";
export type { WorkflowJobPayload } from "./webhooks/payloads/asWorkflowJobPayload";
export type { WorkflowRunPayload } from "./webhooks/payloads/asWorkflowRunPayload";

/** Webhooks Repositories **/

import {
export type {
CreateRepositoryWebhookProps,
CreateRepositoryWebhookResponse,
} from "./webhooks/repositoryWebhooks/createRepositoryWebhook";
import { DeleteRepositoryWebhookProps } from "./webhooks/repositoryWebhooks/deleteRepositoryWebhook";
import { GetRepositoryWebhookProps } from "./webhooks/repositoryWebhooks/getRepositoryWebhook";
import {
export type { DeleteRepositoryWebhookProps } from "./webhooks/repositoryWebhooks/deleteRepositoryWebhook";
export type { GetRepositoryWebhookProps } from "./webhooks/repositoryWebhooks/getRepositoryWebhook";
export type {
ListRepositoryWebhooksProps,
ListRepositoryWebhooksResponse,
} from "./webhooks/repositoryWebhooks/listRepositoryWebhooks";
import { PingRepositoryWebhookProps } from "./webhooks/repositoryWebhooks/pingRepositoryWebhook";
import { TestPushRepositoryWebhookProps } from "./webhooks/repositoryWebhooks/testPushRepositoryWebhook";
import {
UpdateRepositoryWebhookProps,
UpdateRepositoryWebhookResponse,
} from "./webhooks/repositoryWebhooks/updateRepositoryWebhook";

export { GitHub, GitHubOAuth };
export type { PingRepositoryWebhookProps } from "./webhooks/repositoryWebhooks/pingRepositoryWebhook";
export type { TestPushRepositoryWebhookProps } from "./webhooks/repositoryWebhooks/testPushRepositoryWebhook";
export type {
GitHubConnectorProps,
GitHubOAuthProps,
GitHubDefineAuthProps,
CompareTwoCommitsProps,
CompareTwoCommitsResponse,
CompareTwoCommitsResponseData,
CreateGistProps,
CreateIssueProps,
UpdateIssueProps,
CreatePullRequestProps,
CreatePullRequestCommentProps,
UpdatePullRequestProps,
DownloadRepoArchiveTarProps,
DownloadRepoArchiveZipProps,
ListOrganizationRepositoriesProps,
ListRepositoriesForAuthenticatedUserProps,
ListRepositoriesForUserProps,
Commit,
CommitComment,
Deployment,
GitHubScope,
Issue,
IssueComment,
Label,
Member,
Milestone,
PushCommit,
Reactions,
Repository,
User,
WebhookConfig,
WebhookEvent,
Workflow,
WorkflowJob,
WorkflowRun,
DefineGitHubWebhookProps,
GitHubWebhookSubscribeProps,
GitHubWebhookSubscribePropsFunc,
CommitCommentPayload,
CommonPayload,
CreatePayload,
DeletePayload,
IssueCommentPayload,
IssueCommentCreatedPayload,
IssueCommentDeletedPayload,
IssueCommentEditedPayload,
IssuesPayload,
IssueAssignedPayload,
IssueClosedPayload,
IssueDeletedPayload,
IssueDemilestonedPayload,
IssueEditedPayload,
IssueLabeledPayload,
IssueLockedPayload,
IssueMilestonedPayload,
IssueOpenedPayload,
IssuePinnedPayload,
IssueReopenedPayload,
IssueTransferredPayload,
IssueUnassignedPayload,
IssueUnlabeledPayload,
IssueUnlockedPayload,
IssueUnpinnedPayload,
LabelPayload,
LabelCreatedPayload,
LabelDeletedPayload,
LabelEditedPayload,
MemberPayload,
MemberAddedPayload,
MemberEditedPayload,
MemberRemovedPayload,
PingPayload,
PullRequestPayload,
PullRequestReviewPayload,
PushPayload,
RepositoryPayload,
RepositoryArchivedPayload,
RepositoryCreatedPayload,
RepositoryDeletedPayload,
RepositoryEditedPayload,
RepositoryPrivatizedPayload,
RepositoryPublicizedPayload,
RepositoryRenamedPayload,
RepositoryTransferredPayload,
RepositoryUnarchivedPayload,
StatusPayload,
WorkflowDispatchPayload,
WorkflowJobPayload,
WorkflowRunPayload,
CreateRepositoryWebhookProps,
CreateRepositoryWebhookResponse,
DeleteRepositoryWebhookProps,
GetRepositoryWebhookProps,
ListRepositoryWebhooksProps,
ListRepositoryWebhooksResponse,
PingRepositoryWebhookProps,
TestPushRepositoryWebhookProps,
UpdateRepositoryWebhookProps,
UpdateRepositoryWebhookResponse,
};
} from "./webhooks/repositoryWebhooks/updateRepositoryWebhook";
2 changes: 1 addition & 1 deletion packages/@runlightyear/github/src/issues/updateIssue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export interface UpdateIssueProps {
/**
* The reason for the current state
*/
stateReason: "completed" | "not_planned" | "repopened" | null;
stateReason?: "completed" | "not_planned" | "reopened" | null;
/**
* The number of the milestone to associate this issue with or null to remove current.
*
Expand Down
Loading

0 comments on commit a272ad6

Please sign in to comment.