AxiomLogs
Defined in: plugins/holocron-plugin-axiom/src/capabilities/logs.ts:34
The logs capability for Axiom: checks a dataset is reachable and creates datasets that are missing.
Implements
Section titled “Implements”Logs
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AxiomLogs(
client,opts):AxiomLogs
Defined in: plugins/holocron-plugin-axiom/src/capabilities/logs.ts:44
client is a thunk — the token is resolved on first call, so
describe() (which needs no auth) works without one.
Parameters
Section titled “Parameters”client
Section titled “client”() => object
Returns
Section titled “Returns”AxiomLogs
Properties
Section titled “Properties”
readonlykey:"logs"
Defined in: plugins/holocron-plugin-axiom/src/capabilities/logs.ts:36
The capability key, always logs.
Implementation of
Section titled “Implementation of”Logs.key
providerName
Section titled “providerName”
readonlyproviderName:"axiom"="axiom"
Defined in: plugins/holocron-plugin-axiom/src/capabilities/logs.ts:38
The provider name, axiom.
Implementation of
Section titled “Implementation of”Logs.providerName
Methods
Section titled “Methods”checkToken()
Section titled “checkToken()”checkToken(
dataset?):Promise<{ok:boolean;reason?:string; }>
Defined in: plugins/holocron-plugin-axiom/src/capabilities/logs.ts:84
Ask the provider whether it accepts the token. dataset names one the token is expected to hold (the caller’s
own), which a provider may probe in place of a name it makes up: a token that cannot see a dataset that does not
exist may still reach its own. ok: false only when the provider refused it; an error that says nothing about the
token (a network failure, a missing token, an answer that could mean either) throws.
Parameters
Section titled “Parameters”dataset?
Section titled “dataset?”string
Returns
Section titled “Returns”Promise<{ ok: boolean; reason?: string; }>
Implementation of
Section titled “Implementation of”Logs.checkToken
describe()
Section titled “describe()”describe():
Promise<{envKeys:string[];provider:string; }>
Defined in: plugins/holocron-plugin-axiom/src/capabilities/logs.ts:49
Returns the env var names the app reads at runtime for this provider.
Returns
Section titled “Returns”Promise<{ envKeys: string[]; provider: string; }>
Implementation of
Section titled “Implementation of”Logs.describe
ensureDataset()
Section titled “ensureDataset()”ensureDataset(
name):Promise<{alreadyExists:boolean; }>
Defined in: plugins/holocron-plugin-axiom/src/capabilities/logs.ts:99
Create the aggregation dataset if it does not already exist. Idempotent.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<{ alreadyExists: boolean; }>
Implementation of
Section titled “Implementation of”Logs.ensureDataset
readDataset()
Section titled “readDataset()”readDataset(
name):Promise<LogsDataset>
Defined in: plugins/holocron-plugin-axiom/src/capabilities/logs.ts:68
Read a dataset without changing anything (holocron doctor logs). A dataset that is not there is exists: false,
not an error, and one the token may not see is forbidden: true; any other failure throws.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<LogsDataset>
Implementation of
Section titled “Implementation of”Logs.readDataset
whoami()
Section titled “whoami()”whoami():
Promise<{dataset:string;ok:boolean; }>
Defined in: plugins/holocron-plugin-axiom/src/capabilities/logs.ts:56
Verify the token by fetching the target dataset’s info.
Returns
Section titled “Returns”Promise<{ dataset: string; ok: boolean; }>
Implementation of
Section titled “Implementation of”Logs.whoami