@distilled.cloud/axiom 0.23.1 → 0.24.0
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/lib/credentials.d.ts +3 -3
- package/lib/credentials.d.ts.map +1 -1
- package/lib/credentials.js +3 -3
- package/lib/credentials.js.map +1 -1
- package/package.json +2 -2
- package/src/credentials.ts +7 -6
package/lib/credentials.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Context from "effect/Context";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
2
3
|
import * as Layer from "effect/Layer";
|
|
3
4
|
import * as Redacted from "effect/Redacted";
|
|
4
|
-
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
5
5
|
/** Default base URL for Axiom Cloud. Self-hosted users can override via AXIOM_URL. */
|
|
6
6
|
export declare const DEFAULT_API_BASE_URL = "https://api.axiom.co";
|
|
7
7
|
export interface Config {
|
|
@@ -14,7 +14,7 @@ export interface Config {
|
|
|
14
14
|
*/
|
|
15
15
|
readonly orgId?: string;
|
|
16
16
|
}
|
|
17
|
-
declare const Credentials_base: Context.ServiceClass<Credentials, "AxiomCredentials", Config
|
|
17
|
+
declare const Credentials_base: Context.ServiceClass<Credentials, "AxiomCredentials", Effect.Effect<Config, never, never>>;
|
|
18
18
|
export declare class Credentials extends Credentials_base {
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
@@ -25,6 +25,6 @@ export declare class Credentials extends Credentials_base {
|
|
|
25
25
|
* regional edge deployments). Defaults to `https://api.axiom.co`.
|
|
26
26
|
* - `AXIOM_ORG_ID` (optional) — organization ID, required for PATs.
|
|
27
27
|
*/
|
|
28
|
-
export declare const CredentialsFromEnv: Layer.Layer<Credentials,
|
|
28
|
+
export declare const CredentialsFromEnv: Layer.Layer<Credentials, never, never>;
|
|
29
29
|
export {};
|
|
30
30
|
//# sourceMappingURL=credentials.d.ts.map
|
package/lib/credentials.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C,sFAAsF;AACtF,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAE3D,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;;AAED,qBAAa,WAAY,SAAQ,gBAGV;CAAG;AAW1B;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,wCA6B9B,CAAC"}
|
package/lib/credentials.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
1
2
|
import * as EffectConfig from "effect/Config";
|
|
2
3
|
import * as Context from "effect/Context";
|
|
3
4
|
import * as Effect from "effect/Effect";
|
|
4
5
|
import * as Layer from "effect/Layer";
|
|
5
6
|
import * as Option from "effect/Option";
|
|
6
7
|
import * as Redacted from "effect/Redacted";
|
|
7
|
-
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
8
8
|
/** Default base URL for Axiom Cloud. Self-hosted users can override via AXIOM_URL. */
|
|
9
9
|
export const DEFAULT_API_BASE_URL = "https://api.axiom.co";
|
|
10
10
|
export class Credentials extends Context.Service()("AxiomCredentials") {
|
|
@@ -23,7 +23,7 @@ const envConfig = EffectConfig.all({
|
|
|
23
23
|
* regional edge deployments). Defaults to `https://api.axiom.co`.
|
|
24
24
|
* - `AXIOM_ORG_ID` (optional) — organization ID, required for PATs.
|
|
25
25
|
*/
|
|
26
|
-
export const CredentialsFromEnv = Layer.
|
|
26
|
+
export const CredentialsFromEnv = Layer.succeed(Credentials, Effect.gen(function* () {
|
|
27
27
|
const config = yield* envConfig.pipe(Effect.mapError(() => new ConfigError({
|
|
28
28
|
message: "AXIOM_TOKEN (or AXIOM_API_KEY) environment variable is required",
|
|
29
29
|
})));
|
|
@@ -39,5 +39,5 @@ export const CredentialsFromEnv = Layer.effect(Credentials, Effect.gen(function*
|
|
|
39
39
|
apiBaseUrl: config.apiBaseUrl,
|
|
40
40
|
orgId: Option.getOrUndefined(config.orgId),
|
|
41
41
|
};
|
|
42
|
-
}));
|
|
42
|
+
}).pipe(Effect.orDie));
|
|
43
43
|
//# sourceMappingURL=credentials.js.map
|
package/lib/credentials.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,YAAY,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,KAAK,YAAY,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cA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EAAiE;SACpE,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;QAC7B,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,KAAK,EAAE,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC;KAC3C,CAAC;AACJ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CACtB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@distilled.cloud/axiom",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/alchemy-run/distilled",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"specs:update": "git -C specs/docs fetch && git -C specs/docs checkout main && git -C specs/docs pull"
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
|
-
"@distilled.cloud/core": "0.
|
|
81
|
+
"@distilled.cloud/core": "0.24.0"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@types/bun": "^1.3.0",
|
package/src/credentials.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
1
2
|
import * as EffectConfig from "effect/Config";
|
|
2
3
|
import * as Context from "effect/Context";
|
|
3
4
|
import * as Effect from "effect/Effect";
|
|
4
5
|
import * as Layer from "effect/Layer";
|
|
5
6
|
import * as Option from "effect/Option";
|
|
6
7
|
import * as Redacted from "effect/Redacted";
|
|
7
|
-
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
8
8
|
|
|
9
9
|
/** Default base URL for Axiom Cloud. Self-hosted users can override via AXIOM_URL. */
|
|
10
10
|
export const DEFAULT_API_BASE_URL = "https://api.axiom.co";
|
|
@@ -20,9 +20,10 @@ export interface Config {
|
|
|
20
20
|
readonly orgId?: string;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export class Credentials extends Context.Service<
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
export class Credentials extends Context.Service<
|
|
24
|
+
Credentials,
|
|
25
|
+
Effect.Effect<Config>
|
|
26
|
+
>()("AxiomCredentials") {}
|
|
26
27
|
|
|
27
28
|
const envConfig = EffectConfig.all({
|
|
28
29
|
apiToken: EffectConfig.option(EffectConfig.string("AXIOM_TOKEN")),
|
|
@@ -41,7 +42,7 @@ const envConfig = EffectConfig.all({
|
|
|
41
42
|
* regional edge deployments). Defaults to `https://api.axiom.co`.
|
|
42
43
|
* - `AXIOM_ORG_ID` (optional) — organization ID, required for PATs.
|
|
43
44
|
*/
|
|
44
|
-
export const CredentialsFromEnv = Layer.
|
|
45
|
+
export const CredentialsFromEnv = Layer.succeed(
|
|
45
46
|
Credentials,
|
|
46
47
|
Effect.gen(function* () {
|
|
47
48
|
const config = yield* envConfig.pipe(
|
|
@@ -69,5 +70,5 @@ export const CredentialsFromEnv = Layer.effect(
|
|
|
69
70
|
apiBaseUrl: config.apiBaseUrl,
|
|
70
71
|
orgId: Option.getOrUndefined(config.orgId),
|
|
71
72
|
};
|
|
72
|
-
}),
|
|
73
|
+
}).pipe(Effect.orDie),
|
|
73
74
|
);
|