@iveri/contracts 0.4.0 → 0.6.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 (98) hide show
  1. package/README.md +11 -4
  2. package/dist/cjs/api/conduit/connection.type.d.ts +100 -0
  3. package/dist/cjs/api/conduit/connection.type.d.ts.map +1 -0
  4. package/dist/cjs/api/conduit/connection.type.js +3 -0
  5. package/dist/cjs/api/conduit/connection.type.js.map +1 -0
  6. package/dist/cjs/api/conduit/connector-auth-type.enum.d.ts +42 -0
  7. package/dist/cjs/api/conduit/connector-auth-type.enum.d.ts.map +1 -0
  8. package/dist/cjs/api/conduit/connector-auth-type.enum.js +46 -0
  9. package/dist/cjs/api/conduit/connector-auth-type.enum.js.map +1 -0
  10. package/dist/cjs/api/conduit/connector.type.d.ts +179 -0
  11. package/dist/cjs/api/conduit/connector.type.d.ts.map +1 -0
  12. package/dist/cjs/api/conduit/connector.type.js +13 -0
  13. package/dist/cjs/api/conduit/connector.type.js.map +1 -0
  14. package/dist/cjs/api/conduit/delivery-status.enum.d.ts +39 -0
  15. package/dist/cjs/api/conduit/delivery-status.enum.d.ts.map +1 -0
  16. package/dist/cjs/api/conduit/delivery-status.enum.js +43 -0
  17. package/dist/cjs/api/conduit/delivery-status.enum.js.map +1 -0
  18. package/dist/cjs/api/conduit/delivery.type.d.ts +79 -0
  19. package/dist/cjs/api/conduit/delivery.type.d.ts.map +1 -0
  20. package/dist/cjs/api/conduit/delivery.type.js +3 -0
  21. package/dist/cjs/api/conduit/delivery.type.js.map +1 -0
  22. package/dist/cjs/api/conduit/destination.type.d.ts +73 -0
  23. package/dist/cjs/api/conduit/destination.type.d.ts.map +1 -0
  24. package/dist/cjs/api/conduit/destination.type.js +3 -0
  25. package/dist/cjs/api/conduit/destination.type.js.map +1 -0
  26. package/dist/cjs/api/conduit/dispatch-status.enum.d.ts +40 -0
  27. package/dist/cjs/api/conduit/dispatch-status.enum.d.ts.map +1 -0
  28. package/dist/cjs/api/conduit/dispatch-status.enum.js +44 -0
  29. package/dist/cjs/api/conduit/dispatch-status.enum.js.map +1 -0
  30. package/dist/cjs/api/conduit/dispatch.type.d.ts +143 -0
  31. package/dist/cjs/api/conduit/dispatch.type.d.ts.map +1 -0
  32. package/dist/cjs/api/conduit/dispatch.type.js +3 -0
  33. package/dist/cjs/api/conduit/dispatch.type.js.map +1 -0
  34. package/dist/cjs/api/conduit/index.d.ts +10 -0
  35. package/dist/cjs/api/conduit/index.d.ts.map +1 -1
  36. package/dist/cjs/api/conduit/index.js +10 -0
  37. package/dist/cjs/api/conduit/index.js.map +1 -1
  38. package/dist/cjs/api/conduit/match-operator.enum.d.ts +22 -0
  39. package/dist/cjs/api/conduit/match-operator.enum.d.ts.map +1 -0
  40. package/dist/cjs/api/conduit/match-operator.enum.js +26 -0
  41. package/dist/cjs/api/conduit/match-operator.enum.js.map +1 -0
  42. package/dist/cjs/api/conduit/route.type.d.ts +124 -0
  43. package/dist/cjs/api/conduit/route.type.d.ts.map +1 -0
  44. package/dist/cjs/api/conduit/route.type.js +3 -0
  45. package/dist/cjs/api/conduit/route.type.js.map +1 -0
  46. package/dist/cjs/enum/user-permission.enum.d.ts +40 -1
  47. package/dist/cjs/enum/user-permission.enum.d.ts.map +1 -1
  48. package/dist/cjs/enum/user-permission.enum.js +42 -0
  49. package/dist/cjs/enum/user-permission.enum.js.map +1 -1
  50. package/dist/esm/api/conduit/connection.type.d.ts +100 -0
  51. package/dist/esm/api/conduit/connection.type.d.ts.map +1 -0
  52. package/dist/esm/api/conduit/connection.type.js +2 -0
  53. package/dist/esm/api/conduit/connection.type.js.map +1 -0
  54. package/dist/esm/api/conduit/connector-auth-type.enum.d.ts +42 -0
  55. package/dist/esm/api/conduit/connector-auth-type.enum.d.ts.map +1 -0
  56. package/dist/esm/api/conduit/connector-auth-type.enum.js +43 -0
  57. package/dist/esm/api/conduit/connector-auth-type.enum.js.map +1 -0
  58. package/dist/esm/api/conduit/connector.type.d.ts +179 -0
  59. package/dist/esm/api/conduit/connector.type.d.ts.map +1 -0
  60. package/dist/esm/api/conduit/connector.type.js +10 -0
  61. package/dist/esm/api/conduit/connector.type.js.map +1 -0
  62. package/dist/esm/api/conduit/delivery-status.enum.d.ts +39 -0
  63. package/dist/esm/api/conduit/delivery-status.enum.d.ts.map +1 -0
  64. package/dist/esm/api/conduit/delivery-status.enum.js +40 -0
  65. package/dist/esm/api/conduit/delivery-status.enum.js.map +1 -0
  66. package/dist/esm/api/conduit/delivery.type.d.ts +79 -0
  67. package/dist/esm/api/conduit/delivery.type.d.ts.map +1 -0
  68. package/dist/esm/api/conduit/delivery.type.js +2 -0
  69. package/dist/esm/api/conduit/delivery.type.js.map +1 -0
  70. package/dist/esm/api/conduit/destination.type.d.ts +73 -0
  71. package/dist/esm/api/conduit/destination.type.d.ts.map +1 -0
  72. package/dist/esm/api/conduit/destination.type.js +2 -0
  73. package/dist/esm/api/conduit/destination.type.js.map +1 -0
  74. package/dist/esm/api/conduit/dispatch-status.enum.d.ts +40 -0
  75. package/dist/esm/api/conduit/dispatch-status.enum.d.ts.map +1 -0
  76. package/dist/esm/api/conduit/dispatch-status.enum.js +41 -0
  77. package/dist/esm/api/conduit/dispatch-status.enum.js.map +1 -0
  78. package/dist/esm/api/conduit/dispatch.type.d.ts +143 -0
  79. package/dist/esm/api/conduit/dispatch.type.d.ts.map +1 -0
  80. package/dist/esm/api/conduit/dispatch.type.js +2 -0
  81. package/dist/esm/api/conduit/dispatch.type.js.map +1 -0
  82. package/dist/esm/api/conduit/index.d.ts +10 -0
  83. package/dist/esm/api/conduit/index.d.ts.map +1 -1
  84. package/dist/esm/api/conduit/index.js +10 -0
  85. package/dist/esm/api/conduit/index.js.map +1 -1
  86. package/dist/esm/api/conduit/match-operator.enum.d.ts +22 -0
  87. package/dist/esm/api/conduit/match-operator.enum.d.ts.map +1 -0
  88. package/dist/esm/api/conduit/match-operator.enum.js +23 -0
  89. package/dist/esm/api/conduit/match-operator.enum.js.map +1 -0
  90. package/dist/esm/api/conduit/route.type.d.ts +124 -0
  91. package/dist/esm/api/conduit/route.type.d.ts.map +1 -0
  92. package/dist/esm/api/conduit/route.type.js +2 -0
  93. package/dist/esm/api/conduit/route.type.js.map +1 -0
  94. package/dist/esm/enum/user-permission.enum.d.ts +40 -1
  95. package/dist/esm/enum/user-permission.enum.d.ts.map +1 -1
  96. package/dist/esm/enum/user-permission.enum.js +42 -0
  97. package/dist/esm/enum/user-permission.enum.js.map +1 -1
  98. package/package.json +1 -1
