@iveri/contracts 0.3.0 → 0.5.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 (58) hide show
  1. package/README.md +11 -4
  2. package/dist/cjs/api/conduit/delivery-status.enum.d.ts +39 -0
  3. package/dist/cjs/api/conduit/delivery-status.enum.d.ts.map +1 -0
  4. package/dist/cjs/api/conduit/delivery-status.enum.js +43 -0
  5. package/dist/cjs/api/conduit/delivery-status.enum.js.map +1 -0
  6. package/dist/cjs/api/conduit/delivery.type.d.ts +79 -0
  7. package/dist/cjs/api/conduit/delivery.type.d.ts.map +1 -0
  8. package/dist/cjs/api/conduit/delivery.type.js +3 -0
  9. package/dist/cjs/api/conduit/delivery.type.js.map +1 -0
  10. package/dist/cjs/api/conduit/destination.type.d.ts +73 -0
  11. package/dist/cjs/api/conduit/destination.type.d.ts.map +1 -0
  12. package/dist/cjs/api/conduit/destination.type.js +3 -0
  13. package/dist/cjs/api/conduit/destination.type.js.map +1 -0
  14. package/dist/cjs/api/conduit/index.d.ts +5 -0
  15. package/dist/cjs/api/conduit/index.d.ts.map +1 -1
  16. package/dist/cjs/api/conduit/index.js +5 -0
  17. package/dist/cjs/api/conduit/index.js.map +1 -1
  18. package/dist/cjs/api/conduit/match-operator.enum.d.ts +22 -0
  19. package/dist/cjs/api/conduit/match-operator.enum.d.ts.map +1 -0
  20. package/dist/cjs/api/conduit/match-operator.enum.js +26 -0
  21. package/dist/cjs/api/conduit/match-operator.enum.js.map +1 -0
  22. package/dist/cjs/api/conduit/route.type.d.ts +124 -0
  23. package/dist/cjs/api/conduit/route.type.d.ts.map +1 -0
  24. package/dist/cjs/api/conduit/route.type.js +3 -0
  25. package/dist/cjs/api/conduit/route.type.js.map +1 -0
  26. package/dist/cjs/enum/user-permission.enum.d.ts +30 -1
  27. package/dist/cjs/enum/user-permission.enum.d.ts.map +1 -1
  28. package/dist/cjs/enum/user-permission.enum.js +32 -0
  29. package/dist/cjs/enum/user-permission.enum.js.map +1 -1
  30. package/dist/esm/api/conduit/delivery-status.enum.d.ts +39 -0
  31. package/dist/esm/api/conduit/delivery-status.enum.d.ts.map +1 -0
  32. package/dist/esm/api/conduit/delivery-status.enum.js +40 -0
  33. package/dist/esm/api/conduit/delivery-status.enum.js.map +1 -0
  34. package/dist/esm/api/conduit/delivery.type.d.ts +79 -0
  35. package/dist/esm/api/conduit/delivery.type.d.ts.map +1 -0
  36. package/dist/esm/api/conduit/delivery.type.js +2 -0
  37. package/dist/esm/api/conduit/delivery.type.js.map +1 -0
  38. package/dist/esm/api/conduit/destination.type.d.ts +73 -0
  39. package/dist/esm/api/conduit/destination.type.d.ts.map +1 -0
  40. package/dist/esm/api/conduit/destination.type.js +2 -0
  41. package/dist/esm/api/conduit/destination.type.js.map +1 -0
  42. package/dist/esm/api/conduit/index.d.ts +5 -0
  43. package/dist/esm/api/conduit/index.d.ts.map +1 -1
  44. package/dist/esm/api/conduit/index.js +5 -0
  45. package/dist/esm/api/conduit/index.js.map +1 -1
  46. package/dist/esm/api/conduit/match-operator.enum.d.ts +22 -0
  47. package/dist/esm/api/conduit/match-operator.enum.d.ts.map +1 -0
  48. package/dist/esm/api/conduit/match-operator.enum.js +23 -0
  49. package/dist/esm/api/conduit/match-operator.enum.js.map +1 -0
  50. package/dist/esm/api/conduit/route.type.d.ts +124 -0
  51. package/dist/esm/api/conduit/route.type.d.ts.map +1 -0
  52. package/dist/esm/api/conduit/route.type.js +2 -0
  53. package/dist/esm/api/conduit/route.type.js.map +1 -0
  54. package/dist/esm/enum/user-permission.enum.d.ts +30 -1
  55. package/dist/esm/enum/user-permission.enum.d.ts.map +1 -1
  56. package/dist/esm/enum/user-permission.enum.js +32 -0
  57. package/dist/esm/enum/user-permission.enum.js.map +1 -1
  58. package/package.json +1 -1
package/README.md CHANGED
@@ -77,10 +77,17 @@ one consumer each and stay in the service until a second one appears.
77
77
 
78
78
  ### `api/conduit/` → `@iveri/contracts/conduit`
79
79
 
