@grovemotorco/manifold 0.0.0-stage → 0.0.1
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/LICENSE +201 -0
- package/README.md +50 -2
- package/dist/api.d.ts +6515 -0
- package/dist/api.js +643 -0
- package/dist/client.d.ts +2603 -0
- package/dist/client.js +42 -0
- package/dist/domain-Dye3ZdC_.js +922 -0
- package/dist/filter-DQnhobby.js +240 -0
- package/dist/ids-Ced7gYBp.d.ts +1704 -0
- package/dist/index.d.ts +640 -0
- package/dist/index.js +1339 -0
- package/dist/listen.d.ts +530 -0
- package/dist/listen.js +566 -0
- package/package.json +49 -3
|
@@ -0,0 +1,1704 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
declare const KiB = 1024;
|
|
3
|
+
declare const MiB: number;
|
|
4
|
+
declare const LIMITS: {
|
|
5
|
+
/** Bodies above this are stored in R2 at `{owner}/{requestId}`. */
|
|
6
|
+
readonly inlineBodyBytes: number;
|
|
7
|
+
readonly defaultMaxBodyBytes: number;
|
|
8
|
+
readonly hardMaxBodyBytes: number;
|
|
9
|
+
/** Attempt response bodies are truncated to this. */
|
|
10
|
+
readonly responseBodyBytes: number;
|
|
11
|
+
/** Per-source SQLite capacity reported in stats. */
|
|
12
|
+
readonly sqliteBytes: number;
|
|
13
|
+
readonly rejectionRing: 50;
|
|
14
|
+
readonly rejectionRecordsPerMinute: 60;
|
|
15
|
+
readonly releaseBatch: 100;
|
|
16
|
+
readonly replayRangeMax: 500;
|
|
17
|
+
readonly pageDefault: 50;
|
|
18
|
+
readonly pageMax: 200;
|
|
19
|
+
/** Extracted event types and idempotency keys longer than this are dropped. */
|
|
20
|
+
readonly extractedValueChars: 512;
|
|
21
|
+
readonly defaultRelayTimeoutMs: 30000;
|
|
22
|
+
readonly maxRelayTimeoutMs: 120000;
|
|
23
|
+
};
|
|
24
|
+
declare const TIMINGS: {
|
|
25
|
+
/** Lease on a `dispatched` delivery (§6.2). */
|
|
26
|
+
readonly dispatchLeaseMs: number;
|
|
27
|
+
/** Added to the relay timeout for the lease on a `running` delivery (§6.3). */
|
|
28
|
+
readonly runningLeaseSlackMs: 60000;
|
|
29
|
+
/** A failed queue send puts rows back to `pending`, due this much later. */
|
|
30
|
+
readonly sendRetryMs: 5000;
|
|
31
|
+
/** The alarm re-arms this much later after an internal error. */
|
|
32
|
+
readonly alarmErrorRetryMs: 5000;
|
|
33
|
+
readonly maintenanceIntervalMs: number;
|
|
34
|
+
/** Worker-side verify config cache (§4 step 3). */
|
|
35
|
+
readonly verifyCacheTtlMs: 15000;
|
|
36
|
+
/** Minimum age before a failed verification refreshes the cache (§4 step 4). */
|
|
37
|
+
readonly verifyRefreshMinMs: 2000;
|
|
38
|
+
/** A rotated relay signing secret keeps signing this long (§5.5). */
|
|
39
|
+
readonly signingSecretOverlapMs: number;
|
|
40
|
+
readonly retryAfterCapMs: number;
|
|
41
|
+
readonly cronSweepMs: number;
|
|
42
|
+
};
|
|
43
|
+
declare const Millis: Schema.Int;
|
|
44
|
+
declare const Count: Schema.Int;
|
|
45
|
+
declare const Revision: Schema.Int;
|
|
46
|
+
declare const RequestId: Schema.String;
|
|
47
|
+
declare const DeliveryId: Schema.String;
|
|
48
|
+
declare const AttemptId: Schema.String;
|
|
49
|
+
declare const RelayId: Schema.String;
|
|
50
|
+
declare const RouteId: Schema.String;
|
|
51
|
+
/** A request sent to a local target (docs/LOCAL-RELAY.md): sent as `manifold-delivery-id` instead of a `dlv_` id. */
|
|
52
|
+
declare const LocalId: Schema.String;
|
|
53
|
+
/** One connected `manifold listen` session. */
|
|
54
|
+
declare const ListenerSessionId: Schema.String;
|
|
55
|
+
/** A listen token's id. The token itself (`mfl_…`) is never stored or returned after creation. */
|
|
56
|
+
declare const ListenTokenId: Schema.String;
|
|
57
|
+
/** A source's key, which is also its ingest path segment: `/in/{key}`. */
|
|
58
|
+
declare const SourceKey: Schema.String;
|
|
59
|
+
/** An HTTP header name (matched case-insensitively). */
|
|
60
|
+
declare const HeaderName: Schema.String;
|
|
61
|
+
/** A JSON body field, as a dot path (`event.type`). Numeric segments index arrays. */
|
|
62
|
+
declare const BodyPath: Schema.String;
|
|
63
|
+
/** An event-type glob: `*` matches any run of characters, everything else is literal. */
|
|
64
|
+
declare const EventTypeGlob: Schema.String;
|
|
65
|
+
declare const Fingerprint: Schema.String;
|
|
66
|
+
/** A plaintext secret as supplied by an operator. Only ever accepted, never returned (except signing secrets once). */
|
|
67
|
+
declare const SecretValue: Schema.String;
|
|
68
|
+
declare const RequestStatus: Schema.Literals<readonly ["accepted", "duplicate", "unrouted"]>;
|
|
69
|
+
type RequestStatus = typeof RequestStatus.Type;
|
|
70
|
+
declare const DeliveryStatus: Schema.Literals<readonly ["pending", "dispatched", "running", "succeeded", "failed", "cancelled"]>;
|
|
71
|
+
type DeliveryStatus = typeof DeliveryStatus.Type;
|
|
72
|
+
/** Statuses that end a delivery. Retention only deletes requests whose deliveries are all finished. */
|
|
73
|
+
declare const FINISHED_DELIVERY_STATUSES: ReadonlyArray<DeliveryStatus>;
|
|
74
|
+
declare const AttemptStatus: Schema.Literals<readonly ["started", "succeeded", "failed", "lost"]>;
|
|
75
|
+
type AttemptStatus = typeof AttemptStatus.Type;
|
|
76
|
+
declare const PauseReason: Schema.Literals<readonly ["manual", "consecutive_failures"]>;
|
|
77
|
+
type PauseReason = typeof PauseReason.Type;
|
|
78
|
+
/** Why a request failed verification. Counted per source per minute (§5.4). */
|
|
79
|
+
declare const RejectionReason: Schema.Literals<readonly ["missing_signature", "malformed", "bad_signature", "missing_timestamp", "timestamp_out_of_tolerance", "missing_id", "no_secrets", "missing_token", "bad_token", "unverified_not_allowed", "jwt_missing", "jwt_malformed", "jwt_unsupported_alg", "jwt_unknown_kid", "jwt_bad_signature", "jwt_expired", "jwt_not_yet_valid", "jwt_bad_issuer", "jwt_bad_audience", "jwt_claim_mismatch", "jwks_unavailable"]>;
|
|
80
|
+
type RejectionReason = typeof RejectionReason.Type;
|
|
81
|
+
declare const HashAlgorithm: Schema.Literals<readonly ["sha1", "sha256", "sha512"]>;
|
|
82
|
+
type HashAlgorithm = typeof HashAlgorithm.Type;
|
|
83
|
+
declare const SignatureEncoding: Schema.Literals<readonly ["hex", "base64"]>;
|
|
84
|
+
/**
|
|
85
|
+
* - `plain`: the header is the signature.
|
|
86
|
+
* - `prefixed`: `{prefix}{signature}`, e.g. `sha256=…` (`prefix` required).
|
|
87
|
+
* - `kv-list`: `t=…,v1=…,v1=…`; signatures are the entries named `key`.
|
|
88
|
+
* - `space-list`: `v1,… v1,…`; signatures are the entries versioned `key`.
|
|
89
|
+
*/
|
|
90
|
+
declare const SignatureFormat: Schema.Literals<readonly ["plain", "prefixed", "kv-list", "space-list"]>;
|
|
91
|
+
/** How a secret string becomes HMAC key bytes. `whsec`: strip `whsec_`, then base64. */
|
|
92
|
+
declare const SecretEncoding: Schema.Literals<readonly ["utf8", "base64", "whsec"]>;
|
|
93
|
+
/**
|
|
94
|
+
* The signed payload. `{body}` must appear exactly once; `{timestamp}`, `{id}`
|
|
95
|
+
* and `{url}` are optional. Examples: `{body}`, `{timestamp}.{body}`,
|
|
96
|
+
* `v0:{timestamp}:{body}`, `{id}.{timestamp}.{body}`.
|
|
97
|
+
*/
|
|
98
|
+
declare const PayloadTemplate: Schema.String;
|
|
99
|
+
/** Where a timestamp or id comes from: a request header, or an entry of a `kv-list` signature header. */
|
|
100
|
+
declare const ValueSource: Schema.Union<readonly [Schema.Struct<{
|
|
101
|
+
readonly header: Schema.String;
|
|
102
|
+
}>, Schema.Struct<{
|
|
103
|
+
readonly signatureKey: Schema.String;
|
|
104
|
+
}>]>;
|
|
105
|
+
type ValueSource = typeof ValueSource.Type;
|
|
106
|
+
declare const Tolerance: Schema.Struct<{
|
|
107
|
+
readonly pastSeconds: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
108
|
+
readonly futureSeconds: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
109
|
+
}>;
|
|
110
|
+
declare const HmacVerify: Schema.Struct<{
|
|
111
|
+
readonly type: Schema.Literal<"hmac">;
|
|
112
|
+
readonly algorithm: Schema.withDecodingDefaultKey<Schema.Literals<readonly ["sha1", "sha256", "sha512"]>, never>;
|
|
113
|
+
readonly header: Schema.String;
|
|
114
|
+
readonly encoding: Schema.withDecodingDefaultKey<Schema.Literals<readonly ["hex", "base64"]>, never>;
|
|
115
|
+
readonly format: Schema.withDecodingDefaultKey<Schema.Literals<readonly ["plain", "prefixed", "kv-list", "space-list"]>, never>;
|
|
116
|
+
readonly prefix: Schema.optionalKey<Schema.String>;
|
|
117
|
+
readonly key: Schema.optionalKey<Schema.String>;
|
|
118
|
+
readonly payload: Schema.withDecodingDefaultKey<Schema.String, never>;
|
|
119
|
+
readonly timestamp: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
120
|
+
readonly header: Schema.String;
|
|
121
|
+
}>, Schema.Struct<{
|
|
122
|
+
readonly signatureKey: Schema.String;
|
|
123
|
+
}>]>>;
|
|
124
|
+
readonly id: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
125
|
+
readonly header: Schema.String;
|
|
126
|
+
}>, Schema.Struct<{
|
|
127
|
+
readonly signatureKey: Schema.String;
|
|
128
|
+
}>]>>;
|
|
129
|
+
/** Applies only when a timestamp source is set. */
|
|
130
|
+
readonly tolerance: Schema.withDecodingDefaultKey<Schema.Struct<{
|
|
131
|
+
readonly pastSeconds: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
132
|
+
readonly futureSeconds: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
133
|
+
}>, never>;
|
|
134
|
+
readonly secretEncoding: Schema.withDecodingDefaultKey<Schema.Literals<readonly ["utf8", "base64", "whsec"]>, never>;
|
|
135
|
+
}>;
|
|
136
|
+
type HmacVerify = typeof HmacVerify.Type;
|
|
137
|
+
declare const TokenVerify: Schema.Struct<{
|
|
138
|
+
readonly type: Schema.Literal<"token">;
|
|
139
|
+
readonly header: Schema.String;
|
|
140
|
+
/** When set (e.g. `Bearer`), the header must be `{scheme} {token}`; the scheme matches case-insensitively. */
|
|
141
|
+
readonly scheme: Schema.optionalKey<Schema.String>;
|
|
142
|
+
}>;
|
|
143
|
+
type TokenVerify = typeof TokenVerify.Type;
|
|
144
|
+
declare const JwtAlgorithm: Schema.Literals<readonly ["RS256", "ES256"]>;
|
|
145
|
+
type JwtAlgorithm = typeof JwtAlgorithm.Type;
|
|
146
|
+
/** A required claim: equal to the value, or to one of the values when a list is given. */
|
|
147
|
+
declare const ClaimRequirement: Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>>]>;
|
|
148
|
+
declare const JwtVerify: Schema.Struct<{
|
|
149
|
+
readonly type: Schema.Literal<"jwt">;
|
|
150
|
+
readonly header: Schema.withDecodingDefaultKey<Schema.String, never>;
|
|
151
|
+
readonly scheme: Schema.optionalKey<Schema.String>;
|
|
152
|
+
readonly jwksUrl: Schema.String;
|
|
153
|
+
readonly algorithms: Schema.withDecodingDefaultKey<Schema.NonEmptyArray<Schema.Literals<readonly ["RS256", "ES256"]>>, never>;
|
|
154
|
+
/** Accepted `iss` values. */
|
|
155
|
+
readonly issuer: Schema.Union<readonly [Schema.String, Schema.NonEmptyArray<Schema.String>]>;
|
|
156
|
+
/** Accepted `aud` values; the token must carry at least one. */
|
|
157
|
+
readonly audience: Schema.Union<readonly [Schema.String, Schema.NonEmptyArray<Schema.String>]>;
|
|
158
|
+
readonly claims: Schema.withDecodingDefaultKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>>]>>, never>;
|
|
159
|
+
readonly clockToleranceSeconds: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
160
|
+
}>;
|
|
161
|
+
type JwtVerify = typeof JwtVerify.Type;
|
|
162
|
+
declare const NoneVerify: Schema.Struct<{
|
|
163
|
+
readonly type: Schema.Literal<"none">;
|
|
164
|
+
}>;
|
|
165
|
+
type NoneVerify = typeof NoneVerify.Type;
|
|
166
|
+
declare const VerifySpec: Schema.Union<readonly [Schema.Struct<{
|
|
167
|
+
readonly type: Schema.Literal<"hmac">;
|
|
168
|
+
readonly algorithm: Schema.withDecodingDefaultKey<Schema.Literals<readonly ["sha1", "sha256", "sha512"]>, never>;
|
|
169
|
+
readonly header: Schema.String;
|
|
170
|
+
readonly encoding: Schema.withDecodingDefaultKey<Schema.Literals<readonly ["hex", "base64"]>, never>;
|
|
171
|
+
readonly format: Schema.withDecodingDefaultKey<Schema.Literals<readonly ["plain", "prefixed", "kv-list", "space-list"]>, never>;
|
|
172
|
+
readonly prefix: Schema.optionalKey<Schema.String>;
|
|
173
|
+
readonly key: Schema.optionalKey<Schema.String>;
|
|
174
|
+
readonly payload: Schema.withDecodingDefaultKey<Schema.String, never>;
|
|
175
|
+
readonly timestamp: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
176
|
+
readonly header: Schema.String;
|
|
177
|
+
}>, Schema.Struct<{
|
|
178
|
+
readonly signatureKey: Schema.String;
|
|
179
|
+
}>]>>;
|
|
180
|
+
readonly id: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
181
|
+
readonly header: Schema.String;
|
|
182
|
+
}>, Schema.Struct<{
|
|
183
|
+
readonly signatureKey: Schema.String;
|
|
184
|
+
}>]>>;
|
|
185
|
+
/** Applies only when a timestamp source is set. */
|
|
186
|
+
readonly tolerance: Schema.withDecodingDefaultKey<Schema.Struct<{
|
|
187
|
+
readonly pastSeconds: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
188
|
+
readonly futureSeconds: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
189
|
+
}>, never>;
|
|
190
|
+
readonly secretEncoding: Schema.withDecodingDefaultKey<Schema.Literals<readonly ["utf8", "base64", "whsec"]>, never>;
|
|
191
|
+
}>, Schema.Struct<{
|
|
192
|
+
readonly type: Schema.Literal<"token">;
|
|
193
|
+
readonly header: Schema.String;
|
|
194
|
+
/** When set (e.g. `Bearer`), the header must be `{scheme} {token}`; the scheme matches case-insensitively. */
|
|
195
|
+
readonly scheme: Schema.optionalKey<Schema.String>;
|
|
196
|
+
}>, Schema.Struct<{
|
|
197
|
+
readonly type: Schema.Literal<"jwt">;
|
|
198
|
+
readonly header: Schema.withDecodingDefaultKey<Schema.String, never>;
|
|
199
|
+
readonly scheme: Schema.optionalKey<Schema.String>;
|
|
200
|
+
readonly jwksUrl: Schema.String;
|
|
201
|
+
readonly algorithms: Schema.withDecodingDefaultKey<Schema.NonEmptyArray<Schema.Literals<readonly ["RS256", "ES256"]>>, never>;
|
|
202
|
+
/** Accepted `iss` values. */
|
|
203
|
+
readonly issuer: Schema.Union<readonly [Schema.String, Schema.NonEmptyArray<Schema.String>]>;
|
|
204
|
+
/** Accepted `aud` values; the token must carry at least one. */
|
|
205
|
+
readonly audience: Schema.Union<readonly [Schema.String, Schema.NonEmptyArray<Schema.String>]>;
|
|
206
|
+
readonly claims: Schema.withDecodingDefaultKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>>]>>, never>;
|
|
207
|
+
readonly clockToleranceSeconds: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
208
|
+
}>, Schema.Struct<{
|
|
209
|
+
readonly type: Schema.Literal<"none">;
|
|
210
|
+
}>]>;
|
|
211
|
+
type VerifySpec = typeof VerifySpec.Type;
|
|
212
|
+
type VerifyType = VerifySpec["type"];
|
|
213
|
+
/**
|
|
214
|
+
* A partial verify spec: a preset's template, or a source's override of it.
|
|
215
|
+
* Fields from all verifier types share one flat struct; the merged result is
|
|
216
|
+
* decoded with `VerifySpec` (see `resolveVerifySpec` in presets.ts).
|
|
217
|
+
*/
|
|
218
|
+
declare const VerifyOverride: Schema.Struct<{
|
|
219
|
+
readonly type: Schema.optionalKey<Schema.Literals<readonly ["hmac", "token", "jwt", "none"]>>;
|
|
220
|
+
readonly header: Schema.optionalKey<Schema.String>;
|
|
221
|
+
readonly algorithm: Schema.optionalKey<Schema.Literals<readonly ["sha1", "sha256", "sha512"]>>;
|
|
222
|
+
readonly encoding: Schema.optionalKey<Schema.Literals<readonly ["hex", "base64"]>>;
|
|
223
|
+
readonly format: Schema.optionalKey<Schema.Literals<readonly ["plain", "prefixed", "kv-list", "space-list"]>>;
|
|
224
|
+
readonly prefix: Schema.optionalKey<Schema.String>;
|
|
225
|
+
readonly key: Schema.optionalKey<Schema.String>;
|
|
226
|
+
readonly payload: Schema.optionalKey<Schema.String>;
|
|
227
|
+
readonly timestamp: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
228
|
+
readonly header: Schema.String;
|
|
229
|
+
}>, Schema.Struct<{
|
|
230
|
+
readonly signatureKey: Schema.String;
|
|
231
|
+
}>]>>;
|
|
232
|
+
readonly id: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
233
|
+
readonly header: Schema.String;
|
|
234
|
+
}>, Schema.Struct<{
|
|
235
|
+
readonly signatureKey: Schema.String;
|
|
236
|
+
}>]>>;
|
|
237
|
+
readonly tolerance: Schema.optionalKey<Schema.Struct<{
|
|
238
|
+
readonly pastSeconds: Schema.optionalKey<Schema.Int>;
|
|
239
|
+
readonly futureSeconds: Schema.optionalKey<Schema.Int>;
|
|
240
|
+
}>>;
|
|
241
|
+
readonly secretEncoding: Schema.optionalKey<Schema.Literals<readonly ["utf8", "base64", "whsec"]>>;
|
|
242
|
+
readonly scheme: Schema.optionalKey<Schema.String>;
|
|
243
|
+
readonly jwksUrl: Schema.optionalKey<Schema.String>;
|
|
244
|
+
readonly algorithms: Schema.optionalKey<Schema.NonEmptyArray<Schema.Literals<readonly ["RS256", "ES256"]>>>;
|
|
245
|
+
readonly issuer: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.NonEmptyArray<Schema.String>]>>;
|
|
246
|
+
readonly audience: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.NonEmptyArray<Schema.String>]>>;
|
|
247
|
+
readonly claims: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>>]>>>;
|
|
248
|
+
readonly clockToleranceSeconds: Schema.optionalKey<Schema.Int>;
|
|
249
|
+
}>;
|
|
250
|
+
type VerifyOverride = typeof VerifyOverride.Type;
|
|
251
|
+
/** A preset's verify template: a `VerifyOverride` whose `type` is set. */
|
|
252
|
+
type VerifyTemplate = VerifyOverride & {
|
|
253
|
+
readonly type: VerifyType;
|
|
254
|
+
};
|
|
255
|
+
declare const ExtractorPart: Schema.Union<readonly [Schema.Struct<{
|
|
256
|
+
readonly header: Schema.String;
|
|
257
|
+
}>, Schema.Struct<{
|
|
258
|
+
readonly body: Schema.String;
|
|
259
|
+
}>]>;
|
|
260
|
+
type ExtractorPart = typeof ExtractorPart.Type;
|
|
261
|
+
/**
|
|
262
|
+
* The first part of `from` that yields a value wins. When `suffix` yields a
|
|
263
|
+
* value too, it is appended after a `.` (GitHub: `pull_request` + `.opened`).
|
|
264
|
+
* JSON strings, numbers and booleans count as values.
|
|
265
|
+
*/
|
|
266
|
+
declare const Extractor: Schema.Struct<{
|
|
267
|
+
readonly from: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
268
|
+
readonly header: Schema.String;
|
|
269
|
+
}>, Schema.Struct<{
|
|
270
|
+
readonly body: Schema.String;
|
|
271
|
+
}>]>>;
|
|
272
|
+
readonly suffix: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
273
|
+
readonly header: Schema.String;
|
|
274
|
+
}>, Schema.Struct<{
|
|
275
|
+
readonly body: Schema.String;
|
|
276
|
+
}>]>>;
|
|
277
|
+
}>;
|
|
278
|
+
type Extractor = typeof Extractor.Type;
|
|
279
|
+
/**
|
|
280
|
+
* Answers a challenge in a JSON body: when the value at `path` equals
|
|
281
|
+
* `equals`, the response is the string at `challenge` as `text/plain`, and the
|
|
282
|
+
* request is not stored (Slack `url_verification`).
|
|
283
|
+
*/
|
|
284
|
+
declare const JsonChallengeHandshake: Schema.Struct<{
|
|
285
|
+
readonly type: Schema.Literal<"json-challenge">;
|
|
286
|
+
readonly path: Schema.String;
|
|
287
|
+
readonly equals: Schema.String;
|
|
288
|
+
readonly challenge: Schema.String;
|
|
289
|
+
}>;
|
|
290
|
+
declare const HandshakeSpec: Schema.Union<readonly [Schema.Struct<{
|
|
291
|
+
readonly type: Schema.Literal<"json-challenge">;
|
|
292
|
+
readonly path: Schema.String;
|
|
293
|
+
readonly equals: Schema.String;
|
|
294
|
+
readonly challenge: Schema.String;
|
|
295
|
+
}>]>;
|
|
296
|
+
type HandshakeSpec = typeof HandshakeSpec.Type;
|
|
297
|
+
/** The answer a sender expects instead of the default `202 { id, status }`. */
|
|
298
|
+
declare const PresetResponse: Schema.Struct<{
|
|
299
|
+
readonly status: Schema.Int;
|
|
300
|
+
readonly body: Schema.optionalKey<Schema.String>;
|
|
301
|
+
readonly contentType: Schema.optionalKey<Schema.String>;
|
|
302
|
+
}>;
|
|
303
|
+
type PresetResponse = typeof PresetResponse.Type;
|
|
304
|
+
declare const PresetId: Schema.Literals<readonly ["github", "stripe", "slack", "shopify", "gitlab", "linear", "standard-webhooks", "google-oidc", "hmac", "bearer", "none"]>;
|
|
305
|
+
type PresetId = typeof PresetId.Type;
|
|
306
|
+
declare const Preset: Schema.Struct<{
|
|
307
|
+
readonly id: Schema.Literals<readonly ["github", "stripe", "slack", "shopify", "gitlab", "linear", "standard-webhooks", "google-oidc", "hmac", "bearer", "none"]>;
|
|
308
|
+
readonly description: Schema.String;
|
|
309
|
+
readonly verify: Schema.Struct<{
|
|
310
|
+
readonly header: Schema.optionalKey<Schema.String>;
|
|
311
|
+
readonly algorithm: Schema.optionalKey<Schema.Literals<readonly ["sha1", "sha256", "sha512"]>>;
|
|
312
|
+
readonly encoding: Schema.optionalKey<Schema.Literals<readonly ["hex", "base64"]>>;
|
|
313
|
+
readonly format: Schema.optionalKey<Schema.Literals<readonly ["plain", "prefixed", "kv-list", "space-list"]>>;
|
|
314
|
+
readonly prefix: Schema.optionalKey<Schema.String>;
|
|
315
|
+
readonly key: Schema.optionalKey<Schema.String>;
|
|
316
|
+
readonly payload: Schema.optionalKey<Schema.String>;
|
|
317
|
+
readonly timestamp: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
318
|
+
readonly header: Schema.String;
|
|
319
|
+
}>, Schema.Struct<{
|
|
320
|
+
readonly signatureKey: Schema.String;
|
|
321
|
+
}>]>>;
|
|
322
|
+
readonly id: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
323
|
+
readonly header: Schema.String;
|
|
324
|
+
}>, Schema.Struct<{
|
|
325
|
+
readonly signatureKey: Schema.String;
|
|
326
|
+
}>]>>;
|
|
327
|
+
readonly tolerance: Schema.optionalKey<Schema.Struct<{
|
|
328
|
+
readonly pastSeconds: Schema.optionalKey<Schema.Int>;
|
|
329
|
+
readonly futureSeconds: Schema.optionalKey<Schema.Int>;
|
|
330
|
+
}>>;
|
|
331
|
+
readonly secretEncoding: Schema.optionalKey<Schema.Literals<readonly ["utf8", "base64", "whsec"]>>;
|
|
332
|
+
readonly scheme: Schema.optionalKey<Schema.String>;
|
|
333
|
+
readonly jwksUrl: Schema.optionalKey<Schema.String>;
|
|
334
|
+
readonly algorithms: Schema.optionalKey<Schema.NonEmptyArray<Schema.Literals<readonly ["RS256", "ES256"]>>>;
|
|
335
|
+
readonly issuer: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.NonEmptyArray<Schema.String>]>>;
|
|
336
|
+
readonly audience: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.NonEmptyArray<Schema.String>]>>;
|
|
337
|
+
readonly claims: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>>]>>>;
|
|
338
|
+
readonly clockToleranceSeconds: Schema.optionalKey<Schema.Int>;
|
|
339
|
+
readonly type: Schema.Literals<readonly ["hmac", "token", "jwt", "none"]>;
|
|
340
|
+
}>;
|
|
341
|
+
readonly eventType: Schema.optionalKey<Schema.Struct<{
|
|
342
|
+
readonly from: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
343
|
+
readonly header: Schema.String;
|
|
344
|
+
}>, Schema.Struct<{
|
|
345
|
+
readonly body: Schema.String;
|
|
346
|
+
}>]>>;
|
|
347
|
+
readonly suffix: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
348
|
+
readonly header: Schema.String;
|
|
349
|
+
}>, Schema.Struct<{
|
|
350
|
+
readonly body: Schema.String;
|
|
351
|
+
}>]>>;
|
|
352
|
+
}>>;
|
|
353
|
+
readonly idempotencyKey: Schema.optionalKey<Schema.Struct<{
|
|
354
|
+
readonly from: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
355
|
+
readonly header: Schema.String;
|
|
356
|
+
}>, Schema.Struct<{
|
|
357
|
+
readonly body: Schema.String;
|
|
358
|
+
}>]>>;
|
|
359
|
+
readonly suffix: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
360
|
+
readonly header: Schema.String;
|
|
361
|
+
}>, Schema.Struct<{
|
|
362
|
+
readonly body: Schema.String;
|
|
363
|
+
}>]>>;
|
|
364
|
+
}>>;
|
|
365
|
+
readonly handshake: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
366
|
+
readonly type: Schema.Literal<"json-challenge">;
|
|
367
|
+
readonly path: Schema.String;
|
|
368
|
+
readonly equals: Schema.String;
|
|
369
|
+
readonly challenge: Schema.String;
|
|
370
|
+
}>]>>;
|
|
371
|
+
readonly response: Schema.optionalKey<Schema.Struct<{
|
|
372
|
+
readonly status: Schema.Int;
|
|
373
|
+
readonly body: Schema.optionalKey<Schema.String>;
|
|
374
|
+
readonly contentType: Schema.optionalKey<Schema.String>;
|
|
375
|
+
}>>;
|
|
376
|
+
/** Extra headers never stored or forwarded. */
|
|
377
|
+
readonly redactHeaders: Schema.$Array<Schema.String>;
|
|
378
|
+
}>;
|
|
379
|
+
type Preset = typeof Preset.Type;
|
|
380
|
+
/** A source's verification after its preset and overrides are merged. Holds no secrets. */
|
|
381
|
+
declare const ResolvedVerification: Schema.Struct<{
|
|
382
|
+
readonly verify: Schema.Union<readonly [Schema.Struct<{
|
|
383
|
+
readonly type: Schema.Literal<"hmac">;
|
|
384
|
+
readonly algorithm: Schema.withDecodingDefaultKey<Schema.Literals<readonly ["sha1", "sha256", "sha512"]>, never>;
|
|
385
|
+
readonly header: Schema.String;
|
|
386
|
+
readonly encoding: Schema.withDecodingDefaultKey<Schema.Literals<readonly ["hex", "base64"]>, never>;
|
|
387
|
+
readonly format: Schema.withDecodingDefaultKey<Schema.Literals<readonly ["plain", "prefixed", "kv-list", "space-list"]>, never>;
|
|
388
|
+
readonly prefix: Schema.optionalKey<Schema.String>;
|
|
389
|
+
readonly key: Schema.optionalKey<Schema.String>;
|
|
390
|
+
readonly payload: Schema.withDecodingDefaultKey<Schema.String, never>;
|
|
391
|
+
readonly timestamp: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
392
|
+
readonly header: Schema.String;
|
|
393
|
+
}>, Schema.Struct<{
|
|
394
|
+
readonly signatureKey: Schema.String;
|
|
395
|
+
}>]>>;
|
|
396
|
+
readonly id: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
397
|
+
readonly header: Schema.String;
|
|
398
|
+
}>, Schema.Struct<{
|
|
399
|
+
readonly signatureKey: Schema.String;
|
|
400
|
+
}>]>>;
|
|
401
|
+
/** Applies only when a timestamp source is set. */
|
|
402
|
+
readonly tolerance: Schema.withDecodingDefaultKey<Schema.Struct<{
|
|
403
|
+
readonly pastSeconds: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
404
|
+
readonly futureSeconds: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
405
|
+
}>, never>;
|
|
406
|
+
readonly secretEncoding: Schema.withDecodingDefaultKey<Schema.Literals<readonly ["utf8", "base64", "whsec"]>, never>;
|
|
407
|
+
}>, Schema.Struct<{
|
|
408
|
+
readonly type: Schema.Literal<"token">;
|
|
409
|
+
readonly header: Schema.String;
|
|
410
|
+
/** When set (e.g. `Bearer`), the header must be `{scheme} {token}`; the scheme matches case-insensitively. */
|
|
411
|
+
readonly scheme: Schema.optionalKey<Schema.String>;
|
|
412
|
+
}>, Schema.Struct<{
|
|
413
|
+
readonly type: Schema.Literal<"jwt">;
|
|
414
|
+
readonly header: Schema.withDecodingDefaultKey<Schema.String, never>;
|
|
415
|
+
readonly scheme: Schema.optionalKey<Schema.String>;
|
|
416
|
+
readonly jwksUrl: Schema.String;
|
|
417
|
+
readonly algorithms: Schema.withDecodingDefaultKey<Schema.NonEmptyArray<Schema.Literals<readonly ["RS256", "ES256"]>>, never>;
|
|
418
|
+
/** Accepted `iss` values. */
|
|
419
|
+
readonly issuer: Schema.Union<readonly [Schema.String, Schema.NonEmptyArray<Schema.String>]>;
|
|
420
|
+
/** Accepted `aud` values; the token must carry at least one. */
|
|
421
|
+
readonly audience: Schema.Union<readonly [Schema.String, Schema.NonEmptyArray<Schema.String>]>;
|
|
422
|
+
readonly claims: Schema.withDecodingDefaultKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>>]>>, never>;
|
|
423
|
+
readonly clockToleranceSeconds: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
424
|
+
}>, Schema.Struct<{
|
|
425
|
+
readonly type: Schema.Literal<"none">;
|
|
426
|
+
}>]>;
|
|
427
|
+
readonly eventType: Schema.NullOr<Schema.Struct<{
|
|
428
|
+
readonly from: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
429
|
+
readonly header: Schema.String;
|
|
430
|
+
}>, Schema.Struct<{
|
|
431
|
+
readonly body: Schema.String;
|
|
432
|
+
}>]>>;
|
|
433
|
+
readonly suffix: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
434
|
+
readonly header: Schema.String;
|
|
435
|
+
}>, Schema.Struct<{
|
|
436
|
+
readonly body: Schema.String;
|
|
437
|
+
}>]>>;
|
|
438
|
+
}>>;
|
|
439
|
+
readonly idempotencyKey: Schema.NullOr<Schema.Struct<{
|
|
440
|
+
readonly from: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
441
|
+
readonly header: Schema.String;
|
|
442
|
+
}>, Schema.Struct<{
|
|
443
|
+
readonly body: Schema.String;
|
|
444
|
+
}>]>>;
|
|
445
|
+
readonly suffix: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
446
|
+
readonly header: Schema.String;
|
|
447
|
+
}>, Schema.Struct<{
|
|
448
|
+
readonly body: Schema.String;
|
|
449
|
+
}>]>>;
|
|
450
|
+
}>>;
|
|
451
|
+
readonly handshake: Schema.NullOr<Schema.Union<readonly [Schema.Struct<{
|
|
452
|
+
readonly type: Schema.Literal<"json-challenge">;
|
|
453
|
+
readonly path: Schema.String;
|
|
454
|
+
readonly equals: Schema.String;
|
|
455
|
+
readonly challenge: Schema.String;
|
|
456
|
+
}>]>>;
|
|
457
|
+
readonly response: Schema.NullOr<Schema.Struct<{
|
|
458
|
+
readonly status: Schema.Int;
|
|
459
|
+
readonly body: Schema.optionalKey<Schema.String>;
|
|
460
|
+
readonly contentType: Schema.optionalKey<Schema.String>;
|
|
461
|
+
}>>;
|
|
462
|
+
/** Preset, source and credential headers; stored as `[redacted:…]` and never forwarded. */
|
|
463
|
+
readonly redactHeaders: Schema.$Array<Schema.String>;
|
|
464
|
+
}>;
|
|
465
|
+
type ResolvedVerification = typeof ResolvedVerification.Type;
|
|
466
|
+
/** Who a verifier proved sent the request. Only `jwt` yields one in v1. */
|
|
467
|
+
declare const Principal: Schema.Struct<{
|
|
468
|
+
readonly kind: Schema.Literal<"jwt">;
|
|
469
|
+
readonly iss: Schema.String;
|
|
470
|
+
readonly sub: Schema.NullOr<Schema.String>;
|
|
471
|
+
readonly email: Schema.NullOr<Schema.String>;
|
|
472
|
+
/** The audience that matched the verifier's `audience`. */
|
|
473
|
+
readonly aud: Schema.NullOr<Schema.String>;
|
|
474
|
+
}>;
|
|
475
|
+
type Principal = typeof Principal.Type;
|
|
476
|
+
declare const RetryPolicy: Schema.Struct<{
|
|
477
|
+
readonly strategy: Schema.withDecodingDefaultKey<Schema.Literals<readonly ["exponential", "linear"]>, never>;
|
|
478
|
+
readonly baseSeconds: Schema.withDecodingDefaultKey<Schema.Finite, never>;
|
|
479
|
+
readonly factor: Schema.withDecodingDefaultKey<Schema.Finite, never>;
|
|
480
|
+
readonly capSeconds: Schema.withDecodingDefaultKey<Schema.Finite, never>;
|
|
481
|
+
readonly maxAttempts: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
482
|
+
/** Fraction of the delay added or removed at random: 0.2 is ±20%. */
|
|
483
|
+
readonly jitter: Schema.withDecodingDefaultKey<Schema.Finite, never>;
|
|
484
|
+
}>;
|
|
485
|
+
type RetryPolicy = typeof RetryPolicy.Type;
|
|
486
|
+
declare const DedupeWindowSeconds: Schema.Int;
|
|
487
|
+
declare const MaxBodyBytes: Schema.Int;
|
|
488
|
+
declare const RetentionDays: Schema.Int;
|
|
489
|
+
declare const RelayTimeoutMs: Schema.Int;
|
|
490
|
+
declare const AutoPauseThreshold: Schema.Int;
|
|
491
|
+
/** Whether `manifold listen` may attach to a source (docs/LOCAL-RELAY.md §7). Default `on`. */
|
|
492
|
+
declare const ListenersSetting: Schema.Literals<readonly ["on", "off"]>;
|
|
493
|
+
type ListenersSetting = typeof ListenersSetting.Type;
|
|
494
|
+
declare const sourceConfigFields: {
|
|
495
|
+
key: Schema.String;
|
|
496
|
+
description: Schema.optionalKey<Schema.String>;
|
|
497
|
+
preset: Schema.Literals<readonly ["github", "stripe", "slack", "shopify", "gitlab", "linear", "standard-webhooks", "google-oidc", "hmac", "bearer", "none"]>;
|
|
498
|
+
enabled: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
499
|
+
/** Required for the `none` verifier. */
|
|
500
|
+
allowUnverified: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
501
|
+
/** Merged over the preset's verify template. */
|
|
502
|
+
verify: Schema.optionalKey<Schema.Struct<{
|
|
503
|
+
readonly type: Schema.optionalKey<Schema.Literals<readonly ["hmac", "token", "jwt", "none"]>>;
|
|
504
|
+
readonly header: Schema.optionalKey<Schema.String>;
|
|
505
|
+
readonly algorithm: Schema.optionalKey<Schema.Literals<readonly ["sha1", "sha256", "sha512"]>>;
|
|
506
|
+
readonly encoding: Schema.optionalKey<Schema.Literals<readonly ["hex", "base64"]>>;
|
|
507
|
+
readonly format: Schema.optionalKey<Schema.Literals<readonly ["plain", "prefixed", "kv-list", "space-list"]>>;
|
|
508
|
+
readonly prefix: Schema.optionalKey<Schema.String>;
|
|
509
|
+
readonly key: Schema.optionalKey<Schema.String>;
|
|
510
|
+
readonly payload: Schema.optionalKey<Schema.String>;
|
|
511
|
+
readonly timestamp: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
512
|
+
readonly header: Schema.String;
|
|
513
|
+
}>, Schema.Struct<{
|
|
514
|
+
readonly signatureKey: Schema.String;
|
|
515
|
+
}>]>>;
|
|
516
|
+
readonly id: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
517
|
+
readonly header: Schema.String;
|
|
518
|
+
}>, Schema.Struct<{
|
|
519
|
+
readonly signatureKey: Schema.String;
|
|
520
|
+
}>]>>;
|
|
521
|
+
readonly tolerance: Schema.optionalKey<Schema.Struct<{
|
|
522
|
+
readonly pastSeconds: Schema.optionalKey<Schema.Int>;
|
|
523
|
+
readonly futureSeconds: Schema.optionalKey<Schema.Int>;
|
|
524
|
+
}>>;
|
|
525
|
+
readonly secretEncoding: Schema.optionalKey<Schema.Literals<readonly ["utf8", "base64", "whsec"]>>;
|
|
526
|
+
readonly scheme: Schema.optionalKey<Schema.String>;
|
|
527
|
+
readonly jwksUrl: Schema.optionalKey<Schema.String>;
|
|
528
|
+
readonly algorithms: Schema.optionalKey<Schema.NonEmptyArray<Schema.Literals<readonly ["RS256", "ES256"]>>>;
|
|
529
|
+
readonly issuer: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.NonEmptyArray<Schema.String>]>>;
|
|
530
|
+
readonly audience: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.NonEmptyArray<Schema.String>]>>;
|
|
531
|
+
readonly claims: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>>]>>>;
|
|
532
|
+
readonly clockToleranceSeconds: Schema.optionalKey<Schema.Int>;
|
|
533
|
+
}>>;
|
|
534
|
+
/** Replaces the preset's extractor. */
|
|
535
|
+
eventType: Schema.optionalKey<Schema.Struct<{
|
|
536
|
+
readonly from: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
537
|
+
readonly header: Schema.String;
|
|
538
|
+
}>, Schema.Struct<{
|
|
539
|
+
readonly body: Schema.String;
|
|
540
|
+
}>]>>;
|
|
541
|
+
readonly suffix: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
542
|
+
readonly header: Schema.String;
|
|
543
|
+
}>, Schema.Struct<{
|
|
544
|
+
readonly body: Schema.String;
|
|
545
|
+
}>]>>;
|
|
546
|
+
}>>;
|
|
547
|
+
idempotencyKey: Schema.optionalKey<Schema.Struct<{
|
|
548
|
+
readonly from: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
549
|
+
readonly header: Schema.String;
|
|
550
|
+
}>, Schema.Struct<{
|
|
551
|
+
readonly body: Schema.String;
|
|
552
|
+
}>]>>;
|
|
553
|
+
readonly suffix: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
554
|
+
readonly header: Schema.String;
|
|
555
|
+
}>, Schema.Struct<{
|
|
556
|
+
readonly body: Schema.String;
|
|
557
|
+
}>]>>;
|
|
558
|
+
}>>;
|
|
559
|
+
handshake: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
560
|
+
readonly type: Schema.Literal<"json-challenge">;
|
|
561
|
+
readonly path: Schema.String;
|
|
562
|
+
readonly equals: Schema.String;
|
|
563
|
+
readonly challenge: Schema.String;
|
|
564
|
+
}>]>>;
|
|
565
|
+
response: Schema.optionalKey<Schema.Struct<{
|
|
566
|
+
readonly status: Schema.Int;
|
|
567
|
+
readonly body: Schema.optionalKey<Schema.String>;
|
|
568
|
+
readonly contentType: Schema.optionalKey<Schema.String>;
|
|
569
|
+
}>>;
|
|
570
|
+
/** Added to the preset's list. */
|
|
571
|
+
redactHeaders: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
|
|
572
|
+
/** 0 turns dedupe off. */
|
|
573
|
+
dedupeWindowSeconds: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
574
|
+
maxBodyBytes: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
575
|
+
retentionDays: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
576
|
+
/** `off` refuses listeners and listen tokens for this source (docs/LOCAL-RELAY.md §7). */
|
|
577
|
+
listeners: Schema.withDecodingDefaultKey<Schema.Literals<readonly ["on", "off"]>, never>;
|
|
578
|
+
};
|
|
579
|
+
declare const SourceConfig: Schema.Struct<{
|
|
580
|
+
key: Schema.String;
|
|
581
|
+
description: Schema.optionalKey<Schema.String>;
|
|
582
|
+
preset: Schema.Literals<readonly ["github", "stripe", "slack", "shopify", "gitlab", "linear", "standard-webhooks", "google-oidc", "hmac", "bearer", "none"]>;
|
|
583
|
+
enabled: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
584
|
+
/** Required for the `none` verifier. */
|
|
585
|
+
allowUnverified: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
586
|
+
/** Merged over the preset's verify template. */
|
|
587
|
+
verify: Schema.optionalKey<Schema.Struct<{
|
|
588
|
+
readonly type: Schema.optionalKey<Schema.Literals<readonly ["hmac", "token", "jwt", "none"]>>;
|
|
589
|
+
readonly header: Schema.optionalKey<Schema.String>;
|
|
590
|
+
readonly algorithm: Schema.optionalKey<Schema.Literals<readonly ["sha1", "sha256", "sha512"]>>;
|
|
591
|
+
readonly encoding: Schema.optionalKey<Schema.Literals<readonly ["hex", "base64"]>>;
|
|
592
|
+
readonly format: Schema.optionalKey<Schema.Literals<readonly ["plain", "prefixed", "kv-list", "space-list"]>>;
|
|
593
|
+
readonly prefix: Schema.optionalKey<Schema.String>;
|
|
594
|
+
readonly key: Schema.optionalKey<Schema.String>;
|
|
595
|
+
readonly payload: Schema.optionalKey<Schema.String>;
|
|
596
|
+
readonly timestamp: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
597
|
+
readonly header: Schema.String;
|
|
598
|
+
}>, Schema.Struct<{
|
|
599
|
+
readonly signatureKey: Schema.String;
|
|
600
|
+
}>]>>;
|
|
601
|
+
readonly id: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
602
|
+
readonly header: Schema.String;
|
|
603
|
+
}>, Schema.Struct<{
|
|
604
|
+
readonly signatureKey: Schema.String;
|
|
605
|
+
}>]>>;
|
|
606
|
+
readonly tolerance: Schema.optionalKey<Schema.Struct<{
|
|
607
|
+
readonly pastSeconds: Schema.optionalKey<Schema.Int>;
|
|
608
|
+
readonly futureSeconds: Schema.optionalKey<Schema.Int>;
|
|
609
|
+
}>>;
|
|
610
|
+
readonly secretEncoding: Schema.optionalKey<Schema.Literals<readonly ["utf8", "base64", "whsec"]>>;
|
|
611
|
+
readonly scheme: Schema.optionalKey<Schema.String>;
|
|
612
|
+
readonly jwksUrl: Schema.optionalKey<Schema.String>;
|
|
613
|
+
readonly algorithms: Schema.optionalKey<Schema.NonEmptyArray<Schema.Literals<readonly ["RS256", "ES256"]>>>;
|
|
614
|
+
readonly issuer: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.NonEmptyArray<Schema.String>]>>;
|
|
615
|
+
readonly audience: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.NonEmptyArray<Schema.String>]>>;
|
|
616
|
+
readonly claims: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>>]>>>;
|
|
617
|
+
readonly clockToleranceSeconds: Schema.optionalKey<Schema.Int>;
|
|
618
|
+
}>>;
|
|
619
|
+
/** Replaces the preset's extractor. */
|
|
620
|
+
eventType: Schema.optionalKey<Schema.Struct<{
|
|
621
|
+
readonly from: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
622
|
+
readonly header: Schema.String;
|
|
623
|
+
}>, Schema.Struct<{
|
|
624
|
+
readonly body: Schema.String;
|
|
625
|
+
}>]>>;
|
|
626
|
+
readonly suffix: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
627
|
+
readonly header: Schema.String;
|
|
628
|
+
}>, Schema.Struct<{
|
|
629
|
+
readonly body: Schema.String;
|
|
630
|
+
}>]>>;
|
|
631
|
+
}>>;
|
|
632
|
+
idempotencyKey: Schema.optionalKey<Schema.Struct<{
|
|
633
|
+
readonly from: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
634
|
+
readonly header: Schema.String;
|
|
635
|
+
}>, Schema.Struct<{
|
|
636
|
+
readonly body: Schema.String;
|
|
637
|
+
}>]>>;
|
|
638
|
+
readonly suffix: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
639
|
+
readonly header: Schema.String;
|
|
640
|
+
}>, Schema.Struct<{
|
|
641
|
+
readonly body: Schema.String;
|
|
642
|
+
}>]>>;
|
|
643
|
+
}>>;
|
|
644
|
+
handshake: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
645
|
+
readonly type: Schema.Literal<"json-challenge">;
|
|
646
|
+
readonly path: Schema.String;
|
|
647
|
+
readonly equals: Schema.String;
|
|
648
|
+
readonly challenge: Schema.String;
|
|
649
|
+
}>]>>;
|
|
650
|
+
response: Schema.optionalKey<Schema.Struct<{
|
|
651
|
+
readonly status: Schema.Int;
|
|
652
|
+
readonly body: Schema.optionalKey<Schema.String>;
|
|
653
|
+
readonly contentType: Schema.optionalKey<Schema.String>;
|
|
654
|
+
}>>;
|
|
655
|
+
/** Added to the preset's list. */
|
|
656
|
+
redactHeaders: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
|
|
657
|
+
/** 0 turns dedupe off. */
|
|
658
|
+
dedupeWindowSeconds: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
659
|
+
maxBodyBytes: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
660
|
+
retentionDays: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
661
|
+
/** `off` refuses listeners and listen tokens for this source (docs/LOCAL-RELAY.md §7). */
|
|
662
|
+
listeners: Schema.withDecodingDefaultKey<Schema.Literals<readonly ["on", "off"]>, never>;
|
|
663
|
+
}>;
|
|
664
|
+
type SourceConfig = typeof SourceConfig.Type;
|
|
665
|
+
type SourceConfigInput = typeof SourceConfig.Encoded;
|
|
666
|
+
declare const SecretInfo: Schema.Struct<{
|
|
667
|
+
readonly fingerprint: Schema.String;
|
|
668
|
+
readonly addedAt: Schema.Int;
|
|
669
|
+
}>;
|
|
670
|
+
type SecretInfo = typeof SecretInfo.Type;
|
|
671
|
+
declare const relayConfigFields: {
|
|
672
|
+
/** Unique across relays; the identity of a relay in a declarative config. */
|
|
673
|
+
name: Schema.String;
|
|
674
|
+
description: Schema.optionalKey<Schema.String>;
|
|
675
|
+
url: Schema.String;
|
|
676
|
+
/** Extra headers sent on every attempt. Not secret: shown in the API. */
|
|
677
|
+
headers: Schema.withDecodingDefaultKey<Schema.$Record<Schema.String, Schema.String>, never>;
|
|
678
|
+
timeoutMs: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
679
|
+
retry: Schema.withDecodingDefaultKey<Schema.Struct<{
|
|
680
|
+
readonly strategy: Schema.withDecodingDefaultKey<Schema.Literals<readonly ["exponential", "linear"]>, never>;
|
|
681
|
+
readonly baseSeconds: Schema.withDecodingDefaultKey<Schema.Finite, never>;
|
|
682
|
+
readonly factor: Schema.withDecodingDefaultKey<Schema.Finite, never>;
|
|
683
|
+
readonly capSeconds: Schema.withDecodingDefaultKey<Schema.Finite, never>;
|
|
684
|
+
readonly maxAttempts: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
685
|
+
/** Fraction of the delay added or removed at random: 0.2 is ±20%. */
|
|
686
|
+
readonly jitter: Schema.withDecodingDefaultKey<Schema.Finite, never>;
|
|
687
|
+
}>, never>;
|
|
688
|
+
/** Sign attempts with a manifold-generated `whsec_` secret (§6.6). */
|
|
689
|
+
signing: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
690
|
+
};
|
|
691
|
+
declare const RelayConfig: Schema.Struct<{
|
|
692
|
+
/** Unique across relays; the identity of a relay in a declarative config. */
|
|
693
|
+
name: Schema.String;
|
|
694
|
+
description: Schema.optionalKey<Schema.String>;
|
|
695
|
+
url: Schema.String;
|
|
696
|
+
/** Extra headers sent on every attempt. Not secret: shown in the API. */
|
|
697
|
+
headers: Schema.withDecodingDefaultKey<Schema.$Record<Schema.String, Schema.String>, never>;
|
|
698
|
+
timeoutMs: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
699
|
+
retry: Schema.withDecodingDefaultKey<Schema.Struct<{
|
|
700
|
+
readonly strategy: Schema.withDecodingDefaultKey<Schema.Literals<readonly ["exponential", "linear"]>, never>;
|
|
701
|
+
readonly baseSeconds: Schema.withDecodingDefaultKey<Schema.Finite, never>;
|
|
702
|
+
readonly factor: Schema.withDecodingDefaultKey<Schema.Finite, never>;
|
|
703
|
+
readonly capSeconds: Schema.withDecodingDefaultKey<Schema.Finite, never>;
|
|
704
|
+
readonly maxAttempts: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
705
|
+
/** Fraction of the delay added or removed at random: 0.2 is ±20%. */
|
|
706
|
+
readonly jitter: Schema.withDecodingDefaultKey<Schema.Finite, never>;
|
|
707
|
+
}>, never>;
|
|
708
|
+
/** Sign attempts with a manifold-generated `whsec_` secret (§6.6). */
|
|
709
|
+
signing: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
710
|
+
}>;
|
|
711
|
+
type RelayConfig = typeof RelayConfig.Type;
|
|
712
|
+
type RelayConfigInput = typeof RelayConfig.Encoded;
|
|
713
|
+
/** Secret extra headers (for example the relay's own `authorization`). Write-only. */
|
|
714
|
+
declare const SecretHeaders: Schema.$Record<Schema.String, Schema.String>;
|
|
715
|
+
declare const SecretHeaderInfo: Schema.Struct<{
|
|
716
|
+
readonly name: Schema.String;
|
|
717
|
+
readonly fingerprint: Schema.String;
|
|
718
|
+
}>;
|
|
719
|
+
declare const SigningSecretInfo: Schema.Struct<{
|
|
720
|
+
readonly fingerprint: Schema.String;
|
|
721
|
+
readonly createdAt: Schema.Int;
|
|
722
|
+
/** Set on the previous secret after a rotation. */
|
|
723
|
+
readonly expiresAt: Schema.NullOr<Schema.Int>;
|
|
724
|
+
}>;
|
|
725
|
+
type SigningSecretInfo = typeof SigningSecretInfo.Type;
|
|
726
|
+
declare const routeConfigFields: {
|
|
727
|
+
source: Schema.String;
|
|
728
|
+
relay: Schema.String;
|
|
729
|
+
description: Schema.optionalKey<Schema.String>;
|
|
730
|
+
eventTypes: Schema.withDecodingDefaultKey<Schema.NonEmptyArray<Schema.String>, never>;
|
|
731
|
+
/** A disabled route creates no deliveries; a paused one holds them. */
|
|
732
|
+
enabled: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
733
|
+
/** Consecutive failed attempts that pause the route; 0 never pauses. */
|
|
734
|
+
autoPauseThreshold: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
735
|
+
};
|
|
736
|
+
declare const RouteConfig: Schema.Struct<{
|
|
737
|
+
source: Schema.String;
|
|
738
|
+
relay: Schema.String;
|
|
739
|
+
description: Schema.optionalKey<Schema.String>;
|
|
740
|
+
eventTypes: Schema.withDecodingDefaultKey<Schema.NonEmptyArray<Schema.String>, never>;
|
|
741
|
+
/** A disabled route creates no deliveries; a paused one holds them. */
|
|
742
|
+
enabled: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
743
|
+
/** Consecutive failed attempts that pause the route; 0 never pauses. */
|
|
744
|
+
autoPauseThreshold: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
745
|
+
}>;
|
|
746
|
+
type RouteConfig = typeof RouteConfig.Type;
|
|
747
|
+
type RouteConfigInput = typeof RouteConfig.Encoded;
|
|
748
|
+
/** A route's live state, kept by its SourceDO. */
|
|
749
|
+
declare const RouteState: Schema.Struct<{
|
|
750
|
+
readonly routeId: Schema.String;
|
|
751
|
+
readonly consecutiveFailures: Schema.Int;
|
|
752
|
+
readonly paused: Schema.Boolean;
|
|
753
|
+
readonly pausedAt: Schema.NullOr<Schema.Int>;
|
|
754
|
+
readonly pauseReason: Schema.NullOr<Schema.Literals<readonly ["manual", "consecutive_failures"]>>;
|
|
755
|
+
}>;
|
|
756
|
+
type RouteState = typeof RouteState.Type;
|
|
757
|
+
declare const HeaderMap: Schema.$Record<Schema.String, Schema.String>;
|
|
758
|
+
declare const RequestRecord: Schema.Struct<{
|
|
759
|
+
readonly id: Schema.String;
|
|
760
|
+
readonly sourceKey: Schema.String;
|
|
761
|
+
readonly receivedAt: Schema.Int;
|
|
762
|
+
readonly status: Schema.Literals<readonly ["accepted", "duplicate", "unrouted"]>;
|
|
763
|
+
readonly method: Schema.String;
|
|
764
|
+
readonly path: Schema.String;
|
|
765
|
+
/** The query string without `?`; empty when none. */
|
|
766
|
+
readonly query: Schema.String;
|
|
767
|
+
/** As stored: credentials redacted as `[redacted:<fingerprint>]`. */
|
|
768
|
+
readonly headers: Schema.$Record<Schema.String, Schema.String>;
|
|
769
|
+
readonly bodySize: Schema.Int;
|
|
770
|
+
readonly bodySha256: Schema.String;
|
|
771
|
+
readonly bodyStorage: Schema.Literals<readonly ["inline", "r2"]>;
|
|
772
|
+
readonly contentType: Schema.NullOr<Schema.String>;
|
|
773
|
+
readonly eventType: Schema.NullOr<Schema.String>;
|
|
774
|
+
readonly idempotencyKey: Schema.NullOr<Schema.String>;
|
|
775
|
+
readonly principal: Schema.NullOr<Schema.Struct<{
|
|
776
|
+
readonly kind: Schema.Literal<"jwt">;
|
|
777
|
+
readonly iss: Schema.String;
|
|
778
|
+
readonly sub: Schema.NullOr<Schema.String>;
|
|
779
|
+
readonly email: Schema.NullOr<Schema.String>;
|
|
780
|
+
/** The audience that matched the verifier's `audience`. */
|
|
781
|
+
readonly aud: Schema.NullOr<Schema.String>;
|
|
782
|
+
}>>;
|
|
783
|
+
readonly duplicateOf: Schema.NullOr<Schema.String>;
|
|
784
|
+
/** A duplicate whose body digest differs from the original's. */
|
|
785
|
+
readonly conflict: Schema.Boolean;
|
|
786
|
+
readonly remoteIp: Schema.NullOr<Schema.String>;
|
|
787
|
+
readonly userAgent: Schema.NullOr<Schema.String>;
|
|
788
|
+
}>;
|
|
789
|
+
type RequestRecord = typeof RequestRecord.Type;
|
|
790
|
+
declare const DeliveryRecord: Schema.Struct<{
|
|
791
|
+
readonly id: Schema.String;
|
|
792
|
+
readonly requestId: Schema.String;
|
|
793
|
+
readonly routeId: Schema.String;
|
|
794
|
+
readonly relayId: Schema.String;
|
|
795
|
+
readonly status: Schema.Literals<readonly ["pending", "dispatched", "running", "succeeded", "failed", "cancelled"]>;
|
|
796
|
+
/** `pending` on a paused route. Derived, not stored. */
|
|
797
|
+
readonly held: Schema.Boolean;
|
|
798
|
+
readonly generation: Schema.Int;
|
|
799
|
+
readonly attemptCount: Schema.Int;
|
|
800
|
+
readonly maxAttempts: Schema.Int;
|
|
801
|
+
readonly dueAt: Schema.Int;
|
|
802
|
+
readonly leaseExpiresAt: Schema.NullOr<Schema.Int>;
|
|
803
|
+
readonly lastStatusCode: Schema.NullOr<Schema.Int>;
|
|
804
|
+
readonly lastError: Schema.NullOr<Schema.String>;
|
|
805
|
+
readonly createdAt: Schema.Int;
|
|
806
|
+
readonly completedAt: Schema.NullOr<Schema.Int>;
|
|
807
|
+
/** Created by a replay; sends `manifold-replay: true`. */
|
|
808
|
+
readonly replay: Schema.Boolean;
|
|
809
|
+
/** The latest earlier delivery of the same request on the same route, when this is a replay. */
|
|
810
|
+
readonly replayOf: Schema.NullOr<Schema.String>;
|
|
811
|
+
}>;
|
|
812
|
+
type DeliveryRecord = typeof DeliveryRecord.Type;
|
|
813
|
+
declare const AttemptRecord: Schema.Struct<{
|
|
814
|
+
readonly id: Schema.String;
|
|
815
|
+
readonly deliveryId: Schema.String;
|
|
816
|
+
readonly number: Schema.Int;
|
|
817
|
+
readonly generation: Schema.Int;
|
|
818
|
+
readonly status: Schema.Literals<readonly ["started", "succeeded", "failed", "lost"]>;
|
|
819
|
+
/** Made after a manual retry. */
|
|
820
|
+
readonly manual: Schema.Boolean;
|
|
821
|
+
readonly startedAt: Schema.Int;
|
|
822
|
+
readonly durationMs: Schema.NullOr<Schema.Int>;
|
|
823
|
+
readonly url: Schema.String;
|
|
824
|
+
readonly relayRevision: Schema.Int;
|
|
825
|
+
readonly statusCode: Schema.NullOr<Schema.Int>;
|
|
826
|
+
readonly error: Schema.NullOr<Schema.String>;
|
|
827
|
+
/** `set-cookie` and `authorization` redacted. */
|
|
828
|
+
readonly responseHeaders: Schema.NullOr<Schema.$Record<Schema.String, Schema.String>>;
|
|
829
|
+
/** UTF-8 decoded, at most `LIMITS.responseBodyBytes`. */
|
|
830
|
+
readonly responseBody: Schema.NullOr<Schema.String>;
|
|
831
|
+
readonly responseBodyTruncated: Schema.Boolean;
|
|
832
|
+
}>;
|
|
833
|
+
type AttemptRecord = typeof AttemptRecord.Type;
|
|
834
|
+
declare const DeliveryDetail: Schema.Struct<{
|
|
835
|
+
readonly id: Schema.String;
|
|
836
|
+
readonly requestId: Schema.String;
|
|
837
|
+
readonly routeId: Schema.String;
|
|
838
|
+
readonly relayId: Schema.String;
|
|
839
|
+
readonly status: Schema.Literals<readonly ["pending", "dispatched", "running", "succeeded", "failed", "cancelled"]>;
|
|
840
|
+
readonly held: Schema.Boolean;
|
|
841
|
+
readonly generation: Schema.Int;
|
|
842
|
+
readonly attemptCount: Schema.Int;
|
|
843
|
+
readonly maxAttempts: Schema.Int;
|
|
844
|
+
readonly dueAt: Schema.Int;
|
|
845
|
+
readonly leaseExpiresAt: Schema.NullOr<Schema.Int>;
|
|
846
|
+
readonly lastStatusCode: Schema.NullOr<Schema.Int>;
|
|
847
|
+
readonly lastError: Schema.NullOr<Schema.String>;
|
|
848
|
+
readonly createdAt: Schema.Int;
|
|
849
|
+
readonly completedAt: Schema.NullOr<Schema.Int>;
|
|
850
|
+
readonly replay: Schema.Boolean;
|
|
851
|
+
readonly replayOf: Schema.NullOr<Schema.String>;
|
|
852
|
+
readonly attempts: Schema.$Array<Schema.Struct<{
|
|
853
|
+
readonly id: Schema.String;
|
|
854
|
+
readonly deliveryId: Schema.String;
|
|
855
|
+
readonly number: Schema.Int;
|
|
856
|
+
readonly generation: Schema.Int;
|
|
857
|
+
readonly status: Schema.Literals<readonly ["started", "succeeded", "failed", "lost"]>;
|
|
858
|
+
/** Made after a manual retry. */
|
|
859
|
+
readonly manual: Schema.Boolean;
|
|
860
|
+
readonly startedAt: Schema.Int;
|
|
861
|
+
readonly durationMs: Schema.NullOr<Schema.Int>;
|
|
862
|
+
readonly url: Schema.String;
|
|
863
|
+
readonly relayRevision: Schema.Int;
|
|
864
|
+
readonly statusCode: Schema.NullOr<Schema.Int>;
|
|
865
|
+
readonly error: Schema.NullOr<Schema.String>;
|
|
866
|
+
/** `set-cookie` and `authorization` redacted. */
|
|
867
|
+
readonly responseHeaders: Schema.NullOr<Schema.$Record<Schema.String, Schema.String>>;
|
|
868
|
+
/** UTF-8 decoded, at most `LIMITS.responseBodyBytes`. */
|
|
869
|
+
readonly responseBody: Schema.NullOr<Schema.String>;
|
|
870
|
+
readonly responseBodyTruncated: Schema.Boolean;
|
|
871
|
+
}>>;
|
|
872
|
+
}>;
|
|
873
|
+
type DeliveryDetail = typeof DeliveryDetail.Type;
|
|
874
|
+
/** Why a request was sent to a listener: as it was accepted, on request, or to catch up after a reconnect. */
|
|
875
|
+
declare const LocalAttemptKind: Schema.Literals<readonly ["live", "replay", "resume"]>;
|
|
876
|
+
type LocalAttemptKind = typeof LocalAttemptKind.Type;
|
|
877
|
+
/** A listener's display name (`--name`, default `user@host`). */
|
|
878
|
+
declare const ListenerName: Schema.String;
|
|
879
|
+
/**
|
|
880
|
+
* The label of a local target as the CLI reports it, never the full URL:
|
|
881
|
+
* `:{port}{path}` for loopback targets, `{host}{path}` otherwise (see
|
|
882
|
+
* `targetLabel` in src/api/listen.ts).
|
|
883
|
+
*/
|
|
884
|
+
declare const TargetLabel: Schema.String;
|
|
885
|
+
/**
|
|
886
|
+
* One forward of one request to one local target, reported by the CLI in a
|
|
887
|
+
* `result` frame and kept in the SourceDO's capped `local_attempts` table
|
|
888
|
+
* (debugging information, not ledger state).
|
|
889
|
+
*/
|
|
890
|
+
declare const LocalAttemptRecord: Schema.Struct<{
|
|
891
|
+
/** Row id, increasing. */
|
|
892
|
+
readonly id: Schema.Int;
|
|
893
|
+
readonly requestId: Schema.String;
|
|
894
|
+
/** The `lcl_` id the request was sent with; shared by every target and retry of one send. */
|
|
895
|
+
readonly localId: Schema.String;
|
|
896
|
+
readonly sessionId: Schema.String;
|
|
897
|
+
/** The listener's name when the result was recorded. */
|
|
898
|
+
readonly listener: Schema.String;
|
|
899
|
+
readonly target: Schema.String;
|
|
900
|
+
readonly kind: Schema.Literals<readonly ["live", "replay", "resume"]>;
|
|
901
|
+
/** 1 for the first try; higher after `--retries` on connection refused. */
|
|
902
|
+
readonly attempt: Schema.Int;
|
|
903
|
+
/** `null` when no response arrived (`error` says why). */
|
|
904
|
+
readonly statusCode: Schema.NullOr<Schema.Int>;
|
|
905
|
+
readonly error: Schema.NullOr<Schema.String>;
|
|
906
|
+
readonly durationMs: Schema.Int;
|
|
907
|
+
/** When the SourceDO recorded the result. */
|
|
908
|
+
readonly at: Schema.Int;
|
|
909
|
+
}>;
|
|
910
|
+
type LocalAttemptRecord = typeof LocalAttemptRecord.Type;
|
|
911
|
+
/** A connected listener, as `GET /sources/{key}/listeners` shows it. */
|
|
912
|
+
declare const ListenerInfo: Schema.Struct<{
|
|
913
|
+
readonly sessionId: Schema.String;
|
|
914
|
+
readonly name: Schema.String;
|
|
915
|
+
/** The effective filter: the `hello` frame's globs, or a copy of the `likeRoute` route's filter. */
|
|
916
|
+
readonly eventTypes: Schema.$Array<Schema.String>;
|
|
917
|
+
readonly likeRoute: Schema.NullOr<Schema.String>;
|
|
918
|
+
/** False for a `--no-live` session (replay only). */
|
|
919
|
+
readonly live: Schema.Boolean;
|
|
920
|
+
readonly connectedAt: Schema.Int;
|
|
921
|
+
/** The audit actor that opened it: `listen:<tokenId>`, `token` or `access:<email>`. */
|
|
922
|
+
readonly actor: Schema.String;
|
|
923
|
+
/** The listen token it authenticated with; `null` for the admin token or Cloudflare Access. */
|
|
924
|
+
readonly tokenId: Schema.NullOr<Schema.String>;
|
|
925
|
+
readonly counts: Schema.Struct<{
|
|
926
|
+
/** `request` frames sent to it. */
|
|
927
|
+
readonly sent: Schema.Int;
|
|
928
|
+
/** `result` frames reporting a `2xx`. */
|
|
929
|
+
readonly succeeded: Schema.Int;
|
|
930
|
+
/** Every other `result` frame. */
|
|
931
|
+
readonly failed: Schema.Int;
|
|
932
|
+
}>;
|
|
933
|
+
/** The newest request id sent to it (live or resume); its resume cursor. */
|
|
934
|
+
readonly lastSeenRequestId: Schema.NullOr<Schema.String>;
|
|
935
|
+
}>;
|
|
936
|
+
type ListenerInfo = typeof ListenerInfo.Type;
|
|
937
|
+
/** A listen token as the API shows it. The token itself is shown once, on creation. */
|
|
938
|
+
declare const ListenTokenInfo: Schema.Struct<{
|
|
939
|
+
readonly id: Schema.String;
|
|
940
|
+
readonly name: Schema.String;
|
|
941
|
+
readonly sourceKey: Schema.String;
|
|
942
|
+
/** First 8 hex characters of the token's SHA-256 (§5.5). */
|
|
943
|
+
readonly fingerprint: Schema.String;
|
|
944
|
+
readonly createdAt: Schema.Int;
|
|
945
|
+
readonly expiresAt: Schema.Int;
|
|
946
|
+
/** Best effort, updated at most hourly. */
|
|
947
|
+
readonly lastUsedAt: Schema.NullOr<Schema.Int>;
|
|
948
|
+
}>;
|
|
949
|
+
type ListenTokenInfo = typeof ListenTokenInfo.Type;
|
|
950
|
+
declare const RequestDetail: Schema.Struct<{
|
|
951
|
+
readonly request: Schema.Struct<{
|
|
952
|
+
readonly id: Schema.String;
|
|
953
|
+
readonly sourceKey: Schema.String;
|
|
954
|
+
readonly receivedAt: Schema.Int;
|
|
955
|
+
readonly status: Schema.Literals<readonly ["accepted", "duplicate", "unrouted"]>;
|
|
956
|
+
readonly method: Schema.String;
|
|
957
|
+
readonly path: Schema.String;
|
|
958
|
+
/** The query string without `?`; empty when none. */
|
|
959
|
+
readonly query: Schema.String;
|
|
960
|
+
/** As stored: credentials redacted as `[redacted:<fingerprint>]`. */
|
|
961
|
+
readonly headers: Schema.$Record<Schema.String, Schema.String>;
|
|
962
|
+
readonly bodySize: Schema.Int;
|
|
963
|
+
readonly bodySha256: Schema.String;
|
|
964
|
+
readonly bodyStorage: Schema.Literals<readonly ["inline", "r2"]>;
|
|
965
|
+
readonly contentType: Schema.NullOr<Schema.String>;
|
|
966
|
+
readonly eventType: Schema.NullOr<Schema.String>;
|
|
967
|
+
readonly idempotencyKey: Schema.NullOr<Schema.String>;
|
|
968
|
+
readonly principal: Schema.NullOr<Schema.Struct<{
|
|
969
|
+
readonly kind: Schema.Literal<"jwt">;
|
|
970
|
+
readonly iss: Schema.String;
|
|
971
|
+
readonly sub: Schema.NullOr<Schema.String>;
|
|
972
|
+
readonly email: Schema.NullOr<Schema.String>;
|
|
973
|
+
/** The audience that matched the verifier's `audience`. */
|
|
974
|
+
readonly aud: Schema.NullOr<Schema.String>;
|
|
975
|
+
}>>;
|
|
976
|
+
readonly duplicateOf: Schema.NullOr<Schema.String>;
|
|
977
|
+
/** A duplicate whose body digest differs from the original's. */
|
|
978
|
+
readonly conflict: Schema.Boolean;
|
|
979
|
+
readonly remoteIp: Schema.NullOr<Schema.String>;
|
|
980
|
+
readonly userAgent: Schema.NullOr<Schema.String>;
|
|
981
|
+
}>;
|
|
982
|
+
readonly deliveries: Schema.$Array<Schema.Struct<{
|
|
983
|
+
readonly id: Schema.String;
|
|
984
|
+
readonly requestId: Schema.String;
|
|
985
|
+
readonly routeId: Schema.String;
|
|
986
|
+
readonly relayId: Schema.String;
|
|
987
|
+
readonly status: Schema.Literals<readonly ["pending", "dispatched", "running", "succeeded", "failed", "cancelled"]>;
|
|
988
|
+
readonly held: Schema.Boolean;
|
|
989
|
+
readonly generation: Schema.Int;
|
|
990
|
+
readonly attemptCount: Schema.Int;
|
|
991
|
+
readonly maxAttempts: Schema.Int;
|
|
992
|
+
readonly dueAt: Schema.Int;
|
|
993
|
+
readonly leaseExpiresAt: Schema.NullOr<Schema.Int>;
|
|
994
|
+
readonly lastStatusCode: Schema.NullOr<Schema.Int>;
|
|
995
|
+
readonly lastError: Schema.NullOr<Schema.String>;
|
|
996
|
+
readonly createdAt: Schema.Int;
|
|
997
|
+
readonly completedAt: Schema.NullOr<Schema.Int>;
|
|
998
|
+
readonly replay: Schema.Boolean;
|
|
999
|
+
readonly replayOf: Schema.NullOr<Schema.String>;
|
|
1000
|
+
readonly attempts: Schema.$Array<Schema.Struct<{
|
|
1001
|
+
readonly id: Schema.String;
|
|
1002
|
+
readonly deliveryId: Schema.String;
|
|
1003
|
+
readonly number: Schema.Int;
|
|
1004
|
+
readonly generation: Schema.Int;
|
|
1005
|
+
readonly status: Schema.Literals<readonly ["started", "succeeded", "failed", "lost"]>;
|
|
1006
|
+
/** Made after a manual retry. */
|
|
1007
|
+
readonly manual: Schema.Boolean;
|
|
1008
|
+
readonly startedAt: Schema.Int;
|
|
1009
|
+
readonly durationMs: Schema.NullOr<Schema.Int>;
|
|
1010
|
+
readonly url: Schema.String;
|
|
1011
|
+
readonly relayRevision: Schema.Int;
|
|
1012
|
+
readonly statusCode: Schema.NullOr<Schema.Int>;
|
|
1013
|
+
readonly error: Schema.NullOr<Schema.String>;
|
|
1014
|
+
/** `set-cookie` and `authorization` redacted. */
|
|
1015
|
+
readonly responseHeaders: Schema.NullOr<Schema.$Record<Schema.String, Schema.String>>;
|
|
1016
|
+
/** UTF-8 decoded, at most `LIMITS.responseBodyBytes`. */
|
|
1017
|
+
readonly responseBody: Schema.NullOr<Schema.String>;
|
|
1018
|
+
readonly responseBodyTruncated: Schema.Boolean;
|
|
1019
|
+
}>>;
|
|
1020
|
+
}>>;
|
|
1021
|
+
/** Forwards to listeners' local targets, newest first (docs/LOCAL-RELAY.md §5.1). */
|
|
1022
|
+
readonly localAttempts: Schema.withDecodingDefaultKey<Schema.$Array<Schema.Struct<{
|
|
1023
|
+
/** Row id, increasing. */
|
|
1024
|
+
readonly id: Schema.Int;
|
|
1025
|
+
readonly requestId: Schema.String;
|
|
1026
|
+
/** The `lcl_` id the request was sent with; shared by every target and retry of one send. */
|
|
1027
|
+
readonly localId: Schema.String;
|
|
1028
|
+
readonly sessionId: Schema.String;
|
|
1029
|
+
/** The listener's name when the result was recorded. */
|
|
1030
|
+
readonly listener: Schema.String;
|
|
1031
|
+
readonly target: Schema.String;
|
|
1032
|
+
readonly kind: Schema.Literals<readonly ["live", "replay", "resume"]>;
|
|
1033
|
+
/** 1 for the first try; higher after `--retries` on connection refused. */
|
|
1034
|
+
readonly attempt: Schema.Int;
|
|
1035
|
+
/** `null` when no response arrived (`error` says why). */
|
|
1036
|
+
readonly statusCode: Schema.NullOr<Schema.Int>;
|
|
1037
|
+
readonly error: Schema.NullOr<Schema.String>;
|
|
1038
|
+
readonly durationMs: Schema.Int;
|
|
1039
|
+
/** When the SourceDO recorded the result. */
|
|
1040
|
+
readonly at: Schema.Int;
|
|
1041
|
+
}>>, never>;
|
|
1042
|
+
}>;
|
|
1043
|
+
type RequestDetail = typeof RequestDetail.Type;
|
|
1044
|
+
/** One rejected request: metadata only, no body and no credentials (§5.4). */
|
|
1045
|
+
declare const RejectionRecord: Schema.Struct<{
|
|
1046
|
+
readonly at: Schema.Int;
|
|
1047
|
+
readonly reason: Schema.Literals<readonly ["missing_signature", "malformed", "bad_signature", "missing_timestamp", "timestamp_out_of_tolerance", "missing_id", "no_secrets", "missing_token", "bad_token", "unverified_not_allowed", "jwt_missing", "jwt_malformed", "jwt_unsupported_alg", "jwt_unknown_kid", "jwt_bad_signature", "jwt_expired", "jwt_not_yet_valid", "jwt_bad_issuer", "jwt_bad_audience", "jwt_claim_mismatch", "jwks_unavailable"]>;
|
|
1048
|
+
readonly verifyRevision: Schema.Int;
|
|
1049
|
+
readonly remoteIp: Schema.NullOr<Schema.String>;
|
|
1050
|
+
readonly userAgent: Schema.NullOr<Schema.String>;
|
|
1051
|
+
readonly contentLength: Schema.NullOr<Schema.Int>;
|
|
1052
|
+
/** Lowercase names of the headers sent, never their values. */
|
|
1053
|
+
readonly headerNames: Schema.$Array<Schema.String>;
|
|
1054
|
+
}>;
|
|
1055
|
+
type RejectionRecord = typeof RejectionRecord.Type;
|
|
1056
|
+
declare const RejectionCounter: Schema.Struct<{
|
|
1057
|
+
/** Start of the minute. */
|
|
1058
|
+
readonly minute: Schema.Int;
|
|
1059
|
+
readonly reason: Schema.Literals<readonly ["missing_signature", "malformed", "bad_signature", "missing_timestamp", "timestamp_out_of_tolerance", "missing_id", "no_secrets", "missing_token", "bad_token", "unverified_not_allowed", "jwt_missing", "jwt_malformed", "jwt_unsupported_alg", "jwt_unknown_kid", "jwt_bad_signature", "jwt_expired", "jwt_not_yet_valid", "jwt_bad_issuer", "jwt_bad_audience", "jwt_claim_mismatch", "jwks_unavailable"]>;
|
|
1060
|
+
readonly count: Schema.Int;
|
|
1061
|
+
}>;
|
|
1062
|
+
type RejectionCounter = typeof RejectionCounter.Type;
|
|
1063
|
+
declare const Rejections: Schema.Struct<{
|
|
1064
|
+
/** Newest first, at most `LIMITS.rejectionRing`. */
|
|
1065
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
1066
|
+
readonly at: Schema.Int;
|
|
1067
|
+
readonly reason: Schema.Literals<readonly ["missing_signature", "malformed", "bad_signature", "missing_timestamp", "timestamp_out_of_tolerance", "missing_id", "no_secrets", "missing_token", "bad_token", "unverified_not_allowed", "jwt_missing", "jwt_malformed", "jwt_unsupported_alg", "jwt_unknown_kid", "jwt_bad_signature", "jwt_expired", "jwt_not_yet_valid", "jwt_bad_issuer", "jwt_bad_audience", "jwt_claim_mismatch", "jwks_unavailable"]>;
|
|
1068
|
+
readonly verifyRevision: Schema.Int;
|
|
1069
|
+
readonly remoteIp: Schema.NullOr<Schema.String>;
|
|
1070
|
+
readonly userAgent: Schema.NullOr<Schema.String>;
|
|
1071
|
+
readonly contentLength: Schema.NullOr<Schema.Int>;
|
|
1072
|
+
/** Lowercase names of the headers sent, never their values. */
|
|
1073
|
+
readonly headerNames: Schema.$Array<Schema.String>;
|
|
1074
|
+
}>>;
|
|
1075
|
+
/** Per-minute counts, newest first. */
|
|
1076
|
+
readonly counters: Schema.$Array<Schema.Struct<{
|
|
1077
|
+
/** Start of the minute. */
|
|
1078
|
+
readonly minute: Schema.Int;
|
|
1079
|
+
readonly reason: Schema.Literals<readonly ["missing_signature", "malformed", "bad_signature", "missing_timestamp", "timestamp_out_of_tolerance", "missing_id", "no_secrets", "missing_token", "bad_token", "unverified_not_allowed", "jwt_missing", "jwt_malformed", "jwt_unsupported_alg", "jwt_unknown_kid", "jwt_bad_signature", "jwt_expired", "jwt_not_yet_valid", "jwt_bad_issuer", "jwt_bad_audience", "jwt_claim_mismatch", "jwks_unavailable"]>;
|
|
1080
|
+
readonly count: Schema.Int;
|
|
1081
|
+
}>>;
|
|
1082
|
+
}>;
|
|
1083
|
+
type Rejections = typeof Rejections.Type;
|
|
1084
|
+
/** The numbers of §9.3 for one source. */
|
|
1085
|
+
declare const SourceStats: Schema.Struct<{
|
|
1086
|
+
readonly sourceKey: Schema.String;
|
|
1087
|
+
readonly generatedAt: Schema.Int;
|
|
1088
|
+
readonly requests: Schema.Struct<{
|
|
1089
|
+
readonly accepted: Schema.Int;
|
|
1090
|
+
readonly duplicate: Schema.Int;
|
|
1091
|
+
readonly unrouted: Schema.Int;
|
|
1092
|
+
}>;
|
|
1093
|
+
readonly deliveries: Schema.Struct<{
|
|
1094
|
+
readonly pending: Schema.Int;
|
|
1095
|
+
readonly dispatched: Schema.Int;
|
|
1096
|
+
readonly running: Schema.Int;
|
|
1097
|
+
readonly succeeded: Schema.Int;
|
|
1098
|
+
readonly failed: Schema.Int;
|
|
1099
|
+
readonly cancelled: Schema.Int;
|
|
1100
|
+
/** Pending on a paused route (included in `pending`). */
|
|
1101
|
+
readonly held: Schema.Int;
|
|
1102
|
+
}>;
|
|
1103
|
+
readonly oldestPendingAt: Schema.NullOr<Schema.Int>;
|
|
1104
|
+
readonly oldestPendingAgeMs: Schema.NullOr<Schema.Int>;
|
|
1105
|
+
/** Pending on unpaused routes with `dueAt` in the past. */
|
|
1106
|
+
readonly overdue: Schema.Int;
|
|
1107
|
+
readonly alarm: Schema.Struct<{
|
|
1108
|
+
readonly scheduledAt: Schema.NullOr<Schema.Int>;
|
|
1109
|
+
readonly overdue: Schema.Boolean;
|
|
1110
|
+
}>;
|
|
1111
|
+
readonly storage: Schema.Struct<{
|
|
1112
|
+
readonly sqliteBytes: Schema.Int;
|
|
1113
|
+
readonly limitBytes: Schema.Int;
|
|
1114
|
+
}>;
|
|
1115
|
+
/** Rejections in the last hour, by reason. Reasons with no rejections are omitted. */
|
|
1116
|
+
readonly rejectionsLastHour: Schema.$Record<Schema.String, Schema.Int>;
|
|
1117
|
+
readonly routes: Schema.$Array<Schema.Struct<{
|
|
1118
|
+
readonly routeId: Schema.String;
|
|
1119
|
+
readonly consecutiveFailures: Schema.Int;
|
|
1120
|
+
readonly paused: Schema.Boolean;
|
|
1121
|
+
readonly pausedAt: Schema.NullOr<Schema.Int>;
|
|
1122
|
+
readonly pauseReason: Schema.NullOr<Schema.Literals<readonly ["manual", "consecutive_failures"]>>;
|
|
1123
|
+
}>>;
|
|
1124
|
+
}>;
|
|
1125
|
+
type SourceStats = typeof SourceStats.Type;
|
|
1126
|
+
declare const AuditAction: Schema.Literals<readonly ["source.create", "source.update", "source.delete", "source.secret.add", "source.secret.remove", "relay.create", "relay.update", "relay.delete", "relay.rotate_secret", "route.create", "route.update", "route.delete", "route.pause", "route.resume", "config.apply", "request.body_read", "request.replay", "request.replay_range", "delivery.retry", "delivery.cancel", "maintenance.reencrypt", "listener.connect", "listener.disconnect", "listener.send", "listen_token.create", "listen_token.revoke"]>;
|
|
1127
|
+
type AuditAction = typeof AuditAction.Type;
|
|
1128
|
+
declare const AuditRecord: Schema.Struct<{
|
|
1129
|
+
readonly id: Schema.Int;
|
|
1130
|
+
readonly at: Schema.Int;
|
|
1131
|
+
/** `token`; `access:<email>` for a Cloudflare Access identity; `listen:<tokenId>` for a listen token; `system`. */
|
|
1132
|
+
readonly actor: Schema.String;
|
|
1133
|
+
readonly action: Schema.Literals<readonly ["source.create", "source.update", "source.delete", "source.secret.add", "source.secret.remove", "relay.create", "relay.update", "relay.delete", "relay.rotate_secret", "route.create", "route.update", "route.delete", "route.pause", "route.resume", "config.apply", "request.body_read", "request.replay", "request.replay_range", "delivery.retry", "delivery.cancel", "maintenance.reencrypt", "listener.connect", "listener.disconnect", "listener.send", "listen_token.create", "listen_token.revoke"]>;
|
|
1134
|
+
/** What was acted on: a source key, relay or route id, request or delivery id. */
|
|
1135
|
+
readonly target: Schema.String;
|
|
1136
|
+
/** Small structured context. Never secrets. */
|
|
1137
|
+
readonly detail: Schema.NullOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
1138
|
+
}>;
|
|
1139
|
+
type AuditRecord = typeof AuditRecord.Type;
|
|
1140
|
+
/** The default `202` body for an accepted webhook. An `unrouted` request answers `accepted`. */
|
|
1141
|
+
declare const IngestAck: Schema.Struct<{
|
|
1142
|
+
readonly id: Schema.String;
|
|
1143
|
+
readonly status: Schema.Literals<readonly ["accepted", "duplicate"]>;
|
|
1144
|
+
}>;
|
|
1145
|
+
type IngestAck = typeof IngestAck.Type;
|
|
1146
|
+
declare const ErrorCode: Schema.Literals<readonly ["bad_request", "unauthorized", "not_found", "conflict", "payload_too_large", "unavailable"]>;
|
|
1147
|
+
type ErrorCode = typeof ErrorCode.Type;
|
|
1148
|
+
/** Every error body, from the admin API and from ingest: `{ error: { code, message } }`. */
|
|
1149
|
+
declare const ErrorBody: Schema.Struct<{
|
|
1150
|
+
readonly error: Schema.Struct<{
|
|
1151
|
+
readonly code: Schema.Literals<readonly ["bad_request", "unauthorized", "not_found", "conflict", "payload_too_large", "unavailable"]>;
|
|
1152
|
+
readonly message: Schema.String;
|
|
1153
|
+
}>;
|
|
1154
|
+
}>;
|
|
1155
|
+
type ErrorBody = typeof ErrorBody.Type;
|
|
1156
|
+
declare const ERROR_STATUS: Record<ErrorCode, number>;
|
|
1157
|
+
/** `{ items, nextCursor }`; `nextCursor` is opaque and `null` on the last page. */
|
|
1158
|
+
declare const Page: <S extends Schema.Top>(item: S) => Schema.Struct<{
|
|
1159
|
+
readonly items: Schema.$Array<S>;
|
|
1160
|
+
readonly nextCursor: Schema.NullOr<Schema.String>;
|
|
1161
|
+
}>;
|
|
1162
|
+
declare const SourceView: Schema.Struct<{
|
|
1163
|
+
readonly key: Schema.String;
|
|
1164
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
1165
|
+
readonly preset: Schema.Literals<readonly ["github", "stripe", "slack", "shopify", "gitlab", "linear", "standard-webhooks", "google-oidc", "hmac", "bearer", "none"]>;
|
|
1166
|
+
readonly enabled: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
1167
|
+
readonly allowUnverified: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
1168
|
+
readonly verify: Schema.optionalKey<Schema.Struct<{
|
|
1169
|
+
readonly type: Schema.optionalKey<Schema.Literals<readonly ["hmac", "token", "jwt", "none"]>>;
|
|
1170
|
+
readonly header: Schema.optionalKey<Schema.String>;
|
|
1171
|
+
readonly algorithm: Schema.optionalKey<Schema.Literals<readonly ["sha1", "sha256", "sha512"]>>;
|
|
1172
|
+
readonly encoding: Schema.optionalKey<Schema.Literals<readonly ["hex", "base64"]>>;
|
|
1173
|
+
readonly format: Schema.optionalKey<Schema.Literals<readonly ["plain", "prefixed", "kv-list", "space-list"]>>;
|
|
1174
|
+
readonly prefix: Schema.optionalKey<Schema.String>;
|
|
1175
|
+
readonly key: Schema.optionalKey<Schema.String>;
|
|
1176
|
+
readonly payload: Schema.optionalKey<Schema.String>;
|
|
1177
|
+
readonly timestamp: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
1178
|
+
readonly header: Schema.String;
|
|
1179
|
+
}>, Schema.Struct<{
|
|
1180
|
+
readonly signatureKey: Schema.String;
|
|
1181
|
+
}>]>>;
|
|
1182
|
+
readonly id: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
1183
|
+
readonly header: Schema.String;
|
|
1184
|
+
}>, Schema.Struct<{
|
|
1185
|
+
readonly signatureKey: Schema.String;
|
|
1186
|
+
}>]>>;
|
|
1187
|
+
readonly tolerance: Schema.optionalKey<Schema.Struct<{
|
|
1188
|
+
readonly pastSeconds: Schema.optionalKey<Schema.Int>;
|
|
1189
|
+
readonly futureSeconds: Schema.optionalKey<Schema.Int>;
|
|
1190
|
+
}>>;
|
|
1191
|
+
readonly secretEncoding: Schema.optionalKey<Schema.Literals<readonly ["utf8", "base64", "whsec"]>>;
|
|
1192
|
+
readonly scheme: Schema.optionalKey<Schema.String>;
|
|
1193
|
+
readonly jwksUrl: Schema.optionalKey<Schema.String>;
|
|
1194
|
+
readonly algorithms: Schema.optionalKey<Schema.NonEmptyArray<Schema.Literals<readonly ["RS256", "ES256"]>>>;
|
|
1195
|
+
readonly issuer: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.NonEmptyArray<Schema.String>]>>;
|
|
1196
|
+
readonly audience: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.NonEmptyArray<Schema.String>]>>;
|
|
1197
|
+
readonly claims: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>>]>>>;
|
|
1198
|
+
readonly clockToleranceSeconds: Schema.optionalKey<Schema.Int>;
|
|
1199
|
+
}>>;
|
|
1200
|
+
readonly eventType: Schema.optionalKey<Schema.Struct<{
|
|
1201
|
+
readonly from: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
1202
|
+
readonly header: Schema.String;
|
|
1203
|
+
}>, Schema.Struct<{
|
|
1204
|
+
readonly body: Schema.String;
|
|
1205
|
+
}>]>>;
|
|
1206
|
+
readonly suffix: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
1207
|
+
readonly header: Schema.String;
|
|
1208
|
+
}>, Schema.Struct<{
|
|
1209
|
+
readonly body: Schema.String;
|
|
1210
|
+
}>]>>;
|
|
1211
|
+
}>>;
|
|
1212
|
+
readonly idempotencyKey: Schema.optionalKey<Schema.Struct<{
|
|
1213
|
+
readonly from: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
1214
|
+
readonly header: Schema.String;
|
|
1215
|
+
}>, Schema.Struct<{
|
|
1216
|
+
readonly body: Schema.String;
|
|
1217
|
+
}>]>>;
|
|
1218
|
+
readonly suffix: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
1219
|
+
readonly header: Schema.String;
|
|
1220
|
+
}>, Schema.Struct<{
|
|
1221
|
+
readonly body: Schema.String;
|
|
1222
|
+
}>]>>;
|
|
1223
|
+
}>>;
|
|
1224
|
+
readonly handshake: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
1225
|
+
readonly type: Schema.Literal<"json-challenge">;
|
|
1226
|
+
readonly path: Schema.String;
|
|
1227
|
+
readonly equals: Schema.String;
|
|
1228
|
+
readonly challenge: Schema.String;
|
|
1229
|
+
}>]>>;
|
|
1230
|
+
readonly response: Schema.optionalKey<Schema.Struct<{
|
|
1231
|
+
readonly status: Schema.Int;
|
|
1232
|
+
readonly body: Schema.optionalKey<Schema.String>;
|
|
1233
|
+
readonly contentType: Schema.optionalKey<Schema.String>;
|
|
1234
|
+
}>>;
|
|
1235
|
+
readonly redactHeaders: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
|
|
1236
|
+
readonly dedupeWindowSeconds: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
1237
|
+
readonly maxBodyBytes: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
1238
|
+
readonly retentionDays: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
1239
|
+
readonly listeners: Schema.withDecodingDefaultKey<Schema.Literals<readonly ["on", "off"]>, never>;
|
|
1240
|
+
readonly revision: Schema.Int;
|
|
1241
|
+
readonly managed: Schema.Boolean;
|
|
1242
|
+
readonly createdAt: Schema.Int;
|
|
1243
|
+
readonly updatedAt: Schema.Int;
|
|
1244
|
+
/** Bumped whenever verification config or secrets change. */
|
|
1245
|
+
readonly verifyRevision: Schema.Int;
|
|
1246
|
+
readonly secrets: Schema.$Array<Schema.Struct<{
|
|
1247
|
+
readonly fingerprint: Schema.String;
|
|
1248
|
+
readonly addedAt: Schema.Int;
|
|
1249
|
+
}>>;
|
|
1250
|
+
/** `/in/{key}`; prefix with the service origin for the full ingest URL. */
|
|
1251
|
+
readonly ingestPath: Schema.String;
|
|
1252
|
+
/** The preset merged with this source's overrides. */
|
|
1253
|
+
readonly effective: Schema.Struct<{
|
|
1254
|
+
readonly verify: Schema.Union<readonly [Schema.Struct<{
|
|
1255
|
+
readonly type: Schema.Literal<"hmac">;
|
|
1256
|
+
readonly algorithm: Schema.withDecodingDefaultKey<Schema.Literals<readonly ["sha1", "sha256", "sha512"]>, never>;
|
|
1257
|
+
readonly header: Schema.String;
|
|
1258
|
+
readonly encoding: Schema.withDecodingDefaultKey<Schema.Literals<readonly ["hex", "base64"]>, never>;
|
|
1259
|
+
readonly format: Schema.withDecodingDefaultKey<Schema.Literals<readonly ["plain", "prefixed", "kv-list", "space-list"]>, never>;
|
|
1260
|
+
readonly prefix: Schema.optionalKey<Schema.String>;
|
|
1261
|
+
readonly key: Schema.optionalKey<Schema.String>;
|
|
1262
|
+
readonly payload: Schema.withDecodingDefaultKey<Schema.String, never>;
|
|
1263
|
+
readonly timestamp: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
1264
|
+
readonly header: Schema.String;
|
|
1265
|
+
}>, Schema.Struct<{
|
|
1266
|
+
readonly signatureKey: Schema.String;
|
|
1267
|
+
}>]>>;
|
|
1268
|
+
readonly id: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
1269
|
+
readonly header: Schema.String;
|
|
1270
|
+
}>, Schema.Struct<{
|
|
1271
|
+
readonly signatureKey: Schema.String;
|
|
1272
|
+
}>]>>;
|
|
1273
|
+
/** Applies only when a timestamp source is set. */
|
|
1274
|
+
readonly tolerance: Schema.withDecodingDefaultKey<Schema.Struct<{
|
|
1275
|
+
readonly pastSeconds: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
1276
|
+
readonly futureSeconds: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
1277
|
+
}>, never>;
|
|
1278
|
+
readonly secretEncoding: Schema.withDecodingDefaultKey<Schema.Literals<readonly ["utf8", "base64", "whsec"]>, never>;
|
|
1279
|
+
}>, Schema.Struct<{
|
|
1280
|
+
readonly type: Schema.Literal<"token">;
|
|
1281
|
+
readonly header: Schema.String;
|
|
1282
|
+
/** When set (e.g. `Bearer`), the header must be `{scheme} {token}`; the scheme matches case-insensitively. */
|
|
1283
|
+
readonly scheme: Schema.optionalKey<Schema.String>;
|
|
1284
|
+
}>, Schema.Struct<{
|
|
1285
|
+
readonly type: Schema.Literal<"jwt">;
|
|
1286
|
+
readonly header: Schema.withDecodingDefaultKey<Schema.String, never>;
|
|
1287
|
+
readonly scheme: Schema.optionalKey<Schema.String>;
|
|
1288
|
+
readonly jwksUrl: Schema.String;
|
|
1289
|
+
readonly algorithms: Schema.withDecodingDefaultKey<Schema.NonEmptyArray<Schema.Literals<readonly ["RS256", "ES256"]>>, never>;
|
|
1290
|
+
/** Accepted `iss` values. */
|
|
1291
|
+
readonly issuer: Schema.Union<readonly [Schema.String, Schema.NonEmptyArray<Schema.String>]>;
|
|
1292
|
+
/** Accepted `aud` values; the token must carry at least one. */
|
|
1293
|
+
readonly audience: Schema.Union<readonly [Schema.String, Schema.NonEmptyArray<Schema.String>]>;
|
|
1294
|
+
readonly claims: Schema.withDecodingDefaultKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>>]>>, never>;
|
|
1295
|
+
readonly clockToleranceSeconds: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
1296
|
+
}>, Schema.Struct<{
|
|
1297
|
+
readonly type: Schema.Literal<"none">;
|
|
1298
|
+
}>]>;
|
|
1299
|
+
readonly eventType: Schema.NullOr<Schema.Struct<{
|
|
1300
|
+
readonly from: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
1301
|
+
readonly header: Schema.String;
|
|
1302
|
+
}>, Schema.Struct<{
|
|
1303
|
+
readonly body: Schema.String;
|
|
1304
|
+
}>]>>;
|
|
1305
|
+
readonly suffix: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
1306
|
+
readonly header: Schema.String;
|
|
1307
|
+
}>, Schema.Struct<{
|
|
1308
|
+
readonly body: Schema.String;
|
|
1309
|
+
}>]>>;
|
|
1310
|
+
}>>;
|
|
1311
|
+
readonly idempotencyKey: Schema.NullOr<Schema.Struct<{
|
|
1312
|
+
readonly from: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
1313
|
+
readonly header: Schema.String;
|
|
1314
|
+
}>, Schema.Struct<{
|
|
1315
|
+
readonly body: Schema.String;
|
|
1316
|
+
}>]>>;
|
|
1317
|
+
readonly suffix: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
1318
|
+
readonly header: Schema.String;
|
|
1319
|
+
}>, Schema.Struct<{
|
|
1320
|
+
readonly body: Schema.String;
|
|
1321
|
+
}>]>>;
|
|
1322
|
+
}>>;
|
|
1323
|
+
readonly handshake: Schema.NullOr<Schema.Union<readonly [Schema.Struct<{
|
|
1324
|
+
readonly type: Schema.Literal<"json-challenge">;
|
|
1325
|
+
readonly path: Schema.String;
|
|
1326
|
+
readonly equals: Schema.String;
|
|
1327
|
+
readonly challenge: Schema.String;
|
|
1328
|
+
}>]>>;
|
|
1329
|
+
readonly response: Schema.NullOr<Schema.Struct<{
|
|
1330
|
+
readonly status: Schema.Int;
|
|
1331
|
+
readonly body: Schema.optionalKey<Schema.String>;
|
|
1332
|
+
readonly contentType: Schema.optionalKey<Schema.String>;
|
|
1333
|
+
}>>;
|
|
1334
|
+
/** Preset, source and credential headers; stored as `[redacted:…]` and never forwarded. */
|
|
1335
|
+
readonly redactHeaders: Schema.$Array<Schema.String>;
|
|
1336
|
+
}>;
|
|
1337
|
+
}>;
|
|
1338
|
+
type SourceView = typeof SourceView.Type;
|
|
1339
|
+
declare const RelayView: Schema.Struct<{
|
|
1340
|
+
readonly name: Schema.String;
|
|
1341
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
1342
|
+
readonly url: Schema.String;
|
|
1343
|
+
readonly headers: Schema.withDecodingDefaultKey<Schema.$Record<Schema.String, Schema.String>, never>;
|
|
1344
|
+
readonly timeoutMs: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
1345
|
+
readonly retry: Schema.withDecodingDefaultKey<Schema.Struct<{
|
|
1346
|
+
readonly strategy: Schema.withDecodingDefaultKey<Schema.Literals<readonly ["exponential", "linear"]>, never>;
|
|
1347
|
+
readonly baseSeconds: Schema.withDecodingDefaultKey<Schema.Finite, never>;
|
|
1348
|
+
readonly factor: Schema.withDecodingDefaultKey<Schema.Finite, never>;
|
|
1349
|
+
readonly capSeconds: Schema.withDecodingDefaultKey<Schema.Finite, never>;
|
|
1350
|
+
readonly maxAttempts: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
1351
|
+
/** Fraction of the delay added or removed at random: 0.2 is ±20%. */
|
|
1352
|
+
readonly jitter: Schema.withDecodingDefaultKey<Schema.Finite, never>;
|
|
1353
|
+
}>, never>;
|
|
1354
|
+
readonly signing: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
1355
|
+
readonly revision: Schema.Int;
|
|
1356
|
+
readonly managed: Schema.Boolean;
|
|
1357
|
+
readonly createdAt: Schema.Int;
|
|
1358
|
+
readonly updatedAt: Schema.Int;
|
|
1359
|
+
readonly id: Schema.String;
|
|
1360
|
+
readonly secretHeaders: Schema.$Array<Schema.Struct<{
|
|
1361
|
+
readonly name: Schema.String;
|
|
1362
|
+
readonly fingerprint: Schema.String;
|
|
1363
|
+
}>>;
|
|
1364
|
+
/** The current signing secret first; a rotated-out one while it still signs. Empty when `signing` is off. */
|
|
1365
|
+
readonly signingSecrets: Schema.$Array<Schema.Struct<{
|
|
1366
|
+
readonly fingerprint: Schema.String;
|
|
1367
|
+
readonly createdAt: Schema.Int;
|
|
1368
|
+
/** Set on the previous secret after a rotation. */
|
|
1369
|
+
readonly expiresAt: Schema.NullOr<Schema.Int>;
|
|
1370
|
+
}>>;
|
|
1371
|
+
}>;
|
|
1372
|
+
type RelayView = typeof RelayView.Type;
|
|
1373
|
+
declare const RouteView: Schema.Struct<{
|
|
1374
|
+
readonly source: Schema.String;
|
|
1375
|
+
readonly relay: Schema.String;
|
|
1376
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
1377
|
+
readonly eventTypes: Schema.withDecodingDefaultKey<Schema.NonEmptyArray<Schema.String>, never>;
|
|
1378
|
+
readonly enabled: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
1379
|
+
readonly autoPauseThreshold: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
1380
|
+
readonly revision: Schema.Int;
|
|
1381
|
+
readonly managed: Schema.Boolean;
|
|
1382
|
+
readonly createdAt: Schema.Int;
|
|
1383
|
+
readonly updatedAt: Schema.Int;
|
|
1384
|
+
readonly id: Schema.String;
|
|
1385
|
+
/** From the source's SourceDO; `null` when it could not be read. */
|
|
1386
|
+
readonly state: Schema.NullOr<Schema.Struct<{
|
|
1387
|
+
readonly routeId: Schema.String;
|
|
1388
|
+
readonly consecutiveFailures: Schema.Int;
|
|
1389
|
+
readonly paused: Schema.Boolean;
|
|
1390
|
+
readonly pausedAt: Schema.NullOr<Schema.Int>;
|
|
1391
|
+
readonly pauseReason: Schema.NullOr<Schema.Literals<readonly ["manual", "consecutive_failures"]>>;
|
|
1392
|
+
}>>;
|
|
1393
|
+
}>;
|
|
1394
|
+
type RouteView = typeof RouteView.Type;
|
|
1395
|
+
declare const ConfigSource: Schema.Struct<{
|
|
1396
|
+
readonly key: Schema.String;
|
|
1397
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
1398
|
+
readonly preset: Schema.Literals<readonly ["github", "stripe", "slack", "shopify", "gitlab", "linear", "standard-webhooks", "google-oidc", "hmac", "bearer", "none"]>;
|
|
1399
|
+
readonly enabled: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
1400
|
+
readonly allowUnverified: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
1401
|
+
readonly verify: Schema.optionalKey<Schema.Struct<{
|
|
1402
|
+
readonly type: Schema.optionalKey<Schema.Literals<readonly ["hmac", "token", "jwt", "none"]>>;
|
|
1403
|
+
readonly header: Schema.optionalKey<Schema.String>;
|
|
1404
|
+
readonly algorithm: Schema.optionalKey<Schema.Literals<readonly ["sha1", "sha256", "sha512"]>>;
|
|
1405
|
+
readonly encoding: Schema.optionalKey<Schema.Literals<readonly ["hex", "base64"]>>;
|
|
1406
|
+
readonly format: Schema.optionalKey<Schema.Literals<readonly ["plain", "prefixed", "kv-list", "space-list"]>>;
|
|
1407
|
+
readonly prefix: Schema.optionalKey<Schema.String>;
|
|
1408
|
+
readonly key: Schema.optionalKey<Schema.String>;
|
|
1409
|
+
readonly payload: Schema.optionalKey<Schema.String>;
|
|
1410
|
+
readonly timestamp: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
1411
|
+
readonly header: Schema.String;
|
|
1412
|
+
}>, Schema.Struct<{
|
|
1413
|
+
readonly signatureKey: Schema.String;
|
|
1414
|
+
}>]>>;
|
|
1415
|
+
readonly id: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
1416
|
+
readonly header: Schema.String;
|
|
1417
|
+
}>, Schema.Struct<{
|
|
1418
|
+
readonly signatureKey: Schema.String;
|
|
1419
|
+
}>]>>;
|
|
1420
|
+
readonly tolerance: Schema.optionalKey<Schema.Struct<{
|
|
1421
|
+
readonly pastSeconds: Schema.optionalKey<Schema.Int>;
|
|
1422
|
+
readonly futureSeconds: Schema.optionalKey<Schema.Int>;
|
|
1423
|
+
}>>;
|
|
1424
|
+
readonly secretEncoding: Schema.optionalKey<Schema.Literals<readonly ["utf8", "base64", "whsec"]>>;
|
|
1425
|
+
readonly scheme: Schema.optionalKey<Schema.String>;
|
|
1426
|
+
readonly jwksUrl: Schema.optionalKey<Schema.String>;
|
|
1427
|
+
readonly algorithms: Schema.optionalKey<Schema.NonEmptyArray<Schema.Literals<readonly ["RS256", "ES256"]>>>;
|
|
1428
|
+
readonly issuer: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.NonEmptyArray<Schema.String>]>>;
|
|
1429
|
+
readonly audience: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.NonEmptyArray<Schema.String>]>>;
|
|
1430
|
+
readonly claims: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>>]>>>;
|
|
1431
|
+
readonly clockToleranceSeconds: Schema.optionalKey<Schema.Int>;
|
|
1432
|
+
}>>;
|
|
1433
|
+
readonly eventType: Schema.optionalKey<Schema.Struct<{
|
|
1434
|
+
readonly from: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
1435
|
+
readonly header: Schema.String;
|
|
1436
|
+
}>, Schema.Struct<{
|
|
1437
|
+
readonly body: Schema.String;
|
|
1438
|
+
}>]>>;
|
|
1439
|
+
readonly suffix: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
1440
|
+
readonly header: Schema.String;
|
|
1441
|
+
}>, Schema.Struct<{
|
|
1442
|
+
readonly body: Schema.String;
|
|
1443
|
+
}>]>>;
|
|
1444
|
+
}>>;
|
|
1445
|
+
readonly idempotencyKey: Schema.optionalKey<Schema.Struct<{
|
|
1446
|
+
readonly from: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
1447
|
+
readonly header: Schema.String;
|
|
1448
|
+
}>, Schema.Struct<{
|
|
1449
|
+
readonly body: Schema.String;
|
|
1450
|
+
}>]>>;
|
|
1451
|
+
readonly suffix: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
1452
|
+
readonly header: Schema.String;
|
|
1453
|
+
}>, Schema.Struct<{
|
|
1454
|
+
readonly body: Schema.String;
|
|
1455
|
+
}>]>>;
|
|
1456
|
+
}>>;
|
|
1457
|
+
readonly handshake: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
1458
|
+
readonly type: Schema.Literal<"json-challenge">;
|
|
1459
|
+
readonly path: Schema.String;
|
|
1460
|
+
readonly equals: Schema.String;
|
|
1461
|
+
readonly challenge: Schema.String;
|
|
1462
|
+
}>]>>;
|
|
1463
|
+
readonly response: Schema.optionalKey<Schema.Struct<{
|
|
1464
|
+
readonly status: Schema.Int;
|
|
1465
|
+
readonly body: Schema.optionalKey<Schema.String>;
|
|
1466
|
+
readonly contentType: Schema.optionalKey<Schema.String>;
|
|
1467
|
+
}>>;
|
|
1468
|
+
readonly redactHeaders: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
|
|
1469
|
+
readonly dedupeWindowSeconds: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
1470
|
+
readonly maxBodyBytes: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
1471
|
+
readonly retentionDays: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
1472
|
+
readonly listeners: Schema.withDecodingDefaultKey<Schema.Literals<readonly ["on", "off"]>, never>;
|
|
1473
|
+
/** The complete set of verification secrets (read from the environment). */
|
|
1474
|
+
readonly secrets: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
|
|
1475
|
+
}>;
|
|
1476
|
+
type ConfigSource = typeof ConfigSource.Type;
|
|
1477
|
+
declare const ConfigRelay: Schema.Struct<{
|
|
1478
|
+
readonly name: Schema.String;
|
|
1479
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
1480
|
+
readonly url: Schema.String;
|
|
1481
|
+
readonly headers: Schema.withDecodingDefaultKey<Schema.$Record<Schema.String, Schema.String>, never>;
|
|
1482
|
+
readonly timeoutMs: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
1483
|
+
readonly retry: Schema.withDecodingDefaultKey<Schema.Struct<{
|
|
1484
|
+
readonly strategy: Schema.withDecodingDefaultKey<Schema.Literals<readonly ["exponential", "linear"]>, never>;
|
|
1485
|
+
readonly baseSeconds: Schema.withDecodingDefaultKey<Schema.Finite, never>;
|
|
1486
|
+
readonly factor: Schema.withDecodingDefaultKey<Schema.Finite, never>;
|
|
1487
|
+
readonly capSeconds: Schema.withDecodingDefaultKey<Schema.Finite, never>;
|
|
1488
|
+
readonly maxAttempts: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
1489
|
+
/** Fraction of the delay added or removed at random: 0.2 is ±20%. */
|
|
1490
|
+
readonly jitter: Schema.withDecodingDefaultKey<Schema.Finite, never>;
|
|
1491
|
+
}>, never>;
|
|
1492
|
+
readonly signing: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
1493
|
+
/** The complete set of secret extra headers. */
|
|
1494
|
+
readonly secretHeaders: Schema.withDecodingDefaultKey<Schema.$Record<Schema.String, Schema.String>, never>;
|
|
1495
|
+
}>;
|
|
1496
|
+
type ConfigRelay = typeof ConfigRelay.Type;
|
|
1497
|
+
/** A route in a config file. Identity is `(source, relay)`; `relay` names a relay by its `name`. */
|
|
1498
|
+
declare const ConfigRoute: Schema.Struct<{
|
|
1499
|
+
readonly source: Schema.String;
|
|
1500
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
1501
|
+
readonly eventTypes: Schema.withDecodingDefaultKey<Schema.NonEmptyArray<Schema.String>, never>;
|
|
1502
|
+
readonly enabled: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
1503
|
+
readonly autoPauseThreshold: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
1504
|
+
readonly relay: Schema.String;
|
|
1505
|
+
}>;
|
|
1506
|
+
type ConfigRoute = typeof ConfigRoute.Type;
|
|
1507
|
+
declare const ConfigDocument: Schema.Struct<{
|
|
1508
|
+
readonly sources: Schema.withDecodingDefaultKey<Schema.$Array<Schema.Struct<{
|
|
1509
|
+
readonly key: Schema.String;
|
|
1510
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
1511
|
+
readonly preset: Schema.Literals<readonly ["github", "stripe", "slack", "shopify", "gitlab", "linear", "standard-webhooks", "google-oidc", "hmac", "bearer", "none"]>;
|
|
1512
|
+
readonly enabled: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
1513
|
+
readonly allowUnverified: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
1514
|
+
readonly verify: Schema.optionalKey<Schema.Struct<{
|
|
1515
|
+
readonly type: Schema.optionalKey<Schema.Literals<readonly ["hmac", "token", "jwt", "none"]>>;
|
|
1516
|
+
readonly header: Schema.optionalKey<Schema.String>;
|
|
1517
|
+
readonly algorithm: Schema.optionalKey<Schema.Literals<readonly ["sha1", "sha256", "sha512"]>>;
|
|
1518
|
+
readonly encoding: Schema.optionalKey<Schema.Literals<readonly ["hex", "base64"]>>;
|
|
1519
|
+
readonly format: Schema.optionalKey<Schema.Literals<readonly ["plain", "prefixed", "kv-list", "space-list"]>>;
|
|
1520
|
+
readonly prefix: Schema.optionalKey<Schema.String>;
|
|
1521
|
+
readonly key: Schema.optionalKey<Schema.String>;
|
|
1522
|
+
readonly payload: Schema.optionalKey<Schema.String>;
|
|
1523
|
+
readonly timestamp: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
1524
|
+
readonly header: Schema.String;
|
|
1525
|
+
}>, Schema.Struct<{
|
|
1526
|
+
readonly signatureKey: Schema.String;
|
|
1527
|
+
}>]>>;
|
|
1528
|
+
readonly id: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
1529
|
+
readonly header: Schema.String;
|
|
1530
|
+
}>, Schema.Struct<{
|
|
1531
|
+
readonly signatureKey: Schema.String;
|
|
1532
|
+
}>]>>;
|
|
1533
|
+
readonly tolerance: Schema.optionalKey<Schema.Struct<{
|
|
1534
|
+
readonly pastSeconds: Schema.optionalKey<Schema.Int>;
|
|
1535
|
+
readonly futureSeconds: Schema.optionalKey<Schema.Int>;
|
|
1536
|
+
}>>;
|
|
1537
|
+
readonly secretEncoding: Schema.optionalKey<Schema.Literals<readonly ["utf8", "base64", "whsec"]>>;
|
|
1538
|
+
readonly scheme: Schema.optionalKey<Schema.String>;
|
|
1539
|
+
readonly jwksUrl: Schema.optionalKey<Schema.String>;
|
|
1540
|
+
readonly algorithms: Schema.optionalKey<Schema.NonEmptyArray<Schema.Literals<readonly ["RS256", "ES256"]>>>;
|
|
1541
|
+
readonly issuer: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.NonEmptyArray<Schema.String>]>>;
|
|
1542
|
+
readonly audience: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.NonEmptyArray<Schema.String>]>>;
|
|
1543
|
+
readonly claims: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>>]>>>;
|
|
1544
|
+
readonly clockToleranceSeconds: Schema.optionalKey<Schema.Int>;
|
|
1545
|
+
}>>;
|
|
1546
|
+
readonly eventType: Schema.optionalKey<Schema.Struct<{
|
|
1547
|
+
readonly from: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
1548
|
+
readonly header: Schema.String;
|
|
1549
|
+
}>, Schema.Struct<{
|
|
1550
|
+
readonly body: Schema.String;
|
|
1551
|
+
}>]>>;
|
|
1552
|
+
readonly suffix: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
1553
|
+
readonly header: Schema.String;
|
|
1554
|
+
}>, Schema.Struct<{
|
|
1555
|
+
readonly body: Schema.String;
|
|
1556
|
+
}>]>>;
|
|
1557
|
+
}>>;
|
|
1558
|
+
readonly idempotencyKey: Schema.optionalKey<Schema.Struct<{
|
|
1559
|
+
readonly from: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
1560
|
+
readonly header: Schema.String;
|
|
1561
|
+
}>, Schema.Struct<{
|
|
1562
|
+
readonly body: Schema.String;
|
|
1563
|
+
}>]>>;
|
|
1564
|
+
readonly suffix: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
1565
|
+
readonly header: Schema.String;
|
|
1566
|
+
}>, Schema.Struct<{
|
|
1567
|
+
readonly body: Schema.String;
|
|
1568
|
+
}>]>>;
|
|
1569
|
+
}>>;
|
|
1570
|
+
readonly handshake: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
1571
|
+
readonly type: Schema.Literal<"json-challenge">;
|
|
1572
|
+
readonly path: Schema.String;
|
|
1573
|
+
readonly equals: Schema.String;
|
|
1574
|
+
readonly challenge: Schema.String;
|
|
1575
|
+
}>]>>;
|
|
1576
|
+
readonly response: Schema.optionalKey<Schema.Struct<{
|
|
1577
|
+
readonly status: Schema.Int;
|
|
1578
|
+
readonly body: Schema.optionalKey<Schema.String>;
|
|
1579
|
+
readonly contentType: Schema.optionalKey<Schema.String>;
|
|
1580
|
+
}>>;
|
|
1581
|
+
readonly redactHeaders: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
|
|
1582
|
+
readonly dedupeWindowSeconds: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
1583
|
+
readonly maxBodyBytes: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
1584
|
+
readonly retentionDays: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
1585
|
+
readonly listeners: Schema.withDecodingDefaultKey<Schema.Literals<readonly ["on", "off"]>, never>;
|
|
1586
|
+
/** The complete set of verification secrets (read from the environment). */
|
|
1587
|
+
readonly secrets: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
|
|
1588
|
+
}>>, never>;
|
|
1589
|
+
readonly relays: Schema.withDecodingDefaultKey<Schema.$Array<Schema.Struct<{
|
|
1590
|
+
readonly name: Schema.String;
|
|
1591
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
1592
|
+
readonly url: Schema.String;
|
|
1593
|
+
readonly headers: Schema.withDecodingDefaultKey<Schema.$Record<Schema.String, Schema.String>, never>;
|
|
1594
|
+
readonly timeoutMs: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
1595
|
+
readonly retry: Schema.withDecodingDefaultKey<Schema.Struct<{
|
|
1596
|
+
readonly strategy: Schema.withDecodingDefaultKey<Schema.Literals<readonly ["exponential", "linear"]>, never>;
|
|
1597
|
+
readonly baseSeconds: Schema.withDecodingDefaultKey<Schema.Finite, never>;
|
|
1598
|
+
readonly factor: Schema.withDecodingDefaultKey<Schema.Finite, never>;
|
|
1599
|
+
readonly capSeconds: Schema.withDecodingDefaultKey<Schema.Finite, never>;
|
|
1600
|
+
readonly maxAttempts: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
1601
|
+
/** Fraction of the delay added or removed at random: 0.2 is ±20%. */
|
|
1602
|
+
readonly jitter: Schema.withDecodingDefaultKey<Schema.Finite, never>;
|
|
1603
|
+
}>, never>;
|
|
1604
|
+
readonly signing: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
1605
|
+
/** The complete set of secret extra headers. */
|
|
1606
|
+
readonly secretHeaders: Schema.withDecodingDefaultKey<Schema.$Record<Schema.String, Schema.String>, never>;
|
|
1607
|
+
}>>, never>;
|
|
1608
|
+
readonly routes: Schema.withDecodingDefaultKey<Schema.$Array<Schema.Struct<{
|
|
1609
|
+
readonly source: Schema.String;
|
|
1610
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
1611
|
+
readonly eventTypes: Schema.withDecodingDefaultKey<Schema.NonEmptyArray<Schema.String>, never>;
|
|
1612
|
+
readonly enabled: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
1613
|
+
readonly autoPauseThreshold: Schema.withDecodingDefaultKey<Schema.Int, never>;
|
|
1614
|
+
readonly relay: Schema.String;
|
|
1615
|
+
}>>, never>;
|
|
1616
|
+
/** Delete managed items that are not listed. Default true. */
|
|
1617
|
+
readonly prune: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
1618
|
+
}>;
|
|
1619
|
+
type ConfigDocument = typeof ConfigDocument.Type;
|
|
1620
|
+
type ConfigDocumentInput = typeof ConfigDocument.Encoded;
|
|
1621
|
+
/** Identities touched by an apply: source keys, relay ids, route ids. */
|
|
1622
|
+
declare const ApplyChanges: Schema.Struct<{
|
|
1623
|
+
readonly created: Schema.$Array<Schema.String>;
|
|
1624
|
+
readonly updated: Schema.$Array<Schema.String>;
|
|
1625
|
+
readonly deleted: Schema.$Array<Schema.String>;
|
|
1626
|
+
readonly unchanged: Schema.$Array<Schema.String>;
|
|
1627
|
+
}>;
|
|
1628
|
+
type ApplyChanges = typeof ApplyChanges.Type;
|
|
1629
|
+
declare const IssuedSigningSecret: Schema.Struct<{
|
|
1630
|
+
readonly relayId: Schema.String;
|
|
1631
|
+
readonly relayName: Schema.String;
|
|
1632
|
+
/** Shown once. */
|
|
1633
|
+
readonly signingSecret: Schema.String;
|
|
1634
|
+
}>;
|
|
1635
|
+
type IssuedSigningSecret = typeof IssuedSigningSecret.Type;
|
|
1636
|
+
declare const ApplyResult: Schema.Struct<{
|
|
1637
|
+
readonly sources: Schema.Struct<{
|
|
1638
|
+
readonly created: Schema.$Array<Schema.String>;
|
|
1639
|
+
readonly updated: Schema.$Array<Schema.String>;
|
|
1640
|
+
readonly deleted: Schema.$Array<Schema.String>;
|
|
1641
|
+
readonly unchanged: Schema.$Array<Schema.String>;
|
|
1642
|
+
}>;
|
|
1643
|
+
readonly relays: Schema.Struct<{
|
|
1644
|
+
readonly created: Schema.$Array<Schema.String>;
|
|
1645
|
+
readonly updated: Schema.$Array<Schema.String>;
|
|
1646
|
+
readonly deleted: Schema.$Array<Schema.String>;
|
|
1647
|
+
readonly unchanged: Schema.$Array<Schema.String>;
|
|
1648
|
+
}>;
|
|
1649
|
+
readonly routes: Schema.Struct<{
|
|
1650
|
+
readonly created: Schema.$Array<Schema.String>;
|
|
1651
|
+
readonly updated: Schema.$Array<Schema.String>;
|
|
1652
|
+
readonly deleted: Schema.$Array<Schema.String>;
|
|
1653
|
+
readonly unchanged: Schema.$Array<Schema.String>;
|
|
1654
|
+
}>;
|
|
1655
|
+
/** Signing secrets of relays created by this apply. */
|
|
1656
|
+
readonly signingSecrets: Schema.$Array<Schema.Struct<{
|
|
1657
|
+
readonly relayId: Schema.String;
|
|
1658
|
+
readonly relayName: Schema.String;
|
|
1659
|
+
/** Shown once. */
|
|
1660
|
+
readonly signingSecret: Schema.String;
|
|
1661
|
+
}>>;
|
|
1662
|
+
/** Sources whose snapshot push failed; the cron sweep retries them. */
|
|
1663
|
+
readonly pendingPushes: Schema.$Array<Schema.String>;
|
|
1664
|
+
}>;
|
|
1665
|
+
type ApplyResult = typeof ApplyResult.Type;
|
|
1666
|
+
/**
|
|
1667
|
+
* Prefixed, time-sortable ULIDs (`req_01J…`). Ids made by one generator are
|
|
1668
|
+
* strictly increasing, also within a millisecond.
|
|
1669
|
+
*
|
|
1670
|
+
* The local development relay (docs/LOCAL-RELAY.md) adds three prefixes:
|
|
1671
|
+
* `lcl_` for a request sent to a local target (it stands in for the delivery
|
|
1672
|
+
* id, `manifold-delivery-id`), `lsn_` for a listener session and `ltk_` for a
|
|
1673
|
+
* listen token's id (not the token itself, which is `mfl_…`).
|
|
1674
|
+
*/
|
|
1675
|
+
type IdPrefix = "req" | "dlv" | "att" | "rly" | "rte" | "lcl" | "lsn" | "ltk";
|
|
1676
|
+
declare const ID_PREFIXES: ReadonlyArray<IdPrefix>;
|
|
1677
|
+
/** The prefix of local ids: what a local target sees in `manifold-delivery-id` (§4.2 of LOCAL-RELAY.md). */
|
|
1678
|
+
declare const LOCAL_ID_PREFIX: "lcl";
|
|
1679
|
+
/** A ULID body: 26 Crockford base32 characters. */
|
|
1680
|
+
declare const ULID_PATTERN: RegExp;
|
|
1681
|
+
declare const idPattern: (prefix: IdPrefix) => RegExp;
|
|
1682
|
+
declare const isId: (prefix: IdPrefix, value: string) => boolean;
|
|
1683
|
+
interface IdGenerator {
|
|
1684
|
+
readonly ulid: () => string;
|
|
1685
|
+
readonly make: (prefix: IdPrefix) => string;
|
|
1686
|
+
}
|
|
1687
|
+
interface IdGeneratorOptions {
|
|
1688
|
+
readonly now?: () => number;
|
|
1689
|
+
readonly random?: (length: number) => Uint8Array;
|
|
1690
|
+
}
|
|
1691
|
+
declare const makeIdGenerator: (options?: IdGeneratorOptions) => IdGenerator;
|
|
1692
|
+
/** A new id with this prefix stamped at `time` (random within that millisecond), e.g. for back-dated fixtures. */
|
|
1693
|
+
declare const idAt: (prefix: IdPrefix, time: number) => string;
|
|
1694
|
+
/** A new prefixed id from the process-wide generator. */
|
|
1695
|
+
declare const newId: (prefix: IdPrefix) => string;
|
|
1696
|
+
/** A new local id (`lcl_…`), minted per request sent to a listener or forwarded by `manifold replay`. */
|
|
1697
|
+
declare const newLocalId: () => string;
|
|
1698
|
+
/** True for an `lcl_…` id. */
|
|
1699
|
+
declare const isLocalId: (value: string) => boolean;
|
|
1700
|
+
/** The smallest id of `prefix` at `time`: every id made at or after `time` sorts at or after it. */
|
|
1701
|
+
declare const minIdAt: (prefix: IdPrefix, time: number) => string;
|
|
1702
|
+
/** The millisecond timestamp encoded in a ULID or prefixed id, or `undefined` if malformed. */
|
|
1703
|
+
declare const idTime: (id: string) => number | undefined;
|
|
1704
|
+
export { JwtAlgorithm as $, SourceConfig as $t, ConfigSource as A, RelayTimeoutMs as At, EventTypeGlob as B, RouteConfig as Bt, AutoPauseThreshold as C, RejectionCounter as Ct, ConfigDocumentInput as D, RelayConfig as Dt, ConfigDocument as E, Rejections as Et, DeliveryRecord as F, RequestStatus as Ft, HandshakeSpec as G, SecretEncoding as Gt, ExtractorPart as H, RouteId as Ht, DeliveryStatus as I, ResolvedVerification as It, HeaderName as J, SecretInfo as Jt, HashAlgorithm as K, SecretHeaderInfo as Kt, ERROR_STATUS as L, RetentionDays as Lt, DedupeWindowSeconds as M, RequestDetail as Mt, DeliveryDetail as N, RequestId as Nt, ConfigRelay as O, RelayConfigInput as Ot, DeliveryId as P, RequestRecord as Pt, JsonChallengeHandshake as Q, SigningSecretInfo as Qt, ErrorBody as R, RetryPolicy as Rt, AuditRecord as S, Principal as St, ClaimRequirement as T, RejectionRecord as Tt, FINISHED_DELIVERY_STATUSES as U, RouteState as Ut, Extractor as V, RouteConfigInput as Vt, Fingerprint as W, RouteView as Wt, IngestAck as X, SignatureEncoding as Xt, HmacVerify as Y, SecretValue as Yt, IssuedSigningSecret as Z, SignatureFormat as Zt, ApplyResult as _, PauseReason as _t, LOCAL_ID_PREFIX as a, TargetLabel as an, ListenerInfo as at, AttemptStatus as b, PresetId as bt, idPattern as c, ValueSource as cn, ListenersSetting as ct, isLocalId as d, VerifyTemplate as dn, LocalId as dt, SourceConfigInput as en, JwtVerify as et, makeIdGenerator as f, VerifyType as fn, MaxBodyBytes as ft, ApplyChanges as g, Page as gt, newLocalId as h, sourceConfigFields as hn, NoneVerify as ht, IdPrefix as i, TIMINGS as in, ListenTokenInfo as it, Count as j, RelayView as jt, ConfigRoute as k, RelayId as kt, idTime as l, VerifyOverride as ln, LocalAttemptKind as lt, newId as m, routeConfigFields as mn, Millis as mt, IdGenerator as n, SourceStats as nn, LIMITS as nt, ULID_PATTERN as o, TokenVerify as on, ListenerName as ot, minIdAt as p, relayConfigFields as pn, MiB as pt, HeaderMap as q, SecretHeaders as qt, IdGeneratorOptions as r, SourceView as rn, ListenTokenId as rt, idAt as s, Tolerance as sn, ListenerSessionId as st, ID_PREFIXES as t, SourceKey as tn, KiB as tt, isId as u, VerifySpec as un, LocalAttemptRecord as ut, AttemptId as v, PayloadTemplate as vt, BodyPath as w, RejectionReason as wt, AuditAction as x, PresetResponse as xt, AttemptRecord as y, Preset as yt, ErrorCode as z, Revision as zt };
|