@ghx-dev/core 0.1.2 → 0.2.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/.claude-plugin/plugin.json +21 -0
- package/README.md +12 -15
- package/dist/cards/issue.assignees.add.yaml +50 -0
- package/dist/cards/issue.assignees.remove.yaml +50 -0
- package/dist/cards/issue.assignees.set.yaml +47 -0
- package/dist/cards/issue.close.yaml +16 -2
- package/dist/cards/issue.comments.create.yaml +16 -2
- package/dist/cards/issue.create.yaml +11 -0
- package/dist/cards/issue.delete.yaml +16 -2
- package/dist/cards/issue.labels.add.yaml +48 -0
- package/dist/cards/issue.labels.remove.yaml +50 -0
- package/dist/cards/issue.labels.set.yaml +47 -0
- package/dist/cards/issue.milestone.clear.yaml +40 -0
- package/dist/cards/issue.milestone.set.yaml +23 -4
- package/dist/{core/registry/cards/issue.blocked_by.add.yaml → cards/issue.relations.blocked_by.add.yaml} +3 -2
- package/dist/cards/{issue.blocked_by.remove.yaml → issue.relations.blocked_by.remove.yaml} +1 -1
- package/dist/cards/{issue.parent.remove.yaml → issue.relations.parent.remove.yaml} +11 -1
- package/dist/{core/registry/cards/issue.parent.set.yaml → cards/issue.relations.parent.set.yaml} +3 -2
- package/dist/{core/registry/cards/issue.linked_prs.list.yaml → cards/issue.relations.prs.list.yaml} +1 -1
- package/dist/cards/{issue.relations.get.yaml → issue.relations.view.yaml} +1 -1
- package/dist/cards/issue.reopen.yaml +16 -2
- package/dist/cards/issue.update.yaml +16 -2
- package/dist/cards/issue.view.yaml +7 -5
- package/dist/cards/{pr.review.submit_approve.yaml → pr.assignees.add.yaml} +12 -9
- package/dist/cards/pr.assignees.remove.yaml +29 -0
- package/dist/{core/registry/cards/pr.status.checks.yaml → cards/pr.checks.list.yaml} +15 -2
- package/dist/{core/registry/cards/pr.checks.rerun_all.yaml → cards/pr.checks.rerun.all.yaml} +2 -4
- package/dist/{core/registry/cards/pr.checks.rerun_failed.yaml → cards/pr.checks.rerun.failed.yaml} +3 -5
- package/dist/cards/pr.create.yaml +30 -0
- package/dist/cards/{pr.diff.list_files.yaml → pr.diff.files.yaml} +1 -1
- package/dist/cards/{pr.ready_for_review.set.yaml → pr.diff.view.yaml} +6 -8
- package/dist/{core/registry/cards/pr.mergeability.view.yaml → cards/pr.merge.status.yaml} +6 -3
- package/dist/{core/registry/cards/pr.merge.execute.yaml → cards/pr.merge.yaml} +1 -1
- package/dist/cards/pr.reviews.list.yaml +1 -1
- package/dist/cards/{pr.reviewers.request.yaml → pr.reviews.request.yaml} +1 -1
- package/dist/cards/pr.reviews.submit.yaml +67 -0
- package/dist/cards/{pr.comments.list.yaml → pr.threads.list.yaml} +2 -2
- package/dist/cards/{pr.comment.reply.yaml → pr.threads.reply.yaml} +4 -2
- package/dist/cards/{pr.comment.resolve.yaml → pr.threads.resolve.yaml} +1 -1
- package/dist/cards/{pr.comment.unresolve.yaml → pr.threads.unresolve.yaml} +1 -1
- package/dist/cards/pr.update.yaml +29 -0
- package/dist/cards/pr.view.yaml +7 -5
- package/dist/{core/registry/cards/project_v2.item.field.update.yaml → cards/project_v2.items.field.update.yaml} +1 -1
- package/dist/{core/registry/cards/project_v2.item.add_issue.yaml → cards/project_v2.items.issue.add.yaml} +1 -1
- package/dist/cards/project_v2.items.issue.remove.yaml +23 -0
- package/dist/{core/registry/cards/project_v2.org.get.yaml → cards/project_v2.org.view.yaml} +1 -1
- package/dist/cards/{project_v2.user.get.yaml → project_v2.user.view.yaml} +1 -1
- package/dist/{core/registry/cards/release.create_draft.yaml → cards/release.create.yaml} +1 -1
- package/dist/cards/{release.publish_draft.yaml → release.publish.yaml} +1 -1
- package/dist/{core/registry/cards/release.get.yaml → cards/release.view.yaml} +1 -1
- package/dist/cards/repo.view.yaml +2 -4
- package/dist/cards/{workflow_dispatch.run.yaml → workflow.dispatch.yaml} +1 -1
- package/dist/cards/{workflow_job.logs.get.yaml → workflow.job.logs.raw.yaml} +2 -2
- package/dist/{core/registry/cards/workflow_job.logs.analyze.yaml → cards/workflow.job.logs.view.yaml} +1 -1
- package/dist/{core/registry/cards/workflow_run.artifacts.list.yaml → cards/workflow.run.artifacts.list.yaml} +1 -1
- package/dist/cards/{workflow_run.cancel.yaml → workflow.run.cancel.yaml} +1 -1
- package/dist/cards/{workflow_run.rerun_all.yaml → workflow.run.rerun.all.yaml} +3 -3
- package/dist/{core/registry/cards/workflow_run.rerun_failed.yaml → cards/workflow.run.rerun.failed.yaml} +3 -3
- package/dist/{core/registry/cards/workflow_run.get.yaml → cards/workflow.run.view.yaml} +19 -4
- package/dist/cards/{workflow_runs.list.yaml → workflow.runs.list.yaml} +1 -1
- package/dist/cards/{workflow.get.yaml → workflow.view.yaml} +2 -2
- package/dist/chunk-3DU2WHXF.js +15 -0
- package/dist/chunk-3DU2WHXF.js.map +1 -0
- package/dist/chunk-3P3KHWFU.js +5779 -0
- package/dist/chunk-3P3KHWFU.js.map +1 -0
- package/dist/chunk-BIWBJA2F.js +228 -0
- package/dist/chunk-BIWBJA2F.js.map +1 -0
- package/dist/chunk-HEHONZTO.js +121 -0
- package/dist/chunk-HEHONZTO.js.map +1 -0
- package/dist/chunk-Q7RCIK2C.js +773 -0
- package/dist/chunk-Q7RCIK2C.js.map +1 -0
- package/dist/chunk-R3CBGJZX.js +12 -0
- package/dist/chunk-R3CBGJZX.js.map +1 -0
- package/dist/chunk-TDABI6C7.js +167 -0
- package/dist/chunk-TDABI6C7.js.map +1 -0
- package/dist/chunk-TPQYVCAS.js +15 -0
- package/dist/chunk-TPQYVCAS.js.map +1 -0
- package/dist/cli/index.js +202 -21
- package/dist/cli/index.js.map +1 -1
- package/dist/core/registry/cards/issue.assignees.add.yaml +50 -0
- package/dist/core/registry/cards/issue.assignees.remove.yaml +50 -0
- package/dist/core/registry/cards/issue.assignees.set.yaml +47 -0
- package/dist/core/registry/cards/issue.close.yaml +16 -2
- package/dist/core/registry/cards/issue.comments.create.yaml +16 -2
- package/dist/core/registry/cards/issue.create.yaml +11 -0
- package/dist/core/registry/cards/issue.delete.yaml +16 -2
- package/dist/core/registry/cards/issue.labels.add.yaml +48 -0
- package/dist/core/registry/cards/issue.labels.remove.yaml +50 -0
- package/dist/core/registry/cards/issue.labels.set.yaml +47 -0
- package/dist/core/registry/cards/issue.milestone.clear.yaml +40 -0
- package/dist/core/registry/cards/issue.milestone.set.yaml +23 -4
- package/dist/{cards/issue.blocked_by.add.yaml → core/registry/cards/issue.relations.blocked_by.add.yaml} +3 -2
- package/dist/core/registry/cards/{issue.blocked_by.remove.yaml → issue.relations.blocked_by.remove.yaml} +1 -1
- package/dist/core/registry/cards/{issue.parent.remove.yaml → issue.relations.parent.remove.yaml} +11 -1
- package/dist/{cards/issue.parent.set.yaml → core/registry/cards/issue.relations.parent.set.yaml} +3 -2
- package/dist/{cards/issue.linked_prs.list.yaml → core/registry/cards/issue.relations.prs.list.yaml} +1 -1
- package/dist/core/registry/cards/{issue.relations.get.yaml → issue.relations.view.yaml} +1 -1
- package/dist/core/registry/cards/issue.reopen.yaml +16 -2
- package/dist/core/registry/cards/issue.update.yaml +16 -2
- package/dist/core/registry/cards/issue.view.yaml +7 -5
- package/dist/core/registry/cards/pr.assignees.add.yaml +29 -0
- package/dist/core/registry/cards/pr.assignees.remove.yaml +29 -0
- package/dist/{cards/pr.status.checks.yaml → core/registry/cards/pr.checks.list.yaml} +15 -2
- package/dist/{cards/pr.checks.rerun_all.yaml → core/registry/cards/pr.checks.rerun.all.yaml} +2 -4
- package/dist/{cards/pr.checks.rerun_failed.yaml → core/registry/cards/pr.checks.rerun.failed.yaml} +3 -5
- package/dist/core/registry/cards/pr.create.yaml +30 -0
- package/dist/core/registry/cards/{pr.diff.list_files.yaml → pr.diff.files.yaml} +1 -1
- package/dist/core/registry/cards/{pr.ready_for_review.set.yaml → pr.diff.view.yaml} +6 -8
- package/dist/{cards/pr.mergeability.view.yaml → core/registry/cards/pr.merge.status.yaml} +6 -3
- package/dist/{cards/pr.merge.execute.yaml → core/registry/cards/pr.merge.yaml} +1 -1
- package/dist/core/registry/cards/pr.reviews.list.yaml +1 -1
- package/dist/core/registry/cards/{pr.reviewers.request.yaml → pr.reviews.request.yaml} +1 -1
- package/dist/core/registry/cards/pr.reviews.submit.yaml +67 -0
- package/dist/core/registry/cards/{pr.comments.list.yaml → pr.threads.list.yaml} +2 -2
- package/dist/core/registry/cards/{pr.comment.reply.yaml → pr.threads.reply.yaml} +4 -2
- package/dist/core/registry/cards/{pr.comment.resolve.yaml → pr.threads.resolve.yaml} +1 -1
- package/dist/core/registry/cards/{pr.comment.unresolve.yaml → pr.threads.unresolve.yaml} +1 -1
- package/dist/core/registry/cards/pr.update.yaml +29 -0
- package/dist/core/registry/cards/pr.view.yaml +7 -5
- package/dist/{cards/project_v2.item.field.update.yaml → core/registry/cards/project_v2.items.field.update.yaml} +1 -1
- package/dist/{cards/project_v2.item.add_issue.yaml → core/registry/cards/project_v2.items.issue.add.yaml} +1 -1
- package/dist/core/registry/cards/project_v2.items.issue.remove.yaml +23 -0
- package/dist/{cards/project_v2.org.get.yaml → core/registry/cards/project_v2.org.view.yaml} +1 -1
- package/dist/core/registry/cards/{project_v2.user.get.yaml → project_v2.user.view.yaml} +1 -1
- package/dist/{cards/release.create_draft.yaml → core/registry/cards/release.create.yaml} +1 -1
- package/dist/core/registry/cards/{release.publish_draft.yaml → release.publish.yaml} +1 -1
- package/dist/{cards/release.get.yaml → core/registry/cards/release.view.yaml} +1 -1
- package/dist/core/registry/cards/repo.view.yaml +2 -4
- package/dist/core/registry/cards/{workflow_dispatch.run.yaml → workflow.dispatch.yaml} +1 -1
- package/dist/core/registry/cards/{workflow_job.logs.get.yaml → workflow.job.logs.raw.yaml} +2 -2
- package/dist/{cards/workflow_job.logs.analyze.yaml → core/registry/cards/workflow.job.logs.view.yaml} +1 -1
- package/dist/{cards/workflow_run.artifacts.list.yaml → core/registry/cards/workflow.run.artifacts.list.yaml} +1 -1
- package/dist/core/registry/cards/{workflow_run.cancel.yaml → workflow.run.cancel.yaml} +1 -1
- package/dist/core/registry/cards/{workflow_run.rerun_all.yaml → workflow.run.rerun.all.yaml} +3 -3
- package/dist/{cards/workflow_run.rerun_failed.yaml → core/registry/cards/workflow.run.rerun.failed.yaml} +3 -3
- package/dist/{cards/workflow_run.get.yaml → core/registry/cards/workflow.run.view.yaml} +19 -4
- package/dist/core/registry/cards/{workflow_runs.list.yaml → workflow.runs.list.yaml} +1 -1
- package/dist/core/registry/cards/{workflow.get.yaml → workflow.view.yaml} +2 -2
- package/dist/index.d.ts +374 -35
- package/dist/index.js +33 -5
- package/dist/index.js.map +1 -1
- package/dist/issue-mutations-FJNZW7L5.js +668 -0
- package/dist/issue-mutations-FJNZW7L5.js.map +1 -0
- package/dist/issue-queries-GRA4MKPD.js +208 -0
- package/dist/issue-queries-GRA4MKPD.js.map +1 -0
- package/dist/pr-mutations-UG67YOF5.js +344 -0
- package/dist/pr-mutations-UG67YOF5.js.map +1 -0
- package/dist/pr-queries-UOEOXIJQ.js +331 -0
- package/dist/pr-queries-UOEOXIJQ.js.map +1 -0
- package/dist/repo-JDUHFPZF.js +66 -0
- package/dist/repo-JDUHFPZF.js.map +1 -0
- package/package.json +16 -13
- package/skills/using-ghx/SKILL.md +61 -0
- package/dist/agent.d.ts +0 -32
- package/dist/agent.js +0 -36
- package/dist/agent.js.map +0 -1
- package/dist/cards/check_run.annotations.list.yaml +0 -35
- package/dist/cards/issue.assignees.update.yaml +0 -27
- package/dist/cards/issue.labels.update.yaml +0 -27
- package/dist/cards/pr.assignees.update.yaml +0 -38
- package/dist/cards/pr.checks.get_failed.yaml +0 -42
- package/dist/cards/pr.review.submit_comment.yaml +0 -26
- package/dist/cards/pr.review.submit_request_changes.yaml +0 -26
- package/dist/cards/workflow_run.jobs.list.yaml +0 -35
- package/dist/chunk-2FCPR3XZ.js +0 -54
- package/dist/chunk-2FCPR3XZ.js.map +0 -1
- package/dist/chunk-RDUPMVHG.js +0 -4139
- package/dist/chunk-RDUPMVHG.js.map +0 -1
- package/dist/chunk-UN5YHUNK.js +0 -245
- package/dist/chunk-UN5YHUNK.js.map +0 -1
- package/dist/cli/assets/skills/ghx/SKILL.md +0 -57
- package/dist/core/registry/cards/check_run.annotations.list.yaml +0 -35
- package/dist/core/registry/cards/issue.assignees.update.yaml +0 -27
- package/dist/core/registry/cards/issue.labels.update.yaml +0 -27
- package/dist/core/registry/cards/pr.assignees.update.yaml +0 -38
- package/dist/core/registry/cards/pr.checks.get_failed.yaml +0 -42
- package/dist/core/registry/cards/pr.review.submit_approve.yaml +0 -26
- package/dist/core/registry/cards/pr.review.submit_comment.yaml +0 -26
- package/dist/core/registry/cards/pr.review.submit_request_changes.yaml +0 -26
- package/dist/core/registry/cards/workflow_run.jobs.list.yaml +0 -35
- package/dist/envelope-BpF6MNCv.d.ts +0 -55
|
@@ -0,0 +1,668 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getSdk,
|
|
3
|
+
getSdk10,
|
|
4
|
+
getSdk11,
|
|
5
|
+
getSdk12,
|
|
6
|
+
getSdk13,
|
|
7
|
+
getSdk14,
|
|
8
|
+
getSdk15,
|
|
9
|
+
getSdk16,
|
|
10
|
+
getSdk17,
|
|
11
|
+
getSdk18,
|
|
12
|
+
getSdk19,
|
|
13
|
+
getSdk2,
|
|
14
|
+
getSdk20,
|
|
15
|
+
getSdk21,
|
|
16
|
+
getSdk22,
|
|
17
|
+
getSdk3,
|
|
18
|
+
getSdk4,
|
|
19
|
+
getSdk5,
|
|
20
|
+
getSdk6,
|
|
21
|
+
getSdk7,
|
|
22
|
+
getSdk8,
|
|
23
|
+
getSdk9
|
|
24
|
+
} from "./chunk-Q7RCIK2C.js";
|
|
25
|
+
import "./chunk-3DU2WHXF.js";
|
|
26
|
+
import {
|
|
27
|
+
PrCoreFieldsFragmentDoc
|
|
28
|
+
} from "./chunk-TPQYVCAS.js";
|
|
29
|
+
import {
|
|
30
|
+
asRecord,
|
|
31
|
+
assertIssueAssigneesAddInput,
|
|
32
|
+
assertIssueAssigneesRemoveInput,
|
|
33
|
+
assertIssueAssigneesUpdateInput,
|
|
34
|
+
assertIssueBlockedByInput,
|
|
35
|
+
assertIssueCommentCreateInput,
|
|
36
|
+
assertIssueCreateInput,
|
|
37
|
+
assertIssueLabelsAddInput,
|
|
38
|
+
assertIssueLabelsUpdateInput,
|
|
39
|
+
assertIssueLinkedPrsListInput,
|
|
40
|
+
assertIssueMilestoneSetInput,
|
|
41
|
+
assertIssueMutationInput,
|
|
42
|
+
assertIssueParentRemoveInput,
|
|
43
|
+
assertIssueParentSetInput,
|
|
44
|
+
assertIssueRelationsGetInput,
|
|
45
|
+
assertIssueUpdateInput,
|
|
46
|
+
assertNonEmptyString
|
|
47
|
+
} from "./chunk-BIWBJA2F.js";
|
|
48
|
+
import {
|
|
49
|
+
createGraphqlRequestClient
|
|
50
|
+
} from "./chunk-HEHONZTO.js";
|
|
51
|
+
|
|
52
|
+
// src/gql/operations/issue-linked-prs-list.generated.ts
|
|
53
|
+
var IssueLinkedPrsListDocument = `
|
|
54
|
+
query IssueLinkedPrsList($owner: String!, $name: String!, $issueNumber: Int!) {
|
|
55
|
+
repository(owner: $owner, name: $name) {
|
|
56
|
+
issue(number: $issueNumber) {
|
|
57
|
+
timelineItems(first: 50, itemTypes: [CONNECTED_EVENT]) {
|
|
58
|
+
nodes {
|
|
59
|
+
__typename
|
|
60
|
+
... on ConnectedEvent {
|
|
61
|
+
subject {
|
|
62
|
+
__typename
|
|
63
|
+
... on PullRequest {
|
|
64
|
+
...PrCoreFields
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
${PrCoreFieldsFragmentDoc}`;
|
|
74
|
+
var defaultWrapper = (action, _operationName, _operationType, _variables) => action();
|
|
75
|
+
function getSdk23(client, withWrapper = defaultWrapper) {
|
|
76
|
+
return {
|
|
77
|
+
IssueLinkedPrsList(variables, requestHeaders, signal) {
|
|
78
|
+
return withWrapper(
|
|
79
|
+
(wrappedRequestHeaders) => client.request({
|
|
80
|
+
document: IssueLinkedPrsListDocument,
|
|
81
|
+
variables,
|
|
82
|
+
requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },
|
|
83
|
+
signal
|
|
84
|
+
}),
|
|
85
|
+
"IssueLinkedPrsList",
|
|
86
|
+
"query",
|
|
87
|
+
variables
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// src/gql/operations/issue-relations-get.generated.ts
|
|
94
|
+
var IssueRelationsGetDocument = `
|
|
95
|
+
query IssueRelationsGet($owner: String!, $name: String!, $issueNumber: Int!) {
|
|
96
|
+
repository(owner: $owner, name: $name) {
|
|
97
|
+
issue(number: $issueNumber) {
|
|
98
|
+
id
|
|
99
|
+
number
|
|
100
|
+
parent {
|
|
101
|
+
id
|
|
102
|
+
number
|
|
103
|
+
}
|
|
104
|
+
subIssues(first: 50) {
|
|
105
|
+
nodes {
|
|
106
|
+
id
|
|
107
|
+
number
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
blockedBy(first: 50) {
|
|
111
|
+
nodes {
|
|
112
|
+
id
|
|
113
|
+
number
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
`;
|
|
120
|
+
var defaultWrapper2 = (action, _operationName, _operationType, _variables) => action();
|
|
121
|
+
function getSdk24(client, withWrapper = defaultWrapper2) {
|
|
122
|
+
return {
|
|
123
|
+
IssueRelationsGet(variables, requestHeaders, signal) {
|
|
124
|
+
return withWrapper(
|
|
125
|
+
(wrappedRequestHeaders) => client.request({
|
|
126
|
+
document: IssueRelationsGetDocument,
|
|
127
|
+
variables,
|
|
128
|
+
requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders },
|
|
129
|
+
signal
|
|
130
|
+
}),
|
|
131
|
+
"IssueRelationsGet",
|
|
132
|
+
"query",
|
|
133
|
+
variables
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// src/gql/domains/issue-mutations.ts
|
|
140
|
+
function parseIssueNode(issue) {
|
|
141
|
+
const issueRecord = asRecord(issue);
|
|
142
|
+
if (!issueRecord || typeof issueRecord.id !== "string" || typeof issueRecord.number !== "number") {
|
|
143
|
+
throw new Error("Issue mutation failed");
|
|
144
|
+
}
|
|
145
|
+
const result = {
|
|
146
|
+
id: issueRecord.id,
|
|
147
|
+
number: issueRecord.number
|
|
148
|
+
};
|
|
149
|
+
if (typeof issueRecord.title === "string") {
|
|
150
|
+
result.title = issueRecord.title;
|
|
151
|
+
}
|
|
152
|
+
if (typeof issueRecord.state === "string") {
|
|
153
|
+
result.state = issueRecord.state;
|
|
154
|
+
}
|
|
155
|
+
if (typeof issueRecord.url === "string") {
|
|
156
|
+
result.url = issueRecord.url;
|
|
157
|
+
}
|
|
158
|
+
return result;
|
|
159
|
+
}
|
|
160
|
+
async function runIssueCreate(transport, input) {
|
|
161
|
+
assertIssueCreateInput(input);
|
|
162
|
+
const client = createGraphqlRequestClient(transport);
|
|
163
|
+
const repositoryLookupResult = await getSdk10(
|
|
164
|
+
client
|
|
165
|
+
).IssueCreateRepositoryId({
|
|
166
|
+
owner: input.owner,
|
|
167
|
+
name: input.name
|
|
168
|
+
});
|
|
169
|
+
const repositoryId = asRecord(repositoryLookupResult.repository)?.id;
|
|
170
|
+
if (typeof repositoryId !== "string" || repositoryId.length === 0) {
|
|
171
|
+
throw new Error("Repository not found");
|
|
172
|
+
}
|
|
173
|
+
const result = await getSdk9(client).IssueCreate({
|
|
174
|
+
repositoryId,
|
|
175
|
+
title: input.title,
|
|
176
|
+
...input.body === void 0 ? {} : { body: input.body }
|
|
177
|
+
});
|
|
178
|
+
const issue = asRecord(asRecord(result)?.createIssue)?.issue;
|
|
179
|
+
return parseIssueNode(issue);
|
|
180
|
+
}
|
|
181
|
+
async function runIssueUpdate(transport, input) {
|
|
182
|
+
assertIssueUpdateInput(input);
|
|
183
|
+
const client = createGraphqlRequestClient(transport);
|
|
184
|
+
const lookupResult = await getSdk17(client).IssueNodeIdLookup({
|
|
185
|
+
owner: input.owner,
|
|
186
|
+
name: input.name,
|
|
187
|
+
issueNumber: input.issueNumber
|
|
188
|
+
});
|
|
189
|
+
const issueId = asRecord(asRecord(asRecord(lookupResult)?.repository)?.issue)?.id;
|
|
190
|
+
if (typeof issueId !== "string" || issueId.length === 0) {
|
|
191
|
+
throw new Error("Issue not found");
|
|
192
|
+
}
|
|
193
|
+
const result = await getSdk22(client).IssueUpdate({
|
|
194
|
+
issueId,
|
|
195
|
+
...input.title === void 0 ? {} : { title: input.title },
|
|
196
|
+
...input.body === void 0 ? {} : { body: input.body }
|
|
197
|
+
});
|
|
198
|
+
const issue = asRecord(asRecord(result)?.updateIssue)?.issue;
|
|
199
|
+
return parseIssueNode(issue);
|
|
200
|
+
}
|
|
201
|
+
async function runIssueClose(transport, input) {
|
|
202
|
+
assertIssueMutationInput(input);
|
|
203
|
+
const client = createGraphqlRequestClient(transport);
|
|
204
|
+
const lookupResult = await getSdk17(client).IssueNodeIdLookup({
|
|
205
|
+
owner: input.owner,
|
|
206
|
+
name: input.name,
|
|
207
|
+
issueNumber: input.issueNumber
|
|
208
|
+
});
|
|
209
|
+
const issueId = asRecord(asRecord(asRecord(lookupResult)?.repository)?.issue)?.id;
|
|
210
|
+
if (typeof issueId !== "string" || issueId.length === 0) {
|
|
211
|
+
throw new Error("Issue not found");
|
|
212
|
+
}
|
|
213
|
+
const result = await getSdk7(client).IssueClose({ issueId });
|
|
214
|
+
const issueData = parseIssueNode(asRecord(asRecord(result)?.closeIssue)?.issue);
|
|
215
|
+
return {
|
|
216
|
+
...issueData,
|
|
217
|
+
closed: issueData.state === "CLOSED"
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
async function runIssueReopen(transport, input) {
|
|
221
|
+
assertIssueMutationInput(input);
|
|
222
|
+
const client = createGraphqlRequestClient(transport);
|
|
223
|
+
const lookupResult = await getSdk17(client).IssueNodeIdLookup({
|
|
224
|
+
owner: input.owner,
|
|
225
|
+
name: input.name,
|
|
226
|
+
issueNumber: input.issueNumber
|
|
227
|
+
});
|
|
228
|
+
const issueId = asRecord(asRecord(asRecord(lookupResult)?.repository)?.issue)?.id;
|
|
229
|
+
if (typeof issueId !== "string" || issueId.length === 0) {
|
|
230
|
+
throw new Error("Issue not found");
|
|
231
|
+
}
|
|
232
|
+
const result = await getSdk21(client).IssueReopen({ issueId });
|
|
233
|
+
const issueData = parseIssueNode(asRecord(asRecord(result)?.reopenIssue)?.issue);
|
|
234
|
+
return {
|
|
235
|
+
...issueData,
|
|
236
|
+
reopened: issueData.state === "OPEN"
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
async function runIssueDelete(transport, input) {
|
|
240
|
+
assertIssueMutationInput(input);
|
|
241
|
+
const client = createGraphqlRequestClient(transport);
|
|
242
|
+
const lookupResult = await getSdk17(client).IssueNodeIdLookup({
|
|
243
|
+
owner: input.owner,
|
|
244
|
+
name: input.name,
|
|
245
|
+
issueNumber: input.issueNumber
|
|
246
|
+
});
|
|
247
|
+
const issueId = asRecord(asRecord(asRecord(lookupResult)?.repository)?.issue)?.id;
|
|
248
|
+
if (typeof issueId !== "string" || issueId.length === 0) {
|
|
249
|
+
throw new Error("Issue not found");
|
|
250
|
+
}
|
|
251
|
+
const result = await getSdk11(client).IssueDelete({ issueId });
|
|
252
|
+
const mutation = asRecord(asRecord(result)?.deleteIssue);
|
|
253
|
+
if (!mutation) {
|
|
254
|
+
throw new Error("Issue deletion failed");
|
|
255
|
+
}
|
|
256
|
+
return {
|
|
257
|
+
id: issueId,
|
|
258
|
+
number: 0,
|
|
259
|
+
deleted: true
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
async function runIssueLabelsUpdate(transport, input) {
|
|
263
|
+
assertIssueLabelsUpdateInput(input);
|
|
264
|
+
const client = createGraphqlRequestClient(transport);
|
|
265
|
+
const lookupResult = await getSdk13(client).IssueLabelsLookupByNumber({
|
|
266
|
+
owner: input.owner,
|
|
267
|
+
name: input.name,
|
|
268
|
+
issueNumber: input.issueNumber
|
|
269
|
+
});
|
|
270
|
+
const repo = asRecord(asRecord(lookupResult)?.repository);
|
|
271
|
+
const issueId = asRecord(repo?.issue)?.id;
|
|
272
|
+
if (typeof issueId !== "string" || issueId.length === 0) {
|
|
273
|
+
throw new Error("Issue not found");
|
|
274
|
+
}
|
|
275
|
+
const availableLabels = Array.isArray(asRecord(repo?.labels)?.nodes) ? asRecord(repo?.labels)?.nodes : [];
|
|
276
|
+
const labelIdsByName = /* @__PURE__ */ new Map();
|
|
277
|
+
for (const label of availableLabels) {
|
|
278
|
+
const labelRecord = asRecord(label);
|
|
279
|
+
if (typeof labelRecord?.name === "string" && typeof labelRecord?.id === "string") {
|
|
280
|
+
labelIdsByName.set(labelRecord.name.toLowerCase(), labelRecord.id);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
const labelIds = input.labels.map((labelName) => {
|
|
284
|
+
const id = labelIdsByName.get(labelName.toLowerCase());
|
|
285
|
+
if (!id) {
|
|
286
|
+
throw new Error(`Label not found: ${labelName}`);
|
|
287
|
+
}
|
|
288
|
+
return id;
|
|
289
|
+
});
|
|
290
|
+
const result = await getSdk14(client).IssueLabelsUpdate({
|
|
291
|
+
issueId,
|
|
292
|
+
labelIds
|
|
293
|
+
});
|
|
294
|
+
const mutation = asRecord(asRecord(result)?.["updateIssue"]);
|
|
295
|
+
const issue = asRecord(mutation?.["issue"]);
|
|
296
|
+
const labels = asRecord(issue?.["labels"]);
|
|
297
|
+
const labelNodes = Array.isArray(labels?.["nodes"]) ? labels["nodes"] : [];
|
|
298
|
+
return {
|
|
299
|
+
id: assertNonEmptyString(issue?.["id"], "Issue id"),
|
|
300
|
+
labels: labelNodes.map((label) => asRecord(label)?.["name"]).filter((name) => typeof name === "string")
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
async function runIssueLabelsAdd(transport, input) {
|
|
304
|
+
assertIssueLabelsAddInput(input);
|
|
305
|
+
const client = createGraphqlRequestClient(transport);
|
|
306
|
+
const lookupResult = await getSdk13(client).IssueLabelsLookupByNumber({
|
|
307
|
+
owner: input.owner,
|
|
308
|
+
name: input.name,
|
|
309
|
+
issueNumber: input.issueNumber
|
|
310
|
+
});
|
|
311
|
+
const repo = asRecord(asRecord(lookupResult)?.repository);
|
|
312
|
+
const labelableId = asRecord(repo?.issue)?.id;
|
|
313
|
+
if (typeof labelableId !== "string" || labelableId.length === 0) {
|
|
314
|
+
throw new Error("Issue not found");
|
|
315
|
+
}
|
|
316
|
+
const availableLabels = Array.isArray(asRecord(repo?.labels)?.nodes) ? asRecord(repo?.labels)?.nodes : [];
|
|
317
|
+
const labelIdsByName = /* @__PURE__ */ new Map();
|
|
318
|
+
for (const label of availableLabels) {
|
|
319
|
+
const labelRecord = asRecord(label);
|
|
320
|
+
if (typeof labelRecord?.name === "string" && typeof labelRecord?.id === "string") {
|
|
321
|
+
labelIdsByName.set(labelRecord.name.toLowerCase(), labelRecord.id);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
const labelIds = input.labels.map((labelName) => {
|
|
325
|
+
const id = labelIdsByName.get(labelName.toLowerCase());
|
|
326
|
+
if (!id) {
|
|
327
|
+
throw new Error(`Label not found: ${labelName}`);
|
|
328
|
+
}
|
|
329
|
+
return id;
|
|
330
|
+
});
|
|
331
|
+
const result = await getSdk12(client).IssueLabelsAdd({
|
|
332
|
+
labelableId,
|
|
333
|
+
labelIds
|
|
334
|
+
});
|
|
335
|
+
const mutation = asRecord(asRecord(result)?.["addLabelsToLabelable"]);
|
|
336
|
+
const labelable = asRecord(mutation?.["labelable"]);
|
|
337
|
+
const labels = asRecord(labelable?.["labels"]);
|
|
338
|
+
const labelNodes = Array.isArray(labels?.["nodes"]) ? labels["nodes"] : [];
|
|
339
|
+
return {
|
|
340
|
+
id: assertNonEmptyString(labelable?.["id"], "Issue id"),
|
|
341
|
+
labels: labelNodes.map((label) => asRecord(label)?.["name"]).filter((name) => typeof name === "string")
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
async function runIssueAssigneesUpdate(transport, input) {
|
|
345
|
+
assertIssueAssigneesUpdateInput(input);
|
|
346
|
+
const client = createGraphqlRequestClient(transport);
|
|
347
|
+
const lookupResult = await getSdk2(
|
|
348
|
+
client
|
|
349
|
+
).IssueAssigneesLookupByNumber({
|
|
350
|
+
owner: input.owner,
|
|
351
|
+
name: input.name,
|
|
352
|
+
issueNumber: input.issueNumber
|
|
353
|
+
});
|
|
354
|
+
const { assignableId, assigneeIds } = resolveAssigneeIds(lookupResult, input.assignees);
|
|
355
|
+
const result = await getSdk4(client).IssueAssigneesUpdate({
|
|
356
|
+
issueId: assignableId,
|
|
357
|
+
assigneeIds
|
|
358
|
+
});
|
|
359
|
+
const mutation = asRecord(asRecord(result)?.["updateIssue"]);
|
|
360
|
+
const issue = asRecord(mutation?.["issue"]);
|
|
361
|
+
const assignees = asRecord(issue?.["assignees"]);
|
|
362
|
+
const assigneeNodes = Array.isArray(assignees?.["nodes"]) ? assignees["nodes"] : [];
|
|
363
|
+
return {
|
|
364
|
+
id: assertNonEmptyString(issue?.["id"], "Issue id"),
|
|
365
|
+
assignees: assigneeNodes.map((assignee) => asRecord(assignee)?.["login"]).filter((login) => typeof login === "string")
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
function resolveAssigneeIds(lookupResult, assigneeLogins) {
|
|
369
|
+
const repo = asRecord(asRecord(lookupResult)?.repository);
|
|
370
|
+
const issueId = asRecord(repo?.issue)?.id;
|
|
371
|
+
if (typeof issueId !== "string" || issueId.length === 0) {
|
|
372
|
+
throw new Error("Issue not found");
|
|
373
|
+
}
|
|
374
|
+
const assignableNodes = Array.isArray(asRecord(repo?.assignableUsers)?.nodes) ? asRecord(repo?.assignableUsers)?.nodes : [];
|
|
375
|
+
const idsByLogin = /* @__PURE__ */ new Map();
|
|
376
|
+
for (const node of assignableNodes) {
|
|
377
|
+
const rec = asRecord(node);
|
|
378
|
+
if (typeof rec?.login === "string" && typeof rec?.id === "string") {
|
|
379
|
+
idsByLogin.set(rec.login.toLowerCase(), rec.id);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
const assigneeIds = assigneeLogins.map((login) => {
|
|
383
|
+
const id = idsByLogin.get(login.toLowerCase());
|
|
384
|
+
if (!id) {
|
|
385
|
+
throw new Error(`Assignee not found: ${login}`);
|
|
386
|
+
}
|
|
387
|
+
return id;
|
|
388
|
+
});
|
|
389
|
+
return { assignableId: issueId, assigneeIds };
|
|
390
|
+
}
|
|
391
|
+
function parseAssignableResult(result, mutationKey) {
|
|
392
|
+
const mutation = asRecord(asRecord(result)?.[mutationKey]);
|
|
393
|
+
const assignable = asRecord(mutation?.assignable);
|
|
394
|
+
const assignees = asRecord(assignable?.assignees);
|
|
395
|
+
const nodes = Array.isArray(assignees?.nodes) ? assignees.nodes : [];
|
|
396
|
+
return {
|
|
397
|
+
id: assertNonEmptyString(assignable?.id, "Issue id"),
|
|
398
|
+
assignees: nodes.map((n) => asRecord(n)?.login).filter((login) => typeof login === "string")
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
async function runIssueAssigneesAdd(transport, input) {
|
|
402
|
+
assertIssueAssigneesAddInput(input);
|
|
403
|
+
const client = createGraphqlRequestClient(transport);
|
|
404
|
+
const lookupResult = await getSdk2(
|
|
405
|
+
client
|
|
406
|
+
).IssueAssigneesLookupByNumber({
|
|
407
|
+
owner: input.owner,
|
|
408
|
+
name: input.name,
|
|
409
|
+
issueNumber: input.issueNumber
|
|
410
|
+
});
|
|
411
|
+
const { assignableId, assigneeIds } = resolveAssigneeIds(lookupResult, input.assignees);
|
|
412
|
+
const result = await getSdk(client).IssueAssigneesAdd({
|
|
413
|
+
assignableId,
|
|
414
|
+
assigneeIds
|
|
415
|
+
});
|
|
416
|
+
return parseAssignableResult(result, "addAssigneesToAssignable");
|
|
417
|
+
}
|
|
418
|
+
async function runIssueAssigneesRemove(transport, input) {
|
|
419
|
+
assertIssueAssigneesRemoveInput(input);
|
|
420
|
+
const client = createGraphqlRequestClient(transport);
|
|
421
|
+
const lookupResult = await getSdk2(
|
|
422
|
+
client
|
|
423
|
+
).IssueAssigneesLookupByNumber({
|
|
424
|
+
owner: input.owner,
|
|
425
|
+
name: input.name,
|
|
426
|
+
issueNumber: input.issueNumber
|
|
427
|
+
});
|
|
428
|
+
const { assignableId, assigneeIds } = resolveAssigneeIds(lookupResult, input.assignees);
|
|
429
|
+
const result = await getSdk3(client).IssueAssigneesRemove({
|
|
430
|
+
assignableId,
|
|
431
|
+
assigneeIds
|
|
432
|
+
});
|
|
433
|
+
return parseAssignableResult(result, "removeAssigneesFromAssignable");
|
|
434
|
+
}
|
|
435
|
+
async function runIssueMilestoneSet(transport, input) {
|
|
436
|
+
assertIssueMilestoneSetInput(input);
|
|
437
|
+
const client = createGraphqlRequestClient(transport);
|
|
438
|
+
const lookupResult = await getSdk15(
|
|
439
|
+
client
|
|
440
|
+
).IssueMilestoneLookupByNumber({
|
|
441
|
+
owner: input.owner,
|
|
442
|
+
name: input.name,
|
|
443
|
+
issueNumber: input.issueNumber,
|
|
444
|
+
milestoneNumber: input.milestoneNumber
|
|
445
|
+
});
|
|
446
|
+
const repo = asRecord(asRecord(lookupResult)?.repository);
|
|
447
|
+
const issueId = asRecord(repo?.issue)?.id;
|
|
448
|
+
const milestoneId = asRecord(repo?.milestone)?.id;
|
|
449
|
+
if (typeof issueId !== "string" || issueId.length === 0) {
|
|
450
|
+
throw new Error("Issue not found");
|
|
451
|
+
}
|
|
452
|
+
if (typeof milestoneId !== "string" || milestoneId.length === 0) {
|
|
453
|
+
throw new Error(`Milestone not found: ${input.milestoneNumber}`);
|
|
454
|
+
}
|
|
455
|
+
const result = await getSdk16(client).IssueMilestoneSet({
|
|
456
|
+
issueId,
|
|
457
|
+
milestoneId
|
|
458
|
+
});
|
|
459
|
+
const mutation = asRecord(asRecord(result)?.["updateIssue"]);
|
|
460
|
+
const issue = asRecord(mutation?.["issue"]);
|
|
461
|
+
const milestone = asRecord(issue?.["milestone"]);
|
|
462
|
+
return {
|
|
463
|
+
id: assertNonEmptyString(issue?.["id"], "Issue id"),
|
|
464
|
+
milestoneNumber: typeof milestone?.["number"] === "number" ? milestone["number"] : null
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
async function runIssueCommentCreate(transport, input) {
|
|
468
|
+
assertIssueCommentCreateInput(input);
|
|
469
|
+
const client = createGraphqlRequestClient(transport);
|
|
470
|
+
const lookupResult = await getSdk17(client).IssueNodeIdLookup({
|
|
471
|
+
owner: input.owner,
|
|
472
|
+
name: input.name,
|
|
473
|
+
issueNumber: input.issueNumber
|
|
474
|
+
});
|
|
475
|
+
const issueId = asRecord(asRecord(asRecord(lookupResult)?.repository)?.issue)?.id;
|
|
476
|
+
if (typeof issueId !== "string" || issueId.length === 0) {
|
|
477
|
+
throw new Error("Issue not found");
|
|
478
|
+
}
|
|
479
|
+
const result = await getSdk8(client).IssueCommentCreate({
|
|
480
|
+
issueId,
|
|
481
|
+
body: input.body
|
|
482
|
+
});
|
|
483
|
+
const mutation = asRecord(asRecord(result)?.["addComment"]);
|
|
484
|
+
const commentEdge = asRecord(mutation?.["commentEdge"]);
|
|
485
|
+
const node = asRecord(commentEdge?.["node"]);
|
|
486
|
+
if (!node || typeof node["id"] !== "string" || typeof node["body"] !== "string") {
|
|
487
|
+
throw new Error("Issue comment creation failed");
|
|
488
|
+
}
|
|
489
|
+
return {
|
|
490
|
+
id: node["id"],
|
|
491
|
+
body: node["body"],
|
|
492
|
+
url: typeof node["url"] === "string" ? node["url"] : ""
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
async function runIssueLinkedPrsList(transport, input) {
|
|
496
|
+
assertIssueLinkedPrsListInput(input);
|
|
497
|
+
const result = await getSdk23(
|
|
498
|
+
createGraphqlRequestClient(transport)
|
|
499
|
+
).IssueLinkedPrsList({
|
|
500
|
+
owner: input.owner,
|
|
501
|
+
name: input.name,
|
|
502
|
+
issueNumber: input.issueNumber
|
|
503
|
+
});
|
|
504
|
+
const issue = asRecord(asRecord(asRecord(result)?.repository)?.issue);
|
|
505
|
+
const timelineItems = asRecord(issue?.timelineItems);
|
|
506
|
+
const nodes = Array.isArray(timelineItems?.nodes) ? timelineItems.nodes : [];
|
|
507
|
+
return {
|
|
508
|
+
items: nodes.map((node) => asRecord(asRecord(node)?.["subject"])).filter(
|
|
509
|
+
(subject) => Boolean(subject) && subject?.["__typename"] === "PullRequest"
|
|
510
|
+
).flatMap((subject) => {
|
|
511
|
+
if (!subject) {
|
|
512
|
+
return [];
|
|
513
|
+
}
|
|
514
|
+
if (typeof subject["id"] !== "string" || typeof subject["number"] !== "number" || typeof subject["title"] !== "string" || typeof subject["state"] !== "string" || typeof subject["url"] !== "string") {
|
|
515
|
+
return [];
|
|
516
|
+
}
|
|
517
|
+
return [
|
|
518
|
+
{
|
|
519
|
+
id: subject["id"],
|
|
520
|
+
number: subject["number"],
|
|
521
|
+
title: subject["title"],
|
|
522
|
+
state: subject["state"],
|
|
523
|
+
url: subject["url"]
|
|
524
|
+
}
|
|
525
|
+
];
|
|
526
|
+
})
|
|
527
|
+
};
|
|
528
|
+
}
|
|
529
|
+
function parseIssueRelationNode(node) {
|
|
530
|
+
const record = asRecord(node);
|
|
531
|
+
if (!record || typeof record.id !== "string" || typeof record.number !== "number") {
|
|
532
|
+
return null;
|
|
533
|
+
}
|
|
534
|
+
return {
|
|
535
|
+
id: record.id,
|
|
536
|
+
number: record.number
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
async function runIssueRelationsGet(transport, input) {
|
|
540
|
+
assertIssueRelationsGetInput(input);
|
|
541
|
+
const result = await getSdk24(
|
|
542
|
+
createGraphqlRequestClient(transport)
|
|
543
|
+
).IssueRelationsGet({
|
|
544
|
+
owner: input.owner,
|
|
545
|
+
name: input.name,
|
|
546
|
+
issueNumber: input.issueNumber
|
|
547
|
+
});
|
|
548
|
+
const issue = asRecord(asRecord(asRecord(result)?.repository)?.issue);
|
|
549
|
+
const currentIssue = parseIssueRelationNode(issue);
|
|
550
|
+
if (!currentIssue) {
|
|
551
|
+
throw new Error("Issue relations not found");
|
|
552
|
+
}
|
|
553
|
+
const parent = parseIssueRelationNode(issue?.parent);
|
|
554
|
+
const subIssues = asRecord(issue?.["subIssues"]);
|
|
555
|
+
const blockedByConnection = asRecord(issue?.["blockedBy"]);
|
|
556
|
+
const childrenNodes = Array.isArray(subIssues?.["nodes"]) ? subIssues["nodes"] : [];
|
|
557
|
+
const blockedByNodes = Array.isArray(blockedByConnection?.["nodes"]) ? blockedByConnection["nodes"] : [];
|
|
558
|
+
return {
|
|
559
|
+
issue: currentIssue,
|
|
560
|
+
parent,
|
|
561
|
+
children: childrenNodes.map((node) => parseIssueRelationNode(node)).flatMap((node) => node ? [node] : []),
|
|
562
|
+
blockedBy: blockedByNodes.map((node) => parseIssueRelationNode(node)).flatMap((node) => node ? [node] : [])
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
async function runIssueParentSet(transport, input) {
|
|
566
|
+
assertIssueParentSetInput(input);
|
|
567
|
+
const result = await getSdk20(createGraphqlRequestClient(transport)).IssueParentSet({
|
|
568
|
+
issueId: input.issueId,
|
|
569
|
+
parentIssueId: input.parentIssueId
|
|
570
|
+
});
|
|
571
|
+
const mutation = asRecord(asRecord(result)?.addSubIssue);
|
|
572
|
+
const parentIssue = asRecord(mutation?.issue);
|
|
573
|
+
const subIssue = asRecord(mutation?.subIssue);
|
|
574
|
+
if (typeof parentIssue?.id !== "string" || typeof subIssue?.id !== "string") {
|
|
575
|
+
throw new Error("Issue parent update failed");
|
|
576
|
+
}
|
|
577
|
+
return {
|
|
578
|
+
issueId: subIssue.id,
|
|
579
|
+
parentIssueId: parentIssue.id,
|
|
580
|
+
updated: true
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
async function runIssueParentRemove(transport, input) {
|
|
584
|
+
assertIssueParentRemoveInput(input);
|
|
585
|
+
const client = createGraphqlRequestClient(transport);
|
|
586
|
+
const lookupResult = await getSdk18(client).IssueParentLookup({
|
|
587
|
+
issueId: input.issueId
|
|
588
|
+
});
|
|
589
|
+
const parentIssueId = asRecord(asRecord(asRecord(lookupResult)?.node)?.parent)?.id;
|
|
590
|
+
if (typeof parentIssueId !== "string" || parentIssueId.length === 0) {
|
|
591
|
+
throw new Error("Issue parent removal failed");
|
|
592
|
+
}
|
|
593
|
+
const result = await getSdk19(client).IssueParentRemove({
|
|
594
|
+
issueId: input.issueId,
|
|
595
|
+
parentIssueId
|
|
596
|
+
});
|
|
597
|
+
const mutation = asRecord(asRecord(result)?.removeSubIssue);
|
|
598
|
+
const parentIssue = asRecord(mutation?.issue);
|
|
599
|
+
const subIssue = asRecord(mutation?.subIssue);
|
|
600
|
+
if (typeof parentIssue?.id !== "string" || typeof subIssue?.id !== "string") {
|
|
601
|
+
throw new Error("Issue parent removal failed");
|
|
602
|
+
}
|
|
603
|
+
return {
|
|
604
|
+
issueId: subIssue.id,
|
|
605
|
+
parentRemoved: true
|
|
606
|
+
};
|
|
607
|
+
}
|
|
608
|
+
async function runIssueBlockedByAdd(transport, input) {
|
|
609
|
+
assertIssueBlockedByInput(input);
|
|
610
|
+
const result = await getSdk5(
|
|
611
|
+
createGraphqlRequestClient(transport)
|
|
612
|
+
).IssueBlockedByAdd({
|
|
613
|
+
issueId: input.issueId,
|
|
614
|
+
blockedByIssueId: input.blockedByIssueId
|
|
615
|
+
});
|
|
616
|
+
const mutation = asRecord(asRecord(result)?.addBlockedBy);
|
|
617
|
+
const issue = asRecord(mutation?.issue);
|
|
618
|
+
const blockingIssue = asRecord(mutation?.blockingIssue);
|
|
619
|
+
if (typeof issue?.id !== "string" || typeof blockingIssue?.id !== "string") {
|
|
620
|
+
throw new Error("Issue dependency mutation failed");
|
|
621
|
+
}
|
|
622
|
+
return {
|
|
623
|
+
issueId: issue.id,
|
|
624
|
+
blockedByIssueId: blockingIssue.id,
|
|
625
|
+
added: true
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
async function runIssueBlockedByRemove(transport, input) {
|
|
629
|
+
assertIssueBlockedByInput(input);
|
|
630
|
+
const result = await getSdk6(
|
|
631
|
+
createGraphqlRequestClient(transport)
|
|
632
|
+
).IssueBlockedByRemove({
|
|
633
|
+
issueId: input.issueId,
|
|
634
|
+
blockedByIssueId: input.blockedByIssueId
|
|
635
|
+
});
|
|
636
|
+
const mutation = asRecord(asRecord(result)?.removeBlockedBy);
|
|
637
|
+
const issue = asRecord(mutation?.issue);
|
|
638
|
+
const blockingIssue = asRecord(mutation?.blockingIssue);
|
|
639
|
+
if (typeof issue?.id !== "string" || typeof blockingIssue?.id !== "string") {
|
|
640
|
+
throw new Error("Issue dependency mutation failed");
|
|
641
|
+
}
|
|
642
|
+
return {
|
|
643
|
+
issueId: issue.id,
|
|
644
|
+
blockedByIssueId: blockingIssue.id,
|
|
645
|
+
removed: true
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
export {
|
|
649
|
+
runIssueAssigneesAdd,
|
|
650
|
+
runIssueAssigneesRemove,
|
|
651
|
+
runIssueAssigneesUpdate,
|
|
652
|
+
runIssueBlockedByAdd,
|
|
653
|
+
runIssueBlockedByRemove,
|
|
654
|
+
runIssueClose,
|
|
655
|
+
runIssueCommentCreate,
|
|
656
|
+
runIssueCreate,
|
|
657
|
+
runIssueDelete,
|
|
658
|
+
runIssueLabelsAdd,
|
|
659
|
+
runIssueLabelsUpdate,
|
|
660
|
+
runIssueLinkedPrsList,
|
|
661
|
+
runIssueMilestoneSet,
|
|
662
|
+
runIssueParentRemove,
|
|
663
|
+
runIssueParentSet,
|
|
664
|
+
runIssueRelationsGet,
|
|
665
|
+
runIssueReopen,
|
|
666
|
+
runIssueUpdate
|
|
667
|
+
};
|
|
668
|
+
//# sourceMappingURL=issue-mutations-FJNZW7L5.js.map
|