@shivaedev/platform 0.16.1 → 0.18.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/CHANGELOG.md +33 -0
- package/README.md +133 -12
- package/dist/rpc/identity.d.ts +8 -2
- package/dist/rpc/identity.d.ts.map +1 -1
- package/dist/rpc/identity.js +2 -0
- package/dist/rpc/identity.js.map +1 -1
- package/dist/rpc/middleware.d.ts +4 -1
- package/dist/rpc/middleware.d.ts.map +1 -1
- package/dist/rpc/middleware.js +4 -0
- package/dist/rpc/middleware.js.map +1 -1
- package/dist/rpc/publicConfig.d.ts +3 -0
- package/dist/rpc/publicConfig.d.ts.map +1 -0
- package/dist/rpc/publicConfig.js +8 -0
- package/dist/rpc/publicConfig.js.map +1 -0
- package/dist/rpc/requireAdmin.d.ts +3 -3
- package/dist/rpc/requireAdmin.d.ts.map +1 -1
- package/dist/rpc/requireAdmin.js +5 -8
- package/dist/rpc/requireAdmin.js.map +1 -1
- package/dist/server/AppHostFactory.d.ts +15 -0
- package/dist/server/AppHostFactory.d.ts.map +1 -0
- package/dist/server/AppHostFactory.js +2 -0
- package/dist/server/AppHostFactory.js.map +1 -0
- package/dist/server/AppHostInput.d.ts +13 -0
- package/dist/server/AppHostInput.d.ts.map +1 -0
- package/dist/server/AppHostInput.js +2 -0
- package/dist/server/AppHostInput.js.map +1 -0
- package/dist/server/appHost.d.ts +8 -10
- package/dist/server/appHost.d.ts.map +1 -1
- package/dist/server/appHost.js +6 -6
- package/dist/server/appHost.js.map +1 -1
- package/dist/server/appHostHttp.d.ts +5 -2
- package/dist/server/appHostHttp.d.ts.map +1 -1
- package/dist/server/appHostHttp.js.map +1 -1
- package/dist/server/better-auth/mount.d.ts +61 -0
- package/dist/server/better-auth/mount.d.ts.map +1 -0
- package/dist/server/better-auth/mount.js +59 -0
- package/dist/server/better-auth/mount.js.map +1 -0
- package/dist/server/better-auth/testing.d.ts +50 -0
- package/dist/server/better-auth/testing.d.ts.map +1 -0
- package/dist/server/better-auth/testing.js +18 -0
- package/dist/server/better-auth/testing.js.map +1 -0
- package/dist/server/databaseLayer.d.ts +2 -1
- package/dist/server/databaseLayer.d.ts.map +1 -1
- package/dist/server/databaseLayer.js +2 -0
- package/dist/server/databaseLayer.js.map +1 -1
- package/dist/server/rpc-server/adapters/betterAuthSessions.d.ts +3 -1
- package/dist/server/rpc-server/adapters/betterAuthSessions.d.ts.map +1 -1
- package/dist/server/rpc-server/adapters/betterAuthSessions.js +13 -22
- package/dist/server/rpc-server/adapters/betterAuthSessions.js.map +1 -1
- package/dist/server/rpc-server/publicConfigLayer.d.ts +4 -0
- package/dist/server/rpc-server/publicConfigLayer.d.ts.map +1 -0
- package/dist/server/rpc-server/publicConfigLayer.js +8 -0
- package/dist/server/rpc-server/publicConfigLayer.js.map +1 -0
- package/dist/server/rpc-server/session.d.ts +6 -2
- package/dist/server/rpc-server/session.d.ts.map +1 -1
- package/dist/server/rpc-server/session.js +16 -6
- package/dist/server/rpc-server/session.js.map +1 -1
- package/package.json +10 -6
- package/src/rpc/identity.ts +8 -2
- package/src/rpc/middleware.ts +7 -1
- package/src/rpc/publicConfig.ts +9 -0
- package/src/rpc/requireAdmin.ts +6 -9
- package/src/server/AppHostFactory.ts +121 -0
- package/src/server/AppHostInput.ts +74 -0
- package/src/server/appHost.ts +43 -71
- package/src/server/appHostHttp.ts +4 -4
- package/src/server/better-auth/mount.ts +68 -0
- package/src/server/better-auth/testing.ts +21 -0
- package/src/server/databaseLayer.ts +4 -1
- package/src/server/rpc-server/adapters/betterAuthSessions.ts +19 -23
- package/src/server/rpc-server/publicConfigLayer.ts +11 -0
- package/src/server/rpc-server/session.ts +38 -6
package/dist/server/appHost.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Context } from "effect";
|
|
1
|
+
import { Context, Layer } from "effect";
|
|
2
2
|
import { appHostHttp, deferredHost, migratedHost } from "#server/appHostHttp.ts";
|
|
3
3
|
import { databaseLayer } from "#server/databaseLayer.ts";
|
|
4
4
|
export class AppChanges extends Context.Service()("@shivaedev/platform/AppChanges") {
|
|
@@ -6,12 +6,12 @@ export class AppChanges extends Context.Service()("@shivaedev/platform/AppChange
|
|
|
6
6
|
export function appDatabase(options) {
|
|
7
7
|
return databaseLayer(options, AppChanges);
|
|
8
8
|
}
|
|
9
|
-
export
|
|
9
|
+
export const appHost = (options) => {
|
|
10
10
|
if ("application" in options) {
|
|
11
|
-
return deferredHost(options.application, appDatabase(options));
|
|
11
|
+
return deferredHost(options.application, appDatabase(options)).pipe(Layer.provideMerge(options.preflight ?? Layer.empty));
|
|
12
12
|
}
|
|
13
13
|
return options.migrations === undefined
|
|
14
|
-
? appHostHttp(options)
|
|
15
|
-
: migratedHost({ ...options, migrations: options.migrations }, appDatabase({ ...options, migrations: options.migrations }));
|
|
16
|
-
}
|
|
14
|
+
? appHostHttp(options).pipe(Layer.provideMerge(options.preflight ?? Layer.empty))
|
|
15
|
+
: migratedHost({ ...options, migrations: options.migrations }, appDatabase({ ...options, migrations: options.migrations })).pipe(Layer.provideMerge(options.preflight ?? Layer.empty));
|
|
16
|
+
};
|
|
17
17
|
//# sourceMappingURL=appHost.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appHost.js","sourceRoot":"","sources":["../../src/server/appHost.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAe,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"appHost.js","sourceRoot":"","sources":["../../src/server/appHost.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAe,KAAK,EAAE,MAAM,QAAQ,CAAC;AAKrD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAAuB,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAK9E,MAAM,OAAO,UAAW,SAAQ,OAAO,CAAC,OAAO,EAAqD,CAAC,gCAAgC,CAAC;CAAG;AAMzI,MAAM,UAAU,WAAW,CAAI,OAA8B;IAC5D,OAAO,aAAa,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AAC3C,CAAC;AAwDD,MAAM,CAAC,MAAM,OAAO,GAAmB,CAgBtC,OAeC,EACA,EAAE;IACH,IAAI,aAAa,IAAI,OAAO,EAAE,CAAC;QAC9B,OAAO,YAAY,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3H,CAAC;IACD,OAAO,OAAO,CAAC,UAAU,KAAK,SAAS;QACtC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;QACjF,CAAC,CAAC,YAAY,CAAC,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,EAAE,WAAW,CAAC,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,IAAI,CAC9H,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,IAAI,KAAK,CAAC,KAAK,CAAC,CACpD,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -3,11 +3,14 @@ import { Config, Effect, Layer } from "effect";
|
|
|
3
3
|
import { HttpRouter } from "effect/http";
|
|
4
4
|
import { type Rpc, RpcSerialization } from "effect/rpc";
|
|
5
5
|
import type { RequestTracing } from "#rpc/middleware.ts";
|
|
6
|
-
import type {
|
|
6
|
+
import type { AppHttpHostOptions } from "#server/appHost.ts";
|
|
7
7
|
import type { databaseLayer } from "#server/databaseLayer.ts";
|
|
8
8
|
import type { HostOptions, HostPolicy } from "#server/hostOptions.ts";
|
|
9
|
+
import type { MigrationOptions } from "#server/MigrationOptions.ts";
|
|
9
10
|
import { type SessionShape } from "#server/rpc-server/session.ts";
|
|
10
11
|
export declare function appHostHttp<TRpcs extends Rpc.Any, THandlers, THandlerError, THandlerRequirements, TServices, TServiceError, TServiceRequirements, TSession extends SessionShape>(options: HostOptions<TRpcs, THandlers, THandlerError, THandlerRequirements, TServices, TServiceError, TServiceRequirements> & HostPolicy<TSession>): Layer.Layer<TServices | import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices, TServiceError | Config.ConfigError | import("effect/PlatformError").PlatformError | import("effect/http/HttpServerError").ServeError | HttpRouter.Request.Without<THandlerError>, Exclude<Exclude<Exclude<TServiceRequirements, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<import("effect/FileSystem").FileSystem, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpPlatform").HttpPlatform, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpServer").HttpServer, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<import("effect/Path").Path, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<THandlerRequirements, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<Exclude<HttpRouter.HttpRouter, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<Exclude<RpcSerialization.RpcSerialization, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Rpc.ServicesServer<Rpc.AddMiddleware<TRpcs, typeof RequestTracing>>, import("effect/Scope").Scope>, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Rpc.ToHandler<Rpc.AddMiddleware<TRpcs, typeof RequestTracing>>, import("effect/Scope").Scope>, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"Requires", Exclude<THandlerRequirements, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"Requires", Exclude<Exclude<HttpRouter.HttpRouter, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"Requires", Exclude<Exclude<RpcSerialization.RpcSerialization, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"Requires", Exclude<Exclude<Exclude<Rpc.ServicesServer<Rpc.AddMiddleware<TRpcs, typeof RequestTracing>>, import("effect/Scope").Scope>, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"Requires", Exclude<Exclude<Exclude<Rpc.ToHandler<Rpc.AddMiddleware<TRpcs, typeof RequestTracing>>, import("effect/Scope").Scope>, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Without<Exclude<THandlerRequirements, RpcSerialization.RpcSerialization>>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Without<Exclude<Exclude<HttpRouter.HttpRouter, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Without<Exclude<Exclude<RpcSerialization.RpcSerialization, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Without<Exclude<Exclude<Exclude<Rpc.ServicesServer<Rpc.AddMiddleware<TRpcs, typeof RequestTracing>>, import("effect/Scope").Scope>, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Without<Exclude<Exclude<Exclude<Rpc.ToHandler<Rpc.AddMiddleware<TRpcs, typeof RequestTracing>>, import("effect/Scope").Scope>, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never>>;
|
|
11
|
-
export declare function migratedHost<TRpcs extends Rpc.Any, THandlers, THandlerError, THandlerRequirements, TServices, TServiceError, TServiceRequirements, TMigrations, TSession extends SessionShape>(options: AppHostOptions<TRpcs, THandlers, THandlerError, THandlerRequirements, TServices, TServiceError, TServiceRequirements, TMigrations, TSession> | AppLocalHostOptions<TRpcs, THandlers, THandlerError, THandlerRequirements, TServices, TServiceError, TServiceRequirements, TMigrations>, database: ReturnType<typeof databaseLayer<TMigrations>>): Layer.Layer<TServices | import("#server/appHost.ts").AppChanges | import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient | NodeServices.NodeServices, TServiceError | Config.ConfigError | import("effect/sql/Migrator").MigrationError | import("effect/PlatformError").PlatformError | import("effect/http/HttpServerError").ServeError | import("effect/sql/SqlError").SqlError | HttpRouter.Request.Without<THandlerError>, Exclude<Exclude<Exclude<Exclude<TServiceRequirements, import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<import("effect/FileSystem").FileSystem, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpPlatform").HttpPlatform, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpServer").HttpServer, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<import("effect/Path").Path, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<TMigrations, import("effect/Scope").Scope>, import("@effect/sql-pg/PgClient").PgClient | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<THandlerRequirements, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<Exclude<HttpRouter.HttpRouter, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<Exclude<RpcSerialization.RpcSerialization, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Rpc.ServicesServer<Rpc.AddMiddleware<TRpcs, typeof RequestTracing>>, import("effect/Scope").Scope>, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Rpc.ToHandler<Rpc.AddMiddleware<TRpcs, typeof RequestTracing>>, import("effect/Scope").Scope>, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"Requires", Exclude<THandlerRequirements, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"Requires", Exclude<Exclude<HttpRouter.HttpRouter, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"Requires", Exclude<Exclude<RpcSerialization.RpcSerialization, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"Requires", Exclude<Exclude<Exclude<Rpc.ServicesServer<Rpc.AddMiddleware<TRpcs, typeof RequestTracing>>, import("effect/Scope").Scope>, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"Requires", Exclude<Exclude<Exclude<Rpc.ToHandler<Rpc.AddMiddleware<TRpcs, typeof RequestTracing>>, import("effect/Scope").Scope>, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Without<Exclude<THandlerRequirements, RpcSerialization.RpcSerialization>>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Without<Exclude<Exclude<HttpRouter.HttpRouter, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Without<Exclude<Exclude<RpcSerialization.RpcSerialization, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Without<Exclude<Exclude<Exclude<Rpc.ServicesServer<Rpc.AddMiddleware<TRpcs, typeof RequestTracing>>, import("effect/Scope").Scope>, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Without<Exclude<Exclude<Exclude<Rpc.ToHandler<Rpc.AddMiddleware<TRpcs, typeof RequestTracing>>, import("effect/Scope").Scope>, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never>>;
|
|
12
|
+
export declare function migratedHost<TRpcs extends Rpc.Any, THandlers, THandlerError, THandlerRequirements, TServices, TServiceError, TServiceRequirements, TMigrations, TSession extends SessionShape>(options: HostOptions<TRpcs, THandlers, THandlerError, THandlerRequirements, TServices, TServiceError, TServiceRequirements> & HostPolicy<TSession> & {
|
|
13
|
+
readonly migrations: MigrationOptions<TMigrations>;
|
|
14
|
+
}, database: ReturnType<typeof databaseLayer<TMigrations>>): Layer.Layer<TServices | import("#server/appHost.ts").AppChanges | import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient | NodeServices.NodeServices, TServiceError | Config.ConfigError | import("effect/sql/Migrator").MigrationError | import("effect/PlatformError").PlatformError | import("effect/http/HttpServerError").ServeError | import("effect/sql/SqlError").SqlError | HttpRouter.Request.Without<THandlerError>, Exclude<Exclude<Exclude<Exclude<TServiceRequirements, import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<import("effect/FileSystem").FileSystem, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpPlatform").HttpPlatform, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpServer").HttpServer, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<import("effect/Path").Path, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<TMigrations, import("effect/Scope").Scope>, import("@effect/sql-pg/PgClient").PgClient | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<THandlerRequirements, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<Exclude<HttpRouter.HttpRouter, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<Exclude<RpcSerialization.RpcSerialization, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Rpc.ServicesServer<Rpc.AddMiddleware<TRpcs, typeof RequestTracing>>, import("effect/Scope").Scope>, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Rpc.ToHandler<Rpc.AddMiddleware<TRpcs, typeof RequestTracing>>, import("effect/Scope").Scope>, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"Requires", Exclude<THandlerRequirements, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"Requires", Exclude<Exclude<HttpRouter.HttpRouter, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"Requires", Exclude<Exclude<RpcSerialization.RpcSerialization, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"Requires", Exclude<Exclude<Exclude<Rpc.ServicesServer<Rpc.AddMiddleware<TRpcs, typeof RequestTracing>>, import("effect/Scope").Scope>, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"Requires", Exclude<Exclude<Exclude<Rpc.ToHandler<Rpc.AddMiddleware<TRpcs, typeof RequestTracing>>, import("effect/Scope").Scope>, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Without<Exclude<THandlerRequirements, RpcSerialization.RpcSerialization>>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Without<Exclude<Exclude<HttpRouter.HttpRouter, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Without<Exclude<Exclude<RpcSerialization.RpcSerialization, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Without<Exclude<Exclude<Exclude<Rpc.ServicesServer<Rpc.AddMiddleware<TRpcs, typeof RequestTracing>>, import("effect/Scope").Scope>, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Without<Exclude<Exclude<Exclude<Rpc.ToHandler<Rpc.AddMiddleware<TRpcs, typeof RequestTracing>>, import("effect/Scope").Scope>, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.HttpRouter>, TServices | import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never>>;
|
|
12
15
|
export declare function deferredHost<TRpcs extends Rpc.Any, THandlers, THandlerError, THandlerRequirements, TServices, TServiceError, TServiceRequirements, TMigrations, TSession extends SessionShape, TApplicationError, TApplicationRequirements>(application: Effect.Effect<AppHttpHostOptions<TRpcs, THandlers, THandlerError, THandlerRequirements, TServices, TServiceError, TServiceRequirements, TSession>, TApplicationError, TApplicationRequirements>, database: ReturnType<typeof databaseLayer<TMigrations>>): Layer.Layer<TServices | import("#server/appHost.ts").AppChanges | import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient | NodeServices.NodeServices, TApplicationError | TServiceError | Config.ConfigError | import("effect/sql/Migrator").MigrationError | import("effect/PlatformError").PlatformError | import("effect/http/HttpServerError").ServeError | import("effect/sql/SqlError").SqlError | HttpRouter.Request.Without<THandlerError>, Exclude<Exclude<TApplicationRequirements, import("effect/Scope").Scope>, import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<TMigrations, import("effect/Scope").Scope>, import("@effect/sql-pg/PgClient").PgClient | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<TServiceRequirements, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never>, import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/FileSystem").FileSystem, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never>, import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpPlatform").HttpPlatform, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never>, import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpServer").HttpServer, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never>, import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/Path").Path, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never>, import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<THandlerRequirements, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never>, import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<Exclude<HttpRouter.HttpRouter, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never>, import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<Exclude<RpcSerialization.RpcSerialization, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never>, import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Rpc.ServicesServer<Rpc.AddMiddleware<TRpcs, typeof RequestTracing>>, import("effect/Scope").Scope>, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never>, import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Rpc.ToHandler<Rpc.AddMiddleware<TRpcs, typeof RequestTracing>>, import("effect/Scope").Scope>, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never>, import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"Requires", Exclude<THandlerRequirements, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never>, import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"Requires", Exclude<Exclude<HttpRouter.HttpRouter, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never>, import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"Requires", Exclude<Exclude<RpcSerialization.RpcSerialization, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never>, import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"Requires", Exclude<Exclude<Exclude<Rpc.ServicesServer<Rpc.AddMiddleware<TRpcs, typeof RequestTracing>>, import("effect/Scope").Scope>, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never>, import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"Requires", Exclude<Exclude<Exclude<Rpc.ToHandler<Rpc.AddMiddleware<TRpcs, typeof RequestTracing>>, import("effect/Scope").Scope>, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.GlobalProvided>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never>, import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Without<Exclude<THandlerRequirements, RpcSerialization.RpcSerialization>>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never>, import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Without<Exclude<Exclude<HttpRouter.HttpRouter, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never>, import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Without<Exclude<Exclude<RpcSerialization.RpcSerialization, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never>, import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Without<Exclude<Exclude<Exclude<Rpc.ServicesServer<Rpc.AddMiddleware<TRpcs, typeof RequestTracing>>, import("effect/Scope").Scope>, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never>, import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Without<Exclude<Exclude<Exclude<Rpc.ToHandler<Rpc.AddMiddleware<TRpcs, typeof RequestTracing>>, import("effect/Scope").Scope>, THandlers | RequestTracing>, RpcSerialization.RpcSerialization>>, HttpRouter.HttpRouter>, TServices>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | NodeServices.NodeServices>, NodeServices.NodeServices>, never>, import("#server/appHost.ts").AppChanges | import("@effect/sql-pg/PgClient").PgClient | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>>;
|
|
13
16
|
//# sourceMappingURL=appHostHttp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appHostHttp.d.ts","sourceRoot":"","sources":["../../src/server/appHostHttp.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAY,MAAM,EAAE,MAAM,EAAE,KAAK,EAAkB,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAuB,UAAU,EAAuC,MAAM,aAAa,CAAC;AACnG,OAAO,EAAE,KAAK,GAAG,EAAE,gBAAgB,EAAa,MAAM,YAAY,CAAC;AACnE,OAAO,KAAK,EAAqC,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC5F,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"appHostHttp.d.ts","sourceRoot":"","sources":["../../src/server/appHostHttp.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAY,MAAM,EAAE,MAAM,EAAE,KAAK,EAAkB,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAuB,UAAU,EAAuC,MAAM,aAAa,CAAC;AACnG,OAAO,EAAE,KAAK,GAAG,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GAAG,CAAC,GAAG,EACrB,SAAS,EACT,aAAa,EACb,oBAAoB,EACpB,SAAS,EACT,aAAa,EACb,oBAAoB,EACpB,WAAW,EACX,QAAQ,SAAS,YAAY,EAC7B,iBAAiB,EACjB,wBAAwB,EAExB,WAAW,EAAE,MAAM,CAAC,MAAM,CACzB,kBAAkB,CAAC,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,oBAAoB,EAAE,SAAS,EAAE,aAAa,EAAE,oBAAoB,EAAE,QAAQ,CAAC,EACnI,iBAAiB,EACjB,wBAAwB,CACxB,EACD,QAAQ,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,WAAW,CAAC,CAAC,88ZAGvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appHostHttp.js","sourceRoot":"","sources":["../../src/server/appHostHttp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACnG,OAAO,EAAY,gBAAgB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"appHostHttp.js","sourceRoot":"","sources":["../../src/server/appHostHttp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,QA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AC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;AAC3F,CAAC;AAED,MAAM,UAAU,YAAY,CAa3B,WAIC,EACD,QAAuD;IAEvD,OAAO,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;AACpH,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type BetterAuthOptions } from "better-auth";
|
|
2
|
+
import { Config, Effect, Redacted } from "effect";
|
|
3
|
+
import { HttpRouter } from "effect/http";
|
|
4
|
+
import { Pool } from "pg";
|
|
5
|
+
export declare const betterAuthMount: <const TOptions extends BetterAuthOptions>(options: TOptions) => Effect.Effect<{
|
|
6
|
+
auth: import("better-auth").Auth<TOptions & {
|
|
7
|
+
advanced: {
|
|
8
|
+
disableCSRFCheck?: boolean | undefined;
|
|
9
|
+
disableOriginCheck?: boolean | undefined;
|
|
10
|
+
crossSubDomainCookies?: {
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
additionalCookies?: string[];
|
|
13
|
+
domain?: string;
|
|
14
|
+
} | undefined;
|
|
15
|
+
cookies?: {
|
|
16
|
+
[key: string]: {
|
|
17
|
+
name?: string;
|
|
18
|
+
attributes?: import("better-auth").CookieOptions;
|
|
19
|
+
};
|
|
20
|
+
} | undefined;
|
|
21
|
+
defaultCookieAttributes?: import("better-auth").CookieOptions | undefined;
|
|
22
|
+
cookiePrefix?: string | undefined;
|
|
23
|
+
database?: {
|
|
24
|
+
defaultFindManyLimit?: number;
|
|
25
|
+
generateId?: import("better-auth").GenerateIdFn | false | "serial" | "uuid";
|
|
26
|
+
joins?: boolean;
|
|
27
|
+
validateSchema?: boolean;
|
|
28
|
+
} | undefined;
|
|
29
|
+
trustedProxyHeaders?: boolean | undefined;
|
|
30
|
+
backgroundTasks?: {
|
|
31
|
+
handler: (promise: Promise<unknown>) => void;
|
|
32
|
+
};
|
|
33
|
+
skipTrailingSlashes?: boolean;
|
|
34
|
+
useSecureCookies: boolean | undefined;
|
|
35
|
+
ipAddress: {
|
|
36
|
+
disableIpTracking?: boolean;
|
|
37
|
+
ipv6Subnet?: number;
|
|
38
|
+
ipAddressHeaders: string[];
|
|
39
|
+
trustedProxies: string[];
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
baseURL: import("better-auth").BaseURLConfig;
|
|
43
|
+
rateLimit: {
|
|
44
|
+
window?: number | undefined;
|
|
45
|
+
max?: number | undefined;
|
|
46
|
+
modelName?: "rateLimit" | import("better-auth").LiteralString;
|
|
47
|
+
fields?: Partial<Record<"count" | "key" | "lastRequest", string>>;
|
|
48
|
+
customRules?: {
|
|
49
|
+
[key: string]: import("better-auth").BetterAuthRateLimitRule | false | ((request: Request, currentRule: import("better-auth").BetterAuthRateLimitRule) => import("better-auth").Awaitable<false | import("better-auth").BetterAuthRateLimitRule>);
|
|
50
|
+
} | undefined;
|
|
51
|
+
storage?: ("memory" | "database" | "secondary-storage") | undefined;
|
|
52
|
+
customStorage?: import("better-auth").BetterAuthRateLimitStorage;
|
|
53
|
+
enabled: boolean;
|
|
54
|
+
};
|
|
55
|
+
secret: string;
|
|
56
|
+
trustedOrigins: string[] | ((request?: Request | undefined) => import("better-auth").Awaitable<(string | undefined | null)[]>);
|
|
57
|
+
}>;
|
|
58
|
+
routes: import("effect/Layer").Layer<never, never, HttpRouter.HttpRouter>;
|
|
59
|
+
}, Config.ConfigError, never>;
|
|
60
|
+
export declare const authDatabase: (url: Redacted.Redacted<string>) => Effect.Effect<Pool, never, import("effect/Scope").Scope>;
|
|
61
|
+
//# sourceMappingURL=mount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../../src/server/better-auth/mount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAc,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAU,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAyC,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE,IAAI,EAAmB,MAAM,IAAI,CAAC;AAG3C,eAAO,MAAM,eAAe,SAA0D,QAAQ,SAAS,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAsCtH,CAAC;AAEH,eAAO,MAAM,YAAY,8FAqBvB,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { betterAuth } from "better-auth";
|
|
2
|
+
import { Config, Effect, Option, Redacted } from "effect";
|
|
3
|
+
import { HttpRouter, HttpServerRequest, HttpServerResponse } from "effect/http";
|
|
4
|
+
import { Pool } from "pg";
|
|
5
|
+
import { trustedProxyPeer, trustedProxyRanges } from "#server/rpc-server/local.ts";
|
|
6
|
+
export const betterAuthMount = Effect.fn("Platform.betterAuthMount")(function* (options) {
|
|
7
|
+
const secret = options.secret ?? Redacted.value(yield* Config.Redacted("BETTER_AUTH_SECRET"));
|
|
8
|
+
const publicUrl = yield* Config.URL("PUBLIC_URL").pipe(Config.option);
|
|
9
|
+
const origin = Option.map(publicUrl, (url) => url.origin);
|
|
10
|
+
const trustedProxy = Option.getOrUndefined(yield* Config.String("TRUSTED_PROXY").pipe(Config.option));
|
|
11
|
+
const clientIpHeader = yield* Config.String("AUTH_CLIENT_IP_HEADER").pipe(Config.withDefault("x-forwarded-for"));
|
|
12
|
+
const rateLimitEnabled = yield* Config.Boolean("AUTH_RATE_LIMIT_ENABLED").pipe(Config.withDefault(true));
|
|
13
|
+
const isTrustedProxy = trustedProxyPeer(trustedProxy);
|
|
14
|
+
const trustedProxies = trustedProxyRanges(trustedProxy);
|
|
15
|
+
const auth = betterAuth({
|
|
16
|
+
...options,
|
|
17
|
+
advanced: {
|
|
18
|
+
useSecureCookies: Option.isSome(publicUrl) && publicUrl.value.protocol === "https:",
|
|
19
|
+
...options.advanced,
|
|
20
|
+
ipAddress: {
|
|
21
|
+
...options.advanced?.ipAddress,
|
|
22
|
+
ipAddressHeaders: trustedProxies.length === 0 ? [] : [clientIpHeader],
|
|
23
|
+
trustedProxies,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
"baseURL": options.baseURL ?? Option.getOrElse(origin, () => ({ allowedHosts: ["127.0.0.1:*"], protocol: "http" })),
|
|
27
|
+
rateLimit: { ...options.rateLimit, enabled: rateLimitEnabled },
|
|
28
|
+
secret,
|
|
29
|
+
trustedOrigins: options.trustedOrigins ?? [Option.getOrElse(origin, () => "http://127.0.0.1:*")],
|
|
30
|
+
});
|
|
31
|
+
const routes = HttpRouter.use((router) => router.add("*", "/api/auth/*", (request) => Effect.gen(function* () {
|
|
32
|
+
const web = yield* HttpServerRequest.toWeb(request);
|
|
33
|
+
if (!Option.exists(request.remoteAddress, isTrustedProxy)) {
|
|
34
|
+
web.headers.delete("x-forwarded-for");
|
|
35
|
+
web.headers.delete(clientIpHeader);
|
|
36
|
+
}
|
|
37
|
+
return HttpServerResponse.fromWeb(yield* Effect.tryPromise(() => auth.handler(web)));
|
|
38
|
+
}).pipe(Effect.catch(() => Effect.succeed(HttpServerResponse.text("Authentication is temporarily unavailable", { status: 503 }))))));
|
|
39
|
+
return { auth, routes };
|
|
40
|
+
});
|
|
41
|
+
export const authDatabase = Effect.fn("Platform.authDatabase")(function* (url) {
|
|
42
|
+
const clients = new Set();
|
|
43
|
+
const run = Effect.runForkWith(yield* Effect.context());
|
|
44
|
+
return yield* Effect.acquireRelease(Effect.sync(() => {
|
|
45
|
+
const pool = new Pool({ connectionString: Redacted.value(url) });
|
|
46
|
+
pool.on("connect", (client) => clients.add(client));
|
|
47
|
+
pool.on("remove", (client) => clients.delete(client));
|
|
48
|
+
pool.on("error", (error) => {
|
|
49
|
+
run(Effect.logDebug({ event: "auth_database_idle_client_failed", message: error.message }));
|
|
50
|
+
});
|
|
51
|
+
return pool;
|
|
52
|
+
}), (pool) => Effect.promise(async () => {
|
|
53
|
+
// pg-pool resolves end before its clients finish disconnecting.
|
|
54
|
+
const disconnected = [...clients].map((client) => new Promise((resolve) => client.once("end", resolve)));
|
|
55
|
+
await pool.end();
|
|
56
|
+
await Promise.all(disconnected);
|
|
57
|
+
}));
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=mount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mount.js","sourceRoot":"","sources":["../../../src/server/better-auth/mount.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,UAAU,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE,IAAI,EAAmB,MAAM,IAAI,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEnF,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAC,QAAQ,CAAC,EAA4C,OAAiB;IAC1I,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAC9F,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACtE,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,GA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AAC;QACjB,MAAM,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACjC,CAAC,CAAC,CACH,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { testUtils } from "better-auth/plugins";
|
|
2
|
+
export declare function authTestUtils(options?: Parameters<typeof testUtils>[0]): {
|
|
3
|
+
id: "test-utils";
|
|
4
|
+
version: string;
|
|
5
|
+
options: import("better-auth/plugins").TestUtilsOptions;
|
|
6
|
+
init(context: Parameters<(ctx: import("better-auth").AuthContext) => {
|
|
7
|
+
context: {
|
|
8
|
+
test: import("better-auth/plugins").TestHelpers;
|
|
9
|
+
};
|
|
10
|
+
options: {
|
|
11
|
+
databaseHooks: {
|
|
12
|
+
verification: {
|
|
13
|
+
create: {
|
|
14
|
+
after(verification: {
|
|
15
|
+
identifier: string;
|
|
16
|
+
value: string;
|
|
17
|
+
} | null): Promise<void>;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
} | undefined;
|
|
22
|
+
}>[0]): {
|
|
23
|
+
context: {
|
|
24
|
+
test: import("better-auth/plugins").TestHelpers;
|
|
25
|
+
};
|
|
26
|
+
options?: never;
|
|
27
|
+
} | {
|
|
28
|
+
context: {
|
|
29
|
+
test: import("better-auth/plugins").TestHelpers;
|
|
30
|
+
};
|
|
31
|
+
options: {
|
|
32
|
+
databaseHooks: {
|
|
33
|
+
verification: {
|
|
34
|
+
create: {
|
|
35
|
+
after(verification: {
|
|
36
|
+
identifier: string;
|
|
37
|
+
value: string;
|
|
38
|
+
} | null): Promise<void>;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
type TestContext = ReturnType<ReturnType<typeof authTestUtils>["init"]>["context"];
|
|
46
|
+
export declare function signedInUser(auth: {
|
|
47
|
+
readonly $context: Promise<TestContext>;
|
|
48
|
+
}, fields: Parameters<TestContext["test"]["createUser"]>[0]): Promise<import("better-auth/plugins").LoginResult>;
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=testing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../src/server/better-auth/testing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;;;;kBAIvD,UAAU;;;;;;;;;;;;;;;;MAAoB,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;EAMhD;AAED,KAAK,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AAEnF,wBAAsB,YAAY,CAAC,IAAI,EAAE;IAAE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;CAAE,EAAE,MAAM,EAAE,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,sDAI7I"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { testUtils } from "better-auth/plugins";
|
|
2
|
+
export function authTestUtils(options) {
|
|
3
|
+
const plugin = testUtils(options);
|
|
4
|
+
return {
|
|
5
|
+
...plugin,
|
|
6
|
+
init(context) {
|
|
7
|
+
const result = plugin.init(context);
|
|
8
|
+
// Remove this wrapper once Better Auth's testUtils omits undefined options.
|
|
9
|
+
return result.options === undefined ? { context: result.context } : { context: result.context, options: result.options };
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export async function signedInUser(auth, fields) {
|
|
14
|
+
const { test } = await auth.$context;
|
|
15
|
+
const user = await test.saveUser(test.createUser(fields));
|
|
16
|
+
return test.login({ userId: user.id });
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=testing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing.js","sourceRoot":"","sources":["../../../src/server/better-auth/testing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,MAAM,UAAU,aAAa,CAAC,OAAyC;IACtE,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;IAClC,OAAO;QACN,GAAG,MAAM;QACT,IAAI,CAAC,OAA0C;YAC9C,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACpC,4EAA4E;YAC5E,OAAO,MAAM,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;QAC1H,CAAC;KACD,CAAC;AACH,CAAC;AAID,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,IAAiD,EAAE,MAAwD;IAC7I,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC;IACrC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1D,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as PgClient from "@effect/sql-pg/PgClient";
|
|
2
2
|
import { Config, Layer, type Redacted } from "effect";
|
|
3
3
|
import * as Reactivity from "effect/reactivity/Reactivity";
|
|
4
|
+
import type { SqlNameTransforms } from "@shivaedev/effect-sql/clientOptions.ts";
|
|
4
5
|
import { type PostgresChangesOptions } from "@shivaedev/effect-sql/postgresChanges.ts";
|
|
5
6
|
import type { AppChanges, AppDatabaseOptions } from "#server/appHost.ts";
|
|
6
|
-
export interface DatabaseConfig {
|
|
7
|
+
export interface DatabaseConfig extends SqlNameTransforms {
|
|
7
8
|
readonly applicationName?: string;
|
|
8
9
|
readonly changes?: Omit<PostgresChangesOptions, "client" | "resync">;
|
|
9
10
|
readonly databaseUrl?: Redacted.Redacted<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"databaseLayer.d.ts","sourceRoot":"","sources":["../../src/server/databaseLayer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAU,KAAK,EAAE,KAAK,QAAQ,EAAY,MAAM,QAAQ,CAAC;AACxE,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"databaseLayer.d.ts","sourceRoot":"","sources":["../../src/server/databaseLayer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAU,KAAK,EAAE,KAAK,QAAQ,EAAY,MAAM,QAAQ,CAAC;AACxE,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAG3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAEhF,OAAO,EAAE,KAAK,sBAAsB,EAAmB,MAAM,0CAA0C,CAAC;AACxG,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAGzE,MAAM,WAAW,cAAe,SAAQ,iBAAiB;IACxD,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,sBAAsB,EAAE,QAAQ,GAAG,QAAQ,CAAC,CAAC;IACrE,QAAQ,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjD,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,OAAO,UAAU,+UA4BjG"}
|
|
@@ -10,6 +10,8 @@ export function databaseLayer(options, changesService) {
|
|
|
10
10
|
const pool = Layer.unwrap(Effect.gen(function* () {
|
|
11
11
|
const url = options.config?.databaseUrl ?? (yield* Config.Redacted("DATABASE_URL"));
|
|
12
12
|
return PgClient.layer({
|
|
13
|
+
transformQueryNames: options.config?.transformQueryNames,
|
|
14
|
+
transformResultNames: options.config?.transformResultNames,
|
|
13
15
|
url,
|
|
14
16
|
...databaseAddress(url),
|
|
15
17
|
...(options.config?.maxConnections === undefined ? {} : { maxConnections: options.config.maxConnections }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"databaseLayer.js","sourceRoot":"","sources":["../../src/server/databaseLayer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAiB,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACxE,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAC9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,mDAAmD,CAAC;
|
|
1
|
+
{"version":3,"file":"databaseLayer.js","sourceRoot":"","sources":["../../src/server/databaseLayer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAiB,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACxE,OAAO,KAAK,UAAU,MAAM,8B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/C,MAAM,CAAC,KAAK,CAAC;QACZ,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,YAAY,IAAI,UAAU,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,IAAI,WAAW,CAAC,CAAC,CAAC;QACxI,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,gBAAgB,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU;KAC9E,CAAC,CACF,CAAC;AACH,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { AuthUnavailable, Unauthorized } from "#errors/taxonomy.ts";
|
|
1
3
|
import type { ProviderAccountValue } from "#rpc/identity.ts";
|
|
2
4
|
import type { SessionProvider, SessionShape } from "#server/rpc-server/session.ts";
|
|
3
5
|
export type GetSession<TSession extends SessionShape> = (headers: globalThis.Headers) => Promise<TSession | null>;
|
|
4
6
|
export type GetProviderAccounts = (headers: globalThis.Headers) => Promise<readonly ProviderAccountValue[]>;
|
|
5
7
|
export type SessionWithProviderAccounts<TSession extends SessionShape> = TSession & {
|
|
6
8
|
readonly user: TSession["user"] & {
|
|
7
|
-
readonly providerAccounts: readonly ProviderAccountValue[]
|
|
9
|
+
readonly providerAccounts: Effect.Effect<readonly ProviderAccountValue[], AuthUnavailable | Unauthorized>;
|
|
8
10
|
};
|
|
9
11
|
};
|
|
10
12
|
export declare function betterAuthSessions<TSession extends SessionShape>(getSession: GetSession<TSession>): SessionProvider<TSession>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"betterAuthSessions.d.ts","sourceRoot":"","sources":["../../../../src/server/rpc-server/adapters/betterAuthSessions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"betterAuthSessions.d.ts","sourceRoot":"","sources":["../../../../src/server/rpc-server/adapters/betterAuthSessions.ts"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ailable, Unauthorized } from "#errors/taxonomy.ts";
|
|
3
3
|
import { redact } from "#server/rpc-server/redact.ts";
|
|
4
4
|
function unavailable(cause) {
|
|
5
5
|
return Effect.andThen(Effect.logError("Authentication provider failed", redact(cause)), Effect.fail(new AuthUnavailable({ message: "Authentication is temporarily unavailable" })));
|
|
6
6
|
}
|
|
7
7
|
export function betterAuthSessions(getSession, getProviderAccounts) {
|
|
8
8
|
const betterAuthSession = Effect.fn("PlatformRpc.betterAuthSession")(function* (headers) {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (accounts === null) {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
return {
|
|
25
|
-
...resolved,
|
|
26
|
-
user: { ...resolved.user, providerAccounts: accounts },
|
|
27
|
-
};
|
|
28
|
-
}).pipe(Effect.catch((error) => unavailable(error.cause)));
|
|
29
|
-
return Option.fromNullishOr(session);
|
|
9
|
+
const transport = new globalThis.Headers(headers);
|
|
10
|
+
const session = yield* Effect.tryPromise(() => getSession(transport)).pipe(Effect.catch((error) => unavailable(error.cause)));
|
|
11
|
+
if (session === null || getProviderAccounts === undefined) {
|
|
12
|
+
return Option.fromNullishOr(session);
|
|
13
|
+
}
|
|
14
|
+
const providerAccounts = Effect.tryPromise({
|
|
15
|
+
catch: (cause) => cause,
|
|
16
|
+
try: () => getProviderAccounts(transport),
|
|
17
|
+
}).pipe(Effect.catch((cause) => Predicate.hasProperty(cause, "statusCode") && cause.statusCode === 401
|
|
18
|
+
? Effect.fail(new Unauthorized({ message: "Authentication required" }))
|
|
19
|
+
: unavailable(cause)));
|
|
20
|
+
return Option.some({ ...session, user: { ...session.user, providerAccounts } });
|
|
30
21
|
});
|
|
31
22
|
return { get: betterAuthSession };
|
|
32
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"betterAuthSessions.js","sourceRoot":"","sources":["../../../../src/server/rpc-server/adapters/betterAuthSessions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"betterAuthSessions.js","sourceRoot":"","sources":["../../../../src/server/rpc-server/adapters/betterAuthSessions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEpE,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAOtD,SAAS,WAAW,CAAC,KAAc;IAClC,OAAO,MAAM,CAAC,OAAO,CACpB,MAAM,CAAC,QAAQ,CAAC,gCAAgC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,EAChE,MAAM,CAAC,IAAI,CAAC,IAAI,eAAe,CAAC,EAAE,OAAO,EAAE,2CAA2C,EAAE,CAAC,CAAC,CAC1F,CAAC;AACH,CAAC;AAMD,MAAM,UAAU,kBAAkB,CAAgC,UAAgC,EAAE,mBAAyC;IAC5I,MAAM,iBAAiB,GAAG,MAAM,CAAC,EAAE,CAAC,+BAA+B,CAAC,CAAC,QAAQ,CAAC,EAAE,OAAwB;QACvG,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAClD,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC9H,IAAI,OAAO,KAAK,IAAI,IAAI,mBAAmB,KAAK,SAAS,EAAE,CAAC;YAC3D,OAAO,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QACD,MAAM,gBAAgB,GAAG,MAAM,CAAC,UAAU,CAAC;YAC1C,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK;YACvB,GAAG,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,SAAS,CAAC;SACzC,CAAC,CAAC,IAAI,CACN,MAAM,CAAC,KAAK,CACX,CAAC,KAAK,EAAwD,EAAE,CAC/D,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,YAAY,CAAC,IAAI,KAAK,CAAC,UAAU,KAAK,GAAG;YACrE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,YAAY,CAAC,EAAE,OAAO,EAAE,yBAAyB,EAAE,CAAC,CAAC;YACvE,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CACtB,CACD,CAAC;QACF,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;IACjF,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,GAAG,EAAE,iBAAiB,EAAE,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Config, type ConfigProvider } from "effect";
|
|
2
|
+
import type { publicConfig } from "#rpc/publicConfig.ts";
|
|
3
|
+
export declare function publicConfigLayer<T, E>(declaration: ReturnType<typeof publicConfig<T, E>>, path?: string | ConfigProvider.Path): import("effect/Layer").Layer<import("effect/rpc/Rpc").Handler<"platform.publicConfig.get">, Config.ConfigError, never>;
|
|
4
|
+
//# sourceMappingURL=publicConfigLayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publicConfigLayer.d.ts","sourceRoot":"","sources":["../../../src/server/rpc-server/publicConfigLayer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,cAAc,EAAU,MAAM,QAAQ,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC,IAAI,0HAO9H"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Config, Effect } from "effect";
|
|
2
|
+
export function publicConfigLayer(declaration, path) {
|
|
3
|
+
return declaration.toLayer(Effect.gen(function* () {
|
|
4
|
+
const value = yield* Config.schema(declaration.declaration.queries[0].success, path);
|
|
5
|
+
return declaration.of({ "platform.publicConfig.get": () => Effect.succeed(value) });
|
|
6
|
+
}));
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=publicConfigLayer.js.map
|