@distilled.cloud/neon 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 +4 -4
- package/lib/credentials.d.ts.map +1 -1
- package/lib/credentials.js +4 -4
- package/lib/credentials.js.map +1 -1
- package/package.json +2 -2
- package/src/credentials.ts +8 -7
package/lib/credentials.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
+
import * as Context from "effect/Context";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
1
3
|
import * as Layer from "effect/Layer";
|
|
2
4
|
import * as Redacted from "effect/Redacted";
|
|
3
|
-
import * as Context from "effect/Context";
|
|
4
|
-
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
5
5
|
export declare const DEFAULT_API_BASE_URL = "https://console.neon.tech/api/v2";
|
|
6
6
|
export interface Config {
|
|
7
7
|
readonly apiKey: Redacted.Redacted<string>;
|
|
8
8
|
readonly apiBaseUrl: string;
|
|
9
9
|
}
|
|
10
|
-
declare const Credentials_base: Context.ServiceClass<Credentials, "NeonCredentials", Config
|
|
10
|
+
declare const Credentials_base: Context.ServiceClass<Credentials, "NeonCredentials", Effect.Effect<Config, never, never>>;
|
|
11
11
|
export declare class Credentials extends Credentials_base {
|
|
12
12
|
}
|
|
13
|
-
export declare const CredentialsFromEnv: Layer.Layer<Credentials,
|
|
13
|
+
export declare const CredentialsFromEnv: Layer.Layer<Credentials, never, never>;
|
|
14
14
|
export {};
|
|
15
15
|
//# 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":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AACA,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,eAAO,MAAM,oBAAoB,qCAAqC,CAAC;AAEvE,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;;AAED,qBAAa,WAAY,SAAQ,gBAGX;CAAG;AAEzB,eAAO,MAAM,kBAAkB,wCAa9B,CAAC"}
|
package/lib/credentials.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
2
|
+
import * as Context from "effect/Context";
|
|
1
3
|
import * as Effect from "effect/Effect";
|
|
2
4
|
import * as Layer from "effect/Layer";
|
|
3
5
|
import * as Redacted from "effect/Redacted";
|
|
4
|
-
import * as Context from "effect/Context";
|
|
5
|
-
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
6
6
|
export const DEFAULT_API_BASE_URL = "https://console.neon.tech/api/v2";
|
|
7
7
|
export class Credentials extends Context.Service()("NeonCredentials") {
|
|
8
8
|
}
|
|
9
|
-
export const CredentialsFromEnv = Layer.
|
|
9
|
+
export const CredentialsFromEnv = Layer.succeed(Credentials, Effect.gen(function* () {
|
|
10
10
|
const apiKey = process.env.NEON_API_KEY;
|
|
11
11
|
if (!apiKey) {
|
|
12
12
|
return yield* new ConfigError({
|
|
@@ -14,5 +14,5 @@ export const CredentialsFromEnv = Layer.effect(Credentials, Effect.gen(function*
|
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
return { apiKey: Redacted.make(apiKey), apiBaseUrl: DEFAULT_API_BASE_URL };
|
|
17
|
-
}));
|
|
17
|
+
}).pipe(Effect.orDie));
|
|
18
18
|
//# 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,
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,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,CAAC,MAAM,oBAAoB,GAAG,kCAAkC,CAAC;AAOvE,MAAM,OAAO,WAAY,SAAQ,OAAO,CAAC,OAAO,EAG7C,CAAC,iBAAiB,CAAC;CAAG;AAEzB,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,CAC7C,WAAW,EACX,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;IAExC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,KAAK,CAAC,CAAC,IAAI,WAAW,CAAC;YAC5B,OAAO,EAAE,+CAA+C;SACzD,CAAC,CAAC;IACL,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,oBAAoB,EAAE,CAAC;AAC7E,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/neon",
|
|
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/distilled-spec-neon fetch && git -C specs/distilled-spec-neon checkout main && git -C specs/distilled-spec-neon 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
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
2
|
+
import * as Context from "effect/Context";
|
|
1
3
|
import * as Effect from "effect/Effect";
|
|
2
4
|
import * as Layer from "effect/Layer";
|
|
3
5
|
import * as Redacted from "effect/Redacted";
|
|
4
|
-
import * as Context from "effect/Context";
|
|
5
|
-
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
6
6
|
|
|
7
7
|
export const DEFAULT_API_BASE_URL = "https://console.neon.tech/api/v2";
|
|
8
8
|
|
|
@@ -11,11 +11,12 @@ export interface Config {
|
|
|
11
11
|
readonly apiBaseUrl: string;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export class Credentials extends Context.Service<
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
export class Credentials extends Context.Service<
|
|
15
|
+
Credentials,
|
|
16
|
+
Effect.Effect<Config>
|
|
17
|
+
>()("NeonCredentials") {}
|
|
17
18
|
|
|
18
|
-
export const CredentialsFromEnv = Layer.
|
|
19
|
+
export const CredentialsFromEnv = Layer.succeed(
|
|
19
20
|
Credentials,
|
|
20
21
|
Effect.gen(function* () {
|
|
21
22
|
const apiKey = process.env.NEON_API_KEY;
|
|
@@ -27,5 +28,5 @@ export const CredentialsFromEnv = Layer.effect(
|
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
return { apiKey: Redacted.make(apiKey), apiBaseUrl: DEFAULT_API_BASE_URL };
|
|
30
|
-
}),
|
|
31
|
+
}).pipe(Effect.orDie),
|
|
31
32
|
);
|