@@ -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,MA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AM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3C,SAAS,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;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":""}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Where one outbound dispatch is in its life.
3
+ *
4
+ * The members mirror `DeliveryStatus` exactly, and this is deliberately **not** the same enum.
5
+ * The two are separate wire contracts on separate resources, and sharing one would mean a state
6
+ * added for the inbound queue silently appears on the outbound one's documented API — a
7
+ * connector-specific state has no business showing up on a webhook delivery, and vice versa.
8
+ * Being identical today is not a reason to make them the same type; it is just what happens when
9
+ * two queues share a state machine.
10
+ *
11
+ * There is no `RATE_LIMITED` member on purpose. A dispatch held back by a connector's rate limit
12
+ * is simply `PENDING` with a later `nextAttemptAt`, because that is exactly what it is — waiting
13
+ * for its next attempt time, no differently from one waiting out a backoff. A separate state
14
+ * would suggest an operator has something to do about it.
15
+ */
16
+ export declare enum DispatchStatus {
17
+ /** Waiting for its next attempt time. The only state the processor claims from. */
18
+ PENDING = "pending",
19
+ /**
20
+ * Claimed by a replica and being attempted right now.
21
+ *
22
+ * A row stuck here past the claim timeout is assumed abandoned and reclaimed — and on this
23
+ * side that reclaim is genuinely dangerous, because the request may have already reached the
24
+ * provider. It is why every dispatch carries an idempotency key onward and why a caller must
25
+ * treat outbound as at-least-once too.
26
+ */
27
+ IN_FLIGHT = "in-flight",
28
+ /** The provider accepted it. Terminal. */
29
+ DELIVERED = "delivered",
30
+ /**
31
+ * Every attempt was used and none succeeded, or the failure was permanent. Terminal until an
32
+ * operator redrives it.
33
+ *
34
+ * **This is the dead-letter queue** — a status, not a separate resource.
35
+ */
36
+ DEAD_LETTERED = "dead-lettered",
37
+ /** An operator stopped it before it was sent. Terminal, and distinct from a failure. */
38
+ CANCELLED = "cancelled"
39
+ }
40
+ //# sourceMappingURL=dispatch-status.enum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dispatch-status.enum.d.ts","sourceRoot":"","sources":["../../../../src/api/conduit/dispatch-status.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,oBAAY,cAAc;IACtB,mFAAmF;IACnF,OAAO,YAAY;IAEnB;;;;;;;OAOG;IACH,SAAS,cAAc;IAEvB,0CAA0C;IAC1C,SAAS,cAAc;IAEvB;;;;;OAKG;IACH,aAAa,kBAAkB;IAE/B,wFAAwF;IACxF,SAAS,cAAc;CAC1B"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DispatchStatus = void 0;
4
+ /**
5
+ * Where one outbound dispatch is in its life.
6
+ *
7
+ * The members mirror `DeliveryStatus` exactly, and this is deliberately **not** the same enum.
8
+ * The two are separate wire contracts on separate resources, and sharing one would mean a state
9
+ * added for the inbound queue silently appears on the outbound one's documented API — a
10
+ * connector-specific state has no business showing up on a webhook delivery, and vice versa.
11
+ * Being identical today is not a reason to make them the same type; it is just what happens when
12
+ * two queues share a state machine.
13
+ *
14
+ * There is no `RATE_LIMITED` member on purpose. A dispatch held back by a connector's rate limit
15
+ * is simply `PENDING` with a later `nextAttemptAt`, because that is exactly what it is — waiting
16
+ * for its next attempt time, no differently from one waiting out a backoff. A separate state
17
+ * would suggest an operator has something to do about it.
18
+ */
19
+ var DispatchStatus;
20
+ (function (DispatchStatus) {
21
+ /** Waiting for its next attempt time. The only state the processor claims from. */
22
+ DispatchStatus["PENDING"] = "pending";
23
+ /**
24
+ * Claimed by a replica and being attempted right now.
25
+ *
26
+ * A row stuck here past the claim timeout is assumed abandoned and reclaimed — and on this
27
+ * side that reclaim is genuinely dangerous, because the request may have already reached the
28
+ * provider. It is why every dispatch carries an idempotency key onward and why a caller must
29
+ * treat outbound as at-least-once too.
30
+ */
31
+ DispatchStatus["IN_FLIGHT"] = "in-flight";
32
+ /** The provider accepted it. Terminal. */
33
+ DispatchStatus["DELIVERED"] = "delivered";
34
+ /**
35
+ * Every attempt was used and none succeeded, or the failure was permanent. Terminal until an
36
+ * operator redrives it.
37
+ *
38
+ * **This is the dead-letter queue** — a status, not a separate resource.
39
+ */
40
+ DispatchStatus["DEAD_LETTERED"] = "dead-lettered";
41
+ /** An operator stopped it before it was sent. Terminal, and distinct from a failure. */
42
+ DispatchStatus["CANCELLED"] = "cancelled";
43
+ })(DispatchStatus || (exports.DispatchStatus = DispatchStatus = {}));
44
+ //# sourceMappingURL=dispatch-status.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dispatch-status.enum.js","sourceRoot":"","sources":["../../../../src/api/conduit/dispatch-status.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,IAAY,cA2BX;AA3BD,WAAY,cAAc;IACtB,mFAAmF;IACnF,qCAAmB,CAAA;IAEnB;;;;;;;OAOG;IACH,yCAAuB,CAAA;IAEvB,0CAA0C;IAC1C,yCAAuB,CAAA;IAEvB;;;;;OAKG;IACH,iDAA+B,CAAA;IAE/B,wFAAwF;IACxF,yCAAuB,CAAA;AAC3B,CAAC,EA3BW,cAAc,8BAAd,cAAc,QA2BzB"}
@@ -0,0 +1,143 @@
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 { DispatchStatus } from './dispatch-status.enum.js';
6
+ /**
7
+ * One outbound request Conduit has accepted responsibility for.
8
+ *
9
+ * The inbound pipeline reversed: a vertical POSTs here, Conduit persists and answers `202`, and
10
+ * the provider is called afterwards with retries and a dead-letter queue. The caller is released
11
+ * from the third party's availability entirely — which is the point, because a CRM that awaits
12
+ * the Graph API inline is a CRM that is down whenever Meta is.
13
+ *
14
+ * **The payload is stored as sent.** Conduit does not reshape it into a provider's format; §14
15
+ * rules out transforms beyond header templating, and a gateway that rewrites bodies is a gateway
16
+ * that has opinions about domains it must not know exist.
17
+ */
18
+ export interface Dispatch {
19
+ id: UUID;
20
+ /** The connection this went out through. A loose reference — it may since have been deleted. */
21
+ connectionId: UUID;
22
+ /** Snapshotted, so the record still reads correctly after the connection is renamed. */
23
+ connectionKey: string;
24
+ connectorKey: string;
25
+ /** The operation named at submit time. */
26
+ operation: string;
27
+ /**
28
+ * Resolved when the dispatch was accepted, not read from the manifest now.
29
+ *
30
+ * Same rule as a delivery's target: editing an operation's path must not retroactively
31
+ * change where Conduit says it sent something.
32
+ */
33
+ targetUrl: string;
34
+ method: string;
35
+ /**
36
+ * The caller's own key, echoed back.
37
+ *
38
+ * Submitting twice with the same key returns the **first** dispatch rather than creating a
39
+ * second — which is what makes a vertical's own retry safe. Null when the caller supplied
40
+ * none, in which case a resubmit is a second send and that is the caller's choice.
41
+ */
42
+ idempotencyKey: Nullable<string>;
43
+ status: DispatchStatus;
44
+ attemptCount: number;
45
+ /** Snapshotted from the connector's retry policy when accepted. */
46
+ maxAttempts: number;
47
+ nextAttemptAt: IsoDateTime;
48
+ lastAttemptAt: Nullable<IsoDateTime>;
49
+ /** Null when no response arrived. See `lastError`. */
50
+ lastResponseStatus: Nullable<number>;
51
+ lastResponseBodyPreview: Nullable<string>;
52
+ lastError: Nullable<string>;
53
+ /** Set when an operator redrove this. */
54
+ redrivenByUserId: Nullable<UUID>;
55
+ completedAt: Nullable<IsoDateTime>;
56
+ createdAt: IsoDateTime;
57
+ }
58
+ /**
59
+ * One attempt at one dispatch.
60
+ *
61
+ * `wasRateLimited` is the field that stops an operator misreading the history. A dispatch held
62
+ * back by the connector's own limit did not fail, cost no attempt, and needs nothing done about
63
+ * it — but without a record it looks like a gap in the timeline, and the obvious conclusion is
64
+ * that the queue stalled.
65
+ */
66
+ export interface DispatchAttempt {
67
+ id: UUID;
68
+ /** 1-based. Equal for two rows only when one of them was a rate-limit deferral. */
69
+ attemptNumber: number;
70
+ /** Null when no response arrived at all. */
71
+ responseStatus: Nullable<number>;
72
+ responseBodyPreview: Nullable<string>;
73
+ errorMessage: Nullable<string>;
74
+ durationMs: number;
75
+ isSuccess: boolean;
76
+ /** Recorded but not charged against the attempt budget. */
77
+ wasRateLimited: boolean;
78
+ /** Whether the access token was refreshed and the request re-sent within this attempt. */
79
+ didRefreshCredentials: boolean;
80
+ createdAt: IsoDateTime;
81
+ }
82
+ /** `GET /api/v1/dispatches/:id/attempts`. Oldest first — an attempt history reads as a story. */
83
+ export interface DispatchAttemptsList {
84
+ items: DispatchAttempt[];
85
+ }
86
+ /** `GET /api/v1/dispatches`. Cursor-paginated: the collection is appended to while it is read. */
87
+ export type DispatchesPage = CursorPage<Dispatch>;
88
+ /** Query for `GET /api/v1/dispatches`. */
89
+ export interface GetDispatchesQuery {
90
+ limit?: number;
91
+ /** Opaque cursor from the previous page's `nextCursor`. Never parse it. */
92
+ after?: Nullable<string>;
93
+ /** `dead-lettered` is the DLQ view. The DLQ is a filter, not a separate resource. */
94
+ status?: Nullable<DispatchStatus>;
95
+ connectionId?: Nullable<UUID>;
96
+ operation?: Nullable<string>;
97
+ }
98
+ /**
99
+ * `POST /api/v1/dispatches` — the request a vertical makes to send something.
100
+ *
101
+ * Note what is **not** here: no URL, no host, no arbitrary headers. The caller picks a connection
102
+ * and an operation, both of which someone configured deliberately, and Conduit derives the
103
+ * target. Accepting a URL would make this an authenticated open proxy sitting inside our network.
104
+ */
105
+ export interface SubmitDispatchBody {
106
+ /** Which connection to send through, by its tenant-scoped key. */
107
+ connectionKey: string;
108
+ /** Which of the connector's operations to invoke, by key. */
109
+ operation: string;
110
+ /** The request body, sent to the provider as-is. */
111
+ payload: Record<string, unknown>;
112
+ /**
113
+ * Values for `{placeholders}` in the operation's path that the connection does not supply.
114
+ *
115
+ * Percent-encoded into the path, so a value cannot introduce a path segment or a query
116
+ * string and steer the request at a different endpoint of the same host.
117
+ */
118
+ pathParams?: Nullable<Record<string, string>>;
119
+ /** Appended to the resolved URL. Values are encoded. */
120
+ query?: Nullable<Record<string, string>>;
121
+ /**
122
+ * The caller's idempotency key, scoped to the tenant.
123
+ *
124
+ * **Strongly recommended.** Without one, a vertical that times out submitting and retries
125
+ * sends the customer two messages. With one, the second submit returns the first dispatch.
126
+ */
127
+ idempotencyKey?: Nullable<string>;
128
+ }
129
+ /**
130
+ * `202 Accepted` from `POST /api/v1/dispatches`.
131
+ *
132
+ * Deliberately not the full {@link Dispatch}: at this moment the only true facts are that it was
133
+ * accepted and where to look next. Returning a status the caller might treat as an outcome
134
+ * invites exactly the synchronous coupling this endpoint exists to remove.
135
+ */
136
+ export interface SubmitDispatchResponse {
137
+ id: UUID;
138
+ status: DispatchStatus;
139
+ /** True when this submit matched an existing idempotency key and created nothing. */
140
+ isDuplicate: boolean;
141
+ createdAt: IsoDateTime;
142
+ }
143
+ //# sourceMappingURL=dispatch.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dispatch.type.d.ts","sourceRoot":"","sources":["../../../../src/api/conduit/dispatch.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;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,QAAQ;IACrB,EAAE,EAAE,IAAI,CAAC;IAET,gGAAgG;IAChG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1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=dispatch.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dispatch.type.js","sourceRoot":"","sources":["../../../../src/api/conduit/dispatch.type.ts"],"names":[],"mappings":""}
@@ -1,8 +1,18 @@
1
1
  export * from './capture.type.js';