80
- `conduit-api`'s full admin surface: `Endpoint`, `CaptureSummary`/`CaptureDetail`, `Provider`
81
- with its `SignatureManifest`/`HandshakeManifest`, `Replay`, `SignatureDiagnostic`, the request
82
- bodies for each, and the five enums they are built from — `SignatureVerdict`,
83
- `SignatureAlgorithm`, `SignatureEncoding`, `SignatureHeaderScheme`, `HandshakeKind`.
80
+ `conduit-api`'s full admin surface.
81
+
82
+ Inspect mode: `Endpoint`, `CaptureSummary`/`CaptureDetail`, `Provider` with its
83
+ `SignatureManifest`/`HandshakeManifest`, `Replay`, `SignatureDiagnostic`.
84
+
85
+ Gateway mode: `Destination`, `Route` with its `HeaderMatcher`/`BodyMatcher`, `Delivery` and
86
+ `DeliveryAttempt`.
87
+
88
+ Plus the request bodies for each, and the seven enums they are built from — `SignatureVerdict`,
89
+ `SignatureAlgorithm`, `SignatureEncoding`, `SignatureHeaderScheme`, `HandshakeKind`,
90
+ `MatchOperator`, `DeliveryStatus`.
84
91
 
85
92
  ### Why the wire shapes moved here
