@barqjs/start 0.2.0-next.0 → 0.2.0-next.1
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/README.md +26 -0
- package/dist/{client-BHyIiYxt.js → client-BsyxVCyu.js} +49 -22
- package/dist/client-BsyxVCyu.js.map +1 -0
- package/dist/{client-DHCV7yvQ.d.ts → client-DidH0F2e.d.ts} +28 -18
- package/dist/client-DidH0F2e.d.ts.map +1 -0
- package/dist/client.d.ts +25 -3
- package/dist/client.js +3 -3
- package/dist/{env-qA8EyOr1.d.ts → env-Bhk_aIkx.d.ts} +1 -3
- package/dist/env-Bhk_aIkx.d.ts.map +1 -0
- package/dist/env.d.ts +1 -1
- package/dist/env.js +1 -2
- package/dist/{index-Bm_-MTj6.d.ts → index-B4o7eyCr.d.ts} +32 -22
- package/dist/index-B4o7eyCr.d.ts.map +1 -0
- package/dist/index.d.ts +18 -5
- package/dist/index.js +4 -4
- package/dist/{middleware-BdVlE8qm.d.ts → middleware-B-tI8QHQ.d.ts} +1 -3
- package/dist/middleware-B-tI8QHQ.d.ts.map +1 -0
- package/dist/middleware.d.ts +1 -1
- package/dist/middleware.js +1 -2
- package/dist/middleware.js.map +1 -1
- package/dist/prerender.d.ts +22 -2
- package/dist/prerender.d.ts.map +1 -1
- package/dist/prerender.js +4 -4
- package/dist/prerender.js.map +1 -1
- package/dist/protocol.d.ts +0 -2
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +1 -2
- package/dist/serve.d.ts +14 -5
- package/dist/serve.d.ts.map +1 -1
- package/dist/serve.js +3 -5
- package/dist/serve.js.map +1 -1
- package/dist/{server-BV3xKmLa.js → server-DG6jb_NA.js} +162 -57
- package/dist/server-DG6jb_NA.js.map +1 -0
- package/dist/server.d.ts +21 -4
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +1 -1
- package/dist/{src-ChnB_xug.js → src-odXG7kLA.js} +31 -20
- package/dist/src-odXG7kLA.js.map +1 -0
- package/dist/{static-fn-DgjNArBe.js → static-fn-CXjJi-It.js} +10 -11
- package/dist/{static-fn-DgjNArBe.js.map → static-fn-CXjJi-It.js.map} +1 -1
- package/package.json +11 -11
- package/src/client.ts +27 -1
- package/src/context.ts +33 -0
- package/src/fn-error.ts +25 -1
- package/src/frames-client.ts +5 -1
- package/src/index.ts +32 -6
- package/src/live-server.ts +154 -44
- package/src/server.ts +43 -7
- package/src/wire-types.ts +2 -3
- package/dist/client-BHyIiYxt.js.map +0 -1
- package/dist/client-DHCV7yvQ.d.ts.map +0 -1
- package/dist/env-qA8EyOr1.d.ts.map +0 -1
- package/dist/index-Bm_-MTj6.d.ts.map +0 -1
- package/dist/middleware-BdVlE8qm.d.ts.map +0 -1
- package/dist/server-BV3xKmLa.js.map +0 -1
- package/dist/src-ChnB_xug.js.map +0 -1
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { G as WithClient, K as WithServer, S as NOT_FOUND, f as FreshMiddleware, g as Middleware, k as REDIRECT, t as BuiltMiddleware } from "./middleware-
|
|
1
|
+
import { G as WithClient, K as WithServer, S as NOT_FOUND, f as FreshMiddleware, g as Middleware, k as REDIRECT, t as BuiltMiddleware } from "./middleware-B-tI8QHQ.js";
|
|
2
2
|
import { AnySerializationAdapter } from "@barqjs/server/codec";
|
|
3
|
-
import "@barqjs/web";
|
|
4
3
|
import { Child, Incoming, JSXElement } from "@barqjs/core";
|
|
5
|
-
|
|
4
|
+
import "@barqjs/web";
|
|
6
5
|
/**
|
|
7
6
|
* How a server function's failure reaches its caller in the browser. Its own
|
|
8
7
|
* module, so every module that answers a call can raise it and none of them
|
|
@@ -20,6 +19,13 @@ interface ServerFnIssue {
|
|
|
20
19
|
readonly message: string;
|
|
21
20
|
readonly path?: readonly (string | number)[];
|
|
22
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* The label on an answer from a deployment that does not know the call: an
|
|
24
|
+
* unknown id (a tab holding the previous build's ids across a deploy, or a
|
|
25
|
+
* removed function), or a call from another build. A CDN 404 and a skew 404
|
|
26
|
+
* look alike without it.
|
|
27
|
+
*/
|
|
28
|
+
declare const UNKNOWN_HEADER = "x-barq-fn-unknown";
|
|
23
29
|
/** What a failed call's JSON body may carry. */
|
|
24
30
|
interface FailedAnswer {
|
|
25
31
|
readonly message?: string;
|
|
@@ -60,10 +66,14 @@ declare class ServerFnError extends Error {
|
|
|
60
66
|
* for the reason above.
|
|
61
67
|
*/
|
|
62
68
|
readonly response?: Response;
|
|
69
|
+
/**
|
|
70
|
+
* The deployment that answered does not know this call: the page came from
|
|
71
|
+
* another build, or the function was removed. Retrying cannot help; reloading
|
|
72
|
+
* the document onto the current build can.
|
|
73
|
+
*/
|
|
74
|
+
readonly unknownFunction?: true;
|
|
63
75
|
constructor(id: string, status: number, response?: Response, answer?: FailedAnswer);
|
|
64
76
|
}
|
|
65
|
-
//#endregion
|
|
66
|
-
//#region src/static-fn.d.ts
|
|
67
77
|
/** Where a static answer is served from, under the client output. */
|
|
68
78
|
declare const STATIC_PREFIX = "/_barq/static/";
|
|
69
79
|
/** Where the answer for one call is, as a URL. */
|
|
@@ -81,8 +91,6 @@ declare function staticUrl(id: string, input: unknown): string;
|
|
|
81
91
|
* `sendContext` is not, and a `Response` or a stream is never written.
|
|
82
92
|
*/
|
|
83
93
|
declare const staticFunctionMiddleware: BuiltMiddleware<WithServer<WithClient<FreshMiddleware, Promise<{} | null>>, Promise<unknown>>>;
|
|
84
|
-
//#endregion
|
|
85
|
-
//#region src/stubs.d.ts
|
|
86
94
|
/**
|
|
87
95
|
* The stubs a page has made, and how `live` calls one: a module of its own so
|
|
88
96
|
* the frames client finds a stub by id without importing the stub's module.
|
|
@@ -101,8 +109,6 @@ interface LiveRequest {
|
|
|
101
109
|
/** How `live` calls a stub at the live address, its client middleware around the fetch. */
|
|
102
110
|
declare const LIVE_CALL: unique symbol;
|
|
103
111
|
declare function clientStub(id: string): Stub | undefined;
|
|
104
|
-
//#endregion
|
|
105
|
-
//#region src/frames.d.ts
|
|
106
112
|
/**
|
|
107
113
|
* A slot on a server component's props: a call the browser answers with its
|
|
108
114
|
* own content. What the call is given crosses as data, and its `children` as a
|
|
@@ -137,8 +143,6 @@ interface FrameRef {
|
|
|
137
143
|
declare function isFrame(value: unknown): boolean;
|
|
138
144
|
/** Dispatched on `document` once a frame update has been applied to the page. */
|
|
139
145
|
declare const FRAME_APPLIED_EVENT = "barq:frame-applied";
|
|
140
|
-
//#endregion
|
|
141
|
-
//#region src/frames-client.d.ts
|
|
142
146
|
/** What a frame renders as: a component taking the slots' content as props. */
|
|
143
147
|
type FrameComponent = ((props: Record<string, unknown>) => Node) & {
|
|
144
148
|
readonly [FRAME]: FrameRef;
|
|
@@ -161,16 +165,12 @@ interface LiveIterable<T> extends AsyncIterable<T> {
|
|
|
161
165
|
/** Told `"connected"` per connection, `"reconnecting"` with the error per death, `"closed"` at the end. */
|
|
162
166
|
onstatus?: (status: LiveStatus, error?: unknown) => void;
|
|
163
167
|
}
|
|
164
|
-
//#endregion
|
|
165
|
-
//#region src/live-client.d.ts
|
|
166
168
|
/**
|
|
167
169
|
* Declare a server function's answer a standing one. In the browser, calling
|
|
168
170
|
* the result returns an iterable that stays connected; on the server it is the
|
|
169
171
|
* call itself, a frame it answers with marked for the page to connect.
|
|
170
172
|
*/
|
|
171
173
|
declare function live<In, Out>(fn: ServerFn<In, Out, never>): (...args: Parameters<ServerFn<In, Out, never>>) => LiveIterable<Awaited<Out>>;
|
|
172
|
-
//#endregion
|
|
173
|
-
//#region src/client.d.ts
|
|
174
174
|
declare const SERVER_FN: unique symbol;
|
|
175
175
|
/** Where mounted server functions answer. */
|
|
176
176
|
declare const RPC_PREFIX = "/_barq/fn/";
|
|
@@ -323,6 +323,8 @@ interface ServerFnMeta {
|
|
|
323
323
|
id: string;
|
|
324
324
|
/** Absent for `POST`, which is every function that did not ask for `GET`. */
|
|
325
325
|
readonly method?: ServerFnMethod;
|
|
326
|
+
/** Declared `createServerFn({ broadcast: true })`; the server half alone knows it. */
|
|
327
|
+
readonly broadcast?: true;
|
|
326
328
|
}
|
|
327
329
|
/**
|
|
328
330
|
* The request header every GET call the stub makes carries, and is refused
|
|
@@ -336,6 +338,15 @@ interface ServerFnMeta {
|
|
|
336
338
|
* one-click CSRF carrying `SameSite=Lax` cookies.
|
|
337
339
|
*/
|
|
338
340
|
declare const RPC_CALLER = "x-barq-fn";
|
|
341
|
+
/**
|
|
342
|
+
* The build a call was bundled with. A server stamped with another build
|
|
343
|
+
* answers it with a 409 rather than running a function whose arguments or
|
|
344
|
+
* result may have changed shape under the same id. A GET read does not send
|
|
345
|
+
* it: its url is its identity to every cache in between.
|
|
346
|
+
*/
|
|
347
|
+
declare const BUILD_HEADER = "x-barq-build";
|
|
348
|
+
/** The build `@barqjs/vite` stamped this bundle with, or none outside a build. */
|
|
349
|
+
declare const BUNDLED_BUILD: string | undefined;
|
|
339
350
|
/** Where a GET call's payload rides, since a GET has no body. */
|
|
340
351
|
declare const PAYLOAD_PARAM = "payload";
|
|
341
352
|
/**
|
|
@@ -435,6 +446,5 @@ type ChainStep = Middleware | AnyServerFn;
|
|
|
435
446
|
declare function inlineServerFns(chain: readonly ChainStep[]): readonly Middleware[];
|
|
436
447
|
/** Whether a value is a server function, by brand rather than by shape. */
|
|
437
448
|
declare function isServerFn(value: unknown): value is ServerFn<unknown, unknown>;
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
//# sourceMappingURL=client-DHCV7yvQ.d.ts.map
|
|
449
|
+
export { ServerFnThrown as $, clientRpc as A, frameAdapter as B, ServerFnArgs as C, ServerFnMethod as D, ServerFnMeta as E, live as F, LIVE_CALL as G, FRAME_APPLIED_EVENT as H, FrameComponent as I, STATIC_PREFIX as J, LiveRequest as K, LiveIterable as L, inlineServerFns as M, isServerFn as N, Streamed as O, urlOf as P, ServerFnIssue as Q, LiveStatus as R, ServerFn as S, ServerFnInputAnswer as T, Slot as U, BindingSlot as V, isFrame as W, staticUrl as X, staticFunctionMiddleware as Y, ServerFnError as Z, RpcNotFound as _, DATA_SUFFIX as a, SERVER_FN as b, RPC_CALLER as c, RPC_PREFIX as d, UNKNOWN_HEADER as et, RPC_RESPONSE as f, RpcEnvelope as g, RpcControl as h, ChainStep as i, dataOf as j, callOptionsOf as k, RPC_CONTEXT as l, RPC_THROWN as m, BUILD_HEADER as n, LIVE_SUFFIX as o, RPC_STREAM as p, clientStub as q, BUNDLED_BUILD as r, PAYLOAD_PARAM as s, AnyServerFn as t, RPC_CONTROL as u, RpcRedirect as v, ServerFnCallOptions as w, SERVER_FN_CHAIN as x, RpcStreamLine as y, applyFrameResponse as z };
|
|
450
|
+
//# sourceMappingURL=client-DidH0F2e.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-DidH0F2e.d.ts","names":[],"sources":["../src/fn-error.ts","../src/static-fn.ts","../src/stubs.ts","../src/frames.ts","../src/frames-client.ts","../src/live-client.ts","../src/client.ts"],"mappings":";;;;;;;;;;UAOiB;WACN;WACA;;WAEA;;;UAIM;WACN;WACA;;;;;;;;cASE;;UAGI;WACN;WACA,kBAAkB;WAClB,SAAS;;;;;;;;;;;;cAaP,sBAAsB;WACxB;;;;;;WAMA,kBAAkB;;;;;;WAMlB,SAAS;;;;;;;;;;WAUT,WAAW;;;;;;WAMX;EACT,YAAY,YAAY,gBAAgB,WAAW,UAAU,SAAS;;;cChD3D;;iBA8EG,UAAU,YAAY;;;;;;;;;;;;;cA+CzB,0BAA0B,gBACrC,WAAW,WAAW,iBAAiB,qBAAqB;;;;;;KCnJlD,SAAS,sBAAsB;WAChC;aAAiB;;;;UAIX;WACN;WACA,QAAQ;;;cAIN;iBAYG,WAAW,aAAa;;;;;;;KCO5B,KAAK,0BACf,OAAO,SAAS;WAAe;WAAiC,WAAW;OACxE;;;;;;;;;KAUO,YACV,uBACA,mBAAmB,iCACX,mBACL;WAAkB;MAA6B,SAAS,MACxD,MAAM;WAAe;MAA6B,SAAS;;cAGnD;;UAGI;WACN;WACA;;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;WACD,MAAM;;WAEN,cAAc;;WAEd,QAAQ;;;;;WAKR;;;;;;;;;;KAWC,cAAc;;iBAGV,MAAM;;iBAKN,OAAO;;iBAOP,cAAc,mBAAmB;;;;;;;;;;;;iBAgBjC,UAAU,IAAI,KAAK,eAAe,yBAChD,YACA,yBAAwB,aACxB;WAAsB,SAAS;IAC9B,SAAS,IAAI,KAAK;;cAkRR;;KAGD,YAAY,aAAa;;;;;;iBAOrB,gBAAgB,gBAAgB,uBAAuB;;iBAavD,WAAW,iBAAiB,SAAS"}
|
package/dist/client.d.ts
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The client half of a server function, and NOTHING the server half needs.
|
|
3
|
+
*
|
|
4
|
+
* Its own module because of what importing it costs. The compiler replaces a
|
|
5
|
+
* server-function module's contents with `export const x = clientRpc("<id>")`,
|
|
6
|
+
* and that stub used to import from `@barqjs/start` — whose index re-exports
|
|
7
|
+
* `context.ts`, which is `node:async_hooks`. Every client bundle that reached
|
|
8
|
+
* one server function therefore pulled the request-context machinery, the
|
|
9
|
+
* middleware runner, the validators and the error classes, and Vite printed
|
|
10
|
+
* "node:async_hooks has been externalized for browser compatibility" on every
|
|
11
|
+
* build.
|
|
12
|
+
*
|
|
13
|
+
* That was survivable while a route module was `lazy()`, because the cost sat
|
|
14
|
+
* in that route's own chunk. It stopped being survivable when `routeTree.gen.ts`
|
|
15
|
+
* started importing route modules STATICALLY: measured on
|
|
16
|
+
* `packages/kitchen-sink`, 25.7 kB of it moved into the set every page
|
|
17
|
+
* preloads, for an application with two server functions on one route.
|
|
18
|
+
*
|
|
19
|
+
* So the stub imports from here. `index.ts` re-exports every name below, so an
|
|
20
|
+
* application still writes `import { createServerFn } from "@barqjs/start"` and
|
|
21
|
+
* nothing about the authoring surface changes.
|
|
22
|
+
*/
|
|
23
|
+
import { $ as ServerFnThrown, A as clientRpc, B as frameAdapter, C as ServerFnArgs, D as ServerFnMethod, E as ServerFnMeta, F as live, G as LIVE_CALL, H as FRAME_APPLIED_EVENT, I as FrameComponent, J as STATIC_PREFIX, K as LiveRequest, L as LiveIterable, M as inlineServerFns, N as isServerFn, O as Streamed, P as urlOf, Q as ServerFnIssue, R as LiveStatus, S as ServerFn, T as ServerFnInputAnswer, U as Slot, V as BindingSlot, W as isFrame, X as staticUrl, Y as staticFunctionMiddleware, Z as ServerFnError, _ as RpcNotFound, a as DATA_SUFFIX, b as SERVER_FN, c as RPC_CALLER, d as RPC_PREFIX, et as UNKNOWN_HEADER, f as RPC_RESPONSE, g as RpcEnvelope, h as RpcControl, i as ChainStep, j as dataOf, k as callOptionsOf, l as RPC_CONTEXT, m as RPC_THROWN, n as BUILD_HEADER, o as LIVE_SUFFIX, p as RPC_STREAM, q as clientStub, r as BUNDLED_BUILD, s as PAYLOAD_PARAM, t as AnyServerFn, u as RPC_CONTROL, v as RpcRedirect, w as ServerFnCallOptions, x as SERVER_FN_CHAIN, y as RpcStreamLine, z as applyFrameResponse } from "./client-DidH0F2e.js";
|
|
24
|
+
import { S as NOT_FOUND, k as REDIRECT } from "./middleware-B-tI8QHQ.js";
|
|
25
|
+
export { AnyServerFn, BUILD_HEADER, BUNDLED_BUILD, type BindingSlot, ChainStep, DATA_SUFFIX, FRAME_APPLIED_EVENT, type FrameComponent, LIVE_CALL, LIVE_SUFFIX, type LiveIterable, type LiveRequest, type LiveStatus, NOT_FOUND, PAYLOAD_PARAM, REDIRECT, RPC_CALLER, RPC_CONTEXT, RPC_CONTROL, RPC_PREFIX, RPC_RESPONSE, RPC_STREAM, RPC_THROWN, RpcControl, RpcEnvelope, RpcNotFound, RpcRedirect, RpcStreamLine, SERVER_FN, SERVER_FN_CHAIN, STATIC_PREFIX, ServerFn, ServerFnArgs, ServerFnCallOptions, ServerFnError, ServerFnInputAnswer, type ServerFnIssue, ServerFnMeta, ServerFnMethod, type ServerFnThrown, type Slot, Streamed, UNKNOWN_HEADER, applyFrameResponse, callOptionsOf, clientRpc, clientStub, dataOf, frameAdapter, inlineServerFns, isFrame, isServerFn, live, staticFunctionMiddleware, staticUrl, urlOf };
|
package/dist/client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as live, D as applyFrameResponse, G as LIVE_CALL, J as UNKNOWN_HEADER, K as clientStub, M as FRAME_APPLIED_EVENT, O as frameAdapter, S as urlOf, V as isFrame, _ as callOptionsOf, a as PAYLOAD_PARAM, b as inlineServerFns, c as RPC_CONTROL, d as RPC_STREAM, f as RPC_THROWN, g as SERVER_FN_CHAIN, h as SERVER_FN, i as LIVE_SUFFIX, l as RPC_PREFIX, m as RpcRedirect, n as BUNDLED_BUILD, o as RPC_CALLER, p as RpcNotFound, q as ServerFnError, r as DATA_SUFFIX, s as RPC_CONTEXT, t as BUILD_HEADER, u as RPC_RESPONSE, v as clientRpc, x as isServerFn, y as dataOf } from "./client-BsyxVCyu.js";
|
|
2
2
|
import { NOT_FOUND, REDIRECT } from "./middleware.js";
|
|
3
|
-
import { i as staticUrl, r as staticFunctionMiddleware, t as STATIC_PREFIX } from "./static-fn-
|
|
4
|
-
export { DATA_SUFFIX, FRAME_APPLIED_EVENT, LIVE_CALL, LIVE_SUFFIX, NOT_FOUND, PAYLOAD_PARAM, REDIRECT, RPC_CALLER, RPC_CONTEXT, RPC_CONTROL, RPC_PREFIX, RPC_RESPONSE, RPC_STREAM, RPC_THROWN, RpcNotFound, RpcRedirect, SERVER_FN, SERVER_FN_CHAIN, STATIC_PREFIX, ServerFnError, applyFrameResponse, callOptionsOf, clientRpc, clientStub, dataOf, frameAdapter, inlineServerFns, isFrame, isServerFn, live, staticFunctionMiddleware, staticUrl, urlOf };
|
|
3
|
+
import { i as staticUrl, r as staticFunctionMiddleware, t as STATIC_PREFIX } from "./static-fn-CXjJi-It.js";
|
|
4
|
+
export { BUILD_HEADER, BUNDLED_BUILD, DATA_SUFFIX, FRAME_APPLIED_EVENT, LIVE_CALL, LIVE_SUFFIX, NOT_FOUND, PAYLOAD_PARAM, REDIRECT, RPC_CALLER, RPC_CONTEXT, RPC_CONTROL, RPC_PREFIX, RPC_RESPONSE, RPC_STREAM, RPC_THROWN, RpcNotFound, RpcRedirect, SERVER_FN, SERVER_FN_CHAIN, STATIC_PREFIX, ServerFnError, UNKNOWN_HEADER, applyFrameResponse, callOptionsOf, clientRpc, clientStub, dataOf, frameAdapter, inlineServerFns, isFrame, isServerFn, live, staticFunctionMiddleware, staticUrl, urlOf };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/env.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Functions whose body belongs to ONE side, resolved by the compiler.
|
|
4
3
|
*
|
|
@@ -44,6 +43,5 @@ declare function createIsomorphicFn(): IsomorphicBuilder;
|
|
|
44
43
|
declare function createServerOnlyFn<Args extends readonly unknown[], Out>(fn: (...args: Args) => Out): (...args: Args) => Out;
|
|
45
44
|
/** The mirror: the body reaches the browser and the server gets a throw. */
|
|
46
45
|
declare function createClientOnlyFn<Args extends readonly unknown[], Out>(fn: (...args: Args) => Out): (...args: Args) => Out;
|
|
47
|
-
//#endregion
|
|
48
46
|
export { createServerOnlyFn as a, createIsomorphicFn as i, IsomorphicFn as n, createClientOnlyFn as r, IsomorphicBuilder as t };
|
|
49
|
-
//# sourceMappingURL=env-
|
|
47
|
+
//# sourceMappingURL=env-Bhk_aIkx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-Bhk_aIkx.d.ts","names":[],"sources":["../src/env.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;KAqBY,aAAa,sCAAsC,uBAC1D,MAAM,SACN;UAEY,kBACf,sCACA,yBACQ,aAAa,MAAM;EAC3B,OAAO,8BAA8B,GAAG,QAAQ,MAAM,MAAM,IAAI,kBAAkB,GAAG;EACrF,OAAO,8BAA8B,GAAG,QAAQ,MAAM,MAAM,IAAI,kBAAkB,GAAG;;;;;;;;;;;iBAYvE,sBAAsB;;;;;;;;iBAgCtB,mBAAmB,iCAAiC,KAClE,QAAQ,MAAM,SAAS,UAClB,MAAM,SAAS;;iBAKN,mBAAmB,iCAAiC,KAClE,QAAQ,MAAM,SAAS,UAClB,MAAM,SAAS"}
|
package/dist/env.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as createServerOnlyFn, i as createIsomorphicFn, n as IsomorphicFn, r as createClientOnlyFn, t as IsomorphicBuilder } from "./env-
|
|
1
|
+
import { a as createServerOnlyFn, i as createIsomorphicFn, n as IsomorphicFn, r as createClientOnlyFn, t as IsomorphicBuilder } from "./env-Bhk_aIkx.js";
|
|
2
2
|
export { IsomorphicBuilder, IsomorphicFn, createClientOnlyFn, createIsomorphicFn, createServerOnlyFn };
|
package/dist/env.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/env.ts
|
|
2
2
|
/**
|
|
3
3
|
* One name, two bodies, one of which survives the compile.
|
|
4
4
|
*
|
|
@@ -38,7 +38,6 @@ function createServerOnlyFn(fn) {
|
|
|
38
38
|
function createClientOnlyFn(fn) {
|
|
39
39
|
return fn;
|
|
40
40
|
}
|
|
41
|
-
//#endregion
|
|
42
41
|
export { createClientOnlyFn, createIsomorphicFn, createServerOnlyFn };
|
|
43
42
|
|
|
44
43
|
//# sourceMappingURL=env.js.map
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { E as OpenContext, F as StandardInput, I as StandardOutput, R as StandardSchemaLike, T as NoContribution, V as Validator, d as Empty, g as Middleware, h as Merged, n as Carries, r as ChainContribution, s as Contribution } from "./middleware-BdVlE8qm.js";
|
|
1
|
+
import { RequestEventLocals, ResponseStub } from "@barqjs/web";
|
|
3
2
|
import { commitResponseStub } from "@barqjs/web/internal";
|
|
3
|
+
import { E as OpenContext, F as StandardInput, I as StandardOutput, R as StandardSchemaLike, T as NoContribution, V as Validator, d as Empty, g as Middleware, h as Merged, n as Carries, r as ChainContribution, s as Contribution } from "./middleware-B-tI8QHQ.js";
|
|
4
4
|
import { AnySerializationAdapter, AnySerializationAdapter as AnySerializationAdapter$1, SerializationAdapter, createSerializationAdapter } from "@barqjs/server/codec";
|
|
5
|
-
import {
|
|
6
|
-
//#region src/cookies.d.ts
|
|
5
|
+
import { D as ServerFnMethod, E as ServerFnMeta, O as Streamed, S as ServerFn, i as ChainStep, t as AnyServerFn } from "./client-DidH0F2e.js";
|
|
7
6
|
/**
|
|
8
7
|
* Cookies, parsed and serialized here rather than taken from a package.
|
|
9
8
|
*
|
|
@@ -77,8 +76,6 @@ declare function serializeCookie(name: string, value: string, options?: CookieOp
|
|
|
77
76
|
* a silent one.
|
|
78
77
|
*/
|
|
79
78
|
declare function deleteCookieLine(name: string, options?: CookieOptions): string;
|
|
80
|
-
//#endregion
|
|
81
|
-
//#region src/session.d.ts
|
|
82
79
|
/** What a session holds. An application narrows it with the type argument. */
|
|
83
80
|
type SessionData = Record<string, unknown>;
|
|
84
81
|
interface Session<T extends SessionData = SessionData> {
|
|
@@ -191,8 +188,6 @@ declare function getSession<T extends SessionData = SessionData>(config: Session
|
|
|
191
188
|
declare function updateSession<T extends SessionData = SessionData>(config: SessionConfig, patch: Partial<T> | ((current: Partial<T>) => Partial<T> | undefined)): Promise<SessionManager<T>>;
|
|
192
189
|
/** Drop the session and expire its cookie. */
|
|
193
190
|
declare function clearSession(config: SessionConfig): Promise<void>;
|
|
194
|
-
//#endregion
|
|
195
|
-
//#region src/start-instance.d.ts
|
|
196
191
|
interface StartOptions {
|
|
197
192
|
/** Runs for every request the server answers: a page, a route handler, a server function. */
|
|
198
193
|
readonly requestMiddleware?: readonly Middleware[];
|
|
@@ -203,7 +198,7 @@ interface StartOptions {
|
|
|
203
198
|
* function's input and result and in the page's seed. Installed when the
|
|
204
199
|
* options are first read, which both sides do before they encode anything.
|
|
205
200
|
*/
|
|
206
|
-
readonly serializationAdapters?: readonly AnySerializationAdapter[];
|
|
201
|
+
readonly serializationAdapters?: readonly AnySerializationAdapter$1[];
|
|
207
202
|
/**
|
|
208
203
|
* What a route that says nothing about `ssr` does, for every route: `true`,
|
|
209
204
|
* `false` (rendered in the browser alone) or `"data-only"` (loaders run on
|
|
@@ -265,8 +260,6 @@ declare function createStart<const Options extends StartOptions>(options: () =>
|
|
|
265
260
|
declare function startOptions(): StartOptions;
|
|
266
261
|
/** Test seam. Not for application use. */
|
|
267
262
|
declare function clearStart(): void;
|
|
268
|
-
//#endregion
|
|
269
|
-
//#region src/context.d.ts
|
|
270
263
|
/**
|
|
271
264
|
* Headers and a status a handler asked for, merged into whatever is returned:
|
|
272
265
|
* the request event's response head, Solid's `ResponseStub`, under the name
|
|
@@ -355,10 +348,27 @@ declare const createResponseDraft: () => ResponseDraft;
|
|
|
355
348
|
* back to the package's own sheet, which is where a module-scope rule belongs.
|
|
356
349
|
*/
|
|
357
350
|
declare function collectRequestCss(): string;
|
|
351
|
+
/**
|
|
352
|
+
* The compiled module stylesheets a page made of `routes` reaches, in the order
|
|
353
|
+
* the page's modules run, when a dev server answered that, and `undefined`
|
|
354
|
+
* where none did: a build links its stylesheets instead of inlining them.
|
|
355
|
+
*
|
|
356
|
+
* A dev server imports the application once and renders every page from the
|
|
357
|
+
* one registry, so without this a page's head carried the rules of every module
|
|
358
|
+
* any earlier request had reached. `@barqjs/vite` installs the answer, read off
|
|
359
|
+
* its module graph in the order a build links the same modules' stylesheets.
|
|
360
|
+
*/
|
|
361
|
+
declare function devStylesheets(routes: readonly string[]): Promise<DevStylesheets | undefined> | undefined;
|
|
362
|
+
/** `@barqjs/css`'s `CssScope`, restated so this package does not import that one. */
|
|
363
|
+
interface DevStylesheets {
|
|
364
|
+
readonly keys: readonly string[];
|
|
365
|
+
readonly modules: ReadonlySet<string>;
|
|
366
|
+
}
|
|
358
367
|
/** `@barqjs/css`'s `CssSink`, restated so this package does not import that one. */
|
|
359
368
|
interface CssSink {
|
|
360
369
|
(key: string, rules: string): boolean;
|
|
361
370
|
head?(late: () => string): void;
|
|
371
|
+
owns?(key: string): boolean;
|
|
362
372
|
}
|
|
363
373
|
declare function installCssSink(setSink: (sink: CssSink) => void): void;
|
|
364
374
|
/**
|
|
@@ -554,8 +564,6 @@ declare function draftedStatus(draft: ResponseDraft | undefined, fallback: numbe
|
|
|
554
564
|
status: number;
|
|
555
565
|
statusText?: string;
|
|
556
566
|
};
|
|
557
|
-
//#endregion
|
|
558
|
-
//#region src/rate-limit.d.ts
|
|
559
567
|
/** One key's usage, as the store hands it back. */
|
|
560
568
|
interface RateLimitCount {
|
|
561
569
|
/** How many requests this key has made in the current window. */
|
|
@@ -653,8 +661,6 @@ declare function byIP(options?: {
|
|
|
653
661
|
* and the wrong one for an authorization check, which is why this is not one.
|
|
654
662
|
*/
|
|
655
663
|
declare function rateLimit(options: RateLimitOptions): Middleware;
|
|
656
|
-
//#endregion
|
|
657
|
-
//#region src/timing.d.ts
|
|
658
664
|
/**
|
|
659
665
|
* `Server-Timing` entries for the development server: how long a page's
|
|
660
666
|
* `beforeLoad`, its awaited loaders and its render took, and how long a server
|
|
@@ -671,8 +677,6 @@ interface ServerTiming {
|
|
|
671
677
|
header(): string;
|
|
672
678
|
}
|
|
673
679
|
declare function serverTiming(): ServerTiming;
|
|
674
|
-
//#endregion
|
|
675
|
-
//#region src/wire-types.d.ts
|
|
676
680
|
/**
|
|
677
681
|
* What can cross the wire, as types: the check `createServerFn` runs on a
|
|
678
682
|
* handler's result and a validator's input, so a value the codec would refuse
|
|
@@ -724,8 +728,6 @@ type Strictness = boolean | {
|
|
|
724
728
|
};
|
|
725
729
|
/** Whether a side is checked: on unless `strict` or its side says `false`. */
|
|
726
730
|
type StrictOn<Strict, Side extends "input" | "output"> = Strict extends false ? false : Strict extends { readonly [Key in Side]: false; } ? false : true;
|
|
727
|
-
//#endregion
|
|
728
|
-
//#region src/index.d.ts
|
|
729
731
|
/** TanStack's `json`: a JSON `Response`, which a handler returns as its answer. */
|
|
730
732
|
declare function json(payload: unknown, init?: ResponseInit): Response;
|
|
731
733
|
declare function checkInput(built: {
|
|
@@ -882,6 +884,15 @@ interface ServerFnOptions<Method extends ServerFnMethod = ServerFnMethod, Strict
|
|
|
882
884
|
* `createSerializationAdapter` carries.
|
|
883
885
|
*/
|
|
884
886
|
readonly strict?: Strict;
|
|
887
|
+
/**
|
|
888
|
+
* The answer is the same for every caller with the same arguments, so a
|
|
889
|
+
* `live` call shares one rendering with every other connection asking the
|
|
890
|
+
* same thing: Solid 2.0's `broadcast`. The handler still runs per call, as the
|
|
891
|
+
* gate it is (an auth check, a redirect), and a joiner's own answer is closed
|
|
892
|
+
* unread. The shared rendering belongs to no request: it reads no cookie,
|
|
893
|
+
* header or session, and it stops when its last connection goes.
|
|
894
|
+
*/
|
|
895
|
+
readonly broadcast?: boolean;
|
|
885
896
|
}
|
|
886
897
|
/**
|
|
887
898
|
* Author a server function. The value this returns is replaced by the compiler
|
|
@@ -910,6 +921,5 @@ declare function serverRpc<In, Out, Data = In, Context extends object = Empty, M
|
|
|
910
921
|
* Empty for a client stub, which carries no chain because it carries no handler.
|
|
911
922
|
*/
|
|
912
923
|
declare function middlewareOf(fn: AnyServerFn): readonly Middleware[];
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
//# sourceMappingURL=index-Bm_-MTj6.d.ts.map
|
|
924
|
+
export { getRequestHeaders as $, RateLimitCount as A, Session as At, appendResponseHeader as B, CookieOptions as Bt, InputProblem as C, Register as Ct, WireProblem as D, clearStart as Dt, Strictness as E, StartOptions as Et, rateLimit as F, getSession as Ft, deleteCookie as G, clearResponseHeaders as H, parseCookies as Ht, DevStylesheets as I, sealSession as It, getCookie as J, devStylesheets as K, ForwardedForTrust as L, unsealSession as Lt, RateLimitStore as M, SessionData as Mt, byIP as N, SessionManager as Nt, ServerTiming as O, createStart as Ot, memoryStore as P, clearSession as Pt, getRequestHeader as Q, RequestContext as R, updateSession as Rt, Crossable as S, GlobalRequestContext as St, StrictOn as T, StartInstance as Tt, collectRequestCss as U, serializeCookie as Ut, applyResponseDraft as V, deleteCookieLine as Vt, createResponseDraft as W, getGlobalStartContext as X, getCookies as Y, getRequest as Z, createSerializationAdapter as _, setResponseStatus as _t, FreshServerFn as a, getResponseHeaders as at, middlewareOf as b, FunctionContextOf as bt, HandlerData as c, invalidateFrames as ct, SerializationAdapter as d, peekResponseDraft as dt, getRequestHost as et, ServerFnBuilder as f, removeResponseHeader as ft, checkInput as g, setResponseHeaders as gt, Validates as h, setResponseHeader as ht, FnWithValidator as i, getResponseHeader as it, RateLimitOptions as j, SessionConfig as jt, serverTiming as k, startOptions as kt, InputCheck as l, markResponseSent as lt, ServerFnState as m, setRequestMiddlewareContext as mt, CallerInput as n, getRequestProtocol as nt, HandlerContext as o, getResponseStatus as ot, ServerFnOptions as p, setCookie as pt, draftedStatus as q, FnWithChain as r, getRequestUrl as rt, HandlerContextOf as s, installCssSink as st, AnySerializationAdapter as t, getRequestIP as tt, ResultCheck as u, peekRequest as ut, createServerFn as v, takeSendContext as vt, ResultProblem as w, RequestContextOf as wt, serverRpc as x, GlobalFunctionContext as xt, json as y, withRequest as yt, ResponseDraft as z, useSession as zt };
|
|
925
|
+
//# sourceMappingURL=index-B4o7eyCr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-B4o7eyCr.d.ts","names":["AnySerializationAdapter"],"sources":["../src/cookies.ts","../src/session.ts","../src/start-instance.ts","../src/context.ts","../src/rate-limit.ts","../src/timing.ts","../src/wire-types.ts","../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA2BiB;WACN;WACA,UAAU;WACV;;WAEA;;WAEA;WACA;WACA;WACA;WACA;;;;;;;WAOA,UAAU;;;;;;;;;;;iBA0CL,aAAa,oCAAoC;;;;;;;iBAmCjD,gBAAgB,cAAc,eAAe,UAAS;;;;;;;;;;iBAwGtD,iBAAiB,cAAc,UAAS;;KCpM5C,cAAc;UAET,QAAQ,UAAU,cAAc;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,MAAM,MAAM,KAAK,WACvB,SAAS,IAAI,SAAS,QAAQ,OAAO;;;;;;;;;;;;;iBAoHxB,aAAa,IAAI,uBAAuB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Server functions — the builder, and the two stubs the compiler emits.
|
|
3
|
+
*
|
|
4
|
+
* A server function is written once and reachable from both sides. The compiler
|
|
5
|
+
* decides which side a module is being compiled for and replaces the handler
|
|
6
|
+
* with the matching stub: `serverRpc` on the server, where the body runs, and
|
|
7
|
+
* `clientRpc` on the client, where it becomes a fetch. That decision is a
|
|
8
|
+
* compile-time one and is never taken at runtime, so the body cannot reach a
|
|
9
|
+
* client bundle by being unreachable-but-present.
|
|
10
|
+
*
|
|
11
|
+
* Nothing in this file is safe to call from a browser bundle except
|
|
12
|
+
* `clientRpc`. `./server` is where the request handler lives.
|
|
13
|
+
*/
|
|
14
|
+
import { $ as ServerFnThrown, A as clientRpc, C as ServerFnArgs, D as ServerFnMethod, E as ServerFnMeta, F as live, H as FRAME_APPLIED_EVENT, J as STATIC_PREFIX, L as LiveIterable, N as isServerFn, O as Streamed, Q as ServerFnIssue, R as LiveStatus, S as ServerFn, T as ServerFnInputAnswer, U as Slot, V as BindingSlot, W as isFrame, X as staticUrl, Y as staticFunctionMiddleware, Z as ServerFnError, _ as RpcNotFound, a as DATA_SUFFIX, b as SERVER_FN, c as RPC_CALLER, d as RPC_PREFIX, et as UNKNOWN_HEADER, h as RpcControl, i as ChainStep, l as RPC_CONTEXT, n as BUILD_HEADER, o as LIVE_SUFFIX, p as RPC_STREAM, s as PAYLOAD_PARAM, t as AnyServerFn, u as RPC_CONTROL, v as RpcRedirect, w as ServerFnCallOptions } from "./client-DidH0F2e.js";
|
|
15
|
+
import { $ as runMiddleware, A as RequestMiddleware, B as ValidationError, C as NextOptions, D as OwnReplaced, E as OpenContext, F as StandardInput, G as WithClient, H as ValidatorInput, I as StandardOutput, J as applyValidator, K as WithServer, L as StandardSchema, M as RequestMiddlewareFn, N as RequestMiddlewareNext, O as Plain, P as RequestMiddlewareStart, Q as isInputError, R as StandardSchemaLike, S as NOT_FOUND, T as NoContribution, U as ValidatorReplaced, V as Validator, W as WithChain, X as flattenMiddleware, Y as createMiddleware, Z as isBuiltMiddleware, _ as MiddlewareContext, a as ClientReplaced, b as MiddlewareOptions, c as ContributionOf, d as Empty, et as runRequestMiddleware, f as FreshMiddleware, g as Middleware, h as Merged, i as ClientMiddlewareContext, j as RequestMiddlewareContext, k as REDIRECT, m as InputError, n as Carries, o as ContributedBy, p as FromNext, q as WithValidator, r as ChainContribution, s as Contribution, t as BuiltMiddleware, tt as toValidator, u as DataAt, v as MiddlewareFn, w as NextResult, x as MiddlewareState, y as MiddlewareNext, z as UncheckedInputError } from "./middleware-B-tI8QHQ.js";
|
|
16
|
+
import { a as createServerOnlyFn, i as createIsomorphicFn, n as IsomorphicFn, r as createClientOnlyFn, t as IsomorphicBuilder } from "./env-Bhk_aIkx.js";
|
|
17
|
+
import { $ as getRequestHeaders, A as RateLimitCount, At as Session, B as appendResponseHeader, Bt as CookieOptions, C as InputProblem, Ct as Register, D as WireProblem, Dt as clearStart, E as Strictness, Et as StartOptions, F as rateLimit, Ft as getSession, G as deleteCookie, H as clearResponseHeaders, Ht as parseCookies, I as DevStylesheets, It as sealSession, J as getCookie, K as devStylesheets, L as ForwardedForTrust, Lt as unsealSession, M as RateLimitStore, Mt as SessionData, N as byIP, Nt as SessionManager, O as ServerTiming, Ot as createStart, P as memoryStore, Pt as clearSession, Q as getRequestHeader, R as RequestContext, Rt as updateSession, S as Crossable, St as GlobalRequestContext, T as StrictOn, Tt as StartInstance, U as collectRequestCss, Ut as serializeCookie, V as applyResponseDraft, Vt as deleteCookieLine, W as createResponseDraft, X as getGlobalStartContext, Y as getCookies, Z as getRequest, _ as createSerializationAdapter, _t as setResponseStatus, a as FreshServerFn, at as getResponseHeaders, b as middlewareOf, bt as FunctionContextOf, c as HandlerData, ct as invalidateFrames, d as SerializationAdapter, dt as peekResponseDraft, et as getRequestHost, f as ServerFnBuilder, ft as removeResponseHeader, g as checkInput, gt as setResponseHeaders, h as Validates, ht as setResponseHeader, i as FnWithValidator, it as getResponseHeader, j as RateLimitOptions, jt as SessionConfig, k as serverTiming, kt as startOptions, l as InputCheck, lt as markResponseSent, m as ServerFnState, mt as setRequestMiddlewareContext, n as CallerInput, nt as getRequestProtocol, o as HandlerContext, ot as getResponseStatus, p as ServerFnOptions, pt as setCookie, q as draftedStatus, r as FnWithChain, rt as getRequestUrl, s as HandlerContextOf, st as installCssSink, t as AnySerializationAdapter, tt as getRequestIP, u as ResultCheck, ut as peekRequest, v as createServerFn, vt as takeSendContext, w as ResultProblem, wt as RequestContextOf, x as serverRpc, xt as GlobalFunctionContext, y as json, yt as withRequest, z as ResponseDraft, zt as useSession } from "./index-B4o7eyCr.js";
|
|
18
|
+
export { type AnySerializationAdapter, type AnyServerFn, BUILD_HEADER, type BindingSlot, type BuiltMiddleware, CallerInput, type Carries, type ChainContribution, type ChainStep, type ClientMiddlewareContext, type ClientReplaced, type ContributedBy, type Contribution, type ContributionOf, type CookieOptions, type Crossable, DATA_SUFFIX, type DataAt, type DevStylesheets, type Empty, FRAME_APPLIED_EVENT, FnWithChain, FnWithValidator, type ForwardedForTrust, type FreshMiddleware, FreshServerFn, type FromNext, type FunctionContextOf, type GlobalFunctionContext, type GlobalRequestContext, HandlerContext, HandlerContextOf, HandlerData, InputCheck, InputError, type InputProblem, type IsomorphicBuilder, type IsomorphicFn, LIVE_SUFFIX, type LiveIterable, type LiveStatus, type Merged, type Middleware, type MiddlewareContext, type MiddlewareFn, type MiddlewareNext, type MiddlewareOptions, type MiddlewareState, NOT_FOUND, type NextOptions, type NextResult, type NoContribution, type OpenContext, type OwnReplaced, PAYLOAD_PARAM, type Plain, REDIRECT, RPC_CALLER, RPC_CONTEXT, RPC_CONTROL, RPC_PREFIX, RPC_STREAM, type RateLimitCount, type RateLimitOptions, type RateLimitStore, type Register, type RequestContext, type RequestContextOf, type RequestMiddleware, type RequestMiddlewareContext, type RequestMiddlewareFn, type RequestMiddlewareNext, type RequestMiddlewareStart, type ResponseDraft, ResultCheck, type ResultProblem, type RpcControl, RpcNotFound, RpcRedirect, SERVER_FN, STATIC_PREFIX, type SerializationAdapter, type ServerFn, type ServerFnArgs, ServerFnBuilder, type ServerFnCallOptions, ServerFnError, type ServerFnInputAnswer, type ServerFnIssue, type ServerFnMeta, type ServerFnMethod, ServerFnOptions, ServerFnState, type ServerFnThrown, type ServerTiming, type Session, type SessionConfig, type SessionData, type SessionManager, type Slot, type StandardInput, type StandardOutput, type StandardSchema, type StandardSchemaLike, type StartInstance, type StartOptions, type Streamed, type StrictOn, type Strictness, UNKNOWN_HEADER, UncheckedInputError, Validates, ValidationError, type Validator, type ValidatorInput, type ValidatorReplaced, type WireProblem, type WithChain, type WithClient, type WithServer, type WithValidator, appendResponseHeader, applyResponseDraft, applyValidator, byIP, checkInput, clearResponseHeaders, clearSession, clearStart, clientRpc, collectRequestCss, createClientOnlyFn, createIsomorphicFn, createMiddleware, createResponseDraft, createSerializationAdapter, createServerFn, createServerOnlyFn, createStart, deleteCookie, deleteCookieLine, devStylesheets, draftedStatus, flattenMiddleware, getCookie, getCookies, getGlobalStartContext, getRequest, getRequestHeader, getRequestHeaders, getRequestHost, getRequestIP, getRequestProtocol, getRequestUrl, getResponseHeader, getResponseHeaders, getResponseStatus, getSession, installCssSink, invalidateFrames, isBuiltMiddleware, isFrame, isInputError, isServerFn, json, live, markResponseSent, memoryStore, middlewareOf, parseCookies, peekRequest, peekResponseDraft, rateLimit, removeResponseHeader, runMiddleware, runRequestMiddleware, sealSession, serializeCookie, serverRpc, serverTiming, setCookie, setRequestMiddlewareContext, setResponseHeader, setResponseHeaders, setResponseStatus, startOptions, staticFunctionMiddleware, staticUrl, takeSendContext, toValidator, unsealSession, updateSession, useSession, withRequest };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import {
|
|
1
|
+
import { $ as parseCookies, A as getRequestHeaders, C as devStylesheets, D as getGlobalStartContext, E as getCookies, F as getResponseHeader, G as setCookie, H as peekRequest, I as getResponseHeaders, J as setResponseHeaders, K as setRequestMiddlewareContext, L as getResponseStatus, M as getRequestIP, N as getRequestProtocol, O as getRequest, P as getRequestUrl, Q as deleteCookieLine, R as installCssSink, S as deleteCookie, T as getCookie, U as peekResponseDraft, V as markResponseSent, W as removeResponseHeader, X as takeSendContext, Y as setResponseStatus, Z as withRequest, _ as appendResponseHeader, a as middlewareOf, b as collectRequestCss, c as clearSession, d as unsealSession, et as serializeCookie, f as updateSession, g as rateLimit, h as memoryStore, i as json, j as getRequestHost, k as getRequestHeader, l as getSession, m as byIP, n as createSerializationAdapter, o as serverRpc, p as useSession, q as setResponseHeader, r as createServerFn, s as serverTiming, t as checkInput, u as sealSession, v as applyResponseDraft, w as draftedStatus, x as createResponseDraft, y as clearResponseHeaders, z as invalidateFrames } from "./src-odXG7kLA.js";
|
|
2
|
+
import { C as live, E as startOptions, J as UNKNOWN_HEADER, M as FRAME_APPLIED_EVENT, T as createStart, V as isFrame, a as PAYLOAD_PARAM, c as RPC_CONTROL, d as RPC_STREAM, h as SERVER_FN, i as LIVE_SUFFIX, l as RPC_PREFIX, m as RpcRedirect, o as RPC_CALLER, p as RpcNotFound, q as ServerFnError, r as DATA_SUFFIX, s as RPC_CONTEXT, t as BUILD_HEADER, v as clientRpc, w as clearStart, x as isServerFn } from "./client-BsyxVCyu.js";
|
|
3
3
|
import { InputError, NOT_FOUND, REDIRECT, UncheckedInputError, ValidationError, applyValidator, createMiddleware, flattenMiddleware, isBuiltMiddleware, isInputError, runMiddleware, runRequestMiddleware, toValidator } from "./middleware.js";
|
|
4
|
-
import { i as staticUrl, r as staticFunctionMiddleware, t as STATIC_PREFIX } from "./static-fn-
|
|
4
|
+
import { i as staticUrl, r as staticFunctionMiddleware, t as STATIC_PREFIX } from "./static-fn-CXjJi-It.js";
|
|
5
5
|
import { createClientOnlyFn, createIsomorphicFn, createServerOnlyFn } from "./env.js";
|
|
6
|
-
export { DATA_SUFFIX, FRAME_APPLIED_EVENT, InputError, LIVE_SUFFIX, NOT_FOUND, PAYLOAD_PARAM, REDIRECT, RPC_CALLER, RPC_CONTEXT, RPC_CONTROL, RPC_PREFIX, RPC_STREAM, RpcNotFound, RpcRedirect, SERVER_FN, STATIC_PREFIX, ServerFnError, UncheckedInputError, ValidationError, appendResponseHeader, applyResponseDraft, applyValidator, byIP, checkInput, clearResponseHeaders, clearSession, clearStart, clientRpc, collectRequestCss, createClientOnlyFn, createIsomorphicFn, createMiddleware, createResponseDraft, createSerializationAdapter, createServerFn, createServerOnlyFn, createStart, deleteCookie, deleteCookieLine, draftedStatus, flattenMiddleware, getCookie, getCookies, getGlobalStartContext, getRequest, getRequestHeader, getRequestHeaders, getRequestHost, getRequestIP, getRequestProtocol, getRequestUrl, getResponseHeader, getResponseHeaders, getResponseStatus, getSession, installCssSink, invalidateFrames, isBuiltMiddleware, isFrame, isInputError, isServerFn, json, live, markResponseSent, memoryStore, middlewareOf, parseCookies, peekRequest, peekResponseDraft, rateLimit, removeResponseHeader, runMiddleware, runRequestMiddleware, sealSession, serializeCookie, serverRpc, serverTiming, setCookie, setRequestMiddlewareContext, setResponseHeader, setResponseHeaders, setResponseStatus, startOptions, staticFunctionMiddleware, staticUrl, takeSendContext, toValidator, unsealSession, updateSession, useSession, withRequest };
|
|
6
|
+
export { BUILD_HEADER, DATA_SUFFIX, FRAME_APPLIED_EVENT, InputError, LIVE_SUFFIX, NOT_FOUND, PAYLOAD_PARAM, REDIRECT, RPC_CALLER, RPC_CONTEXT, RPC_CONTROL, RPC_PREFIX, RPC_STREAM, RpcNotFound, RpcRedirect, SERVER_FN, STATIC_PREFIX, ServerFnError, UNKNOWN_HEADER, UncheckedInputError, ValidationError, appendResponseHeader, applyResponseDraft, applyValidator, byIP, checkInput, clearResponseHeaders, clearSession, clearStart, clientRpc, collectRequestCss, createClientOnlyFn, createIsomorphicFn, createMiddleware, createResponseDraft, createSerializationAdapter, createServerFn, createServerOnlyFn, createStart, deleteCookie, deleteCookieLine, devStylesheets, draftedStatus, flattenMiddleware, getCookie, getCookies, getGlobalStartContext, getRequest, getRequestHeader, getRequestHeaders, getRequestHost, getRequestIP, getRequestProtocol, getRequestUrl, getResponseHeader, getResponseHeaders, getResponseStatus, getSession, installCssSink, invalidateFrames, isBuiltMiddleware, isFrame, isInputError, isServerFn, json, live, markResponseSent, memoryStore, middlewareOf, parseCookies, peekRequest, peekResponseDraft, rateLimit, removeResponseHeader, runMiddleware, runRequestMiddleware, sealSession, serializeCookie, serverRpc, serverTiming, setCookie, setRequestMiddlewareContext, setResponseHeader, setResponseHeaders, setResponseStatus, startOptions, staticFunctionMiddleware, staticUrl, takeSendContext, toValidator, unsealSession, updateSession, useSession, withRequest };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/middleware.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Middleware, and the input validation it composes.
|
|
4
3
|
*
|
|
@@ -571,6 +570,5 @@ declare function runMiddleware(chain: readonly Middleware[], half: "server" | "c
|
|
|
571
570
|
/** The innermost work: the handler on the server, the fetch on the client. */
|
|
572
571
|
readonly run: (data: unknown) => Promise<unknown>;
|
|
573
572
|
}): Promise<unknown>;
|
|
574
|
-
//#endregion
|
|
575
573
|
export { runMiddleware as $, RequestMiddleware as A, ValidationError as B, NextOptions as C, OwnReplaced as D, OpenContext as E, StandardInput as F, WithClient as G, ValidatorInput as H, StandardOutput as I, applyValidator as J, WithServer as K, StandardSchema as L, RequestMiddlewareFn as M, RequestMiddlewareNext as N, Plain as O, RequestMiddlewareStart as P, isInputError as Q, StandardSchemaLike as R, NOT_FOUND as S, NoContribution as T, ValidatorReplaced as U, Validator as V, WithChain as W, flattenMiddleware as X, createMiddleware as Y, isBuiltMiddleware as Z, MiddlewareContext as _, ClientReplaced as a, MiddlewareOptions as b, ContributionOf as c, Empty as d, runRequestMiddleware as et, FreshMiddleware as f, Middleware as g, Merged as h, ClientMiddlewareContext as i, RequestMiddlewareContext as j, REDIRECT as k, ContributionOfState as l, InputError as m, Carries as n, ContributedBy as o, FromNext as p, WithValidator as q, ChainContribution as r, Contribution as s, BuiltMiddleware as t, toValidator as tt, DataAt as u, MiddlewareFn as v, NextResult as w, MiddlewareState as x, MiddlewareNext as y, UncheckedInputError as z };
|
|
576
|
-
//# sourceMappingURL=middleware-
|
|
574
|
+
//# sourceMappingURL=middleware-B-tI8QHQ.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware-B-tI8QHQ.d.ts","names":[],"sources":["../src/middleware.ts"],"mappings":";;;;;;;;;;;;;;;;;;UAmBiB,eAAe,cAAc,MAAM;EAClD;IACE;IACA;IACA,WACE;MAEI,OAAO;;MACP,QAAQ;QACV;MAAU,OAAO;;MAAU,QAAQ;;;aAE9B;eAAmB,OAAO;eAAa,QAAQ;;;;;UAK3C;WACN;aAAwB,WAAW;;;;KAIlC,cAAc,WAAW,YAAY;WAA6B,aAAa;KACvF;;KAIQ,eAAe,WAAW,YAAY;WAA6B,cAAc;KACzF,MACA;WAA0B;aAAwB,WAAW,yBAAyB;;IACpF,UAAU,QAAQ;;KAInB,YAAY,UAAU;WAA0B,mBAAmB;0BAC9C,OACpB,YAAY,qBAAqB;KAIlC,UAAU,UAAU;WAA0B,aAAa;IAAQ;;;;;;;;;;KAW5D,UAAU,KAAK,wBAAwB;;;;;;;;KASvC,eAAe,KACvB,UAAU,OACR,mBAAmB,IAAI,QAAQ;WACtB,QAAQ,mBAAmB,IAAI,QAAQ;;;iBAGtC,YAAY,GAAG,OAAO,eAAe,KAAK,UAAU;cA2B9D;;;;;;cAOO,mBAAmB;;;;;;YAMpB;;;iBAII,aAAa,iBAAiB,SAAS;cAQ1C,wBAAwB;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ACd,SAAS;WAA+B;IACvC,kBAAkB;iBACL,iBAAiB,UAAU,oBAAoB,gBAAgB;;;;;;;KAuFnE,kBAAkB,cAAc,kBAAkB,mBAAmB,aAC/E,QAAQ,oBAAoB;WACjB,SAAS;EAClB,iBAAiB,uBAAuB,cACtC,OAAO,QACN,kBAAkB,UAAU,OAAO;EACtC,OAAO,QACL,KAAK,SAAS,yBAAyB,+BAA+B,SACrE,kBAAkB,WAAW,OAAO,YAAY,QAAQ;;;UAI9C;WACN,SAAS;WACT;WACA;;WAEA,SAAS;;;;;;;;;;iBAWE,qBAAqB,GACzC,gBAAgB,cAChB,OAAO,wBACP,WAAW,QAAQ,KAClB,QAAQ;;;;;;;;;;;;;;iBAuDK,kBAAkB,gBAAgB,cAAc,0BAAqB;;iBAuB/D,eACpB,WAAW,gCACX,eACC;;;;;;;;;;;;;;iBAoBmB,cACpB,gBAAgB,cAChB,2BACA;WACW;WACA,QAAQ;;WAER,SAAS;;WAET,gBAAgB;;WAEhB,aAAa;;WAEb,UAAU;;WAEV;IAAU,gBAAgB;;;WAE1B;aAAkB;;;WAElB;;WAEA,MAAM,kBAAkB;IAElC"}
|
package/dist/middleware.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as runMiddleware, A as RequestMiddleware, B as ValidationError, C as NextOptions, D as OwnReplaced, E as OpenContext, F as StandardInput, G as WithClient, H as ValidatorInput, I as StandardOutput, J as applyValidator, K as WithServer, L as StandardSchema, M as RequestMiddlewareFn, N as RequestMiddlewareNext, O as Plain, P as RequestMiddlewareStart, Q as isInputError, R as StandardSchemaLike, S as NOT_FOUND, T as NoContribution, U as ValidatorReplaced, V as Validator, W as WithChain, X as flattenMiddleware, Y as createMiddleware, Z as isBuiltMiddleware, _ as MiddlewareContext, a as ClientReplaced, b as MiddlewareOptions, c as ContributionOf, d as Empty, et as runRequestMiddleware, f as FreshMiddleware, g as Middleware, h as Merged, i as ClientMiddlewareContext, j as RequestMiddlewareContext, k as REDIRECT, l as ContributionOfState, m as InputError, n as Carries, o as ContributedBy, p as FromNext, q as WithValidator, r as ChainContribution, s as Contribution, t as BuiltMiddleware, tt as toValidator, u as DataAt, v as MiddlewareFn, w as NextResult, x as MiddlewareState, y as MiddlewareNext, z as UncheckedInputError } from "./middleware-
|
|
1
|
+
import { $ as runMiddleware, A as RequestMiddleware, B as ValidationError, C as NextOptions, D as OwnReplaced, E as OpenContext, F as StandardInput, G as WithClient, H as ValidatorInput, I as StandardOutput, J as applyValidator, K as WithServer, L as StandardSchema, M as RequestMiddlewareFn, N as RequestMiddlewareNext, O as Plain, P as RequestMiddlewareStart, Q as isInputError, R as StandardSchemaLike, S as NOT_FOUND, T as NoContribution, U as ValidatorReplaced, V as Validator, W as WithChain, X as flattenMiddleware, Y as createMiddleware, Z as isBuiltMiddleware, _ as MiddlewareContext, a as ClientReplaced, b as MiddlewareOptions, c as ContributionOf, d as Empty, et as runRequestMiddleware, f as FreshMiddleware, g as Middleware, h as Merged, i as ClientMiddlewareContext, j as RequestMiddlewareContext, k as REDIRECT, l as ContributionOfState, m as InputError, n as Carries, o as ContributedBy, p as FromNext, q as WithValidator, r as ChainContribution, s as Contribution, t as BuiltMiddleware, tt as toValidator, u as DataAt, v as MiddlewareFn, w as NextResult, x as MiddlewareState, y as MiddlewareNext, z as UncheckedInputError } from "./middleware-B-tI8QHQ.js";
|
|
2
2
|
export { BuiltMiddleware, Carries, ChainContribution, ClientMiddlewareContext, ClientReplaced, ContributedBy, Contribution, ContributionOf, ContributionOfState, DataAt, Empty, FreshMiddleware, FromNext, InputError, Merged, Middleware, MiddlewareContext, MiddlewareFn, MiddlewareNext, MiddlewareOptions, MiddlewareState, NOT_FOUND, NextOptions, NextResult, NoContribution, OpenContext, OwnReplaced, Plain, REDIRECT, RequestMiddleware, RequestMiddlewareContext, RequestMiddlewareFn, RequestMiddlewareNext, RequestMiddlewareStart, StandardInput, StandardOutput, StandardSchema, StandardSchemaLike, UncheckedInputError, ValidationError, Validator, ValidatorInput, ValidatorReplaced, WithChain, WithClient, WithServer, WithValidator, applyValidator, createMiddleware, flattenMiddleware, isBuiltMiddleware, isInputError, runMiddleware, runRequestMiddleware, toValidator };
|
package/dist/middleware.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/middleware.ts
|
|
2
2
|
/** Any accepted validator, as the one shape the runner applies. */
|
|
3
3
|
function toValidator(input) {
|
|
4
4
|
if (input === "unchecked") return input;
|
|
@@ -276,7 +276,6 @@ async function runMiddleware(chain, half, start) {
|
|
|
276
276
|
};
|
|
277
277
|
return dispatch(0, start.data);
|
|
278
278
|
}
|
|
279
|
-
//#endregion
|
|
280
279
|
export { InputError, NOT_FOUND, REDIRECT, UncheckedInputError, ValidationError, applyValidator, createMiddleware, flattenMiddleware, isBuiltMiddleware, isInputError, runMiddleware, runRequestMiddleware, toValidator };
|
|
281
280
|
|
|
282
281
|
//# sourceMappingURL=middleware.js.map
|