2
+ export * from './connection.type.js';
3
+ export * from './connector-auth-type.enum.js';
4
+ export * from './connector.type.js';
5
+ export * from './delivery-status.enum.js';
6
+ export * from './delivery.type.js';
7
+ export * from './destination.type.js';
8
+ export * from './dispatch-status.enum.js';
9
+ export * from './dispatch.type.js';
2
10
  export * from './endpoint.type.js';
3
11
  export * from './handshake-kind.enum.js';
12
+ export * from './match-operator.enum.js';
4
13
  export * from './provider.type.js';
5
14
  export * from './replay.type.js';
15
+ export * from './route.type.js';
6
16
  export * from './signature-algorithm.enum.js';
7
17
  export * from './signature-encoding.enum.js';
8
18
  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,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,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,20 @@ 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("./connection.type.js"), exports);
19
+ __exportStar(require("./connector-auth-type.enum.js"), exports);
20
+ __exportStar(require("./connector.type.js"), exports);
21
+ __exportStar(require("./delivery-status.enum.js"), exports);
22
+ __exportStar(require("./delivery.type.js"), exports);
23
+ __exportStar(require("./destination.type.js"), exports);
24
+ __exportStar(require("./dispatch-status.enum.js"), exports);
25
+ __exportStar(require("./dispatch.type.js"), exports);
18
26
  __exportStar(require("./endpoint.type.js"), exports);