86
93
 
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Where one delivery is in its life.
3
+ *
4
+ * The states a processor can be interrupted in matter as much as the ones it ends in, which is
5
+ * why `IN_FLIGHT` is a status rather than an implied one: a replica killed mid-attempt leaves
6
+ * rows in it, and the reclaim query needs something to look for.
7
+ */
8
+ export declare enum DeliveryStatus {
9
+ /** Waiting for its next attempt time. The only state the processor claims from. */
10
+ PENDING = "pending",
11
+ /**
12
+ * Claimed by a replica and being attempted right now.
13
+ *
14
+ * A row stuck here past the claim timeout is assumed abandoned and reclaimed. That reclaim
15
+ * is where at-least-once becomes visible — a replica that died *after* the receiver
16
+ * processed the request will have its work redone, which is what the idempotency key is
17
+ * for.
18
+ */
19
+ IN_FLIGHT = "in-flight",
20
+ /** The destination answered 2xx. Terminal. */
21
+ DELIVERED = "delivered",
22
+ /**
23
+ * Every attempt was used and none succeeded, or the failure was permanent. Terminal until an
24
+ * operator redrives it.
25
+ *
26
+ * **This is the dead-letter queue** — a status, not a separate resource. A DLQ that lives
27
+ * somewhere else is a DLQ nobody looks at.
28
+ */
29
+ DEAD_LETTERED = "dead-lettered",
30
+ /**
31
+ * An operator stopped it before it succeeded. Terminal.
32
+ *
33
+ * Distinct from `DEAD_LETTERED`: dead-lettered means the gateway tried and failed, cancelled
34
+ * means someone decided it should not be sent. Collapsing them makes "how reliable is our
35
+ * delivery" unanswerable.
36
+ */
37
+ CANCELLED = "cancelled"
38
+ }
39
+ //# sourceMappingURL=delivery-status.enum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delivery-status.enum.d.ts","sourceRoot":"","sources":["../../../../src/api/conduit/delivery-status.enum.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,oBAAY,cAAc;IACtB,mFAAmF;IACnF,OAAO,YAAY;IAEnB;;;;;;;OAOG;IACH,SAAS,cAAc;IAEvB,8CAA8C;IAC9C,SAAS,cAAc;IAEvB;;;;;;OAMG;IACH,aAAa,kBAAkB;IAE/B;;;;;;OAMG;IACH,SAAS,cAAc;CAC1B"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeliveryStatus = void 0;
4
+ /**
5
+ * Where one delivery is in its life.
6
+ *
7
+ * The states a processor can be interrupted in matter as much as the ones it ends in, which is
8
+ * why `IN_FLIGHT` is a status rather than an implied one: a replica killed mid-attempt leaves
9
+ * rows in it, and the reclaim query needs something to look for.
10
+ */
11
+ var DeliveryStatus;
12
+ (function (DeliveryStatus) {
13
+ /** Waiting for its next attempt time. The only state the processor claims from. */
14
+ DeliveryStatus["PENDING"] = "pending";
15
+ /**
16
+ * Claimed by a replica and being attempted right now.
17
+ *
18
+ * A row stuck here past the claim timeout is assumed abandoned and reclaimed. That reclaim
19
+ * is where at-least-once becomes visible — a replica that died *after* the receiver
20
+ * processed the request will have its work redone, which is what the idempotency key is
21
+ * for.
22
+ */
23
+ DeliveryStatus["IN_FLIGHT"] = "in-flight";
24
+ /** The destination answered 2xx. Terminal. */
25
+ DeliveryStatus["DELIVERED"] = "delivered";
26
+ /**
27
+ * Every attempt was used and none succeeded, or the failure was permanent. Terminal until an
28
+ * operator redrives it.
29
+ *
30
+ * **This is the dead-letter queue** — a status, not a separate resource. A DLQ that lives
31
+ * somewhere else is a DLQ nobody looks at.
32
+ */
33
+ DeliveryStatus["DEAD_LETTERED"] = "dead-lettered";
34
+ /**
35
+ * An operator stopped it before it succeeded. Terminal.
36
+ *
37
+ * Distinct from `DEAD_LETTERED`: dead-lettered means the gateway tried and failed, cancelled
38
+ * means someone decided it should not be sent. Collapsing them makes "how reliable is our
39
+ * delivery" unanswerable.
40
+ */
41
+ DeliveryStatus["CANCELLED"] = "cancelled";
42
+ })(DeliveryStatus || (exports.DeliveryStatus = DeliveryStatus = {}));
43
+ //# sourceMappingURL=delivery-status.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delivery-status.enum.js","sourceRoot":"","sources":["../../../../src/api/conduit/delivery-status.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,IAAY,cAkCX;AAlCD,WAAY,cAAc;IACtB,mFAAmF;IACnF,qCAAmB,CAAA;IAEnB;;;;;;;OAOG;IACH,yCAAuB,CAAA;IAEvB,8CAA8C;IAC9C,yCAAuB,CAAA;IAEvB;;;;;;OAMG;IACH,iDAA+B,CAAA;IAE/B;;;;;;OAMG;IACH,yCAAuB,CAAA;AAC3B,CAAC,EAlCW,cAAc,8BAAd,cAAc,QAkCzB"}
@@ -0,0 +1,79 @@
1
+ import type { CursorPage } from '../../type/cursor-page.type.js';
2
+ import type { IsoDateTime } from '../../type/iso-date-time.type.js';
3
+ import type { Nullable } from '../../type/nil.type.js';
4
+ import type { UUID } from '../../type/uuid.type.js';
5
+ import type { DeliveryStatus } from './delivery-status.enum.js';
6
+ /** One capture on its way to one destination. */
7
+ export interface Delivery {
8
+ id: UUID;
9
+ captureId: UUID;
10
+ /** The route that matched. May since have been deleted — the reference is loose. */
11
+ routeId: UUID;
12
+ destinationId: UUID;
13
+ /**
14
+ * Snapshotted when the delivery was enqueued, not read from the destination now: "we sent it
15
+ * here" must not silently become "we sent it wherever that points today".
16
+ */
17
+ targetUrl: string;
18
+ method: string;
19
+ /**
20
+ * Sent as `Idempotency-Key`, stable across every retry and every redrive.
21
+ *
22
+ * **At-least-once is the only guarantee Conduit offers.** A timeout that actually succeeded,
23
+ * a replica that died after the request landed, and an operator redriving a dead letter all
24
+ * arrive with the same key — a receiver must dedupe on it.
25
+ */
26
+ idempotencyKey: string;
27
+ status: DeliveryStatus;
28
+ attemptCount: number;
29
+ /** Snapshotted from the destination when enqueued. */
30
+ maxAttempts: number;
31
+ nextAttemptAt: IsoDateTime;
32
+ lastAttemptAt: Nullable<IsoDateTime>;
33
+ /** Null when no response arrived. See `lastError`. */
34
+ lastResponseStatus: Nullable<number>;
35
+ lastResponseBodyPreview: Nullable<string>;
36
+ lastError: Nullable<string>;
37
+ /** Set when an operator redrove this. */
38
+ redrivenByUserId: Nullable<UUID>;
39
+ completedAt: Nullable<IsoDateTime>;
40
+ createdAt: IsoDateTime;
41
+ }
42
+ /**
43
+ * One attempt at one delivery.
44
+ *
45
+ * What makes a dead letter diagnosable: "timed out, 502, 502, 401" is a different afternoon from
46
+ * "failed after 5 attempts", and the difference is whether the receiver was down or the
47
+ * credential is wrong.
48
+ */
49
+ export interface DeliveryAttempt {
50
+ id: UUID;
51
+ /** 1-based. */
52
+ attemptNumber: number;
53
+ /** Null when no response arrived at all. */
54
+ responseStatus: Nullable<number>;
55
+ responseBodyPreview: Nullable<string>;
56
+ errorMessage: Nullable<string>;
57
+ /** Wall time, so a receiver that is slow rather than broken is visible. */
58
+ durationMs: number;
59
+ isSuccess: boolean;
60
+ createdAt: IsoDateTime;
61
+ }
62
+ /** `GET /api/v1/deliveries/:id/attempts`. Oldest first — an attempt history reads as a story. */
63
+ export interface DeliveryAttemptsList {
64
+ items: DeliveryAttempt[];
65
+ }
66
+ /** `GET /api/v1/deliveries`. Cursor-paginated: the collection is appended to while it is read. */
67
+ export type DeliveriesPage = CursorPage<Delivery>;
68
+ /** Query for `GET /api/v1/deliveries`. */
69
+ export interface GetDeliveriesQuery {
70
+ limit?: number;
71
+ /** Opaque cursor from the previous page's `nextCursor`. Never parse it. */
72
+ after?: Nullable<string>;
73
+ /** `dead-lettered` is the DLQ view. The DLQ is a filter, not a separate resource. */
74
+ status?: Nullable<DeliveryStatus>;
75
+ destinationId?: Nullable<UUID>;
76
+ /** Everything one capture fanned out to. */
77
+ captureId?: Nullable<UUID>;
78
+ }
79
+ //# sourceMappingURL=delivery.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delivery.type.d.ts","sourceRoot":"","sources":["../../../../src/api/conduit/delivery.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,iDAAiD;AACjD,MAAM,WAAW,QAAQ;IACrB,EAAE,EAAE,IAAI,CAAC;IACT,SAAS,EAAE,IAAI,CAAC;IAEhB,oFAAoF;IACpF,OAAO,EAAE,IAAI,CAAC;IAEd,aAAa,EAAE,IAAI,CAAC;IAEpB;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB,MAAM,EAAE,MAAM,CAAC;IAEf;;;;;;OAMG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB,MAAM,EAAE,cAAc,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IAErB,sDAAsD;IACtD,WAAW,EAAE,MAAM,CAAC;IAEpB,aAAa,EAAE,WAAW,CAAC;IAC3B,aAAa,EA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Q,CAAC,IAAI,CAAC,CAAC;CAC9B"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=delivery.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delivery.type.js","sourceRoot":"","sources":["../../../../src/api/conduit/delivery.type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,73 @@
1
+ import type { IsoDateTime } from '../../type/iso-date-time.type.js';
2
+ import type { Nullable } from '../../type/nil.type.js';
3
+ import type { UUID } from '../../type/uuid.type.js';
4
+ /**
5
+ * A URL Conduit delivers to, in gateway mode.
6
+ *
7
+ * Carries `headerNames`, never the header values. Not masked, not truncated — the values have no
8
+ * field to appear in, the same control the endpoint shapes use for signing secrets. An operator
9
+ * can see that `authorization` is configured; nobody can read it back.
10
+ */
11
+ export interface Destination {
12
+ id: UUID;
13
+ name: string;
14
+ description: Nullable<string>;
15
+ url: string;
16
+ /** Null means the provider's own method is reused — a gateway is a proxy, and a PUT meant a PUT. */
17
+ method: Nullable<string>;
18
+ /** Sorted, lowercase. **The values are never returned by any endpoint of this API.** */
19
+ headerNames: string[];
20
+ /** Per-attempt timeout. Null falls back to the service default. */
21
+ timeoutMs: Nullable<number>;
22
+ /** Attempts before dead-lettering. Null falls back to the service default. */
23
+ maxAttempts: Nullable<number>;
24
+ /** Stops *new* deliveries being enqueued. Does not cancel ones already queued. */
25
+ isActive: boolean;
26
+ createdAt: IsoDateTime;
27
+ updatedAt: IsoDateTime;
28
+ }
29
+ /** `GET /api/v1/destinations`. Offset-paginated — a small, slow-moving collection. */
30
+ export interface DestinationsPage {
31
+ items: Destination[];
32
+ total: number;
33
+ limit: number;
34
+ offset: number;
35
+ }
36
+ /** `POST /api/v1/destinations`. */
37
+ export interface CreateDestinationBody {
38
+ name: string;
39
+ description?: Nullable<string>;
40
+ /**
41
+ * Absolute http/https URL. Private, loopback and link-local addresses are refused unless the
42
+ * service is configured to allow them, which it is locally and is not anywhere else.
43
+ * Credentials in the URL are rejected outright — send them as a header.
44
+ */
45
+ url: string;
46
+ method?: Nullable<string>;
47
+ /**
48
+ * Static headers merged over the forwarded ones. **Stored encrypted and never returned.**
49
+ * This is where an `Authorization` header for the receiver goes.
50
+ */
51
+ headers?: Nullable<Record<string, string>>;
52
+ timeoutMs?: Nullable<number>;
53
+ maxAttempts?: Nullable<number>;
54
+ }
55
+ /**
56
+ * `PATCH /api/v1/destinations/:id`.
57
+ *
58
+ * **`headers` has three states, not two.** Omitting it leaves the stored map untouched, `null`
59
+ * clears it, an object replaces it wholesale. A form must never send `{}` where it means
60
+ * "unchanged" — that strips the receiver's auth header, and the symptom is 401s on deliveries
61
+ * that worked yesterday.
62
+ */
63
+ export interface UpdateDestinationBody {
64
+ name?: string;
65
+ description?: Nullable<string>;
66
+ url?: string;
67
+ method?: Nullable<string>;
68
+ headers?: Nullable<Record<string, string>>;
69
+ timeoutMs?: Nullable<number>;
70
+ maxAttempts?: Nullable<number>;
71
+ isActive?: boolean;
72
+ }
73
+ //# sourceMappingURL=destination.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"destination.type.d.ts","sourceRoot":"","sources":["../../../../src/api/conduit/destination.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IACxB,EAAE,EAAE,IAAI,CAAC;IACT,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC9B,GAAG,EAAE,MAAM,CAAC;IAEZ,oGAAoG;IACpG,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEzB,wFAAwF;IACxF,WAAW,EAAE,MAAM,EAAE,C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C;IAC7B,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=destination.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"destination.type.js","sourceRoot":"","sources":["../../../../src/api/conduit/destination.type.ts"],"names":[],"mappings":""}
@@ -1,8 +1,13 @@
1
1
  export * from './capture.type.js';
