@agent-relay/github-primitive 4.0.9 → 5.0.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.
Files changed (65) hide show
  1. package/dist/actions/branches.d.ts +13 -0
  2. package/dist/actions/branches.d.ts.map +1 -0
  3. package/dist/actions/branches.js +59 -0
  4. package/dist/actions/branches.js.map +1 -0
  5. package/dist/actions/commits.d.ts +15 -0
  6. package/dist/actions/commits.d.ts.map +1 -0
  7. package/dist/actions/commits.js +71 -0
  8. package/dist/actions/commits.js.map +1 -0
  9. package/dist/actions/files.d.ts +40 -0
  10. package/dist/actions/files.d.ts.map +1 -0
  11. package/dist/actions/files.js +133 -0
  12. package/dist/actions/files.js.map +1 -0
  13. package/dist/actions/issues.d.ts +29 -0
  14. package/dist/actions/issues.d.ts.map +1 -0
  15. package/dist/actions/issues.js +120 -0
  16. package/dist/actions/issues.js.map +1 -0
  17. package/dist/actions/pulls.d.ts +40 -0
  18. package/dist/actions/pulls.d.ts.map +1 -0
  19. package/dist/actions/pulls.js +169 -0
  20. package/dist/actions/pulls.js.map +1 -0
  21. package/dist/actions/repos.d.ts +18 -0
  22. package/dist/actions/repos.d.ts.map +1 -0
  23. package/dist/actions/repos.js +70 -0
  24. package/dist/actions/repos.js.map +1 -0
  25. package/dist/actions/users.d.ts +13 -0
  26. package/dist/actions/users.d.ts.map +1 -0
  27. package/dist/actions/users.js +51 -0
  28. package/dist/actions/users.js.map +1 -0
  29. package/dist/actions/utils.d.ts +39 -0
  30. package/dist/actions/utils.d.ts.map +1 -0
  31. package/dist/actions/utils.js +173 -0
  32. package/dist/actions/utils.js.map +1 -0
  33. package/dist/adapter.d.ts +49 -0
  34. package/dist/adapter.d.ts.map +1 -0
  35. package/dist/adapter.js +493 -0
  36. package/dist/adapter.js.map +1 -0
  37. package/dist/client.d.ts +149 -0
  38. package/dist/client.d.ts.map +1 -0
  39. package/dist/client.js +254 -0
  40. package/dist/client.js.map +1 -0
  41. package/dist/cloud-runtime.d.ts +31 -0
  42. package/dist/cloud-runtime.d.ts.map +1 -0
  43. package/dist/cloud-runtime.js +202 -0
  44. package/dist/cloud-runtime.js.map +1 -0
  45. package/dist/constants.d.ts +8 -0
  46. package/dist/constants.d.ts.map +1 -0
  47. package/dist/constants.js +8 -0
  48. package/dist/constants.js.map +1 -0
  49. package/dist/index.d.ts +15 -0
  50. package/dist/index.d.ts.map +1 -0
  51. package/dist/index.js +15 -0
  52. package/dist/index.js.map +1 -0
  53. package/dist/local-runtime.d.ts +46 -0
  54. package/dist/local-runtime.d.ts.map +1 -0
  55. package/dist/local-runtime.js +225 -0
  56. package/dist/local-runtime.js.map +1 -0
  57. package/dist/types.d.ts +513 -0
  58. package/dist/types.d.ts.map +1 -0
  59. package/dist/types.js +50 -0
  60. package/dist/types.js.map +1 -0
  61. package/dist/workflow-step.d.ts +79 -0
  62. package/dist/workflow-step.d.ts.map +1 -0
  63. package/dist/workflow-step.js +459 -0
  64. package/dist/workflow-step.js.map +1 -0
  65. package/package.json +2 -2
