@shivaedev/server 0.33.4 → 0.34.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 +15 -0
- package/README.md +30 -3
- package/dist/AppModule.d.ts +17 -3
- package/dist/AppModule.d.ts.map +1 -1
- package/dist/HandWrittenModuleHandlers.d.ts +10 -0
- package/dist/HandWrittenModuleHandlers.d.ts.map +1 -0
- package/dist/HandWrittenModuleHandlers.js +10 -0
- package/dist/HandWrittenModuleHandlers.js.map +1 -0
- package/dist/appDatabaseHttp.d.ts +2 -2
- package/dist/appHost.d.ts +1 -1
- package/dist/appHostHttp.d.ts +1 -1
- package/dist/appModules.d.ts +16 -3
- package/dist/appModules.d.ts.map +1 -1
- package/dist/appModules.js +6 -2
- package/dist/appModules.js.map +1 -1
- package/dist/hostRpcRoutes.d.ts +1 -1
- package/dist/hostRpcRoutes.d.ts.map +1 -1
- package/dist/hostRpcRoutes.js +2 -0
- package/dist/hostRpcRoutes.js.map +1 -1
- package/dist/rerunQuery.d.ts.map +1 -1
- package/dist/rerunQuery.js +4 -1
- package/dist/rerunQuery.js.map +1 -1
- package/dist/servedModules.d.ts +9 -0
- package/dist/servedModules.d.ts.map +1 -0
- package/dist/servedModules.js +30 -0
- package/dist/servedModules.js.map +1 -0
- package/package.json +29 -29
- package/src/AppModule.ts +14 -3
- package/src/HandWrittenModuleHandlers.ts +10 -0
- package/src/appModules.ts +34 -5
- package/src/hostRpcRoutes.ts +2 -0
- package/src/rerunQuery.ts +6 -1
- package/src/servedModules.ts +35 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.34.0 - 2026-11-11
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- An `AppModule` registration can name a module built with `defineModule` as `module: Notes` instead of `group` plus `handlers`; `appModules` builds its group and its handlers with `moduleHandlers`, and both forms can sit in one application. The `group` plus `handlers` form is being retired.
|
|
8
|
+
- The host refuses to start with `HandWrittenModuleHandlers` when a query of a defined module is served by anything but its generated handler, naming the module and each affected query, and `AppModule` refuses a defined module as `group` at compile time.
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Nothing a query's read policy records during a live rerun counts, for queries served by hand-written handlers too.
|
|
13
|
+
|
|
14
|
+
### Breaking
|
|
15
|
+
|
|
16
|
+
- `appModules` refuses at compile time a registration whose type lost a defined module's `requires`: one annotated `: AppModule`, returned by a helper typed `AppModule`, or whose `module` is typed `RegisteredModule`. Such a registration used to compile with generated handlers that required nothing, so a missing module service failed only when an operation ran. A `group` plus `handlers` registration annotated `: AppModule` is refused too, because its type is the same. To migrate either kind, declare the registration with `satisfies AppModule` instead of the annotation, or write the object literal directly in the list passed to `appModules`; a helper returns its inferred type instead of `AppModule`.
|
|
17
|
+
|
|
3
18
|
## 0.33.4 - 2026-11-10
|
|
4
19
|
|
|
5
20
|
### Changed
|
package/README.md
CHANGED
|
@@ -84,7 +84,7 @@ Host option types include this HTTP-only shape. A wrapper that reads native RPC
|
|
|
84
84
|
|
|
85
85
|
`appHost` is the server entry point for an Effect app. For a PostgreSQL app, supply the native RPC group, handler and service Layers, migration loader, session policy and static asset directory. The host completes migrations before acquiring application services, starts Node HTTP with native Effect RPC over a WebSocket upgrade at `/rpc`, and provides SQL, Reactivity and `LiveServer` from `@shivaedev/contract/live-server/service.ts` to those Layers.
|
|
86
86
|
|
|
87
|
-
For feature modules, install the optional peer `@shivaedev/admin` and declare each registration with `satisfies AppModule` from `@shivaedev/server/AppModule.ts`. Each module supplies a diagnostic `name`,
|
|
87
|
+
For feature modules, install the optional peer `@shivaedev/admin` and declare each registration with `satisfies AppModule` from `@shivaedev/server/AppModule.ts`. Each module supplies a diagnostic `name`, its operations, `services` and `migrations: { loader, components? }`. Register caller-dependent Layers in the optional `requestServices` slot beside global `services`. Keep default adapters in its optional `ports` Layer, put an optional `registerAdmin` result in `admin`, and declare owned `queues` and a `workers` Layer on the module. `jobModule` from `@shivaedev/jobs/server/jobModule.ts` supplies those two fields from a jobs registration list.
|
|
88
88
|
|
|
89
89
|
```ts
|
|
90
90
|
import { Effect } from "effect";
|
|
@@ -102,6 +102,33 @@ const hosts = Effect.gen(function* () {
|
|
|
102
102
|
});
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
+
A module defined with `defineModule` from `@shivaedev/contract/defineModule.ts` registers as `module:`, and the host builds its group and its handlers with `moduleHandlers`. Its `services` provide what the module's `requires` lists, except the SQL client and the other services the host provides. A module written as a contract with hand-written handlers registers as `group` plus `handlers`; that form is being retired, and both forms can sit in one application while it moves one module at a time:
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
import { Layer } from "effect";
|
|
109
|
+
import { Migrator, SqlClient } from "effect/sql";
|
|
110
|
+
import { defineModule } from "@shivaedev/contract/defineModule.ts";
|
|
111
|
+
import type { AppModule } from "@shivaedev/server/AppModule.ts";
|
|
112
|
+
import { Create, Get } from "./notes/operations.ts";
|
|
113
|
+
import { Drafts, readDraft } from "./drafts.ts";
|
|
114
|
+
|
|
115
|
+
export const Notes = defineModule({ name: "notes", operations: [Create, Get], requires: [SqlClient.SqlClient] });
|
|
116
|
+
|
|
117
|
+
export const notes = { migrations: { loader: Migrator.fromRecord({}) }, module: Notes, name: "notes", services: Layer.empty } satisfies AppModule;
|
|
118
|
+
|
|
119
|
+
export const drafts = {
|
|
120
|
+
group: Drafts,
|
|
121
|
+
handlers: Drafts.application.toLayer({ "drafts.read": readDraft }),
|
|
122
|
+
migrations: { loader: Migrator.fromRecord({}) },
|
|
123
|
+
name: "drafts",
|
|
124
|
+
services: Layer.empty,
|
|
125
|
+
} satisfies AppModule;
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
A defined module's generated handlers check each query's read policy with the module's services. Hand-written handlers would move that check to the host's read-policy guard, in the handlers' own context, so a defined module would have two paths. `AppModule` refuses a defined module as `group` at compile time, and the host refuses to start when any query of a defined module is served by another handler: it fails with `HandWrittenModuleHandlers` from `@shivaedev/server/HandWrittenModuleHandlers.ts`, whose `module`, `queries` and `message` name the module, each affected query and the `module:` registration to use instead. Fakes in this repository's own stories opt out through `replacedModuleHandlers` in the package's test support, which is not published.
|
|
129
|
+
|
|
130
|
+
`appModules` reads a defined module's `requires` from its registration's own type, so it refuses a registration typed as `AppModule`, returned by a helper typed that way, or whose `module` is typed as `RegisteredModule`: that type has lost the services the module's handlers need. A `group` plus `handlers` registration typed as `AppModule` is refused too, because its type is the same. Declare the registration with `satisfies AppModule` instead.
|
|
131
|
+
|
|
105
132
|
`appModules` returns an Effect that rejects duplicate queue names before building any host. `DuplicateModuleQueue` from `@shivaedev/server/DuplicateModuleQueue.ts` identifies `queue`, `firstModule` and `secondModule`; repeating a name within one module also fails. It combines the native RPC groups, handler Layers, migration loaders and schema components. It includes each admin registration's group and handlers and exposes their merged registry as `modules.admin`. Migration numbers belong to one application-wide sequence. Existing hosts can continue to supply their groups, handlers, services and migrations directly.
|
|
106
133
|
|
|
107
134
|
The host builds `services` once for its lifetime and builds `requestServices` once per RPC call, including each call on a persistent WebSocket connection. Native RPC middleware supplies the request services after the contract's identity middleware resolves the caller. Declare `selfSubject` or `accountSubject` on contracts whose request services require `Subject`, `SessionUser` and `Identity`. Request services yield global dependencies from the enclosing environment; leave those global Layers out of the request Layer so they are reused. `appModules` rejects global services that require caller context or a service registered in the request slot.
|
|
@@ -303,7 +330,7 @@ Both JSON and protobuf export serialization apply sensitive-key and credential-t
|
|
|
303
330
|
|
|
304
331
|
Set `config.maxConnections` on `appDatabase` or a migrated `appHost` to bound the PostgreSQL pool. The host composes sql's [`postgresLayer`](https://github.com/ShivaeDev/platform/blob/main/packages/sql/README.md#one-postgresql-pool-per-application), exposing the native `PgPool` service alongside `PgClient` and `SqlClient`. Application services that need raw connections read `PgPool` from `@effect/sql-pg/PgPool`; reservations share the client's connection budget. The change listener reserves one connection; when transactions hold the remaining connections, another query waits until a transaction releases its connection. A daemon with long-lived RPC streams can use `config.disablePreemptiveShutdown: true` so scope closure interrupts an active HTTP RPC stream and runs its finalizer before host disposal completes, without waiting for Node's preemptive graceful-shutdown timeout. Omitting it keeps Node's native graceful-shutdown default.
|
|
305
332
|
|
|
306
|
-
The host defaults to `config.connectionTTL: "10 minutes"` and `config.idleTimeout: "1 minute"`. Both accept native Effect durations; `config.minConnections` controls the idle floor. Lifetime expiry replaces a query connection on its next checkout, allowing active queries and transactions to finish. The reserved change listener stays connected past the pool lifetime, including with a separate listener URL.
|
|
333
|
+
The host defaults to `config.connectionTTL: "10 minutes"` and `config.idleTimeout: "1 minute"`. Both accept native Effect durations; `config.minConnections` controls the idle floor. Lifetime expiry replaces a query connection on its next checkout, allowing active queries and transactions to finish. The reserved change listener stays connected past the pool lifetime, including with a separate listener URL. No PostgreSQL `idle_session_timeout` is set: an idle LISTEN session must stay alive.
|
|
307
334
|
|
|
308
335
|
Database pool maintenance, worker-release coordination and change-listener heartbeats, deadlines and retries use the live clock. A story can advance its application clock by days while the host and job worker keep running; handlers and jobs still see the advanced application time. For stories about database lifecycle timers, pass the story's native `Clock.Clock` service as `config.clock` on `appDatabase` or `appHost`. This option applies to worker-release timers and both application and separate listener pools; it does not change the application clock or migration wait timers.
|
|
309
336
|
|
|
@@ -500,7 +527,7 @@ For lifecycle observations, acquire `hostProcessReadouts` from `@shivaedev/test-
|
|
|
500
527
|
|
|
501
528
|
Wrap disposal of the host scope or runtime with `readouts.shutdown(dispose)`, then acknowledge the application's shutdown signal. `shutdownDuration()` returns `null` before shutdown completes and elapsed milliseconds afterwards, including finalizer time. The parent retains the completed shutdown's readouts after the child process and its owning scope close; `activeWork()` then returns the work that was active when shutdown began. Forced termination without a completed shutdown report cannot provide these observations.
|
|
502
529
|
|
|
503
|
-
To
|
|
530
|
+
To run the child against PostgreSQL, pass a redacted `databaseUrl` to `hostProcess`. The kit gives the child that URL through `DATABASE_URL`; the child must use that setting. This mode uses the explicit `env` record plus `DATABASE_URL` as the child's environment.
|
|
504
531
|
|
|
505
532
|
### PostgreSQL server settings
|
|
506
533
|
|
package/dist/AppModule.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import type { Layer, Pipeable } from "effect";
|
|
2
2
|
import type { RpcGroup } from "effect/rpc";
|
|
3
3
|
import type { AnyAdminRegistry } from "@shivaedev/admin/registry.ts";
|
|
4
|
+
import type { AnyModule } from "@shivaedev/contract/moduleHandlers.ts";
|
|
4
5
|
import type { MigrationOptions } from "#MigrationOptions.ts";
|
|
5
6
|
export type ModuleLayer = Layer.Any & Pipeable.Pipeable;
|
|
6
7
|
export type ModuleAdmin = AnyAdminRegistry & {
|
|
7
8
|
readonly handlers: ModuleLayer;
|
|
8
9
|
};
|
|
9
|
-
|
|
10
|
+
interface ModuleParts {
|
|
10
11
|
readonly admin?: ModuleAdmin;
|
|
11
|
-
readonly group: RpcGroup.Any;
|
|
12
|
-
readonly handlers: ModuleLayer;
|
|
13
12
|
readonly migrations: Pick<MigrationOptions<unknown, unknown>, "loader" | "components">;
|
|
14
13
|
readonly name: string;
|
|
15
14
|
readonly ports?: ModuleLayer;
|
|
@@ -20,4 +19,19 @@ export interface AppModule {
|
|
|
20
19
|
readonly services: ModuleLayer;
|
|
21
20
|
readonly workers?: ModuleLayer;
|
|
22
21
|
}
|
|
22
|
+
export type AppModule = (ModuleParts & {
|
|
23
|
+
readonly group: RpcGroup.Any & {
|
|
24
|
+
readonly "~requires"?: never;
|
|
25
|
+
};
|
|
26
|
+
readonly handlers: ModuleLayer;
|
|
27
|
+
readonly module?: never;
|
|
28
|
+
}) | (ModuleParts & {
|
|
29
|
+
readonly group?: never;
|
|
30
|
+
readonly handlers?: never;
|
|
31
|
+
readonly module: RegisteredModule;
|
|
32
|
+
});
|
|
33
|
+
export type RegisteredModule = RpcGroup.Any & Pick<AnyModule, "application" | "declaration"> & {
|
|
34
|
+
readonly "~requires": unknown;
|
|
35
|
+
};
|
|
36
|
+
export {};
|
|
23
37
|
//# sourceMappingURL=AppModule.d.ts.map
|
package/dist/AppModule.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppModule.d.ts","sourceRoot":"","sources":["../src/AppModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,GAAG,GAAG,QAAQ,CAAC,QAAQ,CAAC;AACxD,MAAM,MAAM,WAAW,GAAG,gBAAgB,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAA;CAAE,CAAC;AAEhF,
|
|
1
|
+
{"version":3,"file":"AppModule.d.ts","sourceRoot":"","sources":["../src/AppModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,GAAG,GAAG,QAAQ,CAAC,QAAQ,CAAC;AACxD,MAAM,MAAM,WAAW,GAAG,gBAAgB,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAA;CAAE,CAAC;AAEhF,UAAU,WAAW;IACpB,QAAQ,CAAC,KAAK,CAAC,EAAE,W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are const HandWrittenModuleHandlers_base: Schema.Class<HandWrittenModuleHandlers, Schema.TaggedStruct<"HandWrittenModuleHandlers", {
|
|
3
|
+
readonly module: Schema.String;
|
|
4
|
+
readonly queries: Schema.$Array<Schema.String>;
|
|
5
|
+
}>, import("effect/Cause").YieldableError>;
|
|
6
|
+
export declare class HandWrittenModuleHandlers extends HandWrittenModuleHandlers_base {
|
|
7
|
+
get message(): string;
|
|
8
|
+
}
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=HandWrittenModuleHandlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HandWrittenModuleHandlers.d.ts","sourceRoot":"","sources":["../src/HandWrittenModuleHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;;;;;AAEhC,qBAAa,yBAA0B,SAAQ,8BAG7C;IACD,IAAa,OAAO,WAEnB;CACD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export class HandWrittenModuleHandlers extends Schema.TaggedError()("HandWrittenModuleHandlers", {
|
|
3
|
+
module: Schema.String,
|
|
4
|
+
queries: Schema.Array(Schema.String),
|
|
5
|
+
}) {
|
|
6
|
+
get message() {
|
|
7
|
+
return `Module "${this.module}" serves ${this.queries.join(", ")} through hand-written handlers instead of its generated ones, which check each query's read policy with the module's services. Register it as \`module:\` instead of \`group\` and \`handlers\`.`;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=HandWrittenModuleHandlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HandWrittenModuleHandlers.js","sourceRoot":"","sources":["../src/HandWrittenModuleHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,OAAO,yBAA0B,SAAQ,MAAM,CAAC,WAAW,EAA6B,CAAC,2BAA2B,EAAE;IAC3H,MAAM,EAAE,MAAM,CAAC,MAAM;IACrB,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;CACpC,CAAC;IACD,IAAa,OAAO;QACnB,OAAO,WAAW,IAAI,CAAC,MAAM,YAAY,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,kMAAkM,CAAC;IACpQ,CAAC;CACD"}
|
|
@@ -6,7 +6,7 @@ import type { HostOptions, HostPolicy, HostRouteRequirements } from "#hostOption
|
|
|
6
6
|
import type { MigrationOptions } from "#MigrationOptions.ts";
|
|
7
7
|
export declare function migratedHost<TRpcs extends Rpc.Any, THandlers, THandlerError, THandlerRequirements, TServices, TServiceError, TServiceRequirements, TMigrations, TRouteError = never, TRouteRequirements = HostRouteRequirements, TMigrationError = never, TRequestServices = never, TRequestRequirements = never>(options: HostOptions<TRpcs, THandlers, THandlerError, THandlerRequirements, TServices, TServiceError, TServiceRequirements, TRouteError, TRouteRequirements, TRequestServices, TRequestRequirements> & HostPolicy & {
|
|
8
8
|
readonly migrations: MigrationOptions<TMigrations, TMigrationError>;
|
|
9
|
-
}, database: ReturnType<typeof appDatabase<TMigrations, TMigrationError>>): Layer.Layer<"@shivaedev/contract/LiveServer" | TServices | import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient | import("@effect/platform-node/NodeServices").NodeServices, TMigrationError | TServiceError | import("effect/Config").ConfigError | Error | import("@shivaedev/errors/wireMask.ts").InvalidRedactionMask | import("effect/sql/Migrator").MigrationError | import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicies | import("effect/PlatformError").PlatformError | import("@shivaedev/sql/PostgresListenerError.ts").PostgresListenerError | import("effect/Schema").SchemaError | import("@shivaedev/errors/schemaFieldScope.ts").SensitiveFieldConflict | import("effect/sql/SqlError").SqlError | import("./TrustedProxyRequired.ts").TrustedProxyRequired | import("effect/http/HttpRouter").Request.Without<THandlerError> | import("effect/http/HttpRouter").Request.Without<TRouteError>, import("effect/crypto/Digest").Digest | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<TServiceRequirements, "@shivaedev/contract/LiveServer" | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpPlatform").HttpPlatform, "@shivaedev/contract/LiveServer" | TServices | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/crypto/SecureRandom").SecureRandom, "@shivaedev/contract/LiveServer" | TServices | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<TMigrations, import("effect/Scope").Scope>, "@shivaedev/contract/LiveServer" | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<THandlerRequirements, TRequestServices>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, "@shivaedev/contract/LiveServer" | TServices | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy, TRequestRequirements | TRequestServices>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, "@shivaedev/contract/LiveServer" | TServices | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Exclude<TRouteRequirements, never>, never>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, "@shivaedev/contract/LiveServer" | TServices | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Exclude<Exclude<THandlerRequirements, Rpc.Handler<"platform.hostVersion.watch">>, import("effect/rpc/RpcSerialization").RpcSerialization>, TRequestRequirements | TRequestServices>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, "@shivaedev/contract/LiveServer" | TServices | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").HttpRouter, THandlers | import("@shivaedev/identity/middleware.ts").RequestTracing | import("@shivaedev/identity/subject.ts").SubjectResolver | Rpc.ToHandler<Extract<TRpcs, {
|
|
9
|
+
}, database: ReturnType<typeof appDatabase<TMigrations, TMigrationError>>): Layer.Layer<"@shivaedev/contract/LiveServer" | TServices | import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient | import("@effect/platform-node/NodeServices").NodeServices, TMigrationError | TServiceError | import("effect/Config").ConfigError | Error | import("./HandWrittenModuleHandlers.ts").HandWrittenModuleHandlers | import("@shivaedev/errors/wireMask.ts").InvalidRedactionMask | import("effect/sql/Migrator").MigrationError | import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicies | import("effect/PlatformError").PlatformError | import("@shivaedev/sql/PostgresListenerError.ts").PostgresListenerError | import("effect/Schema").SchemaError | import("@shivaedev/errors/schemaFieldScope.ts").SensitiveFieldConflict | import("effect/sql/SqlError").SqlError | import("./TrustedProxyRequired.ts").TrustedProxyRequired | import("effect/http/HttpRouter").Request.Without<THandlerError> | import("effect/http/HttpRouter").Request.Without<TRouteError>, import("effect/crypto/Digest").Digest | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<TServiceRequirements, "@shivaedev/contract/LiveServer" | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpPlatform").HttpPlatform, "@shivaedev/contract/LiveServer" | TServices | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/crypto/SecureRandom").SecureRandom, "@shivaedev/contract/LiveServer" | TServices | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<TMigrations, import("effect/Scope").Scope>, "@shivaedev/contract/LiveServer" | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<THandlerRequirements, TRequestServices>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, "@shivaedev/contract/LiveServer" | TServices | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy, TRequestRequirements | TRequestServices>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, "@shivaedev/contract/LiveServer" | TServices | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Exclude<TRouteRequirements, never>, never>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, "@shivaedev/contract/LiveServer" | TServices | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Exclude<Exclude<THandlerRequirements, Rpc.Handler<"platform.hostVersion.watch">>, import("effect/rpc/RpcSerialization").RpcSerialization>, TRequestRequirements | TRequestServices>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, "@shivaedev/contract/LiveServer" | TServices | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").HttpRouter, THandlers | import("@shivaedev/identity/middleware.ts").RequestTracing | import("@shivaedev/identity/subject.ts").SubjectResolver | Rpc.ToHandler<Extract<TRpcs, {
|
|
10
10
|
readonly _tag: `${string}.$changes`;
|
|
11
11
|
}>>>, Rpc.Handler<"platform.hostVersion.watch">>, import("effect/rpc/RpcSerialization").RpcSerialization>, TRequestRequirements | TRequestServices>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, "@shivaedev/contract/LiveServer" | TServices | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request<"Requires", import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, THandlers | import("@shivaedev/identity/middleware.ts").RequestTracing | import("@shivaedev/identity/subject.ts").SubjectResolver | Rpc.ToHandler<Extract<TRpcs, {
|
|
12
12
|
readonly _tag: `${string}.$changes`;
|
|
@@ -127,7 +127,7 @@ export declare function migratedHost<TRpcs extends Rpc.Any, THandlers, THandlerE
|
|
|
127
127
|
}>, `${string}.$changes`>, THandlers>, Rpc.Handler<"platform.hostVersion.watch">>, import("effect/rpc/RpcSerialization").RpcSerialization>, TRequestRequirements | TRequestServices>, never>, never>>, import("effect/http/HttpRouter").HttpRouter>, import("effect/Scope").Scope>, "@shivaedev/contract/LiveServer" | TServices | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Without<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Rpc.ToHandler<Exclude<TRpcs, {
|
|
128
128
|
readonly _tag: `${string}.$changes`;
|
|
129
129
|
}>>, THandlers>, Rpc.Handler<"platform.hostVersion.watch">>, import("effect/rpc/RpcSerialization").RpcSerialization>, TRequestRequirements | TRequestServices>, never>, never>>, import("effect/http/HttpRouter").HttpRouter>, import("effect/Scope").Scope>, "@shivaedev/contract/LiveServer" | TServices | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Without<Exclude<Exclude<import("./requestServices.ts").RequestRequirements<TRpcs, TRequestRequirements>, never>, never>>, import("effect/http/HttpRouter").HttpRouter>, import("effect/Scope").Scope>, "@shivaedev/contract/LiveServer" | TServices | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>>;
|
|
130
|
-
export declare function deferredHost<TRpcs extends Rpc.Any, THandlers, THandlerError, THandlerRequirements, TServices, TServiceError, TServiceRequirements, TMigrations, TApplicationError, TApplicationRequirements, TRouteError = never, TRouteRequirements = HostRouteRequirements, TMigrationError = never, TRequestServices = never, TRequestRequirements = never>(application: Effect.Effect<AppHttpHostOptions<TRpcs, THandlers, THandlerError, THandlerRequirements, TServices, TServiceError, TServiceRequirements, never, never, never, TRouteError, TRouteRequirements, TRequestServices, TRequestRequirements>, TApplicationError, TApplicationRequirements>, database: ReturnType<typeof appDatabase<TMigrations, TMigrationError>>): Layer.Layer<"@shivaedev/contract/LiveServer" | TServices | import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient | import("@effect/platform-node/NodeServices").NodeServices, TApplicationError | TMigrationError | TServiceError | import("effect/Config").ConfigError | Error | import("@shivaedev/errors/wireMask.ts").InvalidRedactionMask | import("effect/sql/Migrator").MigrationError | import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicies | import("effect/PlatformError").PlatformError | import("@shivaedev/sql/PostgresListenerError.ts").PostgresListenerError | import("effect/Schema").SchemaError | import("@shivaedev/errors/schemaFieldScope.ts").SensitiveFieldConflict | import("effect/sql/SqlError").SqlError | import("./TrustedProxyRequired.ts").TrustedProxyRequired | import("effect/http/HttpRouter").Request.Without<THandlerError> | import("effect/http/HttpRouter").Request.Without<TRouteError>, import("effect/crypto/Digest").Digest | Exclude<Exclude<TApplicationRequirements, import("effect/Scope").Scope>, "@shivaedev/contract/LiveServer" | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<TMigrations, import("effect/Scope").Scope>, "@shivaedev/contract/LiveServer" | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<TServiceRequirements, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, "@shivaedev/contract/LiveServer" | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpPlatform").HttpPlatform, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, "@shivaedev/contract/LiveServer" | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/crypto/SecureRandom").SecureRandom, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, "@shivaedev/contract/LiveServer" | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<THandlerRequirements, TRequestServices>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, "@shivaedev/contract/LiveServer" | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy, TRequestRequirements | TRequestServices>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, "@shivaedev/contract/LiveServer" | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Exclude<TRouteRequirements, never>, never>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, "@shivaedev/contract/LiveServer" | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Exclude<Exclude<THandlerRequirements, Rpc.Handler<"platform.hostVersion.watch">>, import("effect/rpc/RpcSerialization").RpcSerialization>, TRequestRequirements | TRequestServices>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, "@shivaedev/contract/LiveServer" | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").HttpRouter, THandlers | import("@shivaedev/identity/middleware.ts").RequestTracing | import("@shivaedev/identity/subject.ts").SubjectResolver | Rpc.ToHandler<Extract<TRpcs, {
|
|
130
|
+
export declare function deferredHost<TRpcs extends Rpc.Any, THandlers, THandlerError, THandlerRequirements, TServices, TServiceError, TServiceRequirements, TMigrations, TApplicationError, TApplicationRequirements, TRouteError = never, TRouteRequirements = HostRouteRequirements, TMigrationError = never, TRequestServices = never, TRequestRequirements = never>(application: Effect.Effect<AppHttpHostOptions<TRpcs, THandlers, THandlerError, THandlerRequirements, TServices, TServiceError, TServiceRequirements, never, never, never, TRouteError, TRouteRequirements, TRequestServices, TRequestRequirements>, TApplicationError, TApplicationRequirements>, database: ReturnType<typeof appDatabase<TMigrations, TMigrationError>>): Layer.Layer<"@shivaedev/contract/LiveServer" | TServices | import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient | import("@effect/platform-node/NodeServices").NodeServices, TApplicationError | TMigrationError | TServiceError | import("effect/Config").ConfigError | Error | import("./HandWrittenModuleHandlers.ts").HandWrittenModuleHandlers | import("@shivaedev/errors/wireMask.ts").InvalidRedactionMask | import("effect/sql/Migrator").MigrationError | import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicies | import("effect/PlatformError").PlatformError | import("@shivaedev/sql/PostgresListenerError.ts").PostgresListenerError | import("effect/Schema").SchemaError | import("@shivaedev/errors/schemaFieldScope.ts").SensitiveFieldConflict | import("effect/sql/SqlError").SqlError | import("./TrustedProxyRequired.ts").TrustedProxyRequired | import("effect/http/HttpRouter").Request.Without<THandlerError> | import("effect/http/HttpRouter").Request.Without<TRouteError>, import("effect/crypto/Digest").Digest | Exclude<Exclude<TApplicationRequirements, import("effect/Scope").Scope>, "@shivaedev/contract/LiveServer" | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<TMigrations, import("effect/Scope").Scope>, "@shivaedev/contract/LiveServer" | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<TServiceRequirements, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, "@shivaedev/contract/LiveServer" | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpPlatform").HttpPlatform, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, "@shivaedev/contract/LiveServer" | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/crypto/SecureRandom").SecureRandom, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, "@shivaedev/contract/LiveServer" | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<THandlerRequirements, TRequestServices>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, "@shivaedev/contract/LiveServer" | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy, TRequestRequirements | TRequestServices>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, "@shivaedev/contract/LiveServer" | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Exclude<TRouteRequirements, never>, never>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, "@shivaedev/contract/LiveServer" | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Exclude<Exclude<THandlerRequirements, Rpc.Handler<"platform.hostVersion.watch">>, import("effect/rpc/RpcSerialization").RpcSerialization>, TRequestRequirements | TRequestServices>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, "@shivaedev/contract/LiveServer" | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").HttpRouter, THandlers | import("@shivaedev/identity/middleware.ts").RequestTracing | import("@shivaedev/identity/subject.ts").SubjectResolver | Rpc.ToHandler<Extract<TRpcs, {
|
|
131
131
|
readonly _tag: `${string}.$changes`;
|
|
132
132
|
}>>>, Rpc.Handler<"platform.hostVersion.watch">>, import("effect/rpc/RpcSerialization").RpcSerialization>, TRequestRequirements | TRequestServices>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, "@shivaedev/contract/LiveServer" | import("@effect/sql-pg/PgClient").PgClient | import("@effect/sql-pg/PgPool").PgPool | import("effect/reactivity/Reactivity").Reactivity | import("effect/sql/SqlClient").SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request<"Requires", import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, THandlers | import("@shivaedev/identity/middleware.ts").RequestTracing | import("@shivaedev/identity/subject.ts").SubjectResolver | Rpc.ToHandler<Extract<TRpcs, {
|
|
133
133
|
readonly _tag: `${string}.$changes`;
|
package/dist/appHost.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { HostPreflight } from "#hostPreflight.ts";
|
|
|
5
5
|
export type AppHttpHostOptions<TRpcs extends Rpc.Any = never, THandlers = never, THandlerError = never, THandlerRequirements = never, TServices = never, TServiceError = never, TServiceRequirements = never, TPreflight = never, TPreflightError = never, TPreflightRequirements = never, TRouteError = never, TRouteRequirements = HostRouteRequirements, TRequestServices = never, TRequestRequirements = never> = HostPreflight<TPreflight, TPreflightError, TPreflightRequirements> & HostCoreOptions<TRpcs, THandlers, THandlerError, THandlerRequirements, TServices, TServiceError, TServiceRequirements, TRequestServices, TRequestRequirements> & HostRoutes<TRouteError, TRouteRequirements> & HostPolicy & {
|
|
6
6
|
readonly migrations?: undefined;
|
|
7
7
|
};
|
|
8
|
-
declare function buildHttpHost<TRpcs extends Rpc.Any = never, THandlers = never, THandlerError = never, THandlerRequirements = never, TServices = never, TServiceError = never, TServiceRequirements = never, TPreflight = never, TPreflightError = never, TPreflightRequirements = never, TRouteError = never, TRouteRequirements = HostRouteRequirements, TRequestServices = never, TRequestRequirements = never>(options: AppHttpHostOptions<TRpcs, THandlers, THandlerError, THandlerRequirements, TServices, TServiceError, TServiceRequirements, TPreflight, TPreflightError, TPreflightRequirements, TRouteError, TRouteRequirements, TRequestServices, TRequestRequirements>): Layer.Layer<TPreflight | TServices | import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices, TPreflightError | TServiceError | import("effect/Config").ConfigError | Error | import("@shivaedev/errors/wireMask.ts").InvalidRedactionMask | import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicies | import("effect/PlatformError").PlatformError | import("@shivaedev/errors/schemaFieldScope.ts").SensitiveFieldConflict | import("./TrustedProxyRequired.ts").TrustedProxyRequired | import("effect/http/HttpRouter").Request.Without<THandlerError> | import("effect/http/HttpRouter").Request.Without<TRouteError>, Exclude<Exclude<TPreflightRequirements, never>, import("effect/crypto/Aead").Aead | import("effect/crypto/Cipher").Cipher | import("effect/crypto/Digest").Digest | import("effect/crypto/Kdf").Kdf | import("effect/crypto/KeyAgreement").KeyAgreement | import("effect/crypto/KeyWrap").KeyWrap | import("effect/crypto/Mac").Mac | import("effect/crypto/SecureRandom").SecureRandom | import("effect/crypto/Signature").Signature> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<TServiceRequirements, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, TPreflight>, import("effect/crypto/Aead").Aead | import("effect/crypto/Cipher").Cipher | import("effect/crypto/Digest").Digest | import("effect/crypto/Kdf").Kdf | import("effect/crypto/KeyAgreement").KeyAgreement | import("effect/crypto/KeyWrap").KeyWrap | import("effect/crypto/Mac").Mac | import("effect/crypto/SecureRandom").SecureRandom | import("effect/crypto/Signature").Signature> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpPlatform").HttpPlatform, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, TPreflight>, import("effect/crypto/Aead").Aead | import("effect/crypto/Cipher").Cipher | import("effect/crypto/Digest").Digest | import("effect/crypto/Kdf").Kdf | import("effect/crypto/KeyAgreement").KeyAgreement | import("effect/crypto/KeyWrap").KeyWrap | import("effect/crypto/Mac").Mac | import("effect/crypto/SecureRandom").SecureRandom | import("effect/crypto/Signature").Signature> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/crypto/SecureRandom").SecureRandom, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, TPreflight>, import("effect/crypto/Aead").Aead | import("effect/crypto/Cipher").Cipher | import("effect/crypto/Digest").Digest | import("effect/crypto/Kdf").Kdf | import("effect/crypto/KeyAgreement").KeyAgreement | import("effect/crypto/KeyWrap").KeyWrap | import("effect/crypto/Mac").Mac | import("effect/crypto/SecureRandom").SecureRandom | import("effect/crypto/Signature").Signature> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<THandlerRequirements, TRequestServices>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, TPreflight>, import("effect/crypto/Aead").Aead | import("effect/crypto/Cipher").Cipher | import("effect/crypto/Digest").Digest | import("effect/crypto/Kdf").Kdf | import("effect/crypto/KeyAgreement").KeyAgreement | import("effect/crypto/KeyWrap").KeyWrap | import("effect/crypto/Mac").Mac | import("effect/crypto/SecureRandom").SecureRandom | import("effect/crypto/Signature").Signature> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy, TRequestRequirements | TRequestServices>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, TPreflight>, import("effect/crypto/Aead").Aead | import("effect/crypto/Cipher").Cipher | import("effect/crypto/Digest").Digest | import("effect/crypto/Kdf").Kdf | import("effect/crypto/KeyAgreement").KeyAgreement | import("effect/crypto/KeyWrap").KeyWrap | import("effect/crypto/Mac").Mac | import("effect/crypto/SecureRandom").SecureRandom | import("effect/crypto/Signature").Signature> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Exclude<TRouteRequirements, never>, never>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, TPreflight>, import("effect/crypto/Aead").Aead | import("effect/crypto/Cipher").Cipher | import("effect/crypto/Digest").Digest | import("effect/crypto/Kdf").Kdf | import("effect/crypto/KeyAgreement").KeyAgreement | import("effect/crypto/KeyWrap").KeyWrap | import("effect/crypto/Mac").Mac | import("effect/crypto/SecureRandom").SecureRandom | import("effect/crypto/Signature").Signature> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Exclude<Exclude<THandlerRequirements, Rpc.Handler<"platform.hostVersion.watch">>, import("effect/rpc/RpcSerialization").RpcSerialization>, TRequestRequirements | TRequestServices>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, TPreflight>, import("effect/crypto/Aead").Aead | import("effect/crypto/Cipher").Cipher | import("effect/crypto/Digest").Digest | import("effect/crypto/Kdf").Kdf | import("effect/crypto/KeyAgreement").KeyAgreement | import("effect/crypto/KeyWrap").KeyWrap | import("effect/crypto/Mac").Mac | import("effect/crypto/SecureRandom").SecureRandom | import("effect/crypto/Signature").Signature> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").HttpRouter, THandlers | import("@shivaedev/identity/middleware.ts").RequestTracing | import("@shivaedev/identity/subject.ts").SubjectResolver | Rpc.ToHandler<Extract<TRpcs, {
|
|
8
|
+
declare function buildHttpHost<TRpcs extends Rpc.Any = never, THandlers = never, THandlerError = never, THandlerRequirements = never, TServices = never, TServiceError = never, TServiceRequirements = never, TPreflight = never, TPreflightError = never, TPreflightRequirements = never, TRouteError = never, TRouteRequirements = HostRouteRequirements, TRequestServices = never, TRequestRequirements = never>(options: AppHttpHostOptions<TRpcs, THandlers, THandlerError, THandlerRequirements, TServices, TServiceError, TServiceRequirements, TPreflight, TPreflightError, TPreflightRequirements, TRouteError, TRouteRequirements, TRequestServices, TRequestRequirements>): Layer.Layer<TPreflight | TServices | import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices, TPreflightError | TServiceError | import("effect/Config").ConfigError | Error | import("./HandWrittenModuleHandlers.ts").HandWrittenModuleHandlers | import("@shivaedev/errors/wireMask.ts").InvalidRedactionMask | import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicies | import("effect/PlatformError").PlatformError | import("@shivaedev/errors/schemaFieldScope.ts").SensitiveFieldConflict | import("./TrustedProxyRequired.ts").TrustedProxyRequired | import("effect/http/HttpRouter").Request.Without<THandlerError> | import("effect/http/HttpRouter").Request.Without<TRouteError>, Exclude<Exclude<TPreflightRequirements, never>, import("effect/crypto/Aead").Aead | import("effect/crypto/Cipher").Cipher | import("effect/crypto/Digest").Digest | import("effect/crypto/Kdf").Kdf | import("effect/crypto/KeyAgreement").KeyAgreement | import("effect/crypto/KeyWrap").KeyWrap | import("effect/crypto/Mac").Mac | import("effect/crypto/SecureRandom").SecureRandom | import("effect/crypto/Signature").Signature> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<TServiceRequirements, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, TPreflight>, import("effect/crypto/Aead").Aead | import("effect/crypto/Cipher").Cipher | import("effect/crypto/Digest").Digest | import("effect/crypto/Kdf").Kdf | import("effect/crypto/KeyAgreement").KeyAgreement | import("effect/crypto/KeyWrap").KeyWrap | import("effect/crypto/Mac").Mac | import("effect/crypto/SecureRandom").SecureRandom | import("effect/crypto/Signature").Signature> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpPlatform").HttpPlatform, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, TPreflight>, import("effect/crypto/Aead").Aead | import("effect/crypto/Cipher").Cipher | import("effect/crypto/Digest").Digest | import("effect/crypto/Kdf").Kdf | import("effect/crypto/KeyAgreement").KeyAgreement | import("effect/crypto/KeyWrap").KeyWrap | import("effect/crypto/Mac").Mac | import("effect/crypto/SecureRandom").SecureRandom | import("effect/crypto/Signature").Signature> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/crypto/SecureRandom").SecureRandom, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, TPreflight>, import("effect/crypto/Aead").Aead | import("effect/crypto/Cipher").Cipher | import("effect/crypto/Digest").Digest | import("effect/crypto/Kdf").Kdf | import("effect/crypto/KeyAgreement").KeyAgreement | import("effect/crypto/KeyWrap").KeyWrap | import("effect/crypto/Mac").Mac | import("effect/crypto/SecureRandom").SecureRandom | import("effect/crypto/Signature").Signature> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<THandlerRequirements, TRequestServices>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, TPreflight>, import("effect/crypto/Aead").Aead | import("effect/crypto/Cipher").Cipher | import("effect/crypto/Digest").Digest | import("effect/crypto/Kdf").Kdf | import("effect/crypto/KeyAgreement").KeyAgreement | import("effect/crypto/KeyWrap").KeyWrap | import("effect/crypto/Mac").Mac | import("effect/crypto/SecureRandom").SecureRandom | import("effect/crypto/Signature").Signature> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy, TRequestRequirements | TRequestServices>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, TPreflight>, import("effect/crypto/Aead").Aead | import("effect/crypto/Cipher").Cipher | import("effect/crypto/Digest").Digest | import("effect/crypto/Kdf").Kdf | import("effect/crypto/KeyAgreement").KeyAgreement | import("effect/crypto/KeyWrap").KeyWrap | import("effect/crypto/Mac").Mac | import("effect/crypto/SecureRandom").SecureRandom | import("effect/crypto/Signature").Signature> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Exclude<TRouteRequirements, never>, never>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, TPreflight>, import("effect/crypto/Aead").Aead | import("effect/crypto/Cipher").Cipher | import("effect/crypto/Digest").Digest | import("effect/crypto/Kdf").Kdf | import("effect/crypto/KeyAgreement").KeyAgreement | import("effect/crypto/KeyWrap").KeyWrap | import("effect/crypto/Mac").Mac | import("effect/crypto/SecureRandom").SecureRandom | import("effect/crypto/Signature").Signature> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Exclude<Exclude<THandlerRequirements, Rpc.Handler<"platform.hostVersion.watch">>, import("effect/rpc/RpcSerialization").RpcSerialization>, TRequestRequirements | TRequestServices>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, TPreflight>, import("effect/crypto/Aead").Aead | import("effect/crypto/Cipher").Cipher | import("effect/crypto/Digest").Digest | import("effect/crypto/Kdf").Kdf | import("effect/crypto/KeyAgreement").KeyAgreement | import("effect/crypto/KeyWrap").KeyWrap | import("effect/crypto/Mac").Mac | import("effect/crypto/SecureRandom").SecureRandom | import("effect/crypto/Signature").Signature> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").HttpRouter, THandlers | import("@shivaedev/identity/middleware.ts").RequestTracing | import("@shivaedev/identity/subject.ts").SubjectResolver | Rpc.ToHandler<Extract<TRpcs, {
|
|
9
9
|
readonly _tag: `${string}.$changes`;
|
|
10
10
|
}>>>, Rpc.Handler<"platform.hostVersion.watch">>, import("effect/rpc/RpcSerialization").RpcSerialization>, TRequestRequirements | TRequestServices>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never>, TPreflight>, import("effect/crypto/Aead").Aead | import("effect/crypto/Cipher").Cipher | import("effect/crypto/Digest").Digest | import("effect/crypto/Kdf").Kdf | import("effect/crypto/KeyAgreement").KeyAgreement | import("effect/crypto/KeyWrap").KeyWrap | import("effect/crypto/Mac").Mac | import("effect/crypto/SecureRandom").SecureRandom | import("effect/crypto/Signature").Signature> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpRouter").Request<"Requires", import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, THandlers | import("@shivaedev/identity/middleware.ts").RequestTracing | import("@shivaedev/identity/subject.ts").SubjectResolver | Rpc.ToHandler<Extract<TRpcs, {
|
|
11
11
|
readonly _tag: `${string}.$changes`;
|
package/dist/appHostHttp.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Effect, Layer } from "effect";
|
|
|
2
2
|
import { HttpRouter, HttpServer } from "effect/http";
|
|
3
3
|
import type { Rpc } from "effect/rpc";
|
|
4
4
|
import type { HostOptions, HostPolicy, HostRouteRequirements } from "#hostOptions.ts";
|
|
5
|
-
export declare function appHostHttp<TRpcs extends Rpc.Any, THandlers, THandlerError, THandlerRequirements, TServices, TServiceError, TServiceRequirements, TRouteError = never, TRouteRequirements = HostRouteRequirements, TRequestServices = never, TRequestRequirements = never>(options: HostOptions<TRpcs, THandlers, THandlerError, THandlerRequirements, TServices, TServiceError, TServiceRequirements, TRouteError, TRouteRequirements, TRequestServices, TRequestRequirements> & HostPolicy): Layer.Layer<TServices | import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | HttpServer.HttpServer | import("@effect/platform-node/NodeServices").NodeServices, TServiceError | import("effect/Config").ConfigError | Error | import("@shivaedev/errors/wireMask.ts").InvalidRedactionMask | import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicies | import("effect/PlatformError").PlatformError | import("@shivaedev/errors/schemaFieldScope.ts").SensitiveFieldConflict | import("./TrustedProxyRequired.ts").TrustedProxyRequired | HttpRouter.Request.Without<THandlerError> | HttpRouter.Request.Without<TRouteError>, Exclude<Exclude<Exclude<Exclude<Exclude<TServiceRequirements, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpPlatform").HttpPlatform, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/crypto/SecureRandom").SecureRandom, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<THandlerRequirements, TRequestServices>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | HttpServer.HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy, TRequestRequirements | TRequestServices>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | HttpServer.HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Exclude<TRouteRequirements, never>, never>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | HttpServer.HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Exclude<Exclude<THandlerRequirements, Rpc.Handler<"platform.hostVersion.watch">>, import("effect/rpc/RpcSerialization").RpcSerialization>, TRequestRequirements | TRequestServices>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | HttpServer.HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.HttpRouter, THandlers | import("@shivaedev/identity/middleware.ts").RequestTracing | import("@shivaedev/identity/subject.ts").SubjectResolver | Rpc.ToHandler<Extract<TRpcs, {
|
|
5
|
+
export declare function appHostHttp<TRpcs extends Rpc.Any, THandlers, THandlerError, THandlerRequirements, TServices, TServiceError, TServiceRequirements, TRouteError = never, TRouteRequirements = HostRouteRequirements, TRequestServices = never, TRequestRequirements = never>(options: HostOptions<TRpcs, THandlers, THandlerError, THandlerRequirements, TServices, TServiceError, TServiceRequirements, TRouteError, TRouteRequirements, TRequestServices, TRequestRequirements> & HostPolicy): Layer.Layer<TServices | import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | HttpServer.HttpServer | import("@effect/platform-node/NodeServices").NodeServices, TServiceError | import("effect/Config").ConfigError | Error | import("./HandWrittenModuleHandlers.ts").HandWrittenModuleHandlers | import("@shivaedev/errors/wireMask.ts").InvalidRedactionMask | import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicies | import("effect/PlatformError").PlatformError | import("@shivaedev/errors/schemaFieldScope.ts").SensitiveFieldConflict | import("./TrustedProxyRequired.ts").TrustedProxyRequired | HttpRouter.Request.Without<THandlerError> | HttpRouter.Request.Without<TRouteError>, Exclude<Exclude<Exclude<Exclude<Exclude<TServiceRequirements, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/http/HttpPlatform").HttpPlatform, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<import("effect/crypto/SecureRandom").SecureRandom, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<THandlerRequirements, TRequestServices>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | HttpServer.HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy, TRequestRequirements | TRequestServices>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | HttpServer.HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Exclude<TRouteRequirements, never>, never>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | HttpServer.HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Exclude<Exclude<THandlerRequirements, Rpc.Handler<"platform.hostVersion.watch">>, import("effect/rpc/RpcSerialization").RpcSerialization>, TRequestRequirements | TRequestServices>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | HttpServer.HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.HttpRouter, THandlers | import("@shivaedev/identity/middleware.ts").RequestTracing | import("@shivaedev/identity/subject.ts").SubjectResolver | Rpc.ToHandler<Extract<TRpcs, {
|
|
6
6
|
readonly _tag: `${string}.$changes`;
|
|
7
7
|
}>>>, Rpc.Handler<"platform.hostVersion.watch">>, import("effect/rpc/RpcSerialization").RpcSerialization>, TRequestRequirements | TRequestServices>, never>, never>>, import("effect/http/HttpServerRequest").HttpServerRequest | import("effect/Scope").Scope>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | HttpServer.HttpServer | import("@effect/platform-node/NodeServices").NodeServices>, TServices>, import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("@effect/platform-node/NodeServices").NodeServices>, never>, never>, never> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request.Only<"GlobalRequires", Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<HttpRouter.Request<"Requires", import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy>, THandlers | import("@shivaedev/identity/middleware.ts").RequestTracing | import("@shivaedev/identity/subject.ts").SubjectResolver | Rpc.ToHandler<Extract<TRpcs, {
|
|
8
8
|
readonly _tag: `${string}.$changes`;
|
package/dist/appModules.d.ts
CHANGED
|
@@ -3,14 +3,27 @@ import { RpcGroup } from "effect/rpc";
|
|
|
3
3
|
import type { Migrator } from "effect/sql";
|
|
4
4
|
import type { AdminPage } from "@shivaedev/admin/page.ts";
|
|
5
5
|
import type { AdminRegistry } from "@shivaedev/admin/registry.ts";
|
|
6
|
+
import { type AnyModule, type ModuleHandlers } from "@shivaedev/contract/moduleHandlers.ts";
|
|
6
7
|
import type { SchemaComponent } from "@shivaedev/sql/SchemaComponent.ts";
|
|
7
8
|
import type { AppModule, ModuleAdmin } from "#AppModule.ts";
|
|
8
9
|
import { DuplicateModuleQueue } from "#DuplicateModuleQueue.ts";
|
|
9
10
|
import type { GlobalServices } from "#requestServices.ts";
|
|
10
11
|
type ModuleField<TModules, TKey extends PropertyKey> = TModules extends unknown ? (TKey extends keyof TModules ? TModules[TKey] : never) : never;
|
|
11
12
|
type Layers<TModules extends readonly AppModule[], TKey extends "handlers" | "services" | "ports" | "workers" | "requestServices"> = Extract<ModuleField<TModules[number], TKey>, Layer.Any>;
|
|
13
|
+
type ServedHandlers<TModule> = TModule extends {
|
|
14
|
+
readonly module: infer TDefined extends AnyModule;
|
|
15
|
+
} ? ModuleHandlers<TDefined> : never;
|
|
16
|
+
type WidenedModule<TModule> = TModule extends {
|
|
17
|
+
readonly module: infer TDefined;
|
|
18
|
+
} ? (TDefined extends AnyModule ? never : TModule) : never;
|
|
19
|
+
type ExactModules<TModules extends readonly AppModule[]> = number extends TModules["length"] ? unknown : {
|
|
20
|
+
readonly [TKey in keyof TModules]: [WidenedModule<TModules[TKey]>] extends [never] ? unknown : {
|
|
21
|
+
readonly "Declare a defined module's registration with satisfies AppModule so its type keeps the module's requires": never;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
type Groups<TModules extends readonly AppModule[]> = Extract<ModuleField<TModules[number], "group"> | ModuleField<TModules[number], "module">, RpcGroup.Any>;
|
|
12
25
|
type Admin<TModules extends readonly AppModule[]> = Extract<ModuleField<TModules[number], "admin">, ModuleAdmin>;
|
|
13
|
-
type Handlers<TModules extends readonly AppModule[]> = Layers<TModules, "handlers"> | Extract<ModuleField<Admin<TModules>, "handlers">, Layer.Any>;
|
|
26
|
+
type Handlers<TModules extends readonly AppModule[]> = Layers<TModules, "handlers"> | ServedHandlers<TModules[number]> | Extract<ModuleField<Admin<TModules>, "handlers">, Layer.Any>;
|
|
14
27
|
type Pages<TModules extends readonly AppModule[]> = Extract<ModuleField<Admin<TModules>, "pages">, readonly AdminPage[]>;
|
|
15
28
|
type Queues<TModules extends readonly AppModule[]> = Extract<ModuleField<TModules[number], "queues">, readonly {
|
|
16
29
|
readonly name: string;
|
|
@@ -24,13 +37,13 @@ type Services<TModules extends readonly AppModule[]> = Layers<TModules, "service
|
|
|
24
37
|
type MigrationRequirements<TModules extends readonly AppModule[]> = Effect.Services<TModules[number]["migrations"]["loader"]>;
|
|
25
38
|
type Components<T> = T extends readonly (infer TComponent extends SchemaComponent<unknown, unknown>)[] ? TComponent : never;
|
|
26
39
|
type ModuleComponents<TModules extends AppModule> = Components<ModuleField<TModules["migrations"], "components">>;
|
|
27
|
-
export declare function appModules<const TModules extends readonly AppModule[], R = never, E = never, TRequirements = never>(modules: TModules & GlobalServices<Layer.Services<Services<NoInfer<TModules>>>, Layer.Success<RequestServices<NoInfer<TModules
|
|
40
|
+
export declare function appModules<const TModules extends readonly AppModule[], R = never, E = never, TRequirements = never>(modules: TModules & GlobalServices<Layer.Services<Services<NoInfer<TModules>>>, Layer.Success<RequestServices<NoInfer<TModules>>>> & ExactModules<NoInfer<TModules>>, options?: {
|
|
28
41
|
readonly replacements?: Layer.Layer<R, E, TRequirements>;
|
|
29
42
|
}): Effect.Effect<{
|
|
30
43
|
readonly workers: Layer.Layer<Layer.Success<Layers<TModules, "workers">>, Layer.Error<Layers<TModules, "workers">>, Layer.Services<Layers<TModules, "workers">>>;
|
|
31
44
|
readonly queues: readonly Queues<TModules>[];
|
|
32
45
|
readonly admin: AdminRegistry<readonly Pages<TModules>[number][]>;
|
|
33
|
-
readonly group: RpcGroup.RpcGroup<RpcGroup.Rpcs<TModules
|
|
46
|
+
readonly group: RpcGroup.RpcGroup<RpcGroup.Rpcs<Groups<TModules> | ModuleField<Admin<TModules>, "group">>>;
|
|
34
47
|
readonly handlers: Layer.Layer<Layer.Success<Handlers<TModules>>, Layer.Error<Handlers<TModules>>, Layer.Services<Handlers<TModules>>>;
|
|
35
48
|
readonly requestServices: Layer.Layer<Layer.Success<Layers<TModules, "requestServices">>, never, Layer.Services<Layers<TModules, "requestServices">>>;
|
|
36
49
|
readonly services: Layer.Layer<Layer.Success<Services<TModules> | Ports<TModules>> | R, Layer.Error<Services<TModules> | Ports<TModules>> | E, Exclude<Layer.Services<Services<TModules>>, Layer.Success<Ports<TModules>> | R> | Layer.Services<Ports<TModules>> | TRequirements>;
|
package/dist/appModules.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appModules.d.ts","sourceRoot":"","sources":["../src/appModules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAoB,MAAM,8BAA8B,CAAC;AAEpF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAe,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,KAAK,WAAW,CAAC,QAAQ,EAAE,IAAI,SAAS,WAAW,IAAI,QAAQ,SAAS,OAAO,GAAG,CAAC,IAAI,SAAS,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC;AACjJ,KAAK,MAAM,CAAC,QAAQ,SAAS,SAAS,SAAS,EAAE,EAAE,IAAI,SAAS,UAAU,GAAG,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,iBAAiB,IAAI,OAAO,CAC3I,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,EACnC,KAAK,C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aAAa,CACjI,CAAC;IACF,QAAQ,CAAC,UAAU,EAAE;QACpB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC;QAClE,QAAQ,CAAC,UAAU,EAAE,SAAS,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;KACnE,CAAC;CACF,EACD,oBAAoB,CACpB,CAAC"}
|
package/dist/appModules.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Effect, Layer } from "effect";
|
|
2
2
|
import { RpcGroup } from "effect/rpc";
|
|
3
3
|
import { mergeAdminRegistrations } from "@shivaedev/admin/server/mergeAdminRegistrations.ts";
|
|
4
|
+
import { moduleHandlers } from "@shivaedev/contract/moduleHandlers.ts";
|
|
4
5
|
import { DuplicateModuleQueue } from "#DuplicateModuleQueue.ts";
|
|
5
6
|
export function appModules(modules, options) {
|
|
6
7
|
return composeModules(modules, options);
|
|
@@ -23,8 +24,11 @@ const composeModules = Effect.fnUntraced(function* (modules, options) {
|
|
|
23
24
|
const ports = Layer.merge(defaults, options?.replacements ?? Layer.empty);
|
|
24
25
|
return {
|
|
25
26
|
admin,
|
|
26
|
-
group: RpcGroup.make().merge(...modules.map((module) => module.group), admin.group),
|
|
27
|
-
|
|
27
|
+
group: RpcGroup.make().merge(...modules.map((module) => (module.module === undefined ? module.group : module.module)), admin.group),
|
|
28
|
+
// The overload types each module's handlers from its own requires; at run time moduleHandlers reads only its operations.
|
|
29
|
+
handlers: Layer.mergeAll(admin.handlers, ...modules.map((module) => module.module === undefined
|
|
30
|
+
? module.handlers
|
|
31
|
+
: moduleHandlers({ "~requires": [], application: module.module.application, declaration: module.module.declaration }))),
|
|
28
32
|
migrations: {
|
|
29
33
|
components: modules.flatMap((module) => module.migrations.components ?? []),
|
|
30
34
|
loader: Effect.all(modules.map((module) => module.migrations.loader)).pipe(Effect.map((entries) => entries.flat())),
|
package/dist/appModules.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appModules.js","sourceRoot":"","sources":["../src/appModules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oDAAoD,CAAC;
|
|
1
|
+
{"version":3,"file":"appModules.js","sourceRoot":"","sources":["../src/appModules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oDAAoD,CAAC;AAC7F,OAAO,EAAuC,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAG5G,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAwEhE,MAAM,UAAU,UAAU,CACzB,OAA6B,EAC7B,OAAiD;IAcjD,OAAO,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,OAA6B,EAAE,OAAiD;IACnI,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC9B,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC;YACzC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC3C,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;gBAC/B,OAAO,KAAK,CAAC,CAAC,IAAI,oBAAoB,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,YAAY,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C,MAAM,CAAC,OAAO,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;KAC/F,CAAC;AACH,CAAC,CAAC,CAAC"}
|
package/dist/hostRpcRoutes.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare function hostRpcRoutes<TRpcs extends Rpc.Any, THandlers, TError,
|
|
|
20
20
|
readonly policy: "loopback";
|
|
21
21
|
}, transport: Effect.Success<ReturnType<typeof hostTransport>>, sensitive: Effect.Success<ReturnType<typeof schemaSensitiveKeys>>): Layer.Layer<Layer.Success<BuiltRoutes<TRpcs, THandlers, TError, TRequirements, TRequestServices, TRequestRequirements>>, Layer.Error<BuiltRoutes<TRpcs, THandlers, TError, TRequirements, TRequestServices, TRequestRequirements>>, Exclude<TRequirements, TRequestServices> | RequestRequirements<TRpcs, TRequestRequirements> | Exclude<Rpc.ServicesServer<TRpcs>, THandlers> | Exclude<Layer.Services<BuiltRoutes<TRpcs, THandlers, TError, TRequirements, TRequestServices, TRequestRequirements>>, SessionPolicy | HttpRouter.Request<"Requires", SessionPolicy> | TRequestServices | TRequestRequirements>>;
|
|
22
22
|
export declare function hostRpcRoutes<TRpcs extends Rpc.Any, THandlers, TError, TRequirements, TRequestServices = never, TRequestRequirements = never>(...args: Parameters<typeof buildRpcRoutes<TRpcs, THandlers, TError, TRequirements, TRequestServices, TRequestRequirements>>): Layer.Layer<Layer.Success<BuiltRoutes<TRpcs, THandlers, TError, TRequirements, TRequestServices, TRequestRequirements>>, Layer.Error<BuiltRoutes<TRpcs, THandlers, TError, TRequirements, TRequestServices, TRequestRequirements>>, Exclude<Layer.Services<BuiltRoutes<TRpcs, THandlers, TError, TRequirements, TRequestServices, TRequestRequirements>>, TRequestServices | TRequestRequirements> | Exclude<TRequirements, TRequestServices> | RequestRequirements<TRpcs, TRequestRequirements>>;
|
|
23
|
-
declare function buildRpcRoutes<TRpcs extends Rpc.Any, THandlers, TError, TRequirements, TRequestServices = never, TRequestRequirements = never>(options: RouteOptions<TRpcs, THandlers, TError, TRequirements, TRequestServices, TRequestRequirements>, { bodySize, trustedProxy, nativeOrigins }: Effect.Success<ReturnType<typeof hostTransport>>, sensitive: Effect.Success<ReturnType<typeof schemaSensitiveKeys>>): Layer.Layer<never, TError | import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicies, SessionPolicy | Exclude<Exclude<TRequirements, Rpc.Handler<"platform.hostVersion.watch">>, RpcSerialization.RpcSerialization> | Exclude<Exclude<Exclude<HttpRouter.HttpRouter, THandlers | import("@shivaedev/identity/middleware.ts").RequestTracing | import("@shivaedev/identity/subject.ts").SubjectResolver | Rpc.ToHandler<Extract<TRpcs, {
|
|
23
|
+
declare function buildRpcRoutes<TRpcs extends Rpc.Any, THandlers, TError, TRequirements, TRequestServices = never, TRequestRequirements = never>(options: RouteOptions<TRpcs, THandlers, TError, TRequirements, TRequestServices, TRequestRequirements>, { bodySize, trustedProxy, nativeOrigins }: Effect.Success<ReturnType<typeof hostTransport>>, sensitive: Effect.Success<ReturnType<typeof schemaSensitiveKeys>>): Layer.Layer<never, TError | import("./HandWrittenModuleHandlers.ts").HandWrittenModuleHandlers | import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicies, SessionPolicy | Exclude<Exclude<TRequirements, Rpc.Handler<"platform.hostVersion.watch">>, RpcSerialization.RpcSerialization> | Exclude<Exclude<Exclude<HttpRouter.HttpRouter, THandlers | import("@shivaedev/identity/middleware.ts").RequestTracing | import("@shivaedev/identity/subject.ts").SubjectResolver | Rpc.ToHandler<Extract<TRpcs, {
|
|
24
24
|
readonly _tag: `${string}.$changes`;
|
|
25
25
|
}>>>, Rpc.Handler<"platform.hostVersion.watch">>, RpcSerialization.RpcSerialization> | Exclude<Exclude<Exclude<HttpRouter.Request<"Requires", SessionPolicy>, THandlers | import("@shivaedev/identity/middleware.ts").RequestTracing | import("@shivaedev/identity/subject.ts").SubjectResolver | Rpc.ToHandler<Extract<TRpcs, {
|
|
26
26
|
readonly _tag: `${string}.$changes`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hostRpcRoutes.d.ts","sourceRoot":"","sources":["../src/hostRpcRoutes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,EAAmC,UAAU,EAAyC,MAAM,aAAa,CAAC;AAEjH,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,QAAQ,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAEpF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAMjF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"hostRpcRoutes.d.ts","sourceRoot":"","sources":["../src/hostRpcRoutes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,EAAmC,UAAU,EAAyC,MAAM,aAAa,CAAC;AAEjH,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,QAAQ,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAEpF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAMjF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAM/D,KAAK,WAAW,CAAC,KAAK,SAAS,GAAG,CAAC,GAA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C,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,gBAAgB,EAAE,oBAAoB,CAAC,CAAC,EACvG,OAAO,CACP,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,gBAAgB,EAAE,oBAAoB,CAAC,CAAC,EAC5G,gBAAgB,GAAG,oBAAoB,CACtC,GACD,OAAO,CAAC,aAAa,EAAE,gBAAgB,CAAC,GACxC,mBAAmB,CAAC,KAAK,EAAE,oBAAoB,CAAC,CAClD,CAAC;AAOF,iBAAS,cAAc,CAAC,KAAK,SAAS,GAAG,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,gBAAgB,GAAG,KAAK,EAAE,oBAAoB,GAAG,KAAK,EACtI,OAAO,EAAE,YAAY,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,gBAAgB,EAAE,oBAAoB,CAAC,EACtG,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,EAC3F,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iGA+DjE"}
|
package/dist/hostRpcRoutes.js
CHANGED
|
@@ -13,6 +13,7 @@ import { hostRpc, rpcCacheControl } from "#hostRpc.ts";
|
|
|
13
13
|
import { hostVersionLayer } from "#hostVersionLayer.ts";
|
|
14
14
|
import { redactingRpcSerialization } from "#redactingRpcSerialization.ts";
|
|
15
15
|
import { rpcRequestTracing } from "#rpcRequestTracing.ts";
|
|
16
|
+
import { servedModules } from "#servedModules.ts";
|
|
16
17
|
import { socketRpc } from "#socketRpc.ts";
|
|
17
18
|
import { UnixSocketRequest } from "#UnixSocketRequest.ts";
|
|
18
19
|
export function hostRpcRoutes(...args) {
|
|
@@ -24,6 +25,7 @@ function buildRpcRoutes(options, { bodySize, trustedProxy, nativeOrigins }, sens
|
|
|
24
25
|
: Layer.mergeAll(authenticatedLayer(), maybeAuthenticatedLayer(), rpcRequestTracing(sensitive)));
|
|
25
26
|
return HttpRouter.use((router) => Effect.gen(function* () {
|
|
26
27
|
yield* validateReadPolicies(options.group);
|
|
28
|
+
yield* servedModules(options.group);
|
|
27
29
|
const wire = yield* redactingRpcSerialization(sensitive);
|
|
28
30
|
const httpWire = {
|
|
29
31
|
...wire,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hostRpcRoutes.js","sourceRoot":"","sources":["../src/hostRpcRoutes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,UAAU,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjH,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAA2B,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AAEnF,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAE7E,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AACpG,OAAO,EAAE,oBAAoB,EAAE,MAAM,oDAAoD,CAAC;AAC1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAA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GAAG,EAAE,CACzD,iBAAiB,EAAE,CAAC,IAAI,CACvB,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAC1B,OAAO,CAAC,IAAI,CACX,MAAM,CAAC,cAAc,CAAC,mBAAmB,CAAC,WAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAChF,MAAM,CAAC,cAAc,CAAC,iBAAiB,CAAC,iBAAiB,EAAE,OAAO,CAAC,EACnE,MAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,IAAI,CAAC,EAC9D,UAAU,CAAC,sBAAsB,CAAC,eAAe,CAAC,CAClD,CACD,CACD,CACD,CAAC;IACH,CAAC,CAAC,CACF,CAAC,IAAI,CACL,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAC7G,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,EAC7D,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAC3C,CAAC;AACH,CAAC"}
|
package/dist/rerunQuery.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rerunQuery.d.ts","sourceRoot":"","sources":["../src/rerunQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,GAAG,EAAY,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"rerunQuery.d.ts","sourceRoot":"","sources":["../src/rerunQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,GAAG,EAAY,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAiC,KAAK,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACvG,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAClG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAE1E,KAAK,QAAQ,CAAC,CAAC,SAAS,GAAG,CAAC,GAAG,IAAI,MAAM,SAAS,CAAC,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAErG,wBAAgB,UAAU,CAAC,CAAC,SAAS,GAAG,CAAC,GAAG,EAC3C,KAAK,EAAE;IAAE,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;CAAE,EACpD,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,GACpD,CACF,OAAO,EAAE,YAAY,KACjB,MAAM,CAAC,MAAM,CACjB,OAAO,EACP,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,iBAAiB,GAAG,eAAe,EACnF,QAAQ,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAC3C,CAAC"}
|
package/dist/rerunQuery.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import { Rpc, RpcGroup } from "effect/rpc";
|
|
3
|
+
import { ReadRecorder } from "@shivaedev/changes/readRecorder.ts";
|
|
3
4
|
import { authorizeReads, CurrentViewer } from "@shivaedev/contract/readPolicy.ts";
|
|
4
5
|
export function rerunQuery(group, options) {
|
|
5
6
|
const prefix = options.rpc._tag.slice(0, -"$changes".length);
|
|
@@ -15,7 +16,9 @@ export function rerunQuery(group, options) {
|
|
|
15
16
|
if (!Effect.isEffect(result)) {
|
|
16
17
|
return yield* Effect.die(new Error(`Query ${tag} must return an Effect`));
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
+
// Permission changes refresh nothing live, so only the handler's reads record keys, never the read policy's.
|
|
20
|
+
const recorder = yield* ReadRecorder;
|
|
21
|
+
return yield* authorizeReads(Effect.provideService(result, ReadRecorder, recorder), { payload, rpc }, viewer).pipe(Effect.provideService(ReadRecorder, ReadRecorder.defaultValue()));
|
|
19
22
|
});
|
|
20
23
|
}
|
|
21
24
|
//# sourceMappingURL=rerunQuery.js.map
|
package/dist/rerunQuery.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rerunQuery.js","sourceRoot":"","sources":["../src/rerunQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,aAAa,EAAuB,MAAM,mCAAmC,CAAC;AAgBvG,MAAM,UAAU,UAAU,CAAC,KAA0D,EAAE,OAAsD;IAC5I,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IAC7D,OAAO,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAgB;QACnE,MAAM,GAAG,GAAG,GAAG,MAAM,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QACrC,MAAM,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;YACrB,OAAO,KAAK,CAAC,CAAC,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
|
|
3
|
+
import { HandWrittenModuleHandlers } from "#HandWrittenModuleHandlers.ts";
|
|
4
|
+
declare const ReplacedModuleHandlers_base: Context.ServiceClass<ReplacedModuleHandlers, "@shivaedev/server/ReplacedModuleHandlers", string>;
|
|
5
|
+
export declare class ReplacedModuleHandlers extends ReplacedModuleHandlers_base {
|
|
6
|
+
}
|
|
7
|
+
export declare const servedModules: <R extends Rpc.Any>(group: RpcGroup.RpcGroup<R>) => Effect.Effect<undefined, HandWrittenModuleHandlers, never>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=servedModules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"servedModules.d.ts","sourceRoot":"","sources":["../src/servedModules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AACjD,OAAO,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAIhD,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;;AAG1E,qBAAa,sBAAuB,SAAQ,2BAA6F;CAAG;AAE5I,eAAO,MAAM,aAAa,GAAgC,CAAC,SAAS,GAAG,CAAC,GAAG,4FAwBzE,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Context, Effect, Option } from "effect";
|
|
2
|
+
import { DefinedModule } from "@shivaedev/contract/defineModule.ts";
|
|
3
|
+
import { ServedReadPolicy } from "@shivaedev/contract/servedReadPolicy.ts";
|
|
4
|
+
import { QueryDefinition } from "@shivaedev/contract/serverMetadata.ts";
|
|
5
|
+
import { HandWrittenModuleHandlers } from "#HandWrittenModuleHandlers.ts";
|
|
6
|
+
// Only the test-support helper for fakes provides it, so a production host never opts a module out of its generated handlers.
|
|
7
|
+
export class ReplacedModuleHandlers extends Context.Service()("@shivaedev/server/ReplacedModuleHandlers") {
|
|
8
|
+
}
|
|
9
|
+
export const servedModules = Effect.fnUntraced(function* (group) {
|
|
10
|
+
const services = yield* Effect.context();
|
|
11
|
+
const handWritten = new Map();
|
|
12
|
+
for (const rpc of group.requests.values()) {
|
|
13
|
+
const module = Context.getOption(rpc.annotations, DefinedModule);
|
|
14
|
+
if (Option.isNone(module) || Option.isNone(Context.getOption(rpc.annotations, QueryDefinition))) {
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
const handler = Context.getOption(services, Context.Service(rpc.key));
|
|
18
|
+
const generated = Option.exists(handler, ({ context }) => Option.isSome(Context.getOption(context, ServedReadPolicy))
|
|
19
|
+
|| Option.contains(Context.getOption(context, ReplacedModuleHandlers), module.value));
|
|
20
|
+
if (!generated) {
|
|
21
|
+
handWritten.set(module.value, [...(handWritten.get(module.value) ?? []), rpc._tag]);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const [first] = [...handWritten].toSorted(([left], [right]) => left.localeCompare(right));
|
|
25
|
+
if (first !== undefined) {
|
|
26
|
+
const [module, queries] = first;
|
|
27
|
+
return yield* new HandWrittenModuleHandlers({ module, queries: queries.toSorted() });
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=servedModules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"servedModules.js","sourceRoot":"","sources":["../src/servedModules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAE1E,8HAA8H;AAC9H,MAAM,OAAO,sBAAuB,SAAQ,OAAO,CAAC,OAAO,EAAkC,CAAC,0CAA0C,CAAC;CAAG;AAE5I,MAAM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,KAAK,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1F,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC;QAChC,OAAO,KAAK,CAAC,CAAC,IAAI,yBAAyB,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IACtF,CAAC;AACF,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shivaedev/server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
4
4
|
"description": "The Effect application host: HTTP and RPC serving, health, OTLP export, database and migrations, and development mode",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"effect"
|
|
@@ -46,41 +46,41 @@
|
|
|
46
46
|
"README.md"
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@shivaedev/changes": "0.
|
|
50
|
-
"@shivaedev/contract": "0.
|
|
51
|
-
"@shivaedev/errors": "0.
|
|
52
|
-
"@shivaedev/http": "0.8.
|
|
53
|
-
"@shivaedev/identity": "0.31.
|
|
54
|
-
"@shivaedev/local-postgres": "0.16.
|
|
55
|
-
"@shivaedev/sql": "0.
|
|
49
|
+
"@shivaedev/changes": "0.12.0",
|
|
50
|
+
"@shivaedev/contract": "0.44.0",
|
|
51
|
+
"@shivaedev/errors": "0.12.0",
|
|
52
|
+
"@shivaedev/http": "0.8.2",
|
|
53
|
+
"@shivaedev/identity": "0.31.2",
|
|
54
|
+
"@shivaedev/local-postgres": "0.16.1",
|
|
55
|
+
"@shivaedev/sql": "0.47.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@effect/platform-node": "4.1.
|
|
59
|
-
"@effect/sql-pg": "4.1.
|
|
60
|
-
"@effect/vitest": "4.1.
|
|
61
|
-
"@shivaedev/access": "0.6.
|
|
62
|
-
"@shivaedev/admin": "0.24.
|
|
63
|
-
"@shivaedev/jobs": "0.42.
|
|
64
|
-
"@shivaedev/quality": "0.
|
|
65
|
-
"@shivaedev/rate-limit": "0.6.
|
|
66
|
-
"@shivaedev/service": "0.9.
|
|
67
|
-
"@shivaedev/test-kits": "0.
|
|
68
|
-
"@shivaedev/test-sql": "0.24.
|
|
69
|
-
"@shivaedev/test-story": "0.
|
|
58
|
+
"@effect/platform-node": "4.1.2",
|
|
59
|
+
"@effect/sql-pg": "4.1.2",
|
|
60
|
+
"@effect/vitest": "4.1.2",
|
|
61
|
+
"@shivaedev/access": "0.6.3",
|
|
62
|
+
"@shivaedev/admin": "0.24.3",
|
|
63
|
+
"@shivaedev/jobs": "0.42.2",
|
|
64
|
+
"@shivaedev/quality": "0.77.0",
|
|
65
|
+
"@shivaedev/rate-limit": "0.6.10",
|
|
66
|
+
"@shivaedev/service": "0.9.1",
|
|
67
|
+
"@shivaedev/test-kits": "0.12.0",
|
|
68
|
+
"@shivaedev/test-sql": "0.24.9",
|
|
69
|
+
"@shivaedev/test-story": "0.47.0",
|
|
70
70
|
"@types/node": "24.19.2",
|
|
71
|
-
"better-auth": "1.7.
|
|
72
|
-
"effect": "4.1.
|
|
71
|
+
"better-auth": "1.7.16",
|
|
72
|
+
"effect": "4.1.2",
|
|
73
73
|
"pg-boss": "12.38.0",
|
|
74
74
|
"typescript": "7.0.2",
|
|
75
|
-
"vitest": "5.0
|
|
75
|
+
"vitest": "5.1.0"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
|
-
"@effect/platform-node": "4.1.
|
|
79
|
-
"@effect/sql-pg": "4.1.
|
|
80
|
-
"@effect/vitest": "4.1.
|
|
81
|
-
"@shivaedev/admin": "0.24.
|
|
82
|
-
"better-auth": "1.7.
|
|
83
|
-
"effect": "4.1.
|
|
78
|
+
"@effect/platform-node": "4.1.2",
|
|
79
|
+
"@effect/sql-pg": "4.1.2",
|
|
80
|
+
"@effect/vitest": "4.1.2",
|
|
81
|
+
"@shivaedev/admin": "0.24.3",
|
|
82
|
+
"better-auth": "1.7.16",
|
|
83
|
+
"effect": "4.1.2"
|
|
84
84
|
},
|
|
85
85
|
"peerDependenciesMeta": {
|
|
86
86
|
"@effect/platform-node": {
|
package/src/AppModule.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import type { Layer, Pipeable } from "effect";
|
|
2
2
|
import type { RpcGroup } from "effect/rpc";
|
|
3
3
|
import type { AnyAdminRegistry } from "@shivaedev/admin/registry.ts";
|
|
4
|
+
import type { AnyModule } from "@shivaedev/contract/moduleHandlers.ts";
|
|
4
5
|
import type { MigrationOptions } from "#MigrationOptions.ts";
|
|
5
6
|
|
|
6
7
|
export type ModuleLayer = Layer.Any & Pipeable.Pipeable;
|
|
7
8
|
export type ModuleAdmin = AnyAdminRegistry & { readonly handlers: ModuleLayer };
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
interface ModuleParts {
|
|
10
11
|
readonly admin?: ModuleAdmin;
|
|
11
|
-
readonly group: RpcGroup.Any;
|
|
12
|
-
readonly handlers: ModuleLayer;
|
|
13
12
|
readonly migrations: Pick<MigrationOptions<unknown, unknown>, "loader" | "components">;
|
|
14
13
|
readonly name: string;
|
|
15
14
|
readonly ports?: ModuleLayer;
|
|
@@ -18,3 +17,15 @@ export interface AppModule {
|
|
|
18
17
|
readonly services: ModuleLayer;
|
|
19
18
|
readonly workers?: ModuleLayer;
|
|
20
19
|
}
|
|
20
|
+
|
|
21
|
+
// "~requires" exists only on a defined module, so this branch refuses one and it registers as `module:` instead.
|
|
22
|
+
export type AppModule =
|
|
23
|
+
| (ModuleParts & {
|
|
24
|
+
readonly group: RpcGroup.Any & { readonly "~requires"?: never };
|
|
25
|
+
readonly handlers: ModuleLayer;
|
|
26
|
+
readonly module?: never;
|
|
27
|
+
})
|
|
28
|
+
| (ModuleParts & { readonly group?: never; readonly handlers?: never; readonly module: RegisteredModule });
|
|
29
|
+
|
|
30
|
+
// A module's requires list exists only in its type, and appModules reads it from the registration's own type.
|
|
31
|
+
export type RegisteredModule = RpcGroup.Any & Pick<AnyModule, "application" | "declaration"> & { readonly "~requires": unknown };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
|
|
3
|
+
export class HandWrittenModuleHandlers extends Schema.TaggedError<HandWrittenModuleHandlers>()("HandWrittenModuleHandlers", {
|
|
4
|
+
module: Schema.String,
|
|
5
|
+
queries: Schema.Array(Schema.String),
|
|
6
|
+
}) {
|
|
7
|
+
override get message() {
|
|
8
|
+
return `Module "${this.module}" serves ${this.queries.join(", ")} through hand-written handlers instead of its generated ones, which check each query's read policy with the module's services. Register it as \`module:\` instead of \`group\` and \`handlers\`.`;
|
|
9
|
+
}
|
|
10
|
+
}
|
package/src/appModules.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { Migrator } from "effect/sql";
|
|
|
4
4
|
import type { AdminPage } from "@shivaedev/admin/page.ts";
|
|
5
5
|
import type { AdminRegistry, AnyAdminRegistry } from "@shivaedev/admin/registry.ts";
|
|
6
6
|
import { mergeAdminRegistrations } from "@shivaedev/admin/server/mergeAdminRegistrations.ts";
|
|
7
|
+
import { type AnyModule, type ModuleHandlers, moduleHandlers } from "@shivaedev/contract/moduleHandlers.ts";
|
|
7
8
|
import type { SchemaComponent } from "@shivaedev/sql/SchemaComponent.ts";
|
|
8
9
|
import type { AppModule, ModuleAdmin, ModuleLayer } from "#AppModule.ts";
|
|
9
10
|
import { DuplicateModuleQueue } from "#DuplicateModuleQueue.ts";
|
|
@@ -15,8 +16,26 @@ type Layers<TModules extends readonly AppModule[], TKey extends "handlers" | "se
|
|
|
15
16
|
ModuleField<TModules[number], TKey>,
|
|
16
17
|
Layer.Any
|
|
17
18
|
>;
|
|
19
|
+
type ServedHandlers<TModule> = TModule extends { readonly module: infer TDefined extends AnyModule } ? ModuleHandlers<TDefined> : never;
|
|
20
|
+
// A registration typed as AppModule has lost its module's requires, so ServedHandlers would serve it as requiring nothing.
|
|
21
|
+
// Only a tuple is checked: inference sees the bare constraint, and a check that refuses it breaks inference of every registration list.
|
|
22
|
+
type WidenedModule<TModule> = TModule extends { readonly module: infer TDefined } ? (TDefined extends AnyModule ? never : TModule) : never;
|
|
23
|
+
type ExactModules<TModules extends readonly AppModule[]> = number extends TModules["length"]
|
|
24
|
+
? unknown
|
|
25
|
+
: {
|
|
26
|
+
readonly [TKey in keyof TModules]: [WidenedModule<TModules[TKey]>] extends [never]
|
|
27
|
+
? unknown
|
|
28
|
+
: { readonly "Declare a defined module's registration with satisfies AppModule so its type keeps the module's requires": never };
|
|
29
|
+
};
|
|
30
|
+
type Groups<TModules extends readonly AppModule[]> = Extract<
|
|
31
|
+
ModuleField<TModules[number], "group"> | ModuleField<TModules[number], "module">,
|
|
32
|
+
RpcGroup.Any
|
|
33
|
+
>;
|
|
18
34
|
type Admin<TModules extends readonly AppModule[]> = Extract<ModuleField<TModules[number], "admin">, ModuleAdmin>;
|
|
19
|
-
type Handlers<TModules extends readonly AppModule[]> =
|
|
35
|
+
type Handlers<TModules extends readonly AppModule[]> =
|
|
36
|
+
| Layers<TModules, "handlers">
|
|
37
|
+
| ServedHandlers<TModules[number]>
|
|
38
|
+
| Extract<ModuleField<Admin<TModules>, "handlers">, Layer.Any>;
|
|
20
39
|
type Pages<TModules extends readonly AppModule[]> = Extract<ModuleField<Admin<TModules>, "pages">, readonly AdminPage[]>;
|
|
21
40
|
type Queues<TModules extends readonly AppModule[]> = Extract<ModuleField<TModules[number], "queues">, readonly { readonly name: string }[]>[number];
|
|
22
41
|
type Ports<TModules extends readonly AppModule[]> = Layers<TModules, "ports">;
|
|
@@ -28,7 +47,9 @@ type Components<T> = T extends readonly (infer TComponent extends SchemaComponen
|
|
|
28
47
|
type ModuleComponents<TModules extends AppModule> = Components<ModuleField<TModules["migrations"], "components">>;
|
|
29
48
|
|
|
30
49
|
export function appModules<const TModules extends readonly AppModule[], R = never, E = never, TRequirements = never>(
|
|
31
|
-
modules: TModules &
|
|
50
|
+
modules: TModules &
|
|
51
|
+
GlobalServices<Layer.Services<Services<NoInfer<TModules>>>, Layer.Success<RequestServices<NoInfer<TModules>>>> &
|
|
52
|
+
ExactModules<NoInfer<TModules>>,
|
|
32
53
|
options?: { readonly replacements?: Layer.Layer<R, E, TRequirements> },
|
|
33
54
|
): Effect.Effect<
|
|
34
55
|
{
|
|
@@ -39,7 +60,7 @@ export function appModules<const TModules extends readonly AppModule[], R = neve
|
|
|
39
60
|
>;
|
|
40
61
|
readonly queues: readonly Queues<TModules>[];
|
|
41
62
|
readonly admin: AdminRegistry<readonly Pages<TModules>[number][]>;
|
|
42
|
-
readonly group: RpcGroup.RpcGroup<RpcGroup.Rpcs<TModules
|
|
63
|
+
readonly group: RpcGroup.RpcGroup<RpcGroup.Rpcs<Groups<TModules> | ModuleField<Admin<TModules>, "group">>>;
|
|
43
64
|
readonly handlers: Layer.Layer<Layer.Success<Handlers<TModules>>, Layer.Error<Handlers<TModules>>, Layer.Services<Handlers<TModules>>>;
|
|
44
65
|
readonly requestServices: Layer.Layer<
|
|
45
66
|
Layer.Success<Layers<TModules, "requestServices">>,
|
|
@@ -95,8 +116,16 @@ const composeModules = Effect.fnUntraced(function* (modules: readonly AppModule[
|
|
|
95
116
|
const ports = Layer.merge(defaults, options?.replacements ?? Layer.empty);
|
|
96
117
|
return {
|
|
97
118
|
admin,
|
|
98
|
-
group: RpcGroup.make().merge(...modules.map((module) => module.group), admin.group),
|
|
99
|
-
|
|
119
|
+
group: RpcGroup.make().merge(...modules.map((module) => (module.module === undefined ? module.group : module.module)), admin.group),
|
|
120
|
+
// The overload types each module's handlers from its own requires; at run time moduleHandlers reads only its operations.
|
|
121
|
+
handlers: Layer.mergeAll(
|
|
122
|
+
admin.handlers,
|
|
123
|
+
...modules.map((module) =>
|
|
124
|
+
module.module === undefined
|
|
125
|
+
? module.handlers
|
|
126
|
+
: moduleHandlers({ "~requires": [], application: module.module.application, declaration: module.module.declaration }),
|
|
127
|
+
),
|
|
128
|
+
),
|
|
100
129
|
migrations: {
|
|
101
130
|
components: modules.flatMap((module) => module.migrations.components ?? []),
|
|
102
131
|
loader: Effect.all(modules.map((module) => module.migrations.loader)).pipe(Effect.map((entries) => entries.flat())),
|
package/src/hostRpcRoutes.ts
CHANGED
|
@@ -18,6 +18,7 @@ import { hostVersionLayer } from "#hostVersionLayer.ts";
|
|
|
18
18
|
import { redactingRpcSerialization } from "#redactingRpcSerialization.ts";
|
|
19
19
|
import type { RequestRequirements } from "#requestServices.ts";
|
|
20
20
|
import { rpcRequestTracing } from "#rpcRequestTracing.ts";
|
|
21
|
+
import { servedModules } from "#servedModules.ts";
|
|
21
22
|
import { socketRpc } from "#socketRpc.ts";
|
|
22
23
|
import { UnixSocketRequest } from "#UnixSocketRequest.ts";
|
|
23
24
|
|
|
@@ -79,6 +80,7 @@ function buildRpcRoutes<TRpcs extends Rpc.Any, THandlers, TError, TRequirements,
|
|
|
79
80
|
return HttpRouter.use((router) =>
|
|
80
81
|
Effect.gen(function* () {
|
|
81
82
|
yield* validateReadPolicies(options.group);
|
|
83
|
+
yield* servedModules(options.group);
|
|
82
84
|
const wire = yield* redactingRpcSerialization(sensitive);
|
|
83
85
|
const httpWire: typeof wire = {
|
|
84
86
|
...wire,
|
package/src/rerunQuery.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import { Rpc, RpcGroup } from "effect/rpc";
|
|
3
|
+
import { ReadRecorder } from "@shivaedev/changes/readRecorder.ts";
|
|
3
4
|
import { authorizeReads, CurrentViewer, type PolicyChannels } from "@shivaedev/contract/readPolicy.ts";
|
|
4
5
|
import type { MissingReadPolicy, QueryReadDenied } from "@shivaedev/contract/readPolicyErrors.ts";
|
|
5
6
|
import type { QueryRequest } from "@shivaedev/contract/serverMetadata.ts";
|
|
@@ -30,6 +31,10 @@ export function rerunQuery(group: { readonly requests: ReadonlyMap<string, Rpc.A
|
|
|
30
31
|
if (!Effect.isEffect(result)) {
|
|
31
32
|
return yield* Effect.die(new Error(`Query ${tag} must return an Effect`));
|
|
32
33
|
}
|
|
33
|
-
|
|
34
|
+
// Permission changes refresh nothing live, so only the handler's reads record keys, never the read policy's.
|
|
35
|
+
const recorder = yield* ReadRecorder;
|
|
36
|
+
return yield* authorizeReads(Effect.provideService(result, ReadRecorder, recorder), { payload, rpc }, viewer).pipe(
|
|
37
|
+
Effect.provideService(ReadRecorder, ReadRecorder.defaultValue()),
|
|
38
|
+
);
|
|
34
39
|
});
|
|
35
40
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Context, Effect, Option } from "effect";
|
|
2
|
+
import type { Rpc, RpcGroup } from "effect/rpc";
|
|
3
|
+
import { DefinedModule } from "@shivaedev/contract/defineModule.ts";
|
|
4
|
+
import { ServedReadPolicy } from "@shivaedev/contract/servedReadPolicy.ts";
|
|
5
|
+
import { QueryDefinition } from "@shivaedev/contract/serverMetadata.ts";
|
|
6
|
+
import { HandWrittenModuleHandlers } from "#HandWrittenModuleHandlers.ts";
|
|
7
|
+
|
|
8
|
+
// Only the test-support helper for fakes provides it, so a production host never opts a module out of its generated handlers.
|
|
9
|
+
export class ReplacedModuleHandlers extends Context.Service<ReplacedModuleHandlers, string>()("@shivaedev/server/ReplacedModuleHandlers") {}
|
|
10
|
+
|
|
11
|
+
export const servedModules = Effect.fnUntraced(function* <R extends Rpc.Any>(group: RpcGroup.RpcGroup<R>) {
|
|
12
|
+
const services = yield* Effect.context<never>();
|
|
13
|
+
const handWritten = new Map<string, string[]>();
|
|
14
|
+
for (const rpc of group.requests.values()) {
|
|
15
|
+
const module = Context.getOption(rpc.annotations, DefinedModule);
|
|
16
|
+
if (Option.isNone(module) || Option.isNone(Context.getOption(rpc.annotations, QueryDefinition))) {
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
const handler = Context.getOption(services, Context.Service<Rpc.Handler<string>>(rpc.key));
|
|
20
|
+
const generated = Option.exists(
|
|
21
|
+
handler,
|
|
22
|
+
({ context }) =>
|
|
23
|
+
Option.isSome(Context.getOption(context, ServedReadPolicy))
|
|
24
|
+
|| Option.contains(Context.getOption(context, ReplacedModuleHandlers), module.value),
|
|
25
|
+
);
|
|
26
|
+
if (!generated) {
|
|
27
|
+
handWritten.set(module.value, [...(handWritten.get(module.value) ?? []), rpc._tag]);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const [first] = [...handWritten].toSorted(([left], [right]) => left.localeCompare(right));
|
|
31
|
+
if (first !== undefined) {
|
|
32
|
+
const [module, queries] = first;
|
|
33
|
+
return yield* new HandWrittenModuleHandlers({ module, queries: queries.toSorted() });
|
|
34
|
+
}
|
|
35
|
+
});
|