@iveri/contracts 0.5.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 (57) hide show
  1. package/dist/cjs/api/conduit/connection.type.d.ts +100 -0
  2. package/dist/cjs/api/conduit/connection.type.d.ts.map +1 -0
  3. package/dist/cjs/api/conduit/connection.type.js +3 -0
  4. package/dist/cjs/api/conduit/connection.type.js.map +1 -0
  5. package/dist/cjs/api/conduit/connector-auth-type.enum.d.ts +42 -0
  6. package/dist/cjs/api/conduit/connector-auth-type.enum.d.ts.map +1 -0
  7. package/dist/cjs/api/conduit/connector-auth-type.enum.js +46 -0
  8. package/dist/cjs/api/conduit/connector-auth-type.enum.js.map +1 -0
  9. package/dist/cjs/api/conduit/connector.type.d.ts +179 -0
  10. package/dist/cjs/api/conduit/connector.type.d.ts.map +1 -0
  11. package/dist/cjs/api/conduit/connector.type.js +13 -0
  12. package/dist/cjs/api/conduit/connector.type.js.map +1 -0
  13. package/dist/cjs/api/conduit/dispatch-status.enum.d.ts +40 -0
  14. package/dist/cjs/api/conduit/dispatch-status.enum.d.ts.map +1 -0
  15. package/dist/cjs/api/conduit/dispatch-status.enum.js +44 -0
  16. package/dist/cjs/api/conduit/dispatch-status.enum.js.map +1 -0
  17. package/dist/cjs/api/conduit/dispatch.type.d.ts +143 -0
  18. package/dist/cjs/api/conduit/dispatch.type.d.ts.map +1 -0
  19. package/dist/cjs/api/conduit/dispatch.type.js +3 -0
  20. package/dist/cjs/api/conduit/dispatch.type.js.map +1 -0
  21. package/dist/cjs/api/conduit/index.d.ts +5 -0
  22. package/dist/cjs/api/conduit/index.d.ts.map +1 -1
  23. package/dist/cjs/api/conduit/index.js +5 -0
  24. package/dist/cjs/api/conduit/index.js.map +1 -1
  25. package/dist/cjs/enum/user-permission.enum.d.ts +40 -1
  26. package/dist/cjs/enum/user-permission.enum.d.ts.map +1 -1
  27. package/dist/cjs/enum/user-permission.enum.js +42 -0
  28. package/dist/cjs/enum/user-permission.enum.js.map +1 -1
  29. package/dist/esm/api/conduit/connection.type.d.ts +100 -0
  30. package/dist/esm/api/conduit/connection.type.d.ts.map +1 -0
  31. package/dist/esm/api/conduit/connection.type.js +2 -0
  32. package/dist/esm/api/conduit/connection.type.js.map +1 -0
  33. package/dist/esm/api/conduit/connector-auth-type.enum.d.ts +42 -0
  34. package/dist/esm/api/conduit/connector-auth-type.enum.d.ts.map +1 -0
  35. package/dist/esm/api/conduit/connector-auth-type.enum.js +43 -0
  36. package/dist/esm/api/conduit/connector-auth-type.enum.js.map +1 -0
  37. package/dist/esm/api/conduit/connector.type.d.ts +179 -0
  38. package/dist/esm/api/conduit/connector.type.d.ts.map +1 -0
  39. package/dist/esm/api/conduit/connector.type.js +10 -0
  40. package/dist/esm/api/conduit/connector.type.js.map +1 -0
  41. package/dist/esm/api/conduit/dispatch-status.enum.d.ts +40 -0
  42. package/dist/esm/api/conduit/dispatch-status.enum.d.ts.map +1 -0
  43. package/dist/esm/api/conduit/dispatch-status.enum.js +41 -0
  44. package/dist/esm/api/conduit/dispatch-status.enum.js.map +1 -0
  45. package/dist/esm/api/conduit/dispatch.type.d.ts +143 -0
  46. package/dist/esm/api/conduit/dispatch.type.d.ts.map +1 -0
  47. package/dist/esm/api/conduit/dispatch.type.js +2 -0
  48. package/dist/esm/api/conduit/dispatch.type.js.map +1 -0
  49. package/dist/esm/api/conduit/index.d.ts +5 -0
  50. package/dist/esm/api/conduit/index.d.ts.map +1 -1
  51. package/dist/esm/api/conduit/index.js +5 -0
  52. package/dist/esm/api/conduit/index.js.map +1 -1
  53. package/dist/esm/enum/user-permission.enum.d.ts +40 -1
  54. package/dist/esm/enum/user-permission.enum.d.ts.map +1 -1
  55. package/dist/esm/enum/user-permission.enum.js +42 -0
  56. package/dist/esm/enum/user-permission.enum.js.map +1 -1
  57. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dispatch.type.d.ts","sourceRoot":"","sources":["../../../../src/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AC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAE9C,wDAAwD;IACxD,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAEzC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CACrC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACnC,EAAE,EAAE,IAAI,CAAC;IACT,MAAM,EAAE,cAAc,CAAC;IAEvB,qFAAqF;IACrF,WAAW,EAAE,OAAO,CAAC;IAErB,SAAS,EAAE,WAAW,CAAC;CAC1B"}
