@fungi.computer/carrier 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +468 -2
  3. package/dist/cloudflare.d.ts +32 -0
  4. package/dist/cloudflare.js +80 -0
  5. package/dist/email.d.ts +2 -0
  6. package/dist/email.js +2 -0
  7. package/dist/index.d.ts +21 -0
  8. package/dist/index.js +28 -0
  9. package/dist/inspection.d.ts +108 -0
  10. package/dist/inspection.js +188 -0
  11. package/dist/internal/cloudflare-send.d.ts +9 -0
  12. package/dist/internal/cloudflare-send.js +79 -0
  13. package/dist/internal/contracts.d.ts +94 -0
  14. package/dist/internal/contracts.js +7 -0
  15. package/dist/internal/owner.d.ts +24 -0
  16. package/dist/internal/owner.js +419 -0
  17. package/dist/internal/policy.d.ts +25 -0
  18. package/dist/internal/policy.js +18 -0
  19. package/dist/internal/post-contract.d.ts +27 -0
  20. package/dist/internal/post-contract.js +22 -0
  21. package/dist/internal/post-execution.d.ts +45 -0
  22. package/dist/internal/post-execution.js +73 -0
  23. package/dist/internal/post-sql.d.ts +51 -0
  24. package/dist/internal/post-sql.js +259 -0
  25. package/dist/internal/receipt-schema.d.ts +3 -0
  26. package/dist/internal/receipt-schema.js +12 -0
  27. package/dist/post-d1.d.ts +36 -0
  28. package/dist/post-d1.js +55 -0
  29. package/dist/post-outbox.d.ts +52 -0
  30. package/dist/post-outbox.js +152 -0
  31. package/dist/post-postgres.d.ts +25 -0
  32. package/dist/post-postgres.js +79 -0
  33. package/dist/post.d.ts +189 -0
  34. package/dist/post.js +437 -0
  35. package/dist/testing.d.ts +16 -0
  36. package/dist/testing.js +20 -0
  37. package/docs/api/README.md +20 -0
  38. package/docs/api/cloudflare.md +100 -0
  39. package/docs/api/email.md +87 -0
  40. package/docs/api/index.md +343 -0
  41. package/docs/api/inspection.md +281 -0
  42. package/docs/api/post-d1.md +184 -0
  43. package/docs/api/post-postgres.md +108 -0
  44. package/docs/api/post.md +599 -0
  45. package/docs/api/testing.md +46 -0
  46. package/package.json +95 -3
