@theholocron/axiom-client 1.58.0-alpha.31 → 1.58.0-alpha.33

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
@@ -36,6 +36,15 @@ interface CreateAxiomDatasetInput {
36
36
  /** A description for the new dataset. */
37
37
  description?: string;
38
38
  }
39
+ /** What a query of a dataset is sent with. */
40
+ interface AxiomQueryInput {
41
+ /** The APL query. */
42
+ apl: string;
43
+ /** The start of the time range, an RFC 3339 time. */
44
+ startTime?: string;
45
+ /** The end of the time range, an RFC 3339 time. */
46
+ endTime?: string;
47
+ }
39
48
  /** The user the Axiom token belongs to. */
40
49
  interface AxiomUser {
41
50
  /** The user id. */
@@ -51,6 +60,9 @@ interface AxiomUser {
51
60
  export declare function createAxiomClient(opts: AxiomClientOptions): {
52
61
  datasets: {
53
62
  get: (name: string) => Promise<AxiomDataset>;
63
+ list: () => Promise<AxiomDataset[]>;
64
+ ingest: (name: string, events: readonly Record<string, unknown>[]) => Promise<unknown>;
65
+ query: (input: AxiomQueryInput) => Promise<unknown>;
54
66
  create: (input: CreateAxiomDatasetInput) => Promise<AxiomDataset>;
55
67
  };
56
68
  user: {
@@ -59,4 +71,4 @@ export declare function createAxiomClient(opts: AxiomClientOptions): {
59
71
  };
60
72
  /** The client `createAxiomClient` returns. */
61
73
  export type AxiomClient = ReturnType<typeof createAxiomClient>;
62
- export type { AxiomClientOptions, AxiomDataset, AxiomUser, CreateAxiomDatasetInput };
74
+ export type { AxiomClientOptions, AxiomDataset, AxiomQueryInput, AxiomUser, CreateAxiomDatasetInput };
package/dist/index.mjs CHANGED
@@ -5,6 +5,22 @@ function datasets(rest) {
5
5
  return {
6
6
  /** Get one dataset by name (`GET /v2/datasets/{name}`); the name is URL-encoded. */
7
7
  get: (name) => rest.request(`${PATH}/${encodeURIComponent(name)}`),
8
+ /** List the datasets the token can see (`GET /v2/datasets`). */
9
+ list: () => rest.request(PATH),
10
+ /**
11
+ * Send events to a dataset (`POST /v1/datasets/{name}/ingest`). An empty list ingests nothing, which is how a token's
12
+ * right to ingest is tried without writing an event.
13
+ */
14
+ ingest: (name, events) => rest.request(`/v1/datasets/${encodeURIComponent(name)}/ingest`, {
15
+ method: "POST",
16
+ body: events
17
+ }),
18
+ /** Run an APL query (`POST /v1/datasets/_apl?format=tabular`); the dataset is named in the query. */
19
+ query: (input) => rest.request("/v1/datasets/_apl", {
20
+ method: "POST",
21
+ body: input,
22
+ query: { format: "tabular" }
23
+ }),
8
24
  /** Create a dataset (`POST /v2/datasets`). */
9
25
  create: (input) => rest.request(PATH, {
10
26
  method: "POST",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/axiom-client",
3
- "version": "1.58.0-alpha.31",
3
+ "version": "1.58.0-alpha.33",
4
4
  "description": "A TypeScript client for the Axiom API",
5
5
  "keywords": [
6
6
  "axiom",
@@ -32,7 +32,7 @@
32
32
  "dist"
33
33
  ],
34
34
  "dependencies": {
35
- "@theholocron/http-client": "^1.58.0-alpha.31",
35
+ "@theholocron/http-client": "^1.58.0-alpha.33",
36
36
  "@theholocron/observability": "^0.7.0-alpha.4"
37
37
  },
38
38
  "devDependencies": {
@@ -46,9 +46,9 @@
46
46
  "typescript": "^5.9.3",
47
47
  "vitest": "^5.1.0",
48
48
  "@theholocron/eslint-config": "^8.9.0-alpha.17",
49
- "@theholocron/tsconfig": "^8.9.0-alpha.17",
50
49
  "@theholocron/tsdown-config": "^8.9.0-alpha.17",
51
- "@theholocron/vitest-config": "^8.9.0-alpha.17"
50
+ "@theholocron/vitest-config": "^8.9.0-alpha.17",
51
+ "@theholocron/tsconfig": "^8.9.0-alpha.17"
52
52
  },
53
53
  "engines": {
54
54
  "node": ">=22.0.0"