@shivaedev/server 0.18.0 → 0.20.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 +51 -0
- package/README.md +81 -17
- package/dist/AppModule.d.ts +22 -0
- package/dist/AppModule.d.ts.map +1 -0
- package/dist/AppModule.js +2 -0
- package/dist/AppModule.js.map +1 -0
- package/dist/DuplicateModuleQueue.d.ts +11 -0
- package/dist/DuplicateModuleQueue.d.ts.map +1 -0
- package/dist/DuplicateModuleQueue.js +11 -0
- package/dist/DuplicateModuleQueue.js.map +1 -0
- package/dist/{runtime/makePlatform.d.ts → adapters/makePlatformRuntime.d.ts} +2 -2
- package/dist/adapters/makePlatformRuntime.d.ts.map +1 -0
- package/dist/{runtime/makePlatform.js → adapters/makePlatformRuntime.js} +1 -1
- package/dist/adapters/makePlatformRuntime.js.map +1 -0
- package/dist/{nodeHttpServer.d.ts → adapters/nodeHttpServer.d.ts} +1 -0
- package/dist/adapters/nodeHttpServer.d.ts.map +1 -0
- package/dist/{nodeHttpServer.js → adapters/nodeHttpServer.js} +5 -0
- package/dist/adapters/nodeHttpServer.js.map +1 -0
- package/dist/adapters/subscriptionSignal.d.ts.map +1 -0
- package/dist/adapters/subscriptionSignal.js.map +1 -0
- package/dist/appDatabase.d.ts +2 -2
- package/dist/appDatabase.d.ts.map +1 -1
- package/dist/appDatabase.js +8 -3
- package/dist/appDatabase.js.map +1 -1
- package/dist/appHost.d.ts.map +1 -1
- package/dist/appHost.js +11 -4
- package/dist/appHost.js.map +1 -1
- package/dist/appHostHttp.d.ts +48 -30
- package/dist/appHostHttp.d.ts.map +1 -1
- package/dist/appHostHttp.js +2 -2
- package/dist/appHostHttp.js.map +1 -1
- package/dist/appModules.d.ts +37 -0
- package/dist/appModules.d.ts.map +1 -0
- package/dist/appModules.js +37 -0
- package/dist/appModules.js.map +1 -0
- package/dist/boundedRpcRequest.d.ts +3 -2
- package/dist/boundedRpcRequest.d.ts.map +1 -1
- package/dist/boundedRpcRequest.js +6 -5
- package/dist/boundedRpcRequest.js.map +1 -1
- package/dist/boundedRpcSocket.d.ts +4 -0
- package/dist/boundedRpcSocket.d.ts.map +1 -0
- package/dist/boundedRpcSocket.js +29 -0
- package/dist/boundedRpcSocket.js.map +1 -0
- package/dist/browserErrorRoute.js +1 -1
- package/dist/browserErrorRoute.js.map +1 -1
- package/dist/hostChanges.d.ts +4 -2
- package/dist/hostChanges.d.ts.map +1 -1
- package/dist/hostChanges.js +37 -42
- package/dist/hostChanges.js.map +1 -1
- package/dist/hostRpc.d.ts +4 -9
- package/dist/hostRpc.d.ts.map +1 -1
- package/dist/hostRpc.js +9 -17
- package/dist/hostRpc.js.map +1 -1
- package/dist/hostRpcRoutes.d.ts +5 -3
- package/dist/hostRpcRoutes.d.ts.map +1 -1
- package/dist/hostRpcRoutes.js +5 -4
- package/dist/hostRpcRoutes.js.map +1 -1
- package/dist/hostTransport.js +1 -1
- package/dist/hostTransport.js.map +1 -1
- package/dist/nativeClientOrigins.js +1 -1
- package/dist/nativeClientOrigins.js.map +1 -1
- package/dist/otlpHttpClient.js +2 -2
- package/dist/otlpHttpClient.js.map +1 -1
- package/dist/otlpTracing.d.ts.map +1 -1
- package/dist/otlpTracing.js +4 -4
- package/dist/otlpTracing.js.map +1 -1
- package/dist/publishCommand.d.ts +3 -0
- package/dist/publishCommand.d.ts.map +1 -0
- package/dist/publishCommand.js +36 -0
- package/dist/publishCommand.js.map +1 -0
- package/dist/redactingRpcSerialization.d.ts +3 -2
- package/dist/redactingRpcSerialization.d.ts.map +1 -1
- package/dist/redactingRpcSerialization.js +8 -8
- package/dist/redactingRpcSerialization.js.map +1 -1
- package/dist/rerunQuery.d.ts +7 -3
- package/dist/rerunQuery.d.ts.map +1 -1
- package/dist/rerunQuery.js +3 -4
- package/dist/rerunQuery.js.map +1 -1
- package/dist/setupDatabases.d.ts +1 -1
- package/dist/setupDatabases.d.ts.map +1 -1
- package/dist/setupDatabases.js +3 -3
- package/dist/setupDatabases.js.map +1 -1
- package/dist/socketRpc.js +1 -1
- package/dist/socketRpc.js.map +1 -1
- package/dist/testing/HostProcessError.d.ts +10 -0
- package/dist/testing/HostProcessError.d.ts.map +1 -0
- package/dist/testing/HostProcessError.js +4 -0
- package/dist/testing/HostProcessError.js.map +1 -0
- package/dist/testing/adapters/hostProcess.d.ts +23 -0
- package/dist/testing/adapters/hostProcess.d.ts.map +1 -0
- package/dist/testing/adapters/hostProcess.js +84 -0
- package/dist/testing/adapters/hostProcess.js.map +1 -0
- package/dist/testing/adapters/hostProcessReadouts.d.ts +10 -0
- package/dist/testing/adapters/hostProcessReadouts.d.ts.map +1 -0
- package/dist/testing/adapters/hostProcessReadouts.js +26 -0
- package/dist/testing/adapters/hostProcessReadouts.js.map +1 -0
- package/dist/testing/hostProcess.d.ts +24 -0
- package/dist/testing/hostProcess.d.ts.map +1 -0
- package/dist/testing/hostProcess.js +49 -0
- package/dist/testing/hostProcess.js.map +1 -0
- package/dist/testing/hostProcessChild.d.ts +6 -0
- package/dist/testing/hostProcessChild.d.ts.map +1 -0
- package/dist/testing/hostProcessChild.js +15 -0
- package/dist/testing/hostProcessChild.js.map +1 -0
- package/dist/testing/hostProcessProtocol.d.ts +17 -0
- package/dist/testing/hostProcessProtocol.d.ts.map +1 -0
- package/dist/testing/hostProcessProtocol.js +10 -0
- package/dist/testing/hostProcessProtocol.js.map +1 -0
- package/dist/testing/hostProcessReadouts.d.ts +7 -0
- package/dist/testing/hostProcessReadouts.d.ts.map +1 -0
- package/dist/testing/hostProcessReadouts.js +37 -0
- package/dist/testing/hostProcessReadouts.js.map +1 -0
- package/dist/workerHost.d.ts +7 -0
- package/dist/workerHost.d.ts.map +1 -0
- package/dist/workerHost.js +7 -0
- package/dist/workerHost.js.map +1 -0
- package/package.json +25 -17
- package/src/AppModule.ts +19 -0
- package/src/DuplicateModuleQueue.ts +11 -0
- package/src/{runtime/makePlatform.ts → adapters/makePlatformRuntime.ts} +1 -1
- package/src/{nodeHttpServer.ts → adapters/nodeHttpServer.ts} +7 -0
- package/src/appDatabase.ts +9 -3
- package/src/appHost.ts +17 -7
- package/src/appHostHttp.ts +2 -2
- package/src/appModules.ts +99 -0
- package/src/boundedRpcRequest.ts +6 -5
- package/src/boundedRpcSocket.ts +32 -0
- package/src/browserErrorRoute.ts +1 -1
- package/src/hostChanges.ts +66 -50
- package/src/hostRpc.ts +9 -23
- package/src/hostRpcRoutes.ts +22 -12
- package/src/hostTransport.ts +1 -1
- package/src/nativeClientOrigins.ts +1 -1
- package/src/otlpHttpClient.ts +2 -2
- package/src/otlpTracing.ts +8 -6
- package/src/publishCommand.ts +47 -0
- package/src/redactingRpcSerialization.ts +11 -12
- package/src/rerunQuery.ts +18 -6
- package/src/setupDatabases.ts +3 -3
- package/src/socketRpc.ts +1 -1
- package/src/testing/HostProcessError.ts +6 -0
- package/src/testing/adapters/hostProcess.ts +95 -0
- package/src/testing/adapters/hostProcessReadouts.ts +29 -0
- package/src/testing/hostProcess.ts +60 -0
- package/src/testing/hostProcessChild.ts +20 -0
- package/src/testing/hostProcessProtocol.ts +10 -0
- package/src/testing/hostProcessReadouts.ts +46 -0
- package/src/workerHost.ts +13 -0
- package/dist/node-http/subscriptionSignal.d.ts.map +0 -1
- package/dist/node-http/subscriptionSignal.js.map +0 -1
- package/dist/nodeHttpServer.d.ts.map +0 -1
- package/dist/nodeHttpServer.js.map +0 -1
- package/dist/runtime/makePlatform.d.ts.map +0 -1
- package/dist/runtime/makePlatform.js.map +0 -1
- /package/dist/{node-http → adapters}/subscriptionSignal.d.ts +0 -0
- /package/dist/{node-http → adapters}/subscriptionSignal.js +0 -0
- /package/src/{node-http → adapters}/subscriptionSignal.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.20.0 - 2026-11-03
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Compose command publication through the changes publication port, preserving post-commit retries, deduplication and recovery across required, optional and custom authentication.
|
|
8
|
+
- Read a child host's active work, completed finalizers and shutdown duration through the process kit, including after a reported shutdown. Instrument child Effects with `hostProcessReadouts`.
|
|
9
|
+
- Launch a host with a proxied `databaseUrl` and cut its idle PostgreSQL connections with `disconnectIdlePostgres` to exercise recovery.
|
|
10
|
+
- Modules carry their queue declarations and worker Layers. `workerHost` runs workers with the same composed services and ports used by `appHost` after database preparation.
|
|
11
|
+
- Provide `sendHostReady` in the server's host-process testing adapter to report the current process ID and listening URL over IPC.
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Database setup shares local-postgres's Docker settings reader.
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- Apply the host's `maxBodySize` and `MAX_BODY_SIZE` limit to WebSocket RPC messages, including binary and fragmented messages. Oversized messages close the connection with WebSocket code 1009, surfaced as Effect's typed `SocketError` with a `SocketCloseError` reason.
|
|
20
|
+
- Hash the server's default PostgreSQL changes channel through Effect Crypto while retaining its channel name and explicit channel override.
|
|
21
|
+
- Hosted live queries receive writes to newly discovered relations and stop refreshing for relations they no longer read, for both invalidation hints and pushed results.
|
|
22
|
+
- Redact preflight log messages, failure causes and annotations before host startup. Preserve typed preflight failures and ordinary startup logs. Direct hosts also apply schema-sensitive fields and configured sensitive keys; deferred hosts use the default redaction policy before their application is constructed.
|
|
23
|
+
- Hosts using the pg-boss schema component wait for missing deferral artifacts to be installed before starting the application, and check mode names those artifacts.
|
|
24
|
+
- Masked failures retain scalar, array and object wire shapes so native RPC clients decode the declared failure without a schema error.
|
|
25
|
+
- The application host uses the contract's attached guard and retains its HTTP refusal of WebSocket-only subscriptions.
|
|
26
|
+
- Query reruns retain their native RPC handler service requirements and declared failures through read authorization and live subscriptions.
|
|
27
|
+
- Authenticated hosts subscribe to plain repository keys and publish unscoped command dependencies.
|
|
28
|
+
- The application host installs the contract guard, avoiding duplicate policy evaluations after session resolution for required and optional authentication.
|
|
29
|
+
- Build hosted changes handlers through the contract Layer and validate pushed results as decoded values, including transformed schemas such as bigint.
|
|
30
|
+
|
|
31
|
+
### Breaking
|
|
32
|
+
|
|
33
|
+
- App-host rerun-and-compare subscriptions emit `Unchanged` updates for equal results. Upgrade raw `$changes` consumers to handle this update and deploy compatible clients and servers together.
|
|
34
|
+
- Direct users of `appDatabase` must provide `Crypto.Crypto` for the default changes channel, for example with `Layer.provide(NodeCrypto.layer)` from `@effect/platform-node/NodeCrypto`. `appHost` and `workerHost` already supply it.
|
|
35
|
+
- `redactingRpcSerialization` now takes the validated policy returned by `yield* schemaSensitiveKeys(group, extraKeys)` as its second argument. Replace the separate key predicate and masking callbacks with that policy.
|
|
36
|
+
- Modules now require a `name`, and `appModules` returns an Effect. Add a name to each module and use `yield* appModules(...)` inside an Effect before passing its result to either host. Duplicate queue names fail composition with `DuplicateModuleQueue`, identifying the queue and both owners.
|
|
37
|
+
- in `boundedRpcRequest.ts`, replace `boundedRpcRequest(request)` with `yield* boundedRpcRequest()` inside an Effect. Provide the native request through `HttpServerRequest.HttpServerRequest`; the returned request keeps its cached text and array-buffer reads.
|
|
38
|
+
- Move Node bridges under adapters. Replace imports from `@shivaedev/server/runtime/makePlatform.ts`, `@shivaedev/server/node-http/subscriptionSignal.ts` and `@shivaedev/server/nodeHttpServer.ts` with `@shivaedev/server/adapters/makePlatformRuntime.ts`, `@shivaedev/server/adapters/subscriptionSignal.ts` and `@shivaedev/server/adapters/nodeHttpServer.ts` respectively. Runtime types remain in `@shivaedev/server/runtime/types.ts`.
|
|
39
|
+
- `rerunQuery` exposes the queried group's handler services and read-policy services in its Effect requirements. Provide the application handler layer and the read-policy services before running a rerun.
|
|
40
|
+
- Replace the `HostedReadPolicy` type from `@shivaedev/server/hostRpc.ts` with `ReadPolicyGuard` from `@shivaedev/contract/ReadPolicyGuard.ts`. Custom hosts install `readPolicyGuardLayer()` and serve the group returned by `yield* guardReads(group)`, which places the guard inside identity middleware. Pass `{ websocket: true }` to the Layer constructor for WebSocket hosts; its default refuses `$changes` over HTTP.
|
|
41
|
+
|
|
42
|
+
## 0.19.0 - 2026-11-02
|
|
43
|
+
|
|
44
|
+
### Added
|
|
45
|
+
|
|
46
|
+
- Compose feature modules with `AppModule` and `appModules`, combining native RPC groups, handlers, migrations, services and admin registrations for `appHost`. Supply default ports separately so replacement Layers reach module services before they bind dependencies.
|
|
47
|
+
- The module entry point uses `@shivaedev/admin` as an optional peer; install it when composing modules.
|
|
48
|
+
- A scoped child-process host testing kit with IPC readiness and signal acknowledgements, health answers and response-header readouts.
|
|
49
|
+
|
|
50
|
+
### Fixed
|
|
51
|
+
|
|
52
|
+
- Session-backed application hosts evaluate each live hint's read policy and pushed query against the current session, including changed roles and grants. Signing out, revocation and expiry still end subscriptions with `Unauthorized`.
|
|
53
|
+
|
|
3
54
|
## 0.18.0 - 2026-11-02
|
|
4
55
|
|
|
5
56
|
### Added
|
package/README.md
CHANGED
|
@@ -25,6 +25,8 @@ The process migrates the database, serves `Api` at `/rpc` and the built client f
|
|
|
25
25
|
|
|
26
26
|
The host composes pieces that live in their own packages. Request identity, sessions, Origin policy, permissions and Better Auth come from [`@shivaedev/identity`](https://github.com/ShivaeDev/platform/tree/main/packages/identity#readme); shared failures and redaction from [`@shivaedev/errors`](https://github.com/ShivaeDev/platform/tree/main/packages/errors#readme); outside HTTP calls from [`@shivaedev/http`](https://github.com/ShivaeDev/platform/tree/main/packages/http#readme). This package hosts them: `appHost` serves the RPC group with the application's session policy, database and migrations.
|
|
27
27
|
|
|
28
|
+
The RPC host composes contract's `CommandGuard` with `publishCommand` and the `CommandPublication` port from `@shivaedev/changes/commandPublication.ts`. Session middleware supplies the viewer. Successful commands publish declared changes after their handlers finish committing, deduplicating changes already announced by the handler. Publication retries do not repeat the write; exhausted retries request a live resync while preserving the committed result. Failed commands publish no declared changes.
|
|
29
|
+
|
|
28
30
|
The optional modules solve different boundaries. `runtime/` carries Effect services into Promise callers, and `node-http/` combines subscription cancellation sources. Choose the modules that match the application rather than adopting every integration.
|
|
29
31
|
|
|
30
32
|
### Prepare local development
|
|
@@ -37,6 +39,28 @@ The optional modules solve different boundaries. `runtime/` carries Effect servi
|
|
|
37
39
|
|
|
38
40
|
`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/LiveServer.ts` to those Layers.
|
|
39
41
|
|
|
42
|
+
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`, `group`, `handlers`, `services` and `migrations: { loader, components? }`. 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.
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
import { Effect } from "effect";
|
|
46
|
+
import { appHost } from "@shivaedev/server/appHost.ts";
|
|
47
|
+
import { workerHost } from "@shivaedev/server/workerHost.ts";
|
|
48
|
+
import { appModules } from "@shivaedev/server/appModules.ts";
|
|
49
|
+
import { notes, tasks, sessions } from "./app.ts";
|
|
50
|
+
|
|
51
|
+
const hosts = Effect.gen(function* () {
|
|
52
|
+
const modules = yield* appModules([notes, tasks]);
|
|
53
|
+
return {
|
|
54
|
+
server: appHost({ ...modules, sessions }),
|
|
55
|
+
worker: workerHost({ ...modules, migrations: { ...modules.migrations, mode: "wait" } }),
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
`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.
|
|
61
|
+
|
|
62
|
+
Pass `{ replacements: Layer.succeed(MyPort, implementation) }` as the second argument to `appModules`. Replacements take precedence over the combined default `ports` before module `services` acquire dependencies. Leave these ports unprovided in the module's service Layer; an adapter already captured by `Layer.provide` inside that Layer cannot be replaced from outside it. Missing ports and replacement Layer requirements remain in the host's requirement type. `workerHost` takes the same composition, provides its services to all module workers after database preparation, and scopes their lifetime to the returned Layer. Supply the shared `PgBoss` client through the service Layer in each process; the host and worker use the same module ports and replacements.
|
|
63
|
+
|
|
40
64
|
```ts
|
|
41
65
|
import { NodeRuntime } from "@effect/platform-node";
|
|
42
66
|
import { Layer } from "effect";
|
|
@@ -102,11 +126,11 @@ Static layers mounted manually through `routes` keep Effect's native behavior. T
|
|
|
102
126
|
|
|
103
127
|
The listener uses `HOST` or `127.0.0.1`, uses `PORT` or 3000, and reads `DATABASE_URL`. Set overrides in the one `config` object: `host`, `port` (0 selects an ephemeral port), `trustedProxy`, `maxBodySize`, `databaseUrl` and `listenDatabaseUrl` (Effect `Redacted<string>` values), `applicationName`, and optional `changes`. Migration options accept `table` and `lockTimeout` (default `effect_sql_migrations` and five seconds). Native Layer failures remain in the build error channel; missing application dependencies remain in the requirement type.
|
|
104
128
|
|
|
105
|
-
RPC request bodies are limited to 1 MiB by default. Set `MAX_BODY_SIZE` to a byte count or override it with `config.maxBodySize`, a nonnegative safe integer. An oversized NDJSON body, fixed-length or chunked, returns a 4xx before any RPC handler runs. This limit applies to the host's RPC route.
|
|
129
|
+
RPC request bodies are limited to 1 MiB by default. Set `MAX_BODY_SIZE` to a byte count or override it with `config.maxBodySize`, a nonnegative safe integer. An oversized NDJSON body, fixed-length or chunked, returns a 4xx before any RPC handler runs. The same byte limit applies to each WebSocket RPC message, including binary messages and the combined payload of continuation frames. An oversized message closes the connection with code 1009 before any RPC in that message runs; native Effect socket clients receive a typed `SocketError` with a `SocketCloseError` reason. The limit includes bearer authentication frames, and zero refuses every nonempty message. This limit applies to the host's RPC route.
|
|
106
130
|
|
|
107
131
|
For a native Node HTTP route outside RPC, read the request body with `readBoundedBody` from [`@shivaedev/http`](https://github.com/ShivaeDev/platform/tree/main/packages/http#readme), which rejects oversized bodies with a typed 413 failure.
|
|
108
132
|
|
|
109
|
-
Ordinary POST RPC uses `localRpcGuard` from `@shivaedev/identity/server/local.ts`: it requires a loopback peer and Host, same-origin or absent Origin, and the NDJSON content type. The WebSocket upgrade uses the same loopback, origin and trusted-proxy checks without an HTTP body content type. Session lookup uses the upgrade's transport headers; RPC message headers cannot replace its cookie or Origin. Session middleware revalidates authenticated streams at `streamRevalidationInterval` and ends revoked subscriptions with typed `Unauthorized`. Cookie-authenticated sockets remain open; later protected calls use the same session checks. Automatic live subscriptions
|
|
133
|
+
Ordinary POST RPC uses `localRpcGuard` from `@shivaedev/identity/server/adapters/local.ts`: it requires a loopback peer and Host, same-origin or absent Origin, and the NDJSON content type. The WebSocket upgrade uses the same loopback, origin and trusted-proxy checks without an HTTP body content type. Session lookup uses the upgrade's transport headers; RPC message headers cannot replace its cookie or Origin. Session middleware revalidates authenticated streams at `streamRevalidationInterval` and ends revoked subscriptions with typed `Unauthorized`. Cookie-authenticated sockets remain open; later protected calls use the same session checks. Automatic live subscriptions reload the session before each hint and use its current roles and grants for the query policy and any pushed query result. A policy denial keeps an established subscription open; delivery resumes on the next authorized hint. POST RPC refuses `$changes` subscriptions with the contract’s typed `WebSocketRequired` error and a message saying they need the WebSocket protocol. The host applies `RequestTracing` last to every served RPC, including loopback RPC, so it wraps authentication and handlers without a per-contract tracing declaration. Existing tracing declarations run once at that outermost boundary. With a session policy, contracts declare `Authenticated` and `MaybeAuthenticated` as needed; the host supplies their implementations. For `AuthenticatedUser`, merge `authenticatedUserLayer()` from `@shivaedev/identity/server/session.ts` beside the handlers. Declared errors retain their Schema types. Applications still own resource authorization and use `rpcBoundary` when they need to map unexpected failures.
|
|
110
134
|
|
|
111
135
|
Native clients that cannot set upgrade headers use `makeClient`'s `bearerToken` option from `@shivaedev/contract/bind.ts`. On session hosts, `GET /rpc?auth=frame` requires a first text frame shaped as `{"_tag":"Authenticate","token":"<credential>"}` within five seconds, with at most 8192 characters. The host consumes that frame before starting native RPC and supplies its bearer as the socket's transport Authorization header. The existing session provider, identity middleware, Origin policy and query read policies apply to every call and live read. RPC message headers cannot replace the authenticated credential. Configure bearer admission on the session provider and the WebView Origin through `nativeOrigins`. A long-lived bearer is never placed in a URL.
|
|
112
136
|
|
|
@@ -128,6 +152,8 @@ The host provides Effect's native `Crypto` service (`effect/Crypto`) to prefligh
|
|
|
128
152
|
|
|
129
153
|
Supply `preflight: AppConfigLive` to `appHost` to build a native Layer before checking or applying migrations, or constructing the application. Use it to validate configuration such as app IDs, keys and invite lists. Its errors stay in the returned Layer's typed error channel, its requirements other than `Crypto` remain external requirements, and its services are available to migrations, application construction, services and RPC handlers as well as callers of the host Layer. Preflight resources close with the host scope. The option also works without migrations.
|
|
130
154
|
|
|
155
|
+
Preflight logs pass through the host's redaction, including logged failure causes and annotations. The original typed failure remains available to callers. Direct hosts derive the policy from their RPC schemas and `config.sensitiveKeys`; deferred hosts use the default credential policy during preflight, before their application's schemas are available. Ordinary startup messages and annotations remain intact.
|
|
156
|
+
|
|
131
157
|
When construction itself touches the schema, use `appHost({ migrations, config, application })`. `application` is a native Effect that returns the HTTP host options (`group`, handler and service Layers, session policy, and optional HTTP config). The host first builds `appDatabase`, then evaluates this Effect in the host scope with SQL, Reactivity and `LiveServer` from `@shivaedev/contract/LiveServer.ts` available. A failed migration or schema-current check prevents construction. Initialization requirements and errors stay in the returned Layer's types, and acquired resources close with the host scope.
|
|
132
158
|
|
|
133
159
|
```ts
|
|
@@ -290,7 +316,7 @@ Diagnostic failure, defect and interruption reasons are rebuilt with sanitized a
|
|
|
290
316
|
|
|
291
317
|
The shared errors policy also masks `db.user`, `db.user.name` and `db.connection_string` in logs, error reports and exported traces. It matches field names, not arbitrary occurrences of their values in prose. Free text uses credential-shaped string, key-assignment and URL rules; it does not scan for personal data. Keep sensitive values out of ordinary prose and span names.
|
|
292
318
|
|
|
293
|
-
For native RPC serialization, `yield* schemaSensitiveKeys(group, extraKeys)` from `@shivaedev/errors/schemaSensitiveKeys.ts` obtains a key predicate with `forRpc(tag)` and `maskFailure(tag: string | undefined, reason: "Fail" | "Die")`. The Effect can fail with `SensitiveFieldConflict` from `@shivaedev/errors/schemaFieldScope.ts`; `appHost` reports this typed failure during Layer startup. Pass the predicate and its methods to `redactingRpcSerialization(wire, sensitive
|
|
319
|
+
For native RPC serialization, `yield* schemaSensitiveKeys(group, extraKeys)` from `@shivaedev/errors/schemaSensitiveKeys.ts` obtains a key predicate with `forRpc(tag)` and `maskFailure(tag: string | undefined, reason: "Fail" | "Die")`. The Effect can fail with `SensitiveFieldConflict` from `@shivaedev/errors/schemaFieldScope.ts`; `appHost` reports this typed failure during Layer startup. Pass the predicate and its methods to `redactingRpcSerialization(wire, sensitive)`. The serializer correlates request tags and response IDs, including batches, and uses the validated schema policy to mask failures within their declared wire shapes. Incompatible masks fail policy definition with `InvalidRedactionMask` from `@shivaedev/errors/wireMask.ts`, before the host listens; supply a constant `redactionMask` annotation on a constrained sensitive schema when its generic mask cannot decode. Unassociated defects use the conservative policy across the host's defect schemas.
|
|
294
320
|
|
|
295
321
|
The masking primitives, `redact`, `redactWire`, `redactRecord`, `redactText`, `redactUrl`, `redactCause`, `schemaSensitiveKeys` and `isSensitiveKey`, live in [`@shivaedev/errors`](https://github.com/ShivaeDev/platform/tree/main/packages/errors#readme).
|
|
296
322
|
|
|
@@ -306,7 +332,7 @@ Build the application Layer once. `runWithServices` supplies an invocation's ove
|
|
|
306
332
|
|
|
307
333
|
```ts
|
|
308
334
|
import { Context, Layer } from "effect";
|
|
309
|
-
import { makePlatformRuntime } from "@shivaedev/server/
|
|
335
|
+
import { makePlatformRuntime } from "@shivaedev/server/adapters/makePlatformRuntime.ts";
|
|
310
336
|
|
|
311
337
|
class Greeting extends Context.Service<Greeting, string>()("app/Greeting") {}
|
|
312
338
|
|
|
@@ -329,7 +355,7 @@ A long-lived response can receive cancellation from a Web request, a procedure a
|
|
|
329
355
|
|
|
330
356
|
```ts
|
|
331
357
|
import type { IncomingMessage } from "node:http";
|
|
332
|
-
import { nodeSubscriptionSignal } from "@shivaedev/server/
|
|
358
|
+
import { nodeSubscriptionSignal } from "@shivaedev/server/adapters/subscriptionSignal.ts";
|
|
333
359
|
|
|
334
360
|
export async function consumeSubscription(
|
|
335
361
|
request: Request,
|
|
@@ -352,6 +378,44 @@ export async function consumeSubscription(
|
|
|
352
378
|
|
|
353
379
|
The signal aborts on an additional signal, socket close, incomplete request close or an already destroyed connection. Normal completion of a request does not abort a continuing response. Without an explicit `nodeRequest`, the helper can read one from an srvx Web request's `runtime.node.req`. `dispose()` removes Node listeners and can be called repeatedly.
|
|
354
380
|
|
|
381
|
+
### Stories against a child host
|
|
382
|
+
|
|
383
|
+
`hostProcess(options)` from `@shivaedev/server/testing/hostProcess.ts` is a scoped kit for an application's real Node host process. It forks `options.module` with `args`, `cwd`, an explicit child environment in `env` and Node flags in `execArgv`. It waits for an IPC readiness message; stdout is ignored and stderr is inherited. Closing the owning Effect scope kills the child and waits for its exit. `stop()` does the same when a story needs to restart the host sooner.
|
|
384
|
+
|
|
385
|
+
In the child entry point, build the app host Layer, then run `reportHostReady` from `@shivaedev/server/testing/hostProcessChild.ts` with that Layer's context. It reads `HttpServer`, reports the listening URL and process ID over IPC, and fails if there is no parent IPC channel. The child must install its signal handlers before reporting readiness. After a handler finishes its work, run `acknowledgeHostSignal(signal)` from the same module. `signal(signal)` in the parent sends the OS signal and waits for that signal's IPC acknowledgement. Deliver signals sequentially, using signals the child handles; signals that kill or suspend a process cannot be acknowledged.
|
|
386
|
+
|
|
387
|
+
Wrap the kit in the application's story vocabulary:
|
|
388
|
+
|
|
389
|
+
```ts
|
|
390
|
+
import { expect } from "vitest";
|
|
391
|
+
import { storyKit } from "@shivaedev/test-story/server/storyKit.ts";
|
|
392
|
+
import { hostProcess } from "@shivaedev/server/testing/hostProcess.ts";
|
|
393
|
+
|
|
394
|
+
const host = storyKit({
|
|
395
|
+
name: "application host",
|
|
396
|
+
clock: "live",
|
|
397
|
+
stages: [],
|
|
398
|
+
create: () => hostProcess({ module: new URL("./host.ts", import.meta.url) }),
|
|
399
|
+
verbs: (process) => ({
|
|
400
|
+
health: process.health,
|
|
401
|
+
headers: process.headers,
|
|
402
|
+
reload: () => process.signal("SIGUSR2"),
|
|
403
|
+
}),
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
host.it("the running application answers health checks", [], function* ({ health }) {
|
|
407
|
+
expect(yield* health()).toMatchObject({ status: 200, body: "" });
|
|
408
|
+
});
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
`health()` requests `/health` and returns `{ status, body, headers }`. `headers(path)` returns the named path's response headers as a lowercase-keyed record. Both use real HTTP and leave redirects visible. The host's normal health semantics apply: reachable PostgreSQL produces 200; a host without a database produces 503. `url` and `pid` identify the ready child. Launch, signal and HTTP failures use the typed `HostProcessError` from `@shivaedev/server/testing/HostProcessError.ts`, with `operation` and the original `cause`. A child exit before readiness or signal acknowledgement fails the waiting action. A live child that never reports the expected message stays pending until its owning story is interrupted or times out.
|
|
412
|
+
|
|
413
|
+
For lifecycle observations, acquire `hostProcessReadouts` from `@shivaedev/server/testing/hostProcessReadouts.ts` in the child before reporting readiness. Keep its scope open until shutdown reporting finishes. Wrap a running Effect with `readouts.work(name, effect)` and a finalizer's Effect with `readouts.finalizer(name, effect)`. These wrappers observe the Effects the application runs; they do not discover uninstrumented work or finalizers. The parent's `activeWork()` returns names in start order, removing each item when it ends, including interrupted work and overlapping items with the same name. `finalizers()` returns names in completion order.
|
|
414
|
+
|
|
415
|
+
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.
|
|
416
|
+
|
|
417
|
+
To exercise PostgreSQL recovery, install the optional `@shivaedev/test-sql` peer and pass a redacted `databaseUrl` to `hostProcess`. The kit opens a `disconnectProxy` in its owning scope and gives the child its URL through `DATABASE_URL`; the child must use that setting. This mode uses the explicit `env` record plus the proxy's `DATABASE_URL` as the child's environment. Call `disconnectIdlePostgres()` once the host's database connections are idle. It cuts the proxy's existing connections while allowing new ones, so a following HTTP health request can exercise the host's PostgreSQL pool recovery.
|
|
418
|
+
|
|
355
419
|
### Low-memory PostgreSQL hosts
|
|
356
420
|
|
|
357
421
|
Use sql's [opt-in preset](https://github.com/ShivaeDev/platform/tree/main/packages/sql#low-memory-postgresql-hosts) with the host's ten-minute connection lifetime and one-minute idle timeout. The preset bounds PostgreSQL shared memory and per-operation work; connection recycling releases backend memory, and a page-cache trim releases clean file pages charged to the container. A busy workload still needs memory for its working set.
|
|
@@ -383,18 +447,18 @@ Enable the preset and trim per app in a throwaway environment first. Record `mem
|
|
|
383
447
|
|
|
384
448
|
Import the module that defines the name; there is no package-root entry. Paths below follow `@shivaedev/server/`.
|
|
385
449
|
|
|
386
|
-
| Module | Names and purpose
|
|
387
|
-
| ------------------------------------------------------------------------------- |
|
|
388
|
-
| `appHost.ts` | `appHost`: scoped HTTP and PostgreSQL composition with loopback defaults and optional proxy trust.
|
|
389
|
-
| `appDatabase.ts` | `appDatabase`, `DatabaseConfig`: PostgreSQL composition with migrations, Reactivity and contract's `LiveServer`.
|
|
390
|
-
| `setupDatabases.ts` | `setupDatabases()`: prepare the local development and test databases.
|
|
391
|
-
| `development.ts` | `development({ server, worker, conditions? })`, `runDevelopment(options)`: run the server, worker and Vite in watch mode.
|
|
392
|
-
| `rpc-server/publicConfigLayer.ts` | `publicConfigLayer(declaration, path?)`: serve a `publicConfig` declaration from native Config.
|
|
393
|
-
| `otlpTracing.ts` | `otlpTracing`: redacting Railway OTLP export for worker spans, logs and error reports.
|
|
394
|
-
| `RedactionPolicy.ts` | `RedactionPolicy`: provide the app's diagnostic key predicate derived by errors.
|
|
395
|
-
| `redactingDiagnostics.ts`, `redactingTracer.ts`, `redactingRpcSerialization.ts` | `redactingDiagnostics(sensitive)`, `redactingTracer(sensitive)`, `redactingRpcSerialization(wire, sensitive
|
|
396
|
-
| `
|
|
397
|
-
| `
|
|
450
|
+
| Module | Names and purpose |
|
|
451
|
+
| ------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
452
|
+
| `appHost.ts` | `appHost`: scoped HTTP and PostgreSQL composition with loopback defaults and optional proxy trust. |
|
|
453
|
+
| `appDatabase.ts` | `appDatabase`, `DatabaseConfig`: PostgreSQL composition with migrations, Reactivity and contract's `LiveServer`. |
|
|
454
|
+
| `setupDatabases.ts` | `setupDatabases()`: prepare the local development and test databases. |
|
|
455
|
+
| `development.ts` | `development({ server, worker, conditions? })`, `runDevelopment(options)`: run the server, worker and Vite in watch mode. |
|
|
456
|
+
| `rpc-server/publicConfigLayer.ts` | `publicConfigLayer(declaration, path?)`: serve a `publicConfig` declaration from native Config. |
|
|
457
|
+
| `otlpTracing.ts` | `otlpTracing`: redacting Railway OTLP export for worker spans, logs and error reports. |
|
|
458
|
+
| `RedactionPolicy.ts` | `RedactionPolicy`: provide the app's diagnostic key predicate derived by errors. |
|
|
459
|
+
| `redactingDiagnostics.ts`, `redactingTracer.ts`, `redactingRpcSerialization.ts` | `redactingDiagnostics(sensitive)`, `redactingTracer(sensitive)`, `redactingRpcSerialization(wire, sensitive)`: compose native diagnostic and NDJSON boundaries. |
|
|
460
|
+
| `adapters/makePlatformRuntime.ts` | `makePlatformRuntime(layer, { developmentCacheKey? })`. |
|
|
461
|
+
| `adapters/subscriptionSignal.ts` | `nodeSubscriptionSignal({ nodeRequest?, request?, signals? })`, returning `{ signal, dispose }`. |
|
|
398
462
|
|
|
399
463
|
### Install, setup and limits
|
|
400
464
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Layer, Pipeable } from "effect";
|
|
2
|
+
import type { RpcGroup } from "effect/rpc";
|
|
3
|
+
import type { AnyAdminRegistry } from "@shivaedev/admin/registry.ts";
|
|
4
|
+
import type { MigrationOptions } from "#MigrationOptions.ts";
|
|
5
|
+
export type ModuleLayer = Layer.Any & Pipeable.Pipeable;
|
|
6
|
+
export type ModuleAdmin = AnyAdminRegistry & {
|
|
7
|
+
readonly handlers: ModuleLayer;
|
|
8
|
+
};
|
|
9
|
+
export interface AppModule {
|
|
10
|
+
readonly admin?: ModuleAdmin;
|
|
11
|
+
readonly group: RpcGroup.Any;
|
|
12
|
+
readonly handlers: ModuleLayer;
|
|
13
|
+
readonly migrations: Pick<MigrationOptions<unknown, unknown>, "loader" | "components">;
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly ports?: ModuleLayer;
|
|
16
|
+
readonly queues?: readonly {
|
|
17
|
+
readonly name: string;
|
|
18
|
+
}[];
|
|
19
|
+
readonly services: ModuleLayer;
|
|
20
|
+
readonly workers?: ModuleLayer;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=AppModule.d.ts.map
|
|
@@ -0,0 +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,MAAM,WAAW,SAAS;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,QAAQ,GAAG,YAAY,CAAC,CAAC;IACvF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACvD,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC;CAC/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppModule.js","sourceRoot":"","sources":["../src/AppModule.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
declare const DuplicateModuleQueue_base: Schema.Class<DuplicateModuleQueue, Schema.TaggedStruct<"DuplicateModuleQueue", {
|
|
3
|
+
readonly firstModule: Schema.String;
|
|
4
|
+
readonly queue: Schema.String;
|
|
5
|
+
readonly secondModule: Schema.String;
|
|
6
|
+
}>, import("effect/Cause").YieldableError>;
|
|
7
|
+
export declare class DuplicateModuleQueue extends DuplicateModuleQueue_base {
|
|
8
|
+
get message(): string;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=DuplicateModuleQueue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DuplicateModuleQueue.d.ts","sourceRoot":"","sources":["../src/DuplicateModuleQueue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;;;;;;AAEhC,qBAAa,oBAAqB,SAAQ,yBAIxC;IACD,IAAa,OAAO,WAEnB;CACD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export class DuplicateModuleQueue extends Schema.TaggedError()("DuplicateModuleQueue", {
|
|
3
|
+
firstModule: Schema.String,
|
|
4
|
+
queue: Schema.String,
|
|
5
|
+
secondModule: Schema.String,
|
|
6
|
+
}) {
|
|
7
|
+
get message() {
|
|
8
|
+
return `Queue "${this.queue}" is declared by both "${this.firstModule}" and "${this.secondModule}".`;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=DuplicateModuleQueue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DuplicateModuleQueue.js","sourceRoot":"","sources":["../src/DuplicateModuleQueue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,OAAO,oBAAqB,SAAQ,MAAM,CAAC,WAAW,EAAwB,CAAC,sBAAsB,EAAE;IAC5G,WAAW,EAAE,MAAM,CAAC,MAAM;IAC1B,KAAK,EAAE,MAAM,CAAC,MAAM;IACpB,YAAY,EAAE,MAAM,CAAC,MAAM;CAC3B,CAAC;IACD,IAAa,OAAO;QACnB,OAAO,UAAU,IAAI,CAAC,KAAK,0BAA0B,IAAI,CAAC,WAAW,UAAU,IAAI,CAAC,YAAY,IAAI,CAAC;IACtG,CAAC;CACD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Layer } from "effect";
|
|
2
|
-
import type { PlatformRuntime, PlatformRuntimeOptions } from "
|
|
2
|
+
import type { PlatformRuntime, PlatformRuntimeOptions } from "#runtime/types.ts";
|
|
3
3
|
export declare function makePlatformRuntime<TServices, TBuildError>(layer: Layer.Layer<TServices, TBuildError>, options?: PlatformRuntimeOptions): PlatformRuntime<TServices, TBuildError>;
|
|
4
|
-
//# sourceMappingURL=
|
|
4
|
+
//# sourceMappingURL=makePlatformRuntime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"makePlatformRuntime.d.ts","sourceRoot":"","sources":["../../src/adapters/makePlatformRuntime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEpC,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AA+CjF,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,WAAW,EACzD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE,WAAW,CAAC,EAC1C,OAAO,GAAE,sBAA2B,GAClC,eAAe,CAAC,SAAS,EAAE,WAAW,CAAC,CAqBzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"makePlatformRuntime.js","sourceRoot":"","sources":["../../src/adapters/makePlatformRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAG9E,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;AACtE,MAAM,WAAW,GAAY,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;AACtE,MAAM,YAAY,GAAkC,WAAW,YAAY,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,GAAG,EAA4B,CAAC;AACnI,OAAO,CAAC,G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AC9D,GAAG,OAAO;QACV,OAAO,EAAE,KAAK,IAAI,EAAE;YACnB,IAAI,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,aAAa,EAAE,CAAC;gBAC7C,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC1B,CAAC;YACD,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;QACzB,CAAC;KACD,CAAC;IACF,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;IACrC,OAAO,aAAa,CAAC;AACtB,CAAC"}
|
|
@@ -3,5 +3,6 @@ export declare function nodeHttpServer(host: string, config?: {
|
|
|
3
3
|
readonly port?: number;
|
|
4
4
|
readonly gracefulShutdownTimeout?: Duration.Input;
|
|
5
5
|
readonly disablePreemptiveShutdown?: boolean;
|
|
6
|
+
readonly maxBodySize?: number;
|
|
6
7
|
}): Layer.Layer<import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("@effect/platform-node/NodeServices").NodeServices, Config.ConfigError | import("effect/http/HttpServerError").ServeError, never>;
|
|
7
8
|
//# sourceMappingURL=nodeHttpServer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodeHttpServer.d.ts","sourceRoot":"","sources":["../../src/adapters/nodeHttpServer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,KAAK,QAAQ,EAAU,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE9D,wBAAgB,cAAc,CAC7B,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE;IACR,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,uBAAuB,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC;IAClD,QAAQ,CAAC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAC7C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC9B,+RAcD"}
|
|
@@ -8,8 +8,13 @@ export function nodeHttpServer(host, config) {
|
|
|
8
8
|
gracefulShutdownTimeout: config?.gracefulShutdownTimeout,
|
|
9
9
|
host,
|
|
10
10
|
port,
|
|
11
|
+
websocket: config?.maxBodySize === undefined ? undefined : { maxPayload: socketPayloadLimit(config.maxBodySize) },
|
|
11
12
|
...(config?.disablePreemptiveShutdown === undefined ? {} : { disablePreemptiveShutdown: config.disablePreemptiveShutdown }),
|
|
12
13
|
});
|
|
13
14
|
}));
|
|
14
15
|
}
|
|
16
|
+
function socketPayloadLimit(bytes) {
|
|
17
|
+
// ws truncates maxPayload to a signed 32-bit integer; the RPC reader covers zero and larger limits.
|
|
18
|
+
return bytes > 0x7f_ff_ff_ff ? 0 : Math.max(1, bytes);
|
|
19
|
+
}
|
|
15
20
|
//# sourceMappingURL=nodeHttpServer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodeHttpServer.js","sourceRoot":"","sources":["../../src/adapters/nodeHttpServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,cAAc,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,MAAM,EAAiB,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE9D,MAAM,UAAU,cAAc,CAC7B,IAAY,EACZ,MAKC;IAED,OAAO,KAAK,CAAC,MAAM,CAClB,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QACnB,MAAM,IAAI,GAAG,MAAM,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACxF,OAAO,cAAc,CAAC,KAAK,CAAC,YAAY,EAAE;YACzC,uBAAuB,EAAE,MAAM,EAAE,uBAAuB;YACxD,IAAI;YACJ,IAAI;YACJ,SAAS,EAAE,MAAM,EAAE,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,kBAAkB,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE;YACjH,GAAG,CAAC,MAAM,EAAE,yBAAyB,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,yBAAyB,EAAE,MAAM,CAAC,yBAAyB,EAAE,CAAC;SAC3H,CAAC,CAAC;IACJ,CAAC,CAAC,CACF,CAAC;AACH,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAa;IACxC,oGAAoG;IACpG,OAAO,KAAK,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptionSignal.d.ts","sourceRoot":"","sources":["../../src/adapters/subscriptionSignal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,MAAM,WAAW,6BAA6B;IAC7C,QAAQ,CAAC,WAAW,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;IACnD,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACvC,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;CACrD;AACD,MAAM,WAAW,sBAAsB;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;CAC7B;AAYD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,6BAA6B,GAAG,sBAAsB,CA0CrG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptionSignal.js","sourceRoot":"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import * as PgClient from "@effect/sql-pg/PgClient";
|
|
2
|
-
import { Clock, Config, Layer, Redacted } from "effect";
|
|
2
|
+
import { Clock, Config, Crypto, Layer, Redacted } from "effect";
|
|
3
3
|
import * as Reactivity from "effect/reactivity/Reactivity";
|
|
4
4
|
import { Migrator } from "effect/sql";
|
|
5
5
|
import { type PostgresChangesOptions } from "@shivaedev/sql/postgresChanges.ts";
|
|
@@ -11,5 +11,5 @@ export interface DatabaseConfig extends PostgresOptions {
|
|
|
11
11
|
readonly databaseUrl?: Redacted.Redacted<string>;
|
|
12
12
|
readonly listenDatabaseUrl?: Redacted.Redacted<string>;
|
|
13
13
|
}
|
|
14
|
-
export declare function appDatabase<R, E = never>(options: AppDatabaseOptions<R, E>): Layer.Layer<"@shivaedev/contract/LiveServer" | PgClient.PgClient | import("@effect/sql-pg/PgPool").PgPool | Reactivity.Reactivity | import("effect/sql/SqlClient").SqlClient, E | Config.ConfigError | Migrator.MigrationError | import("@shivaedev/sql/PostgresListenerError.ts").PostgresListenerError | import("effect/Schema").SchemaError | import("effect/sql/SqlError").SqlError, Exclude<Exclude<R, import("effect/Scope").Scope>, "@shivaedev/contract/LiveServer" | PgClient.PgClient | import("@effect/sql-pg/PgPool").PgPool | Reactivity.Reactivity | import("effect/sql/SqlClient").SqlClient>>;
|
|
14
|
+
export declare function appDatabase<R, E = never>(options: AppDatabaseOptions<R, E>): Layer.Layer<"@shivaedev/contract/LiveServer" | PgClient.PgClient | import("@effect/sql-pg/PgPool").PgPool | Reactivity.Reactivity | import("effect/sql/SqlClient").SqlClient, E | Config.ConfigError | Migrator.MigrationError | import("@shivaedev/sql/PostgresListenerError.ts").PostgresListenerError | import("effect/Schema").SchemaError | import("effect/sql/SqlError").SqlError, Crypto.Crypto | Exclude<Exclude<R, import("effect/Scope").Scope>, "@shivaedev/contract/LiveServer" | PgClient.PgClient | import("@effect/sql-pg/PgPool").PgPool | Reactivity.Reactivity | import("effect/sql/SqlClient").SqlClient>>;
|
|
15
15
|
//# sourceMappingURL=appDatabase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appDatabase.d.ts","sourceRoot":"","sources":["../src/appDatabase.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"appDatabase.d.ts","sourceRoot":"","sources":["../src/appDatabase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAW,MAAM,EAA2B,KAAK,EAAU,QAAQ,EAAY,MAAM,QAAQ,CAAC;AAEpH,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAMtC,OAAO,EAAE,KAAK,sBAAsB,EAAmB,MAAM,mCAAmC,CAAC;AACjG,OAAO,EAAE,KAAK,eAAe,EAAiB,MAAM,iCAAiC,CAAC;AAEtF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD,MAAM,WAAW,cAAe,SAAQ,eAAe;IACtD,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,QAAQ,GAAG,gBAAgB,GAAG,mBAAmB,GAAG,eAAe,GAAG,QAAQ,CAAC,CAAC,CAAC;IACzI,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC;IAC7B,QAAQ,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjD,QAAQ,CAAC,iBAAiB,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;CACvD;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,imBAoD1E"}
|
package/dist/appDatabase.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createHash } from "node:crypto";
|
|
2
1
|
import * as PgClient from "@effect/sql-pg/PgClient";
|
|
3
|
-
import { Clock, Config, Context, Duration, Effect, Fiber, Layer, Option, Redacted, Schedule } from "effect";
|
|
2
|
+
import { Clock, Config, Context, Crypto, Duration, Effect, Fiber, Layer, Option, Redacted, Schedule } from "effect";
|
|
3
|
+
import * as Hex from "effect/encoding/Hex";
|
|
4
4
|
import * as Reactivity from "effect/reactivity/Reactivity";
|
|
5
5
|
import { Migrator } from "effect/sql";
|
|
6
6
|
import { LiveServer } from "@shivaedev/contract/LiveServer.ts";
|
|
@@ -31,7 +31,7 @@ export function appDatabase(options) {
|
|
|
31
31
|
const hints = yield* LiveServer;
|
|
32
32
|
const url = options.config?.databaseUrl ?? (yield* Config.Redacted("DATABASE_URL"));
|
|
33
33
|
const name = yield* Config.String("APP_NAME").pipe(Config.withDefault(new URL(Redacted.value(url)).pathname));
|
|
34
|
-
const channel = changes?.channel ??
|
|
34
|
+
const channel = changes?.channel ?? (yield* defaultChangesChannel(name));
|
|
35
35
|
const listenUrl = options.config?.listenDatabaseUrl ?? Option.getOrUndefined(yield* Config.Redacted("LISTEN_DATABASE_URL").pipe(Config.option));
|
|
36
36
|
const listenerClient = listenUrl === undefined
|
|
37
37
|
? client
|
|
@@ -53,6 +53,11 @@ export function appDatabase(options) {
|
|
|
53
53
|
const prepared = Layer.effectDiscard(prepareMigrations(migrations)).pipe(Layer.provideMerge(connected));
|
|
54
54
|
return worker.pipe(Layer.provideMerge(prepared));
|
|
55
55
|
}
|
|
56
|
+
const defaultChangesChannel = Effect.fnUntraced(function* (name) {
|
|
57
|
+
const crypto = yield* Crypto.Crypto;
|
|
58
|
+
const digest = yield* crypto.digest("SHA-256", new TextEncoder().encode(name)).pipe(Effect.orDie);
|
|
59
|
+
return `changes_${Hex.encode(digest).slice(0, 32)}`;
|
|
60
|
+
});
|
|
56
61
|
function prepareMigrations(migrations) {
|
|
57
62
|
switch (migrations.mode) {
|
|
58
63
|
case "check": {
|
package/dist/appDatabase.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appDatabase.js","sourceRoot":"","sources":["../src/appDatabase.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"appDatabase.js","sourceRoot":"","sources":["../src/appDatabase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACpH,OAAO,KAAK,GAAG,MAAM,qBAAqB,CAAC;AAC3C,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAC9G,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAkC,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AACxH,OAAO,EAA+B,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACjG,OAAO,EAAwB,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAUhE,MAAM,UAAU,WAAW,CAAe,OAAiC;IAC1E,MAAM,MAAM,GAAG;QACd,GAAG,OAAO,CAAC,MAAM;QACjB,eAAe,EAAE,OAAO,CAAC,MAAM,EAAE,aAAa,IAAI,YAAY;QAC9D,WAAW,EAAE,OAAO,CAAC,MAAM,EAAE,WAAW,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,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC5B,KAAK,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;YACjC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,6BAA6B,CAAC,CAAC;QACtD,CAAC;IACF,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC"}
|
package/dist/appHost.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appHost.d.ts","sourceRoot":"","sources":["../src/appHost.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"appHost.d.ts","sourceRoot":"","sources":["../src/appHost.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,KAAK,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEnE,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACtG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAG7D,MAAM,WAAW,kBAAkB,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,KAAK;IACvD,QAAQ,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC;IACjC,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAC5C;AAED,MAAM,MAAM,cAAc,CACzB,KAAK,SAAS,GAAG,CAAC,GAA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AAa,EAAE,oBAAoB,CAAC,GACtH,UAAU,CAAC,WAAW,EAAE,kBAAkB,CAAC,GAAG;IAC7C,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC,YAAY,CAAC,CAAC;IACpF,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC;CAC1B,CAAC;AAEH,MAAM,MAAM,kBAAkB,CAC7B,KAAK,SAAS,GAAG,CAAC,GAAG,EACrB,SAAS,EACT,aAAa,EACb,oBAAoB,EACpB,SAAS,GAAG,KAAK,EACjB,aAAa,GAAG,KAAK,EACrB,oBAAoB,GAAG,KAAK,EAC5B,UAAU,GAAG,KAAK,EAClB,eAAe,GAAG,KAAK,EACvB,sBAAsB,GAAG,KAAK,EAC9B,WAAW,GAAG,KAAK,EACnB,kBAAkB,GAAG,qBAAqB,IACvC,aAAa,CAAC,UAAU,EAAE,eAAe,EAAE,sBAAsB,CAAC,GACrE,eAAe,CAAC,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,oBAAoB,EAAE,SAAS,EAAE,aAAa,EAAE,oBAAoB,CAAC,GACtH,UAAU,CAAC,WAAW,EAAE,kBAAkB,CAAC,GAC3C,UAAU,GAAG;IAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC;AAClD,eAAO,MAAM,OAAO,EAAE,cAwDrB,CAAC"}
|
package/dist/appHost.js
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import * as NodeCrypto from "@effect/platform-node/NodeCrypto";
|
|
2
|
-
import { Layer } from "effect";
|
|
2
|
+
import { Effect, Layer } from "effect";
|
|
3
|
+
import { schemaSensitiveKeys } from "@shivaedev/errors/schemaSensitiveKeys.ts";
|
|
4
|
+
import { isSensitiveKey } from "@shivaedev/errors/sensitive.ts";
|
|
3
5
|
import { appDatabase } from "#appDatabase.ts";
|
|
4
6
|
import { appHostHttp, deferredHost, migratedHost } from "#appHostHttp.ts";
|
|
7
|
+
import { redactingDiagnostics } from "#redactingDiagnostics.ts";
|
|
5
8
|
export const appHost = (options) => {
|
|
9
|
+
const startup = options.preflight;
|
|
10
|
+
const preflight = startup === undefined
|
|
11
|
+
? Layer.empty
|
|
12
|
+
: Layer.unwrap(Effect.map("application" in options ? Effect.succeed(isSensitiveKey) : schemaSensitiveKeys(options.group, options.config?.sensitiveKeys), (sensitive) => startup.pipe(Layer.provide(redactingDiagnostics(sensitive)))));
|
|
6
13
|
if ("application" in options) {
|
|
7
|
-
return deferredHost(options.application, appDatabase(options)).pipe(Layer.provideMerge(
|
|
14
|
+
return deferredHost(options.application, appDatabase(options)).pipe(Layer.provideMerge(preflight), Layer.provide(NodeCrypto.layer));
|
|
8
15
|
}
|
|
9
16
|
return options.migrations === undefined
|
|
10
|
-
? appHostHttp(options).pipe(Layer.provideMerge(
|
|
11
|
-
: migratedHost({ ...options, migrations: options.migrations }, appDatabase({ ...options, migrations: options.migrations })).pipe(Layer.provideMerge(
|
|
17
|
+
? appHostHttp(options).pipe(Layer.provideMerge(preflight), Layer.provide(NodeCrypto.layer))
|
|
18
|
+
: migratedHost({ ...options, migrations: options.migrations }, appDatabase({ ...options, migrations: options.migrations })).pipe(Layer.provideMerge(preflight), Layer.provide(NodeCrypto.layer));
|
|
12
19
|
};
|
|
13
20
|
//# sourceMappingURL=appHost.js.map
|
package/dist/appHost.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appHost.js","sourceRoot":"","sources":["../src/appHost.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"appHost.js","sourceRoot":"","sources":["../src/appHost.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,kCAAkC,CAAC;AAC/D,OAAO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