19
27
  __exportStar(require("./handshake-kind.enum.js"), exports);
28
+ __exportStar(require("./match-operator.enum.js"), exports);
20
29
  __exportStar(require("./provider.type.js"), exports);
21
30
  __exportStar(require("./replay.type.js"), exports);
31
+ __exportStar(require("./route.type.js"), exports);
22
32
  __exportStar(require("./signature-algorithm.enum.js"), exports);
23
33
  __exportStar(require("./signature-encoding.enum.js"), exports);
24
34
  __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,uDAAqC;AACrC,gEAA8C;AAC9C,sDAAoC;AACpC,4DAA0C;AAC1C,qDAAmC;AACnC,wDAAsC;AACtC,4DAA0C;AAC1C,qDAAmC;AACnC,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":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,yCAAyC;AACzC,MAAM,WAAW,aAAa;IAC1B,sFAAsF;IACtF,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,aAAa,CAAC;IACxB,6CAA6C;IAC7C,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CAC3B;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,aAAa,CAAC;IACxB,6CAA6C;IAC7C,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CAC3B;AAED,+EAA+E;AAC/E,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC;IACpE,KAAK,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACzB;AAED,2EAA2E;AAC3E,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC;IAChE,KAAK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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,EAAE,IAAI,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC5B,WAAW,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;CACnC;AAED;;;;;;GAMG;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":""}
