@shivaedev/server 0.26.0 → 0.28.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 +24 -0
- package/README.md +8 -4
- package/dist/AppHostFactory.d.ts +3 -3
- package/dist/AppHostFactory.d.ts.map +1 -1
- package/dist/AppHostInput.d.ts +7 -5
- package/dist/AppHostInput.d.ts.map +1 -1
- package/dist/AppModule.d.ts +1 -0
- package/dist/AppModule.d.ts.map +1 -1
- package/dist/appDatabase.d.ts +3 -2
- package/dist/appDatabase.d.ts.map +1 -1
- package/dist/appDatabase.js +9 -8
- package/dist/appDatabase.js.map +1 -1
- package/dist/appDatabaseHttp.d.ts +123 -87
- package/dist/appDatabaseHttp.d.ts.map +1 -1
- package/dist/appDatabaseHttp.js.map +1 -1
- package/dist/appHost.d.ts +63 -45
- package/dist/appHost.d.ts.map +1 -1
- package/dist/appHost.js.map +1 -1
- package/dist/appHostHttp.d.ts +61 -43
- package/dist/appHostHttp.d.ts.map +1 -1
- package/dist/appHostHttp.js.map +1 -1
- package/dist/appModules.d.ts +8 -2
- package/dist/appModules.d.ts.map +1 -1
- package/dist/appModules.js +1 -0
- package/dist/appModules.js.map +1 -1
- package/dist/hostChanges.d.ts.map +1 -1
- package/dist/hostChanges.js +4 -3
- package/dist/hostChanges.js.map +1 -1
- package/dist/hostOptions.d.ts +3 -2
- package/dist/hostOptions.d.ts.map +1 -1
- package/dist/hostPreflight.d.ts +5 -2
- package/dist/hostPreflight.d.ts.map +1 -1
- package/dist/hostPreflight.js.map +1 -1
- package/dist/hostRpc.d.ts +17 -8
- package/dist/hostRpc.d.ts.map +1 -1
- package/dist/hostRpc.js +11 -5
- package/dist/hostRpc.js.map +1 -1
- package/dist/hostRpcRoutes.d.ts +24 -16
- package/dist/hostRpcRoutes.d.ts.map +1 -1
- package/dist/hostRpcRoutes.js +3 -4
- package/dist/hostRpcRoutes.js.map +1 -1
- package/dist/prepareMigrations.js +2 -2
- package/dist/prepareMigrations.js.map +1 -1
- package/dist/requestServices.d.ts +18 -0
- package/dist/requestServices.d.ts.map +1 -0
- package/dist/requestServices.js +2 -0
- package/dist/requestServices.js.map +1 -0
- package/dist/workerHost.d.ts +1 -1
- package/dist/workerHost.d.ts.map +1 -1
- package/package.json +26 -25
- package/src/AppHostFactory.ts +16 -4
- package/src/AppHostInput.ts +38 -42
- package/src/AppModule.ts +1 -0
- package/src/appDatabase.ts +14 -9
- package/src/appDatabaseHttp.ts +10 -2
- package/src/appHost.ts +26 -4
- package/src/appHostHttp.ts +5 -1
- package/src/appModules.ts +12 -2
- package/src/hostChanges.ts +8 -3
- package/src/hostOptions.ts +25 -2
- package/src/hostPreflight.ts +5 -2
- package/src/hostRpc.ts +18 -4
- package/src/hostRpcRoutes.ts +34 -20
- package/src/prepareMigrations.ts +2 -2
- package/src/requestServices.ts +21 -0
package/src/AppHostInput.ts
CHANGED
|
@@ -22,6 +22,8 @@ export type AppHostInput<
|
|
|
22
22
|
TRouteError = never,
|
|
23
23
|
TRouteRequirements = HostRouteRequirements,
|
|
24
24
|
TMigrationError = never,
|
|
25
|
+
TRequestServices = never,
|
|
26
|
+
TRequestRequirements = never,
|
|
25
27
|
> = HostPreflight<TPreflight, TPreflightError, TPreflightRequirements> &
|
|
26
28
|
(
|
|
27
29
|
| (AppDatabaseOptions<TMigrations, TMigrationError> & {
|
|
@@ -38,13 +40,15 @@ export type AppHostInput<
|
|
|
38
40
|
never,
|
|
39
41
|
never,
|
|
40
42
|
TRouteError,
|
|
41
|
-
TRouteRequirements
|
|
43
|
+
TRouteRequirements,
|
|
44
|
+
TRequestServices,
|
|
45
|
+
TRequestRequirements
|
|
42
46
|
>,
|
|
43
47
|
TApplicationError,
|
|
44
48
|
TApplicationRequirements
|
|
45
49
|
>;
|
|
46
50
|
})
|
|
47
|
-
|
|
|
51
|
+
| (HostCoreOptions<
|
|
48
52
|
TRpcs,
|
|
49
53
|
THandlers,
|
|
50
54
|
THandlerError,
|
|
@@ -52,44 +56,12 @@ export type AppHostInput<
|
|
|
52
56
|
TServices,
|
|
53
57
|
TServiceError,
|
|
54
58
|
TServiceRequirements,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
TMigrationError
|
|
62
|
-
>
|
|
63
|
-
| AppLocalHostOptions<
|
|
64
|
-
TRpcs,
|
|
65
|
-
THandlers,
|
|
66
|
-
THandlerError,
|
|
67
|
-
THandlerRequirements,
|
|
68
|
-
TServices,
|
|
69
|
-
TServiceError,
|
|
70
|
-
TServiceRequirements,
|
|
71
|
-
TMigrations,
|
|
72
|
-
TPreflight,
|
|
73
|
-
TPreflightError,
|
|
74
|
-
TPreflightRequirements,
|
|
75
|
-
TRouteError,
|
|
76
|
-
TRouteRequirements,
|
|
77
|
-
TMigrationError
|
|
78
|
-
>
|
|
79
|
-
| AppHttpHostOptions<
|
|
80
|
-
TRpcs,
|
|
81
|
-
THandlers,
|
|
82
|
-
THandlerError,
|
|
83
|
-
THandlerRequirements,
|
|
84
|
-
TServices,
|
|
85
|
-
TServiceError,
|
|
86
|
-
TServiceRequirements,
|
|
87
|
-
TPreflight,
|
|
88
|
-
TPreflightError,
|
|
89
|
-
TPreflightRequirements,
|
|
90
|
-
TRouteError,
|
|
91
|
-
TRouteRequirements
|
|
92
|
-
>
|
|
59
|
+
TRequestServices,
|
|
60
|
+
TRequestRequirements
|
|
61
|
+
> &
|
|
62
|
+
HostRoutes<TRouteError, TRouteRequirements> &
|
|
63
|
+
HostPolicy &
|
|
64
|
+
(AppDatabaseOptions<TMigrations, TMigrationError> | { readonly migrations?: undefined }))
|
|
93
65
|
);
|
|
94
66
|
|
|
95
67
|
export type AppHostOptions<
|
|
@@ -107,8 +79,20 @@ export type AppHostOptions<
|
|
|
107
79
|
TRouteError = never,
|
|
108
80
|
TRouteRequirements = HostRouteRequirements,
|
|
109
81
|
TMigrationError = never,
|
|
82
|
+
TRequestServices = never,
|
|
83
|
+
TRequestRequirements = never,
|
|
110
84
|
> = HostPreflight<TPreflight, TPreflightError, TPreflightRequirements> &
|
|
111
|
-
HostCoreOptions<
|
|
85
|
+
HostCoreOptions<
|
|
86
|
+
TRpcs,
|
|
87
|
+
THandlers,
|
|
88
|
+
THandlerError,
|
|
89
|
+
THandlerRequirements,
|
|
90
|
+
TServices,
|
|
91
|
+
TServiceError,
|
|
92
|
+
TServiceRequirements,
|
|
93
|
+
TRequestServices,
|
|
94
|
+
TRequestRequirements
|
|
95
|
+
> &
|
|
112
96
|
HostRoutes<TRouteError, TRouteRequirements> &
|
|
113
97
|
HostPolicy & {
|
|
114
98
|
readonly migrations: AppDatabaseOptions<TMigrations, TMigrationError>["migrations"];
|
|
@@ -131,8 +115,20 @@ export type AppLocalHostOptions<
|
|
|
131
115
|
TRouteError = never,
|
|
132
116
|
TRouteRequirements = HostRouteRequirements,
|
|
133
117
|
TMigrationError = never,
|
|
118
|
+
TRequestServices = never,
|
|
119
|
+
TRequestRequirements = never,
|
|
134
120
|
> = HostPreflight<TPreflight, TPreflightError, TPreflightRequirements> &
|
|
135
|
-
HostCoreOptions<
|
|
121
|
+
HostCoreOptions<
|
|
122
|
+
TRpcs,
|
|
123
|
+
THandlers,
|
|
124
|
+
THandlerError,
|
|
125
|
+
THandlerRequirements,
|
|
126
|
+
TServices,
|
|
127
|
+
TServiceError,
|
|
128
|
+
TServiceRequirements,
|
|
129
|
+
TRequestServices,
|
|
130
|
+
TRequestRequirements
|
|
131
|
+
> &
|
|
136
132
|
HostRoutes<TRouteError, TRouteRequirements> & {
|
|
137
133
|
readonly migrations: AppDatabaseOptions<TMigrations, TMigrationError>["migrations"];
|
|
138
134
|
readonly config?: AppDatabaseOptions["config"];
|
package/src/AppModule.ts
CHANGED
|
@@ -14,6 +14,7 @@ export interface AppModule {
|
|
|
14
14
|
readonly name: string;
|
|
15
15
|
readonly ports?: ModuleLayer;
|
|
16
16
|
readonly queues?: readonly { readonly name: string }[];
|
|
17
|
+
readonly requestServices?: Layer.Layer<never, never, unknown>;
|
|
17
18
|
readonly services: ModuleLayer;
|
|
18
19
|
readonly workers?: ModuleLayer;
|
|
19
20
|
}
|
package/src/appDatabase.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import * as NodeCrypto from "@effect/platform-node/NodeCrypto";
|
|
2
2
|
import * as PgClient from "@effect/sql-pg/PgClient";
|
|
3
|
-
import { Clock, Config, Context,
|
|
4
|
-
import
|
|
3
|
+
import { Clock, Config, Context, Effect, Layer, Option, Redacted } from "effect";
|
|
4
|
+
import { Digest } from "effect/crypto";
|
|
5
5
|
import * as Reactivity from "effect/reactivity/Reactivity";
|
|
6
6
|
import type { Rpc } from "effect/rpc";
|
|
7
|
-
import {
|
|
7
|
+
import { liveServerLayer } from "@shivaedev/contract/live-server/layer.ts";
|
|
8
|
+
import { LiveServer } from "@shivaedev/contract/live-server/service.ts";
|
|
8
9
|
import { isSensitiveKey } from "@shivaedev/errors/sensitive.ts";
|
|
9
10
|
import { coordinateWorkerRelease } from "@shivaedev/sql/coordinateWorkerRelease.ts";
|
|
10
11
|
import { type PostgresChangesOptions, postgresChanges } from "@shivaedev/sql/postgresChanges.ts";
|
|
11
12
|
import { type PostgresOptions, postgresLayer } from "@shivaedev/sql/postgresLayer.ts";
|
|
12
|
-
import { WorkerRelease } from "@shivaedev/sql/
|
|
13
|
+
import { WorkerRelease } from "@shivaedev/sql/worker-release/service.ts";
|
|
13
14
|
import type { AppHostFactory } from "#AppHostFactory.ts";
|
|
14
15
|
import type { AppHostInput } from "#AppHostInput.ts";
|
|
15
16
|
import { deferredHost, migratedHost } from "#appDatabaseHttp.ts";
|
|
@@ -44,7 +45,7 @@ export function appDatabase<R, E = never>(options: AppDatabaseOptions<R, E>) {
|
|
|
44
45
|
postgresLayer(url, config).pipe(Layer.provide(clock)),
|
|
45
46
|
),
|
|
46
47
|
);
|
|
47
|
-
const live =
|
|
48
|
+
const live = liveServerLayer.pipe(Layer.provideMerge(Reactivity.layer));
|
|
48
49
|
const migrations = options.migrations;
|
|
49
50
|
const worker =
|
|
50
51
|
migrations.mode === "wait" && migrations.release !== undefined
|
|
@@ -87,9 +88,9 @@ export function appDatabase<R, E = never>(options: AppDatabaseOptions<R, E>) {
|
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
const defaultChangesChannel = Effect.fnUntraced(function* (name: string) {
|
|
90
|
-
const
|
|
91
|
-
const
|
|
92
|
-
return `changes_${
|
|
91
|
+
const digest = yield* Digest.Digest;
|
|
92
|
+
const hash = yield* digest.digestHex(Digest.sha256, new TextEncoder().encode(name));
|
|
93
|
+
return `changes_${hash.slice(0, 32)}`;
|
|
93
94
|
});
|
|
94
95
|
|
|
95
96
|
export const appHost: AppHostFactory = <
|
|
@@ -109,6 +110,8 @@ export const appHost: AppHostFactory = <
|
|
|
109
110
|
TRouteError = never,
|
|
110
111
|
TRouteRequirements = HostRouteRequirements,
|
|
111
112
|
TMigrationError = never,
|
|
113
|
+
TRequestServices = never,
|
|
114
|
+
TRequestRequirements = never,
|
|
112
115
|
>(
|
|
113
116
|
options: AppHostInput<
|
|
114
117
|
TRpcs,
|
|
@@ -126,7 +129,9 @@ export const appHost: AppHostFactory = <
|
|
|
126
129
|
TPreflightRequirements,
|
|
127
130
|
TRouteError,
|
|
128
131
|
TRouteRequirements,
|
|
129
|
-
TMigrationError
|
|
132
|
+
TMigrationError,
|
|
133
|
+
TRequestServices,
|
|
134
|
+
TRequestRequirements
|
|
130
135
|
>,
|
|
131
136
|
) => {
|
|
132
137
|
const preflight = hostPreflight(options.preflight, "application" in options ? Effect.succeed(isSensitiveKey) : hostSensitiveKeys(options));
|
package/src/appDatabaseHttp.ts
CHANGED
|
@@ -18,6 +18,8 @@ export function migratedHost<
|
|
|
18
18
|
TRouteError = never,
|
|
19
19
|
TRouteRequirements = HostRouteRequirements,
|
|
20
20
|
TMigrationError = never,
|
|
21
|
+
TRequestServices = never,
|
|
22
|
+
TRequestRequirements = never,
|
|
21
23
|
>(
|
|
22
24
|
options: HostOptions<
|
|
23
25
|
TRpcs,
|
|
@@ -28,7 +30,9 @@ export function migratedHost<
|
|
|
28
30
|
TServiceError,
|
|
29
31
|
TServiceRequirements,
|
|
30
32
|
TRouteError,
|
|
31
|
-
TRouteRequirements
|
|
33
|
+
TRouteRequirements,
|
|
34
|
+
TRequestServices,
|
|
35
|
+
TRequestRequirements
|
|
32
36
|
> &
|
|
33
37
|
HostPolicy & {
|
|
34
38
|
readonly migrations: MigrationOptions<TMigrations, TMigrationError>;
|
|
@@ -53,6 +57,8 @@ export function deferredHost<
|
|
|
53
57
|
TRouteError = never,
|
|
54
58
|
TRouteRequirements = HostRouteRequirements,
|
|
55
59
|
TMigrationError = never,
|
|
60
|
+
TRequestServices = never,
|
|
61
|
+
TRequestRequirements = never,
|
|
56
62
|
>(
|
|
57
63
|
application: Effect.Effect<
|
|
58
64
|
AppHttpHostOptions<
|
|
@@ -67,7 +73,9 @@ export function deferredHost<
|
|
|
67
73
|
never,
|
|
68
74
|
never,
|
|
69
75
|
TRouteError,
|
|
70
|
-
TRouteRequirements
|
|
76
|
+
TRouteRequirements,
|
|
77
|
+
TRequestServices,
|
|
78
|
+
TRequestRequirements
|
|
71
79
|
>,
|
|
72
80
|
TApplicationError,
|
|
73
81
|
TApplicationRequirements
|
package/src/appHost.ts
CHANGED
|
@@ -20,8 +20,20 @@ export type AppHttpHostOptions<
|
|
|
20
20
|
TPreflightRequirements = never,
|
|
21
21
|
TRouteError = never,
|
|
22
22
|
TRouteRequirements = HostRouteRequirements,
|
|
23
|
+
TRequestServices = never,
|
|
24
|
+
TRequestRequirements = never,
|
|
23
25
|
> = HostPreflight<TPreflight, TPreflightError, TPreflightRequirements> &
|
|
24
|
-
HostCoreOptions<
|
|
26
|
+
HostCoreOptions<
|
|
27
|
+
TRpcs,
|
|
28
|
+
THandlers,
|
|
29
|
+
THandlerError,
|
|
30
|
+
THandlerRequirements,
|
|
31
|
+
TServices,
|
|
32
|
+
TServiceError,
|
|
33
|
+
TServiceRequirements,
|
|
34
|
+
TRequestServices,
|
|
35
|
+
TRequestRequirements
|
|
36
|
+
> &
|
|
25
37
|
HostRoutes<TRouteError, TRouteRequirements> &
|
|
26
38
|
HostPolicy & { readonly migrations?: undefined };
|
|
27
39
|
function buildHttpHost<
|
|
@@ -37,6 +49,8 @@ function buildHttpHost<
|
|
|
37
49
|
TPreflightRequirements = never,
|
|
38
50
|
TRouteError = never,
|
|
39
51
|
TRouteRequirements = HostRouteRequirements,
|
|
52
|
+
TRequestServices = never,
|
|
53
|
+
TRequestRequirements = never,
|
|
40
54
|
>(
|
|
41
55
|
options: AppHttpHostOptions<
|
|
42
56
|
TRpcs,
|
|
@@ -50,7 +64,9 @@ function buildHttpHost<
|
|
|
50
64
|
TPreflightError,
|
|
51
65
|
TPreflightRequirements,
|
|
52
66
|
TRouteError,
|
|
53
|
-
TRouteRequirements
|
|
67
|
+
TRouteRequirements,
|
|
68
|
+
TRequestServices,
|
|
69
|
+
TRequestRequirements
|
|
54
70
|
>,
|
|
55
71
|
) {
|
|
56
72
|
return appHostHttp(options).pipe(Layer.provideMerge(hostPreflight(options.preflight, hostSensitiveKeys(options))), Layer.provide(NodeCrypto.layer));
|
|
@@ -69,6 +85,8 @@ type HttpHostFactory = <
|
|
|
69
85
|
TPreflightRequirements = never,
|
|
70
86
|
TRouteError = never,
|
|
71
87
|
TRouteRequirements = HostRouteRequirements,
|
|
88
|
+
TRequestServices = never,
|
|
89
|
+
TRequestRequirements = never,
|
|
72
90
|
>(
|
|
73
91
|
options: AppHttpHostOptions<
|
|
74
92
|
TRpcs,
|
|
@@ -82,7 +100,9 @@ type HttpHostFactory = <
|
|
|
82
100
|
TPreflightError,
|
|
83
101
|
TPreflightRequirements,
|
|
84
102
|
TRouteError,
|
|
85
|
-
TRouteRequirements
|
|
103
|
+
TRouteRequirements,
|
|
104
|
+
TRequestServices,
|
|
105
|
+
TRequestRequirements
|
|
86
106
|
>,
|
|
87
107
|
) => ReturnType<
|
|
88
108
|
typeof buildHttpHost<
|
|
@@ -97,7 +117,9 @@ type HttpHostFactory = <
|
|
|
97
117
|
NoInfer<TPreflightError>,
|
|
98
118
|
NoInfer<TPreflightRequirements>,
|
|
99
119
|
TRouteError,
|
|
100
|
-
TRouteRequirements
|
|
120
|
+
TRouteRequirements,
|
|
121
|
+
TRequestServices,
|
|
122
|
+
TRequestRequirements
|
|
101
123
|
>
|
|
102
124
|
>;
|
|
103
125
|
|
package/src/appHostHttp.ts
CHANGED
|
@@ -26,6 +26,8 @@ export function appHostHttp<
|
|
|
26
26
|
TServiceRequirements,
|
|
27
27
|
TRouteError = never,
|
|
28
28
|
TRouteRequirements = HostRouteRequirements,
|
|
29
|
+
TRequestServices = never,
|
|
30
|
+
TRequestRequirements = never,
|
|
29
31
|
>(
|
|
30
32
|
options: HostOptions<
|
|
31
33
|
TRpcs,
|
|
@@ -36,7 +38,9 @@ export function appHostHttp<
|
|
|
36
38
|
TServiceError,
|
|
37
39
|
TServiceRequirements,
|
|
38
40
|
TRouteError,
|
|
39
|
-
TRouteRequirements
|
|
41
|
+
TRouteRequirements,
|
|
42
|
+
TRequestServices,
|
|
43
|
+
TRequestRequirements
|
|
40
44
|
> &
|
|
41
45
|
HostPolicy,
|
|
42
46
|
) {
|
package/src/appModules.ts
CHANGED
|
@@ -8,9 +8,10 @@ import type { SchemaComponent } from "@shivaedev/sql/SchemaComponent.ts";
|
|
|
8
8
|
import type { AppModule, ModuleAdmin, ModuleLayer } from "#AppModule.ts";
|
|
9
9
|
import { DuplicateModuleQueue } from "#DuplicateModuleQueue.ts";
|
|
10
10
|
import type { MigrationOptions } from "#MigrationOptions.ts";
|
|
11
|
+
import type { GlobalServices } from "#requestServices.ts";
|
|
11
12
|
|
|
12
13
|
type ModuleField<TModules, TKey extends PropertyKey> = TModules extends unknown ? (TKey extends keyof TModules ? TModules[TKey] : never) : never;
|
|
13
|
-
type Layers<TModules extends readonly AppModule[], TKey extends "handlers" | "services" | "ports" | "workers"> = Extract<
|
|
14
|
+
type Layers<TModules extends readonly AppModule[], TKey extends "handlers" | "services" | "ports" | "workers" | "requestServices"> = Extract<
|
|
14
15
|
ModuleField<TModules[number], TKey>,
|
|
15
16
|
Layer.Any
|
|
16
17
|
>;
|
|
@@ -19,13 +20,15 @@ type Handlers<TModules extends readonly AppModule[]> = Layers<TModules, "handler
|
|
|
19
20
|
type Pages<TModules extends readonly AppModule[]> = Extract<ModuleField<Admin<TModules>, "pages">, readonly AdminPage[]>;
|
|
20
21
|
type Queues<TModules extends readonly AppModule[]> = Extract<ModuleField<TModules[number], "queues">, readonly { readonly name: string }[]>[number];
|
|
21
22
|
type Ports<TModules extends readonly AppModule[]> = Layers<TModules, "ports">;
|
|
23
|
+
type RequestLayer<TModule> = TModule extends { readonly requestServices: infer TLayer extends Layer.Any } ? TLayer : never;
|
|
24
|
+
type RequestServices<TModules extends readonly AppModule[]> = RequestLayer<TModules[number]>;
|
|
22
25
|
type Services<TModules extends readonly AppModule[]> = Layers<TModules, "services">;
|
|
23
26
|
type MigrationRequirements<TModules extends readonly AppModule[]> = Effect.Services<TModules[number]["migrations"]["loader"]>;
|
|
24
27
|
type Components<T> = T extends readonly (infer TComponent extends SchemaComponent<unknown, unknown>)[] ? TComponent : never;
|
|
25
28
|
type ModuleComponents<TModules extends AppModule> = Components<ModuleField<TModules["migrations"], "components">>;
|
|
26
29
|
|
|
27
30
|
export function appModules<const TModules extends readonly AppModule[], R = never, E = never, TRequirements = never>(
|
|
28
|
-
modules: TModules
|
|
31
|
+
modules: TModules & GlobalServices<Layer.Services<Services<NoInfer<TModules>>>, Layer.Success<RequestServices<NoInfer<TModules>>>>,
|
|
29
32
|
options?: { readonly replacements?: Layer.Layer<R, E, TRequirements> },
|
|
30
33
|
): Effect.Effect<
|
|
31
34
|
{
|
|
@@ -38,6 +41,11 @@ export function appModules<const TModules extends readonly AppModule[], R = neve
|
|
|
38
41
|
readonly admin: AdminRegistry<readonly Pages<TModules>[number][]>;
|
|
39
42
|
readonly group: RpcGroup.RpcGroup<RpcGroup.Rpcs<TModules[number]["group"] | ModuleField<Admin<TModules>, "group">>>;
|
|
40
43
|
readonly handlers: Layer.Layer<Layer.Success<Handlers<TModules>>, Layer.Error<Handlers<TModules>>, Layer.Services<Handlers<TModules>>>;
|
|
44
|
+
readonly requestServices: Layer.Layer<
|
|
45
|
+
Layer.Success<Layers<TModules, "requestServices">>,
|
|
46
|
+
never,
|
|
47
|
+
Layer.Services<Layers<TModules, "requestServices">>
|
|
48
|
+
>;
|
|
41
49
|
readonly services: Layer.Layer<
|
|
42
50
|
Layer.Success<Services<TModules> | Ports<TModules>> | R,
|
|
43
51
|
Layer.Error<Services<TModules> | Ports<TModules>> | E,
|
|
@@ -61,6 +69,7 @@ export function appModules(
|
|
|
61
69
|
readonly group: RpcGroup.Any;
|
|
62
70
|
readonly handlers: ModuleLayer;
|
|
63
71
|
readonly migrations: MigrationOptions<unknown, unknown>;
|
|
72
|
+
readonly requestServices: Layer.Layer<never, never, unknown>;
|
|
64
73
|
readonly services: ModuleLayer;
|
|
65
74
|
},
|
|
66
75
|
DuplicateModuleQueue
|
|
@@ -93,6 +102,7 @@ const composeModules = Effect.fnUntraced(function* (modules: readonly AppModule[
|
|
|
93
102
|
loader: Effect.all(modules.map((module) => module.migrations.loader)).pipe(Effect.map((entries) => entries.flat())),
|
|
94
103
|
},
|
|
95
104
|
queues,
|
|
105
|
+
requestServices: Layer.mergeAll(Layer.empty, ...modules.map((module) => module.requestServices ?? Layer.empty)),
|
|
96
106
|
services: Layer.mergeAll(Layer.empty, ...modules.map((module) => module.services)).pipe(Layer.provideMerge(ports)),
|
|
97
107
|
workers: Layer.mergeAll(Layer.empty, ...modules.map((module) => module.workers ?? Layer.empty)),
|
|
98
108
|
};
|
package/src/hostChanges.ts
CHANGED
|
@@ -2,10 +2,11 @@ import { Context, Effect, Layer, Option, Stream } from "effect";
|
|
|
2
2
|
import { Headers } from "effect/http";
|
|
3
3
|
import type { Rpc, RpcGroup } from "effect/rpc";
|
|
4
4
|
import { changesHandlerLayer } from "@shivaedev/contract/changesHandlerLayer.ts";
|
|
5
|
-
import { LiveServer } from "@shivaedev/contract/
|
|
5
|
+
import { LiveServer } from "@shivaedev/contract/live-server/service.ts";
|
|
6
|
+
import { subscribe as subscribeQueries } from "@shivaedev/contract/live-server/subscribe.ts";
|
|
6
7
|
import { CurrentViewer, type Viewer } from "@shivaedev/contract/readPolicy.ts";
|
|
7
8
|
import type { QueryReference } from "@shivaedev/contract/serverMetadata.ts";
|
|
8
|
-
import { currentSessionContext } from "@shivaedev/identity/server/currentSessionContext.ts";
|
|
9
|
+
import { currentSessionContext } from "@shivaedev/identity/server/adapters/currentSessionContext.ts";
|
|
9
10
|
import { recheckSession } from "@shivaedev/identity/server/recheckSession.ts";
|
|
10
11
|
import { resolveChanges } from "@shivaedev/identity/server/resolveChanges.ts";
|
|
11
12
|
import { revalidateStream } from "@shivaedev/identity/server/revalidateStream.ts";
|
|
@@ -64,7 +65,11 @@ function subscribe(
|
|
|
64
65
|
const read = rerunQuery(group, options);
|
|
65
66
|
type Failure = Effect.Error<typeof subscription.authorized | typeof refresh | ReturnType<typeof read>>;
|
|
66
67
|
const stream = Option.isSome(changes)
|
|
67
|
-
? Stream.unwrap(
|
|
68
|
+
? Stream.unwrap(
|
|
69
|
+
subscribeQueries<Failure, Effect.Services<ReturnType<typeof read>>, typeof read>({ ...subscription, refresh }, read).pipe(
|
|
70
|
+
Effect.provideService(LiveServer, changes.value),
|
|
71
|
+
),
|
|
72
|
+
)
|
|
68
73
|
: Stream.concat(Stream.succeed({ _tag: "Resync" } as const), Stream.never);
|
|
69
74
|
if (Option.isNone(sessions) || Option.isNone(viewer)) {
|
|
70
75
|
return stream;
|
package/src/hostOptions.ts
CHANGED
|
@@ -7,7 +7,17 @@ import type { BrowserErrorOptions } from "#browserErrorRoute.ts";
|
|
|
7
7
|
|
|
8
8
|
export type HostRouteRequirements = HttpRouter.HttpRouter | HttpRouter.Request<"Error", unknown>;
|
|
9
9
|
|
|
10
|
-
export type HostCoreOptions<
|
|
10
|
+
export type HostCoreOptions<
|
|
11
|
+
TRpcs extends Rpc.Any,
|
|
12
|
+
THandlers,
|
|
13
|
+
THandlerError,
|
|
14
|
+
THandlerRequirements,
|
|
15
|
+
TServices,
|
|
16
|
+
TServiceError,
|
|
17
|
+
TServiceRequirements,
|
|
18
|
+
TRequestServices = never,
|
|
19
|
+
TRequestRequirements = never,
|
|
20
|
+
> = {
|
|
11
21
|
readonly assets?: string | AssetOptions;
|
|
12
22
|
readonly browserErrors?: BrowserErrorOptions;
|
|
13
23
|
readonly config?: {
|
|
@@ -21,6 +31,7 @@ export type HostCoreOptions<TRpcs extends Rpc.Any, THandlers, THandlerError, THa
|
|
|
21
31
|
readonly disablePreemptiveShutdown?: boolean;
|
|
22
32
|
readonly gracefulShutdownTimeout?: Duration.Input;
|
|
23
33
|
};
|
|
34
|
+
readonly requestServices?: Layer.Layer<TRequestServices, never, TRequestRequirements>;
|
|
24
35
|
readonly nativeOrigins?: readonly string[];
|
|
25
36
|
readonly rpcPath?: HttpRouter.PathInput;
|
|
26
37
|
} & (
|
|
@@ -46,7 +57,19 @@ export type HostOptions<
|
|
|
46
57
|
TServiceRequirements,
|
|
47
58
|
TRouteError = never,
|
|
48
59
|
TRouteRequirements = HostRouteRequirements,
|
|
49
|
-
|
|
60
|
+
TRequestServices = never,
|
|
61
|
+
TRequestRequirements = never,
|
|
62
|
+
> = HostCoreOptions<
|
|
63
|
+
TRpcs,
|
|
64
|
+
THandlers,
|
|
65
|
+
THandlerError,
|
|
66
|
+
THandlerRequirements,
|
|
67
|
+
TServices,
|
|
68
|
+
TServiceError,
|
|
69
|
+
TServiceRequirements,
|
|
70
|
+
TRequestServices,
|
|
71
|
+
TRequestRequirements
|
|
72
|
+
> &
|
|
50
73
|
HostRoutes<TRouteError, TRouteRequirements>;
|
|
51
74
|
|
|
52
75
|
export type HostPolicy =
|
package/src/hostPreflight.ts
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type * as NodeCrypto from "@effect/platform-node/NodeCrypto";
|
|
2
|
+
import { Effect, Layer } from "effect";
|
|
2
3
|
import { redactingDiagnostics } from "#redactingDiagnostics.ts";
|
|
3
4
|
|
|
4
5
|
export type HostPreflight<TServices = never, TError = never, TRequirements = never> =
|
|
5
6
|
| { readonly preflight: Layer.Layer<TServices, TError, TRequirements> }
|
|
6
7
|
| ([TServices | TError | TRequirements] extends [never] ? { readonly preflight?: never } : never);
|
|
7
8
|
|
|
9
|
+
type HostCrypto = Layer.Success<typeof NodeCrypto.layer>;
|
|
10
|
+
|
|
8
11
|
export type PreflightHost<THost extends Layer.Any, TServices, TError, TRequirements> = Layer.Layer<
|
|
9
12
|
Layer.Success<THost> | TServices,
|
|
10
13
|
Layer.Error<THost> | TError,
|
|
11
|
-
Exclude<Layer.Services<THost>, TServices |
|
|
14
|
+
Exclude<Layer.Services<THost>, TServices | HostCrypto> | Exclude<TRequirements, HostCrypto>
|
|
12
15
|
>;
|
|
13
16
|
|
|
14
17
|
export function hostPreflight<TServices, TError, TRequirements, TSensitiveError>(
|
package/src/hostRpc.ts
CHANGED
|
@@ -1,17 +1,30 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
1
|
+
import { Effect, Layer } from "effect";
|
|
2
2
|
import { type HttpEffect, HttpServerResponse } from "effect/http";
|
|
3
|
-
import { type Rpc, type RpcGroup, RpcServer } from "effect/rpc";
|
|
3
|
+
import { type Rpc, type RpcGroup, RpcMiddleware, RpcServer } from "effect/rpc";
|
|
4
4
|
import { CommandGuard, commandGuardLayer, guardCommands } from "@shivaedev/contract/CommandGuard.ts";
|
|
5
|
+
import { HostVersion } from "@shivaedev/contract/HostVersion.ts";
|
|
6
|
+
import { prependMiddleware } from "@shivaedev/contract/prependMiddleware.ts";
|
|
5
7
|
import { ReadPolicyGuard, readPolicyGuardLayer } from "@shivaedev/contract/ReadPolicyGuard.ts";
|
|
6
8
|
import { subjectLayers } from "@shivaedev/contract/subjectLayers.ts";
|
|
7
9
|
import { publishCommand } from "#publishCommand.ts";
|
|
10
|
+
import type { RequestServices } from "#requestServices.ts";
|
|
8
11
|
import { tracedGroup } from "#tracedGroup.ts";
|
|
9
12
|
|
|
10
13
|
export const rpcCacheControl: HttpEffect.PreResponseHandler = (_, response) =>
|
|
11
14
|
Effect.succeed(HttpServerResponse.setHeader(response, "cache-control", "private, no-store"));
|
|
12
15
|
|
|
13
|
-
export const hostRpc = Effect.fnUntraced(function* <R extends Rpc.Any
|
|
14
|
-
|
|
16
|
+
export const hostRpc = Effect.fnUntraced(function* <R extends Rpc.Any, TServices = never, TRequirements = never>(
|
|
17
|
+
group: RpcGroup.RpcGroup<R>,
|
|
18
|
+
websocket = false,
|
|
19
|
+
services?: Layer.Layer<TServices, never, TRequirements>,
|
|
20
|
+
) {
|
|
21
|
+
const requestsMiddleware = RpcMiddleware.Service<RequestServices<TServices, TRequirements>, { provides: TServices; requires: TRequirements }>()(
|
|
22
|
+
"@shivaedev/server/RequestServices",
|
|
23
|
+
);
|
|
24
|
+
const requestLayer = Layer.mergeAll(services ?? Layer.empty);
|
|
25
|
+
const requested = yield* prependMiddleware(group.middleware(requestsMiddleware), requestsMiddleware.key);
|
|
26
|
+
const requests = yield* prependMiddleware(requested, ReadPolicyGuard.key);
|
|
27
|
+
const guarded = yield* guardCommands(requests.merge(HostVersion.application));
|
|
15
28
|
const traced = tracedGroup(guarded);
|
|
16
29
|
const readPolicy = yield* ReadPolicyGuard.pipe(Effect.provide(readPolicyGuardLayer({ websocket })));
|
|
17
30
|
const publication = yield* CommandGuard.pipe(Effect.provide(commandGuardLayer(publishCommand)));
|
|
@@ -20,5 +33,6 @@ export const hostRpc = Effect.fnUntraced(function* <R extends Rpc.Any>(group: Rp
|
|
|
20
33
|
Effect.provideService(ReadPolicyGuard, readPolicy),
|
|
21
34
|
Effect.provideService(CommandGuard, publication),
|
|
22
35
|
Effect.provide(subjectLayers(group)),
|
|
36
|
+
Effect.provide(Layer.succeed(requestsMiddleware, (effect) => Effect.provide(effect, requestLayer))),
|
|
23
37
|
);
|
|
24
38
|
});
|
package/src/hostRpcRoutes.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { ByteSize, Effect, Layer } from "effect";
|
|
|
2
2
|
import { HttpEffect, HttpIncomingMessage, HttpRouter, HttpServerRequest, HttpServerResponse } from "effect/http";
|
|
3
3
|
import * as HttpStatus from "effect/http/HttpStatus";
|
|
4
4
|
import { type Rpc, type RpcGroup, RpcSerialization } from "effect/rpc";
|
|
5
|
-
import { HostVersion } from "@shivaedev/contract/HostVersion.ts";
|
|
6
5
|
import { validateReadPolicies } from "@shivaedev/contract/validateReadPolicies.ts";
|
|
7
6
|
import type { schemaSensitiveKeys } from "@shivaedev/errors/schemaSensitiveKeys.ts";
|
|
8
7
|
import { localRpcGuard } from "@shivaedev/identity/server/adapters/local.ts";
|
|
@@ -17,42 +16,57 @@ import { hostRpc, rpcCacheControl } from "#hostRpc.ts";
|
|
|
17
16
|
import type { hostTransport } from "#hostTransport.ts";
|
|
18
17
|
import { hostVersionLayer } from "#hostVersionLayer.ts";
|
|
19
18
|
import { redactingRpcSerialization } from "#redactingRpcSerialization.ts";
|
|
19
|
+
import type { RequestRequirements } from "#requestServices.ts";
|
|
20
20
|
import { rpcRequestTracing } from "#rpcRequestTracing.ts";
|
|
21
21
|
import { socketRpc } from "#socketRpc.ts";
|
|
22
22
|
import { UnixSocketRequest } from "#UnixSocketRequest.ts";
|
|
23
23
|
|
|
24
|
-
type BuiltRoutes<TRpcs extends Rpc.Any, THandlers, TError, TRequirements> = ReturnType<
|
|
25
|
-
typeof buildRpcRoutes<TRpcs, THandlers, TError, TRequirements>
|
|
24
|
+
type BuiltRoutes<TRpcs extends Rpc.Any, THandlers, TError, TRequirements, TRequestServices = never, TRequestRequirements = never> = ReturnType<
|
|
25
|
+
typeof buildRpcRoutes<TRpcs, THandlers, TError, TRequirements, TRequestServices, TRequestRequirements>
|
|
26
26
|
>;
|
|
27
|
-
type RouteOptions<TRpcs extends Rpc.Any, THandlers, TError, TRequirements> = {
|
|
27
|
+
type RouteOptions<TRpcs extends Rpc.Any, THandlers, TError, TRequirements, TRequestServices = never, TRequestRequirements = never> = {
|
|
28
28
|
readonly config?: { readonly buildVersion?: string };
|
|
29
29
|
readonly group: RpcGroup.RpcGroup<TRpcs>;
|
|
30
30
|
readonly handlers: Layer.Layer<THandlers, TError, TRequirements>;
|
|
31
|
+
readonly requestServices?: Layer.Layer<TRequestServices, never, TRequestRequirements>;
|
|
31
32
|
readonly rpcPath?: HttpRouter.PathInput;
|
|
32
33
|
} & HostPolicy;
|
|
33
34
|
|
|
34
|
-
export function hostRpcRoutes<TRpcs extends Rpc.Any, THandlers, TError, TRequirements>(
|
|
35
|
-
options: RouteOptions<TRpcs, THandlers, TError, TRequirements> & { readonly policy: "loopback" },
|
|
35
|
+
export function hostRpcRoutes<TRpcs extends Rpc.Any, THandlers, TError, TRequirements, TRequestServices = never, TRequestRequirements = never>(
|
|
36
|
+
options: RouteOptions<TRpcs, THandlers, TError, TRequirements, TRequestServices, TRequestRequirements> & { readonly policy: "loopback" },
|
|
36
37
|
transport: Effect.Success<ReturnType<typeof hostTransport>>,
|
|
37
38
|
sensitive: Effect.Success<ReturnType<typeof schemaSensitiveKeys>>,
|
|
38
39
|
): Layer.Layer<
|
|
39
|
-
Layer.Success<BuiltRoutes<TRpcs, THandlers, TError, TRequirements>>,
|
|
40
|
-
Layer.Error<BuiltRoutes<TRpcs, THandlers, TError, TRequirements>>,
|
|
41
|
-
| TRequirements
|
|
40
|
+
Layer.Success<BuiltRoutes<TRpcs, THandlers, TError, TRequirements, TRequestServices, TRequestRequirements>>,
|
|
41
|
+
Layer.Error<BuiltRoutes<TRpcs, THandlers, TError, TRequirements, TRequestServices, TRequestRequirements>>,
|
|
42
|
+
| Exclude<TRequirements, TRequestServices>
|
|
43
|
+
| RequestRequirements<TRpcs, TRequestRequirements>
|
|
42
44
|
| Exclude<Rpc.ServicesServer<TRpcs>, THandlers>
|
|
43
|
-
| Exclude<
|
|
45
|
+
| Exclude<
|
|
46
|
+
Layer.Services<BuiltRoutes<TRpcs, THandlers, TError, TRequirements, TRequestServices, TRequestRequirements>>,
|
|
47
|
+
SessionPolicy | HttpRouter.Request<"Requires", SessionPolicy> | TRequestServices | TRequestRequirements
|
|
48
|
+
>
|
|
44
49
|
>;
|
|
45
|
-
export function hostRpcRoutes<TRpcs extends Rpc.Any, THandlers, TError, TRequirements>(
|
|
46
|
-
...args: Parameters<typeof buildRpcRoutes<TRpcs, THandlers, TError, TRequirements>>
|
|
47
|
-
):
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
export function hostRpcRoutes<TRpcs extends Rpc.Any, THandlers, TError, TRequirements, TRequestServices = never, TRequestRequirements = never>(
|
|
51
|
+
...args: Parameters<typeof buildRpcRoutes<TRpcs, THandlers, TError, TRequirements, TRequestServices, TRequestRequirements>>
|
|
52
|
+
): Layer.Layer<
|
|
53
|
+
Layer.Success<BuiltRoutes<TRpcs, THandlers, TError, TRequirements, TRequestServices, TRequestRequirements>>,
|
|
54
|
+
Layer.Error<BuiltRoutes<TRpcs, THandlers, TError, TRequirements, TRequestServices, TRequestRequirements>>,
|
|
55
|
+
| Exclude<
|
|
56
|
+
Layer.Services<BuiltRoutes<TRpcs, THandlers, TError, TRequirements, TRequestServices, TRequestRequirements>>,
|
|
57
|
+
TRequestServices | TRequestRequirements
|
|
58
|
+
>
|
|
59
|
+
| Exclude<TRequirements, TRequestServices>
|
|
60
|
+
| RequestRequirements<TRpcs, TRequestRequirements>
|
|
61
|
+
>;
|
|
62
|
+
export function hostRpcRoutes<TRpcs extends Rpc.Any, THandlers, TError, TRequirements, TRequestServices = never, TRequestRequirements = never>(
|
|
63
|
+
...args: Parameters<typeof buildRpcRoutes<TRpcs, THandlers, TError, TRequirements, TRequestServices, TRequestRequirements>>
|
|
50
64
|
) {
|
|
51
65
|
return buildRpcRoutes(...args);
|
|
52
66
|
}
|
|
53
67
|
|
|
54
|
-
function buildRpcRoutes<TRpcs extends Rpc.Any, THandlers, TError, TRequirements>(
|
|
55
|
-
options: RouteOptions<TRpcs, THandlers, TError, TRequirements>,
|
|
68
|
+
function buildRpcRoutes<TRpcs extends Rpc.Any, THandlers, TError, TRequirements, TRequestServices = never, TRequestRequirements = never>(
|
|
69
|
+
options: RouteOptions<TRpcs, THandlers, TError, TRequirements, TRequestServices, TRequestRequirements>,
|
|
56
70
|
{ bodySize, trustedProxy, nativeOrigins }: Effect.Success<ReturnType<typeof hostTransport>>,
|
|
57
71
|
sensitive: Effect.Success<ReturnType<typeof schemaSensitiveKeys>>,
|
|
58
72
|
) {
|
|
@@ -66,10 +80,10 @@ function buildRpcRoutes<TRpcs extends Rpc.Any, THandlers, TError, TRequirements>
|
|
|
66
80
|
Effect.gen(function* () {
|
|
67
81
|
yield* validateReadPolicies(options.group);
|
|
68
82
|
const wire = redactingRpcSerialization(yield* RpcSerialization.RpcSerialization, sensitive);
|
|
69
|
-
const group = options.group
|
|
70
|
-
const handler = yield* hostRpc(group).pipe(Effect.provideService(RpcSerialization.RpcSerialization, wire));
|
|
83
|
+
const group = options.group;
|
|
84
|
+
const handler = yield* hostRpc(group, false, options.requestServices).pipe(Effect.provideService(RpcSerialization.RpcSerialization, wire));
|
|
71
85
|
const guarded = Effect.flatMap(UnixSocketRequest, (unix) => (unix ? handler : localRpcGuard(handler, trustedProxy, nativeOrigins)));
|
|
72
|
-
const websocket = yield* hostRpc(group, true).pipe(Effect.provideService(RpcSerialization.RpcSerialization, wire));
|
|
86
|
+
const websocket = yield* hostRpc(group, true, options.requestServices).pipe(Effect.provideService(RpcSerialization.RpcSerialization, wire));
|
|
73
87
|
yield* router.add(
|
|
74
88
|
"OPTIONS",
|
|
75
89
|
options.rpcPath ?? "/rpc",
|
package/src/prepareMigrations.ts
CHANGED
|
@@ -6,14 +6,14 @@ import { type PendingPostgresMigrations, pendingPostgresMigrations } from "@shiv
|
|
|
6
6
|
import type { MigrationOptions } from "#MigrationOptions.ts";
|
|
7
7
|
|
|
8
8
|
export function prepareMigrations<R, E>(migrations: MigrationOptions<R, E>) {
|
|
9
|
-
switch (migrations.mode) {
|
|
9
|
+
switch (migrations.mode ?? "migrate") {
|
|
10
10
|
case "check": {
|
|
11
11
|
const { release: _release, ...schema } = migrations;
|
|
12
12
|
return assertPostgresMigrations(schema);
|
|
13
13
|
}
|
|
14
14
|
case "wait":
|
|
15
15
|
return waitForMigrations(migrations);
|
|
16
|
-
|
|
16
|
+
case "migrate":
|
|
17
17
|
return migratePostgres({ ...migrations, lockTimeout: migrations.lockTimeout ?? "5 seconds" }).pipe(Effect.asVoid);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Schema } from "effect";
|
|
2
|
+
import type { Rpc, RpcMiddleware } from "effect/rpc";
|
|
3
|
+
import type { Identity, OptionalIdentity, SessionUser, SessionUserWithProviderAccounts } from "@shivaedev/identity/identity.ts";
|
|
4
|
+
import type { Subject } from "@shivaedev/identity/subject.ts";
|
|
5
|
+
|
|
6
|
+
export type RequestContext = Identity | OptionalIdentity | SessionUser | SessionUserWithProviderAccounts | Subject;
|
|
7
|
+
export type RequestRequirements<TRpcs extends Rpc.Any, TRequirements> = TRpcs extends unknown
|
|
8
|
+
? Exclude<TRequirements, Rpc.ExtractProvides<TRpcs, TRpcs["_tag"]>>
|
|
9
|
+
: never;
|
|
10
|
+
export type GlobalServices<TRequirements, TRequestServices = never> = [Extract<TRequirements, RequestContext | TRequestServices>] extends [never]
|
|
11
|
+
? unknown
|
|
12
|
+
: { readonly "Register caller-dependent services in requestServices": never };
|
|
13
|
+
|
|
14
|
+
export interface RequestServices<TServices, TRequirements> extends RpcMiddleware.AnyId {
|
|
15
|
+
readonly [RpcMiddleware.TypeId]: {
|
|
16
|
+
readonly provides: TServices;
|
|
17
|
+
readonly requires: TRequirements;
|
|
18
|
+
readonly error: typeof Schema.Never;
|
|
19
|
+
readonly clientError: never;
|
|
20
|
+
};
|
|
21
|
+
}
|