@theholocron/github-client 1.58.0-alpha.26 → 1.58.0-alpha.28

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/index.d.mts CHANGED
@@ -622,6 +622,8 @@ interface ReviewThread {
622
622
  }
623
623
  /** A repository as GitHub returns it, with only the fields this client reads. */
624
624
  interface GitHubRepo {
625
+ /** The repository's numeric id, which organization secrets and variables name their readers by. */
626
+ id: number;
625
627
  /** The name of the repository's default branch. */
626
628
  default_branch: string;
627
629
  /** The repository's `owner/name`. */
@@ -702,6 +704,15 @@ interface GitHubPublicKey {
702
704
  /** The Base64-encoded public key. */
703
705
  key: string;
704
706
  }
707
+ /** Who can read an organization secret: every repository, every private one, or the ones listed. */
708
+ type OrgSecretVisibility = "all" | "private" | "selected";
709
+ /** An organization secret as the list returns it: its name and who can read it (never its value). */
710
+ interface OrgSecretInfo {
711
+ /** The secret's name. */
712
+ name: string;
713
+ /** Who can read it. */
714
+ visibility: OrgSecretVisibility;
715
+ }
705
716
  /** The workflow run that a code scanning setup started. */
706
717
  interface CodeScanningSetupResult {
707
718
  /** The id of the workflow run. */
@@ -1063,6 +1074,8 @@ export declare function createGitHubClient(opts: GitHubClientOptions): {
1063
1074
  };
1064
1075
  secrets: {
1065
1076
  listSecrets: (repo: string, scope: SecretScope) => Promise<string[]>;
1077
+ listOrgSecretInfo: (org: string) => Promise<OrgSecretInfo[]>;
1078
+ listSelectedRepositories: (org: string, name: string) => Promise<string[]>;
1066
1079
  getPublicKey: (repo: string, scope: SecretScope) => Promise<GitHubPublicKey>;
1067
1080
  putSecret: (repo: string, scope: SecretScope, name: string, body: Record<string, unknown>) => Promise<void>;
1068
1081
  deleteSecret: (repo: string, scope: SecretScope, name: string) => Promise<void>;
@@ -1107,4 +1120,4 @@ export declare function createGitHubClient(opts: GitHubClientOptions): {
1107
1120
  };
1108
1121
  /** The client returned by `createGitHubClient()`: one group of methods per GitHub API area. */
1109
1122
  export type GitHubClient = ReturnType<typeof createGitHubClient>;
1110
- export type { CheckRunAnnotation, CheckRunAnnotationLevel, CheckRunConclusion, CheckRunOutput, CheckRunStatus, CodeScanningSetupResult, CreateCheckRunInput, CreatePagesPayload, CreatePullInput, CreateReviewComment, CreateReviewInput, GitBlob, GitCommit, GitContents, GitDirectoryEntry, GitHubApp, GitHubAppAccount, GitHubAppCredentials, GitHubAppInstallation, GitHubCheckRun, GitHubClientOptions, GitHubContents, GitHubEnvironment, GitHubInstallationWebhookPayload, GitHubIssue, GitHubIssueComment, GitHubLabel, GitHubMilestone, GitHubPages, GitHubPublicKey, GitHubPullRequest, GitHubPullRequestCommit, GitHubPullRequestFile, GitHubPullRequestReview, GitHubPullRequestWebhookPayload, GitHubPushWebhookPayload, GitHubRepo, GitHubRuleset, GitHubRulesetDetail, GitHubUser, GitHubUserWithExpiry, GitHubVariable, GitHubWebhookHeaders, GitHubWorkflowRun, GitPull, GitRef, GitTree, GitTreeItem, GraphQLClient, InstallationAccessToken, IssueSearchParams, ListDirectoryOptions, OrgProperty, PagesBuildStatus, PagesBuildType, PutContentsInput, PutContentsResult, RepoPropertyValue, RepoTeam, ReviewThread, SecretScope, TeamMember, TeamPermission, UpdateCheckRunInput, UpdatePagesPayload, VariableScope, VariableVisibility, WorkflowRunFilter };
1123
+ export type { CheckRunAnnotation, CheckRunAnnotationLevel, CheckRunConclusion, CheckRunOutput, CheckRunStatus, CodeScanningSetupResult, CreateCheckRunInput, CreatePagesPayload, CreatePullInput, CreateReviewComment, CreateReviewInput, GitBlob, GitCommit, GitContents, GitDirectoryEntry, GitHubApp, GitHubAppAccount, GitHubAppCredentials, GitHubAppInstallation, GitHubCheckRun, GitHubClientOptions, GitHubContents, GitHubEnvironment, GitHubInstallationWebhookPayload, GitHubIssue, GitHubIssueComment, GitHubLabel, GitHubMilestone, GitHubPages, GitHubPublicKey, GitHubPullRequest, GitHubPullRequestCommit, GitHubPullRequestFile, GitHubPullRequestReview, GitHubPullRequestWebhookPayload, GitHubPushWebhookPayload, GitHubRepo, GitHubRuleset, GitHubRulesetDetail, GitHubUser, GitHubUserWithExpiry, GitHubVariable, GitHubWebhookHeaders, GitHubWorkflowRun, GitPull, GitRef, GitTree, GitTreeItem, GraphQLClient, InstallationAccessToken, IssueSearchParams, ListDirectoryOptions, OrgProperty, OrgSecretInfo, OrgSecretVisibility, PagesBuildStatus, PagesBuildType, PutContentsInput, PutContentsResult, RepoPropertyValue, RepoTeam, ReviewThread, SecretScope, TeamMember, TeamPermission, UpdateCheckRunInput, UpdatePagesPayload, VariableScope, VariableVisibility, WorkflowRunFilter };
package/dist/index.mjs CHANGED
@@ -538,6 +538,13 @@ function scopeBase$1(repo, scope) {
538
538
  function secrets(rest) {
539
539
  return {
540
540
  listSecrets: (repo, scope) => rest.request(`${scopeBase$1(repo, scope)}/secrets`).then((r) => r.secrets.map((s) => s.name)),
541
+ /** The organization's secrets with their visibility, names only (first 100). */
542
+ listOrgSecretInfo: (org) => rest.request(`/orgs/${org}/actions/secrets?per_page=100`).then((r) => r.secrets.map((s) => ({
543
+ name: s.name,
544
+ visibility: s.visibility
545
+ }))),
546
+ /** The names of the repositories that can read one organization secret of visibility `selected` (first 100). */
547
+ listSelectedRepositories: (org, name) => rest.request(`/orgs/${org}/actions/secrets/${name}/repositories?per_page=100`).then((r) => r.repositories.map((repo) => repo.name)),
541
548
  getPublicKey: (repo, scope) => rest.request(`${scopeBase$1(repo, scope)}/secrets/public-key`),
542
549
  putSecret: (repo, scope, name, body) => rest.request(`${scopeBase$1(repo, scope)}/secrets/${name}`, {
543
550
  method: "PUT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/github-client",
3
- "version": "1.58.0-alpha.26",
3
+ "version": "1.58.0-alpha.28",
4
4
  "description": "A TypeScript client for the GitHub REST API",
5
5
  "keywords": [
6
6
  "github",
@@ -32,8 +32,8 @@
32
32
  "dist"
33
33
  ],
34
34
  "dependencies": {
35
- "@theholocron/http-client": "^1.58.0-alpha.26",
36
- "@theholocron/observability": "^0.7.0-alpha.3"
35
+ "@theholocron/http-client": "^1.58.0-alpha.28",
36
+ "@theholocron/observability": "^0.7.0-alpha.4"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/node": "^26",
@@ -45,10 +45,10 @@
45
45
  "tsdown": "^0.23.5",
46
46
  "typescript": "^5.9.3",
47
47
  "vitest": "^5.1.0",
48
- "@theholocron/eslint-config": "^8.9.0-alpha.15",
49
- "@theholocron/tsconfig": "^8.9.0-alpha.15",
50
- "@theholocron/vitest-config": "^8.9.0-alpha.15",
51
- "@theholocron/tsdown-config": "^8.9.0-alpha.15"
48
+ "@theholocron/eslint-config": "^8.9.0-alpha.16",
49
+ "@theholocron/tsconfig": "^8.9.0-alpha.16",
50
+ "@theholocron/tsdown-config": "^8.9.0-alpha.16",
51
+ "@theholocron/vitest-config": "^8.9.0-alpha.16"
52
52
  },
53
53
  "engines": {
54
54
  "node": ">=22.0.0"