2
+ export * from './delivery-status.enum.js';
3
+ export * from './delivery.type.js';
4
+ export * from './destination.type.js';
2
5
  export * from './endpoint.type.js';
3
6
  export * from './handshake-kind.enum.js';
7
+ export * from './match-operator.enum.js';
4
8
  export * from './provider.type.js';
5
9
  export * from './replay.type.js';
10
+ export * from './route.type.js';
6
11
  export * from './signature-algorithm.enum.js';
7
12
  export * from './signature-encoding.enum.js';
8
13
  export * from './signature-header-scheme.enum.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/conduit/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/conduit/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC"}
@@ -15,10 +15,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./capture.type.js"), exports);
18
+ __exportStar(require("./delivery-status.enum.js"), exports);
19
+ __exportStar(require("./delivery.type.js"), exports);
20
+ __exportStar(require("./destination.type.js"), exports);
18
21
  __exportStar(require("./endpoint.type.js"), exports);
19
22
  __exportStar(require("./handshake-kind.enum.js"), exports);
23
+ __exportStar(require("./match-operator.enum.js"), exports);
20
24
  __exportStar(require("./provider.type.js"), exports);
21
25
  __exportStar(require("./replay.type.js"), exports);
26
+ __exportStar(require("./route.type.js"), exports);
22
27
  __exportStar(require("./signature-algorithm.enum.js"), exports);
