@pithy-sh/core 0.10.0 → 0.12.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/dist/access/access.d.ts +172 -0
- package/dist/access/access.d.ts.map +1 -0
- package/dist/access/access.js +147 -0
- package/dist/access/acting.d.ts +49 -0
- package/dist/access/acting.d.ts.map +1 -0
- package/dist/access/acting.js +21 -0
- package/dist/access/policyCheck.d.ts +33 -0
- package/dist/access/policyCheck.d.ts.map +1 -0
- package/dist/access/policyCheck.js +48 -0
- package/dist/access/usage.d.ts +83 -0
- package/dist/access/usage.d.ts.map +1 -0
- package/dist/access/usage.js +104 -0
- package/dist/access/visibility.d.ts +66 -0
- package/dist/access/visibility.d.ts.map +1 -0
- package/dist/access/visibility.js +86 -0
- package/dist/audit/auditEvent.d.ts +5 -0
- package/dist/audit/auditEvent.d.ts.map +1 -1
- package/dist/audit/auditEvent.js +2 -0
- package/dist/audit/recorder.d.ts +10 -2
- package/dist/audit/recorder.d.ts.map +1 -1
- package/dist/capability/bindings.d.ts +47 -2
- package/dist/capability/bindings.d.ts.map +1 -1
- package/dist/capability/bindings.js +117 -7
- package/dist/capability/capability.d.ts +110 -28
- package/dist/capability/capability.d.ts.map +1 -1
- package/dist/capability/capability.js +2 -0
- package/dist/capability/manifest.d.ts +2 -1
- package/dist/capability/manifest.d.ts.map +1 -1
- package/dist/capability/manifest.js +1 -1
- package/dist/capability/purge.d.ts +80 -0
- package/dist/capability/purge.d.ts.map +1 -0
- package/dist/capability/purge.js +76 -0
- package/dist/capability/settings.d.ts +86 -2
- package/dist/capability/settings.d.ts.map +1 -1
- package/dist/capability/settings.js +80 -1
- package/dist/cli/commandCatalog.generated.d.ts +238 -24
- package/dist/cli/commandCatalog.generated.d.ts.map +1 -1
- package/dist/cli/commandCatalog.generated.js +251 -22
- package/dist/cli/commandFacts.d.ts +2 -1
- package/dist/cli/commandFacts.d.ts.map +1 -1
- package/dist/cli/commandFacts.js +2 -0
- package/dist/controlPlane/capability.d.ts.map +1 -1
- package/dist/controlPlane/capability.js +19 -2
- package/dist/controlPlane/context.d.ts +5 -0
- package/dist/controlPlane/context.d.ts.map +1 -1
- package/dist/controlPlane/context.js +3 -1
- package/dist/controlPlane/data/connection.d.ts +49 -12
- package/dist/controlPlane/data/connection.d.ts.map +1 -1
- package/dist/controlPlane/data/connection.js +56 -2
- package/dist/controlPlane/discovery/adminRoute.d.ts +29 -0
- package/dist/controlPlane/discovery/adminRoute.d.ts.map +1 -1
- package/dist/controlPlane/discovery/adminRoute.js +3 -0
- package/dist/controlPlane/error/errors.d.ts +4 -3
- package/dist/controlPlane/error/errors.d.ts.map +1 -1
- package/dist/controlPlane/http/cors.d.ts +4 -4
- package/dist/controlPlane/http/cors.js +4 -4
- package/dist/controlPlane/http/guard.d.ts +11 -0
- package/dist/controlPlane/http/guard.d.ts.map +1 -1
- package/dist/controlPlane/http/guard.js +17 -1
- package/dist/controlPlane/http/handlers.d.ts +139 -0
- package/dist/controlPlane/http/handlers.d.ts.map +1 -1
- package/dist/controlPlane/http/handlers.js +67 -4
- package/dist/controlPlane/http/readiness.d.ts +33 -0
- package/dist/controlPlane/http/readiness.d.ts.map +1 -0
- package/dist/controlPlane/http/readiness.js +39 -0
- package/dist/controlPlane/http/responses.d.ts +245 -0
- package/dist/controlPlane/http/responses.d.ts.map +1 -1
- package/dist/controlPlane/http/responses.js +101 -4
- package/dist/controlPlane/http/routes.d.ts +2 -0
- package/dist/controlPlane/http/routes.d.ts.map +1 -1
- package/dist/controlPlane/http/routes.js +31 -3
- package/dist/controlPlane/http/verify.d.ts.map +1 -1
- package/dist/controlPlane/http/verify.js +2 -1
- package/dist/controlPlane/migrationState/migrationState.d.ts +102 -0
- package/dist/controlPlane/migrationState/migrationState.d.ts.map +1 -0
- package/dist/controlPlane/migrationState/migrationState.js +142 -0
- package/dist/controlPlane/migrations/0003_connection_principal.d.ts +21 -0
- package/dist/controlPlane/migrations/0003_connection_principal.d.ts.map +1 -0
- package/dist/controlPlane/migrations/0003_connection_principal.js +33 -0
- package/dist/controlPlane/scope/scope.d.ts +23 -2
- package/dist/controlPlane/scope/scope.d.ts.map +1 -1
- package/dist/controlPlane/scope/scope.js +24 -3
- package/dist/createBackend.d.ts.map +1 -1
- package/dist/createBackend.js +9 -2
- package/dist/createEntrypoint.d.ts.map +1 -1
- package/dist/createEntrypoint.js +5 -3
- package/dist/crypto/envelope.d.ts +86 -0
- package/dist/crypto/envelope.d.ts.map +1 -0
- package/dist/crypto/envelope.js +129 -0
- package/dist/crypto/fieldKeys.d.ts +41 -0
- package/dist/crypto/fieldKeys.d.ts.map +1 -0
- package/dist/crypto/fieldKeys.js +56 -0
- package/dist/data/codecs.d.ts +23 -10
- package/dist/data/codecs.d.ts.map +1 -1
- package/dist/data/codecs.js +50 -36
- package/dist/entitlement/allowance.d.ts +25 -0
- package/dist/entitlement/allowance.d.ts.map +1 -0
- package/dist/entitlement/allowance.js +80 -0
- package/dist/entitlement/entitlement.d.ts +41 -0
- package/dist/entitlement/entitlement.d.ts.map +1 -1
- package/dist/entitlement/meter.d.ts +57 -0
- package/dist/entitlement/meter.d.ts.map +1 -0
- package/dist/entitlement/meter.js +13 -0
- package/dist/error/extend.d.ts +6 -5
- package/dist/error/extend.d.ts.map +1 -1
- package/dist/error/http.d.ts +168 -0
- package/dist/error/http.d.ts.map +1 -1
- package/dist/error/payload.d.ts +336 -0
- package/dist/error/payload.d.ts.map +1 -1
- package/dist/error/payload.js +116 -4
- package/dist/error/pithyError.d.ts +18 -7
- package/dist/error/pithyError.d.ts.map +1 -1
- package/dist/error/pithyError.js +6 -0
- package/dist/http/authContext.d.ts +7 -0
- package/dist/http/authContext.d.ts.map +1 -1
- package/dist/http/authContext.js +8 -1
- package/dist/http/scopeGates.d.ts +20 -0
- package/dist/http/scopeGates.d.ts.map +1 -0
- package/dist/http/scopeGates.js +36 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/logger/logger.d.ts +12 -5
- package/dist/logger/logger.d.ts.map +1 -1
- package/dist/logger/record.d.ts +98 -0
- package/dist/logger/record.d.ts.map +1 -1
- package/dist/migrations/capabilitySets.d.ts +23 -0
- package/dist/migrations/capabilitySets.d.ts.map +1 -0
- package/dist/migrations/capabilitySets.js +74 -0
- package/dist/migrations/registry.d.ts +26 -0
- package/dist/migrations/registry.d.ts.map +1 -1
- package/dist/migrations/registry.js +38 -7
- package/dist/migrations/state.d.ts +60 -0
- package/dist/migrations/state.d.ts.map +1 -0
- package/dist/migrations/state.js +46 -0
- package/dist/naming/feature.d.ts +27 -5
- package/dist/naming/feature.d.ts.map +1 -1
- package/dist/naming/feature.js +36 -6
- package/dist/naming/limits.d.ts +47 -3
- package/dist/naming/limits.d.ts.map +1 -1
- package/dist/naming/limits.js +47 -3
- package/dist/naming/provisionScope.d.ts +6 -0
- package/dist/naming/provisionScope.d.ts.map +1 -1
- package/dist/naming/provisionScope.js +8 -3
- package/dist/naming/resourceNames.d.ts +21 -2
- package/dist/naming/resourceNames.d.ts.map +1 -1
- package/dist/naming/resourceNames.js +21 -3
- package/dist/privacy/blindIndex.d.ts +27 -0
- package/dist/privacy/blindIndex.d.ts.map +1 -0
- package/dist/privacy/blindIndex.js +57 -0
- package/dist/privacy/classes.d.ts +142 -0
- package/dist/privacy/classes.d.ts.map +1 -0
- package/dist/privacy/classes.js +209 -0
- package/dist/privacy/classify.d.ts +336 -0
- package/dist/privacy/classify.d.ts.map +1 -0
- package/dist/privacy/classify.js +1024 -0
- package/dist/privacy/encrypted.d.ts +210 -0
- package/dist/privacy/encrypted.d.ts.map +1 -0
- package/dist/privacy/encrypted.js +350 -0
- package/dist/privacy/encryptedColumns.d.ts +64 -0
- package/dist/privacy/encryptedColumns.d.ts.map +1 -0
- package/dist/privacy/encryptedColumns.js +134 -0
- package/dist/privacy/fieldRotation.d.ts +34 -0
- package/dist/privacy/fieldRotation.d.ts.map +1 -0
- package/dist/privacy/fieldRotation.js +186 -0
- package/dist/privacy/inventory.d.ts +12 -0
- package/dist/privacy/inventory.d.ts.map +1 -0
- package/dist/privacy/inventory.js +154 -0
- package/dist/privacy/posture.d.ts +114 -0
- package/dist/privacy/posture.d.ts.map +1 -0
- package/dist/privacy/posture.js +136 -0
- package/dist/privacy/redact.d.ts +7 -0
- package/dist/privacy/redact.d.ts.map +1 -0
- package/dist/privacy/redact.js +404 -0
- package/dist/privacy/report.d.ts +58 -0
- package/dist/privacy/report.d.ts.map +1 -0
- package/dist/privacy/report.js +15 -0
- package/dist/privacy/retirement.d.ts +68 -0
- package/dist/privacy/retirement.d.ts.map +1 -0
- package/dist/privacy/retirement.js +72 -0
- package/dist/privacy/sealed.d.ts +87 -0
- package/dist/privacy/sealed.d.ts.map +1 -0
- package/dist/privacy/sealed.js +221 -0
- package/dist/privacy/types.d.ts +559 -0
- package/dist/privacy/types.d.ts.map +1 -0
- package/dist/privacy/types.js +2 -0
- package/dist/seed/writeD1.d.ts +7 -1
- package/dist/seed/writeD1.d.ts.map +1 -1
- package/dist/seed/writeD1.js +9 -3
- package/dist/seed/writeKv.d.ts +2 -0
- package/dist/seed/writeKv.d.ts.map +1 -1
- package/dist/seed/writeKv.js +6 -2
- package/dist/version.generated.d.ts +1 -1
- package/dist/version.generated.js +1 -1
- package/dist/worker/serviceLoopback.d.ts +36 -0
- package/dist/worker/serviceLoopback.d.ts.map +1 -0
- package/dist/worker/serviceLoopback.js +74 -0
- package/dist/workflow/faults.d.ts +12 -1
- package/dist/workflow/faults.d.ts.map +1 -1
- package/dist/workflow/faults.js +22 -15
- package/package.json +2 -2
- package/src/access/access.ts +298 -0
- package/src/access/acting.ts +59 -0
- package/src/access/policyCheck.ts +77 -0
- package/src/access/usage.ts +141 -0
- package/src/access/visibility.ts +109 -0
- package/src/audit/auditEvent.ts +4 -0
- package/src/audit/recorder.ts +10 -2
- package/src/capability/bindings.ts +159 -13
- package/src/capability/capability.ts +114 -29
- package/src/capability/purge.ts +124 -0
- package/src/capability/settings.ts +146 -2
- package/src/cli/commandCatalog.generated.ts +271 -22
- package/src/cli/commandFacts.ts +2 -0
- package/src/controlPlane/capability.ts +36 -1
- package/src/controlPlane/context.ts +4 -0
- package/src/controlPlane/data/connection.ts +90 -0
- package/src/controlPlane/discovery/adminRoute.ts +11 -0
- package/src/controlPlane/error/errors.ts +4 -3
- package/src/controlPlane/http/cors.ts +4 -4
- package/src/controlPlane/http/guard.ts +21 -0
- package/src/controlPlane/http/handlers.ts +98 -4
- package/src/controlPlane/http/readiness.ts +50 -0
- package/src/controlPlane/http/responses.ts +240 -2
- package/src/controlPlane/http/routes.ts +55 -1
- package/src/controlPlane/http/verify.ts +2 -0
- package/src/controlPlane/migrationState/migrationState.ts +200 -0
- package/src/controlPlane/migrations/0003_connection_principal.ts +37 -0
- package/src/controlPlane/scope/scope.ts +25 -2
- package/src/controlPlane/token/base64url.ts +1 -1
- package/src/createBackend.ts +28 -6
- package/src/createEntrypoint.ts +9 -3
- package/src/crypto/envelope.ts +196 -0
- package/src/crypto/fieldKeys.ts +76 -0
- package/src/data/codecs.ts +69 -37
- package/src/entitlement/allowance.ts +85 -0
- package/src/entitlement/entitlement.ts +38 -0
- package/src/entitlement/meter.ts +69 -0
- package/src/error/extend.ts +6 -5
- package/src/error/payload.ts +253 -4
- package/src/error/pithyError.ts +21 -7
- package/src/http/authContext.ts +13 -1
- package/src/http/scopeGates.ts +34 -0
- package/src/index.ts +2 -0
- package/src/logger/logger.ts +12 -5
- package/src/migrations/capabilitySets.ts +87 -0
- package/src/migrations/registry.ts +46 -2
- package/src/migrations/state.ts +94 -0
- package/src/naming/feature.ts +46 -7
- package/src/naming/limits.ts +35 -3
- package/src/naming/provisionScope.ts +19 -1
- package/src/naming/resourceNames.ts +52 -5
- package/src/privacy/blindIndex.ts +81 -0
- package/src/privacy/classes.ts +277 -0
- package/src/privacy/classify.ts +1447 -0
- package/src/privacy/encrypted.ts +513 -0
- package/src/privacy/encryptedColumns.ts +185 -0
- package/src/privacy/fieldRotation.ts +234 -0
- package/src/privacy/inventory.ts +147 -0
- package/src/privacy/posture.ts +205 -0
- package/src/privacy/redact.ts +423 -0
- package/src/privacy/report.ts +64 -0
- package/src/privacy/retirement.ts +102 -0
- package/src/privacy/sealed.ts +323 -0
- package/src/privacy/types.ts +804 -0
- package/src/seed/writeD1.ts +13 -4
- package/src/seed/writeKv.ts +6 -2
- package/src/version.generated.ts +1 -1
- package/src/worker/serviceLoopback.ts +105 -0
- package/src/workflow/faults.ts +51 -24
|
@@ -0,0 +1,559 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2026 Pithy
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
import type { z } from "zod";
|
|
4
|
+
import type { SQLiteBoolean, SQLiteDate, SqliteJsonSchema } from "../data/codecs";
|
|
5
|
+
import type { MAX_RECURSION_DEPTH, ValueKind } from "./classify";
|
|
6
|
+
/**
|
|
7
|
+
* **The type gate: a marked value does not compile into a log, an audit record or an error detail** (#132).
|
|
8
|
+
*
|
|
9
|
+
* A marker brands a field's output type under the `privacy:` key (`./classes`). These types are what read
|
|
10
|
+
* that brand on the three internal surfaces — the logger's fields, `AuditEvent.metadata`, `PithyError.detail`
|
|
11
|
+
* — and refuse it at compile time, where the mistake is a red build rather than a row in an adopter's D1 that
|
|
12
|
+
* nobody can retract.
|
|
13
|
+
*
|
|
14
|
+
* ## What the compiler checks, exactly
|
|
15
|
+
*
|
|
16
|
+
* - **A marked value itself**, anywhere a field value goes: `log.info("m", { email: user.email })` fails.
|
|
17
|
+
* - **A marked value inside an object or an array, down to {@link PRIVACY_CHECK_DEPTH} levels below the field**:
|
|
18
|
+
* `{ user }`, `{ user: { email } }`, `{ users: [user] }`, `{ batch: { users: [user] } }` all fail.
|
|
19
|
+
* - **A marked key**: a record keyed by a marked value, `Record<User["email"], …>`, is refused like the value.
|
|
20
|
+
* - **A marked string as a message**: `log.info(user.email)`, `log.child(user.email)`, and `message`, `action` or
|
|
21
|
+
* `detail` on any `PithyError` constructor fail, because each takes {@link UnmarkedString}.
|
|
22
|
+
*
|
|
23
|
+
* ## What it does not, and cannot
|
|
24
|
+
*
|
|
25
|
+
* - **Deeper than {@link PRIVACY_CHECK_DEPTH}.** The bound is there so the walk terminates on a recursive type
|
|
26
|
+
* (a JSON alias, a tree), not for speed: measured with `tsc --extendedDiagnostics` (TypeScript 7.0.2,
|
|
27
|
+
* 2026-10-20, #132), the gate costs `@pithy-sh/auth` +0.6% types and +0.1% instantiations over `main`, and
|
|
28
|
+
* moving the bound from 1 to 9 changes either count by less than 0.01% on every package — and by about 330
|
|
29
|
+
* types and 5,400 instantiations on a file that logs a Hono `Context`, a `Kysely` instance and an
|
|
30
|
+
* eight-level object, because `Error`, functions, promises, maps and sets are not walked. Below the bound a
|
|
31
|
+
* value is not inspected.
|
|
32
|
+
* - **A template literal.** `` `signup for ${email}` `` is a `string` to TypeScript, whatever was
|
|
33
|
+
* interpolated, and no type can see through it. `detail` is where this matters most; interpolate the
|
|
34
|
+
* `redact`ed value, or the id, instead.
|
|
35
|
+
* - **A cast or an `unknown`.** A value the compiler cannot see is a value it cannot refuse.
|
|
36
|
+
*
|
|
37
|
+
* None of the three is checked at runtime either: a marker changes no runtime value, so a string that
|
|
38
|
+
* escaped the type is an ordinary string. `docs/PRIVACY.md` says the same to adopters.
|
|
39
|
+
*/
|
|
40
|
+
/** How many levels of object or array below a field value the gate inspects. See the module note. */
|
|
41
|
+
export type PRIVACY_CHECK_DEPTH = 6;
|
|
42
|
+
/** Depth countdown: `Prev[3]` is `2`. Index past the end is `never`, which stops the walk. */
|
|
43
|
+
type Prev = [never, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19];
|
|
44
|
+
/** One level down from `D`, and `never` from `never`: indexing {@link Prev} with `never` is not `never`. */
|
|
45
|
+
type Down<D extends number> = [D] extends [never] ? never : Prev[D];
|
|
46
|
+
/** `true` for `any`, so an untyped value is never mistaken for a marked one. */
|
|
47
|
+
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
48
|
+
/**
|
|
49
|
+
* Values whose structure is not data: walking an `Error`'s payload union or a `Request`'s methods would cost the
|
|
50
|
+
* compiler a great deal and could only ever find a brand somebody put there by hand.
|
|
51
|
+
*/
|
|
52
|
+
type Opaque = Error | Date | RegExp | ((...args: never[]) => unknown) | PromiseLike<unknown> | ReadonlyMap<unknown, unknown> | ReadonlySet<unknown>;
|
|
53
|
+
/** Whether `T` carries a privacy brand. Distributes, so `marked | undefined` is `boolean` — test with `true extends`. */
|
|
54
|
+
export type IsMarked<T> = IsAny<T> extends true ? false : T extends {
|
|
55
|
+
readonly [z.core.$brand]: infer M;
|
|
56
|
+
} ? [Extract<keyof M, `privacy:${string}`>] extends [never] ? false : true : false;
|
|
57
|
+
/**
|
|
58
|
+
* Whether `T`, or anything up to `D` levels of object or array inside it, carries a privacy brand — in a value, or
|
|
59
|
+
* in a key: a `Record<User["email"], number>` holds every email it is keyed by.
|
|
60
|
+
*/
|
|
61
|
+
export type ContainsMarked<T, D extends number = PRIVACY_CHECK_DEPTH> = IsAny<T> extends true ? false : [D] extends [never] ? false : true extends IsMarked<T> ? true : T extends Opaque ? false : T extends readonly (infer E)[] ? ContainsMarked<E, Down<D>> : T extends object ? true extends IsMarked<keyof T> ? true : true extends {
|
|
62
|
+
[K in keyof T]-?: ContainsMarked<T[K], Down<D>>;
|
|
63
|
+
}[keyof T] ? true : false : false;
|
|
64
|
+
/**
|
|
65
|
+
* The type a refused field takes, so the compiler's error reads as the rule: `Type 'string & $brand<…>' is not
|
|
66
|
+
* assignable to type '"A value marked with a privacy class …"'`.
|
|
67
|
+
*/
|
|
68
|
+
export type PrivateValueRefused = "A value marked with a privacy class cannot reach a log, an audit record or an error detail. Pass redact(Schema, value), or an unmarked field, instead.";
|
|
69
|
+
/**
|
|
70
|
+
* A record of fields, each one either kept as written or refused because it holds a marked value. A surface
|
|
71
|
+
* that accepts structured fields takes `F & Loggable<F>`: `F` infers from the call, and `Loggable<F>` replaces
|
|
72
|
+
* every field that carries a brand with {@link PrivateValueRefused}, so the call fails on that key alone.
|
|
73
|
+
*/
|
|
74
|
+
export type Loggable<F> = {
|
|
75
|
+
[K in keyof F]: true extends ContainsMarked<F[K]> ? PrivateValueRefused : F[K];
|
|
76
|
+
};
|
|
77
|
+
/** No privacy brand. Any other brand — an adopter's `UserId` — is untouched. */
|
|
78
|
+
type NoPrivacyBrand = {
|
|
79
|
+
readonly [z.core.$brand]?: {
|
|
80
|
+
readonly [K in `privacy:${string}`]?: never;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* A string that is not marked. A plain `string` and a template literal both are; `user.email` from a `pii()`
|
|
85
|
+
* field is not. What a log message, a logger's name and `PithyError`'s `message`, `action` and `detail` take.
|
|
86
|
+
*/
|
|
87
|
+
export type UnmarkedString = string & NoPrivacyBrand;
|
|
88
|
+
/**
|
|
89
|
+
* What `redact(schema, value)` returns, named by the schema: the type a caller names for a value it already redacted,
|
|
90
|
+
* `Redacted<typeof User>`. It is {@link RedactedOutput}, and it takes the schema rather than the value's type on
|
|
91
|
+
* purpose: a value's type cannot tell a plain object from the output of a transform, which `redact` may mask whole.
|
|
92
|
+
* Nor can a schema's: a class instance where an object with a mark beneath is expected is masked whole at runtime,
|
|
93
|
+
* outside the contract, and typed as the object it stands in for.
|
|
94
|
+
*/
|
|
95
|
+
export type Redacted<S extends z.ZodType> = RedactedOutput<S>;
|
|
96
|
+
/**
|
|
97
|
+
* **What `redact(schema, value)` returns, read off the schema: the redaction contract (`./redact`) at the type level.**
|
|
98
|
+
*
|
|
99
|
+
* - **A marked position is a `string`**, beside the `null` or `undefined` its wrappers add: a marked node, or a
|
|
100
|
+
* position a mark reaches through no union option. A mark reached through an option applies where the value has
|
|
101
|
+
* that option's shape, so an option of another shape beside it keeps its own type: `z.union([pii(z.string()),
|
|
102
|
+
* z.array(z.string())])` is `string | string[]`.
|
|
103
|
+
* - **Every structural kind keeps its shape**: an object maps its fields, an array and a tuple their elements, a
|
|
104
|
+
* record and a map their values, a set its elements, and a marked key becomes `string`. Each wrapper keeps what it
|
|
105
|
+
* adds. A union is a union of its members and an intersection intersects its sides, each with every option's and
|
|
106
|
+
* every side's marks at each position: an array beside a tuple is typed index by index where the tuple names one,
|
|
107
|
+
* and a record or an open object beside an object types each key the object names. An intersection with a record
|
|
108
|
+
* on either side is `unknown`, as a record's masked keys rename the other side's keys too. The kit's three codecs
|
|
109
|
+
* are the schema they decode to, and a JSON column is known by the type `sqliteJson` returns, never by its shape.
|
|
110
|
+
* - **An opaque node is its own output**, or `unknown` where a mark sits anywhere beneath it or may, because `redact`
|
|
111
|
+
* masks it whole there. The search beneath it reads every schema once, to the one recursion limit, so an unmarked
|
|
112
|
+
* schema of any depth keeps its output. A recursion beneath it is `unknown` however it is written, as a type cannot
|
|
113
|
+
* tell one defined once from one built anew, which reaches the limit and is masked; so is a schema annotated
|
|
114
|
+
* `z.ZodType<T>` beneath it. That is the one place the type says `unknown`, with two more a type cannot see past: a
|
|
115
|
+
* schema annotated `z.ZodType<T>`, as a self-referencing `z.lazy` must be, names no kind; and `any`.
|
|
116
|
+
* - **A `.catch()` over a structure is read as the opaque node it may be**: `unknown` where a mark sits beneath it, a
|
|
117
|
+
* constant fallback included, as the type cannot tell one from a function, which `redact` masks whole. An
|
|
118
|
+
* `.overwrite()` keeps the type of the schema it is called on, so the type cannot see it.
|
|
119
|
+
* - **A position nested deeper than {@link REDACT_RECURSION_DEPTH} levels is `unknown`**, as `redact` masks it whole
|
|
120
|
+
* from the same depth: every object, array, tuple, record, map and set above it counts one.
|
|
121
|
+
*/
|
|
122
|
+
export type RedactedOutput<S> = At<S, S, []>;
|
|
123
|
+
/**
|
|
124
|
+
* The one recursion limit, in levels of nesting: the type of `MAX_RECURSION_DEPTH`, the constant `redact` stops at. A
|
|
125
|
+
* position nested deeper than this is `unknown`, as `redact` masks it whole there.
|
|
126
|
+
*/
|
|
127
|
+
export type REDACT_RECURSION_DEPTH = typeof MAX_RECURSION_DEPTH;
|
|
128
|
+
/** How deep a position is: one element per level of nesting above it, or `"past"` beyond the limit. */
|
|
129
|
+
type Depth = readonly unknown[] | "past";
|
|
130
|
+
/** One level of nesting below `D`. */
|
|
131
|
+
type Deeper<D extends Depth> = D extends readonly unknown[] ? D["length"] extends REDACT_RECURSION_DEPTH ? "past" : [...D, 0] : "past";
|
|
132
|
+
/** A schema kind, read off its definition. Anything that is not a schema has a kind no branch below names. */
|
|
133
|
+
type DefOf<S> = S extends {
|
|
134
|
+
readonly _zod: {
|
|
135
|
+
readonly def: infer D;
|
|
136
|
+
};
|
|
137
|
+
} ? D : {
|
|
138
|
+
readonly type: "not-a-schema";
|
|
139
|
+
};
|
|
140
|
+
/** A schema's output, by its own `_zod`. Distributes over a union of schemas. */
|
|
141
|
+
type Out<S> = S extends {
|
|
142
|
+
readonly _zod: {
|
|
143
|
+
readonly output: infer O;
|
|
144
|
+
};
|
|
145
|
+
} ? O : never;
|
|
146
|
+
/** A Zod schema, as a definition slot holds one. */
|
|
147
|
+
type Schema = {
|
|
148
|
+
readonly _zod: {
|
|
149
|
+
readonly output: unknown;
|
|
150
|
+
readonly def: unknown;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
/** The wrappers that are the same position as what they wrap. */
|
|
154
|
+
type Wrapper = "optional" | "nullable" | "default" | "prefault" | "readonly" | "catch" | "nonoptional";
|
|
155
|
+
/** The kinds a value is walked into. */
|
|
156
|
+
type Structural = "object" | "array" | "tuple" | "record" | "map" | "set";
|
|
157
|
+
/**
|
|
158
|
+
* The schema one of the kit's three codecs decodes to, or `never` for any other node. A JSON column is known by the type
|
|
159
|
+
* `sqliteJson` names, never by its shape: an adopter's codec built the same way is opaque, as it is to `redact`.
|
|
160
|
+
*/
|
|
161
|
+
type KitCodec<S> = S extends typeof SQLiteDate | typeof SQLiteBoolean ? DefOf<S> extends {
|
|
162
|
+
out: infer O;
|
|
163
|
+
} ? O : never : SqliteJsonSchema<S>;
|
|
164
|
+
/**
|
|
165
|
+
* Whether a schema is a marked node: every value its output holds, `null` and `undefined` aside, carries a privacy
|
|
166
|
+
* brand, and the brand is its own. A union with one marked option among others is not one; it is read option by
|
|
167
|
+
* option. Nor is a pipe whose every output value takes every privacy brand it has from what it pipes into, such as
|
|
168
|
+
* `z.email().pipe(pii(z.string()))` or a transform that returns a marked value: the mark is beneath an opaque node, so
|
|
169
|
+
* `redact` masks it whole and the type is `unknown`. A marker on the pipe itself is the pipe's own, though one option
|
|
170
|
+
* of what it pipes into carries the same class: `pii(sqliteJson(z.union([pii(z.boolean()), z.array(z.number())])))`
|
|
171
|
+
* brands its array with `pii` too, and only the pipe's own marker can have put it there.
|
|
172
|
+
*/
|
|
173
|
+
type IsMarkedNode<S> = [Exclude<Out<S>, null | undefined>] extends [never] ? false : false extends IsMarked<Exclude<Out<S>, null | undefined>> ? false : DefOf<S> extends {
|
|
174
|
+
type: "pipe";
|
|
175
|
+
out: infer O;
|
|
176
|
+
} ? true extends LacksBrand<Exclude<Out<O>, null | undefined>, PrivacyBrands<Out<S>>> ? true : [Exclude<Out<O>, null | undefined>] extends [never] ? true : false : true;
|
|
177
|
+
/** The privacy brand keys on `T`'s output. Distributes. */
|
|
178
|
+
type PrivacyBrands<T> = T extends {
|
|
179
|
+
readonly [z.core.$brand]: infer M;
|
|
180
|
+
} ? Extract<keyof M, `privacy:${string}`> : never;
|
|
181
|
+
/** Whether some member of `T` lacks a privacy brand in `B`. Distributes. */
|
|
182
|
+
type LacksBrand<T, B> = T extends unknown ? ([Exclude<B, PrivacyBrands<T>>] extends [never] ? false : true) : never;
|
|
183
|
+
/** The shape each kind of schema produces, as `kindsOf` reads it at runtime. */
|
|
184
|
+
interface SchemaKinds {
|
|
185
|
+
string: "string";
|
|
186
|
+
template_literal: "string";
|
|
187
|
+
number: "number";
|
|
188
|
+
nan: "number";
|
|
189
|
+
bigint: "bigint";
|
|
190
|
+
boolean: "boolean";
|
|
191
|
+
symbol: "symbol";
|
|
192
|
+
function: "function";
|
|
193
|
+
date: "date";
|
|
194
|
+
object: "object";
|
|
195
|
+
record: "object";
|
|
196
|
+
array: "array";
|
|
197
|
+
tuple: "array";
|
|
198
|
+
map: "map";
|
|
199
|
+
set: "set";
|
|
200
|
+
}
|
|
201
|
+
/** The shape of a value of type `T`, as `kindOfValue` reads it at runtime. Distributes; every shape for `unknown`. */
|
|
202
|
+
type OutKind<T> = T extends null | undefined ? never : T extends string ? "string" : T extends number ? "number" : T extends bigint ? "bigint" : T extends boolean ? "boolean" : T extends symbol ? "symbol" : T extends Date ? "date" : T extends readonly unknown[] ? "array" : T extends ReadonlyMap<unknown, unknown> ? "map" : T extends ReadonlySet<unknown> ? "set" : T extends (...args: never[]) => unknown ? "function" : T extends object ? "object" : ValueKind;
|
|
203
|
+
/**
|
|
204
|
+
* The shapes a schema's output can have, read the way `kindsOf` reads them: through wrappers, the options of a union,
|
|
205
|
+
* the sides of an intersection, a lazy and the kit's codecs. Every shape for an opaque node. Distributes.
|
|
206
|
+
*/
|
|
207
|
+
type KindOf<S, D extends number = REDACT_TYPE_DEPTH> = [D] extends [never] ? TooDeep : S extends unknown ? DefOf<S> extends {
|
|
208
|
+
type: Wrapper;
|
|
209
|
+
innerType: infer I;
|
|
210
|
+
} ? KindOf<I, Down<D>> : DefOf<S> extends {
|
|
211
|
+
type: "union";
|
|
212
|
+
options: readonly (infer O)[];
|
|
213
|
+
} ? KindOf<O, Down<D>> : DefOf<S> extends {
|
|
214
|
+
type: "intersection";
|
|
215
|
+
left: infer L;
|
|
216
|
+
right: infer R;
|
|
217
|
+
} ? Extract<KindOf<L, Down<D>>, KindOf<R, Down<D>>> : DefOf<S> extends {
|
|
218
|
+
type: "lazy";
|
|
219
|
+
getter: () => infer I;
|
|
220
|
+
} ? KindOf<I, Down<D>> : DefOf<S> extends {
|
|
221
|
+
type: infer T extends keyof SchemaKinds;
|
|
222
|
+
} ? SchemaKinds[T] : DefOf<S> extends {
|
|
223
|
+
type: "literal" | "enum";
|
|
224
|
+
} ? OutKind<Out<S>> : DefOf<S> extends {
|
|
225
|
+
type: "null" | "undefined" | "void" | "never";
|
|
226
|
+
} ? never : [KitCodec<S>] extends [never] ? ValueKind : KitCodec<S> extends infer C ? KindOf<C, Down<D>> : never : never;
|
|
227
|
+
/**
|
|
228
|
+
* The shapes of value a position masks: every shape for a mark reached through no union option, and, for one reached
|
|
229
|
+
* through options, the shapes every option on the way has. `never` where nothing here is marked. Distributes.
|
|
230
|
+
*/
|
|
231
|
+
type MaskedKinds<S, G = ValueKind, D extends number = REDACT_TYPE_DEPTH> = [D] extends [never] ? TooDeep : S extends unknown ? IsMarkedNode<S> extends true ? G : DefOf<S> extends {
|
|
232
|
+
type: Wrapper;
|
|
233
|
+
innerType: infer I;
|
|
234
|
+
} ? MaskedKinds<I, G, Down<D>> : DefOf<S> extends {
|
|
235
|
+
type: "union";
|
|
236
|
+
options: readonly (infer O)[];
|
|
237
|
+
} ? Gated<O, G, Down<D>> : DefOf<S> extends {
|
|
238
|
+
type: "intersection";
|
|
239
|
+
left: infer L;
|
|
240
|
+
right: infer R;
|
|
241
|
+
} ? MaskedKinds<L, G, Down<D>> | MaskedKinds<R, G, Down<D>> : DefOf<S> extends {
|
|
242
|
+
type: "lazy";
|
|
243
|
+
getter: () => infer I;
|
|
244
|
+
} ? MaskedKinds<I, G, Down<D>> : [KitCodec<S>] extends [never] ? never : MaskedKinds<KitCodec<S>, G, Down<D>> : never;
|
|
245
|
+
/**
|
|
246
|
+
* Each union option's marks, narrowed to the shapes that option has. Distributes over the options. An option whose
|
|
247
|
+
* shapes the type cannot follow to the end leaves the position {@link TooDeep}.
|
|
248
|
+
*/
|
|
249
|
+
type Gated<O, G, D extends number> = O extends unknown ? TooDeep extends KindOf<O> ? TooDeep : MaskedKinds<O, Extract<G, KindOf<O>>, D> : never;
|
|
250
|
+
/** A structural node's shape, where a mark masks it whole. */
|
|
251
|
+
type StructuralKind<S> = DefOf<S> extends {
|
|
252
|
+
type: "object" | "record";
|
|
253
|
+
} ? "object" : DefOf<S> extends {
|
|
254
|
+
type: "array" | "tuple";
|
|
255
|
+
} ? "array" : DefOf<S> extends {
|
|
256
|
+
type: "map";
|
|
257
|
+
} ? "map" : DefOf<S> extends {
|
|
258
|
+
type: "set";
|
|
259
|
+
} ? "set" : never;
|
|
260
|
+
/** An output with each value of a masked shape `M` masked to a `string`. Distributes; `unknown` stays `unknown`. */
|
|
261
|
+
type MaskOut<T, M> = unknown extends T ? T : T extends null | undefined ? T : [OutKind<T>] extends [never] ? T : OutKind<T> extends M ? string : T;
|
|
262
|
+
/**
|
|
263
|
+
* Every node at a position: `S` flattened through its wrappers, the options of a union, the sides of an intersection,
|
|
264
|
+
* each lazy and the kit's codecs, stopping at a marked node. Distributes over a union of schemas.
|
|
265
|
+
*/
|
|
266
|
+
type Nodes<S, D extends number = REDACT_TYPE_DEPTH> = [D] extends [never] ? TooDeep : S extends unknown ? IsMarkedNode<S> extends true ? S : IsMadeCatch<S> extends true ? S : DefOf<S> extends {
|
|
267
|
+
type: Wrapper;
|
|
268
|
+
innerType: infer I;
|
|
269
|
+
} ? Nodes<I, Down<D>> : DefOf<S> extends {
|
|
270
|
+
type: "union";
|
|
271
|
+
options: readonly (infer O)[];
|
|
272
|
+
} ? Nodes<O, Down<D>> : DefOf<S> extends {
|
|
273
|
+
type: "intersection";
|
|
274
|
+
left: infer L;
|
|
275
|
+
right: infer R;
|
|
276
|
+
} ? Nodes<L, Down<D>> | Nodes<R, Down<D>> : DefOf<S> extends {
|
|
277
|
+
type: "lazy";
|
|
278
|
+
getter: () => infer I;
|
|
279
|
+
} ? Nodes<I, Down<D>> : [KitCodec<S>] extends [never] ? S : Nodes<KitCodec<S>, Down<D>> : never;
|
|
280
|
+
/**
|
|
281
|
+
* Whether a schema is a `.catch()` over a structure. A fallback function makes a new value, so `redact` masks it whole
|
|
282
|
+
* over a mark, as it does a transform; a constant one is walked. The type cannot tell the two apart, so it reads every
|
|
283
|
+
* such catch as the node it may be: `unknown` where a mark sits beneath it, and its own output where none does.
|
|
284
|
+
*/
|
|
285
|
+
type IsMadeCatch<S> = DefOf<S> extends {
|
|
286
|
+
type: "catch";
|
|
287
|
+
innerType: infer I;
|
|
288
|
+
} ? [Extract<KindOf<I>, "object" | "array" | "map" | "set">] extends [never] ? false : true : false;
|
|
289
|
+
/**
|
|
290
|
+
* How many levels of wrapper, choice and lazy {@link Nodes} flattens at one position. Past it the position is typed
|
|
291
|
+
* `unknown`, never guessed: `redact` walks any number of them, so a concrete type there could be wrong.
|
|
292
|
+
*/
|
|
293
|
+
export type REDACT_TYPE_DEPTH = 16;
|
|
294
|
+
/**
|
|
295
|
+
* What {@link Nodes}, {@link MaskedKinds} and {@link KindOf} answer where they run out of {@link REDACT_TYPE_DEPTH}: a
|
|
296
|
+
* kind no value has and a node no schema is, so a position that holds it is typed `unknown`.
|
|
297
|
+
*/
|
|
298
|
+
type TooDeep = "past-the-type-depth";
|
|
299
|
+
/** Whether the type could not follow a position's wrappers and choices to the end. */
|
|
300
|
+
type Unfollowed<C> = TooDeep extends Nodes<C> ? true : TooDeep extends MaskedKinds<C> ? true : false;
|
|
301
|
+
/** Whether a node is one the walk goes into. */
|
|
302
|
+
type IsStructural<S> = DefOf<S> extends {
|
|
303
|
+
type: Structural;
|
|
304
|
+
} ? true : false;
|
|
305
|
+
/** A search's answer: `true` when a mark was found, `"deep"` when none was but it ran out of depth. */
|
|
306
|
+
type Verdict<R> = true extends R ? true : "deep" extends R ? "deep" : false;
|
|
307
|
+
/**
|
|
308
|
+
* Whether a schema carries a mark anywhere beneath it: `true`, `false`, or `"deep"` where the search ran past the one
|
|
309
|
+
* recursion limit, or may. It reads level by level, every schema once; as the runtime search does, a level is one more
|
|
310
|
+
* object, array, tuple, record, map, set or lazy. It is `"deep"` wherever it meets a recursion, a getter or a lazy
|
|
311
|
+
* that comes round to a schema above it: a type cannot tell one defined once, which the runtime reads to its end, from
|
|
312
|
+
* one built anew each read, which reaches the limit and is masked whole. So is a schema annotated `z.ZodType<T>`,
|
|
313
|
+
* which names no kind the search could read inside.
|
|
314
|
+
*/
|
|
315
|
+
type HasMark<S> = SearchLevel<S, never, never, []>;
|
|
316
|
+
/**
|
|
317
|
+
* One round of the search. `Cur` is still to read at depth `L`, `Next` waits for the level below, and `Seen` has been
|
|
318
|
+
* read. A schema is seen when it and one already read are each assignable to the other.
|
|
319
|
+
*/
|
|
320
|
+
type SearchLevel<Cur, Next, Seen, L extends readonly unknown[]> = [Cur] extends [never] ? [Next] extends [never] ? false : SearchLevel<Next, never, Seen, [...L, 0]> : true extends Recurs<Cur, Seen> ? "deep" : Unseen<Cur, Seen> extends infer New ? [New] extends [never] ? SearchLevel<never, Next, Seen, L> : true extends AnyBranded<New> ? true : true extends Unnamed<New> ? "deep" : [Nested<New>] extends [never] ? SearchLevel<Children<New>, Next, Seen | New, L> : L["length"] extends REDACT_RECURSION_DEPTH ? "deep" : SearchLevel<Children<Flat<New>>, Next | Children<Nested<New>>, Seen | New, L> : never;
|
|
321
|
+
/**
|
|
322
|
+
* Whether a schema met again is a recursion: one among `Cur` already read, a level counted at it, that reaches itself.
|
|
323
|
+
* A schema used twice at two depths is met again too, and reaches no copy of itself. Distributes.
|
|
324
|
+
*/
|
|
325
|
+
type Recurs<Cur, Seen> = Nested<Cur> extends infer R ? R extends unknown ? true extends IsSeen<R, Seen> ? Reaches<Children<R>, R, never> : false : never : never;
|
|
326
|
+
/** Whether `T` is among the schemas beneath `Cur`, each read once. */
|
|
327
|
+
type Reaches<Cur, T, Seen> = [Cur] extends [never] ? false : true extends IsSeen<T, Cur> ? true : Reaches<Children<Unseen<Cur, Seen>>, T, Seen | Cur>;
|
|
328
|
+
/** The schemas among `N` not yet read. Distributes. */
|
|
329
|
+
type Unseen<N, Seen> = N extends unknown ? (true extends IsSeen<N, Seen> ? never : N) : never;
|
|
330
|
+
/** Whether `N` is one of `Seen`: each assignable to the other. */
|
|
331
|
+
type IsSeen<N, Seen> = Seen extends unknown ? [N] extends [Seen] ? [Seen] extends [N] ? true : false : false : never;
|
|
332
|
+
/** Whether any schema among `N` has a privacy brand on its output. Distributes. */
|
|
333
|
+
type AnyBranded<N> = N extends Schema ? IsMarked<Out<N>> : false;
|
|
334
|
+
/** The schemas among `N` a level of nesting is counted at. Distributes. */
|
|
335
|
+
type Nested<N> = N extends unknown ? (DefOf<N> extends {
|
|
336
|
+
type: Structural | "lazy";
|
|
337
|
+
} ? N : never) : never;
|
|
338
|
+
/** The schemas among `N` read at the level they sit at. Distributes. */
|
|
339
|
+
type Flat<N> = N extends unknown ? (DefOf<N> extends {
|
|
340
|
+
type: Structural | "lazy";
|
|
341
|
+
} ? never : N) : never;
|
|
342
|
+
/**
|
|
343
|
+
* Every schema a definition holds: a schema, a lazy's getter, a list of schemas, or an object's shape. An object's
|
|
344
|
+
* definition names its catchall only as a schema of any kind, so the catchall is read from its config. Distributes.
|
|
345
|
+
*/
|
|
346
|
+
type Children<N> = N extends Schema ? {
|
|
347
|
+
[K in keyof DefOf<N>]-?: K extends "checks" | "catchall" ? never : SlotSchemas<DefOf<N>[K]>;
|
|
348
|
+
}[keyof DefOf<N>] | OpenCatchall<N> : never;
|
|
349
|
+
/** The schemas one slot of a definition holds. */
|
|
350
|
+
type SlotSchemas<V> = V extends Schema ? V : V extends () => infer R ? Extract<R, Schema> : V extends readonly (infer E)[] ? Extract<E, Schema> : V extends object ? {
|
|
351
|
+
[K in keyof V]-?: V[K] extends Schema ? V[K] : never;
|
|
352
|
+
}[keyof V] : never;
|
|
353
|
+
/** Whether an opaque node among `N` carries a mark beneath it, or may. Distributes. */
|
|
354
|
+
type AnyOpaqueMarked<N> = N extends unknown ? IsMarkedNode<N> extends true ? false : IsStructural<N> extends true ? false : HasMark<N> : never;
|
|
355
|
+
/** Whether a node's schema type names no single kind: one typed `z.ZodType<T>`, whose definition could be any. */
|
|
356
|
+
type Unnamed<N> = N extends unknown ? DefOf<N> extends {
|
|
357
|
+
type: infer T;
|
|
358
|
+
} ? string extends T ? true : IsUnion<T> : true : never;
|
|
359
|
+
/** Whether a union of string literals has more than one member. */
|
|
360
|
+
type IsUnion<T, U = T> = T extends unknown ? ([U] extends [T] ? false : true) : never;
|
|
361
|
+
/**
|
|
362
|
+
* One member's schema `S` at a position `D` levels deep, against `C`, every schema that reaches it. `C` decides whether
|
|
363
|
+
* the position is masked, and what is at each position below it; `S` decides the shape this member keeps.
|
|
364
|
+
*/
|
|
365
|
+
type At<S, C, D extends Depth> = [S] extends [never] ? never : [D] extends ["past"] ? unknown : IsAny<Out<S>> extends true ? unknown : Unfollowed<C> extends true ? unknown : Verdict<AnyOpaqueMarked<Nodes<C>>> extends false ? Masked<S, C, D, MaskedKinds<C>> : unknown;
|
|
366
|
+
/**
|
|
367
|
+
* A position whose values of shape `M` are masked: a `string` where every shape is, and otherwise each member keeps
|
|
368
|
+
* its shape, with its values of a masked shape a `string`.
|
|
369
|
+
*/
|
|
370
|
+
type Masked<S, C, D extends Depth, M> = [ValueKind] extends [M] ? string | Extract<Out<S>, null | undefined> : true extends Unnamed<Nodes<C>> ? unknown : Shaped<S, Nodes<C>, D, M>;
|
|
371
|
+
/** A structural result keeps a brand that is not a privacy class, as the copy is the same kind of value. */
|
|
372
|
+
type Rebrand<S, X> = Out<S> extends {
|
|
373
|
+
readonly [z.core.$brand]: infer B;
|
|
374
|
+
} ? KeptBrand<X, Exclude<keyof B, `privacy:${string}`>> : X;
|
|
375
|
+
/** `X` with the brands `K`, or `X` itself where there are none. */
|
|
376
|
+
type KeptBrand<X, K> = [K] extends [never] ? X : X & z.core.$brand<K & (string | number | symbol)>;
|
|
377
|
+
/**
|
|
378
|
+
* Keys renamed to `string` where a record at the position masks them: a string key, a number key's included, where its
|
|
379
|
+
* key schema marks any shape but a symbol, and a symbol key where it marks a symbol.
|
|
380
|
+
*/
|
|
381
|
+
type KeyName<K, N> = K extends typeof z.core.$brand ? never : K extends symbol ? "symbol" extends KeyMasks<N> ? string : K : MasksStringKeys<N> extends true ? string : K;
|
|
382
|
+
/** Whether a record at the position masks its string keys: its key schema marks any shape but a symbol. */
|
|
383
|
+
type MasksStringKeys<N> = [Exclude<KeyMasks<N>, "symbol">] extends [never] ? false : true;
|
|
384
|
+
/**
|
|
385
|
+
* The shapes of key a record at the position masks. A key schema with an opaque node over a mark, such as
|
|
386
|
+
* `z.email().pipe(pii(z.string()))`, masks a key of every shape, as `redact` masks it whole, so its keys are plain
|
|
387
|
+
* strings and never keep the brand the opaque node's output carries.
|
|
388
|
+
*/
|
|
389
|
+
type KeyMasks<N> = Unfollowed<RecordKeys<N>> extends true ? ValueKind : Verdict<AnyOpaqueMarked<Nodes<RecordKeys<N>>>> extends false ? MaskedKinds<RecordKeys<N>> : ValueKind;
|
|
390
|
+
/**
|
|
391
|
+
* One schema at a position that is walked into, against `N`, every node at the position, with the values of a shape
|
|
392
|
+
* in `M` masked: a marked node is a `string`, a wrapper keeps what it adds, a union and an intersection keep their
|
|
393
|
+
* form, and a structural node maps by every node's schemas, or is a `string` where its shape is masked. Any other
|
|
394
|
+
* node, unmarked and with nothing marked beneath it, keeps its output type, which is what `redact` hands back.
|
|
395
|
+
*/
|
|
396
|
+
type Shaped<S, N, D extends Depth, M> = S extends unknown ? IsMarkedNode<S> extends true ? string | Extract<Out<S>, null | undefined> : StructuralKind<S> extends infer K ? [K] extends [never] ? Rebrand<S, ShapedNode<S, N, D, M>> : K extends M ? string : Rebrand<S, ShapedNode<S, N, D, M>> : never : never;
|
|
397
|
+
/** {@link Shaped}, before a brand that is not a privacy class is put back. */
|
|
398
|
+
type ShapedNode<S, N, D extends Depth, M> = S extends unknown ? DefOf<S> extends {
|
|
399
|
+
type: "optional";
|
|
400
|
+
innerType: infer I;
|
|
401
|
+
} ? Shaped<I, N, D, M> | undefined : DefOf<S> extends {
|
|
402
|
+
type: "nullable";
|
|
403
|
+
innerType: infer I;
|
|
404
|
+
} ? Shaped<I, N, D, M> | null : DefOf<S> extends {
|
|
405
|
+
type: "default" | "prefault" | "nonoptional";
|
|
406
|
+
innerType: infer I;
|
|
407
|
+
} ? Exclude<Shaped<I, N, D, M>, undefined> : DefOf<S> extends {
|
|
408
|
+
type: "catch";
|
|
409
|
+
innerType: infer I;
|
|
410
|
+
} ? IsMadeCatch<S> extends true ? MaskOut<Out<S>, M> : Shaped<I, N, D, M> : DefOf<S> extends {
|
|
411
|
+
type: "readonly";
|
|
412
|
+
innerType: infer I;
|
|
413
|
+
} ? z.core.util.MakeReadonly<Shaped<I, N, D, M>> : DefOf<S> extends {
|
|
414
|
+
type: "lazy";
|
|
415
|
+
getter: () => infer I;
|
|
416
|
+
} ? Shaped<I, N, D, M> : DefOf<S> extends {
|
|
417
|
+
type: "union";
|
|
418
|
+
options: readonly (infer O)[];
|
|
419
|
+
} ? Shaped<O, N, D, M> : DefOf<S> extends {
|
|
420
|
+
type: "intersection";
|
|
421
|
+
left: infer L;
|
|
422
|
+
right: infer R;
|
|
423
|
+
} ? true extends HoldsRecord<Nodes<L>> | HoldsRecord<Nodes<R>> ? unknown : Shaped<L, N, D, M> & Shaped<R, N, D, M> : DefOf<S> extends {
|
|
424
|
+
type: Structural;
|
|
425
|
+
} ? Walked<S, N, D> : [KitCodec<S>] extends [never] ? MaskOut<Out<S>, M> : Shaped<KitCodec<S>, N, D, M> : never;
|
|
426
|
+
/**
|
|
427
|
+
* Whether a record is among `N`, the nodes on one side of an intersection. A record's key schema renames the other
|
|
428
|
+
* side's keys at runtime, a masked key taking a placeholder name, so neither side's own keys describe the copy: the
|
|
429
|
+
* intersection is typed `unknown` rather than a narrower type that could be wrong. Distributes.
|
|
430
|
+
*/
|
|
431
|
+
type HoldsRecord<N> = N extends unknown ? (DefOf<N> extends {
|
|
432
|
+
type: "record";
|
|
433
|
+
} ? true : false) : never;
|
|
434
|
+
/** A structural node, mapped by every node's schemas at the position. */
|
|
435
|
+
type Walked<S, N, D extends Depth, E extends Depth = Deeper<D>> = DefOf<S> extends {
|
|
436
|
+
type: "object";
|
|
437
|
+
shape: infer Shape;
|
|
438
|
+
} ? WithNamed<{
|
|
439
|
+
[K in keyof Out<S> as KeyName<K, N>]: K extends keyof Shape ? At<Shape[K], Fields<N, K>, E> : At<OpenCatchall<S>, Catchalls<N>, E> | NamedAt<OpenCatchall<S>, N, Exclude<NamedKeys<N>, keyof Shape>, E>;
|
|
440
|
+
}, [
|
|
441
|
+
OpenCatchall<S>
|
|
442
|
+
] extends [never] ? never : OpenCatchall<S>, N, Exclude<NamedKeys<N>, keyof Shape>, E> : DefOf<S> extends {
|
|
443
|
+
type: "record";
|
|
444
|
+
valueType: infer V;
|
|
445
|
+
} ? string extends keyof Out<S> ? WithNamed<{
|
|
446
|
+
[K in keyof Out<S> as KeyName<K, N>]: At<V, Fields<N, K>, E> | NamedAt<V, N, NamedKeys<N>, E>;
|
|
447
|
+
}, V, N, NamedKeys<N>, E> : MasksStringKeys<N> extends true ? {
|
|
448
|
+
[K in KeyName<keyof Out<S>, N>]: At<V, Fields<N, K extends symbol ? K : Exclude<keyof Out<S>, symbol>>, E>;
|
|
449
|
+
} : {
|
|
450
|
+
[K in keyof Out<S> as KeyName<K, N>]: At<V, Fields<N, K>, E>;
|
|
451
|
+
} : DefOf<S> extends {
|
|
452
|
+
type: "array";
|
|
453
|
+
element: infer El;
|
|
454
|
+
} ? Beyond<El, N, [], E> : DefOf<S> extends {
|
|
455
|
+
type: "tuple";
|
|
456
|
+
items: infer Items extends readonly z.core.SomeType[];
|
|
457
|
+
rest: infer R extends z.core.SomeType | null;
|
|
458
|
+
} ? z.output<z.ZodTuple<Items, null>> extends infer O extends readonly unknown[] ? [
|
|
459
|
+
...{
|
|
460
|
+
-readonly [K in keyof O]: K extends keyof Items ? At<Items[K], Elements<N, K>, E> : never;
|
|
461
|
+
},
|
|
462
|
+
...(R extends z.core.SomeType ? Beyond<R, N, [...Items], E> : [])
|
|
463
|
+
] : never : DefOf<S> extends {
|
|
464
|
+
type: "map";
|
|
465
|
+
keyType: infer K;
|
|
466
|
+
valueType: infer V;
|
|
467
|
+
} ? Map<At<K, MapKeys<N>, E>, At<V, MapValues<N>, E>> : DefOf<S> extends {
|
|
468
|
+
type: "set";
|
|
469
|
+
valueType: infer V;
|
|
470
|
+
} ? Set<At<V, SetElements<N>, E>> : never;
|
|
471
|
+
/**
|
|
472
|
+
* The keys the objects at a position name. A record or an open object beside them takes each one where the value has
|
|
473
|
+
* it, at the position every schema there gives that key: `{ a: pii(…) }` beside a record masks the record's `a`.
|
|
474
|
+
*/
|
|
475
|
+
type NamedKeys<N> = N extends unknown ? DefOf<N> extends {
|
|
476
|
+
type: "object";
|
|
477
|
+
shape: infer Shape;
|
|
478
|
+
} ? Extract<keyof Shape, string> : never : never;
|
|
479
|
+
/** What a key in `Keys` holds, against every schema there, for a value parsed by `V`. Distributes over the keys. */
|
|
480
|
+
type NamedAt<V, N, Keys, D extends Depth> = Keys extends unknown ? At<V, Fields<N, Keys>, D> : never;
|
|
481
|
+
/** `Mapped`, with each key in `Keys` an optional field of its own where `V` lets a key no shape names through. */
|
|
482
|
+
type WithNamed<Mapped, V, N, Keys extends PropertyKey, D extends Depth> = [V] extends [never] ? Mapped : [Keys] extends [never] ? Mapped : Mapped & {
|
|
483
|
+
[K in Keys as KeyName<K, N>]?: At<V, Fields<N, K>, D>;
|
|
484
|
+
};
|
|
485
|
+
/**
|
|
486
|
+
* An array's element, or a tuple's rest, from index `I["length"]` on: optional and one by one while a tuple beside it
|
|
487
|
+
* names the index, so each takes the items there, then any number past every tuple's items.
|
|
488
|
+
*/
|
|
489
|
+
type Beyond<E, N, I extends unknown[], D extends Depth> = true extends NamesIndex<N, `${I["length"]}`> ? [At<E, Elements<N, `${I["length"]}`>, D>?, ...Beyond<E, N, [...I, unknown], D>] : At<E, Past<N>, D>[];
|
|
490
|
+
/** Whether a tuple at the position names index `K`. */
|
|
491
|
+
type NamesIndex<N, K extends string> = N extends unknown ? DefOf<N> extends {
|
|
492
|
+
type: "tuple";
|
|
493
|
+
items: infer Items extends readonly unknown[];
|
|
494
|
+
} ? K extends keyof Items ? true : false : false : never;
|
|
495
|
+
/** The schemas at an index past every tuple's items: each array's element and each tuple's rest. */
|
|
496
|
+
type Past<N> = N extends unknown ? DefOf<N> extends {
|
|
497
|
+
type: "array";
|
|
498
|
+
element: infer E;
|
|
499
|
+
} ? E : DefOf<N> extends {
|
|
500
|
+
type: "tuple";
|
|
501
|
+
rest: infer R;
|
|
502
|
+
} ? Exclude<R, null> : never : never;
|
|
503
|
+
/** The schemas at object key `K`: each object's field there or its catchall, and each record's value. */
|
|
504
|
+
type Fields<N, K> = N extends unknown ? DefOf<N> extends {
|
|
505
|
+
type: "object";
|
|
506
|
+
shape: infer Shape;
|
|
507
|
+
} ? K extends keyof Shape ? Shape[K] : OpenCatchall<N> : DefOf<N> extends {
|
|
508
|
+
type: "record";
|
|
509
|
+
valueType: infer V;
|
|
510
|
+
} ? V : never : never;
|
|
511
|
+
/**
|
|
512
|
+
* An object's catchall when it lets an extra key through, or `never`. Zod's object type keeps the catchall only in
|
|
513
|
+
* its config, `$catchall<T>`, and TypeScript reads `T` back out of that alias. A loose object's config is `$loose`,
|
|
514
|
+
* which names no schema, so its catchall is `z.unknown()`, as Zod parses it: read out of `$loose`, `T` would be a
|
|
515
|
+
* schema of no kind, which the search beneath it reads as one that may be marked.
|
|
516
|
+
*/
|
|
517
|
+
type OpenCatchall<N> = N extends {
|
|
518
|
+
readonly _zod: {
|
|
519
|
+
readonly config: infer Config;
|
|
520
|
+
};
|
|
521
|
+
} ? Config extends {
|
|
522
|
+
readonly out: infer O;
|
|
523
|
+
} ? string extends keyof O ? [z.core.$loose] extends [Config] ? z.ZodUnknown : Config extends z.core.$catchall<infer T> ? T : never : never : never : never;
|
|
524
|
+
/** The schemas at a key no object names. */
|
|
525
|
+
type Catchalls<N> = N extends unknown ? DefOf<N> extends {
|
|
526
|
+
type: "object";
|
|
527
|
+
} ? OpenCatchall<N> : DefOf<N> extends {
|
|
528
|
+
type: "record";
|
|
529
|
+
valueType: infer V;
|
|
530
|
+
} ? V : never : never;
|
|
531
|
+
/** The schemas a record's keys are parsed by. */
|
|
532
|
+
type RecordKeys<N> = N extends unknown ? (DefOf<N> extends {
|
|
533
|
+
type: "record";
|
|
534
|
+
keyType: infer K;
|
|
535
|
+
} ? K : never) : never;
|
|
536
|
+
/** The schemas of a map's keys, a map's values and a set's elements. */
|
|
537
|
+
type MapKeys<N> = N extends unknown ? (DefOf<N> extends {
|
|
538
|
+
type: "map";
|
|
539
|
+
keyType: infer K;
|
|
540
|
+
} ? K : never) : never;
|
|
541
|
+
type MapValues<N> = N extends unknown ? (DefOf<N> extends {
|
|
542
|
+
type: "map";
|
|
543
|
+
valueType: infer V;
|
|
544
|
+
} ? V : never) : never;
|
|
545
|
+
type SetElements<N> = N extends unknown ? (DefOf<N> extends {
|
|
546
|
+
type: "set";
|
|
547
|
+
valueType: infer V;
|
|
548
|
+
} ? V : never) : never;
|
|
549
|
+
/** The schemas at element `K`, an index: each array's element, and each tuple's item there or its rest. */
|
|
550
|
+
type Elements<N, K> = N extends unknown ? DefOf<N> extends {
|
|
551
|
+
type: "array";
|
|
552
|
+
element: infer E;
|
|
553
|
+
} ? E : DefOf<N> extends {
|
|
554
|
+
type: "tuple";
|
|
555
|
+
items: infer Items extends readonly unknown[];
|
|
556
|
+
rest: infer R;
|
|
557
|
+
} ? K extends keyof Items ? Items[K] : Exclude<R, null> : never : never;
|
|
558
|
+
export {};
|
|
559
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/privacy/types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClF,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,M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AC,SAAS;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC;AAErH,2GAA2G;AAC3G,KAAK,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,OAAO,GACnC,KAAK,CAAC,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,CAAA;CAAE,GAClD,CAAC,GACD,KAAK,CAAC,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,KAAK,SAAS,SAAS,OAAO,EAAE,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC,CAAA;CAAE,GAC9F,CAAC,SAAS,MAAM,KAAK,GACnB,KAAK,CAAC,CAAC,CAAC,GACR,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,GAClB,KAAK,GACT,KAAK,CAAC"}
|
package/dist/seed/writeD1.d.ts
CHANGED
|
@@ -12,8 +12,14 @@ export interface SeedD1Options {
|
|
|
12
12
|
export interface SeedD1Result {
|
|
13
13
|
/** The table seeded. */
|
|
14
14
|
table: string;
|
|
15
|
-
/** The number of rows
|
|
15
|
+
/** The number of rows the fixture holds, every one validated. */
|
|
16
16
|
rows: number;
|
|
17
|
+
/**
|
|
18
|
+
* The number of rows this call inserted. Under `INSERT OR IGNORE` a row whose key is already there is
|
|
19
|
+
* not, so a re-run writes none, and says so here rather than repeating `rows` (#764). Always `0` under
|
|
20
|
+
* `dryRun`.
|
|
21
|
+
*/
|
|
22
|
+
written: number;
|
|
17
23
|
}
|
|
18
24
|
/**
|
|
19
25
|
* Seed one D1 group, idempotently and non-destructively.
|