pipework 0.118.0 → 0.120.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 +1477 -0
- package/dist/core/surface/http.js +2 -0
- package/dist/core/surface/http.js.map +1 -1
- package/dist/core/surface/types.d.ts +2 -0
- package/dist/core/surface/types.d.ts.map +1 -1
- package/dist/infra/access-links/rate-limit.d.ts +10 -0
- package/dist/infra/access-links/rate-limit.d.ts.map +1 -0
- package/dist/infra/access-links/rate-limit.js +28 -0
- package/dist/infra/access-links/rate-limit.js.map +1 -0
- package/dist/infra/email/sigv4.d.ts +24 -0
- package/dist/infra/email/sigv4.d.ts.map +1 -0
- package/dist/infra/email/sigv4.js +55 -0
- package/dist/infra/email/sigv4.js.map +1 -0
- package/dist/test/savepoints.d.ts +4 -3
- package/dist/test/savepoints.d.ts.map +1 -1
- package/dist/test/savepoints.js +19 -9
- package/dist/test/savepoints.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.120.0
|
|
4
|
+
|
|
5
|
+
- **Added: `surface.http({ onInternalError })`** (#609). An HTTP surface now takes the same `onInternalError` hook as `ServerConfig` (#584), so `alerts.requestFaults(handle)` works for surface-built apps, `pipework serve` included. It runs for each internal 5xx under `surface.start` and `.test()` alike; before, the surface dropped it.
|
|
6
|
+
|
|
7
|
+
## 0.119.0
|
|
8
|
+
|
|
9
|
+
- **Fixed: a test-harness savepoint could reset a tenant it did not set** (#605). On release, a `pipe.transaction` savepoint under the vitest harness put back every setting that differed from its start, including one sent on the shared test connection by another task while it was open. So a `withFlow({ tenant })` that ran while an earlier task held a savepoint lost `pipework.tenant_id` (read as `''`, refusing RLS writes) when that savepoint released. A release now puts back only the settings and role changed by statements sent from inside its own block. Test-only; requests and jobs were not affected.
|
|
10
|
+
|
|
3
11
|
## 0.118.0
|
|
4
12
|
|
|
5
13
|
- **Added: `awsCredentials()`, the default AWS credential provider** (#604). Environment keys (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN`), re-read on every call; else the ECS task role through the container credentials endpoint (`AWS_CONTAINER_CREDENTIALS_RELATIVE_URI`, or `_FULL_URI` with `AWS_CONTAINER_AUTHORIZATION_TOKEN[_FILE]`); else EC2 instance metadata (IMDSv2; `AWS_EC2_METADATA_DISABLED=true` skips it). Endpoint credentials are cached until five minutes before `Expiration`, concurrent calls share one fetch, and a failed refresh keeps serving unexpired credentials. Every fetch has a timeout. Nothing found throws an error listing each source looked at; a configured container endpoint that fails is an error, not a fall-through. Profiles and SSO are not read.
|
package/REFERENCE.md
CHANGED
|
@@ -678,6 +678,8 @@ Surface namespace — declarative entry points that define how the app runs (HTT
|
|
|
678
678
|
|
|
679
679
|
Creates an HTTP surface — a Fastify server with routes, middleware, and production validation. Returns an HttpSurfaceBuilder with a .test() method for inject()-based integration tests.
|
|
680
680
|
|
|
681
|
+
It accepts `onInternalError` (and so `alerts.requestFaults(...)`) as `ServerConfig` does; it runs for each internal 5xx under `.test()` and `start` alike.
|
|
682
|
+
|
|
681
683
|
### `surface.worker`
|
|
682
684
|
|
|
683
685
|
Creates a worker surface — a long-running process that claims and executes jobs from queues.
|
|
@@ -1517,7 +1519,7 @@ Pass in `sources`; each raises with a fixed key on a tick and, where it can tell
|
|
|
1517
1519
|
|
|
1518
1520
|
`table` is the jobs table, default `pipework_jobs`. A custom source is `{ name, evaluate(): Promise<{ key, severity, message, subject? }[]>, owns?(key) }`; with `owns`, an open alert it owns that `evaluate` no longer returns is resolved.
|
|
1519
1521
|
|
|
1520
|
-
`alerts.requestFaults(handle, { owner?, runbook?, severity? = 'error' })` returns a hook for the HTTP server's `onInternalError`: each internal 5xx raises `request-fault:<METHOD> <route pattern>` with message `<METHOD> <route>: <error message>`, context `{ method, route, requestId, traceId, message }` and the request's tenant as subject; repeats on one route group into one alert. Pass it as `createServer(m, { onInternalError: alerts.requestFaults(ops, { owner: 'platform' }) })`.
|
|
1522
|
+
`alerts.requestFaults(handle, { owner?, runbook?, severity? = 'error' })` returns a hook for the HTTP server's `onInternalError`: each internal 5xx raises `request-fault:<METHOD> <route pattern>` with message `<METHOD> <route>: <error message>`, context `{ method, route, requestId, traceId, message }` and the request's tenant as subject; repeats on one route group into one alert. Pass it as `createServer(m, { onInternalError: alerts.requestFaults(ops, { owner: 'platform' }) })` or `surface.http({ onInternalError: ... })`.
|
|
1521
1523
|
|
|
1522
1524
|
```ts
|
|
1523
1525
|
const sink = alerts.webhook({ url: process.env.OPS_HOOK!, secret: process.env.OPS_SECRET! })
|