@theholocron/holocron-plugin-github 5.0.0-alpha.115 → 5.0.0-alpha.116

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
@@ -1,5 +1,5 @@
1
1
  import { GitHubClient, GitHubClientOptions, createGitHubClient } from "@theholocron/github-client";
2
- import { Auth, AuthError, Ci, CiRun, CiRunFilter, Environment, Environments, Issue, IssueSearchFilter, Issues, LabelDef, LifecycleResult, LifecycleSlot, PagesConfig, PullRequest, RepoRef, RepoSettings, ResolveTokenInput, Ruleset, SecretScope, Secrets, Source, TeamEntry, TeamEntry as TeamEntry$1, TeamPermission, TrackerDoctorReport, TrackerUser, createFeatureResolver } from "@theholocron/cli";
2
+ import { Auth, AuthError, Ci, CiRun, CiRunFilter, Environment, Environments, Issue, IssueSearchFilter, Issues, LabelDef, LifecycleResult, LifecycleSlot, PagesConfig, PullRequest, RepoRef, RepoSettings, ResolveTokenInput, Ruleset, SecretScope, Secrets, Source, TeamEntry, TeamEntry as TeamEntry$1, TeamPermission, TrackerDoctorReport, TrackerUser, VerifyTokenFailure, VerifyTokenResult, VerifyTokenResult as VerifyTokenResult$1, VerifyTokenSuccess, createFeatureResolver } from "@theholocron/cli";
3
3
  //#region src/auth.d.ts
4
4
  declare const resolveReadToken: (input?: ResolveTokenInput) => string;
5
5
  declare const resolveIssuesToken: (input?: ResolveTokenInput) => string;
@@ -184,30 +184,11 @@ declare function syncTeams(client: GitHubClient, repo: string, teams: TeamEntry[
184
184
  declare function encryptSecret(publicKeyBase64: string, value: string): Promise<string>;
185
185
  //#endregion
186
186
  //#region src/verify-token.d.ts
187
- /**
188
- * `verifyToken` — plugin-level export used by `holocron auth set` +
189
- * `holocron auth check`. Hits `GET /user` and translates the response
190
- * into the normalized `VerifyTokenResult` shape.
191
- *
192
- * Kept as a standalone function (not a capability method) so the auth
193
- * command can call it without initializing the full plugin — plugin
194
- * construction requires an already-resolved token, which is exactly
195
- * what we don't have yet at bootstrap time.
196
- */
197
- interface VerifyTokenSuccess {
198
- ok: true;
199
- subject: string;
200
- }
201
- interface VerifyTokenFailure {
202
- ok: false;
203
- message: string;
204
- }
205
- type VerifyTokenResult = VerifyTokenSuccess | VerifyTokenFailure;
206
187
  interface VerifyTokenOptions {
207
188
  baseUrl?: string;
208
189
  fetch?: typeof fetch;
209
190
  }
210
- declare function verifyToken(token: string, opts?: VerifyTokenOptions): Promise<VerifyTokenResult>;
191
+ declare function verifyToken(token: string, opts?: VerifyTokenOptions): Promise<VerifyTokenResult$1>;
211
192
  //#endregion
212
193
  //#region src/index.d.ts
213
194
  interface GitHubPluginOptions extends ResolveTokenInput {
package/dist/index.mjs CHANGED
@@ -3,6 +3,7 @@ import { createGitHubClient, createGitHubClient as createGitHubClient$1 } from "
3
3
  import { AuthError, createFeatureResolver } from "@theholocron/cli";
4
4
  import { mkdir, readFile, readdir, rm, stat, writeFile } from "node:fs/promises";
5
5
  import { dirname, join } from "node:path";
6
+ import { errorMessage } from "@theholocron/misc-utils";
6
7
  //#region src/auth.ts
7
8
  const resolveReadToken = createFeatureResolver({
8
9
  envName: "HOLOCRON_READ_TOKEN",
@@ -652,16 +653,6 @@ async function ensureDir(path) {
652
653
  }
653
654
  //#endregion
654
655
  //#region src/verify-token.ts
655
- /**
656
- * `verifyToken` — plugin-level export used by `holocron auth set` +
657
- * `holocron auth check`. Hits `GET /user` and translates the response
658
- * into the normalized `VerifyTokenResult` shape.
659
- *
660
- * Kept as a standalone function (not a capability method) so the auth
661
- * command can call it without initializing the full plugin — plugin
662
- * construction requires an already-resolved token, which is exactly
663
- * what we don't have yet at bootstrap time.
664
- */
665
656
  async function verifyToken(token, opts = {}) {
666
657
  const client = createGitHubClient({
667
658
  token,
@@ -677,7 +668,7 @@ async function verifyToken(token, opts = {}) {
677
668
  } catch (err) {
678
669
  return {
679
670
  ok: false,
680
- message: err instanceof Error ? err.message : String(err)
671
+ message: errorMessage(err)
681
672
  };
682
673
  }
683
674
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/holocron-plugin-github",
3
- "version": "5.0.0-alpha.115",
3
+ "version": "5.0.0-alpha.116",
4
4
  "description": "Holocron plugin for GitHub. Implements source, ci, secrets, environments, and issues capabilities against the GitHub REST API.",
5
5
  "keywords": [
6
6
  "ci",
@@ -37,6 +37,7 @@
37
37
  "@theholocron/eslint-config": "^8.7.0",
38
38
  "@theholocron/github-client": "^1.37.1",
39
39
  "@theholocron/http-client": "^1.37.1",
40
+ "@theholocron/misc-utils": "^1.9.2",
40
41
  "@theholocron/tsconfig": "^8.7.0",
41
42
  "@theholocron/tsdown-config": "^8.7.0",
42
43
  "@theholocron/vitest-config": "^8.7.0",
@@ -50,11 +51,12 @@
50
51
  "tsx": "4.23.12",
51
52
  "typescript": "^5.9.3",
52
53
  "vitest": "^4.1.11",
53
- "@theholocron/cli": "5.0.0-alpha.115"
54
+ "@theholocron/cli": "5.0.0-alpha.116"
54
55
  },
55
56
  "peerDependencies": {
56
57
  "@theholocron/github-client": "^1.37.1",
57
- "@theholocron/cli": "5.0.0-alpha.115"
58
+ "@theholocron/misc-utils": "^1.9.2",
59
+ "@theholocron/cli": "5.0.0-alpha.116"
58
60
  },
59
61
  "engines": {
60
62
  "node": ">=22"