23
28
  __exportStar(require("./signature-encoding.enum.js"), exports);
24
29
  __exportStar(require("./signature-header-scheme.enum.js"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/conduit/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,qDAAmC;AACnC,2DAAyC;AACzC,qDAAmC;AACnC,mDAAiC;AACjC,gEAA8C;AAC9C,+DAA6C;AAC7C,oEAAkD;AAClD,8DAA4C;AAC5C,sDAAoC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/conduit/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,4DAA0C;AAC1C,qDAAmC;AACnC,wDAAsC;AACtC,qDAAmC;AACnC,2DAAyC;AACzC,2DAAyC;AACzC,qDAAmC;AACnC,mDAAiC;AACjC,kDAAgC;AAChC,gEAA8C;AAC9C,+DAA6C;AAC7C,oEAAkD;AAClD,8DAA4C;AAC5C,sDAAoC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * How one header or body matcher compares.
3
+ *
4
+ * Four operators, and the list is short on purpose. A routing rule is declarative data, never
5
+ * code, and every operator added here is a step toward an expression language — the moment a
6
+ * rule can express arbitrary logic we own the customer's bugs and can never change the
7
+ * evaluator.
8
+ *
9
+ * `EXISTS` earns its place because "this field is present at all" is the most common real
10
+ * condition and cannot be written with the other three.
11
+ */
12
+ export declare enum MatchOperator {
13
+ /** Exact string comparison, case-sensitive. */
14
+ EQUALS = "equals",
15
+ /** Substring. Deliberately not a regular expression. */
16
+ CONTAINS = "contains",
17
+ /** Value starts with the operand. Enough for `application/json; charset=utf-8`. */
18
+ STARTS_WITH = "starts-with",
19
+ /** The field is present, whatever its value. The operand is ignored. */
20
+ EXISTS = "exists"
21
+ }
22
+ //# sourceMappingURL=match-operator.enum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"match-operator.enum.d.ts","sourceRoot":"","sources":["../../../../src/api/conduit/match-operator.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,oBAAY,aAAa;IACrB,+CAA+C;IAC/C,MAAM,WAAW;IAEjB,wDAAwD;IACxD,QAAQ,aAAa;IAErB,mFAAmF;IACnF,WAAW,gBAAgB;IAE3B,wEAAwE;IACxE,MAAM,WAAW;CACpB"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MatchOperator = void 0;
4
+ /**
5
+ * How one header or body matcher compares.
6
+ *
7
+ * Four operators, and the list is short on purpose. A routing rule is declarative data, never
8
+ * code, and every operator added here is a step toward an expression language — the moment a
9
+ * rule can express arbitrary logic we own the customer's bugs and can never change the
10
+ * evaluator.
11
+ *
12
+ * `EXISTS` earns its place because "this field is present at all" is the most common real
13
+ * condition and cannot be written with the other three.
14
+ */
15
+ var MatchOperator;
16
+ (function (MatchOperator) {
17
+ /** Exact string comparison, case-sensitive. */
18
+ MatchOperator["EQUALS"] = "equals";
19
+ /** Substring. Deliberately not a regular expression. */
20
+ MatchOperator["CONTAINS"] = "contains";
21
+ /** Value starts with the operand. Enough for `application/json; charset=utf-8`. */
22
+ MatchOperator["STARTS_WITH"] = "starts-with";
23
+ /** The field is present, whatever its value. The operand is ignored. */
24
+ MatchOperator["EXISTS"] = "exists";
25
+ })(MatchOperator || (exports.MatchOperator = MatchOperator = {}));
26
+ //# sourceMappingURL=match-operator.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"match-operator.enum.js","sourceRoot":"","sources":["../../../../src/api/conduit/match-operator.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACH,IAAY,aAYX;AAZD,WAAY,aAAa;IACrB,+CAA+C;IAC/C,kCAAiB,CAAA;IAEjB,wDAAwD;IACxD,sCAAqB,CAAA;IAErB,mFAAmF;IACnF,4CAA2B,CAAA;IAE3B,wEAAwE;IACxE,kCAAiB,CAAA;AACrB,CAAC,EAZW,aAAa,6BAAb,aAAa,QAYxB"}
@@ -0,0 +1,124 @@
1
+ import type { IsoDateTime } from '../../type/iso-date-time.type.js';
2
+ import type { Maybe, Nullable } from '../../type/nil.type.js';
3
+ import type { UUID } from '../../type/uuid.type.js';
4
+ import type { MatchOperator } from './match-operator.enum.js';
5
+ /** One condition on a request header. */
6
+ export interface HeaderMatcher {
7
+ /** Lowercase. Inbound header names are lowercased, so anything else never matches. */
8
+ name: string;
9
+ operator: MatchOperator;
10
+ /** Ignored when the operator is `exists`. */
11
+ value: Nullable<string>;
12
+ }
13
+ /**
14
+ * One condition on a field inside a JSON body.
15
+ *
16
+ * `path` is a **dotted path**, not JSONPath: `type`, `data.object.id`, `entry.0.changes.0.field`.
17
+ * Numeric segments index arrays.
18
+ *
19
+ * Deliberately not JSONPath and not a regular expression. An expression evaluator running over
20
+ * an attacker-controlled webhook body is a different risk class from a path walk —
21
+ * `jsonpath-plus` shipped a remote code execution hole doing exactly this job (CVE-2024-21534).
22
+ * A dotted path has nothing in it to exploit, and it covers every real routing rule: branch on
23
+ * an event type, a channel, an object id.
24
+ */
25
+ export interface BodyMatcher {
26
+ path: string;
27
+ operator: MatchOperator;
28
+ /** Ignored when the operator is `exists`. */
29
+ value: Nullable<string>;
30
+ }
31
+ /** A matcher as sent on a request, where the operand may simply be omitted. */
32
+ export interface HeaderMatcherInput extends Omit<HeaderMatcher, 'value'> {
33
+ value?: Maybe<string>;
34
+ }
35
+ /** A body matcher as sent on a request. See {@link HeaderMatcherInput}. */
36
+ export interface BodyMatcherInput extends Omit<BodyMatcher, 'value'> {
37
+ value?: Maybe<string>;
38
+ }
39
+ /**
40
+ * Which captures fan out to which destinations.
41
+ *
42
+ * **Every criterion is nullable, and null means "any".** A route with all of them null matches
43
+ * every request on the tenant, which is what a customer writes first. Criteria are ANDed; there
44
+ * is no OR and no negation, because two routes express an OR and one rule that can express
45
+ * arbitrary boolean logic is a language.
46
+ */
47
+ export interface Route {
48
+ id: UUID;
49
+ name: string;
50
+ description: Nullable<string>;
51
+ /** Null matches any endpoint. */
52
+ endpointId: Nullable<UUID>;
53
+ /** Null matches any provider. */
54
+ providerKey: Nullable<string>;
55
+ /** Null matches any method. */
56
+ method: Nullable<string>;
57
+ /**
58
+ * Glob over the path after the ingress token. `*` spans one segment, `**` spans any number,
59
+ * and both ends are anchored — `/orders` does not match `/orders/created`. A glob rather
60
+ * than a regular expression: a customer-supplied pattern evaluated on the ingress path would
61
+ * be a ReDoS primitive. Null matches any path.
62
+ */
63
+ pathPattern: Nullable<string>;
64
+ /** Empty rather than null when there are no conditions, so a client handles one spelling. */
65
+ headerMatchers: HeaderMatcher[];
66
+ bodyMatchers: BodyMatcher[];
67
+ /** In order. At least one. */
68
+ destinationIds: UUID[];
69
+ /** Evaluation order, lowest first. Only observable through `stopOnMatch`. */
70
+ priority: number;
71
+ /**
72
+ * Stop evaluating further routes once this one matches.
73
+ *
74
+ * Default false, so the natural behaviour is fan-out — two routes matching one request both
75
+ * fire, which is what "also send this to the audit service" means.
76
+ */
77
+ stopOnMatch: boolean;
78
+ isActive: boolean;
79
+ createdAt: IsoDateTime;
80
+ updatedAt: IsoDateTime;
81
+ }
82
+ /** `GET /api/v1/routes`. Ordered by priority then age — the order they are evaluated in. */
83
+ export interface RoutesPage {
84
+ items: Route[];
85
+ total: number;
86
+ limit: number;
87
+ offset: number;
88
+ }
89
+ /** `POST /api/v1/routes`. */
90
+ export interface CreateRouteBody {
91
+ name: string;
92
+ description?: Nullable<string>;
93
+ endpointId?: Nullable<UUID>;
94
+ providerKey?: Nullable<string>;
95
+ method?: Nullable<string>;
96
+ pathPattern?: Nullable<string>;
97
+ headerMatchers?: Nullable<HeaderMatcherInput[]>;
98
+ bodyMatchers?: Nullable<BodyMatcherInput[]>;
99
+ destinationIds: UUID[];
100
+ priority?: Nullable<number>;
101
+ stopOnMatch?: Nullable<boolean>;
102
+ }
103
+ /**
104
+ * `PATCH /api/v1/routes/:id`.
105
+ *
106
+ * For the criteria, `null` and omission differ: omitting leaves the stored criterion alone,
107
+ * sending `null` widens the route to "any" for it. A form must send `null` rather than `''` to
108
+ * clear one — an empty string is a criterion nothing matches, which looks like the route broke.
109
+ */
110
+ export interface UpdateRouteBody {
111
+ name?: string;
112
+ description?: Nullable<string>;
113
+ endpointId?: Nullable<UUID>;
114
+ providerKey?: Nullable<string>;
115
+ method?: Nullable<string>;
116
+ pathPattern?: Nullable<string>;
117
+ headerMatchers?: Nullable<HeaderMatcherInput[]>;
118
+ bodyMatchers?: Nullable<BodyMatcherInput[]>;
119
+ destinationIds?: UUID[];
120
+ priority?: number;
121
+ stopOnMatch?: boolean;
122
+ isActive?: boolean;
123
+ }
124
+ //# sourceMappingURL=route.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route.type.d.ts","sourceRoot":"","sources":["../../../../src/api/conduit/route.type.ts"],"names":[],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AMG;AACH,MAAM,WAAW,eAAe;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/B,UAAU,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC5B,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/B,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC1B,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/B,cAAc,CAAC,EAAE,QAAQ,CAAC,kBAAkB,EAAE,CAAC,CAAC;IAChD,YAAY,CAAC,EAAE,QAAQ,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAC5C,cAAc,CAAC,EAAE,IAAI,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=route.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route.type.js","sourceRoot":"","sources":["../../../../src/api/conduit/route.type.ts"],"names":[],"mappings":""}
@@ -60,7 +60,36 @@ export declare enum UserPermission {
60
60
  CONDUIT_REPLAY_EXECUTE = "conduit:replay:execute",
61
61
  CONDUIT_PROVIDER_READ = "conduit:provider:read",
62
62
  /** Define or amend a custom provider manifest — signature scheme, headers, handshake. */
63
- CONDUIT_PROVIDER_MANAGE = "conduit:provider:manage"
63
+ CONDUIT_PROVIDER_MANAGE = "conduit:provider:manage",
64
+ /** Read destinations. Never exposes their stored header values. */
65
+ CONDUIT_DESTINATION_READ = "conduit:destination:read",
66
+ /**
67
+ * Create, amend or delete a destination — **a URL Conduit will then post to on its own**,
68
+ * repeatedly, from inside our network, carrying whatever a provider sent.
69
+ *
70
+ * Deliberately a single manage permission rather than create/update/delete: the dangerous
71
+ * act is naming the URL at all, and splitting it would imply the three carry different
72
+ * risk. They do not.
73
+ */
74
+ CONDUIT_DESTINATION_MANAGE = "conduit:destination:manage",
75
+ CONDUIT_ROUTE_READ = "conduit:route:read",
76
+ /** Define which captures fan out to which destinations. */
77
+ CONDUIT_ROUTE_MANAGE = "conduit:route:manage",
78
+ /**
79
+ * Read the delivery log and the dead-letter queue, including each attempt's response.
80
+ *
81
+ * Grouped with reading rather than with operating the queue: a delivery record holds a
82
+ * target's response body, which can echo back the payload that was sent.
83
+ */
84
+ CONDUIT_DELIVERY_READ = "conduit:delivery:read",
85
+ /**
86
+ * Redrive a dead-lettered delivery, or cancel one still pending.
87
+ *
88
+ * Separate from `CONDUIT_DELIVERY_READ` for the same reason replay is separate from capture
89
+ * read: it causes an outbound request rather than returning a row, and redriving a large
90
+ * dead-letter backlog is a way to flood a customer's own service.
91
+ */
92
+ CONDUIT_DELIVERY_OPERATE = "conduit:delivery:operate"
64
93
  }
65
94
  /**
66
95
  * Every member, for seeding the owner role and validating custom-role input.
@@ -1 +1 @@
1
- {"version":3,"file":"user-permission.enum.d.ts","sourceRoot":"","sources":["../../../src/enum/user-permission.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,oBAAY,cAAc;IAItB,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB;IAC/B,sFAAsF;IACtF,aAAa,kBAAkB;IAG/B,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAG3B,eAAe,oBAAoB;IACnC,6EAA6E;IAC7E,iBAAiB,sBAAsB;IACvC;;;OAGG;IACH,sBAAsB,2BAA2B;IAGjD,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAG3B,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;IAC/B,cAAc,m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ACH,0BAA0B,+BAA+B;IAGzD,kBAAkB,uBAAuB;IACzC,2DAA2D;IAC3D,oBAAoB,yBAAyB;IAG7C;;;;;OAKG;IACH,qBAAqB,0BAA0B;IAC/C;;;;;;OAMG;IACH,wBAAwB,6BAA6B;CACxD;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,cAAc,EAAiD,CAAC"}
@@ -76,6 +76,38 @@ var UserPermission;
76
76
  UserPermission["CONDUIT_PROVIDER_READ"] = "conduit:provider:read";
77
77
  /** Define or amend a custom provider manifest — signature scheme, headers, handshake. */
78
78
  UserPermission["CONDUIT_PROVIDER_MANAGE"] = "conduit:provider:manage";
79
+ // ── Destination (gateway mode) ──────────────────────────────────────────
80
+ /** Read destinations. Never exposes their stored header values. */
81
+ UserPermission["CONDUIT_DESTINATION_READ"] = "conduit:destination:read";
82
+ /**
83
+ * Create, amend or delete a destination — **a URL Conduit will then post to on its own**,
84
+ * repeatedly, from inside our network, carrying whatever a provider sent.
85
+ *
86
+ * Deliberately a single manage permission rather than create/update/delete: the dangerous
87
+ * act is naming the URL at all, and splitting it would imply the three carry different
88
+ * risk. They do not.
89
+ */
90
+ UserPermission["CONDUIT_DESTINATION_MANAGE"] = "conduit:destination:manage";
91
+ // ── Route (gateway mode) ────────────────────────────────────────────────
92
+ UserPermission["CONDUIT_ROUTE_READ"] = "conduit:route:read";
93
+ /** Define which captures fan out to which destinations. */
94
+ UserPermission["CONDUIT_ROUTE_MANAGE"] = "conduit:route:manage";
95
+ // ── Delivery (gateway mode) ─────────────────────────────────────────────
96
+ /**
97
+ * Read the delivery log and the dead-letter queue, including each attempt's response.
98
+ *
99
+ * Grouped with reading rather than with operating the queue: a delivery record holds a
100
+ * target's response body, which can echo back the payload that was sent.
101
+ */
102
+ UserPermission["CONDUIT_DELIVERY_READ"] = "conduit:delivery:read";
103
+ /**
104
+ * Redrive a dead-lettered delivery, or cancel one still pending.
105
+ *
106
+ * Separate from `CONDUIT_DELIVERY_READ` for the same reason replay is separate from capture
107
+ * read: it causes an outbound request rather than returning a row, and redriving a large
108
+ * dead-letter backlog is a way to flood a customer's own service.
109
+ */
110
+ UserPermission["CONDUIT_DELIVERY_OPERATE"] = "conduit:delivery:operate";
79
111
  })(UserPermission || (exports.UserPermission = UserPermission = {}));
