@brickkit/effect 0.16.0-beta.10 → 0.16.0-beta.11
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/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/{server-BlvtUhSB.js → server-CKevfoZj.js} +31 -5
- package/dist/server-CKevfoZj.js.map +1 -0
- package/dist/{server-TbtxT_Ag.d.ts → server-Cj74lTGa.d.ts} +9 -4
- package/dist/server-Cj74lTGa.d.ts.map +1 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/package.json +1 -1
- package/dist/server-BlvtUhSB.js.map +0 -1
- package/dist/server-TbtxT_Ag.d.ts.map +0 -1
|
@@ -2672,6 +2672,16 @@ function checkMessage(issue, parent) {
|
|
|
2672
2672
|
const notUndefined = (issue) => !(issue._tag === "InvalidType" && issue.ast._tag === "Undefined");
|
|
2673
2673
|
const isMissing = (issue) => issue._tag === "Pointer" && issue.issue._tag === "MissingKey";
|
|
2674
2674
|
const isExtra = (issue) => issue._tag === "Pointer" && issue.issue._tag === "UnexpectedKey";
|
|
2675
|
+
const onlyExtraKeys = (issue) => {
|
|
2676
|
+
switch (issue._tag) {
|
|
2677
|
+
case "UnexpectedKey": return true;
|
|
2678
|
+
case "Pointer":
|
|
2679
|
+
case "Filter":
|
|
2680
|
+
case "Encoding": return onlyExtraKeys(issue.issue);
|
|
2681
|
+
case "Composite": return issue.issues.length > 0 && issue.issues.every(onlyExtraKeys);
|
|
2682
|
+
default: return false;
|
|
2683
|
+
}
|
|
2684
|
+
};
|
|
2675
2685
|
const expectedOf = (issue) => issue._tag === "Filter" ? issue.filter.annotations?.expected : void 0;
|
|
2676
2686
|
const filtersOf = (checks) => checks.flatMap((check) => check._tag === "FilterGroup" ? filtersOf(check.checks) : [check]);
|
|
2677
2687
|
const valueAt = (input, path) => path.reduce((value, key) => value?.[key], input);
|
|
@@ -2724,14 +2734,20 @@ function collect(issue, path, parent, override, out, phase) {
|
|
|
2724
2734
|
for (const child of childrenOf(issue, path, out.input)) collect(child, path, ast, override, out);
|
|
2725
2735
|
return;
|
|
2726
2736
|
}
|
|
2737
|
+
if (out.extras === "rootOnly") {
|
|
2738
|
+
if (path.length === 0) for (const child of issue.issues.filter(isExtra)) collect(child, path, issue.ast, override, out);
|
|
2739
|
+
return;
|
|
2740
|
+
}
|
|
2727
2741
|
const missing = issue.issues.filter((child) => isMissing(child));
|
|
2728
2742
|
const extra = issue.issues.filter((child) => isExtra(child));
|
|
2729
2743
|
for (const child of missing) collect(child, path, issue.ast, override, out, "required");
|
|
2730
|
-
for (const child of extra) collect(child, path, issue.ast, override, out);
|
|
2744
|
+
if (out.extras !== "ignoreNested" || path.length === 0) for (const child of extra) collect(child, path, issue.ast, override, out);
|
|
2731
2745
|
for (const child of issue.issues) if (!extra.includes(child)) collect(child, path, issue.ast, override, out, isMissing(child) ? "type" : void 0);
|
|
2732
2746
|
return;
|
|
2733
2747
|
}
|
|
2734
2748
|
case "AnyOf": {
|
|
2749
|
+
const failedOnlyOnExtraKeys = issue.issues.some(onlyExtraKeys);
|
|
2750
|
+
if (out.extras === "ignoreNested" && failedOnlyOnExtraKeys) return;
|
|
2735
2751
|
if (override !== void 0) return add(override);
|
|
2736
2752
|
if (typeof issue.ast.annotations?.message === "string") return add(stockMessage(issue));
|
|
2737
2753
|
const { types } = issue.ast;
|
|
@@ -2766,10 +2782,11 @@ const pointer = (path) => path.map((item) => String(typeof item === "object" &&
|
|
|
2766
2782
|
* A custom `message` annotation wins; a check or schema core has no wording for
|
|
2767
2783
|
* keeps Effect's own text.
|
|
2768
2784
|
*/
|
|
2769
|
-
function issuesOf(error, input) {
|
|
2785
|
+
function issuesOf(error, input, options) {
|
|
2770
2786
|
const out = {
|
|
2771
2787
|
input,
|
|
2772
|
-
items: []
|
|
2788
|
+
items: [],
|
|
2789
|
+
...options
|
|
2773
2790
|
};
|
|
2774
2791
|
collect(error.issue, [], void 0, void 0, out);
|
|
2775
2792
|
return out.items.map(({ path, message }) => ({
|
|
@@ -2845,6 +2862,15 @@ function stagesOf(config, host, action) {
|
|
|
2845
2862
|
...all,
|
|
2846
2863
|
...strict && { onExcessProperty: "error" }
|
|
2847
2864
|
};
|
|
2865
|
+
const strictRoot = strict === true;
|
|
2866
|
+
const decodeInput = (call) => {
|
|
2867
|
+
const run = (options) => decode[call.input === void 0 ? call.wire ? "absent" : "value" : call.wire ?? "value"](call.input, options);
|
|
2868
|
+
const reject = (error, options) => Effect.fail(invalid$1(name, "input", issuesOf(error, call.input, options)));
|
|
2869
|
+
return run(strictInput).pipe(Effect.catch((error) => !strictRoot ? reject(error) : run(all).pipe(Effect.matchEffect({
|
|
2870
|
+
onFailure: (plain) => issuesOf(error, call.input, { extras: "rootOnly" }).length ? reject(error, { extras: "ignoreNested" }) : reject(plain),
|
|
2871
|
+
onSuccess: (value) => issuesOf(error, call.input, { extras: "rootOnly" }).length ? reject(error, { extras: "rootOnly" }) : Effect.succeed(value)
|
|
2872
|
+
}))));
|
|
2873
|
+
};
|
|
2848
2874
|
return [
|
|
2849
2875
|
...dashboard ? [{
|
|
2850
2876
|
name: "dashboard",
|
|
@@ -2863,7 +2889,7 @@ function stagesOf(config, host, action) {
|
|
|
2863
2889
|
}] : [],
|
|
2864
2890
|
...decode ? [{
|
|
2865
2891
|
name: "input",
|
|
2866
|
-
run: (call, next) =>
|
|
2892
|
+
run: (call, next) => decodeInput(call).pipe(Effect.flatMap((decoded) => next({
|
|
2867
2893
|
...call,
|
|
2868
2894
|
input: decoded
|
|
2869
2895
|
})))
|
|
@@ -8781,4 +8807,4 @@ function brick(options = {}) {
|
|
|
8781
8807
|
}
|
|
8782
8808
|
export { PLUGIN_KIND as $, toErrorResponse as $n, envSource as $t, onTransactionCommit as A, telemetryLayer as An, errorHelpers as At, scalarDocsHTML as B, signDashboardIdentity as Bn, defineStorage as Bt, scheduleTable as C, baseContext as Cn, kindOf as Ct, defineServiceSocket as D, Telemetry as Dn, RESET_STAGES as Dt, SocketDenied as E, SpanStore as En, HTTP_METHODS as Et, encodePayload as F, dashboardIdentity as Fn, hasSensitive as Ft, getPluginActionRoute as G, actionMeta as Gn, storageKey as Gt, copyControls as H, ATTR as Hn, memory as Ht, isCrudEvent as I, dashboardKey as In, redact as It, installPlugin as J, STANDARD_ERRORS as Jn, scopeFiles as Jt, getPluginEndpoints as K, BrickError as Kn, LOCAL_FILES_ROUTE as Kt, OPENAPI_DEFAULTS as L, dashboardMcpCaller as Ln, sensitivePointer as Lt, crudEventName as M, traceScheduleRun as Mn, runStages as Mt, crudEventSource as N, DASHBOARD_IDENTITY_HEADER as Nn, stagesOf as Nt, localBroker as O, recordWebhook as On, createAction as Ot, defineEvents as P, DASHBOARD_KEY_ENV as Pn, Sensitive as Pt, PLUGIN_COMMIT as Q, prefixedFailure as Qn, defineSecret as Qt, generateOpenApiSpec as R, dashboardUser as Rn, carryClientRequest as Rt, outboxTable as S, actorOf as Sn, jsonValue as St, defineRawSocket as T, defaultLogger as Tn, withoutNull as Tt, defineResourcePlugin as U, GLOBAL_SYMBOL as Un, redis as Ut, claimSegment as V, signDashboardMcp as Vn, frameworkStorage as Vt, defineServicePlugin as W, SPAN as Wn, requireStorage as Wt, internalsOf$1 as X, failureOfCause as Xn, StorageUnavailableError as Xt, validatePath as Y, ValidationError as Yn, StorageError as Yt, setInternals as Z, normalizeFailures as Zn, SecretRef as Zt, idSchema as _, inlineAuditOptions as _n, databaseValue as _t, Workflow as a, definitionSite as an, getActionRoute as at, stopAllEvents as b, recordAudit as bn, idSchema$1 as bt, WORKFLOW_TABLE as c, ownDeps as cn, getActionAccess as ct, createMcpHandler as d, UploadedFile as dn, ORDERED_TYPES as dt, listSecrets as en, toWireError as er, getGlobalRegistry as et, createMcpRegistry as f, UploadedFiles as fn, SORTABLE_TYPES as ft, defineResource as g, bindAuditTarget as gn, columnValue as gt, normalizeDashboard as h, auditTableOf as hn, columnSchema as ht, DurableDeferred as i, claimName as in, actionOwners as it, runInTransaction as j, traceRoute as jn, invalid$1 as jt, splitSeq as k, spanStore as kn, deny as kt, INTERNALS as l, useDeps as ln, setActionAccess as lt, DASHBOARD_MCP_TOOLS as m, auditTable as mn, checkJsonSchema as mt, Activity as n, resetSecrets as nn, exportArchitecture as nt, WorkflowEngine as o, depsOverride as on, isObjectSchema as ot, DASHBOARD_MCP_ROUTE as p, fileFields as pn, UNFILTERABLE_TYPES as pt, hasPlugin as q, DuplicateNameError as qn, s3 as qt, DurableClock as r, resolveSecrets as rn, DEFAULT_PREFIX as rt, workflowEngine as s, freezeAsBuiltDeps as sn, kebabCase as st, brick as t, overrideSecret as tn, resetGlobalRegistry as tt, UnknownToolError as u, withOverride as un, setActionAudit as ut, loadRecord as v, isAuditTable as vn, decodeCursor as vt, defineSchedule as w, createLogger as wn, reject as wt, defineListener as x, recordInline as xn, invalid as xt, Events as y, isInlineAudit as yn, encodeCursor as yt, requestLoggingPlugin as z, markDashboardArrival as zn, clientAddress as zt };
|
|
8783
8809
|
|
|
8784
|
-
//# sourceMappingURL=server-
|
|
8810
|
+
//# sourceMappingURL=server-CKevfoZj.js.map
|