@distilled.cloud/kubernetes 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 +2 -2
- package/lib/credentials.js.map +1 -1
- package/package.json +2 -2
- package/src/credentials.ts +6 -4
package/lib/credentials.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
2
1
|
import * as Context from "effect/Context";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
3
|
import * as Layer from "effect/Layer";
|
|
4
4
|
import * as Redacted from "effect/Redacted";
|
|
5
5
|
export interface Config {
|
|
@@ -19,7 +19,7 @@ export interface Config {
|
|
|
19
19
|
*/
|
|
20
20
|
readonly apiBaseUrl: string;
|
|
21
21
|
}
|
|
22
|
-
declare const Credentials_base: Context.ServiceClass<Credentials, "KubernetesCredentials", Config
|
|
22
|
+
declare const Credentials_base: Context.ServiceClass<Credentials, "KubernetesCredentials", Effect.Effect<Config, never, never>>;
|
|
23
23
|
export declare class Credentials extends Credentials_base {
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
@@ -30,6 +30,6 @@ export declare class Credentials extends Credentials_base {
|
|
|
30
30
|
* | `KUBERNETES_TOKEN` | yes | Bearer token for authentication |
|
|
31
31
|
* | `KUBERNETES_API_URL` | yes | API server URL (e.g. from `kubectl cluster-info`) |
|
|
32
32
|
*/
|
|
33
|
-
export declare const CredentialsFromEnv: Layer.Layer<Credentials,
|
|
33
|
+
export declare const CredentialsFromEnv: Layer.Layer<Credentials, never, never>;
|
|
34
34
|
export {};
|
|
35
35
|
//# 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;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C,MAAM,WAAW,MAAM;IACrB;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAE1C;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;;AAED,qBAAa,WAAY,SAAQ,gBAGL;CAAG;AAO/B;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,wCAmB9B,CAAC"}
|
package/lib/credentials.js
CHANGED
|
@@ -18,7 +18,7 @@ const envConfig = EffectConfig.all({
|
|
|
18
18
|
* | `KUBERNETES_TOKEN` | yes | Bearer token for authentication |
|
|
19
19
|
* | `KUBERNETES_API_URL` | yes | API server URL (e.g. from `kubectl cluster-info`) |
|
|
20
20
|
*/
|
|
21
|
-
export const CredentialsFromEnv = Layer.
|
|
21
|
+
export const CredentialsFromEnv = Layer.succeed(Credentials, envConfig.pipe(Effect.mapError(() => new ConfigError({
|
|
22
22
|
message: "KUBERNETES_TOKEN and KUBERNETES_API_URL environment variables are required. " +
|
|
23
23
|
"Set KUBERNETES_TOKEN to a bearer token for your Kubernetes cluster, " +
|
|
24
24
|
"and KUBERNETES_API_URL to the API server URL (e.g. from `kubectl cluster-info` " +
|
|
@@ -26,5 +26,5 @@ export const CredentialsFromEnv = Layer.effect(Credentials, envConfig.pipe(Effec
|
|
|
26
26
|
})), Effect.map(({ token, apiBaseUrl }) => ({
|
|
27
27
|
token: Redacted.make(token),
|
|
28
28
|
apiBaseUrl,
|
|
29
|
-
}))));
|
|
29
|
+
})), Effect.orDie));
|
|
30
30
|
//# 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,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,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAqB5C,MAAM,OAAO,WAAY,SAAQ,OAAO,CAAC,OAAO,
|
|
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,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAqB5C,MAAM,OAAO,WAAY,SAAQ,OAAO,CAAC,OAAO,EAG7C,CAAC,uBAAuB,CAAC;CAAG;AAE/B,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC;IACjC,KAAK,EAAE,YAAY,CAAC,MAAM,CAAC,kBAAkB,CAAC;IAC9C,UAAU,EAAE,YAAY,CAAC,MAAM,CAAC,oBAAoB,CAAC;CACtD,CAAC,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,CAC7C,WAAW,EACX,SAAS,CAAC,IAAI,CACZ,MAAM,CAAC,QAAQ,CACb,GAAG,EAAE,CACH,IAAI,WAAW,CAAC;IACd,OAAO,EACL,8EAA8E;QAC9E,sEAAsE;QACtE,iFAAiF;QACjF,+BAA+B;CAClC,CAAC,CACL,EACD,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC;IACrC,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;IAC3B,UAAU;CACX,CAAC,CAAC,EACH,MAAM,CAAC,KAAK,CACb,CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@distilled.cloud/kubernetes",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/alchemy-run/distilled",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"specs:update": "git -C specs/kubernetes fetch && git -C specs/kubernetes checkout master && git -C specs/kubernetes pull"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@distilled.cloud/core": "0.
|
|
77
|
+
"@distilled.cloud/core": "0.24.0"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@types/bun": "^1.3.0",
|
package/src/credentials.ts
CHANGED
|
@@ -24,9 +24,10 @@ export interface Config {
|
|
|
24
24
|
readonly apiBaseUrl: string;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
export class Credentials extends Context.Service<
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
export class Credentials extends Context.Service<
|
|
28
|
+
Credentials,
|
|
29
|
+
Effect.Effect<Config>
|
|
30
|
+
>()("KubernetesCredentials") {}
|
|
30
31
|
|
|
31
32
|
const envConfig = EffectConfig.all({
|
|
32
33
|
token: EffectConfig.string("KUBERNETES_TOKEN"),
|
|
@@ -41,7 +42,7 @@ const envConfig = EffectConfig.all({
|
|
|
41
42
|
* | `KUBERNETES_TOKEN` | yes | Bearer token for authentication |
|
|
42
43
|
* | `KUBERNETES_API_URL` | yes | API server URL (e.g. from `kubectl cluster-info`) |
|
|
43
44
|
*/
|
|
44
|
-
export const CredentialsFromEnv = Layer.
|
|
45
|
+
export const CredentialsFromEnv = Layer.succeed(
|
|
45
46
|
Credentials,
|
|
46
47
|
envConfig.pipe(
|
|
47
48
|
Effect.mapError(
|
|
@@ -58,5 +59,6 @@ export const CredentialsFromEnv = Layer.effect(
|
|
|
58
59
|
token: Redacted.make(token),
|
|
59
60
|
apiBaseUrl,
|
|
60
61
|
})),
|
|
62
|
+
Effect.orDie,
|
|
61
63
|
),
|
|
62
64
|
);
|