80
112
  /**
81
113
  * Every member, for seeding the owner role and validating custom-role input.
@@ -1 +1 @@
1
- {"version":3,"file":"user-permission.enum.js","sourceRoot":"","sources":["../../../src/enum/user-permission.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,IAAY,cAkEX;AAlED,WAAY,cAAc;IACtB,4EAA4E;IAE5E,2EAA2E;IAC3E,6CAA2B,CAAA;IAC3B,iDAA+B,CAAA;IAC/B,sFAAsF;IACtF,iDAA+B,CAAA;IAE/B,2EAA2E;IAC3E,yCAAuB,CAAA;IACvB,6CAA2B,CAAA;IAC3B,6CAA2B,CAAA;IAC3B,6CAA2B,CAAA;IAE3B,2EAA2E;IAC3E,qDAAmC,CAAA;IACnC,6EAA6E;IAC7E,yDAAuC,CAAA;IACvC;;;OAGG;IACH,mEAAiD,CAAA;IAEjD,2EAA2E;IAC3E,yCAAuB,CAAA;IACvB,6CAA2B,CAAA;IAC3B,6CAA2B,CAAA;IAC3B,6CAA2B,CAAA;IAE3B,2EAA2E;IAC3E,+CAA6B,CAAA;IAC7B,iDAA+B,CAAA;IAC/B,mDAAiC,CAAA;IAEjC,4EAA4E;IAE5E,2EAA2E;IAC3E,qEAAqE;IACrE,iEAA+C,CAAA;IAC/C,qEAAmD,CAAA;IACnD,qEAAmD,CAAA;IACnD,qEAAmD,CAAA;IAEnD,2EAA2E;IAC3E;;;;OAIG;IACH,+DAA6C,CAAA;IAC7C,mEAAiD,CAAA;IAEjD,2EAA2E;IAC3E;;;;OAIG;IACH,mEAAiD,CAAA;IAEjD,2EAA2E;IAC3E,iEAA+C,CAAA;IAC/C,yFAAyF;IACzF,qEAAmD,CAAA;AACvD,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