@theholocron/axiom-client 1.58.0-alpha.2 → 1.58.0-alpha.4
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 +15 -0
- package/dist/index.mjs +3 -0
- package/package.json +7 -7
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "@theholocron/http-client";
|
|
2
2
|
import { ErrorSink, Logger } from "@theholocron/observability/core";
|
|
3
|
+
/** Options for `createAxiomClient`. */
|
|
3
4
|
interface AxiomClientOptions {
|
|
4
5
|
/** Axiom API token. */
|
|
5
6
|
token: string;
|
|
@@ -12,21 +13,34 @@ interface AxiomClientOptions {
|
|
|
12
13
|
/** Reports transport failures and unexpected 5xx. Defaults to a no-op. */
|
|
13
14
|
errors?: ErrorSink;
|
|
14
15
|
}
|
|
16
|
+
/** An Axiom dataset. */
|
|
15
17
|
interface AxiomDataset {
|
|
18
|
+
/** The dataset id. */
|
|
16
19
|
id: string;
|
|
20
|
+
/** The dataset name. */
|
|
17
21
|
name: string;
|
|
22
|
+
/** The dataset description, if it has one. */
|
|
18
23
|
description?: string;
|
|
19
24
|
}
|
|
25
|
+
/** What to create a dataset with. */
|
|
20
26
|
interface CreateAxiomDatasetInput {
|
|
27
|
+
/** The name of the new dataset. */
|
|
21
28
|
name: string;
|
|
29
|
+
/** A description for the new dataset. */
|
|
22
30
|
description?: string;
|
|
23
31
|
}
|
|
32
|
+
/** The user the Axiom token belongs to. */
|
|
24
33
|
interface AxiomUser {
|
|
34
|
+
/** The user id. */
|
|
25
35
|
id: string;
|
|
36
|
+
/** The user's name. */
|
|
26
37
|
name?: string;
|
|
38
|
+
/** The user's primary email address. */
|
|
27
39
|
email?: string;
|
|
40
|
+
/** All of the user's email addresses. */
|
|
28
41
|
emails?: string[];
|
|
29
42
|
}
|
|
43
|
+
/** Creates an Axiom API client with `datasets` and `user` groups, both sharing one REST client. */
|
|
30
44
|
export declare function createAxiomClient(opts: AxiomClientOptions): {
|
|
31
45
|
datasets: {
|
|
32
46
|
get: (name: string) => Promise<AxiomDataset>;
|
|
@@ -36,5 +50,6 @@ export declare function createAxiomClient(opts: AxiomClientOptions): {
|
|
|
36
50
|
me: () => Promise<AxiomUser>;
|
|
37
51
|
};
|
|
38
52
|
};
|
|
53
|
+
/** The client `createAxiomClient` returns. */
|
|
39
54
|
export type AxiomClient = ReturnType<typeof createAxiomClient>;
|
|
40
55
|
export type { AxiomClientOptions, AxiomDataset, AxiomUser, CreateAxiomDatasetInput };
|
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,9 @@ import { createRestClient } from "@theholocron/http-client";
|
|
|
3
3
|
const PATH = "/v2/datasets";
|
|
4
4
|
function datasets(rest) {
|
|
5
5
|
return {
|
|
6
|
+
/** Get one dataset by name (`GET /v2/datasets/{name}`); the name is URL-encoded. */
|
|
6
7
|
get: (name) => rest.request(`${PATH}/${encodeURIComponent(name)}`),
|
|
8
|
+
/** Create a dataset (`POST /v2/datasets`). */
|
|
7
9
|
create: (input) => rest.request(PATH, {
|
|
8
10
|
method: "POST",
|
|
9
11
|
body: input
|
|
@@ -28,6 +30,7 @@ function createAxiomRestClient(opts) {
|
|
|
28
30
|
});
|
|
29
31
|
}
|
|
30
32
|
// src/index.ts
|
|
33
|
+
/** Creates an Axiom API client with `datasets` and `user` groups, both sharing one REST client. */
|
|
31
34
|
function createAxiomClient(opts) {
|
|
32
35
|
const rest = createAxiomRestClient(opts);
|
|
33
36
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/axiom-client",
|
|
3
|
-
"version": "1.58.0-alpha.
|
|
3
|
+
"version": "1.58.0-alpha.4",
|
|
4
4
|
"description": "A TypeScript client for the Axiom API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"axiom",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"dist"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@theholocron/
|
|
36
|
-
"@theholocron/
|
|
35
|
+
"@theholocron/http-client": "^1.58.0-alpha.4",
|
|
36
|
+
"@theholocron/observability": "^0.6.1-alpha.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^26",
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"tsdown": "^0.23.3",
|
|
46
46
|
"typescript": "^5.9.3",
|
|
47
47
|
"vitest": "^5.0.5",
|
|
48
|
-
"@theholocron/eslint-config": "^8.9.0-alpha.
|
|
49
|
-
"@theholocron/
|
|
50
|
-
"@theholocron/
|
|
51
|
-
"@theholocron/
|
|
48
|
+
"@theholocron/eslint-config": "^8.9.0-alpha.5",
|
|
49
|
+
"@theholocron/tsconfig": "^8.9.0-alpha.5",
|
|
50
|
+
"@theholocron/vitest-config": "^8.9.0-alpha.5",
|
|
51
|
+
"@theholocron/tsdown-config": "^8.9.0-alpha.5"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
|
54
54
|
"node": ">=22.0.0"
|