pipework 0.157.0 → 0.159.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 +8 -0
- package/REFERENCE.md +3 -1
- package/dist/REFERENCE.md +322 -13
- package/dist/core/config/load.d.ts +1 -0
- package/dist/core/config/load.d.ts.map +1 -1
- package/dist/core/config/load.js +7 -0
- package/dist/core/config/load.js.map +1 -1
- package/dist/core/config/namespace.d.ts +1 -0
- package/dist/core/config/namespace.d.ts.map +1 -1
- package/dist/core/config/schema.d.ts +2 -0
- package/dist/core/config/schema.d.ts.map +1 -1
- package/dist/core/config/schema.js +12 -0
- package/dist/core/config/schema.js.map +1 -1
- package/dist/data/db/pool.d.ts +2 -1
- package/dist/data/db/pool.d.ts.map +1 -1
- package/dist/data/db/pool.js +8 -0
- package/dist/data/db/pool.js.map +1 -1
- package/dist/data/schema/namespace.d.ts +9 -18
- package/dist/data/schema/namespace.d.ts.map +1 -1
- package/dist/data/schema/namespace.js +0 -16
- package/dist/data/schema/namespace.js.map +1 -1
- package/dist/data/schema/types.d.ts +18 -55
- package/dist/data/schema/types.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/infra/email/sigv4.d.ts +0 -24
- package/dist/infra/email/sigv4.d.ts.map +0 -1
- package/dist/infra/email/sigv4.js +0 -55
- package/dist/infra/email/sigv4.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.159.0
|
|
4
|
+
|
|
5
|
+
- **Fixed: type-checking an app costs what it did on 0.148 again** (#690). Since 0.149 the validator types `check.*` return (`StringSchema`, `OptionalSchema`, `ObjectSchema`, …) were interfaces overriding `optional()` / `nullable()` with `this`-typed results, and `ObjectSchema` an intersection; every comparison with `Schema<T>` recursed to TypeScript's depth limit. On verity's backend that was 11.0M instantiations and over 4 GB (plain `tsc` ran out of heap); it is now 2.0M and 1.1 GB, the same as 0.148. The named types are now aliases of zod's classes, and those classes (`ZodString`, `ZodNumber`, `ZodBoolean`, `ZodEnum`, `ZodLiteral`, `ZodArray`, `ZodOptional`, `ZodNullable`, `ZodObject`, `$strip`) are exported type-only from `pipework`, so an app without zod still exports validators unannotated (#673). `.extend` / `.pick` / `.omit` / `.partial` stay typed and recursive getter schemas still infer. Hover shows zod's types again instead of `Pick<…>` / `Omit<…>`. All existing type names still export.
|
|
6
|
+
|
|
7
|
+
## 0.158.0
|
|
8
|
+
|
|
9
|
+
- **Added: session settings that survive connection replacement** (#338). `databases.<name>.pool.settings` (and `tap(url, { settings })`) takes session settings (GUCs) such as `{ statement_timeout: '30s', 'myapp.mode': 'bench' }` and sends them in the startup packet of every pooled connection. postgres.js replaces a connection after its max lifetime (30 to 60 minutes); a session `SET` on the old connection was silently lost on the new one, while startup settings are carried again by every new socket. Values may be strings, numbers or booleans (`on`/`off`). A name that is not letters, digits and underscores with at most one dot is a config error. An unknown non-dotted name makes the connection fail (Postgres's `unrecognized configuration parameter` is the error's `cause`) rather than being ignored.
|
|
10
|
+
|
|
3
11
|
## 0.157.0
|
|
4
12
|
|
|
5
13
|
- **Fixed: `pipework test <path>` that runs nothing exits 1** (#337). When a path or name filter is given and the affected-module scope is empty, nothing ran, and the command used to print `✓ No affected modules — nothing to test` and exit 0, so a reverted file looked green. It now prints `Nothing ran: no affected module in scope (<basis>), so <filters> did not run. Run with --all to test it regardless.` and exits 1. Bare `pipework test` with nothing affected still exits 0. **Behavior change:** a script or hook that passes a path and relied on exit 0 for an unaffected path now fails; add `--all`.
|
package/REFERENCE.md
CHANGED
|
@@ -890,7 +890,9 @@ interface ManagedConnection
|
|
|
890
890
|
|
|
891
891
|
`ManagedConnection.connectionIds()` returns `ReadonlyArray<{ connectionId: number; backendPid: number }>` for every pooled connection (opening up to `max`), ascending by `connectionId`. `connectionId` is the driver ordinal `StatementEvent.connectionId` carries in `observability.onStatement`; `backendPid` is `pg_backend_pid()`, matching `pg_stat_activity`. It holds all `max` connections, runs one `SELECT pg_backend_pid()` on each and releases them; those probes reach `onStatement` like any statement (plus the driver's type lookup on a new connection). Without `observability.onStatement` (or `logAllQueries`), and on `tap()` connections, it throws a `[pipework]` error.
|
|
892
892
|
|
|
893
|
-
**`ConnectOptions`** — Options for `tap()` — pool size (default 1)
|
|
893
|
+
**`ConnectOptions`** — Options for `tap()` — pool size (default 1), idle timeout in seconds, and `settings` (see below).
|
|
894
|
+
|
|
895
|
+
**Session settings (`databases.<name>.pool.settings`, `tap({ settings })`)** — `Record<string, string | number | boolean>`, default none. Each entry is a Postgres session setting (GUC) sent in the connection's startup packet, so every pooled socket carries it from its first packet, including a connection the pool replaced at `max_lifetime` or after a backend was terminated. A session `SET` on a pooled connection does not survive replacement; use `settings` for anything that must hold for the life of the pool. Names are `name` or `prefix.name` (letters, digits, underscores); anything else is a config error. Values are stringified (`true` is `on`, `false` is `off`). A dotted custom name (`myapp.tenant`) is always accepted. An unknown non-dotted name is rejected by Postgres: the connection fails, and the first query on the pool rejects, and the error's `cause` is Postgres's own (`unrecognized configuration parameter "..."`); pipework does not translate it.
|
|
894
896
|
|
|
895
897
|
```typescript
|
|
896
898
|
interface ConnectOptions
|
package/dist/REFERENCE.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Pipework API Reference
|
|
2
2
|
|
|
3
3
|
> Auto-generated from source JSDoc. Do not edit manually.
|
|
4
|
-
> Generated: 2026-10-
|
|
4
|
+
> Generated: 2026-10-22
|
|
5
5
|
|
|
6
6
|
## Contents
|
|
7
7
|
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
- [jobs — Background Jobs](#jobs-background-jobs)
|
|
11
11
|
- [pipeline — Multi-Step Pipelines](#pipeline-multi-step-pipelines)
|
|
12
12
|
- [state — State Machines](#state-state-machines)
|
|
13
|
+
- [steps](#steps)
|
|
13
14
|
- [auth — Authentication](#auth-authentication)
|
|
14
15
|
- [rbac — Access Control](#rbac-access-control)
|
|
15
16
|
- [tenant — Multi-Tenancy](#tenant-multi-tenancy)
|
|
@@ -30,7 +31,9 @@
|
|
|
30
31
|
- [cache — Caching](#cache-caching)
|
|
31
32
|
- [credits](#credits)
|
|
32
33
|
- [mail](#mail)
|
|
34
|
+
- [untrustedFetch](#untrustedfetch)
|
|
33
35
|
- [storage](#storage)
|
|
36
|
+
- [support](#support)
|
|
34
37
|
- [webhook — Inbound & Outbound Webhooks](#webhook-inbound-outbound-webhooks)
|
|
35
38
|
- [behavior — Resource Decorators](#behavior-resource-decorators)
|
|
36
39
|
- [fitting — Dependency Injection](#fitting-dependency-injection)
|
|
@@ -85,6 +88,18 @@ function createManifold<const TEnv extends EnvDefs = EnvDefs>( raw: Omit<Bluepri
|
|
|
85
88
|
interface Manifold<TEnv extends EnvDefs = EnvDefs>
|
|
86
89
|
```
|
|
87
90
|
|
|
91
|
+
**`ScriptOptions`** — Options for {@link Manifold.script}.
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
interface ScriptOptions
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**`StartOptions`** — Options for {@link Manifold.start}.
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
interface StartOptions
|
|
101
|
+
```
|
|
102
|
+
|
|
88
103
|
**`SeedOptions`** — ALS context the {@link Manifold.seed} callback runs under — tenant scope, auth principal, and job type.
|
|
89
104
|
|
|
90
105
|
```typescript
|
|
@@ -229,6 +244,14 @@ Creates a job queue with claim/complete/fail lifecycle, heartbeat, and dead lett
|
|
|
229
244
|
|
|
230
245
|
Executes a fitting handler as a background job with its own Flow context.
|
|
231
246
|
|
|
247
|
+
### `jobs.later`
|
|
248
|
+
|
|
249
|
+
The error to throw to end an attempt as "later": pending again after `delayMs`, no attempt counted.
|
|
250
|
+
|
|
251
|
+
### `jobs.permanent`
|
|
252
|
+
|
|
253
|
+
The error to throw to dead-letter the job now, whatever attempts remain.
|
|
254
|
+
|
|
232
255
|
### `jobs.parseCron`
|
|
233
256
|
|
|
234
257
|
Parses a 5-field cron expression into a CronSchedule (minute, hour, dom, month, dow).
|
|
@@ -269,6 +292,14 @@ Thrown when a transition is not allowed from the current state.
|
|
|
269
292
|
|
|
270
293
|
Thrown when the state machine definition is internally inconsistent.
|
|
271
294
|
|
|
295
|
+
## steps
|
|
296
|
+
|
|
297
|
+
Step graphs over a job queue: results recorded by their inputs, only missing steps run.
|
|
298
|
+
|
|
299
|
+
### `steps.define`
|
|
300
|
+
|
|
301
|
+
Defines a graph of named steps over a jobs Queue. Pass it to `createWorkerSurface({ graphs })` to run its steps.
|
|
302
|
+
|
|
272
303
|
## auth — Authentication
|
|
273
304
|
|
|
274
305
|
Authentication namespace — session management, multi-org support, auth chain resolution.
|
|
@@ -289,6 +320,10 @@ Hashes and verifies passwords with scrypt; reports when a stored hash needs reha
|
|
|
289
320
|
|
|
290
321
|
Guarded password sign-in that slows, then refuses, repeated failures per account and per client.
|
|
291
322
|
|
|
323
|
+
### `auth.emailLinks`
|
|
324
|
+
|
|
325
|
+
Emailed single-use links that prove control of an address: password reset and address verification; the token is never stored.
|
|
326
|
+
|
|
292
327
|
### `auth.runChain`
|
|
293
328
|
|
|
294
329
|
Executes an auth chain (strategy pipeline) to resolve auth + tenant from a request.
|
|
@@ -323,7 +358,7 @@ interface AuthContext
|
|
|
323
358
|
interface AuthStrategy<TAuth>
|
|
324
359
|
```
|
|
325
360
|
|
|
326
|
-
**`AuthRequest`** — Normalized request shape passed to auth strategies — headers,
|
|
361
|
+
**`AuthRequest`** — Normalized request shape passed to auth strategies — headers, the parsed `Cookie` header, and the upper-case HTTP method.
|
|
327
362
|
|
|
328
363
|
```typescript
|
|
329
364
|
interface AuthRequest
|
|
@@ -353,6 +388,18 @@ interface TenantResolver<TAuth>
|
|
|
353
388
|
interface AuthChainConfig<TAuth>
|
|
354
389
|
```
|
|
355
390
|
|
|
391
|
+
**`SessionAuth`** — What `sessions.strategy()` authenticates: the token's user and org, its roles, and where the token came from.
|
|
392
|
+
|
|
393
|
+
```typescript
|
|
394
|
+
type SessionAuth = BaseAuth &
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
**`SessionStrategyOptions`** — Options for `sessions.strategy()`.
|
|
398
|
+
|
|
399
|
+
```typescript
|
|
400
|
+
interface SessionStrategyOptions
|
|
401
|
+
```
|
|
402
|
+
|
|
356
403
|
**`SessionConfig`** — Session configuration — signing keys, issuer, audience, token TTLs, refresh rotation.
|
|
357
404
|
|
|
358
405
|
```typescript
|
|
@@ -624,6 +671,10 @@ Base error class with code, statusCode, and suggestion fields.
|
|
|
624
671
|
|
|
625
672
|
403 — authenticated but insufficient permissions.
|
|
626
673
|
|
|
674
|
+
### `errors.CrossSiteRequest`
|
|
675
|
+
|
|
676
|
+
403 `CROSS_SITE_REQUEST` — a cookie-authenticated write that did not come from the app's own site.
|
|
677
|
+
|
|
627
678
|
### `errors.Validation`
|
|
628
679
|
|
|
629
680
|
422 — input validation failed, carries field-level details.
|
|
@@ -644,13 +695,17 @@ Base error class with code, statusCode, and suggestion fields.
|
|
|
644
695
|
|
|
645
696
|
415 — request body media type not accepted by the route.
|
|
646
697
|
|
|
698
|
+
### `errors.MalformedMultipart`
|
|
699
|
+
|
|
700
|
+
400 `MALFORMED_MULTIPART` — a multipart body that cannot be parsed or ends before its closing boundary.
|
|
701
|
+
|
|
647
702
|
## lifecycle — Startup & Shutdown
|
|
648
703
|
|
|
649
704
|
Application lifecycle namespace — startup orchestration with hooks and timeouts.
|
|
650
705
|
|
|
651
706
|
### `lifecycle.orchestrate`
|
|
652
707
|
|
|
653
|
-
Runs pre-start hooks (DB readiness checks, migrations, etc.) with a configurable timeout.
|
|
708
|
+
Runs pre-start hooks (DB readiness checks, migrations, etc.) with a configurable timeout. The hooks run in one trace that names the process; the trace-partition hook runs first, outside it.
|
|
654
709
|
|
|
655
710
|
## log — Structured Logging
|
|
656
711
|
|
|
@@ -690,7 +745,7 @@ Creates a worker surface — a long-running process that claims and executes job
|
|
|
690
745
|
|
|
691
746
|
### `surface.script`
|
|
692
747
|
|
|
693
|
-
Creates a script surface — a one-shot process that runs and exits (migrations, seeds, CLI tools).
|
|
748
|
+
Creates a script surface — a one-shot process that runs and exits (migrations, seeds, CLI tools). The run is traced as a job-kind trace that names the surface.
|
|
694
749
|
|
|
695
750
|
## pipe — Database
|
|
696
751
|
|
|
@@ -761,6 +816,10 @@ Acquires a transaction-scoped advisory lock. Released at commit/rollback.
|
|
|
761
816
|
|
|
762
817
|
Runs a function in a SERIALIZABLE transaction with automatic retry on serialization failures and deadlocks.
|
|
763
818
|
|
|
819
|
+
### `pipe.withTimeouts`
|
|
820
|
+
|
|
821
|
+
Sets statement_timeout and/or lock_timeout for the current transaction in one statement, then runs fn; a statement cancelled for them rejects with StatementTimeoutError or LockTimeoutError.
|
|
822
|
+
|
|
764
823
|
### `pipe.bulkSet`
|
|
765
824
|
|
|
766
825
|
Bulk UPDATE ... FROM (VALUES ...) — updates multiple rows with per-row values in a single statement.
|
|
@@ -769,6 +828,10 @@ Bulk UPDATE ... FROM (VALUES ...) — updates multiple rows with per-row values
|
|
|
769
828
|
|
|
770
829
|
Produces a typed VALUES clause for bulk operations — the base primitive for bulkSet and bulkUpsert.
|
|
771
830
|
|
|
831
|
+
### `pipe.fn`
|
|
832
|
+
|
|
833
|
+
A set-returning SQL function as a typed source for `.from()` and joins — `pipe.fn('schema.f', { args: [field.uuid()], columns: { path: field.text() } })`. Arguments are bound and cast to their declared types.
|
|
834
|
+
|
|
772
835
|
### `pipe.field`
|
|
773
836
|
|
|
774
837
|
Field builders for domain definitions — uuid(), text(), integer(), etc.
|
|
@@ -781,13 +844,17 @@ Registers a domain definition with table, validators, and factory projections. T
|
|
|
781
844
|
|
|
782
845
|
Returns the global registry of all domain definitions.
|
|
783
846
|
|
|
847
|
+
### `pipe.external`
|
|
848
|
+
|
|
849
|
+
Declares a table or view another service owns (`pipe.external(name, fields, { schema, table? })`): typed columns and every query operator, read-only, never migrated, not tenant-scoped.
|
|
850
|
+
|
|
784
851
|
### `pipe.update`
|
|
785
852
|
|
|
786
853
|
Pipework-owned UPDATE builder — the only consumer-facing way to update pipework-managed tables (Q8).
|
|
787
854
|
|
|
788
855
|
### `pipe.insert`
|
|
789
856
|
|
|
790
|
-
Pipework-owned INSERT builder — the only consumer-facing way to insert into pipework-managed tables (Q8).
|
|
857
|
+
Pipework-owned INSERT builder — the only consumer-facing way to insert into pipework-managed tables (Q8). A list of any size is split into statements under Postgres's parameter limit, in one transaction.
|
|
791
858
|
|
|
792
859
|
### `pipe.delete`
|
|
793
860
|
|
|
@@ -795,7 +862,7 @@ Pipework-owned DELETE builder — the only consumer-facing way to delete from pi
|
|
|
795
862
|
|
|
796
863
|
### `pipe.upsert`
|
|
797
864
|
|
|
798
|
-
Pipework-owned UPSERT builder — insert with conflict resolution (Q8).
|
|
865
|
+
Pipework-owned UPSERT builder — insert with conflict resolution (Q8). A list of any size is split into statements under Postgres's parameter limit, in one transaction; rows repeating a conflict key across statements do not fail as one statement would.
|
|
799
866
|
|
|
800
867
|
### Types
|
|
801
868
|
|
|
@@ -811,12 +878,54 @@ interface WindowSpec
|
|
|
811
878
|
interface ValueColumnDef
|
|
812
879
|
```
|
|
813
880
|
|
|
881
|
+
**`JsonbElements`** — A jsonb array read as its elements' text. Produced by {@link jsonbElements}.
|
|
882
|
+
|
|
883
|
+
```typescript
|
|
884
|
+
interface JsonbElements
|
|
885
|
+
```
|
|
886
|
+
|
|
887
|
+
**`ArraySource`** — Something whose elements `arrayAny` / `arrayAll` can test.
|
|
888
|
+
|
|
889
|
+
```typescript
|
|
890
|
+
type ArraySource =
|
|
891
|
+
```
|
|
892
|
+
|
|
893
|
+
**`ElementOf`** — The element type of an {@link ArraySource}.
|
|
894
|
+
|
|
895
|
+
```typescript
|
|
896
|
+
type ElementOf<S> =
|
|
897
|
+
```
|
|
898
|
+
|
|
899
|
+
**`FunctionSpec`** — Declares a SQL function's argument and result-column shapes. See {@link fn}.
|
|
900
|
+
|
|
901
|
+
```typescript
|
|
902
|
+
interface FunctionSpec<TArgs extends readonly AnyField[], TColumns extends Record<string, AnyField>>
|
|
903
|
+
```
|
|
904
|
+
|
|
905
|
+
**`FunctionSourceFields`** — The selected fields of a function source: each result column as a typed SQL expression.
|
|
906
|
+
|
|
907
|
+
```typescript
|
|
908
|
+
type FunctionSourceFields<TColumns extends Record<string, AnyField>> =
|
|
909
|
+
```
|
|
910
|
+
|
|
911
|
+
**`FunctionSource`** — A function call usable in `.from()` and joins; its result columns are properties of it.
|
|
912
|
+
|
|
913
|
+
```typescript
|
|
914
|
+
type FunctionSource<TAlias extends string, TColumns extends Record<string, AnyField>> =
|
|
915
|
+
```
|
|
916
|
+
|
|
814
917
|
**`SerializableOptions`** — Retry policy for {@link serializable}: how many attempts on a serialization failure / deadlock, and the base backoff between them.
|
|
815
918
|
|
|
816
919
|
```typescript
|
|
817
920
|
interface SerializableOptions
|
|
818
921
|
```
|
|
819
922
|
|
|
923
|
+
**`TimeoutOptions`** — Which timeouts {@link withTimeouts} sets; each a positive integer number of milliseconds.
|
|
924
|
+
|
|
925
|
+
```typescript
|
|
926
|
+
interface TimeoutOptions
|
|
927
|
+
```
|
|
928
|
+
|
|
820
929
|
**`ManagedConnection`** — A standalone pooled connection: the raw postgres.js client, its drizzle handle, and a `close()` that ends the pool.
|
|
821
930
|
|
|
822
931
|
```typescript
|
|
@@ -837,6 +946,10 @@ JSONB query operators — typed helpers for PostgreSQL JSONB containment, key ch
|
|
|
837
946
|
|
|
838
947
|
The @> containment operator — tests whether a JSONB column contains the given value.
|
|
839
948
|
|
|
949
|
+
### `jsonb.merge`
|
|
950
|
+
|
|
951
|
+
Merges an object into a JSONB column in `.set()`: `coalesce(col, '{}') || value`. Top-level keys overwrite; others are kept.
|
|
952
|
+
|
|
840
953
|
### `jsonb.containedBy`
|
|
841
954
|
|
|
842
955
|
The <@ contained-by operator — tests whether a JSONB column is contained by the given value.
|
|
@@ -903,6 +1016,60 @@ type Schema<T = unknown> = z.ZodType<T>
|
|
|
903
1016
|
type Infer<T extends Schema> = z.infer<T>
|
|
904
1017
|
```
|
|
905
1018
|
|
|
1019
|
+
**`StringSchema`** — A string validator — what check.string() returns, nameable without importing zod.
|
|
1020
|
+
|
|
1021
|
+
```typescript
|
|
1022
|
+
interface StringSchema extends z.ZodString
|
|
1023
|
+
```
|
|
1024
|
+
|
|
1025
|
+
**`NumberSchema`** — A number validator — what check.number() returns.
|
|
1026
|
+
|
|
1027
|
+
```typescript
|
|
1028
|
+
interface NumberSchema extends z.ZodNumber
|
|
1029
|
+
```
|
|
1030
|
+
|
|
1031
|
+
**`BooleanSchema`** — A boolean validator — what check.boolean() returns.
|
|
1032
|
+
|
|
1033
|
+
```typescript
|
|
1034
|
+
interface BooleanSchema extends z.ZodBoolean
|
|
1035
|
+
```
|
|
1036
|
+
|
|
1037
|
+
**`EnumSchema`** — An enum validator over string literals — what check.enum([...]) returns.
|
|
1038
|
+
|
|
1039
|
+
```typescript
|
|
1040
|
+
interface EnumSchema<V extends string = string> extends z.ZodEnum<
|
|
1041
|
+
```
|
|
1042
|
+
|
|
1043
|
+
**`LiteralSchema`** — A literal validator — what check.literal(v) returns.
|
|
1044
|
+
|
|
1045
|
+
```typescript
|
|
1046
|
+
interface LiteralSchema<V extends string | number | boolean | null = string> extends z.ZodLiteral<V>
|
|
1047
|
+
```
|
|
1048
|
+
|
|
1049
|
+
**`ArraySchema`** — An array validator — what check.array(item) returns.
|
|
1050
|
+
|
|
1051
|
+
```typescript
|
|
1052
|
+
interface ArraySchema<Item extends z.core.SomeType = z.core.SomeType> extends z.ZodArray<Item>
|
|
1053
|
+
```
|
|
1054
|
+
|
|
1055
|
+
**`OptionalSchema`** — An optional validator — what check.optional(inner) returns.
|
|
1056
|
+
|
|
1057
|
+
```typescript
|
|
1058
|
+
interface OptionalSchema<Inner extends z.core.SomeType = z.core.SomeType> extends z.ZodOptional<Inner>
|
|
1059
|
+
```
|
|
1060
|
+
|
|
1061
|
+
**`NullableSchema`** — A nullable validator — what check.nullable(inner) returns.
|
|
1062
|
+
|
|
1063
|
+
```typescript
|
|
1064
|
+
interface NullableSchema<Inner extends z.core.SomeType = z.core.SomeType> extends z.ZodNullable<Inner>
|
|
1065
|
+
```
|
|
1066
|
+
|
|
1067
|
+
**`ObjectSchema`** — An object validator whose .extend, .pick, .omit and .partial results stay ObjectSchema — what check.object({...}) returns.
|
|
1068
|
+
|
|
1069
|
+
```typescript
|
|
1070
|
+
type ObjectSchema<S extends Shape = Shape> =
|
|
1071
|
+
```
|
|
1072
|
+
|
|
906
1073
|
## temporal — Bitemporal Data
|
|
907
1074
|
|
|
908
1075
|
Temporal (bitemporal) data namespace — version history with effective date ranges.
|
|
@@ -947,6 +1114,14 @@ Query all versions of temporal records (no date filter).
|
|
|
947
1114
|
|
|
948
1115
|
Close the current version and create a new one with updated data.
|
|
949
1116
|
|
|
1117
|
+
### `temporal.setVersion`
|
|
1118
|
+
|
|
1119
|
+
Append the next version of an append-only-versions definition: serialised per scope, numbered, never back-dated, audited.
|
|
1120
|
+
|
|
1121
|
+
### `temporal.versionAt`
|
|
1122
|
+
|
|
1123
|
+
The version in force at a moment: the row with the greatest effectiveFrom at or before it.
|
|
1124
|
+
|
|
950
1125
|
## valve
|
|
951
1126
|
|
|
952
1127
|
Valve namespace — typed, directional, gated boundaries between code silos.
|
|
@@ -1129,6 +1304,18 @@ Alerts namespace — raise and resolve keyed conditions, grouped, delivered to s
|
|
|
1129
1304
|
|
|
1130
1305
|
Creates an alerts handle.
|
|
1131
1306
|
|
|
1307
|
+
### `alerts.http`
|
|
1308
|
+
|
|
1309
|
+
Routes for an operations agent: list, get, totals, delivery health, acknowledge, resolve, link; bearer credentials.
|
|
1310
|
+
|
|
1311
|
+
### `alerts.clientFaults`
|
|
1312
|
+
|
|
1313
|
+
One POST route that records failures reported by browser code as a trace step and an alert; answers 204, no session needed. Send with `reportClientFault` from `pipework/client`.
|
|
1314
|
+
|
|
1315
|
+
### `alerts.requestFaults`
|
|
1316
|
+
|
|
1317
|
+
An `onInternalError` hook for the HTTP server: raises `request-fault:<METHOD> <route>` for each internal 500.
|
|
1318
|
+
|
|
1132
1319
|
### `alerts.webhook`
|
|
1133
1320
|
|
|
1134
1321
|
A sink that POSTs the alert as signed JSON to a URL.
|
|
@@ -1161,6 +1348,10 @@ The newest record's `{ seq, hash }` in the tenant's audit hash chain (blueprint
|
|
|
1161
1348
|
|
|
1162
1349
|
Walks the tenant's audit hash chain and reports the first break (hash-mismatch, prev-mismatch, missing, head-mismatch, anchor-mismatch), or `{ ok: true }`.
|
|
1163
1350
|
|
|
1351
|
+
### `audit.removeTenant`
|
|
1352
|
+
|
|
1353
|
+
Deletes every audit record of one tenant and its hash chain, for the closure of that tenant's account. Irreversible; returns the number of records removed. Other tenants' records and chains are untouched.
|
|
1354
|
+
|
|
1164
1355
|
## cache — Caching
|
|
1165
1356
|
|
|
1166
1357
|
In-memory caching namespace — TTL-based with stats, preload, and tenant-aware variants.
|
|
@@ -1213,6 +1404,36 @@ Inbound source: SES receipt rule storing raw messages in S3 and notifying a sign
|
|
|
1213
1404
|
|
|
1214
1405
|
Inbound development source: `.eml` files dropped in a folder, received by `scan()`; refused in production.
|
|
1215
1406
|
|
|
1407
|
+
## untrustedFetch
|
|
1408
|
+
|
|
1409
|
+
Untrusted fetch — fetch one URL a stranger gave without letting them reach the app's private network.
|
|
1410
|
+
|
|
1411
|
+
### `untrustedFetch.get`
|
|
1412
|
+
|
|
1413
|
+
Fetches `url` with GET and returns `{ ok: true, url, status, contentType, body, bytes }`, or `{ ok: false, reason, message }`
|
|
1414
|
+
naming the rule that refused: `scheme`, `address`, `redirects`, `too_large`, `timeout`, `status`, `rejected` or `network`.
|
|
1415
|
+
It does not throw for these.
|
|
1416
|
+
|
|
1417
|
+
Rules, none of which can be switched off: only `http:` and `https:`; the name is resolved and every address is checked
|
|
1418
|
+
(loopback, private, link-local including cloud metadata, CGNAT, unique-local and site-local IPv6, multicast, reserved,
|
|
1419
|
+
unspecified, and IPv4-mapped or NAT64 forms of these; literal IP URLs likewise) and the connection goes to a checked
|
|
1420
|
+
address; redirects are followed up to `maxRedirects` and each hop is checked as the first, and the app's `headers` go only to the first origin;
|
|
1421
|
+
the body is stopped the moment it passes `maxBytes`, whatever Content-Length says; `timeoutMs` covers the whole fetch.
|
|
1422
|
+
`accept({ status, contentType, firstBytes })` sees the first 1024 bytes before the body is kept: return false, or a string
|
|
1423
|
+
(your own message), to refuse with `rejected`. Messages never contain an address or anything a server sent.
|
|
1424
|
+
|
|
1425
|
+
`resolve` and `connect` are for tests: `resolve(hostname)` replaces DNS and `connect(target)` replaces the socket after the
|
|
1426
|
+
address check passed, so a test sends a fake public address to a local server. The address check always runs on what `resolve` returns.
|
|
1427
|
+
|
|
1428
|
+
The call is the trace step `pipework/fetch:get`; its child `pipework/fetch:outcome` carries host, status, bytes and reason.
|
|
1429
|
+
The full URL is recorded only when `urlIsSafeToTrace` is true; otherwise only the host.
|
|
1430
|
+
|
|
1431
|
+
```ts
|
|
1432
|
+
const got = await untrustedFetch.get(pasted, { maxBytes: 5_000_000, timeoutMs: 10_000, maxRedirects: 3,
|
|
1433
|
+
accept: h => h.firstBytes[0] === 0x25 || 'That does not look like a PDF.' })
|
|
1434
|
+
if (!got.ok) return tell(got.message)
|
|
1435
|
+
```
|
|
1436
|
+
|
|
1216
1437
|
## storage
|
|
1217
1438
|
|
|
1218
1439
|
Storage namespace — tenant-scoped, content-addressed file storage with signed URLs and retention.
|
|
@@ -1229,6 +1450,18 @@ S3-compatible backend (AWS S3, MinIO, R2): SigV4 over `fetch`, multipart streami
|
|
|
1229
1450
|
|
|
1230
1451
|
Local-disk backend for development and tests; refused in production.
|
|
1231
1452
|
|
|
1453
|
+
## support
|
|
1454
|
+
|
|
1455
|
+
Support namespace — tickets from email (and later chat), with replies sent only after an approval.
|
|
1456
|
+
|
|
1457
|
+
### `support.create`
|
|
1458
|
+
|
|
1459
|
+
Creates the support handle: tickets, messages, notes, links, drafts, `approve`, `receiveEmail`, and the events job.
|
|
1460
|
+
|
|
1461
|
+
### `support.templates`
|
|
1462
|
+
|
|
1463
|
+
The reply template to spread into `mail.create({ templates })`; it renders the approved draft verbatim.
|
|
1464
|
+
|
|
1232
1465
|
## webhook — Inbound & Outbound Webhooks
|
|
1233
1466
|
|
|
1234
1467
|
Webhook namespace — inbound verification, outbound delivery with retries, HMAC signing.
|
|
@@ -1319,6 +1552,10 @@ Returns the current Flow or undefined — use for optional context detection.
|
|
|
1319
1552
|
|
|
1320
1553
|
Creates a Flow for test isolation with optional auth and tenant overrides.
|
|
1321
1554
|
|
|
1555
|
+
### `flow.actAs`
|
|
1556
|
+
|
|
1557
|
+
Runs `fn` as a tenant and user chosen inside a tenantless Flow (sign-up, a public sign-in): RLS, audit and trace under that tenant, on the request's transaction.
|
|
1558
|
+
|
|
1322
1559
|
## http — Server
|
|
1323
1560
|
|
|
1324
1561
|
HTTP namespace: `http.file()` builds a file response; the server itself is managed by manifold.start().
|
|
@@ -1343,6 +1580,40 @@ interface SecurityConfig
|
|
|
1343
1580
|
interface RateLimitConfig
|
|
1344
1581
|
```
|
|
1345
1582
|
|
|
1583
|
+
**`RateLimitWindow`** — One fixed window: at most `max` requests per `windowSeconds`.
|
|
1584
|
+
|
|
1585
|
+
```typescript
|
|
1586
|
+
interface RateLimitWindow
|
|
1587
|
+
```
|
|
1588
|
+
|
|
1589
|
+
**`RateLimitClass`**
|
|
1590
|
+
|
|
1591
|
+
A named limit class: any of a per-user, per-tenant, per-address and total window, each counted on its own.
|
|
1592
|
+
Each key takes one window or an array of windows (distinct `windowSeconds`); a request is counted against
|
|
1593
|
+
all of a key's windows and refused if any is over.
|
|
1594
|
+
|
|
1595
|
+
```typescript
|
|
1596
|
+
interface RateLimitClass
|
|
1597
|
+
```
|
|
1598
|
+
|
|
1599
|
+
**`RateLimitRefusal`** — What `onRefused` is told about one refused window of one request.
|
|
1600
|
+
|
|
1601
|
+
```typescript
|
|
1602
|
+
interface RateLimitRefusal
|
|
1603
|
+
```
|
|
1604
|
+
|
|
1605
|
+
**`RateLimitClassesConfig`**
|
|
1606
|
+
|
|
1607
|
+
Named limit classes, checked after auth and counted in Postgres (`pipework_rate_limit_counts`, opted in
|
|
1608
|
+
with the blueprint's `rateLimits: {}`), so every server process on the same database shares one count.
|
|
1609
|
+
Keys are counted perUser, perTenant, perAddress, total in turn, up to the first key with a window over its max, so one user's
|
|
1610
|
+
refused requests don't spend the tenant's budget. The 429's Retry-After is the longest wait of the windows that refused. A route is in `signedIn` (auth required, or optional with
|
|
1611
|
+
a user), `public` (no auth, or optional without a user) or the class its fitting names with `.rateLimit(name)`.
|
|
1612
|
+
|
|
1613
|
+
```typescript
|
|
1614
|
+
interface RateLimitClassesConfig
|
|
1615
|
+
```
|
|
1616
|
+
|
|
1346
1617
|
**`InjectOptions`** — Options for server.inject() — method, url, headers, payload for testing without HTTP.
|
|
1347
1618
|
|
|
1348
1619
|
```typescript
|
|
@@ -1361,6 +1632,12 @@ interface InjectResponse
|
|
|
1361
1632
|
interface ServerConfig
|
|
1362
1633
|
```
|
|
1363
1634
|
|
|
1635
|
+
**`InternalErrorFault`** — What `onInternalError` is told about one request that ended in an internal error.
|
|
1636
|
+
|
|
1637
|
+
```typescript
|
|
1638
|
+
interface InternalErrorFault
|
|
1639
|
+
```
|
|
1640
|
+
|
|
1364
1641
|
**`HandlerResponse`** — Standard handler response shape — statusCode, headers, body.
|
|
1365
1642
|
|
|
1366
1643
|
```typescript
|
|
@@ -1419,7 +1696,7 @@ Generates an OpenAPI 3.1 document from route registrations — schemas derived f
|
|
|
1419
1696
|
|
|
1420
1697
|
## trace
|
|
1421
1698
|
|
|
1422
|
-
Trace namespace — hand the current trace to a process outside Node
|
|
1699
|
+
Trace namespace — hand the current trace to a process outside Node, record the steps it reports back, mark point events, and read a trace tree.
|
|
1423
1700
|
|
|
1424
1701
|
### `trace.traceparent`
|
|
1425
1702
|
|
|
@@ -1433,6 +1710,15 @@ W3C `traceparent` for the current trace and open step; `null` outside a traced f
|
|
|
1433
1710
|
|
|
1434
1711
|
Records steps reported as JSON lines (or objects) by an outside process under the step open now. Synchronous; never throws.
|
|
1435
1712
|
|
|
1713
|
+
### `trace.event`
|
|
1714
|
+
|
|
1715
|
+
Records one zero-length step `external:<name>` under the step open now, with an optional `capture` and `error`. A no-op outside a traced flow; never throws.
|
|
1716
|
+
|
|
1717
|
+
### `trace.tree`
|
|
1718
|
+
|
|
1719
|
+
Reads every hot trace sharing `rootId` (a request's trace and the jobs it queued) with their steps. Runs on the
|
|
1720
|
+
given `db`, so tenant policies apply: only an unrestricted connection (table owner, tests) sees every tenant's rows.
|
|
1721
|
+
|
|
1436
1722
|
### Types
|
|
1437
1723
|
|
|
1438
1724
|
**`FlowStepMeta`** — Trace metadata for one documented flow-step: its `path:symbol` graph node id and the per-argument capture projections.
|
|
@@ -1453,17 +1739,40 @@ type ExternalStepReport = z.infer<typeof externalStepReportSchema>
|
|
|
1453
1739
|
interface ExternalRecordResult
|
|
1454
1740
|
```
|
|
1455
1741
|
|
|
1742
|
+
**`TraceStepNode`** — One step of a trace. `ref` is the flow step's `path:symbol`, or `external:<name>` for a recorded or point-event step.
|
|
1743
|
+
|
|
1744
|
+
```typescript
|
|
1745
|
+
interface TraceStepNode
|
|
1746
|
+
```
|
|
1747
|
+
|
|
1748
|
+
**`TraceNode`** — One trace of the tree, with its steps ordered by `seq`.
|
|
1749
|
+
|
|
1750
|
+
```typescript
|
|
1751
|
+
interface TraceNode
|
|
1752
|
+
```
|
|
1753
|
+
|
|
1754
|
+
**`TraceTree`** — The traces that share a root id, ordered by when they opened.
|
|
1755
|
+
|
|
1756
|
+
```typescript
|
|
1757
|
+
interface TraceTree
|
|
1758
|
+
```
|
|
1759
|
+
|
|
1456
1760
|
## data
|
|
1457
1761
|
|
|
1458
|
-
### `
|
|
1762
|
+
### `StatementTimeoutError`
|
|
1763
|
+
|
|
1764
|
+
A statement was cancelled by Postgres for running past the statement timeout a {@link withTimeouts} call set. `cause` is the driver error.
|
|
1765
|
+
|
|
1766
|
+
```typescript
|
|
1767
|
+
class StatementTimeoutError extends Error constructor(readonly statementTimeoutMs: number, cause: unknown)
|
|
1768
|
+
```
|
|
1769
|
+
|
|
1770
|
+
### `LockTimeoutError`
|
|
1459
1771
|
|
|
1460
|
-
|
|
1461
|
-
sanctioned door for contexts where `pipe()` structurally cannot resolve:
|
|
1462
|
-
`worker_threads`, detached monitors, one-off scripts. Callers own the
|
|
1463
|
-
lifecycle: always `await conn.close()`.
|
|
1772
|
+
A statement gave up waiting for a lock past the lock timeout a {@link withTimeouts} call set. `cause` is the driver error.
|
|
1464
1773
|
|
|
1465
1774
|
```typescript
|
|
1466
|
-
|
|
1775
|
+
class LockTimeoutError extends Error constructor(readonly lockTimeoutMs: number, cause: unknown)
|
|
1467
1776
|
```
|
|
1468
1777
|
|
|
1469
1778
|
## request
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../../src/core/config/load.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,SAAS,EAAE,KAAK,WAAW,EAAuB,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAK9H,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAEhE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAA;IAC/B,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAA;IACpC,6EAA6E;IAC7E,QAAQ,CAAC,WAAW,EAAE,iBAAiB,GAAG,SAAS,CAAA;CACpD;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IACjC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAA;IACnC,QAAQ,CAAC,iBAAi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AAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,gHAAgH;IAChH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;IAC9B,qJAAqJ;IACrJ,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,+EAA+E;IAC/E,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAA;IAC9C,mFAAmF;IACnF,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAA;IACvC,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAA;IACtC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;KAAE,CAAA;IACzG,QAAQ,CAAC,GAAG,CAAC,EAAE;QAAE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAA;CACxE;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,cAAc,CAiBvD"}
|
package/dist/core/config/load.js
CHANGED
|
@@ -18,6 +18,12 @@ export function loadConfig(raw) {
|
|
|
18
18
|
?? (config.requireEnvironment === true ? resolveEnvironmentStrict() : resolveEnvironment());
|
|
19
19
|
return buildResolved(config, environment, baseDir);
|
|
20
20
|
}
|
|
21
|
+
function stringifySettings(settings) {
|
|
22
|
+
const out = {};
|
|
23
|
+
for (const [k, v] of Object.entries(settings))
|
|
24
|
+
out[k] = typeof v === 'boolean' ? (v ? 'on' : 'off') : String(v);
|
|
25
|
+
return out;
|
|
26
|
+
}
|
|
21
27
|
function resolveRelease(def, environment) {
|
|
22
28
|
if (def === undefined)
|
|
23
29
|
return null;
|
|
@@ -170,6 +176,7 @@ function resolveDatabase(name, config, url, appUrl, testOwner, baseDir, refuseUr
|
|
|
170
176
|
pool: {
|
|
171
177
|
max: config.pool?.max ?? 10,
|
|
172
178
|
idleTimeout: config.pool?.idleTimeout ?? 30,
|
|
179
|
+
...(config.pool?.settings !== undefined ? { settings: stringifySettings(config.pool.settings) } : {}),
|
|
173
180
|
},
|
|
174
181
|
...(config.rls !== undefined ? { rls: { sessionVar: config.rls.sessionVar, force: config.rls.force } } : {}),
|
|
175
182
|
};
|