@theholocron/holocron-plugin-axiom 5.0.0-alpha.42 → 5.0.0-alpha.420
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/README.md +15 -14
- package/dist/index.d.mts +40 -69
- package/dist/index.mjs +91 -33
- package/package.json +30 -23
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ plus exports `verifyToken` + `AUTH_HINT` for use by `holocron auth`.
|
|
|
9
9
|
> This plugin does **not** ship log lines. `@theholocron/observability/logger`'s
|
|
10
10
|
> Axiom transport reads `HOLOCRON_AXIOM_TOKEN` / `HOLOCRON_AXIOM_DATASET`
|
|
11
11
|
> directly at startup. The `logs` capability exists only for the
|
|
12
|
-
> management surface — `holocron setup` provisions the aggregation
|
|
12
|
+
> management surface — `holocron repo setup` provisions the aggregation
|
|
13
13
|
> datasets and `holocron doctor` checks connectivity.
|
|
14
14
|
|
|
15
15
|
## Install
|
|
@@ -49,23 +49,24 @@ token as `HOLOCRON_AXIOM_TOKEN` (or `AXIOM_TOKEN`) in the workflow env.
|
|
|
49
49
|
}
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
No options are required. `holocron setup` provisions the `holocron
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
`logs: ["axiom", { "dataset": "
|
|
56
|
-
for `doctor`.
|
|
52
|
+
No options are required. `holocron repo setup` provisions the CLI's dataset (`holocron`)
|
|
53
|
+
named by `HOLOCRON_AXIOM_DATASET` / `AXIOM_DATASET`; every environment of the CLI ships to
|
|
54
|
+
it and is told apart by the `env` field on each line. `holocron doctor` checks
|
|
55
|
+
the same dataset. An explicit `logs: ["axiom", { "dataset": "my-dataset" }]`
|
|
56
|
+
overrides the env var for `doctor`.
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
(`holocron-ci`). Leave it unset locally to skip Axiom entirely.
|
|
58
|
+
The dataset name is **not a secret** — it is the org variable `HOLOCRON_AXIOM_DATASET`,
|
|
59
|
+
synced from 1Password. Leave the token unset locally to skip Axiom entirely.
|
|
61
60
|
|
|
62
61
|
## What's implemented
|
|
63
62
|
|
|
64
|
-
| Method | Behavior
|
|
65
|
-
| --------------- |
|
|
66
|
-
| `describe` | Returns `{ provider: "axiom", envKeys: ["HOLOCRON_AXIOM_TOKEN", "HOLOCRON_AXIOM_DATASET"] }`.
|
|
67
|
-
| `whoami` | `GET /v2/datasets/{dataset}` — verifies the token and the configured dataset's reachability.
|
|
68
|
-
| `ensureDataset` | `GET /v2/datasets/{name}`; on 404, `POST /v2/datasets`. Returns `{ alreadyExists }`. Idempotent.
|
|
63
|
+
| Method | Behavior |
|
|
64
|
+
| --------------- | ------------------------------------------------------------------------------------------------------------------------- |
|
|
65
|
+
| `describe` | Returns `{ provider: "axiom", envKeys: ["HOLOCRON_AXIOM_TOKEN", "HOLOCRON_AXIOM_DATASET"] }`. |
|
|
66
|
+
| `whoami` | `GET /v2/datasets/{dataset}` — verifies the token and the configured dataset's reachability. |
|
|
67
|
+
| `ensureDataset` | `GET /v2/datasets/{name}`; on 404, `POST /v2/datasets`. Returns `{ alreadyExists }`. Idempotent. |
|
|
68
|
+
| `readDataset` | `GET /v2/datasets/{name}`; a 404 is `{ exists: false }` and nothing is created. Returns `retentionDays` when Axiom does. |
|
|
69
|
+
| `checkToken` | `GET` of a dataset that cannot exist: a 404 means the token is accepted, a 401 means it is refused, anything else throws. |
|
|
69
70
|
|
|
70
71
|
Plugin-level exports (not capability methods, per the auth-bootstrap convention):
|
|
71
72
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,39 +1,10 @@
|
|
|
1
|
-
import { AuthError, Logs, ResolveTokenInput } from "@theholocron/cli";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
id: string;
|
|
9
|
-
name: string;
|
|
10
|
-
description?: string;
|
|
11
|
-
}
|
|
12
|
-
/** Axiom user — the subset returned by `GET /v2/user`. */
|
|
13
|
-
interface AxiomUser {
|
|
14
|
-
id: string;
|
|
15
|
-
name?: string;
|
|
16
|
-
email?: string;
|
|
17
|
-
emails?: string[];
|
|
18
|
-
}
|
|
19
|
-
interface AxiomClientOptions {
|
|
20
|
-
token: string;
|
|
21
|
-
/** Override the API base URL (default `https://api.axiom.co`). */
|
|
22
|
-
baseUrl?: string;
|
|
23
|
-
/** Override `fetch` for tests. */
|
|
24
|
-
fetch?: typeof fetch;
|
|
25
|
-
}
|
|
26
|
-
interface AxiomRestClient {
|
|
27
|
-
getDataset(name: string): Promise<AxiomDataset>;
|
|
28
|
-
createDataset(input: {
|
|
29
|
-
name: string;
|
|
30
|
-
description?: string;
|
|
31
|
-
}): Promise<AxiomDataset>;
|
|
32
|
-
getCurrentUser(): Promise<AxiomUser>;
|
|
33
|
-
}
|
|
34
|
-
declare function createAxiomClient(opts: AxiomClientOptions): AxiomRestClient;
|
|
35
|
-
//#endregion
|
|
36
|
-
//#region src/capabilities/logs.d.ts
|
|
1
|
+
import { AuthError, Logs, LogsDataset, PluginToken, ResolveTokenInput, VerifyTokenFailure, VerifyTokenResult, VerifyTokenResult as VerifyTokenResult$1, VerifyTokenSuccess } from "@theholocron/cli";
|
|
2
|
+
import { AxiomClient, AxiomClientOptions, AxiomDataset, AxiomUser, CreateAxiomDatasetInput, createAxiomClient } from "@theholocron/axiom-client";
|
|
3
|
+
/** Resolves the Axiom token from `--token`, `HOLOCRON_AXIOM_TOKEN`, `AXIOM_TOKEN` or the keyring, and throws an `AuthError` when none is set. */
|
|
4
|
+
export declare const resolveToken: import("@theholocron/cli").TokenResolver;
|
|
5
|
+
/** Every token this plugin takes, for `holocron doctor tokens`. */
|
|
6
|
+
export declare const tokens: PluginToken[];
|
|
7
|
+
/** Options for the Axiom `logs` capability. */
|
|
37
8
|
interface AxiomLogsOptions {
|
|
38
9
|
/**
|
|
39
10
|
* Target dataset, resolved from `HOLOCRON_AXIOM_DATASET` /
|
|
@@ -42,16 +13,19 @@ interface AxiomLogsOptions {
|
|
|
42
13
|
*/
|
|
43
14
|
dataset?: string;
|
|
44
15
|
}
|
|
45
|
-
|
|
16
|
+
/** The `logs` capability for Axiom: checks a dataset is reachable and creates datasets that are missing. */
|
|
17
|
+
export declare class AxiomLogs implements Logs {
|
|
46
18
|
private readonly client;
|
|
47
19
|
private readonly opts;
|
|
20
|
+
/** The capability key, always `logs`. */
|
|
48
21
|
readonly key: "logs";
|
|
22
|
+
/** The provider name, `axiom`. */
|
|
49
23
|
readonly providerName = "axiom";
|
|
50
24
|
/**
|
|
51
25
|
* `client` is a thunk — the token is resolved on first call, so
|
|
52
26
|
* `describe()` (which needs no auth) works without one.
|
|
53
27
|
*/
|
|
54
|
-
constructor(client: () =>
|
|
28
|
+
constructor(client: () => AxiomClient, opts: AxiomLogsOptions);
|
|
55
29
|
describe(): Promise<{
|
|
56
30
|
provider: string;
|
|
57
31
|
envKeys: string[];
|
|
@@ -60,43 +34,35 @@ declare class AxiomLogs implements Logs {
|
|
|
60
34
|
ok: boolean;
|
|
61
35
|
dataset: string;
|
|
62
36
|
}>;
|
|
37
|
+
readDataset(name: string): Promise<LogsDataset>;
|
|
38
|
+
checkToken(): Promise<{
|
|
39
|
+
ok: boolean;
|
|
40
|
+
reason?: string;
|
|
41
|
+
}>;
|
|
63
42
|
ensureDataset(name: string): Promise<{
|
|
64
43
|
alreadyExists: boolean;
|
|
65
44
|
}>;
|
|
66
45
|
}
|
|
67
|
-
//#endregion
|
|
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
46
|
interface VerifyTokenOptions {
|
|
87
47
|
baseUrl?: string;
|
|
88
48
|
fetch?: typeof fetch;
|
|
89
49
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
50
|
+
/**
|
|
51
|
+
* Checks an Axiom token by fetching the current user; the success subject is `user @` followed by the email, name or id,
|
|
52
|
+
* the failure carries the error message. An API token cannot read the user (403), so then it asks for a dataset that
|
|
53
|
+
* does not exist: a 404 means the token is accepted and may read datasets, and the subject says `API token`.
|
|
54
|
+
*/
|
|
55
|
+
export declare function verifyToken(token: string, opts?: VerifyTokenOptions): Promise<VerifyTokenResult$1>;
|
|
56
|
+
/** Options for the Axiom plugin: token resolution, the target dataset and test overrides. */
|
|
57
|
+
export interface AxiomPluginOptions extends ResolveTokenInput, AxiomLogsOptions {
|
|
94
58
|
/** Override base URL for tests. */
|
|
95
59
|
baseUrl?: string;
|
|
96
60
|
/** Override `fetch` for tests. */
|
|
97
61
|
fetch?: typeof fetch;
|
|
98
62
|
}
|
|
99
|
-
|
|
63
|
+
/** What the plugin's capabilities share: the resolved options and a lazily built client. */
|
|
64
|
+
export interface PluginContext {
|
|
65
|
+
/** The options, with `dataset` resolved from config, `HOLOCRON_AXIOM_DATASET` or `AXIOM_DATASET` (in that order). */
|
|
100
66
|
options: AxiomPluginOptions & {
|
|
101
67
|
dataset?: string;
|
|
102
68
|
};
|
|
@@ -106,12 +72,18 @@ interface PluginContext {
|
|
|
106
72
|
* no auth (`describe`) works without a token, and the loader never
|
|
107
73
|
* aborts on a plugin whose token happens to be absent.
|
|
108
74
|
*/
|
|
109
|
-
client: () =>
|
|
75
|
+
client: () => AxiomClient;
|
|
110
76
|
}
|
|
111
|
-
|
|
112
|
-
declare function
|
|
113
|
-
|
|
77
|
+
/** Creates the shared context for the given options; no token is resolved until `client()` is first called. */
|
|
78
|
+
export declare function createContext(options: AxiomPluginOptions): PluginContext;
|
|
79
|
+
/** Builds the `logs` capability from a plugin context. */
|
|
80
|
+
export declare function logs(ctx: PluginContext): Logs;
|
|
81
|
+
/** Creates the Axiom plugin: a `connection` probe and the `logs` capability. */
|
|
82
|
+
export declare function createPlugin(options: AxiomPluginOptions): {
|
|
114
83
|
name: string;
|
|
84
|
+
probes: {
|
|
85
|
+
connection: import("@theholocron/cli").Probe;
|
|
86
|
+
};
|
|
115
87
|
capabilities: {
|
|
116
88
|
logs: () => Logs;
|
|
117
89
|
};
|
|
@@ -120,6 +92,5 @@ declare function createPlugin(options: AxiomPluginOptions): {
|
|
|
120
92
|
* One-line hint shown by `holocron auth set axiom` when no token is
|
|
121
93
|
* supplied or when the supplied token is rejected.
|
|
122
94
|
*/
|
|
123
|
-
declare const AUTH_HINT: string;
|
|
124
|
-
|
|
125
|
-
export { AUTH_HINT, AuthError, type AxiomClientOptions, type AxiomDataset, AxiomLogs, type AxiomLogsOptions, AxiomPluginOptions, type AxiomRestClient, type AxiomUser, PluginContext, type ResolveTokenInput, type VerifyTokenFailure, type VerifyTokenResult, type VerifyTokenSuccess, createAxiomClient, createContext, createPlugin, logs, resolveToken, verifyToken };
|
|
95
|
+
export declare const AUTH_HINT: string;
|
|
96
|
+
export { AuthError, type AxiomClient, type AxiomClientOptions, type AxiomDataset, type AxiomLogsOptions, type AxiomUser, type CreateAxiomDatasetInput, type ResolveTokenInput, type VerifyTokenFailure, type VerifyTokenResult, type VerifyTokenSuccess, createAxiomClient };
|
package/dist/index.mjs
CHANGED
|
@@ -1,17 +1,27 @@
|
|
|
1
|
-
import { AuthError, ProviderApiError,
|
|
2
|
-
|
|
1
|
+
import { AuthError, ProviderApiError, connectionProbe, createResolveToken } from "@theholocron/cli";
|
|
2
|
+
import { createEnvLookup, firstEnv } from "@theholocron/env-utils/lookup";
|
|
3
|
+
import { createAxiomClient } from "@theholocron/axiom-client";
|
|
4
|
+
import { errorMessage } from "@theholocron/misc-utils";
|
|
5
|
+
// src/auth.ts
|
|
6
|
+
/** Resolves the Axiom token from `--token`, `HOLOCRON_AXIOM_TOKEN`, `AXIOM_TOKEN` or the keyring, and throws an `AuthError` when none is set. */
|
|
3
7
|
const resolveToken = createResolveToken({
|
|
4
8
|
envName: "HOLOCRON_AXIOM_TOKEN",
|
|
5
9
|
vendorEnvName: "AXIOM_TOKEN",
|
|
6
10
|
keyringService: "axiom",
|
|
7
11
|
errorMessage: "no Axiom token found. Pass --token <TOKEN>, set HOLOCRON_AXIOM_TOKEN / AXIOM_TOKEN, or run: holocron auth set axiom <TOKEN>"
|
|
8
12
|
});
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
/** Every token this plugin takes, for `holocron doctor tokens`. */
|
|
14
|
+
const tokens = [resolveToken.token];
|
|
15
|
+
// src/capabilities/logs.ts
|
|
16
|
+
/** A dataset that does not exist: asking for it tells a token Axiom accepts (404) from one it refuses (401). */
|
|
17
|
+
const PROBE_DATASET$1 = "holocron-token-check";
|
|
18
|
+
/** The `logs` capability for Axiom: checks a dataset is reachable and creates datasets that are missing. */
|
|
11
19
|
var AxiomLogs = class {
|
|
12
20
|
client;
|
|
13
21
|
opts;
|
|
22
|
+
/** The capability key, always `logs`. */
|
|
14
23
|
key = "logs";
|
|
24
|
+
/** The provider name, `axiom`. */
|
|
15
25
|
providerName = "axiom";
|
|
16
26
|
/**
|
|
17
27
|
* `client` is a thunk — the token is resolved on first call, so
|
|
@@ -30,44 +40,55 @@ var AxiomLogs = class {
|
|
|
30
40
|
async whoami() {
|
|
31
41
|
const dataset = this.opts.dataset;
|
|
32
42
|
if (!dataset) throw new Error("@theholocron/holocron-plugin-axiom needs a dataset (HOLOCRON_AXIOM_DATASET / AXIOM_DATASET) for whoami");
|
|
33
|
-
await this.client().
|
|
43
|
+
await this.client().datasets.get(dataset);
|
|
34
44
|
return {
|
|
35
45
|
ok: true,
|
|
36
46
|
dataset
|
|
37
47
|
};
|
|
38
48
|
}
|
|
49
|
+
async readDataset(name) {
|
|
50
|
+
try {
|
|
51
|
+
const found = await this.client().datasets.get(name);
|
|
52
|
+
const days = found.useRetentionPeriod === false ? void 0 : found.retentionDays;
|
|
53
|
+
return {
|
|
54
|
+
exists: true,
|
|
55
|
+
...days === void 0 ? {} : { retentionDays: days }
|
|
56
|
+
};
|
|
57
|
+
} catch (err) {
|
|
58
|
+
if (err instanceof ProviderApiError && err.status === 404) return { exists: false };
|
|
59
|
+
throw err;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
async checkToken() {
|
|
63
|
+
try {
|
|
64
|
+
await this.client().datasets.get(PROBE_DATASET$1);
|
|
65
|
+
return { ok: true };
|
|
66
|
+
} catch (err) {
|
|
67
|
+
if (err instanceof ProviderApiError) {
|
|
68
|
+
if (err.status === 404) return { ok: true };
|
|
69
|
+
if (err.status === 401) return {
|
|
70
|
+
ok: false,
|
|
71
|
+
reason: "Axiom refused the token (401)"
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
throw err;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
39
77
|
async ensureDataset(name) {
|
|
40
78
|
try {
|
|
41
|
-
await this.client().
|
|
79
|
+
await this.client().datasets.get(name);
|
|
42
80
|
return { alreadyExists: true };
|
|
43
81
|
} catch (err) {
|
|
44
82
|
if (!(err instanceof ProviderApiError) || err.status !== 404) throw err;
|
|
45
83
|
}
|
|
46
|
-
await this.client().
|
|
84
|
+
await this.client().datasets.create({
|
|
47
85
|
name,
|
|
48
86
|
description: "Managed by holocron"
|
|
49
87
|
});
|
|
50
88
|
return { alreadyExists: false };
|
|
51
89
|
}
|
|
52
90
|
};
|
|
53
|
-
|
|
54
|
-
const rest = createRestClient({
|
|
55
|
-
baseUrl: opts.baseUrl ?? "https://api.axiom.co",
|
|
56
|
-
token: opts.token,
|
|
57
|
-
vendor: "Axiom",
|
|
58
|
-
fetch: opts.fetch
|
|
59
|
-
});
|
|
60
|
-
return {
|
|
61
|
-
getDataset: (name) => rest.request(`/v2/datasets/${encodeURIComponent(name)}`),
|
|
62
|
-
createDataset: (input) => rest.request("/v2/datasets", {
|
|
63
|
-
method: "POST",
|
|
64
|
-
body: input
|
|
65
|
-
}),
|
|
66
|
-
getCurrentUser: () => rest.request("/v2/user")
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
//#endregion
|
|
70
|
-
//#region src/verify-token.ts
|
|
91
|
+
// src/verify-token.ts
|
|
71
92
|
/**
|
|
72
93
|
* `verifyToken` — plugin-level export used by `holocron auth set axiom`
|
|
73
94
|
* + `holocron auth check`. Hits `GET /v2/user` and translates the
|
|
@@ -76,6 +97,13 @@ function createAxiomClient(opts) {
|
|
|
76
97
|
* Kept as a standalone function (not a capability method) so the auth
|
|
77
98
|
* command can call it without initializing the full plugin.
|
|
78
99
|
*/
|
|
100
|
+
/** A dataset that does not exist: asking for it tells a token that may read datasets (404) from one that may not (403). */
|
|
101
|
+
const PROBE_DATASET = "holocron-token-check";
|
|
102
|
+
/**
|
|
103
|
+
* Checks an Axiom token by fetching the current user; the success subject is `user @` followed by the email, name or id,
|
|
104
|
+
* the failure carries the error message. An API token cannot read the user (403), so then it asks for a dataset that
|
|
105
|
+
* does not exist: a 404 means the token is accepted and may read datasets, and the subject says `API token`.
|
|
106
|
+
*/
|
|
79
107
|
async function verifyToken(token, opts = {}) {
|
|
80
108
|
const client = createAxiomClient({
|
|
81
109
|
token,
|
|
@@ -83,23 +111,42 @@ async function verifyToken(token, opts = {}) {
|
|
|
83
111
|
fetch: opts.fetch
|
|
84
112
|
});
|
|
85
113
|
try {
|
|
86
|
-
const me = await client.
|
|
114
|
+
const me = await client.user.me();
|
|
87
115
|
return {
|
|
88
116
|
ok: true,
|
|
89
117
|
subject: `user @ ${me.email ?? me.emails?.[0] ?? me.name ?? me.id ?? "unknown"}`
|
|
90
118
|
};
|
|
91
119
|
} catch (err) {
|
|
120
|
+
if (err instanceof ProviderApiError && err.status === 403) return verifyApiToken(client);
|
|
121
|
+
return {
|
|
122
|
+
ok: false,
|
|
123
|
+
message: errorMessage(err)
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
async function verifyApiToken(client) {
|
|
128
|
+
try {
|
|
129
|
+
await client.datasets.get(PROBE_DATASET);
|
|
130
|
+
return {
|
|
131
|
+
ok: true,
|
|
132
|
+
subject: "API token"
|
|
133
|
+
};
|
|
134
|
+
} catch (err) {
|
|
135
|
+
if (err instanceof ProviderApiError && err.status === 404) return {
|
|
136
|
+
ok: true,
|
|
137
|
+
subject: "API token"
|
|
138
|
+
};
|
|
92
139
|
return {
|
|
93
140
|
ok: false,
|
|
94
|
-
message:
|
|
141
|
+
message: errorMessage(err)
|
|
95
142
|
};
|
|
96
143
|
}
|
|
97
144
|
}
|
|
98
|
-
|
|
99
|
-
|
|
145
|
+
// src/index.ts
|
|
146
|
+
/** Creates the shared context for the given options; no token is resolved until `client()` is first called. */
|
|
100
147
|
function createContext(options) {
|
|
101
|
-
const env = options.env
|
|
102
|
-
const dataset = options.dataset ?? env
|
|
148
|
+
const env = createEnvLookup(options.env);
|
|
149
|
+
const dataset = options.dataset ?? firstEnv(env, ["HOLOCRON_AXIOM_DATASET", "AXIOM_DATASET"]);
|
|
103
150
|
let client;
|
|
104
151
|
return {
|
|
105
152
|
options: {
|
|
@@ -113,13 +160,25 @@ function createContext(options) {
|
|
|
113
160
|
})
|
|
114
161
|
};
|
|
115
162
|
}
|
|
163
|
+
/** Builds the `logs` capability from a plugin context. */
|
|
116
164
|
function logs(ctx) {
|
|
117
165
|
return new AxiomLogs(ctx.client, { dataset: ctx.options.dataset });
|
|
118
166
|
}
|
|
167
|
+
/** Creates the Axiom plugin: a `connection` probe and the `logs` capability. */
|
|
119
168
|
function createPlugin(options) {
|
|
120
169
|
const ctx = createContext(options);
|
|
121
170
|
return {
|
|
122
171
|
name: "@theholocron/holocron-plugin-axiom",
|
|
172
|
+
probes: { connection: connectionProbe({
|
|
173
|
+
provider: "Axiom",
|
|
174
|
+
url: options.baseUrl ?? "https://api.axiom.co",
|
|
175
|
+
fetch: options.fetch,
|
|
176
|
+
token: () => resolveToken(options),
|
|
177
|
+
verify: (token) => verifyToken(token, {
|
|
178
|
+
baseUrl: options.baseUrl,
|
|
179
|
+
fetch: options.fetch
|
|
180
|
+
})
|
|
181
|
+
}) },
|
|
123
182
|
capabilities: { logs: () => logs(ctx) }
|
|
124
183
|
};
|
|
125
184
|
}
|
|
@@ -128,5 +187,4 @@ function createPlugin(options) {
|
|
|
128
187
|
* supplied or when the supplied token is rejected.
|
|
129
188
|
*/
|
|
130
189
|
const AUTH_HINT = "generate an Axiom API token at https://app.axiom.co/settings/api-tokens with dataset read + create permissions, then run: holocron auth set axiom <TOKEN>";
|
|
131
|
-
|
|
132
|
-
export { AUTH_HINT, AuthError, AxiomLogs, createAxiomClient, createContext, createPlugin, logs, resolveToken, verifyToken };
|
|
190
|
+
export { AUTH_HINT, AuthError, AxiomLogs, createAxiomClient, createContext, createPlugin, logs, resolveToken, tokens, verifyToken };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/holocron-plugin-axiom",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.420",
|
|
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",
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
"logs",
|
|
9
9
|
"plugin"
|
|
10
10
|
],
|
|
11
|
-
"homepage": "https://
|
|
11
|
+
"homepage": "https://docs.theholocron.dev/holocron/plugins/axiom/",
|
|
12
12
|
"bugs": "https://github.com/theholocron/holocron/issues",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
15
|
"url": "git+https://github.com/theholocron/holocron.git",
|
|
16
|
-
"directory": "
|
|
16
|
+
"directory": "plugins/holocron-plugin-axiom"
|
|
17
17
|
},
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"author": "Newton Koumantzelis",
|
|
@@ -29,26 +29,33 @@
|
|
|
29
29
|
"files": [
|
|
30
30
|
"dist"
|
|
31
31
|
],
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@theholocron/env-utils": "^1.17.0-alpha.4"
|
|
34
|
+
},
|
|
32
35
|
"devDependencies": {
|
|
33
|
-
"@theholocron/eslint-config": "^8.0.0",
|
|
34
|
-
"@theholocron/http-client": "^1.24.0",
|
|
35
|
-
"@theholocron/tsconfig": "^8.0.0",
|
|
36
|
-
"@theholocron/tsdown-config": "^8.0.0",
|
|
37
|
-
"@theholocron/vitest-config": "^8.0.0",
|
|
38
36
|
"@types/node": "^26",
|
|
39
|
-
"@vitest/coverage-v8": "^
|
|
40
|
-
"@vitest/eslint-plugin": "^1.6.
|
|
41
|
-
"eslint": "^10.
|
|
42
|
-
"eslint-plugin-n": "^18.
|
|
43
|
-
"globals": "^17.
|
|
44
|
-
"tsdown": "^0.
|
|
45
|
-
"tsx": "4.23.
|
|
37
|
+
"@vitest/coverage-v8": "^5.1.0",
|
|
38
|
+
"@vitest/eslint-plugin": "^1.6.28",
|
|
39
|
+
"eslint": "^10.14.0",
|
|
40
|
+
"eslint-plugin-n": "^18.5.0",
|
|
41
|
+
"globals": "^17.14.0",
|
|
42
|
+
"tsdown": "^0.23.5",
|
|
43
|
+
"tsx": "4.23.15",
|
|
46
44
|
"typescript": "^5.9.3",
|
|
47
|
-
"vitest": "^
|
|
48
|
-
"@theholocron/
|
|
45
|
+
"vitest": "^5.1.0",
|
|
46
|
+
"@theholocron/axiom-client": "^1.58.0-alpha.28",
|
|
47
|
+
"@theholocron/cli": "5.0.0-alpha.420",
|
|
48
|
+
"@theholocron/misc-utils": "^1.17.0-alpha.4",
|
|
49
|
+
"@theholocron/http-client": "^1.58.0-alpha.28",
|
|
50
|
+
"@theholocron/tsconfig": "^8.9.0-alpha.16",
|
|
51
|
+
"@theholocron/tsdown-config": "^8.9.0-alpha.16",
|
|
52
|
+
"@theholocron/vitest-config": "^8.9.0-alpha.16",
|
|
53
|
+
"@theholocron/eslint-config": "^8.9.0-alpha.16"
|
|
49
54
|
},
|
|
50
55
|
"peerDependencies": {
|
|
51
|
-
"@theholocron/
|
|
56
|
+
"@theholocron/axiom-client": "^1.43.1",
|
|
57
|
+
"@theholocron/misc-utils": "^1.16.0",
|
|
58
|
+
"@theholocron/cli": "5.0.0-alpha.420"
|
|
52
59
|
},
|
|
53
60
|
"engines": {
|
|
54
61
|
"node": ">=22"
|
|
@@ -57,11 +64,11 @@
|
|
|
57
64
|
"access": "public"
|
|
58
65
|
},
|
|
59
66
|
"scripts": {
|
|
60
|
-
"
|
|
61
|
-
"
|
|
67
|
+
"build": "tsdown",
|
|
68
|
+
"lint:code": "eslint .",
|
|
69
|
+
"test:unit": "vitest run --coverage",
|
|
62
70
|
"test:watch": "vitest",
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"verification.unitTests": "holocron run verification.unitTests --"
|
|
71
|
+
"typecheck": "tsc --noEmit",
|
|
72
|
+
"validate:plugin": "tsx scripts/validate.mjs"
|
|
66
73
|
}
|
|
67
74
|
}
|