@theholocron/holocron-plugin-axiom 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,4 +1,4 @@
1
- import { AuthError, Logs, ResolveTokenInput } from "@theholocron/cli";
1
+ import { AuthError, Logs, ResolveTokenInput, VerifyTokenFailure, VerifyTokenResult, VerifyTokenResult as VerifyTokenResult$1, VerifyTokenSuccess } from "@theholocron/cli";
2
2
  //#region src/auth.d.ts
3
3
  declare const resolveToken: (input?: ResolveTokenInput) => string;
4
4
  //#endregion
@@ -66,28 +66,11 @@ declare class AxiomLogs implements Logs {
66
66
  }
67
67
  //#endregion
68
68
  //#region src/verify-token.d.ts
69
- /**
70
- * `verifyToken` — plugin-level export used by `holocron auth set axiom`
71
- * + `holocron auth check`. Hits `GET /v2/user` and translates the
72
- * response into the normalized `VerifyTokenResult` shape.
73
- *
74
- * Kept as a standalone function (not a capability method) so the auth
75
- * command can call it without initializing the full plugin.
76
- */
77
- interface VerifyTokenSuccess {
78
- ok: true;
79
- subject: string;
80
- }
81
- interface VerifyTokenFailure {
82
- ok: false;
83
- message: string;
84
- }
85
- type VerifyTokenResult = VerifyTokenSuccess | VerifyTokenFailure;
86
69
  interface VerifyTokenOptions {
87
70
  baseUrl?: string;
88
71
  fetch?: typeof fetch;
89
72
  }
90
- declare function verifyToken(token: string, opts?: VerifyTokenOptions): Promise<VerifyTokenResult>;
73
+ declare function verifyToken(token: string, opts?: VerifyTokenOptions): Promise<VerifyTokenResult$1>;
91
74
  //#endregion
92
75
  //#region src/index.d.ts
93
76
  interface AxiomPluginOptions extends ResolveTokenInput, AxiomLogsOptions {
package/dist/index.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import { AuthError, ProviderApiError, createResolveToken, createRestClient } from "@theholocron/cli";
2
+ import { errorMessage } from "@theholocron/misc-utils";
2
3
  //#region src/auth.ts
3
4
  const resolveToken = createResolveToken({
4
5
  envName: "HOLOCRON_AXIOM_TOKEN",
@@ -68,14 +69,6 @@ function createAxiomClient(opts) {
68
69
  }
69
70
  //#endregion
70
71
  //#region src/verify-token.ts
71
- /**
72
- * `verifyToken` — plugin-level export used by `holocron auth set axiom`
73
- * + `holocron auth check`. Hits `GET /v2/user` and translates the
74
- * response into the normalized `VerifyTokenResult` shape.
75
- *
76
- * Kept as a standalone function (not a capability method) so the auth
77
- * command can call it without initializing the full plugin.
78
- */
79
72
  async function verifyToken(token, opts = {}) {
80
73
  const client = createAxiomClient({
81
74
  token,
@@ -91,7 +84,7 @@ async function verifyToken(token, opts = {}) {
91
84
  } catch (err) {
92
85
  return {
93
86
  ok: false,
94
- message: err instanceof Error ? err.message : String(err)
87
+ message: errorMessage(err)
95
88
  };
96
89
  }
97
90
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/holocron-plugin-axiom",
3
- "version": "5.0.0-alpha.115",
3
+ "version": "5.0.0-alpha.116",
4
4
  "description": "Holocron plugin for Axiom. Implements the logs capability against Axiom's REST API — dataset provisioning and connectivity checks, plus verifyToken + AUTH_HINT for `holocron auth`.",
5
5
  "keywords": [
6
6
  "axiom",
@@ -32,6 +32,7 @@
32
32
  "devDependencies": {
33
33
  "@theholocron/eslint-config": "^8.7.0",
34
34
  "@theholocron/http-client": "^1.37.1",
35
+ "@theholocron/misc-utils": "^1.9.2",
35
36
  "@theholocron/tsconfig": "^8.7.0",
36
37
  "@theholocron/tsdown-config": "^8.7.0",
37
38
  "@theholocron/vitest-config": "^8.7.0",
@@ -45,10 +46,11 @@
45
46
  "tsx": "4.23.12",
46
47
  "typescript": "^5.9.3",
47
48
  "vitest": "^4.1.11",
48
- "@theholocron/cli": "5.0.0-alpha.115"
49
+ "@theholocron/cli": "5.0.0-alpha.116"
49
50
  },
50
51
  "peerDependencies": {
51
- "@theholocron/cli": "5.0.0-alpha.115"
52
+ "@theholocron/misc-utils": "^1.9.2",
53
+ "@theholocron/cli": "5.0.0-alpha.116"
52
54
  },
53
55
  "engines": {
54
56
  "node": ">=22"