@sentry/junior-github 0.301.0 → 0.303.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/events-CrbJHQ0w.js +2466 -0
- package/dist/index.d.ts +71 -3
- package/dist/index.js +7294 -7881
- package/dist/testing.d.ts +51 -1
- package/dist/testing.js +1 -6
- package/migrations/0012_pull_request_next_action.sql +5 -0
- package/migrations/meta/0012_snapshot.json +434 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +11 -13
- package/skills/github-code/SKILL.md +1 -1
- package/skills/github-code/SPEC.md +2 -2
- package/skills/github-code/references/workflow.md +1 -1
- package/dist/account-links.d.ts +0 -8
- package/dist/annotations.d.ts +0 -33
- package/dist/chunk-YUF5P5I7.js +0 -2507
- package/dist/clone-command.d.ts +0 -5
- package/dist/configured-repository.d.ts +0 -10
- package/dist/conversation-title-context.d.ts +0 -20
- package/dist/credential-support.d.ts +0 -107
- package/dist/db/database.d.ts +0 -5
- package/dist/db/schema.d.ts +0 -1403
- package/dist/default-branch.d.ts +0 -15
- package/dist/egress-policy.d.ts +0 -25
- package/dist/events/comment.d.ts +0 -14
- package/dist/events/declarations.d.ts +0 -18
- package/dist/events/deployment.d.ts +0 -38
- package/dist/events/issue.d.ts +0 -42
- package/dist/events/pull-request.d.ts +0 -75
- package/dist/events/release.d.ts +0 -42
- package/dist/events/repository.d.ts +0 -23
- package/dist/events/resource-url.d.ts +0 -5
- package/dist/events/scope.d.ts +0 -13
- package/dist/git-config.d.ts +0 -52
- package/dist/github-status.d.ts +0 -16
- package/dist/graphql-documents.d.ts +0 -31
- package/dist/images.d.ts +0 -8
- package/dist/issue-outcomes/store.d.ts +0 -42
- package/dist/merge-conflict-checks/heartbeat.d.ts +0 -27
- package/dist/merge-conflict-checks/store.d.ts +0 -44
- package/dist/merge-conflict-checks/webhooks.d.ts +0 -23
- package/dist/object-facts.d.ts +0 -29
- package/dist/permissions.d.ts +0 -6
- package/dist/plugin.d.ts +0 -45
- package/dist/pull-request-outcomes/apply.d.ts +0 -22
- package/dist/pull-request-outcomes/commit-composition.d.ts +0 -6
- package/dist/pull-request-outcomes/reconcile.d.ts +0 -41
- package/dist/pull-request-outcomes/store.d.ts +0 -115
- package/dist/pull-request-requesters/draft-reviewers.d.ts +0 -15
- package/dist/pull-request-requesters/store.d.ts +0 -41
- package/dist/pull-request-review-policy.d.ts +0 -6
- package/dist/receive-pack-policy.d.ts +0 -21
- package/dist/reply-markdown.d.ts +0 -18
- package/dist/sandbox-paths.d.ts +0 -4
- package/dist/tool-support/attribution.d.ts +0 -52
- package/dist/tool-support/github-api.d.ts +0 -51
- package/dist/tool-support/github-text.d.ts +0 -8
- package/dist/tool-support/pull-request-description.d.ts +0 -8
- package/dist/tools/clone-repository.d.ts +0 -205
- package/dist/tools/comment-on-issue.d.ts +0 -205
- package/dist/tools/comment-on-pull-request.d.ts +0 -210
- package/dist/tools/create-issue.d.ts +0 -218
- package/dist/tools/create-pull-request.d.ts +0 -240
- package/dist/tools/footer.d.ts +0 -17
- package/dist/tools/get-deployment.d.ts +0 -264
- package/dist/tools/get-issue.d.ts +0 -248
- package/dist/tools/get-pull-request.d.ts +0 -255
- package/dist/tools/get-release.d.ts +0 -243
- package/dist/tools/get-repository.d.ts +0 -226
- package/dist/tools/get-status.d.ts +0 -213
- package/dist/tools/react-to-issue.d.ts +0 -205
- package/dist/tools/resolve-pull-request-review-thread.d.ts +0 -206
- package/dist/tools/stack-pull-request.d.ts +0 -43
- package/dist/tools/submit-pull-request-review.d.ts +0 -216
- package/dist/tools/update-issue-comment.d.ts +0 -206
- package/dist/tools/update-issue.d.ts +0 -249
- package/dist/tools/update-pull-request-feedback.d.ts +0 -242
- package/dist/tools/update-pull-request.d.ts +0 -255
- package/dist/tools.d.ts +0 -13
- package/dist/webhooks/check-suite.d.ts +0 -94
- package/dist/webhooks/event-targets.d.ts +0 -44
- package/dist/webhooks/events.d.ts +0 -23
- package/dist/webhooks/fail-open-log.d.ts +0 -10
- package/dist/webhooks/handler.d.ts +0 -55
- package/dist/webhooks/installation-requests.d.ts +0 -98
- package/dist/webhooks/issue-outcome.d.ts +0 -11
- package/dist/webhooks/issue-update.d.ts +0 -8
- package/dist/webhooks/merge-conflict.d.ts +0 -48
- package/dist/webhooks/ownership.d.ts +0 -14
- package/dist/webhooks/pull-request-activity.d.ts +0 -11
- package/dist/webhooks/pull-request-match-data.d.ts +0 -31
- package/dist/webhooks/pull-request-outcome.d.ts +0 -16
- package/dist/webhooks/pull-request-people.d.ts +0 -51
- package/dist/webhooks/pull-request-preview.d.ts +0 -12
- package/dist/webhooks/pull-request-ready-reviewers.d.ts +0 -25
- package/dist/webhooks/pull-request-ready.d.ts +0 -31
- package/dist/webhooks/pull-request-review-request.d.ts +0 -32
- package/dist/workspace-prepare.d.ts +0 -3
package/dist/clone-command.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/** A GitHub repository, by owner and name. */
|
|
2
|
-
export interface Repository {
|
|
3
|
-
name: string;
|
|
4
|
-
owner: string;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Read the `repo` config value as `owner/name`, or as `name` with the `org`
|
|
8
|
-
* config value. Return undefined when neither form is complete.
|
|
9
|
-
*/
|
|
10
|
-
export declare function configuredRepository(config: Record<string, string>): Repository | undefined;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { PluginLogger } from "@sentry/junior-plugin-api";
|
|
2
|
-
export interface GitHubReference {
|
|
3
|
-
/** Issue number, pull request number, or commit SHA. */
|
|
4
|
-
id: string;
|
|
5
|
-
/** `issue` also matches pull requests, as GitHub numbers them together. */
|
|
6
|
-
kind: "commit" | "issue" | "pull_request";
|
|
7
|
-
name: string;
|
|
8
|
-
owner: string;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Describe GitHub issues, pull requests, and commits that message text
|
|
12
|
-
* references, as `owner/repo#123: Title` or `owner/repo@abc1234: Subject`.
|
|
13
|
-
* References that `loadObject` cannot read are left out.
|
|
14
|
-
*/
|
|
15
|
-
export declare function loadGitHubConversationTitleContext(args: {
|
|
16
|
-
config: Record<string, string>;
|
|
17
|
-
loadObject(reference: GitHubReference): Promise<unknown>;
|
|
18
|
-
log: PluginLogger;
|
|
19
|
-
text: string;
|
|
20
|
-
}): Promise<string[]>;
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import type { PluginCredentialResult, PluginGrant, PluginProviderAccount, PluginStoredTokens, IssueCredentialHookContext } from "@sentry/junior-plugin-api";
|
|
2
|
-
import { type GitHubAppPermissions } from "./permissions.js";
|
|
3
|
-
export type JsonRecord = Record<string, unknown>;
|
|
4
|
-
export type GitHubGrantName = "installation-read" | "installation-write" | "user-read" | "user-write";
|
|
5
|
-
export type GitHubGrantReason = "github.api-read" | "github.asset-upload" | "github.git-read" | "github.graphql-read" | "github.installation-write" | "github.user-read" | "github.user-write";
|
|
6
|
-
export type GitHubGrant = PluginGrant & {
|
|
7
|
-
name: GitHubGrantName;
|
|
8
|
-
reason: GitHubGrantReason;
|
|
9
|
-
};
|
|
10
|
-
interface GitHubRequestParams {
|
|
11
|
-
body?: unknown;
|
|
12
|
-
method?: string;
|
|
13
|
-
token: string;
|
|
14
|
-
}
|
|
15
|
-
interface UserCredentialOptions {
|
|
16
|
-
clientIdEnv: string;
|
|
17
|
-
clientSecretEnv: string;
|
|
18
|
-
userScope?: string;
|
|
19
|
-
}
|
|
20
|
-
interface InstallationCredentialBaseOptions {
|
|
21
|
-
appIdEnv: string;
|
|
22
|
-
installationIdEnv: string;
|
|
23
|
-
privateKeyEnv: string;
|
|
24
|
-
}
|
|
25
|
-
type InstallationCredentialOptions = InstallationCredentialBaseOptions & ({
|
|
26
|
-
loadPermissions?: never;
|
|
27
|
-
permissions?: GitHubAppPermissions;
|
|
28
|
-
repositories?: string[];
|
|
29
|
-
repositoryIds?: number[];
|
|
30
|
-
} | {
|
|
31
|
-
loadPermissions: LoadInstallationReadPermissions;
|
|
32
|
-
permissions?: never;
|
|
33
|
-
repositories?: never;
|
|
34
|
-
repositoryIds?: never;
|
|
35
|
-
});
|
|
36
|
-
type LoadInstallationReadPermissions = (input: {
|
|
37
|
-
appJwt: string;
|
|
38
|
-
installationId: number;
|
|
39
|
-
}) => Promise<Record<string, "read">>;
|
|
40
|
-
/** A GitHub repository named by owner and name. */
|
|
41
|
-
export interface GitHubRepository {
|
|
42
|
-
name: string;
|
|
43
|
-
owner: string;
|
|
44
|
-
}
|
|
45
|
-
export declare const GITHUB_APP_ID_ENV = "GITHUB_APP_ID";
|
|
46
|
-
export declare const GITHUB_APP_PRIVATE_KEY_ENV = "GITHUB_APP_PRIVATE_KEY";
|
|
47
|
-
export declare const GITHUB_INSTALLATION_ID_ENV = "GITHUB_INSTALLATION_ID";
|
|
48
|
-
export declare const GITHUB_AUTH_TOKEN_ENV = "GITHUB_TOKEN";
|
|
49
|
-
export declare const GITHUB_AUTH_TOKEN_PLACEHOLDER = "ghp_host_managed_credential";
|
|
50
|
-
export declare const GITHUB_GRAPHQL_RESPONSE_BODY_LIMIT_BYTES: number;
|
|
51
|
-
export declare const HTTP_READ_METHODS: Set<string>;
|
|
52
|
-
export declare const USER_TOKEN_GRANTS: Set<string>;
|
|
53
|
-
export declare const CREATE_TOOL_ROUTING_GUIDANCE = "This is a tool-routing denial, not a GitHub permission failure. Do not ask the user for GitHub permissions; retry with the required tool.";
|
|
54
|
-
export declare const USER_WRITE_REQUIREMENTS: string[];
|
|
55
|
-
/** A GitHub API response with an error status. */
|
|
56
|
-
export declare class GitHubRequestError extends Error {
|
|
57
|
-
status: number;
|
|
58
|
-
constructor(message: string, status: number);
|
|
59
|
-
}
|
|
60
|
-
export declare class GitHubPluginSetupError extends Error {
|
|
61
|
-
constructor(message: string);
|
|
62
|
-
}
|
|
63
|
-
/** Return whether a provider value is a JSON object. */
|
|
64
|
-
export declare function isRecord(value: unknown): value is JsonRecord;
|
|
65
|
-
/** Read a non-empty GitHub plugin environment value. */
|
|
66
|
-
export declare function readEnv(name: string): string | undefined;
|
|
67
|
-
/** Read a required GitHub plugin environment value. */
|
|
68
|
-
export declare function requireEnv(name: string): string;
|
|
69
|
-
/** Normalize configured GitHub OAuth scopes. */
|
|
70
|
-
export declare function normalizeScopeList(scopes?: string[]): string[];
|
|
71
|
-
/** Send an authenticated request to the GitHub API. */
|
|
72
|
-
export declare function githubRequest(apiBase: string, path: string, params: GitHubRequestParams): Promise<unknown>;
|
|
73
|
-
/** Return a credential result for invalid GitHub App configuration. */
|
|
74
|
-
export declare function credentialUnavailable(message: string): PluginCredentialResult;
|
|
75
|
-
/** Parse a GitHub repository from an API or Git URL. */
|
|
76
|
-
export declare function githubRepositoryFromUrl(upstreamUrl: URL): GitHubRepository | undefined;
|
|
77
|
-
/** Resolve the GitHub account associated with stored user tokens. */
|
|
78
|
-
export declare function resolveUserAccount(tokens: PluginStoredTokens): Promise<PluginProviderAccount>;
|
|
79
|
-
/**
|
|
80
|
-
* List the email addresses GitHub verified for the user OAuth token.
|
|
81
|
-
*
|
|
82
|
-
* GitHub App user tokens need the App's "Email addresses" user permission.
|
|
83
|
-
* Return an empty list when the App does not have it.
|
|
84
|
-
*/
|
|
85
|
-
export declare function listVerifiedUserEmails(tokens: PluginStoredTokens): Promise<string[]>;
|
|
86
|
-
/** Issue a bounded raw token for plugin-owned GitHub API calls. */
|
|
87
|
-
export declare function issueInstallationToken(options: InstallationCredentialOptions): Promise<{
|
|
88
|
-
expiresAtMs: number;
|
|
89
|
-
token: string;
|
|
90
|
-
}>;
|
|
91
|
-
interface GitHubCredentialOptions extends InstallationCredentialBaseOptions, UserCredentialOptions {
|
|
92
|
-
/** Declared read permissions, or a loader for the installed ones. */
|
|
93
|
-
readPermissions: {
|
|
94
|
-
permissions: GitHubAppPermissions;
|
|
95
|
-
} | {
|
|
96
|
-
loadPermissions: LoadInstallationReadPermissions;
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Issue the credential for one GitHub grant that host egress selected. Only
|
|
101
|
-
* the `issueCredential` hook may call this. Other code reads and writes GitHub
|
|
102
|
-
* through host egress.
|
|
103
|
-
*/
|
|
104
|
-
export declare function issueGitHubCredential(ctx: IssueCredentialHookContext, options: GitHubCredentialOptions): Promise<PluginCredentialResult>;
|
|
105
|
-
/** Cache the installation's read permissions for one lease period. */
|
|
106
|
-
export declare function createPermissionCache(): LoadInstallationReadPermissions;
|
|
107
|
-
export {};
|
package/dist/db/database.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { PgDatabase } from "drizzle-orm/pg-core";
|
|
2
|
-
import type { PgQueryResultHKT } from "drizzle-orm/pg-core/session";
|
|
3
|
-
import { githubSqlSchema } from "./schema.js";
|
|
4
|
-
/** Database contract for GitHub-owned projections and reports. */
|
|
5
|
-
export type GitHubDb = PgDatabase<PgQueryResultHKT, typeof githubSqlSchema>;
|