@@ -0,0 +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,7 +1,12 @@
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';
2
5
  export * from './delivery-status.enum.js';
3
6
  export * from './delivery.type.js';
4
7
  export * from './destination.type.js';
8
+ export * from './dispatch-status.enum.js';
9
+ export * from './dispatch.type.js';
5
10
  export * from './endpoint.type.js';
6
11
  export * from './handshake-kind.enum.js';
7
12
  export * from './match-operator.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,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"}
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,9 +15,14 @@ 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);
18
21
  __exportStar(require("./delivery-status.enum.js"), exports);
19
22
  __exportStar(require("./delivery.type.js"), exports);
20
23
  __exportStar(require("./destination.type.js"), exports);
24
+ __exportStar(require("./dispatch-status.enum.js"), exports);
25
+ __exportStar(require("./dispatch.type.js"), exports);
21
26
  __exportStar(require("./endpoint.type.js"), exports);
22
27
  __exportStar(require("./handshake-kind.enum.js"), exports);
23
28
  __exportStar(require("./match-operator.enum.js"), exports);
@@ -1 +1 @@
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"}
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"}
@@ -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.
@@ -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,sBAA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BAAgB;IAG3B,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;IAC/B,cAAc,mBAAmB;IAKjC,qEAAqE;IACrE,qBAAqB,0BAA0B;IAC/C,uBAAuB,4BAA4B;IACnD,uBAAuB,4BAA4B;IACnD,uBAAuB,4BAA4B;IAGnD;;;;OAIG;IACH,oBAAoB,yBAAyB;IAC7C,sBAAsB,2BAA2B;IAGjD;;;;OAIG;IACH,sBAAsB,2BAA2B;IAGjD,qBAAqB,0BAA0B;IAC/C,yFAAyF;IACzF,uBAAuB,4BAA4B;IAGnD,mEAAmE;IACnE,wBAAwB,6BAA6B;IACrD;;;;;;;OAOG;IACH,0BAA0B,+BAA+B;IAGzD,kBAAkB,uBAAuB;IACzC,2DAA2D;IAC3D,oBAAoB,yBAAyB;IAG7C;;;;;OAKG;IACH,qBAAqB,0BAA0B;IAC/C;;;;;;OAMG;IACH,wBAAwB,6BAA6B;IAGrD,wFAAwF;IACxF,sBAAsB,2BAA2B;IACjD;;;;;;;;OAQG;IACH,wBAAwB,6BAA6B;IAGrD,sEAAsE;IACtE,uBAAuB,4BAA4B;IACnD;;;;;OAKG;IACH,yBAAyB,8BAA8B;IAGvD;;;;;OAKG;IACH,qBAAqB,0BAA0B;IAC/C;;;;;;;OAOG;IACH,qBAAqB,0BAA0B;IAC/C,qEAAqE;IACrE,wBAAwB,6BAA6B;CACxD;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,cAAc,EAAiD,CAAC"}
@@ -108,6 +108,48 @@ var UserPermission;
108
108
  * dead-letter backlog is a way to flood a customer's own service.
109
109
  */
110
110
  UserPermission["CONDUIT_DELIVERY_OPERATE"] = "conduit:delivery:operate";