@@ -0,0 +1,599 @@
1
+ <!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
2
+
3
+ [**@fungi.computer/carrier**](README.md)
4
+
5
+ ---
6
+
7
+ [@fungi.computer/carrier](README.md) / post
8
+
9
+ # post
10
+
11
+ ## Classes
12
+
13
+ ### PostError
14
+
15
+ Post rejected an unknown route or conflicting key.
16
+
17
+ #### Extends
18
+
19
+ - `YieldableError`\<`this`\> & `object` & `Readonly`\<\{ `message`: `string`;
20
+ \}\>
21
+
22
+ #### Constructors
23
+
24
+ ##### Constructor
25
+
26
+ ```ts
27
+ new PostError(message): PostError;
28
+ ```
29
+
30
+ ###### Parameters
31
+
32
+ | Parameter | Type |
33
+ | --------- | -------- |
34
+ | `message` | `string` |
35
+
36
+ ###### Returns
37
+
38
+ [`PostError`](#posterror)
39
+
40
+ ###### Overrides
41
+
42
+ ```ts
43
+ Data.TaggedError("PostError")<{
44
+ readonly message: string;
45
+ }>.constructor
46
+ ```
47
+
48
+ #### Properties
49
+
50
+ ##### message
51
+
52
+ ```ts
53
+ message: string;
54
+ ```
55
+
56
+ ###### Inherited from
57
+
58
+ ```ts
59
+ Data.TaggedError("PostError").message;
60
+ ```
61
+
62
+ ## Type Aliases
63
+
64
+ ### PostDeliveryResult
65
+
66
+ ```ts
67
+ type PostDeliveryResult =
68
+ | "accepted"
69
+ | "duplicate"
70
+ | "refused"
71
+ | Readonly<{
72
+ status: "accepted" | "duplicate";
73
+ cursor: number;
74
+ }>
75
+ | Readonly<{
76
+ status: "accepted" | "duplicate" | "refused";
77
+ receipt: Schema.Json;
78
+ }>;
79
+ ```
80
+
81
+ Receiver's idempotent admission decision.
82
+
83
+ ---
84
+
85
+ ### PostOutboxStore
86
+
87
+ ```ts
88
+ type PostOutboxStore<E> = Readonly<{
89
+ put: (key, value) => Effect.Effect<void, E>;
90
+ read: (key) => Effect.Effect<string | undefined, E>;
91
+ list: (
92
+ limit,
93
+ afterKey?,
94
+ ) => Effect.Effect<
95
+ readonly Readonly<{
96
+ key: string;
97
+ value: string;
98
+ }>[],
99
+ E
100
+ >;
101
+ delete: (key) => Effect.Effect<void, E>;
102
+ }>;
103
+ ```
104
+
105
+ Durable, string-backed rows. A delivered receipt must outlive source replay.
106
+
107
+ #### Type Parameters
108
+
109
+ | Type Parameter |
110
+ | -------------- |
111
+ | `E` |
112
+
113
+ ---
114
+
115
+ ### PostOutbox
116
+
117
+ ```ts
118
+ type PostOutbox<M, E> = Readonly<{
119
+ enqueue: (message, at?) => Effect.Effect<number | undefined, E>;
120
+ drain: () => Effect.Effect<void, E>;
121
+ nextWakeAt: () => Effect.Effect<number | undefined, E>;
122
+ deadLetters: (limit, afterKey?) => Effect.Effect<M[], E>;
123
+ }>;
124
+ ```
125
+
126
+ Bounded generic delivery owned by Post.
127
+
128
+ #### Type Parameters
129
+
130
+ | Type Parameter |
131
+ | -------------- |
132
+ | `M` |
133
+ | `E` |
134
+
135
+ ---
136
+
137
+ ### PostEnvelope
138
+
139
+ ```ts
140
+ type PostEnvelope = Schema.Schema.Type<typeof PostEnvelopeSchema>;
141
+ ```
142
+
143
+ One addressed event identified by the producer's stable key.
144
+
145
+ ---
146
+
147
+ ### PostRow
148
+
149
+ ```ts
150
+ type PostRow = Schema.Schema.Type<typeof PostRowSchema>;
151
+ ```
152
+
153
+ Pending row, terminal receipt, or dead letter.
154
+
155
+ ---
156
+
157
+ ### PostRoute
158
+
159
+ ```ts
160
+ type PostRoute<A, E, D, AI, EI, DI> = Readonly<{
161
+ addressKind: string;
162
+ address: Schema.Codec<A, AI>;
163
+ event: Schema.Codec<E, EI>;
164
+ name: (address) => string;
165
+ namespace: Readonly<{
166
+ getByName: (name) => Readonly<{
167
+ deliver: (envelope) => Promise<PostDeliveryResult>;
168
+ }>;
169
+ }>;
170
+ }> &
171
+ | Readonly<{
172
+ prepare: Readonly<{
173
+ event: Schema.Codec<D, DI>;
174
+ run: (address, intent, signal) => Promise<D>;
175
+ }>;
176
+ onDelivered?: (address, event) => void;
177
+ onCursor?: (address, event, cursor) => void;
178
+ onRefused?: (address, event) => void;
179
+ }>
180
+ | Readonly<{
181
+ prepare?: undefined;
182
+ onDelivered?: (address, event) => void;
183
+ onCursor?: (address, event, cursor) => void;
184
+ onRefused?: (address, event) => void;
185
+ }>;
186
+ ```
187
+
188
+ Schema-correlated ordinary events or prepared delivery facts.
189
+
190
+ #### Type Parameters
191
+
192
+ | Type Parameter | Default type |
193
+ | -------------- | ------------ |
194
+ | `A` | - |
195
+ | `E` | - |
196
+ | `D` | `E` |
197
+ | `AI` | `A` |
198
+ | `EI` | `E` |
199
+ | `DI` | `EI` |
200
+
201
+ ---
202
+
203
+ ### PostRegistryRoute
204
+
205
+ ```ts
206
+ type PostRegistryRoute = Readonly<{
207
+ addressKind: string;
208
+ address: Schema.Codec<unknown, unknown>;
209
+ event: Schema.Codec<unknown, unknown>;
210
+ encodeEnvelope: (envelope) => PostEnvelope;
211
+ parseDelivery: (envelope) => PostEnvelope;
212
+ prepareEnvelope?: (envelope, signal) => Promise<PostEnvelope>;
213
+ recordDelivered?: (envelope) => void;
214
+ nameOf: (envelope) => string;
215
+ namespace: PostRoute<never, never>["namespace"];
216
+ recordCursor?: (envelope, cursor) => void;
217
+ recordRefused?: (envelope) => void;
218
+ }>;
219
+ ```
220
+
221
+ Runtime operations that preserve the route's schema evidence.
222
+
223
+ ---
224
+
225
+ ### PostRuntime
226
+
227
+ ```ts
228
+ type PostRuntime<R> = Readonly<{
229
+ send: <K>(input) => void;
230
+ execute: (job) => Promise<
231
+ Readonly<{
232
+ kind: "completed";
233
+ }>
234
+ >;
235
+ enqueueDue: (limit?, afterKey?) => Promise<string | undefined>;
236
+ deadLetters: (
237
+ limit?,
238
+ afterKey?,
239
+ ) => Readonly<{
240
+ letters: readonly Readonly<{
241
+ key: string;
242
+ reason: "refused" | "exhausted";
243
+ envelope: PostEnvelope;
244
+ attempts: number;
245
+ }>[];
246
+ nextCursor: string | undefined;
247
+ }>;
248
+ latest: <K>(
249
+ kind,
250
+ address,
251
+ ) =>
252
+ | Readonly<{
253
+ key: string;
254
+ row: PostRow;
255
+ }>
256
+ | undefined;
257
+ retry: (key) => Promise<void>;
258
+ read: (key) => PostRow | undefined;
259
+ nextWake: () => number | null;
260
+ }>;
261
+ ```
262
+
263
+ One producer's Post operations.
264
+
265
+ #### Type Parameters
266
+
267
+ | Type Parameter |
268
+ | ----------------------------------------------------------------------------- |
269
+ | `R` _extends_ `Record`\<`string`, [`PostRegistryRoute`](#postregistryroute)\> |
270
+
271
+ ## Variables
272
+
273
+ ### PostDeliveryResultSchema
274
+
275
+ ```ts
276
+ const PostDeliveryResultSchema: Union<
277
+ readonly [
278
+ Literals<readonly ["accepted", "duplicate", "refused"]>,
279
+ Struct<{
280
+ status: Literals<readonly ["accepted", "duplicate"]>;
281
+ cursor: Int;
282
+ }>,
283
+ Struct<{
284
+ status: Literals<readonly ["accepted", "duplicate", "refused"]>;
285
+ receipt: Codec<Json, Json, never, never>;
286
+ }>,
287
+ ]
288
+ >;
289
+ ```
290
+
291
+ Accepted receipt, revision cursor, or permanent refusal returned by a receiver.
292
+
293
+ ---
294
+
295
+ ### PostEnvelopeSchema
296
+
297
+ ```ts
298
+ const PostEnvelopeSchema: Struct<{
299
+ key: String;
300
+ kind: String;
301
+ address: Unknown;
302
+ event: Unknown;
303
+ }>;
304
+ ```
305
+
306
+ Wire envelope parsed at the durable row and receiver boundaries.
307
+
308
+ ---
309
+
310
+ ### PostRowSchema
311
+
312
+ ```ts
313
+ const PostRowSchema: fromJsonString<
314
+ Union<
315
+ readonly [
316
+ Struct<{
317
+ state: Literal<"pending">;
318
+ envelope: Struct<{
319
+ key: String;
320
+ kind: String;
321
+ address: Unknown;
322
+ event: Unknown;
323
+ }>;
324
+ attempts: Int;
325
+ nextAttemptAt: Number;
326
+ jobId: optional<String>;
327
+ delivery: optional<
328
+ Struct<{
329
+ key: String;
330
+ kind: String;
331
+ address: Unknown;
332
+ event: Unknown;
333
+ }>
334
+ >;
335
+ nextKey: optional<String>;
336
+ }>,
337
+ Struct<{
338
+ state: Literal<"delivered">;
339
+ receipt: optional<Codec<Json, Json, never, never>>;
340
+ nextKey: optional<String>;
341
+ }>,
342
+ Struct<{
343
+ state: Literal<"dead">;
344
+ envelope: Struct<{
345
+ key: String;
346
+ kind: String;
347
+ address: Unknown;
348
+ event: Unknown;
349
+ }>;
350
+ attempts: Int;
351
+ reason: Literals<readonly ["refused", "exhausted"]>;
352
+ receipt: optional<Codec<Json, Json, never, never>>;
353
+ delivery: optional<
354
+ Struct<{
355
+ key: String;
356
+ kind: String;
357
+ address: Unknown;
358
+ event: Unknown;
359
+ }>
360
+ >;
361
+ nextKey: optional<String>;
362
+ }>,
363
+ ]
364
+ >
365
+ >;
366
+ ```
367
+
368
+ Persisted Post row parser.
369
+
370
+ ## Functions
371
+
372
+ ### makePostOutbox()
373
+
374
+ ```ts
375
+ function makePostOutbox<M, E>(options): PostOutbox<M, E>;
376
+ ```
377
+
378
+ The same bounded delivery and receipt machinery serves Post and BirdDog.
379
+
380
+ #### Type Parameters
381
+
382
+ | Type Parameter |
383
+ | -------------- |
384
+ | `M` |
385
+ | `E` |
386
+
387
+ #### Parameters
388
+
389
+ | Parameter | Type |
390
+ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
391
+ | `options` | `Readonly`\<\{ `message`: `Schema.Codec`\<`M`\>; `key`: (`message`) => `string`; `outbox`: [`PostOutboxStore`](#postoutboxstore)\<`E`\>; `deliver`: (`message`) => `Effect.Effect`\<`boolean`, `E`\>; `scheduleWake`: (`at`) => `Effect.Effect`\<`void`, `E`\>; `now`: () => `number`; `invalidRow`: () => `E`; `encodingFailed`: () => `E`; \}\> |
392
+
393
+ #### Returns
394
+
395
+ [`PostOutbox`](#postoutbox)\<`M`, `E`\>
396
+
397
+ ---
398
+
399
+ ### postOutboxPending()
400
+
401
+ ```ts
402
+ function postOutboxPending<M, E>(options): Effect<boolean, E>;
403
+ ```
404
+
405
+ Whether any message in an outbox still awaits a delivery attempt. Delivered
406
+ receipts and exhausted dead letters are retained but owe nothing more, so a host
407
+ may let their owner rest.
408
+
409
+ #### Type Parameters
410
+
411
+ | Type Parameter |
412
+ | -------------- |
413
+ | `M` |
414
+ | `E` |
415
+
416
+ #### Parameters
417
+
418
+ | Parameter | Type |
419
+ | --------- | --------------------------------------------------------------------------------------------------------------------------------- |
420
+ | `options` | `Readonly`\<\{ `message`: `Schema.Codec`\<`M`\>; `outbox`: `Pick`\<[`PostOutboxStore`](#postoutboxstore)\<`E`\>, `"list"`\>; \}\> |
421
+
422
+ #### Returns
423
+
424
+ `Effect`\<`boolean`, `E`\>
425
+
426
+ ---
427
+
428
+ ### definePostRoute()
429
+
430
+ #### Call Signature
431
+
432
+ ```ts
433
+ function definePostRoute<A, E, AI, EI>(route): PostRoute<A, E, E, AI, EI, EI> & Omit<Readonly<{
434
+ addressKind: string;
435
+ address: Codec<unknown, unknown>;
436
+ event: Codec<unknown, unknown>;
437
+ encodeEnvelope: (envelope) => object;
438
+ parseDelivery: (envelope) => object;
439
+ prepareEnvelope?: (envelope, signal) => Promise<{
440
+ key: string;
441
+ kind: string;
442
+ address: unknown;
443
+ event: unknown;
444
+ }>;
445
+ recordDelivered?: (envelope) => void;
446
+ nameOf: (envelope) => string;
447
+ namespace: Readonly<{
448
+ getByName: (name) => Readonly<{
449
+ deliver: (envelope) => Promise<...>;
450
+ }>;
451
+ }>;
452
+ recordCursor?: (envelope, cursor) => void;
453
+ recordRefused?: (envelope) => void;
454
+ }>, "address" | "event">;
455
+ ```
456
+
457
+ Preserve each route's inferred address and event types in a registry.
458
+
459
+ ##### Type Parameters
460
+
461
+ | Type Parameter | Default type |
462
+ | -------------- | ------------ |
463
+ | `A` | - |
464
+ | `E` | - |
465
+ | `AI` | `A` |
466
+ | `EI` | `E` |
467
+
468
+ ##### Parameters
469
+
470
+ | Parameter | Type |
471
+ | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
472
+ | `route` | `Readonly`\<\{ `addressKind`: `string`; `address`: `Codec`\<`A`, `AI`\>; `event`: `Codec`\<`E`, `EI`\>; `name`: (`address`) => `string`; `namespace`: `Readonly`\<\{ `getByName`: (`name`) => `Readonly`\<\{ `deliver`: (`envelope`) => `Promise`\<[`PostDeliveryResult`](#postdeliveryresult)\>; \}\>; \}\>; \}\> & `Readonly`\<\{ `prepare?`: `undefined`; `onDelivered?`: (`address`, `event`) => `void`; `onCursor?`: (`address`, `event`, `cursor`) => `void`; `onRefused?`: (`address`, `event`) => `void`; \}\> |
473
+
474
+ ##### Returns
475
+
476
+ [`PostRoute`](#postroute)\<`A`, `E`, `E`, `AI`, `EI`, `EI`\> &
477
+ `Omit`\<`Readonly`\<\{ `addressKind`: `string`; `address`: `Codec`\<`unknown`,
478
+ `unknown`\>; `event`: `Codec`\<`unknown`, `unknown`\>; `encodeEnvelope`:
479
+ (`envelope`) => `object`; `parseDelivery`: (`envelope`) => `object`;
480
+ `prepareEnvelope?`: (`envelope`, `signal`) => `Promise`\<\{ `key`: `string`;
481
+ `kind`: `string`; `address`: `unknown`; `event`: `unknown`; \}\>;
482
+ `recordDelivered?`: (`envelope`) => `void`; `nameOf`: (`envelope`) => `string`;
483
+ `namespace`: `Readonly`\<\{ `getByName`: (`name`) => `Readonly`\<\{ `deliver`:
484
+ (`envelope`) => `Promise`\<...\>; \}\>; \}\>; `recordCursor?`: (`envelope`,
485
+ `cursor`) => `void`; `recordRefused?`: (`envelope`) => `void`; \}\>, `"address"`
486
+ \| `"event"`\>
487
+
488
+ #### Call Signature
489
+
490
+ ```ts
491
+ function definePostRoute<A, E, D, AI, EI, DI>(route): PostRoute<A, E, D, AI, EI, DI> & Omit<Readonly<{
492
+ addressKind: string;
493
+ address: Codec<unknown, unknown>;
494
+ event: Codec<unknown, unknown>;
495
+ encodeEnvelope: (envelope) => object;
496
+ parseDelivery: (envelope) => object;
497
+ prepareEnvelope?: (envelope, signal) => Promise<{
498
+ key: string;
499
+ kind: string;
500
+ address: unknown;
501
+ event: unknown;
502
+ }>;
503
+ recordDelivered?: (envelope) => void;
504
+ nameOf: (envelope) => string;
505
+ namespace: Readonly<{
506
+ getByName: (name) => Readonly<{
507
+ deliver: (envelope) => Promise<...>;
508
+ }>;
509
+ }>;
510
+ recordCursor?: (envelope, cursor) => void;
511
+ recordRefused?: (envelope) => void;
512
+ }>, "address" | "event">;
513
+ ```
514
+
515
+ Preserve each route's inferred address and event types in a registry.
516
+
517
+ ##### Type Parameters
518
+
519
+ | Type Parameter | Default type |
520
+ | -------------- | ------------ |
521
+ | `A` | - |
522
+ | `E` | - |
523
+ | `D` | - |
524
+ | `AI` | `A` |
525
+ | `EI` | `E` |
526
+ | `DI` | `EI` |
527
+
528
+ ##### Parameters
529
+
530
+ | Parameter | Type |
531
+ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
532
+ | `route` | `Readonly`\<\{ `addressKind`: `string`; `address`: `Codec`\<`A`, `AI`\>; `event`: `Codec`\<`E`, `EI`\>; `name`: (`address`) => `string`; `namespace`: `Readonly`\<\{ `getByName`: (`name`) => `Readonly`\<\{ `deliver`: (`envelope`) => `Promise`\<[`PostDeliveryResult`](#postdeliveryresult)\>; \}\>; \}\>; \}\> & `Readonly`\<\{ `prepare`: `Readonly`\<\{ `event`: `Schema.Codec`\<`D`, `DI`\>; `run`: (`address`, `intent`, `signal`) => `Promise`\<`D`\>; \}\>; `onDelivered?`: (`address`, `event`) => `void`; `onCursor?`: (`address`, `event`, `cursor`) => `void`; `onRefused?`: (`address`, `event`) => `void`; \}\> |
533
+
534
+ ##### Returns
535
+
536
+ [`PostRoute`](#postroute)\<`A`, `E`, `D`, `AI`, `EI`, `DI`\> &
537
+ `Omit`\<`Readonly`\<\{ `addressKind`: `string`; `address`: `Codec`\<`unknown`,
538
+ `unknown`\>; `event`: `Codec`\<`unknown`, `unknown`\>; `encodeEnvelope`:
539
+ (`envelope`) => `object`; `parseDelivery`: (`envelope`) => `object`;
540
+ `prepareEnvelope?`: (`envelope`, `signal`) => `Promise`\<\{ `key`: `string`;
541
+ `kind`: `string`; `address`: `unknown`; `event`: `unknown`; \}\>;
542
+ `recordDelivered?`: (`envelope`) => `void`; `nameOf`: (`envelope`) => `string`;
543
+ `namespace`: `Readonly`\<\{ `getByName`: (`name`) => `Readonly`\<\{ `deliver`:
544
+ (`envelope`) => `Promise`\<...\>; \}\>; \}\>; `recordCursor?`: (`envelope`,
545
+ `cursor`) => `void`; `recordRefused?`: (`envelope`) => `void`; \}\>, `"address"`
546
+ \| `"event"`\>
547
+
548
+ ---
549
+
550
+ ### createPost()
551
+
552
+ ```ts
553
+ function createPost<R>(options): PostRuntime<R>;
554
+ ```
555
+
556
+ Decode at both persisted and DO boundaries with the route's Effect Schema.
557
+
558
+ #### Type Parameters
559
+
560
+ | Type Parameter |
561
+ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
562
+ | `R` _extends_ `Record`\<`string`, `Readonly`\<\{ `addressKind`: `string`; `address`: `Codec`\<`unknown`, `unknown`\>; `event`: `Codec`\<`unknown`, `unknown`\>; `encodeEnvelope`: (`envelope`) => `object`; `parseDelivery`: (`envelope`) => `object`; `prepareEnvelope?`: (`envelope`, `signal`) => `Promise`\<\{ `key`: `string`; `kind`: `string`; `address`: `unknown`; `event`: `unknown`; \}\>; `recordDelivered?`: (`envelope`) => `void`; `nameOf`: (`envelope`) => `string`; `namespace`: `Readonly`\<\{ `getByName`: (`name`) => `Readonly`\<\{ `deliver`: (`envelope`) => `Promise`\<[`PostDeliveryResult`](#postdeliveryresult)\>; \}\>; \}\>; `recordCursor?`: (`envelope`, `cursor`) => `void`; `recordRefused?`: (`envelope`) => `void`; \}\>\> |
563
+
564
+ #### Parameters
565
+
566
+ | Parameter | Type |
567
+ | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
568
+ | `options` | `Readonly`\<\{ `routes`: `R`; `owner`: `WatchdogSqliteOwner`; `transactional`: `WatchdogTransactionalProjection`; `readJob`: `WatchdogRuntime`\[`"read"`\]; `now`: () => `number`; `scheduleWake`: (`at`) => `Promise`\<`void`\>; \}\> |
569
+
570
+ #### Returns
571
+
572
+ [`PostRuntime`](#postruntime)\<`R`\>
573
+
574
+ ---
575
+
576
+ ### admitPost()
577
+
578
+ ```ts
579
+ function admitPost<E, I>(options): PostDeliveryResult;
580
+ ```
581
+
582
+ Consumer admission runs inside the receiver's own SQLite transaction.
583
+
584
+ #### Type Parameters
585
+
586
+ | Type Parameter |
587
+ | -------------- |
588
+ | `E` |
589
+ | `I` |
590
+
591
+ #### Parameters
592
+
593
+ | Parameter | Type |
594
+ | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
595
+ | `options` | `Readonly`\<\{ `key`: `string`; `event`: `unknown`; `schema`: `Schema.Codec`\<`E`, `I`\>; `hasReceipt`: (`key`) => `boolean`; `apply`: (`event`) => [`PostDeliveryResult`](#postdeliveryresult); `putReceipt`: (`key`) => `void`; \}\> |
596
+
597
+ #### Returns
598
+
599
+ [`PostDeliveryResult`](#postdeliveryresult)
@@ -0,0 +1,46 @@
1
+ <!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
2
+
3
+ [**@fungi.computer/carrier**](README.md)
4
+
5
+ ---
6
+
7
+ [@fungi.computer/carrier](README.md) / testing
8
+
9
+ # testing
10
+
11
+ ## Type Aliases
12
+
13
+ ### MemoryOutbox
14
+
15
+ ```ts
16
+ type MemoryOutbox = Readonly<{
17
+ put: (key, value) => Promise<void>;
18
+ read: (key) => Promise<string | undefined>;
19
+ list: (
20
+ limit,
21
+ afterKey?,
22
+ ) => Promise<
23
+ readonly Readonly<{
24
+ key: string;
25
+ value: string;
26
+ }>[]
27
+ >;
28
+ delete: (key) => Promise<void>;
29
+ }>;
30
+ ```
31
+
32
+ String-row outbox for deterministic tests and quick starts; no persistence.
33
+
34
+ ## Functions
35
+
36
+ ### createMemoryOutbox()
37
+
38
+ ```ts
39
+ function createMemoryOutbox(): MemoryOutbox;
40
+ ```
41
+
42
+ Create an independent in-process outbox for trusted tests and examples.
43
+
44
+ #### Returns
45
+
46
+ [`MemoryOutbox`](#memoryoutbox)