@@ -0,0 +1,13 @@
1
+ import type { BranchInfo, CreateBranchParams } from '../types.js';
2
+ import { type GitHubActionAdapter } from './utils.js';
3
+ /**
4
+ * List branches for a repository.
5
+ */
6
+ export declare function listBranches(adapter: GitHubActionAdapter, owner: string, repo: string): Promise<BranchInfo[]>;
7
+ /**
8
+ * Create a branch from another branch, or from the repository default branch.
9
+ */
10
+ export declare function createBranch(adapter: GitHubActionAdapter, params: CreateBranchParams): Promise<void>;
11
+ export declare function getBranch(adapter: GitHubActionAdapter, owner: string, repo: string, branch: string): Promise<BranchInfo>;
12
+ export declare function mapBranch(value: unknown): BranchInfo;
13
+ //# sourceMappingURL=branches.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"branches.d.ts","sourceRoot":"","sources":["../../src/actions/branches.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAiB,MAAM,aAAa,CAAC;AACjF,OAAO,EAWL,KAAK,mBAAmB,EACzB,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE,mBAAmB,EAC5B,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,UAAU,EAAE,CAAC,CAMvB;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiB1G;AAED,wBAAsB,SAAS,CAC7B,OAAO,EAAE,mBAAmB,EAC5B,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,UAAU,CAAC,CAGrB;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,CAYpD"}
@@ -0,0 +1,59 @@
1
+ import { asArray, asRecord, assertNonEmptyString, assertOwnerRepo, booleanValue, branchEndpoint, numberValue, repoEndpoint, stringValue, withActionError, } from './utils.js';
2
+ /**
3
+ * List branches for a repository.
4
+ */
5
+ export async function listBranches(adapter, owner, repo) {
6
+ return withActionError(`list GitHub branches for ${owner}/${repo}`, async () => {
7
+ assertOwnerRepo(owner, repo);
8
+ const response = await adapter.request('GET', repoEndpoint(owner, repo, '/branches'));
9
+ return asArray(response, 'branches').map(mapBranch);
10
+ });
11
+ }
12
+ /**
13
+ * Create a branch from another branch, or from the repository default branch.
14
+ */
15
+ export async function createBranch(adapter, params) {
16
+ const { owner, repo } = params;
17
+ return withActionError(`create GitHub branch ${params.branch} in ${owner}/${repo}`, async () => {
18
+ assertOwnerRepo(owner, repo);
19
+ const branch = assertNonEmptyString(params.branch, 'branch');
20
+ const sourceBranch = params.fromBranch ?? (await getDefaultBranch(adapter, params));
21
+ const source = await getBranch(adapter, owner, repo, sourceBranch);
22
+ const sha = assertNonEmptyString(source.commit.sha, 'source branch sha');
23
+ await adapter.request('POST', repoEndpoint(owner, repo, '/git/refs'), {
24
+ body: {
25
+ ref: `refs/heads/${branch}`,
26
+ sha,
27
+ },
28
+ });
29
+ });
30
+ }
31
+ export async function getBranch(adapter, owner, repo, branch) {
32
+ const response = await adapter.request('GET', branchEndpoint(owner, repo, branch));
33
+ return mapBranch(response);
34
+ }
35
+ export function mapBranch(value) {
36
+ const branch = asRecord(value, 'branch');
37
+ const commit = asRecord(branch.commit, 'branch commit');
38
+ return {
39
+ name: stringValue(branch.name),
40
+ commit: {
41
+ sha: stringValue(commit.sha),
42
+ url: stringValue(commit.url),
43
+ },
44
+ protected: booleanValue(branch.protected),
45
+ };
46
+ }
47
+ async function getDefaultBranch(adapter, params) {
48
+ const response = await adapter.request('GET', repoEndpoint(params.owner, params.repo));
49
+ const repository = asRecord(response, 'repository');
50
+ const branch = stringValue(repository.default_branch);
51
+ if (!branch) {
52
+ const id = numberValue(repository.id);
53
+ throw new Error(id
54
+ ? `Repository ${params.owner}/${params.repo} did not include a default branch.`
55
+ : `Repository ${params.owner}/${params.repo} was not a valid repository response.`);
56
+ }
57
+ return branch;
58
+ }
59
+ //# sourceMappingURL=branches.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"branches.js","sourceRoot":"","sources":["../../src/actions/branches.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EACP,QAAQ,EACR,oBAAoB,EACpB,eAAe,EACf,YAAY,EACZ,cAAc,EACd,WAAW,EACX,YAAY,EACZ,WAAW,EACX,eAAe,GAEhB,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,OAA4B,EAC5B,KAAa,EACb,IAAY;IAEZ,OAAO,eAAe,CAAC,4BAA4B,KAAK,IAAI,IAAI,EAAE,EAAE,KAAK,IAAI,EAAE;QAC7E,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAC7B,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,OAAO,CAAU,KAAK,EAAE,YAA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MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { CommitInfo, CreateCommitParams, ListCommitsParams } from '../types.js';
2
+ import { type GitHubActionAdapter } from './utils.js';
3
+ /**
4
+ * List commits for a repository.
5
+ */
6
+ export declare function listCommits(adapter: GitHubActionAdapter, params: ListCommitsParams): Promise<CommitInfo[]>;
7
+ /**
8
+ * Create a Git commit object.
9
+ *
10
+ * This creates the commit object only. Updating a branch ref is intentionally a
11
+ * separate operation so callers can decide when to move refs.
12
+ */
13
+ export declare function createCommit(adapter: GitHubActionAdapter, params: CreateCommitParams): Promise<CommitInfo>;
14
+ export declare function mapCommit(value: unknown): CommitInfo;
15
+ //# sourceMappingURL=commits.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commits.d.ts","sourceRoot":"","sources":["../../src/actions/commits.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,kBAAkB,EAGlB,iBAAiB,EAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAYL,KAAK,mBAAmB,EACzB,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,mBAAmB,EAC5B,MAAM,EAAE,iBAAiB,GACxB,OAAO,CAAC,UAAU,EAAE,CAAC,CAoBvB;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE,mBAAmB,EAC5B,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,UAAU,CAAC,CAwBrB;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,CAcpD"}
@@ -0,0 +1,71 @@
1
+ import { asArray, asRecord, assertNonEmptyString, assertOwnerRepo, normalizePerPage, optionalRecord, optionalString, removeUndefinedValues, repoEndpoint, stringValue, withActionError, } from './utils.js';
2
+ /**
3
+ * List commits for a repository.
4
+ */
5
+ export async function listCommits(adapter, params) {
6
+ const { owner, repo } = params;
7
+ return withActionError(`list GitHub commits for ${owner}/${repo}`, async () => {
8
+ assertOwnerRepo(owner, repo);
9
+ const query = {
10
+ sha: params.sha,
11
+ path: params.path,
12
+ author: params.author,
13
+ since: params.since,
14
+ until: params.until,
15
+ per_page: normalizePerPage(params.perPage),
16
+ };
17
+ const response = await adapter.request('GET', repoEndpoint(owner, repo, '/commits'), {
18
+ query,
19
+ });
20
+ return asArray(response, 'commits').map(mapCommit);
21
+ });
22
+ }
23
+ /**
24
+ * Create a Git commit object.
25
+ *
26
+ * This creates the commit object only. Updating a branch ref is intentionally a
27
+ * separate operation so callers can decide when to move refs.
28
+ */
29
+ export async function createCommit(adapter, params) {
30
+ const { owner, repo } = params;
31
+ return withActionError(`create GitHub commit in ${owner}/${repo}`, async () => {
32
+ assertOwnerRepo(owner, repo);
33
+ const message = assertNonEmptyString(params.message, 'commit message');
34
+ const tree = assertNonEmptyString(params.tree, 'commit tree');
35
+ if (!Array.isArray(params.parents)) {
36
+ throw new Error('GitHub commit parents must be an array of parent SHAs.');
37
+ }
38
+ const response = await adapter.request('POST', repoEndpoint(owner, repo, '/git/commits'), {
39
+ body: removeUndefinedValues({
40
+ message,
41
+ tree,
42
+ parents: params.parents.map((parent) => assertNonEmptyString(parent, 'parent sha')),
43
+ author: params.author,
44
+ committer: params.committer,
45
+ }),
46
+ });
47
+ return mapCommit(response);
48
+ });
49
+ }
50
+ export function mapCommit(value) {
51
+ const topLevel = asRecord(value, 'commit');
52
+ const nestedCommit = optionalRecord(topLevel.commit);
53
+ const author = optionalRecord(nestedCommit?.author ?? topLevel.author);
54
+ const committer = optionalRecord(nestedCommit?.committer ?? topLevel.committer);
55
+ return {
56
+ sha: stringValue(topLevel.sha),
57
+ url: optionalString(topLevel.url),
58
+ htmlUrl: optionalString(topLevel.html_url),
59
+ message: optionalString(nestedCommit?.message ?? topLevel.message),
60
+ author: author ? mapCommitAuthor(author) : undefined,
61
+ committer: committer ? mapCommitAuthor(committer) : undefined,
62
+ };
63
+ }
64
+ function mapCommitAuthor(value) {
65
+ return {
66
+ name: stringValue(value.name),
67
+ email: stringValue(value.email),
68
+ date: optionalString(value.date),
69
+ };
70
+ }
71
+ //# sourceMappingURL=commits.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commits.js","sourceRoot":"","sources":["../../src/actions/commits.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,OAAO,EACP,QAAQ,EACR,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,qBAAqB,EACrB,YAAY,EACZ,WAAW,EACX,eAAe,GAEhB,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,OAA4B,EAC5B,MAAyB;IAEzB,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IAE/B,OAAO,eAAe,CAAC,2BAA2B,KAAK,IAAI,IAAI,EAAE,EAAE,KAAK,IAAI,EAAE;QAC5E,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAC7B,MAAM,KAAK,GAAsB;YAC/B,GAAG,EAAE,MAAM,CAAC,GAAG;YACf,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC;SAC3C,CAAC;QAEF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,OAAO,CAAU,KAAK,EAAE,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE,UAAU,CAAC,EAAE;YAC5F,KAAK;SACN,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,YA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C,YAAY,EAAE,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;IACvE,MAAM,SAAS,GAAG,cAAc,CAAC,YAAY,EAAE,SAAS,IAAI,QAAQ,CAAC,SAAS,CAAC,CAAC;IAEhF,OAAO;QACL,GAAG,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC;QAC9B,GAAG,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC;QACjC,OAAO,EAAE,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAC1C,OAAO,EAAE,cAAc,CAAC,YAAY,EAAE,OAAO,IAAI,QAAQ,CAAC,OAAO,CAAC;QAClE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS;QACpD,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS;KAC9D,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,KAA8B;IACrD,OAAO;QACL,IAAI,EAAE,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC;QAC7B,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC;QAC/B,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC;KACjC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,40 @@
1
+ import type { CreateFileParams, DeleteFileParams, GitHubFile, ListFilesParams, UpdateFileParams } from '../types.js';
2
+ import { type GitHubActionAdapter } from './utils.js';
3
+ export type ListFileOptions = Omit<ListFilesParams, 'owner' | 'repo' | 'path'>;
4
+ export type CreateFileOptions = Omit<CreateFileParams, 'owner' | 'repo' | 'path' | 'content' | 'message'>;
5
+ export type UpdateFileOptions = Omit<UpdateFileParams, 'owner' | 'repo' | 'path' | 'content' | 'message' | 'sha'>;
6
+ export type DeleteFileOptions = Omit<DeleteFileParams, 'owner' | 'repo' | 'path' | 'sha' | 'message'>;
7
+ /**
8
+ * List files or directories at a repository path.
9
+ *
10
+ * Directory responses are returned as a file list. If the path points at a
11
+ * single file, the file is returned as a one-item list.
12
+ */
13
+ export declare function listFiles(adapter: GitHubActionAdapter, owner: string, repo: string, path?: string, options?: ListFileOptions): Promise<GitHubFile[]>;
14
+ /**
15
+ * Read a repository file and return decoded UTF-8 content.
16
+ *
17
+ * The GitHub contents API returns base64 encoded file data; this action decodes
18
+ * the payload before returning it to callers.
19
+ */
20
+ export declare function readFile(adapter: GitHubActionAdapter, owner: string, repo: string, path: string, ref?: string): Promise<string>;
21
+ /**
22
+ * Create a file in a repository.
23
+ *
24
+ * Content is encoded as base64 and committed with the supplied message. The
25
+ * action resolves when GitHub accepts the create request.
26
+ */
27
+ export declare function createFile(adapter: GitHubActionAdapter, owner: string, repo: string, path: string, content: string, message: string, options?: CreateFileOptions): Promise<void>;
28
+ /**
29
+ * Update an existing repository file.
30
+ *
31
+ * The file SHA is required by the GitHub contents API to avoid overwriting an
32
+ * unexpected version.
33
+ */
34
+ export declare function updateFile(adapter: GitHubActionAdapter, owner: string, repo: string, path: string, content: string, message: string, sha: string, options?: UpdateFileOptions): Promise<GitHubFile>;
35
+ /**
36
+ * Delete a repository file with a commit message.
37
+ */
38
+ export declare function deleteFile(adapter: GitHubActionAdapter, owner: string, repo: string, path: string, sha: string, message: string, options?: DeleteFileOptions): Promise<void>;
39
+ export declare function mapFile(value: unknown): GitHubFile;
40
+ //# sourceMappingURL=files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/actions/files.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,gBAAgB,EACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAYL,KAAK,mBAAmB,EACzB,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,eAAe,EAAE,OAAO,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f,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,UAAU,CAAC,CAoBrB;AAED;;GAEG;AACH,wBAAsB,UAAU,CAC9B,OAAO,EAAE,mBAAmB,EAC5B,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,IAAI,CAAC,CAgBf;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,CAkBlD"}
@@ -0,0 +1,133 @@
1
+ import { Buffer } from 'node:buffer';
2
+ import { asArray, asRecord, assertNonEmptyString, assertOwnerRepo, contentsEndpoint, normalizeRepoPath, numberValue, optionalString, removeUndefinedValues, stringValue, withActionError, } from './utils.js';
3
+ /**
4
+ * List files or directories at a repository path.
5
+ *
6
+ * Directory responses are returned as a file list. If the path points at a
7
+ * single file, the file is returned as a one-item list.
8
+ */
9
+ export async function listFiles(adapter, owner, repo, path = '', options = {}) {
10
+ return withActionError(`list GitHub files at ${owner}/${repo}/${path}`, async () => {
11
+ assertOwnerRepo(owner, repo);
12
+ const response = await adapter.request('GET', contentsEndpoint(owner, repo, path), {
13
+ query: {
14
+ ref: options.ref,
15
+ },
16
+ });
17
+ return Array.isArray(response)
18
+ ? asArray(response, 'repository contents').map(mapFile)
19
+ : [mapFile(response)];
20
+ });
21
+ }
22
+ /**
23
+ * Read a repository file and return decoded UTF-8 content.
24
+ *
25
+ * The GitHub contents API returns base64 encoded file data; this action decodes
26
+ * the payload before returning it to callers.
27
+ */
28
+ export async function readFile(adapter, owner, repo, path, ref) {
29
+ return withActionError(`read GitHub file ${owner}/${repo}/${path}`, async () => {
30
+ assertOwnerRepo(owner, repo);
31
+ assertNonEmptyString(normalizeRepoPath(path), 'file path');
32
+ const response = await adapter.request('GET', contentsEndpoint(owner, repo, path), {
33
+ query: {
34
+ ref,
35
+ },
36
+ });
37
+ const file = mapFile(response);
38
+ if (file.type !== 'file') {
39
+ throw new Error(`GitHub path "${path}" is not a file.`);
40
+ }
41
+ if (!file.content) {
42
+ throw new Error(`GitHub file "${path}" did not include content in the API response.`);
43
+ }
44
+ if (file.encoding && file.encoding !== 'base64') {
45
+ throw new Error(`GitHub file "${path}" used unsupported encoding "${file.encoding}".`);
46
+ }
47
+ return Buffer.from(file.content.replace(/\s/g, ''), 'base64').toString('utf8');
48
+ });
49
+ }
50
+ /**
51
+ * Create a file in a repository.
52
+ *
53
+ * Content is encoded as base64 and committed with the supplied message. The
54
+ * action resolves when GitHub accepts the create request.
55
+ */
56
+ export async function createFile(adapter, owner, repo, path, content, message, options = {}) {
57
+ return withActionError(`create GitHub file ${owner}/${repo}/${path}`, async () => {
58
+ assertOwnerRepo(owner, repo);
59
+ const normalizedPath = assertNonEmptyString(normalizeRepoPath(path), 'file path');
60
+ const commitMessage = assertNonEmptyString(message, 'commit message');
61
+ await adapter.request('PUT', contentsEndpoint(owner, repo, normalizedPath), {
62
+ body: removeUndefinedValues({
63
+ message: commitMessage,
64
+ content: Buffer.from(content, 'utf8').toString('base64'),
65
+ branch: options.branch,
66
+ author: options.author,
67
+ }),
68
+ });
69
+ });
70
+ }
71
+ /**
72
+ * Update an existing repository file.
73
+ *
74
+ * The file SHA is required by the GitHub contents API to avoid overwriting an
75
+ * unexpected version.
76
+ */
77
+ export async function updateFile(adapter, owner, repo, path, content, message, sha, options = {}) {
78
+ return withActionError(`update GitHub file ${owner}/${repo}/${path}`, async () => {
79
+ assertOwnerRepo(owner, repo);
80
+ const normalizedPath = assertNonEmptyString(normalizeRepoPath(path), 'file path');
81
+ const commitMessage = assertNonEmptyString(message, 'commit message');
82
+ const fileSha = assertNonEmptyString(sha, 'file sha');
83
+ const response = await adapter.request('PUT', contentsEndpoint(owner, repo, normalizedPath), {
84
+ body: removeUndefinedValues({
85
+ message: commitMessage,
86
+ content: Buffer.from(content, 'utf8').toString('base64'),
87
+ sha: fileSha,
88
+ branch: options.branch,
89
+ author: options.author,
90
+ }),
91
+ });
92
+ const contentRecord = asRecord(response, 'update file response').content;
93
+ return mapFile(contentRecord);
94
+ });
95
+ }
96
+ /**
97
+ * Delete a repository file with a commit message.
98
+ */
99
+ export async function deleteFile(adapter, owner, repo, path, sha, message, options = {}) {
100
+ return withActionError(`delete GitHub file ${owner}/${repo}/${path}`, async () => {
101
+ assertOwnerRepo(owner, repo);
102
+ const normalizedPath = assertNonEmptyString(normalizeRepoPath(path), 'file path');
103
+ const fileSha = assertNonEmptyString(sha, 'file sha');
104
+ const commitMessage = assertNonEmptyString(message, 'commit message');
105
+ await adapter.request('DELETE', contentsEndpoint(owner, repo, normalizedPath), {
106
+ body: removeUndefinedValues({
107
+ message: commitMessage,
108
+ sha: fileSha,
109
+ branch: options.branch,
110
+ author: options.author,
111
+ }),
112
+ });
113
+ });
114
+ }
115
+ export function mapFile(value) {
116
+ const file = asRecord(value, 'repository content');
117
+ const type = stringValue(file.type) === 'dir' ? 'dir' : 'file';
118
+ return {
119
+ name: stringValue(file.name),
120
+ path: stringValue(file.path),
121
+ sha: stringValue(file.sha),
122
+ size: numberValue(file.size),
123
+ url: stringValue(file.url),
124
+ htmlUrl: stringValue(file.html_url),
125
+ gitUrl: stringValue(file.git_url),
126
+ downloadUrl: optionalString(file.download_url),
127
+ type,
128
+ content: optionalString(file.content),
129
+ encoding: optionalString(file.encoding),
130
+ target: optionalString(file.target),
131
+ };
132
+ }
133
+ //# sourceMappingURL=files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/actions/files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AASrC,OAAO,EACL,OAAO,EACP,QAAQ,EACR,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,cAAc,EACd,qBAA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AC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;IAE/D,OAAO;QACL,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;QAC5B,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;QAC5B,GAAG,EAAE,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC;QAC1B,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;QAC5B,GAAG,EAAE,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC;QAC1B,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC;QACnC,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC;QACjC,WAAW,EAAE,cAAc,CAAC,IAAI,CAAC,YAAY,CAAC;QAC9C,IAAI;QACJ,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC;QACrC,QAAQ,EAAE,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC;QACvC,MAAM,EAAE,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC;KACpC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { CreateIssueParams, Issue, ListIssuesParams, UpdateIssueParams } from '../types.js';
2
+ import { type GitHubActionAdapter } from './utils.js';
3
+ export type ListIssueOptions = Omit<ListIssuesParams, 'owner' | 'repo'>;
4
+ export type CreateIssueOptions = Omit<CreateIssueParams, 'owner' | 'repo' | 'title' | 'body'>;
5
+ export type IssueUpdates = Omit<UpdateIssueParams, 'owner' | 'repo' | 'issueNumber'>;
6
+ /**
7
+ * List repository issues.
8
+ *
9
+ * Pull requests are excluded from the repository issues endpoint response so
10
+ * callers receive only true issues. Local and cloud runtimes are handled by the
11
+ * provided adapter.
12
+ */
13
+ export declare function listIssues(adapter: GitHubActionAdapter, owner: string, repo: string, options?: ListIssueOptions): Promise<Issue[]>;
14
+ /**
15
+ * Create an issue in a repository.
16
+ *
17
+ * The request body is sent through the adapter request layer, allowing the
18
+ * local `gh api` runtime and the cloud proxy runtime to share the same action.
19
+ */
20
+ export declare function createIssue(adapter: GitHubActionAdapter, owner: string, repo: string, title: string, body?: string, options?: CreateIssueOptions): Promise<Issue>;
21
+ /**
22
+ * Update an existing issue.
23
+ *
24
+ * At least one update field must be supplied. Supported updates include title,
25
+ * body, state, assignee, and labels.
26
+ */
27
+ export declare function updateIssue(adapter: GitHubActionAdapter, owner: string, repo: string, number: number, updates: IssueUpdates): Promise<Issue>;
28
+ export declare function mapIssue(value: unknown): Issue;
29
+ //# sourceMappingURL=issues.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"issues.d.ts","sourceRoot":"","sources":["../../src/actions/issues.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACjG,OAAO,EAoBL,KAAK,mBAAmB,EACzB,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,MAAM,CAAC,CAAC;AACxE,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,iBAAiB,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC,CAAC;AAC9F,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,iBAAiB,EAAE,OAAO,GAAG,MAAM,GAAG,aAAa,CAAC,CAAC;AAErF;;;;;;GAMG;AACH,wBAAsB,UAAU,CAC9B,OAAO,EAAE,mBAAmB,EAC5B,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,KAAK,EAAE,CAAC,CAmBlB;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,mBAAmB,EAC5B,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,MAAM,EACb,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,KAAK,CAAC,CAgBhB;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,mBAAmB,EAC5B,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC,KAAK,CAAC,CAqBhB;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,CA+B9C"}
@@ -0,0 +1,120 @@
1
+ import { asArray, asRecord, assertNonEmptyString, assertOwnerRepo, assertPositiveInteger, booleanValue, hasDefinedValue, mapGitHubOwner, mapLogin, mapLogins, numberValue, optionalRecord, optionalString, queryWithPerPage, removeUndefinedValues, repoEndpoint, stateValue, stringValue, withActionError, } from './utils.js';
2
+ /**
3
+ * List repository issues.
4
+ *
5
+ * Pull requests are excluded from the repository issues endpoint response so
6
+ * callers receive only true issues. Local and cloud runtimes are handled by the
7
+ * provided adapter.
8
+ */
9
+ export async function listIssues(adapter, owner, repo, options = {}) {
10
+ return withActionError(`list GitHub issues for ${owner}/${repo}`, async () => {
11
+ assertOwnerRepo(owner, repo);
12
+ const query = queryWithPerPage({
13
+ state: options.state,
14
+ assignee: options.assignee,
15
+ labels: options.labels,
16
+ sort: options.sort,
17
+ direction: options.direction,
18
+ }, options.perPage);
19
+ const response = await adapter.request('GET', repoEndpoint(owner, repo, '/issues'), {
20
+ query,
21
+ });
22
+ return asArray(response, 'issues').filter(isIssueResponse).map(mapIssue);
23
+ });
24
+ }
25
+ /**
26
+ * Create an issue in a repository.
27
+ *
28
+ * The request body is sent through the adapter request layer, allowing the
29
+ * local `gh api` runtime and the cloud proxy runtime to share the same action.
30
+ */
31
+ export async function createIssue(adapter, owner, repo, title, body, options = {}) {
32
+ return withActionError(`create GitHub issue in ${owner}/${repo}`, async () => {
33
+ assertOwnerRepo(owner, repo);
34
+ const issueTitle = assertNonEmptyString(title, 'issue title');
35
+ const response = await adapter.request('POST', repoEndpoint(owner, repo, '/issues'), {
36
+ body: removeUndefinedValues({
37
+ title: issueTitle,
38
+ body,
39
+ assignees: options.assignee ? [options.assignee] : undefined,
40
+ labels: options.labels,
41
+ milestone: options.milestone,
42
+ }),
43
+ });
44
+ return mapIssue(response);
45
+ });
46
+ }
47
+ /**
48
+ * Update an existing issue.
49
+ *
50
+ * At least one update field must be supplied. Supported updates include title,
51
+ * body, state, assignee, and labels.
52
+ */
53
+ export async function updateIssue(adapter, owner, repo, number, updates) {
54
+ return withActionError(`update GitHub issue #${number} in ${owner}/${repo}`, async () => {
55
+ assertOwnerRepo(owner, repo);
56
+ assertPositiveInteger(number, 'issue number');
57
+ if (!hasDefinedValue(updates)) {
58
+ throw new Error('At least one issue update field must be provided.');
59
+ }
60
+ const response = await adapter.request('PATCH', repoEndpoint(owner, repo, `/issues/${number}`), {
61
+ body: removeUndefinedValues({
62
+ title: updates.title,
63
+ body: updates.body,
64
+ state: updates.state,
65
+ assignees: updates.assignee ? [updates.assignee] : undefined,
66
+ labels: updates.labels,
67
+ }),
68
+ });
69
+ return mapIssue(response);
70
+ });
71
+ }
72
+ export function mapIssue(value) {
73
+ const issue = asRecord(value, 'issue');
74
+ const milestone = optionalRecord(issue.milestone);
75
+ const reactions = optionalRecord(issue.reactions);
76
+ return {
77
+ number: numberValue(issue.number),
78
+ id: numberValue(issue.id),
79
+ title: stringValue(issue.title),
80
+ body: optionalString(issue.body),
81
+ user: mapGitHubOwner(issue.user),
82
+ labels: Array.isArray(issue.labels) ? issue.labels.map(mapIssueLabel) : [],
83
+ state: stateValue(issue.state),
84
+ locked: booleanValue(issue.locked),
85
+ assignee: issue.assignee ? mapLogin(issue.assignee) : undefined,
86
+ assignees: mapLogins(issue.assignees),
87
+ milestone: milestone
88
+ ? {
89
+ number: numberValue(milestone.number),
90
+ title: stringValue(milestone.title),
91
+ }
92
+ : undefined,
93
+ commentsCount: numberValue(issue.comments),
94
+ createdAt: stringValue(issue.created_at),
95
+ updatedAt: stringValue(issue.updated_at),
96
+ closedAt: optionalString(issue.closed_at),
97
+ authorAssociation: stringValue(issue.author_association),
98
+ reactions: {
99
+ totalCount: numberValue(reactions?.total_count),
100
+ },
101
+ };
102
+ }
103
+ function mapIssueLabel(value) {
104
+ if (typeof value === 'string') {
105
+ return {
106
+ name: value,
107
+ color: '',
108
+ };
109
+ }
110
+ const label = asRecord(value, 'issue label');
111
+ return {
112
+ name: stringValue(label.name),
113
+ color: stringValue(label.color),
114
+ description: optionalString(label.description),
115
+ };
116
+ }
117
+ function isIssueResponse(value) {
118
+ return !('pull_request' in asRecord(value, 'issue'));
119
+ }
120
+ //# sourceMappingURL=issues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"issues.js","sourceRoot":"","sources":["../../src/actions/issues.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EACP,QAAQ,EACR,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,YAAY,EACZ,eAAe,EACf,cAAc,EACd,QAAQ,EACR,SAAS,EACT,WAAW,EACX,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EACZ,UAAU,EACV,WAAW,EACX,eAAe,GAEhB,MAAM,YAAY,CAAC;AAMpB;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,OAA4B,EAC5B,KAAa,EACb,IAAY,EACZ,UAA4B,EAAE;IAE9B,OAAO,eAAe,CAAC,0BAA0B,KAAK,IAAI,IAAI,EAAE,EAAE,KAAK,IAAI,EAAE;QAC3E,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAC7B,MAAM,KAAK,GAAG,gBAAgB,CAC5B;YACE,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,IAAI,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AAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO;YACL,IAAI,EAAE,KAAK;YACX,KAAK,EAAE,EAAE;SACV,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IAC7C,OAAO;QACL,IAAI,EAAE,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC;QAC7B,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC;QAC/B,WAAW,EAAE,cAAc,CAAC,KAAK,CAAC,WAAW,CAAC;KAC/C,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,KAAc;IACrC,OAAO,CAAC,CAAC,cAAc,IAAI,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;AACvD,CAAC"}
@@ -0,0 +1,40 @@
1
+ import type { CreatePRParams, ListPRsParams, MergePRParams, PR, UpdatePRParams } from '../types.js';
2
+ import { type GitHubActionAdapter } from './utils.js';
3
+ export type ListPROptions = Omit<ListPRsParams, 'owner' | 'repo'>;
4
+ export type CreatePROptions = Omit<CreatePRParams, 'owner' | 'repo' | 'title' | 'body' | 'base' | 'head'>;
5
+ export type PullRequestUpdates = Omit<UpdatePRParams, 'owner' | 'repo' | 'pullNumber'>;
6
+ /**
7
+ * List pull requests for a repository.
8
+ *
9
+ * Query options are mapped to GitHub REST parameters and the adapter determines
10
+ * whether the call is executed through `gh api` or the configured cloud proxy.
11
+ */
12
+ export declare function listPRs(adapter: GitHubActionAdapter, owner: string, repo: string, options?: ListPROptions): Promise<PR[]>;
13
+ /**
14
+ * Fetch a single pull request by number.
15
+ */
16
+ export declare function getPR(adapter: GitHubActionAdapter, owner: string, repo: string, number: number): Promise<PR>;
17
+ /**
18
+ * Create a pull request.
19
+ *
20
+ * The supplied base and head refs are passed directly to the GitHub REST API,
21
+ * supporting same-repository branches and owner-qualified fork refs.
22
+ */
23
+ export declare function createPR(adapter: GitHubActionAdapter, owner: string, repo: string, title: string, body: string | undefined, base: string, head: string, options?: CreatePROptions): Promise<PR>;
24
+ /**
25
+ * Update an existing pull request.
26
+ *
27
+ * At least one update field must be provided. GitHub accepts base branch
28
+ * changes and maintainer edit permissions through the same endpoint.
29
+ */
30
+ export declare function updatePR(adapter: GitHubActionAdapter, owner: string, repo: string, number: number, updates: PullRequestUpdates): Promise<PR>;
31
+ /**
32
+ * Merge a pull request and return the fresh pull request representation.
33
+ *
34
+ * GitHub's merge endpoint returns a small confirmation payload, so this action
35
+ * fetches the pull request after a successful merge to preserve the typed PR
36
+ * return value used by the primitive.
37
+ */
38
+ export declare function mergePR(adapter: GitHubActionAdapter, owner: string, repo: string, number: number, options?: Omit<MergePRParams, 'owner' | 'repo' | 'pullNumber'>): Promise<PR>;
39
+ export declare function mapPR(value: unknown): PR;
40
+ //# sourceMappingURL=pulls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pulls.d.ts","sourceRoot":"","sources":["../../src/actions/pulls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACpG,OAAO,EAoBL,KAAK,mBAAmB,EACzB,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,EAAE,OAAO,GAAG,MAAM,CAAC,CAAC;AAClE,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,CAAC;AAC1G,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,MAAM,GAAG,YAAY,CAAC,CAAC;AAEvF;;;;;GAKG;AACH,wBAAsB,OAAO,CAC3B,OAAO,EAAE,mBA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