@sentry/junior-github 0.279.0 → 0.281.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/{chunk-IR7D5MR7.js → chunk-NSAVG2P3.js} +8 -8
- package/dist/db/schema.d.ts +1 -1
- package/dist/events/release.d.ts +1 -1
- package/dist/events/scope.d.ts +1 -1
- package/dist/index.js +848 -1225
- package/dist/issue-outcomes/store.d.ts +1 -1
- package/dist/pull-request-outcomes/store.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/dist/tool-support/attribution.d.ts +11 -2
- package/dist/tool-support/github-api.d.ts +40 -0
- package/dist/tools/stack-pull-request.d.ts +1 -1
- package/dist/webhooks/handler.d.ts +1 -1
- package/package.json +2 -2
package/dist/testing.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Actor, Identity, PluginLogger, Source, User } from "@sentry/junior-plugin-api";
|
|
1
|
+
import type { Actor, Identity, PluginEgress, PluginLogger, Source, User } from "@sentry/junior-plugin-api";
|
|
2
2
|
export declare const GITHUB_REQUEST_ATTRIBUTION_START = "<!-- junior-request-attribution:start -->";
|
|
3
3
|
export declare const GITHUB_REQUEST_ATTRIBUTION_END = "<!-- junior-request-attribution:end -->";
|
|
4
4
|
/**
|
|
@@ -8,6 +8,14 @@ export declare const GITHUB_REQUEST_ATTRIBUTION_END = "<!-- junior-request-attri
|
|
|
8
8
|
* GitHub notifications for the issue or pull request.
|
|
9
9
|
*/
|
|
10
10
|
export declare function linkedGitHubLogin(user: User | undefined): string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Read the body that is on GitHub now, so an update keeps its requesters.
|
|
13
|
+
* The model sees descriptions with the attribution block removed.
|
|
14
|
+
*/
|
|
15
|
+
export declare function readGitHubBody(egress: PluginEgress, input: {
|
|
16
|
+
operation: string;
|
|
17
|
+
path: string;
|
|
18
|
+
}): Promise<string | undefined>;
|
|
11
19
|
/** The stored Junior identity and user of the Actor that makes a GitHub write. */
|
|
12
20
|
export interface GitHubRequester {
|
|
13
21
|
identity?: Identity;
|
|
@@ -29,6 +37,7 @@ export declare function resolveGitHubRequester(ctx: {
|
|
|
29
37
|
}): Promise<GitHubRequester | undefined>;
|
|
30
38
|
/**
|
|
31
39
|
* Append or replace runtime-owned requester attribution in a GitHub body.
|
|
40
|
+
* Pass `currentBody` on updates so requesters already on GitHub are kept.
|
|
32
41
|
* With no stored requester, the label falls back to the already-hydrated
|
|
33
42
|
* actor profile.
|
|
34
43
|
*/
|
|
@@ -38,4 +47,4 @@ export declare function appendGitHubRequesterAttribution(body: string, ctx: {
|
|
|
38
47
|
url: string;
|
|
39
48
|
};
|
|
40
49
|
source?: Source;
|
|
41
|
-
}, requester: GitHubRequester | undefined): string;
|
|
50
|
+
}, requester: GitHubRequester | undefined, currentBody?: string): string;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type PluginEgress } from "@sentry/junior-plugin-api";
|
|
2
|
+
/** A GitHub API reply with its body parsed as JSON, or as text when it is not JSON. */
|
|
3
|
+
export interface GitHubApiResponse {
|
|
4
|
+
body: unknown;
|
|
5
|
+
ok: boolean;
|
|
6
|
+
status: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Send one GitHub API request through host egress.
|
|
10
|
+
*
|
|
11
|
+
* Egress injects credentials, so tools never see a token. `operation` names
|
|
12
|
+
* the provider action for grant selection and diagnostics. Callers own the
|
|
13
|
+
* error mapping, because the status that means bad input differs per route.
|
|
14
|
+
*/
|
|
15
|
+
export declare function githubApi(egress: PluginEgress, input: {
|
|
16
|
+
apiVersion?: string;
|
|
17
|
+
body?: unknown;
|
|
18
|
+
method?: "DELETE" | "GET" | "PATCH" | "POST" | "PUT";
|
|
19
|
+
operation: string;
|
|
20
|
+
path: string;
|
|
21
|
+
signal?: AbortSignal;
|
|
22
|
+
}): Promise<GitHubApiResponse>;
|
|
23
|
+
/** Return the `/repos/{owner}/{name}` API path prefix for a parsed repo. */
|
|
24
|
+
export declare function repoPath(repo: {
|
|
25
|
+
name: string;
|
|
26
|
+
owner: string;
|
|
27
|
+
}): string;
|
|
28
|
+
/** Parse a model-supplied `owner/name` repository reference. */
|
|
29
|
+
export declare function parseRepo(value: string): {
|
|
30
|
+
name: string;
|
|
31
|
+
owner: string;
|
|
32
|
+
ref: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Return a readable error from a GitHub REST or GraphQL error body.
|
|
36
|
+
*
|
|
37
|
+
* REST validation errors list the failed fields in `errors`, and GraphQL puts
|
|
38
|
+
* every message in `errors`. Both details help the model fix its input.
|
|
39
|
+
*/
|
|
40
|
+
export declare function githubErrorMessage(body: unknown): string;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* chain of base branches.
|
|
9
9
|
*/
|
|
10
10
|
import type { ToolRegistrationHookContext } from "@sentry/junior-plugin-api";
|
|
11
|
-
import
|
|
11
|
+
import * as z from "zod";
|
|
12
12
|
/** The fields of a created pull request that decide if it is stacked work. */
|
|
13
13
|
export declare const stackTargetSchema: z.ZodObject<{
|
|
14
14
|
number: z.ZodNumber;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { GitHubStatusIncident } from "../github-status.js";
|
|
2
2
|
import type { CodeChangePublisher, PluginConversationAnnotations, PluginConversationReviewItems, PluginLogger, PluginRoute, EventPublisher } from "@sentry/junior-plugin-api";
|
|
3
|
-
import
|
|
3
|
+
import * as z from "zod";
|
|
4
4
|
import type { GitHubDb } from "../db/database.js";
|
|
5
5
|
import type { GitHubPullRequestCommitComposition } from "../db/schema.js";
|
|
6
6
|
import { type GitHubPullRequestRef } from "./merge-conflict.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior-github",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.281.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"drizzle-orm": "^0.45.2",
|
|
33
33
|
"marked": "^18.1.2",
|
|
34
34
|
"zod": "^4.5.4",
|
|
35
|
-
"@sentry/junior-plugin-api": "0.
|
|
35
|
+
"@sentry/junior-plugin-api": "0.281.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@oxlint/plugins": "1.79.0",
|