111
+ // ── Connector (outbound) ────────────────────────────────────────────────
112
+ /** Read connector manifests. They hold no credential, so this is configuration only. */
113
+ UserPermission["CONDUIT_CONNECTOR_READ"] = "conduit:connector:read";
114
+ /**
115
+ * Define or amend a connector manifest — **the list of hosts and paths Conduit may be asked
116
+ * to call**, and the token endpoint it will send a customer's client secret to.
117
+ *
118
+ * The most powerful permission in the outbound half. A dispatch cannot name a URL; it can
119
+ * only name an operation somebody with this permission wrote down, which is what keeps
120
+ * outbound from being an authenticated open proxy. Whoever holds this decides where the
121
+ * proxy may point.
122
+ */
123
+ UserPermission["CONDUIT_CONNECTOR_MANAGE"] = "conduit:connector:manage";
124
+ // ── Connection (outbound) ───────────────────────────────────────────────
125
+ /** Read connections. Never exposes their stored credential values. */
126
+ UserPermission["CONDUIT_CONNECTION_READ"] = "conduit:connection:read";
127
+ /**
128
+ * Create, amend or delete a connection — the customer's own third-party credentials.
129
+ *
130
+ * Single manage permission rather than create/update/delete: the dangerous act is holding
131
+ * the credential at all, and the three carry the same risk.
132
+ */
133
+ UserPermission["CONDUIT_CONNECTION_MANAGE"] = "conduit:connection:manage";
134
+ // ── Dispatch (outbound) ─────────────────────────────────────────────────
135
+ /**
136
+ * Read the outbound log and its dead-letter queue, including each attempt's response.
137
+ *
138
+ * A dispatch record holds the payload a vertical asked to send — a customer's message text,
139
+ * an order — so this is a data-read permission, not a config one.
140
+ */
141
+ UserPermission["CONDUIT_DISPATCH_READ"] = "conduit:dispatch:read";
142
+ /**
143
+ * Submit an outbound request. **This is the permission a vertical holds**, and the only one
144
+ * it needs: `unibox-api` sending a reply presents this and nothing else.
145
+ *
146
+ * Separate from `CONDUIT_DISPATCH_OPERATE` because sending is the routine act and operating
147
+ * the queue is the exceptional one — a service principal that can send should not also be
148
+ * able to redrive a backlog.
149
+ */
150
+ UserPermission["CONDUIT_DISPATCH_SEND"] = "conduit:dispatch:send";
151
+ /** Redrive a dead-lettered dispatch, or cancel one still pending. */
152
+ UserPermission["CONDUIT_DISPATCH_OPERATE"] = "conduit:dispatch:operate";
111
153
  })(UserPermission || (exports.UserPermission = UserPermission = {}));