@@ -89,7 +89,46 @@ export declare enum UserPermission {
89
89
  * read: it causes an outbound request rather than returning a row, and redriving a large
90
90
  * dead-letter backlog is a way to flood a customer's own service.
91
91
  */
92
- CONDUIT_DELIVERY_OPERATE = "conduit:delivery:operate"
92
+ CONDUIT_DELIVERY_OPERATE = "conduit:delivery:operate",
93
+ /** Read connector manifests. They hold no credential, so this is configuration only. */
94
+ CONDUIT_CONNECTOR_READ = "conduit:connector:read",
95
+ /**
96
+ * Define or amend a connector manifest — **the list of hosts and paths Conduit may be asked
97
+ * to call**, and the token endpoint it will send a customer's client secret to.
98
+ *
99
+ * The most powerful permission in the outbound half. A dispatch cannot name a URL; it can
100
+ * only name an operation somebody with this permission wrote down, which is what keeps
101
+ * outbound from being an authenticated open proxy. Whoever holds this decides where the
102
+ * proxy may point.
103
+ */
104
+ CONDUIT_CONNECTOR_MANAGE = "conduit:connector:manage",
105
+ /** Read connections. Never exposes their stored credential values. */
106
+ CONDUIT_CONNECTION_READ = "conduit:connection:read",
107
+ /**
108
+ * Create, amend or delete a connection — the customer's own third-party credentials.
109
+ *
110
+ * Single manage permission rather than create/update/delete: the dangerous act is holding
111
+ * the credential at all, and the three carry the same risk.
112
+ */
113
+ CONDUIT_CONNECTION_MANAGE = "conduit:connection:manage",
114
+ /**
115
+ * Read the outbound log and its dead-letter queue, including each attempt's response.
116
+ *
117
+ * A dispatch record holds the payload a vertical asked to send — a customer's message text,
118
+ * an order — so this is a data-read permission, not a config one.
119
+ */
120
+ CONDUIT_DISPATCH_READ = "conduit:dispatch:read",
121
+ /**
122
+ * Submit an outbound request. **This is the permission a vertical holds**, and the only one
123
+ * it needs: `unibox-api` sending a reply presents this and nothing else.
124
+ *
125
+ * Separate from `CONDUIT_DISPATCH_OPERATE` because sending is the routine act and operating
126
+ * the queue is the exceptional one — a service principal that can send should not also be
127
+ * able to redrive a backlog.
128
+ */
129
+ CONDUIT_DISPATCH_SEND = "conduit:dispatch:send",
130
+ /** Redrive a dead-lettered dispatch, or cancel one still pending. */
131
+ CONDUIT_DISPATCH_OPERATE = "conduit:dispatch:operate"
93
132
  }
94
133
  /**
95
134
  * Every member, for seeding the owner role and validating custom-role input.