@voltro/client 0.89.2 → 0.91.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 +1943 -0
- package/README.md +22 -0
- package/THIRD-PARTY-NOTICES.md +1 -1
- package/dist/analytics.d.ts +68 -0
- package/dist/analytics.js +1 -0
- package/dist/apiRuntime.js +50 -50
- package/dist/apiSupervisor.js +25 -25
- package/dist/awaitResolvedApi.js +42 -16
- package/dist/bootstrap.d.ts +0 -115
- package/dist/bootstrap.js +8 -8
- package/dist/connectionPrerequisite.js +18 -18
- package/dist/connectionSetupController.js +123 -91
- package/dist/createHooks.js +11 -11
- package/dist/form.js +7 -7
- package/dist/index.d.ts +148 -162
- package/dist/index.js +88 -86
- package/dist/invocationWait.js +14 -0
- package/dist/mutationsBus.js +92 -35
- package/dist/outbox.js +137 -108
- package/dist/outboxState.js +7 -0
- package/dist/platform.js +10 -10
- package/dist/query.js +3 -10
- package/dist/rpcCallOnce.js +30 -0
- package/dist/rpcDeclared.js +7 -0
- package/dist/runRpc.js +9 -6
- package/dist/runtime.d.ts +16 -116
- package/dist/runtime.js +16 -16
- package/dist/runtimeContext.js +1 -1
- package/dist/serviceClient.js +23 -23
- package/dist/store.js +3 -3
- package/dist/subscriptionCache.js +1 -1
- package/dist/traceBus.js +7 -1
- package/dist/unknownRpcTag.js +7 -0
- package/dist/uploadBytes.js +83 -0
- package/dist/uploadClient.js +153 -0
- package/dist/useAction.js +148 -74
- package/dist/useAgentChat.js +3 -3
- package/dist/useCapabilityManifest.js +7 -7
- package/dist/useConnectionStatus.js +5 -5
- package/dist/useDataTable.js +4 -4
- package/dist/useEvent.js +22 -22
- package/dist/useFormBinding.js +10 -10
- package/dist/useMutation.js +221 -134
- package/dist/useOnRpcError.js +5 -5
- package/dist/usePreloadedSubscription.js +6 -6
- package/dist/useRpcCaller.js +75 -13
- package/dist/useRpcInvocationOwner.js +29 -0
- package/dist/useSubscription.js +52 -49
- package/dist/useTranscription.js +112 -40
- package/dist/useUpload.js +160 -242
- package/dist/useWorkflow.js +111 -246
- package/dist/workflowClient.js +126 -0
- package/package.json +8 -3
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { connectionScopeForRuntime as e } from "./connectionScope.js";
|
|
2
|
+
import { runRpcPromise as t } from "./runRpc.js";
|
|
3
|
+
import { rememberRpcErrorKind as n } from "./rpcErrorKind.js";
|
|
4
4
|
import { Effect as r } from "effect";
|
|
5
5
|
// src/connectionPrerequisite.ts
|
|
6
6
|
var i = "voltro:connection-setup-superseded", a = (e) => e.reason === "voltro:connection-setup-superseded" ? "superseded" : "inactive", o = class extends Error {
|
|
7
7
|
reason;
|
|
8
8
|
_tag = "ConnectionPrerequisiteInvalidated";
|
|
9
|
-
constructor(
|
|
10
|
-
super(`Voltro connection prerequisite: ${
|
|
9
|
+
constructor(e) {
|
|
10
|
+
super(`Voltro connection prerequisite: ${e}`), this.reason = e, n(this, e === "connection-unavailable" || e === "connection-changed" ? "transport" : "client");
|
|
11
11
|
}
|
|
12
12
|
}, s = class {
|
|
13
13
|
#e;
|
|
@@ -18,21 +18,21 @@ var i = "voltro:connection-setup-superseded", a = (e) => e.reason === "voltro:co
|
|
|
18
18
|
if (!Number.isFinite(t) || t <= 0 || t > 6e4) throw RangeError("Connection prerequisite timeout must be between 0 and 60000 ms");
|
|
19
19
|
this.#e = e, this.#t = t;
|
|
20
20
|
}
|
|
21
|
-
prepare(
|
|
22
|
-
let s =
|
|
21
|
+
prepare(n, i) {
|
|
22
|
+
let s = e(n)?.getSnapshot();
|
|
23
23
|
if (this.#e.aborted) return Promise.reject(new o(a(this.#e)));
|
|
24
24
|
if (s === void 0) return Promise.reject(new o("connection-unavailable"));
|
|
25
25
|
let c = this.#n.get(s);
|
|
26
|
-
if (c !== void 0) return c.then((
|
|
27
|
-
let l = this.#a(
|
|
26
|
+
if (c !== void 0) return c.then((e) => (this.assertCurrent(n, e), e));
|
|
27
|
+
let l = this.#a(n, s, i).pipe(r.timeoutOrElse({
|
|
28
28
|
duration: this.#t,
|
|
29
29
|
orElse: () => r.fail(new o("timeout"))
|
|
30
|
-
})), u = n
|
|
31
|
-
let
|
|
30
|
+
})), u = t(n, l).then((e) => {
|
|
31
|
+
let t = Object.freeze({
|
|
32
32
|
lease: s,
|
|
33
|
-
output:
|
|
33
|
+
output: e
|
|
34
34
|
});
|
|
35
|
-
return this.#r.add(
|
|
35
|
+
return this.#r.add(t), this.assertCurrent(n, t), t;
|
|
36
36
|
});
|
|
37
37
|
return this.#n.set(s, u), u.catch(() => {
|
|
38
38
|
this.#n.get(s) === u && this.#n.delete(s);
|
|
@@ -42,16 +42,16 @@ var i = "voltro:connection-setup-superseded", a = (e) => e.reason === "voltro:co
|
|
|
42
42
|
if (!this.#r.has(t)) throw new o(a(this.#e));
|
|
43
43
|
this.#i(e, t.lease);
|
|
44
44
|
}
|
|
45
|
-
#i(
|
|
45
|
+
#i(t, n) {
|
|
46
46
|
if (this.#e.aborted) throw new o(a(this.#e));
|
|
47
|
-
if (n.signal.aborted || t
|
|
47
|
+
if (n.signal.aborted || e(t)?.getSnapshot() !== n) throw new o("connection-changed");
|
|
48
48
|
}
|
|
49
|
-
run(e,
|
|
49
|
+
run(e, n, i) {
|
|
50
50
|
let a = r.try({
|
|
51
|
-
try: () => this.assertCurrent(e,
|
|
51
|
+
try: () => this.assertCurrent(e, n),
|
|
52
52
|
catch: (e) => e
|
|
53
53
|
}).pipe(r.andThen(i));
|
|
54
|
-
return
|
|
54
|
+
return t(e, this.#a(e, n.lease, a));
|
|
55
55
|
}
|
|
56
56
|
#a(e, t, n) {
|
|
57
57
|
let i = r.try({
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { squashRpcCause as e } from "./squashRpcCause.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
2
|
+
import { ConnectionPrerequisite as t, ConnectionPrerequisiteInvalidated as n, SUPERSEDED_BY_LATER_ACTIVATION as r, activationEndReason as i } from "./connectionPrerequisite.js";
|
|
3
|
+
import { connectionScopeForRuntime as a } from "./connectionScope.js";
|
|
4
|
+
import { createConnectionSetupHandle as o } from "./mutationConnectionSetup.js";
|
|
5
|
+
import { freshIdempotencyKey as s, withIdempotencyKey as c } from "./mutationIdentity.js";
|
|
6
|
+
import { recoveryCoordinatorFor as l } from "./recoveryCoordinator.js";
|
|
7
|
+
import { resolveByTag as u } from "./tagWalk.js";
|
|
8
|
+
import { runRpcPromise as d } from "./runRpc.js";
|
|
9
|
+
import { rpcErrorKind as f } from "./rpcErrorKind.js";
|
|
10
|
+
import { omitMutationInputs as p, startMutation as m } from "./mutationsBus.js";
|
|
11
|
+
import { captureRpcInvocationOwner as h, rpcInvocationOwnerCurrent as g } from "./awaitResolvedApi.js";
|
|
12
|
+
import { Cause as _, Effect as v, Exit as y } from "effect";
|
|
12
13
|
// src/connectionSetupController.ts
|
|
13
|
-
var
|
|
14
|
+
var b = class {
|
|
14
15
|
#e;
|
|
15
16
|
#t;
|
|
16
17
|
#n;
|
|
@@ -25,7 +26,7 @@ var v = class {
|
|
|
25
26
|
#s;
|
|
26
27
|
handle;
|
|
27
28
|
constructor(e, t, n) {
|
|
28
|
-
this.#e = e, this.#t = t, this.#n = n, this.handle =
|
|
29
|
+
this.#e = e, this.#t = t, this.#n = n, this.handle = o(e, { capture: () => this.#f() });
|
|
29
30
|
}
|
|
30
31
|
getSnapshot = () => this.#a;
|
|
31
32
|
subscribe = (e) => (this.#r.add(e), () => {
|
|
@@ -33,33 +34,37 @@ var v = class {
|
|
|
33
34
|
});
|
|
34
35
|
clear = (e = !1) => {
|
|
35
36
|
let t = this.#i;
|
|
36
|
-
this.#i = void 0, this.#s = void 0, t?.detachSubject?.(), t?.controller.abort(e ?
|
|
37
|
+
this.#i = void 0, this.#s = void 0, t && (t.initialDelivery = void 0), t?.detachSubject?.(), t?.controller.abort(e ? r : void 0), this.#h({
|
|
37
38
|
status: "idle",
|
|
38
39
|
data: void 0,
|
|
39
40
|
error: void 0
|
|
40
41
|
});
|
|
41
42
|
};
|
|
42
|
-
async activate(e,
|
|
43
|
+
async activate(e, n) {
|
|
43
44
|
this.clear(!0);
|
|
44
|
-
let
|
|
45
|
+
let r = new AbortController(), i = () => {}, a = new Promise((e) => {
|
|
46
|
+
i = e;
|
|
47
|
+
}), o = {
|
|
45
48
|
input: e,
|
|
46
|
-
key:
|
|
47
|
-
controller:
|
|
48
|
-
|
|
49
|
+
key: s(),
|
|
50
|
+
controller: r,
|
|
51
|
+
owner: void 0,
|
|
49
52
|
detachSubject: void 0,
|
|
50
|
-
prerequisite: new
|
|
51
|
-
established: !1
|
|
53
|
+
prerequisite: new t(r.signal, this.#c(this.#n()).options.replayWindowMs),
|
|
54
|
+
established: !1,
|
|
55
|
+
outputs: /* @__PURE__ */ new WeakMap(),
|
|
56
|
+
initialDelivery: i
|
|
52
57
|
};
|
|
53
|
-
this.#i =
|
|
58
|
+
this.#i = o, this.#h({
|
|
54
59
|
status: "pending",
|
|
55
60
|
data: void 0,
|
|
56
61
|
error: void 0
|
|
57
62
|
});
|
|
58
63
|
try {
|
|
59
|
-
let e = await
|
|
60
|
-
return this.#l(
|
|
64
|
+
let e = await n(), t = await this.#p(o, e.runtime, e.client);
|
|
65
|
+
return this.#l(o), o.prerequisite.assertCurrent(e.runtime, t), o.established = !0, await a;
|
|
61
66
|
} catch (e) {
|
|
62
|
-
throw this.#i ===
|
|
67
|
+
throw this.#l(o), this.#i === o && (this.clear(), this.#h({
|
|
63
68
|
status: "error",
|
|
64
69
|
data: void 0,
|
|
65
70
|
error: e
|
|
@@ -67,10 +72,10 @@ var v = class {
|
|
|
67
72
|
}
|
|
68
73
|
}
|
|
69
74
|
watch(e) {
|
|
70
|
-
let t =
|
|
75
|
+
let t = a(e.runtime), n = () => {
|
|
71
76
|
let n = this.#i;
|
|
72
77
|
if (n === void 0 || !n.established || this.#n().runtime !== e.runtime) return;
|
|
73
|
-
if (n.
|
|
78
|
+
if (n.owner === void 0 || !g(n.owner, e)) {
|
|
74
79
|
this.clear();
|
|
75
80
|
return;
|
|
76
81
|
}
|
|
@@ -84,112 +89,139 @@ var v = class {
|
|
|
84
89
|
return n(), t?.subscribe(n) ?? (() => {});
|
|
85
90
|
}
|
|
86
91
|
#c(e) {
|
|
87
|
-
return e.recovery ??
|
|
92
|
+
return e.recovery ?? l(e.errorBus, this.#e);
|
|
88
93
|
}
|
|
89
94
|
#l(e) {
|
|
90
|
-
if (this.#i !== e || e.controller.signal.aborted) throw new
|
|
95
|
+
if (this.#i !== e || e.controller.signal.aborted) throw new n(i(e.controller.signal));
|
|
91
96
|
}
|
|
92
|
-
#u(e, t,
|
|
97
|
+
#u(e, t, r) {
|
|
93
98
|
this.#l(e);
|
|
94
|
-
let
|
|
95
|
-
if (e.
|
|
96
|
-
if (
|
|
97
|
-
return
|
|
99
|
+
let i = this.#n();
|
|
100
|
+
if (e.owner !== void 0 && !g(e.owner, i)) throw new n("inactive");
|
|
101
|
+
if (i.runtime !== t || i.client !== r) throw new n("connection-changed");
|
|
102
|
+
return i;
|
|
98
103
|
}
|
|
99
104
|
#d(e, t) {
|
|
100
|
-
if (e.
|
|
101
|
-
|
|
102
|
-
e.subject =
|
|
103
|
-
let r = () => {
|
|
105
|
+
if (e.owner !== void 0) return;
|
|
106
|
+
e.owner = h(t, this.#e, this.#t);
|
|
107
|
+
let n = e.owner.subject, r = () => {
|
|
104
108
|
this.#i === e && this.clear();
|
|
105
109
|
};
|
|
106
110
|
n.addEventListener("abort", r, { once: !0 }), e.detachSubject = () => n.removeEventListener("abort", r), n.aborted && r();
|
|
107
111
|
}
|
|
108
112
|
#f() {
|
|
109
113
|
let e = this.#i;
|
|
110
|
-
if (e === void 0) throw new
|
|
114
|
+
if (e === void 0) throw new n("inactive");
|
|
111
115
|
return { prepare: async (t, n) => {
|
|
112
116
|
let r = await this.#p(e, t, n);
|
|
113
|
-
return { run: (i) => e.prerequisite.run(t, r,
|
|
117
|
+
return { run: (i) => e.prerequisite.run(t, r, v.try({
|
|
114
118
|
try: () => this.#u(e, t, n),
|
|
115
119
|
catch: (e) => e
|
|
116
|
-
}).pipe(
|
|
120
|
+
}).pipe(v.andThen(i))) };
|
|
117
121
|
} };
|
|
118
122
|
}
|
|
119
|
-
async #p(e, t,
|
|
120
|
-
let
|
|
121
|
-
if (
|
|
122
|
-
this.#d(e,
|
|
123
|
-
let c =
|
|
124
|
-
if (c === void 0) throw new
|
|
123
|
+
async #p(e, t, r) {
|
|
124
|
+
let o = this.#u(e, t, r), s = o.descriptors[this.#t];
|
|
125
|
+
if (s?.kind !== "mutation" || s.idempotencyScope !== "connection") throw Error(`Voltro: useConnectionSetup("${this.#t}") requires a mutation declaring idempotencyScope: 'connection'`);
|
|
126
|
+
this.#d(e, o), this.#l(e);
|
|
127
|
+
let c = a(t);
|
|
128
|
+
if (c === void 0) throw new n("connection-unavailable");
|
|
125
129
|
if (c.getSnapshot() === void 0) {
|
|
126
|
-
let
|
|
127
|
-
let
|
|
128
|
-
let
|
|
129
|
-
e.controller.signal.aborted ? t(
|
|
130
|
-
},
|
|
131
|
-
return e.controller.signal.addEventListener("abort",
|
|
132
|
-
|
|
130
|
+
let r = v.callback((t) => {
|
|
131
|
+
let r = () => {
|
|
132
|
+
let r = c.getSnapshot();
|
|
133
|
+
e.controller.signal.aborted ? t(v.fail(new n(i(e.controller.signal)))) : r !== void 0 && t(v.succeed(r));
|
|
134
|
+
}, a = c.subscribe(r);
|
|
135
|
+
return e.controller.signal.addEventListener("abort", r, { once: !0 }), r(), v.sync(() => {
|
|
136
|
+
a(), e.controller.signal.removeEventListener("abort", r);
|
|
133
137
|
});
|
|
134
|
-
}).pipe(
|
|
135
|
-
duration: this.#c(
|
|
136
|
-
orElse: () =>
|
|
138
|
+
}).pipe(v.timeoutOrElse({
|
|
139
|
+
duration: this.#c(o).options.replayWindowMs,
|
|
140
|
+
orElse: () => v.fail(new n("timeout"))
|
|
137
141
|
}));
|
|
138
|
-
await
|
|
142
|
+
await d(t, r);
|
|
139
143
|
}
|
|
140
|
-
this.#u(e, t,
|
|
141
|
-
let
|
|
144
|
+
this.#u(e, t, r);
|
|
145
|
+
let l = c.getSnapshot();
|
|
142
146
|
try {
|
|
143
|
-
let
|
|
144
|
-
return this.#u(e, t,
|
|
147
|
+
let n = await e.prerequisite.prepare(t, this.#m(e, o));
|
|
148
|
+
return this.#u(e, t, r), this.#s = n.lease, this.#n().descriptors[this.#t]?.outputRetention === "none" && (e.outputs = /* @__PURE__ */ new WeakMap()), this.#h({
|
|
145
149
|
status: "ready",
|
|
146
|
-
data:
|
|
150
|
+
data: e.outputs.get(n.lease),
|
|
147
151
|
error: void 0
|
|
148
|
-
}), this.#u(e, t,
|
|
152
|
+
}), this.#u(e, t, r), e.prerequisite.assertCurrent(t, n), n;
|
|
149
153
|
} catch (n) {
|
|
150
|
-
throw this.#i === e && this.#n().runtime === t && c.getSnapshot() ===
|
|
154
|
+
throw this.#u(e, t, r), this.#i === e && this.#n().runtime === t && c.getSnapshot() === l && this.#h({
|
|
151
155
|
status: "error",
|
|
152
156
|
data: void 0,
|
|
153
157
|
error: n
|
|
154
|
-
}), n;
|
|
158
|
+
}), this.#u(e, t, r), n;
|
|
155
159
|
}
|
|
156
160
|
}
|
|
157
|
-
#m(
|
|
158
|
-
return
|
|
159
|
-
let
|
|
160
|
-
return
|
|
161
|
-
|
|
161
|
+
#m(t, r) {
|
|
162
|
+
return v.suspend(() => {
|
|
163
|
+
let i = a(r.runtime)?.getSnapshot();
|
|
164
|
+
if (i === void 0) return v.fail(new n("connection-unavailable"));
|
|
165
|
+
let o = `setup_${t.key}_${++this.#o}`;
|
|
166
|
+
this.#u(t, r.runtime, r.client);
|
|
167
|
+
let s = t.owner?.subject;
|
|
168
|
+
if (s === void 0) throw new n("inactive");
|
|
169
|
+
let l = r.descriptors[this.#t]?.outputRetention === "none", d = !r.descriptors[this.#t] || r.descriptors[this.#t]?.clientHistory?.input === "omit", h = m({
|
|
170
|
+
id: o,
|
|
162
171
|
apiName: this.#e,
|
|
163
172
|
tag: this.#t,
|
|
164
|
-
input:
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
173
|
+
input: d ? void 0 : t.input,
|
|
174
|
+
...d ? { inputOmitted: !0 } : {},
|
|
175
|
+
...l ? { outputOmitted: !0 } : {}
|
|
176
|
+
}, s), g = () => {
|
|
177
|
+
try {
|
|
178
|
+
return this.#u(t, r.runtime, r.client), !0;
|
|
179
|
+
} catch {
|
|
180
|
+
return !1;
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
return v.suspend(() => {
|
|
184
|
+
this.#u(t, r.runtime, r.client);
|
|
185
|
+
let e = u(r.client, this.#t);
|
|
186
|
+
return c(e(t.input), t.key);
|
|
187
|
+
}).pipe(v.withSpan(`client.connectionSetup.${this.#t}`)).pipe(v.onExit((t) => v.sync(() => {
|
|
188
|
+
if (this.#n().descriptors[this.#t]?.clientHistory?.input === "omit" && p(this.#e, this.#t), y.isSuccess(t)) {
|
|
189
|
+
let e = l || this.#n().descriptors[this.#t]?.outputRetention === "none";
|
|
190
|
+
if (h.settle({
|
|
191
|
+
status: "success",
|
|
192
|
+
output: e ? void 0 : t.value,
|
|
193
|
+
...e ? { outputOmitted: !0 } : {}
|
|
194
|
+
}), !g()) return;
|
|
195
|
+
r.errorBus.emitSuccess({
|
|
196
|
+
source: "mutation",
|
|
197
|
+
tag: this.#t
|
|
198
|
+
});
|
|
199
|
+
} else {
|
|
200
|
+
let n = e(t.cause);
|
|
201
|
+
if (h.settle({
|
|
180
202
|
status: "error",
|
|
181
|
-
error:
|
|
182
|
-
}), !
|
|
183
|
-
let e =
|
|
203
|
+
error: n
|
|
204
|
+
}), g() && !_.hasInterruptsOnly(t.cause)) {
|
|
205
|
+
let e = f(n, "handler");
|
|
184
206
|
r.errorBus.emit({
|
|
185
207
|
source: "mutation",
|
|
186
208
|
tag: this.#t,
|
|
187
|
-
error:
|
|
209
|
+
error: n,
|
|
188
210
|
kind: e,
|
|
189
211
|
outcome: e === "transport" ? "unknown" : "known"
|
|
190
212
|
});
|
|
191
213
|
}
|
|
192
214
|
}
|
|
215
|
+
})), v.flatMap((e) => v.try({
|
|
216
|
+
try: () => {
|
|
217
|
+
this.#u(t, r.runtime, r.client);
|
|
218
|
+
let o = a(r.runtime)?.getSnapshot();
|
|
219
|
+
if (o !== i || i.signal.aborted) throw new n("connection-changed");
|
|
220
|
+
l || this.#n().descriptors[this.#t]?.outputRetention === "none" ? t.outputs = /* @__PURE__ */ new WeakMap() : t.outputs.set(o, e);
|
|
221
|
+
let s = t.initialDelivery;
|
|
222
|
+
t.initialDelivery = void 0, s?.(e);
|
|
223
|
+
},
|
|
224
|
+
catch: (e) => e
|
|
193
225
|
})));
|
|
194
226
|
});
|
|
195
227
|
}
|
|
@@ -202,4 +234,4 @@ var v = class {
|
|
|
202
234
|
}
|
|
203
235
|
}
|
|
204
236
|
};
|
|
205
|
-
export {
|
|
237
|
+
export { b as ConnectionSetupController };
|
package/dist/createHooks.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { useAction as e } from "./useAction.js";
|
|
2
|
+
import { useFormBinding as t } from "./useFormBinding.js";
|
|
3
|
+
import { useMutation as n } from "./useMutation.js";
|
|
4
|
+
import { useConnectionSetup as r } from "./useConnectionSetup.js";
|
|
5
|
+
import { useSubscription as i } from "./useSubscription.js";
|
|
6
6
|
// src/createHooks.ts
|
|
7
|
-
var a =
|
|
8
|
-
useSubscription: (t, n
|
|
9
|
-
useMutation: (
|
|
10
|
-
useConnectionSetup: (
|
|
11
|
-
useAction: (t) =>
|
|
12
|
-
useFormBinding: (
|
|
7
|
+
var a = i, o = (i) => ({
|
|
8
|
+
useSubscription: (e, t, n) => a(i, e, t, n),
|
|
9
|
+
useMutation: (e) => n(i, e),
|
|
10
|
+
useConnectionSetup: (e) => r(i, e),
|
|
11
|
+
useAction: (t) => e(i, t),
|
|
12
|
+
useFormBinding: (e, n) => t(i, e, n ?? {})
|
|
13
13
|
});
|
|
14
14
|
export { o as createHooks };
|
package/dist/form.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { FORM_FLASH_SCRIPT_ID as
|
|
4
|
-
import { FORM_CAPTURE_FIELD as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
export {
|
|
1
|
+
import { decodeFieldIssues as e, documentLocale as t, resolveValidationMessage as n, restrictToSchema as r, validateFields as i } from "./formBinding.js";
|
|
2
|
+
import { formDataToInput as a, recoverNativeFormValues as o } from "./formData.js";
|
|
3
|
+
import { FORM_FLASH_SCRIPT_ID as s } from "./formFlashId.js";
|
|
4
|
+
import { FORM_CAPTURE_FIELD as c, FORM_CAPTURE_META_NAME as l, FORM_KEY_FIELD as u, FORM_PATH_PREFIX as d, FORM_REDIRECT_FIELD as f, FORM_SOURCE_FIELD as p, encodeNativeFormCapture as m, formActionPath as h, formCaptureSource as g, formSourcePath as _, readFormCaptureSource as v } from "./formSource.js";
|
|
5
|
+
import { encodeFormRejection as y } from "./formRejection.js";
|
|
6
|
+
import { formField as b, formSections as x, schemaToColumns as S, schemaToFields as C } from "./schemaFields.js";
|
|
7
|
+
export { c as FORM_CAPTURE_FIELD, l as FORM_CAPTURE_META_NAME, s as FORM_FLASH_SCRIPT_ID, u as FORM_KEY_FIELD, d as FORM_PATH_PREFIX, f as FORM_REDIRECT_FIELD, p as FORM_SOURCE_FIELD, e as decodeFieldIssues, t as documentLocale, y as encodeFormRejection, m as encodeNativeFormCapture, h as formActionPath, g as formCaptureSource, a as formDataToInput, b as formField, x as formSections, _ as formSourcePath, v as readFormCaptureSource, o as recoverNativeFormValues, n as resolveValidationMessage, r as restrictToSchema, S as schemaToColumns, C as schemaToFields, i as validateFields };
|