@alchemy.run/turso 0.0.0 → 2.0.0-beta.84
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/LICENSE +201 -0
- package/README.md +68 -4
- package/lib/ApiToken.d.ts +73 -0
- package/lib/ApiToken.d.ts.map +1 -0
- package/lib/ApiToken.js +120 -0
- package/lib/ApiToken.js.map +1 -0
- package/lib/AuthProvider.d.ts +36 -0
- package/lib/AuthProvider.d.ts.map +1 -0
- package/lib/AuthProvider.js +85 -0
- package/lib/AuthProvider.js.map +1 -0
- package/lib/Connect.d.ts +79 -0
- package/lib/Connect.d.ts.map +1 -0
- package/lib/Connect.js +22 -0
- package/lib/Connect.js.map +1 -0
- package/lib/Contributions.d.ts +7 -0
- package/lib/Contributions.d.ts.map +1 -0
- package/lib/Contributions.js +6 -0
- package/lib/Contributions.js.map +1 -0
- package/lib/Credentials.d.ts +39 -0
- package/lib/Credentials.d.ts.map +1 -0
- package/lib/Credentials.js +80 -0
- package/lib/Credentials.js.map +1 -0
- package/lib/Database.d.ts +217 -0
- package/lib/Database.d.ts.map +1 -0
- package/lib/Database.js +271 -0
- package/lib/Database.js.map +1 -0
- package/lib/DatabaseToken.d.ts +95 -0
- package/lib/DatabaseToken.d.ts.map +1 -0
- package/lib/DatabaseToken.js +128 -0
- package/lib/DatabaseToken.js.map +1 -0
- package/lib/Group.d.ts +93 -0
- package/lib/Group.d.ts.map +1 -0
- package/lib/Group.js +162 -0
- package/lib/Group.js.map +1 -0
- package/lib/GroupToken.d.ts +48 -0
- package/lib/GroupToken.d.ts.map +1 -0
- package/lib/GroupToken.js +83 -0
- package/lib/GroupToken.js.map +1 -0
- package/lib/Hrana.d.ts +42 -0
- package/lib/Hrana.d.ts.map +1 -0
- package/lib/Hrana.js +105 -0
- package/lib/Hrana.js.map +1 -0
- package/lib/ManageDatabases.d.ts +73 -0
- package/lib/ManageDatabases.d.ts.map +1 -0
- package/lib/ManageDatabases.js +81 -0
- package/lib/ManageDatabases.js.map +1 -0
- package/lib/OrganizationInvite.d.ts +46 -0
- package/lib/OrganizationInvite.d.ts.map +1 -0
- package/lib/OrganizationInvite.js +72 -0
- package/lib/OrganizationInvite.js.map +1 -0
- package/lib/OrganizationMember.d.ts +47 -0
- package/lib/OrganizationMember.d.ts.map +1 -0
- package/lib/OrganizationMember.js +81 -0
- package/lib/OrganizationMember.js.map +1 -0
- package/lib/OrganizationSettings.d.ts +52 -0
- package/lib/OrganizationSettings.d.ts.map +1 -0
- package/lib/OrganizationSettings.js +93 -0
- package/lib/OrganizationSettings.js.map +1 -0
- package/lib/Providers.d.ts +24 -0
- package/lib/Providers.d.ts.map +1 -0
- package/lib/Providers.js +42 -0
- package/lib/Providers.js.map +1 -0
- package/lib/index.d.ts +14 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +14 -0
- package/lib/index.js.map +1 -0
- package/package.json +54 -3
- package/src/ApiToken.ts +197 -0
- package/src/AuthProvider.ts +113 -0
- package/src/Connect.ts +103 -0
- package/src/Contributions.ts +9 -0
- package/src/Credentials.ts +139 -0
- package/src/Database.ts +504 -0
- package/src/DatabaseToken.ts +203 -0
- package/src/Group.ts +256 -0
- package/src/GroupToken.ts +119 -0
- package/src/Hrana.ts +182 -0
- package/src/ManageDatabases.ts +195 -0
- package/src/OrganizationInvite.ts +118 -0
- package/src/OrganizationMember.ts +122 -0
- package/src/OrganizationSettings.ts +145 -0
- package/src/Providers.ts +67 -0
- package/src/index.ts +20 -0
package/lib/Connect.d.ts
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as Binding from "alchemy/Binding";
|
|
2
|
+
import type { RuntimeContext } from "alchemy/RuntimeContext";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as Layer from "effect/Layer";
|
|
5
|
+
import type * as Redacted from "effect/Redacted";
|
|
6
|
+
import type { Database } from "./Database.ts";
|
|
7
|
+
import { type TokenAuthorization } from "./DatabaseToken.ts";
|
|
8
|
+
/**
|
|
9
|
+
* libSQL connection accessors for one Turso database. Resolving them does
|
|
10
|
+
* not open a connection; pass the client to `SQL.LibSQL` or
|
|
11
|
+
* `Drizzle.LibSQL`, or read `url` / `authToken` for `@libsql/client`.
|
|
12
|
+
*/
|
|
13
|
+
export interface ConnectClient {
|
|
14
|
+
/** libSQL URL of the database (`libsql://<hostname>`). */
|
|
15
|
+
url: Effect.Effect<string, never, RuntimeContext>;
|
|
16
|
+
/** SQL auth token for the database. */
|
|
17
|
+
authToken: Effect.Effect<Redacted.Redacted<string>, never, RuntimeContext>;
|
|
18
|
+
}
|
|
19
|
+
export interface ConnectOptions {
|
|
20
|
+
/**
|
|
21
|
+
* Access level of the token minted for this host.
|
|
22
|
+
* @default "full-access"
|
|
23
|
+
*/
|
|
24
|
+
authorization?: TokenAuthorization;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Connect to a Turso database from a Worker, Lambda, or other host. The
|
|
28
|
+
* host gets the database's URL and its own {@link DatabaseToken}. Your
|
|
29
|
+
* Turso API token stays on your machine.
|
|
30
|
+
*
|
|
31
|
+
* ### Querying a Database
|
|
32
|
+
* **Example:** Effect SQL over a Turso database
|
|
33
|
+
* ```typescript
|
|
34
|
+
* Effect.gen(function* () {
|
|
35
|
+
* const conn = yield* Turso.Connect(Db);
|
|
36
|
+
* const sql = yield* SQL.LibSQL(conn);
|
|
37
|
+
* return {
|
|
38
|
+
* fetch: Effect.gen(function* () {
|
|
39
|
+
* return yield* HttpServerResponse.json(yield* sql`SELECT 1 AS value`);
|
|
40
|
+
* }),
|
|
41
|
+
* };
|
|
42
|
+
* }).pipe(Effect.provide(Turso.ConnectHttp));
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* **Example:** Drizzle over a Turso database
|
|
46
|
+
* ```typescript
|
|
47
|
+
* const conn = yield* Turso.Connect(Db);
|
|
48
|
+
* const db = yield* Drizzle.LibSQL(conn, { relations });
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* **Example:** AWS Lambda (install the native libSQL client)
|
|
52
|
+
* ```typescript
|
|
53
|
+
* export default class Api extends Lambda.Function<Api>()(
|
|
54
|
+
* "Api",
|
|
55
|
+
* { main: import.meta.url, build: { install: ["@libsql/client"] } },
|
|
56
|
+
* Effect.gen(function* () {
|
|
57
|
+
* const sql = yield* SQL.LibSQL(yield* Turso.Connect(Db));
|
|
58
|
+
* // ...
|
|
59
|
+
* }).pipe(Effect.provide(Turso.ConnectHttp)),
|
|
60
|
+
* ) {}
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* **Example:** Read-only access
|
|
64
|
+
* ```typescript
|
|
65
|
+
* const conn = yield* Turso.Connect(Db, { authorization: "read-only" });
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* @binding
|
|
69
|
+
* @product Database
|
|
70
|
+
*/
|
|
71
|
+
export interface Connect extends Binding.Service<Connect, "Turso.Connect", (database: Database, options?: ConnectOptions) => Effect.Effect<ConnectClient>> {
|
|
72
|
+
}
|
|
73
|
+
export declare const Connect: Connect;
|
|
74
|
+
/**
|
|
75
|
+
* Host-independent implementation: the URL and a per-host token are bound
|
|
76
|
+
* as environment values, so it works on any Platform host.
|
|
77
|
+
*/
|
|
78
|
+
export declare const ConnectHttp: Layer.Layer<Connect, never, never>;
|
|
79
|
+
//# sourceMappingURL=Connect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Connect.d.ts","sourceRoot":"","sources":["../src/Connect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE5E;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,0DAA0D;IAC1D,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;IAClD,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;CAC5E;AAED,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,aAAa,CAAC,EAAE,kBAAkB,CAAC;CACpC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,MAAM,WAAW,OAAQ,SAAQ,OAAO,CAAC,OAAO,CAC9C,OAAO,EACP,eAAe,EACf,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,cAAc,KAAK,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAC/E;CAAG;AAEJ,eAAO,MAAM,OAAO,SAA4C,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,WAAW,oCAiBvB,CAAC"}
|
package/lib/Connect.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as Binding from "alchemy/Binding";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Layer from "effect/Layer";
|
|
4
|
+
import { DatabaseToken } from "./DatabaseToken.js";
|
|
5
|
+
export const Connect = Binding.Service("Turso.Connect");
|
|
6
|
+
/**
|
|
7
|
+
* Host-independent implementation: the URL and a per-host token are bound
|
|
8
|
+
* as environment values, so it works on any Platform host.
|
|
9
|
+
*/
|
|
10
|
+
export const ConnectHttp = Layer.effect(Connect, Effect.gen(function* () {
|
|
11
|
+
const Token = yield* DatabaseToken;
|
|
12
|
+
return Effect.fn(function* (database, options) {
|
|
13
|
+
const host = yield* Binding.Host;
|
|
14
|
+
const authorization = options?.authorization ?? "full-access";
|
|
15
|
+
const token = yield* Token(`${host?.LogicalId ?? ""}${database.LogicalId}${authorization === "read-only" ? "ReadOnly" : ""}Token`, { database: database.name, authorization });
|
|
16
|
+
return {
|
|
17
|
+
url: yield* database.url,
|
|
18
|
+
authToken: yield* token.token,
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
}));
|
|
22
|
+
//# sourceMappingURL=Connect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Connect.js","sourceRoot":"","sources":["../src/Connect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAE3C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC,OAAO,EAAE,aAAa,EAA2B,MAAM,oBAAoB,CAAC;AAyE5E,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAU,eAAe,CAAC,CAAC;AAEjE;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CACrC,OAAO,EACP,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,aAAa,CAAC;IACnC,OAAO,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,QAAkB,EAAE,OAAwB;QACtE,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;QACjC,MAAM,aAAa,GAAG,OAAO,EAAE,aAAa,IAAI,aAAa,CAAC;QAC9D,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,KAAK,CACxB,GAAG,IAAI,EAAE,SAAS,IAAI,EAAE,GAAG,QAAQ,CAAC,SAAS,GAAG,aAAa,KAAK,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,OAAO,EACtG,EAAE,QAAQ,EAAE,QAAQ,CAAC,IAAI,EAAE,aAAa,EAAE,CAC3C,CAAC;QACF,OAAO;YACL,GAAG,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,GAAG;YACxB,SAAS,EAAE,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK;SACN,CAAC;IAC5B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as Contributions from "alchemy/Contributions";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
readonly name: "turso";
|
|
4
|
+
readonly auth: Contributions.Lazy<import("effect/Layer").Layer<never, never, import("alchemy/Auth/AuthProvider").AuthProviders | import("effect/FileSystem").FileSystem | import("effect/Path").Path>>;
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
7
|
+
//# sourceMappingURL=Contributions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Contributions.d.ts","sourceRoot":"","sources":["../src/Contributions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,uBAAuB,CAAC;;;;;AAEvD,wBAMG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Contributions.js","sourceRoot":"","sources":["../src/Contributions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,uBAAuB,CAAC;AAEvD,eAAe,aAAa,CAAC,IAAI,CAAC;IAChC,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,aAAa,CAAC,IAAI,CACtB,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,EACjC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAC7B;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Credentials } from "@distilled.cloud/turso/Credentials";
|
|
2
|
+
import * as Context from "effect/Context";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as HttpClient from "effect/http/HttpClient";
|
|
5
|
+
import * as Layer from "effect/Layer";
|
|
6
|
+
import * as Redacted from "effect/Redacted";
|
|
7
|
+
export { Credentials, CredentialsFromEnv, DEFAULT_API_BASE_URL, } from "@distilled.cloud/turso/Credentials";
|
|
8
|
+
declare const Organization_base: Context.ServiceClass<Organization, "Turso.Organization", Effect.Effect<string, never, never>>;
|
|
9
|
+
/**
|
|
10
|
+
* The Turso organization slug every org-scoped Platform API call targets.
|
|
11
|
+
* Holds an effect so the slug is resolved (and, when not configured,
|
|
12
|
+
* discovered from the API token) on first use, never at layer build.
|
|
13
|
+
*/
|
|
14
|
+
export declare class Organization extends Organization_base {
|
|
15
|
+
}
|
|
16
|
+
/** The organization slug for the current Turso credentials. */
|
|
17
|
+
export declare const organization: Effect.Effect<string, never, Organization>;
|
|
18
|
+
/**
|
|
19
|
+
* Build Turso `Credentials` + `Organization` from an explicit API token.
|
|
20
|
+
* Useful for tests or when the caller already has a token in hand.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* Effect.provide(Turso.fromToken({ apiToken: "...", organization: "my-org" }))
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare const fromToken: (input: {
|
|
28
|
+
apiToken: string | Redacted.Redacted<string>;
|
|
29
|
+
organization?: string;
|
|
30
|
+
apiBaseUrl?: string;
|
|
31
|
+
}) => Layer.Layer<Credentials | Organization, never, HttpClient.HttpClient>;
|
|
32
|
+
/**
|
|
33
|
+
* Build Turso `Credentials` + `Organization` that resolve through the
|
|
34
|
+
* Alchemy AuthProvider: environment credentials (`TURSO_API_TOKEN`) when
|
|
35
|
+
* present, otherwise the selected profile. Resolution is deferred until the
|
|
36
|
+
* first API call, so building the provider layers never needs a profile.
|
|
37
|
+
*/
|
|
38
|
+
export declare const fromAuthProvider: () => Layer.Layer<Credentials | Organization, never, import("alchemy/Auth/AuthProvider").AuthProviders | HttpClient.HttpClient | import("alchemy/Auth/Profile").ProfileStore>;
|
|
39
|
+
//# sourceMappingURL=Credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Credentials.d.ts","sourceRoot":"","sources":["../src/Credentials.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EAGZ,MAAM,oCAAoC,CAAC;AAO5C,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAO5C,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,oCAAoC,CAAC;;AAE5C;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,iBAEjC;CAAG;AAEJ,+DAA+D;AAC/D,eAAO,MAAM,YAAY,4CAEvB,CAAC;AA6CH;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,UAAW;IAC/B,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC7C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,0EAYE,CAAC;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,+KAmB1B,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
2
|
+
import { Credentials, DEFAULT_API_BASE_URL, } from "@distilled.cloud/turso/Credentials";
|
|
3
|
+
import * as turso from "@distilled.cloud/turso/turso";
|
|
4
|
+
import { deferUntilFirstUse, orDieCredentialsUnavailable, resolveProviderConfig, } from "alchemy/Auth/Resolve";
|
|
5
|
+
import * as Context from "effect/Context";
|
|
6
|
+
import * as Effect from "effect/Effect";
|
|
7
|
+
import * as HttpClient from "effect/http/HttpClient";
|
|
8
|
+
import * as Layer from "effect/Layer";
|
|
9
|
+
import * as Redacted from "effect/Redacted";
|
|
10
|
+
import { TURSO_AUTH_PROVIDER_NAME, } from "./AuthProvider.js";
|
|
11
|
+
export { Credentials, CredentialsFromEnv, DEFAULT_API_BASE_URL, } from "@distilled.cloud/turso/Credentials";
|
|
12
|
+
/**
|
|
13
|
+
* The Turso organization slug every org-scoped Platform API call targets.
|
|
14
|
+
* Holds an effect so the slug is resolved (and, when not configured,
|
|
15
|
+
* discovered from the API token) on first use, never at layer build.
|
|
16
|
+
*/
|
|
17
|
+
export class Organization extends Context.Service()("Turso.Organization") {
|
|
18
|
+
}
|
|
19
|
+
/** The organization slug for the current Turso credentials. */
|
|
20
|
+
export const organization = Effect.gen(function* () {
|
|
21
|
+
return yield* yield* Organization;
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* Discover the organization an API token acts on: the token's own
|
|
25
|
+
* organization when it is org-scoped, else the account's only organization.
|
|
26
|
+
*/
|
|
27
|
+
const discoverOrganization = Effect.gen(function* () {
|
|
28
|
+
const orgs = yield* turso.listOrganizations({});
|
|
29
|
+
if (orgs.length === 1 && orgs[0]?.slug) {
|
|
30
|
+
return orgs[0].slug;
|
|
31
|
+
}
|
|
32
|
+
return yield* new ConfigError({
|
|
33
|
+
message: orgs.length === 0
|
|
34
|
+
? "Turso: this API token has no organizations."
|
|
35
|
+
: `Turso: this API token can access ${orgs.length} organizations (${orgs
|
|
36
|
+
.map((org) => org.slug)
|
|
37
|
+
.join(", ")}). Set TURSO_ORGANIZATION or configure the organization in your profile.`,
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
const make = (resolve) => Effect.gen(function* () {
|
|
41
|
+
const http = yield* HttpClient.HttpClient;
|
|
42
|
+
const cached = yield* Effect.cached(resolve);
|
|
43
|
+
const credentials = Effect.map(cached, (creds) => ({
|
|
44
|
+
apiKey: creds.apiToken,
|
|
45
|
+
apiBaseUrl: creds.apiBaseUrl,
|
|
46
|
+
}));
|
|
47
|
+
const organization = yield* Effect.cached(Effect.flatMap(cached, (creds) => creds.organization !== undefined && creds.organization.length > 0
|
|
48
|
+
? Effect.succeed(creds.organization)
|
|
49
|
+
: discoverOrganization.pipe(Effect.provideService(Credentials, credentials), Effect.provideService(HttpClient.HttpClient, http), orDieCredentialsUnavailable(TURSO_AUTH_PROVIDER_NAME))));
|
|
50
|
+
return Context.make(Credentials, credentials).pipe(Context.add(Organization, organization));
|
|
51
|
+
});
|
|
52
|
+
/**
|
|
53
|
+
* Build Turso `Credentials` + `Organization` from an explicit API token.
|
|
54
|
+
* Useful for tests or when the caller already has a token in hand.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* Effect.provide(Turso.fromToken({ apiToken: "...", organization: "my-org" }))
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export const fromToken = (input) => Layer.effectContext(make(Effect.succeed({
|
|
62
|
+
type: "apiToken",
|
|
63
|
+
apiToken: typeof input.apiToken === "string" ? Redacted.make(input.apiToken) : input.apiToken,
|
|
64
|
+
apiBaseUrl: input.apiBaseUrl ?? DEFAULT_API_BASE_URL,
|
|
65
|
+
organization: input.organization,
|
|
66
|
+
source: { type: "stored" },
|
|
67
|
+
})));
|
|
68
|
+
/**
|
|
69
|
+
* Build Turso `Credentials` + `Organization` that resolve through the
|
|
70
|
+
* Alchemy AuthProvider: environment credentials (`TURSO_API_TOKEN`) when
|
|
71
|
+
* present, otherwise the selected profile. Resolution is deferred until the
|
|
72
|
+
* first API call, so building the provider layers never needs a profile.
|
|
73
|
+
*/
|
|
74
|
+
export const fromAuthProvider = () => Layer.effectContext(Effect.gen(function* () {
|
|
75
|
+
const resolve = yield* resolveProviderConfig(TURSO_AUTH_PROVIDER_NAME).pipe(Effect.flatMap(({ profileName, resolve }) => Effect.mapError(resolve, (e) => new ConfigError({
|
|
76
|
+
message: `Failed to resolve Turso credentials from ${profileName === undefined ? "the environment" : `profile '${profileName}'`}: ${e.message}`,
|
|
77
|
+
}))), deferUntilFirstUse);
|
|
78
|
+
return yield* make(resolve.pipe(orDieCredentialsUnavailable(TURSO_AUTH_PROVIDER_NAME)));
|
|
79
|
+
}));
|
|
80
|
+
//# sourceMappingURL=Credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Credentials.js","sourceRoot":"","sources":["../src/Credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EACL,WAAW,EACX,oBAAoB,GAErB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,KAAK,MAAM,8BAA8B,CAAC;AACtD,OAAO,EACL,kBAAkB,EAClB,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EACL,wBAAwB,GAGzB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,oCAAoC,CAAC;AAE5C;;;;GAIG;AACH,MAAM,OAAO,YAAa,SAAQ,OAAO,CAAC,OAAO,EAAuC,CACtF,oBAAoB,CACrB;CAAG;AAEJ,+DAA+D;AAC/D,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAC9C,OAAO,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC;AACpC,CAAC,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM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,CAAC,OAAO,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,EAAE,CAC1C,MAAM,CAAC,QAAQ,CACb,OAAO,EACP,CAAC,CAAC,EAAE,EAAE,CACJ,IAAI,WAAW,CAAC;QACd,OAAO,EAAE,4CAA4C,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,YAAY,WAAW,GAAG,KAAK,CAAC,CAAC,OAAO,EAAE;KAChJ,CAAC,CACL,CACF,EACD,kBAAkB,CACnB,CAAC;IACF,OAAO,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,2BAA2B,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC;AAC1F,CAAC,CAAC,CACH,CAAC"}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { type MigrationsInput } from "@alchemy.run/sql/Migrations";
|
|
2
|
+
import * as turso from "@distilled.cloud/turso/turso";
|
|
3
|
+
import * as Provider from "alchemy/Provider";
|
|
4
|
+
import { Resource } from "alchemy/Resource";
|
|
5
|
+
import * as Redacted from "effect/Redacted";
|
|
6
|
+
import type { Providers } from "./Providers.ts";
|
|
7
|
+
export interface DatabaseSeed {
|
|
8
|
+
/**
|
|
9
|
+
* `"database"` copies an existing database (optionally at a point in
|
|
10
|
+
* time). `"database_upload"` creates an empty database awaiting an upload
|
|
11
|
+
* of a SQLite file.
|
|
12
|
+
*/
|
|
13
|
+
type: "database" | "database_upload";
|
|
14
|
+
/** Name of the source database when `type` is `"database"`. */
|
|
15
|
+
name?: string;
|
|
16
|
+
/**
|
|
17
|
+
* ISO 8601 recovery point within the source database's retention window
|
|
18
|
+
* (24 hours, or 30 days on the Scaler plan).
|
|
19
|
+
*/
|
|
20
|
+
timestamp?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface DatabaseEncryption {
|
|
23
|
+
/**
|
|
24
|
+
* Base64-encoded encryption key: 32 bytes for `aes256gcm`,
|
|
25
|
+
* `chacha20poly1305`, and the `aegis256` variants; 16 bytes for
|
|
26
|
+
* `aes128gcm` and the `aegis128l` variants.
|
|
27
|
+
*/
|
|
28
|
+
key: Redacted.Redacted<string>;
|
|
29
|
+
/** Encryption cipher. */
|
|
30
|
+
cipher: "aes256gcm" | "aes128gcm" | "chacha20poly1305" | "aegis128l" | "aegis128x2" | "aegis128x4" | "aegis256" | "aegis256x2" | "aegis256x4" | (string & {});
|
|
31
|
+
}
|
|
32
|
+
export interface DatabaseProps {
|
|
33
|
+
/**
|
|
34
|
+
* Database name, unique within the organization. Lowercase letters,
|
|
35
|
+
* numbers, and dashes, at most 64 characters. If omitted, a unique name
|
|
36
|
+
* is generated from the stack, stage, and logical ID. Changing it
|
|
37
|
+
* replaces the database.
|
|
38
|
+
*/
|
|
39
|
+
name?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Name of the group the database is created in (e.g. `group.name`).
|
|
42
|
+
* Changing it replaces the database.
|
|
43
|
+
*/
|
|
44
|
+
group: string;
|
|
45
|
+
/**
|
|
46
|
+
* Seed the new database from an existing database or a pending upload.
|
|
47
|
+
* Only used when the database is created.
|
|
48
|
+
*/
|
|
49
|
+
seed?: DatabaseSeed;
|
|
50
|
+
/**
|
|
51
|
+
* Encrypt the database at rest with your own key. Only used when the
|
|
52
|
+
* database is created; changing it replaces the database. Requires a Pro
|
|
53
|
+
* or Enterprise plan.
|
|
54
|
+
*/
|
|
55
|
+
encryption?: DatabaseEncryption;
|
|
56
|
+
/**
|
|
57
|
+
* Maximum size of the database, in bytes or with a unit (e.g. `"256mb"`,
|
|
58
|
+
* `"1gb"`). When omitted, the current limit is left unchanged. Only
|
|
59
|
+
* legacy databases support it — Turso rejects it for databases created on
|
|
60
|
+
* the current platform ("size_limit is not supported for db-api
|
|
61
|
+
* controlled databases").
|
|
62
|
+
*/
|
|
63
|
+
sizeLimit?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Allow other databases to be attached to this one with `ATTACH`. Not
|
|
66
|
+
* supported on AWS-hosted databases, which reject the setting.
|
|
67
|
+
* @default false
|
|
68
|
+
*/
|
|
69
|
+
allowAttach?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Reject every read query.
|
|
72
|
+
* @default false
|
|
73
|
+
*/
|
|
74
|
+
blockReads?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Reject every write query.
|
|
77
|
+
* @default false
|
|
78
|
+
*/
|
|
79
|
+
blockWrites?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Prevent the database from being deleted. While enabled, destroying or
|
|
82
|
+
* replacing the database fails; set it to `false` and deploy first.
|
|
83
|
+
* @default false
|
|
84
|
+
*/
|
|
85
|
+
deleteProtection?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* IP addresses and CIDR blocks allowed to connect. Empty or omitted means
|
|
88
|
+
* no IP restriction. Requires a paid plan.
|
|
89
|
+
*/
|
|
90
|
+
allowedIps?: string[];
|
|
91
|
+
/**
|
|
92
|
+
* AWS VPC endpoint IDs (`vpce-...`) allowed to connect. Empty or omitted
|
|
93
|
+
* means no VPC endpoint restriction. Requires a paid plan.
|
|
94
|
+
*/
|
|
95
|
+
allowedAwsVpcIds?: string[];
|
|
96
|
+
/**
|
|
97
|
+
* SQL migrations to apply on deploy. Accepts a directory path, a
|
|
98
|
+
* `Drizzle.Schema` resource, or `{ dir, table? }`.
|
|
99
|
+
*
|
|
100
|
+
* Bookkeeping lives in Alchemy's `__alchemy_migrations` table. A database
|
|
101
|
+
* previously migrated by drizzle-kit is adopted by a one-way conversion on
|
|
102
|
+
* first deploy.
|
|
103
|
+
*/
|
|
104
|
+
migrations?: MigrationsInput;
|
|
105
|
+
/**
|
|
106
|
+
* Paths to additional `.sql` files to apply after migrations. Each file is
|
|
107
|
+
* hashed; only files whose contents change are re-applied.
|
|
108
|
+
*/
|
|
109
|
+
importFiles?: string[];
|
|
110
|
+
}
|
|
111
|
+
export interface DatabaseAttributes {
|
|
112
|
+
/** Database UUID. */
|
|
113
|
+
dbId: string;
|
|
114
|
+
/** Database name. */
|
|
115
|
+
name: string;
|
|
116
|
+
/** The organization slug that owns the database. */
|
|
117
|
+
organization: string;
|
|
118
|
+
/** Name of the group the database belongs to. */
|
|
119
|
+
group: string;
|
|
120
|
+
/** DNS hostname for libSQL and HTTP connections. */
|
|
121
|
+
hostname: string;
|
|
122
|
+
/** libSQL connection URL (`libsql://<hostname>`), for `@libsql/client`. */
|
|
123
|
+
url: string;
|
|
124
|
+
/** HTTPS URL (`https://<hostname>`) of the Hrana-over-HTTP endpoint. */
|
|
125
|
+
httpUrl: string;
|
|
126
|
+
/** Primary location of the database. */
|
|
127
|
+
primaryRegion: string;
|
|
128
|
+
/** Every location the database runs in. */
|
|
129
|
+
regions: string[];
|
|
130
|
+
/** Maximum database size, or `undefined` when unlimited. */
|
|
131
|
+
sizeLimit: string | undefined;
|
|
132
|
+
/** Whether other databases may be attached. */
|
|
133
|
+
allowAttach: boolean;
|
|
134
|
+
/** Whether reads are blocked. */
|
|
135
|
+
blockReads: boolean;
|
|
136
|
+
/** Whether writes are blocked. */
|
|
137
|
+
blockWrites: boolean;
|
|
138
|
+
/** Whether delete protection is enabled. */
|
|
139
|
+
deleteProtection: boolean;
|
|
140
|
+
/** IP addresses and CIDR blocks allowed to connect. */
|
|
141
|
+
allowedIps: string[];
|
|
142
|
+
/** AWS VPC endpoint IDs allowed to connect. */
|
|
143
|
+
allowedAwsVpcIds: string[];
|
|
144
|
+
/** Directory containing migration files, if configured. */
|
|
145
|
+
migrationsDir: string | undefined;
|
|
146
|
+
/** Table used to track applied migrations, if configured. */
|
|
147
|
+
migrationsTable: string | undefined;
|
|
148
|
+
/** Content hashes for the last applied migration files. */
|
|
149
|
+
migrationsHashes: Record<string, string>;
|
|
150
|
+
/** Content hashes for the last applied import files. */
|
|
151
|
+
importHashes: Record<string, string>;
|
|
152
|
+
}
|
|
153
|
+
export type Database = Resource<"Turso.Database", DatabaseProps, DatabaseAttributes, never, Providers>;
|
|
154
|
+
/**
|
|
155
|
+
* A Turso database: a SQLite database that lives in a {@link Group}.
|
|
156
|
+
* Connect to it from a Worker or Lambda with {@link Connect}, or create a
|
|
157
|
+
* {@link DatabaseToken} for other apps.
|
|
158
|
+
* @see https://docs.turso.tech/concepts#databases
|
|
159
|
+
*
|
|
160
|
+
* ### Creating a Database
|
|
161
|
+
* **Example:** Database in a group
|
|
162
|
+
* ```typescript
|
|
163
|
+
* const group = yield* Turso.Group("Group", { location: "aws-us-east-1" });
|
|
164
|
+
* const db = yield* Turso.Database("Db", { group: group.name });
|
|
165
|
+
* ```
|
|
166
|
+
*
|
|
167
|
+
* **Example:** Database with delete protection and an IP allowlist
|
|
168
|
+
* ```typescript
|
|
169
|
+
* const db = yield* Turso.Database("Db", {
|
|
170
|
+
* group: group.name,
|
|
171
|
+
* deleteProtection: true,
|
|
172
|
+
* allowedIps: ["203.0.113.0/24"],
|
|
173
|
+
* });
|
|
174
|
+
* ```
|
|
175
|
+
*
|
|
176
|
+
* ### Branching
|
|
177
|
+
* **Example:** Copy an existing database
|
|
178
|
+
* ```typescript
|
|
179
|
+
* const preview = yield* Turso.Database("Preview", {
|
|
180
|
+
* group: group.name,
|
|
181
|
+
* seed: { type: "database", name: db.name },
|
|
182
|
+
* });
|
|
183
|
+
* ```
|
|
184
|
+
*
|
|
185
|
+
* ### Migrations
|
|
186
|
+
* Point `migrations` at a folder of `.sql` files (or a `Drizzle.Schema`).
|
|
187
|
+
* Pending migrations are applied in order on each deploy.
|
|
188
|
+
*
|
|
189
|
+
* **Example:** Apply migrations from a directory
|
|
190
|
+
* ```typescript
|
|
191
|
+
* const db = yield* Turso.Database("Db", {
|
|
192
|
+
* group: group.name,
|
|
193
|
+
* migrations: "./migrations",
|
|
194
|
+
* });
|
|
195
|
+
* ```
|
|
196
|
+
*
|
|
197
|
+
* **Example:** Seed with SQL files
|
|
198
|
+
* ```typescript
|
|
199
|
+
* const db = yield* Turso.Database("Db", {
|
|
200
|
+
* group: group.name,
|
|
201
|
+
* importFiles: ["./seed/users.sql"],
|
|
202
|
+
* });
|
|
203
|
+
* ```
|
|
204
|
+
*
|
|
205
|
+
* ### Querying from a Worker
|
|
206
|
+
* **Example:** Drizzle over a Turso database
|
|
207
|
+
* ```typescript
|
|
208
|
+
* const conn = yield* Turso.Connect(Db);
|
|
209
|
+
* const db = yield* Drizzle.LibSQL(conn);
|
|
210
|
+
* ```
|
|
211
|
+
*
|
|
212
|
+
* @resource
|
|
213
|
+
* @product Database
|
|
214
|
+
*/
|
|
215
|
+
export declare const Database: import("alchemy/Resource").ResourceClass<Database>;
|
|
216
|
+
export declare const DatabaseProvider: () => import("effect/Layer").Layer<Provider.Provider<Database>, never, import("effect/FileSystem").FileSystem | import("./Credentials.ts").Organization | import("effect/Path").Path | import("alchemy/Stack").Stack | import("alchemy/Stage").Stage | turso.TursoOpContext>;
|
|
217
|
+
//# sourceMappingURL=Database.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Database.d.ts","sourceRoot":"","sources":["../src/Database.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,eAAe,EACrB,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,KAAK,MAAM,8BAA8B,CAAC;AAItD,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAG5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,IAAI,EAAE,UAAU,GAAG,iBAAiB,CAAC;IACrC,+DAA+D;IAC/D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,GAAG,EAAE,QAAQ,CAAC,QAAQ,CA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