112
154
  /**
113
155
  * 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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A2D;IAC3D,+DAA6C,CAAA;IAE7C,2EAA2E;IAC3E;;;;;OAKG;IACH,iEAA+C,CAAA;IAC/C;;;;;;OAMG;IACH,uEAAqD,CAAA;IAErD,2EAA2E;IAC3E,wFAAwF;IACxF,mEAAiD,CAAA;IACjD;;;;;;;;OAQG;IACH,uEAAqD,CAAA;IAErD,2EAA2E;IAC3E,sEAAsE;IACtE,qEAAmD,CAAA;IACnD;;;;;OAKG;IACH,yEAAuD,CAAA;IAEvD,2EAA2E;IAC3E;;;;;OAKG;IACH,iEAA+C,CAAA;IAC/C;;;;;;;OAOG;IACH,iEAA+C,CAAA;IAC/C,qEAAqE;IACrE,uEAAqD,CAAA;AACzD,CAAC,EAlJW,cAAc,8BAAd,cAAc,QAkJzB;AAED;;;;;GAKG;AACU,QAAA,oBAAoB,GAA8B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC"}
@@ -0,0 +1,100 @@
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
+ * One tenant's configured instance of a connector: the credentials and the account details that
6
+ * turn a manifest into something that can actually send.
7
+ *
8
+ * The split is the reason a manifest can ship in the binary. A connector says "WhatsApp Cloud
9
+ * lives at graph.facebook.com and authenticates with a bearer token"; a connection says "and
10
+ * *this* is our token, for *this* phone number". One is ours and identical for everybody; the
11
+ * other is the customer's and is the single most sensitive thing this service holds.
12
+ *
13
+ * **No endpoint of this API returns a credential value**, in any form — not masked, not
14
+ * truncated, not a length. `credentialNames` answers the only question an operator has, which is
15
+ * whether something is configured. Same control as a destination's headers and an endpoint's
16
+ * signing secret, for the same reason: §11 says one leak ends the company.
17
+ */
18
+ export interface Connection {
19
+ id: UUID;
20
+ /** Stable identifier a dispatch names instead of an id, so callers can be configured by name. */
21
+ key: string;
22
+ name: string;
23
+ description: Nullable<string>;
24
+ /** The manifest this connection instantiates. Built-in or tenant-defined. */
25
+ connectorKey: string;
26
+ /** Sorted. **The values are never returned by any endpoint of this API.** */
27
+ credentialNames: string[];
28
+ /**
29
+ * Non-secret values filling `{placeholders}` in an operation path — a phone number id, an
30
+ * account id, an API version.
31
+ *
32
+ * Deliberately separate from credentials rather than one map with a secrecy flag: a flag is
33
+ * a thing somebody sets wrong once, and the failure mode is a token in a response body.
34
+ * Variables are returned in full because they are the part an operator needs to check.
35
+ */
36
+ variables: Record<string, string>;
37
+ /**
38
+ * When the cached OAuth access token stops being usable, or null when there is none —
39
+ * either because the connector authenticates statically or because nothing has fetched one
40
+ * yet.
41
+ *
42
+ * The expiry is returned, the token is not. It is what makes "why is this connection
43
+ * failing" answerable without exposing anything.
44
+ */
45
+ accessTokenExpiresAt: Nullable<IsoDateTime>;
46
+ /**
47
+ * Why the last authentication attempt failed, or null when the last one worked.
48
+ *
49
+ * A refresh token that a provider has revoked is the most common real failure on this
50
+ * aggregate, and it is invisible otherwise: dispatches simply dead-letter with a 401 and
51
+ * nothing points at the connection.
52
+ */
53
+ lastAuthError: Nullable<string>;
54
+ /** Stops *new* dispatches being accepted. Does not cancel ones already queued. */
55
+ isActive: boolean;
56
+ createdAt: IsoDateTime;
57
+ updatedAt: IsoDateTime;
58
+ }
59
+ /** `GET /api/v1/connections`. Offset-paginated — a small, slow-moving collection. */
60
+ export interface ConnectionsPage {
61
+ items: Connection[];
62
+ total: number;
63
+ limit: number;
64
+ offset: number;
65
+ }
66
+ /** `POST /api/v1/connections`. */
67
+ export interface CreateConnectionBody {
68
+ key: string;
69
+ name: string;
70
+ description?: Nullable<string>;
71
+ connectorKey: string;
72
+ /**
73
+ * Secrets this connection authenticates with. **Stored encrypted and never returned.**
74
+ *
75
+ * Which names are expected depends on the connector's auth type: an `API_KEY_HEADER`
76
+ * manifest names its own, an OAuth one wants `clientId`/`clientSecret` and, for the refresh
77
+ * grant, `refreshToken`.
78
+ */
79
+ credentials: Record<string, string>;
80
+ variables?: Nullable<Record<string, string>>;
81
+ }
82
+ /**
83
+ * `PATCH /api/v1/connections/:id`.
84
+ *
85
+ * **`credentials` has three states, not two.** Omitting it leaves the stored map untouched,
86
+ * `null` clears it, an object replaces it wholesale. A form that sends `{}` meaning "unchanged"
87
+ * deletes the customer's token, and the symptom is every dispatch dead-lettering on a 401.
88
+ *
89
+ * Replacing credentials also discards the cached access token: a token minted from the old
90
+ * client secret is not evidence that the new one works, and keeping it would hide a typo until
91
+ * the token happened to expire.
92
+ */
93
+ export interface UpdateConnectionBody {
94
+ name?: string;
95
+ description?: Nullable<string>;
96
+ credentials?: Nullable<Record<string, string>>;
97
+ variables?: Nullable<Record<string, string>>;
98
+ isActive?: boolean;
99
+ }
100
+ //# sourceMappingURL=connection.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection.type.d.ts","sourceRoot":"","sources":["../../../../src/api/conduit/connection.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;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,UAAU;IACvB,EAAE,EAAE,IAAI,CAAC;IAET,iGAAiG;IACjG,GAAG,EAAE,MAAM,CAAC;IAEZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAE9B,6EAA6E;IAC7E,YAAY,EAAE,MAAM,CAAC;IAErB,6EAA6E;IAC7E,eAAe,EAAE,MAAM,EAAE,CAAC;IAE1B;;;;;;;OAOG;IACH,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAElC;;;;;;;OAOG;IACH,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IAE5C;;;;;;OAMG;IACH,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEhC,kFAAkF;IAClF,QAAQ,EAAE,OAAO,CAAC;IAElB,SAAS,EAAE,WAAW,CAAC;IACvB,SAAS,EAAE,WAAW,CAAC;CAC1B;AAED,qFAAqF;AACrF,MAAM,WAAW,eAAe;IAC5B,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,kCAAkC;AAClC,MAAM,WAAW,oBAAoB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/B,YAAY,EAAE,MAAM,CAAC;IAErB;;;;;;OAMG;IACH,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEpC,SAAS,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAChD;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,oBAAoB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/B,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/C,SAAS,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=connection.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection.type.js","sourceRoot":"","sources":["../../../../src/api/conduit/connection.type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * How a connector proves who we are to the third-party API it fronts.
3
+ *
4
+ * This is the field that decides whether Conduit has to hold a *renewable* credential or merely
5
+ * a static one, and the two are very different operationally: a static key works until someone
6
+ * rotates it, an OAuth token stops working on a schedule and something has to notice first.
7
+ *
8
+ * The list is deliberately short. Every member is a scheme a manifest can describe entirely as
9
+ * data — adding a provider that uses one of these is a manifest and a credential, never a code
10
+ * change, which is the whole promise of §11's connector manifest. A provider needing anything
11
+ * else (a request-signing scheme, mutual TLS) does not get a special case bolted on here; it
12
+ * gets a new member, designed once, with the same "no per-provider branches" rule applied to it.
13
+ */
14
+ export declare enum ConnectorAuthType {
15
+ /** The API is open, or the credential travels in the payload. Nothing is added to a request. */
16
+ NONE = "none",
17
+ /**
18
+ * A static secret sent in a header — `X-Api-Key: …`, `Authorization: Basic …`.
19
+ *
20
+ * The header name and any literal prefix come from the manifest; only the secret comes from
21
+ * the connection. That split is what lets one manifest serve every tenant.
22
+ */
23
+ API_KEY_HEADER = "api-key-header",
24
+ /** A static bearer token. Shorthand for {@link API_KEY_HEADER} with the header and prefix fixed. */
25
+ BEARER_STATIC = "bearer-static",
26
+ /**
27
+ * OAuth 2.0 client credentials (RFC 6749 §4.4): exchange a client id and secret for a
28
+ * short-lived access token, and do it again when it expires. Machine-to-machine, no user.
29
+ */
30
+ OAUTH2_CLIENT_CREDENTIALS = "oauth2-client-credentials",
31
+ /**
32
+ * OAuth 2.0 refresh token (RFC 6749 §6): a long-lived refresh token buys short-lived access
33
+ * tokens.
34
+ *
35
+ * **The refresh token may be rotated by the provider on every use**, and Conduit stores
36
+ * whichever one came back last. That single fact is why refreshing has to be serialised
37
+ * across replicas rather than left to race — two simultaneous refreshes rotate twice, one
38
+ * of the two results is stored, and the connection is dead until a human re-authorises it.
39
+ */
40
+ OAUTH2_REFRESH_TOKEN = "oauth2-refresh-token"
41
+ }
42
+ //# sourceMappingURL=connector-auth-type.enum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connector-auth-type.enum.d.ts","sourceRoot":"","sources":["../../../../src/api/conduit/connector-auth-type.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,oBAAY,iBAAiB;IACzB,gGAAgG;IAChG,IAAI,SAAS;IAEb;;;;;OAKG;IACH,cAAc,mBAAmB;IAEjC,oGAAoG;IACpG,aAAa,kBAAkB;IAE/B;;;OAGG;IACH,yBAAyB,8BAA8B;IAEvD;;;;;;;;OAQG;IACH,oBAAoB,yBAAyB;CAChD"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * How a connector proves who we are to the third-party API it fronts.
3
+ *
4
+ * This is the field that decides whether Conduit has to hold a *renewable* credential or merely
5
+ * a static one, and the two are very different operationally: a static key works until someone
6
+ * rotates it, an OAuth token stops working on a schedule and something has to notice first.
7
+ *
8
+ * The list is deliberately short. Every member is a scheme a manifest can describe entirely as
9
+ * data — adding a provider that uses one of these is a manifest and a credential, never a code
10
+ * change, which is the whole promise of §11's connector manifest. A provider needing anything
11
+ * else (a request-signing scheme, mutual TLS) does not get a special case bolted on here; it
12
+ * gets a new member, designed once, with the same "no per-provider branches" rule applied to it.
13
+ */
14
+ export var ConnectorAuthType;
15
+ (function (ConnectorAuthType) {
16
+ /** The API is open, or the credential travels in the payload. Nothing is added to a request. */
17
+ ConnectorAuthType["NONE"] = "none";
18
+ /**
19
+ * A static secret sent in a header — `X-Api-Key: …`, `Authorization: Basic …`.
20
+ *
21
+ * The header name and any literal prefix come from the manifest; only the secret comes from
22
+ * the connection. That split is what lets one manifest serve every tenant.
23
+ */
24
+ ConnectorAuthType["API_KEY_HEADER"] = "api-key-header";
25
+ /** A static bearer token. Shorthand for {@link API_KEY_HEADER} with the header and prefix fixed. */
26
+ ConnectorAuthType["BEARER_STATIC"] = "bearer-static";
27
+ /**
28
+ * OAuth 2.0 client credentials (RFC 6749 §4.4): exchange a client id and secret for a
29
+ * short-lived access token, and do it again when it expires. Machine-to-machine, no user.
30
+ */
31
+ ConnectorAuthType["OAUTH2_CLIENT_CREDENTIALS"] = "oauth2-client-credentials";
32
+ /**
33
+ * OAuth 2.0 refresh token (RFC 6749 §6): a long-lived refresh token buys short-lived access
34
+ * tokens.
35
+ *
36
+ * **The refresh token may be rotated by the provider on every use**, and Conduit stores
37
+ * whichever one came back last. That single fact is why refreshing has to be serialised
38
+ * across replicas rather than left to race — two simultaneous refreshes rotate twice, one
39
+ * of the two results is stored, and the connection is dead until a human re-authorises it.
40
+ */
41
+ ConnectorAuthType["OAUTH2_REFRESH_TOKEN"] = "oauth2-refresh-token";
42
+ })(ConnectorAuthType || (ConnectorAuthType = {}));
43
+ //# sourceMappingURL=connector-auth-type.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connector-auth-type.enum.js","sourceRoot":"","sources":["../../../../src/api/conduit/connector-auth-type.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,CAAN,IAAY,iBA+BX;AA/BD,WAAY,iBAAiB;IACzB,gGAAgG;IAChG,kCAAa,CAAA;IAEb;;;;;OAKG;IACH,sDAAiC,CAAA;IAEjC,oGAAoG;IACpG,oDAA+B,CAAA;IAE/B;;;OAGG;IACH,4EAAuD,CAAA;IAEvD;;;;;;;;OAQG;IACH,kEAA6C,CAAA;AACjD,CAAC,EA/BW,iBAAiB,KAAjB,iBAAiB,QA+B5B"}
@@ -0,0 +1,179 @@
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
+ import type { ConnectorAuthType } from './connector-auth-type.enum.js';
5
+ /**
6
+ * Credential names an OAuth manifest expects to find on a connection.
7
+ *
8
+ * Fixed rather than manifest-configurable: these are the field names RFC 6749 gives the token
9
+ * request, so letting a manifest rename them would only allow it to be wrong.
10
+ */
11
+ export declare const CONNECTOR_CREDENTIAL_CLIENT_ID = "clientId";
12
+ export declare const CONNECTOR_CREDENTIAL_CLIENT_SECRET = "clientSecret";
13
+ export declare const CONNECTOR_CREDENTIAL_REFRESH_TOKEN = "refreshToken";
14
+ /**
15
+ * How a connector authenticates, as data.
16
+ *
17
+ * Flat with a discriminating {@link ConnectorAuthType} and nullable fields, matching
18
+ * `SignatureManifest` — a discriminated union reads better in TypeScript and validates far worse
19
+ * as a request body, and this shape has to survive `class-validator` on the way in.
20
+ *
21
+ * **A manifest holds no secret.** It names *where* the credential goes; the credential itself
22
+ * lives on a connection, encrypted. That is what makes a manifest safe to return in full to
23
+ * anyone with `conduit:connector:read` and safe to ship in the binary.
24
+ */
25
+ export interface ConnectorAuthManifest {
26
+ type: ConnectorAuthType;
27
+ /**
28
+ * Which credential on the connection holds the secret. `API_KEY_HEADER` only.
29
+ *
30
+ * OAuth manifests do not set it — they read the fixed names above, because those are defined
31
+ * by the grant rather than by us.
32
+ */
33
+ credentialKey: Nullable<string>;
34
+ /** Lowercase header the credential is sent in. `API_KEY_HEADER` only. */
35
+ headerName: Nullable<string>;
36
+ /** Literal text before the credential, e.g. `Bearer ` or `Basic `. Kept verbatim, spaces included. */
37
+ valuePrefix: Nullable<string>;
38
+ /** Token endpoint. `OAUTH2_*` only. Vetted against the SSRF blocklist like any other target. */
39
+ tokenUrl: Nullable<string>;
40
+ /** `scope` sent with the token request, when the provider wants one. */
41
+ scope: Nullable<string>;
42
+ /**
43
+ * Seconds shaved off a token's reported lifetime before it counts as expired.
44
+ *
45
+ * Not a nicety. A token that expires while a request is in flight fails with a 401 that looks
46
+ * exactly like a revoked credential, and the retry that would fix it is indistinguishable
47
+ * from one that never will. Refreshing slightly early makes that case rare instead of
48
+ * routine. Null falls back to the service default.
49
+ */
50
+ expirySkewSeconds: Nullable<number>;
51
+ }
52
+ /** {@link ConnectorAuthManifest} as sent on create/update: nullable fields may simply be omitted. */
53
+ export interface ConnectorAuthManifestInput {
54
+ type: ConnectorAuthType;
55
+ credentialKey?: Nullable<string>;
56
+ headerName?: Nullable<string>;
57
+ valuePrefix?: Nullable<string>;
58
+ tokenUrl?: Nullable<string>;
59
+ scope?: Nullable<string>;
60
+ expirySkewSeconds?: Nullable<number>;
61
+ }
62
+ /**
63
+ * One thing a connector can be asked to do.
64
+ *
65
+ * A dispatch names an operation by {@link key} rather than supplying a URL, and that is the
66
+ * whole security model of the outbound side: a caller chooses from a list somebody with
67
+ * `conduit:connector:manage` wrote down, instead of naming a host Conduit will then post to.
68
+ * Outbound would otherwise be an open proxy with authentication attached.
69
+ */
70
+ export interface ConnectorOperation {
71
+ /** Stable identifier a dispatch names. Lowercase kebab-case: `send-message`. */
72
+ key: string;
73
+ /** Human-readable label for the admin UI. */
74
+ name: string;
75
+ method: string;
76
+ /**
77
+ * Path appended to the connector's `baseUrl`.
78
+ *
79
+ * `{name}` placeholders are filled from the connection's variables first and the dispatch's
80
+ * `pathParams` second. Every placeholder must resolve, or the dispatch is refused at submit
81
+ * time rather than dead-lettering later — the caller is still on the phone at submit time.
82
+ */
83
+ path: string;
84
+ description: Nullable<string>;
85
+ }
86
+ /** Requests per minute, and how many may arrive at once. Applied per connection. */
87
+ export interface ConnectorRateLimit {
88
+ perMinute: number;
89
+ burst: number;
90
+ }
91
+ /**
92
+ * When to try again, and when to stop.
93
+ *
94
+ * Per connector rather than global because providers genuinely differ: one returns 429 with a
95
+ * generous window, another treats a burst as abuse and blocks for an hour.
96
+ */
97
+ export interface ConnectorRetryPolicy {
98
+ maxAttempts: number;
99
+ backoffBaseMs: number;
100
+ backoffMaxMs: number;
101
+ /**
102
+ * Statuses to retry **in addition** to the transient default set (5xx, 408, 425, 429).
103
+ *
104
+ * Additive, never subtractive: a manifest can say "this provider's 400 is transient", which
105
+ * is a fact about that provider, but it cannot claim a 502 is permanent — nothing about a
106
+ * gateway error is provider-specific and the ability to get it wrong buys nothing.
107
+ */
108
+ retryableStatuses: number[];
109
+ /**
110
+ * Statuses meaning the access token is stale.
111
+ *
112
+ * Handled once per attempt and unlike any other status: the token is discarded, refreshed,
113
+ * and the request is sent again immediately rather than after a backoff. A token that
114
+ * expired thirty seconds early is not a failing destination and should not be treated as one.
115
+ */
116
+ authFailureStatuses: number[];
117
+ }
118
+ /**
119
+ * A third-party API, described entirely as data. §11's "connector manifest".
120
+ *
121
+ * Conduit contains no `if (connector === 'whatsapp')` anywhere. Adding TikTok is a manifest and
122
+ * a credential; the code that sends the request never learns a provider's name.
123
+ */
124
+ export interface Connector {
125
+ /** Null for a built-in — it is not a row and cannot be edited or deleted. */
126
+ id: Nullable<UUID>;
127
+ /** Stable identifier a connection references. Lowercase kebab-case. */
128
+ key: string;
129
+ name: string;
130
+ description: Nullable<string>;
131
+ /** Absolute https base every operation path is appended to. */
132
+ baseUrl: string;
133
+ auth: ConnectorAuthManifest;
134
+ operations: ConnectorOperation[];
135
+ /** Null means only the service-wide default applies. */
136
+ rateLimit: Nullable<ConnectorRateLimit>;
137
+ retry: ConnectorRetryPolicy;
138
+ /**
139
+ * Ships with Conduit, in code rather than as a seeded row. Override it by defining your own
140
+ * under the same key — resolution checks a tenant's rows first.
141
+ */
142
+ isBuiltIn: boolean;
143
+ /** Null for a built-in. */
144
+ createdAt: Nullable<IsoDateTime>;
145
+ /** Null for a built-in. */
146
+ updatedAt: Nullable<IsoDateTime>;
147
+ }
148
+ /** Built-ins plus whatever one customer has defined. `GET /api/v1/connectors`. */
149
+ export interface ConnectorsList {
150
+ items: Connector[];
151
+ }
152
+ /** `POST /api/v1/connectors`. */
153
+ export interface CreateConnectorBody {
154
+ key: string;
155
+ name: string;
156
+ description?: Nullable<string>;
157
+ baseUrl: string;
158
+ auth: ConnectorAuthManifestInput;
159
+ operations: ConnectorOperation[];
160
+ rateLimit?: Nullable<ConnectorRateLimit>;
161
+ retry?: Nullable<ConnectorRetryPolicy>;
162
+ }
163
+ /**
164
+ * `PATCH /api/v1/connectors/:id`.
165
+ *
166
+ * `operations` replaces the list wholesale — there is no per-operation patch. Merging would make
167
+ * "remove an operation" unexpressible, and an operation nobody can remove is a URL Conduit will
168
+ * post to forever.
169
+ */
170
+ export interface UpdateConnectorBody {
171
+ name?: string;
172
+ description?: Nullable<string>;
173
+ baseUrl?: string;
174
+ auth?: ConnectorAuthManifestInput;
175
+ operations?: ConnectorOperation[];
176
+ rateLimit?: Nullable<ConnectorRateLimit>;
177
+ retry?: Nullable<ConnectorRetryPolicy>;
178
+ }
179
+ //# sourceMappingURL=connector.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connector.type.d.ts","sourceRoot":"","sources":["../../../../src/api/conduit/connector.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,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAEvE;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,aAAa,CAAC;AACzD,eAAO,MAAM,kCAAkC,iBAAiB,CAAC;AACjE,eAAO,MAAM,kCAAkC,iBAAiB,CAAC;AAEjE;;;;;;;;;;GAUG;AACH,MAAM,WAAW,qBAAqB;IAClC,IAAI,EAAE,iBAAiB,CAAC;IAExB;;;;;OAKG;IACH,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEhC,yEAAyE;IACzE,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAE7B,sGAAsG;IACtG,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAE9B,gGAAgG;IAChG,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAE3B,wEAAwE;IACxE,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAExB;;;;;;;OAOG;IACH,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CACvC;AAED,qGAAqG;AACrG,MAAM,WAAW,0BAA0B;IACvC,IAAI,EAAE,iBAAiB,CAAC;IACx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
+ * Credential names an OAuth manifest expects to find on a connection.
3
+ *
4
+ * Fixed rather than manifest-configurable: these are the field names RFC 6749 gives the token
5
+ * request, so letting a manifest rename them would only allow it to be wrong.
6
+ */
7
+ export const CONNECTOR_CREDENTIAL_CLIENT_ID = 'clientId';
8
+ export const CONNECTOR_CREDENTIAL_CLIENT_SECRET = 'clientSecret';
9
+ export const CONNECTOR_CREDENTIAL_REFRESH_TOKEN = 'refreshToken';
10
+ //# sourceMappingURL=connector.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connector.type.js","sourceRoot":"","sources":["../../../../src/api/conduit/connector.type.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,UAAU,CAAC;AACzD,MAAM,CAAC,MAAM,kCAAkC,GAAG,cAAc,CAAC;AACjE,MAAM,CAAC,MAAM,kCAAkC,GAAG,cAAc,CAAC"}
@@ -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"}