@substrat-run/contracts 0.163.0 → 0.165.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.
- package/dist/assistant-stream.d.ts +24 -0
- package/dist/assistant-stream.d.ts.map +1 -1
- package/dist/assistant-stream.js +14 -1
- package/dist/assistant-stream.js.map +1 -1
- package/dist/connections.d.ts +7 -1
- package/dist/connections.d.ts.map +1 -1
- package/dist/connections.js +8 -2
- package/dist/connections.js.map +1 -1
- package/dist/connector-call-target.d.ts +24 -0
- package/dist/connector-call-target.d.ts.map +1 -0
- package/dist/connector-call-target.js +23 -0
- package/dist/connector-call-target.js.map +1 -0
- package/dist/deploy.d.ts +104 -0
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +102 -0
- package/dist/deploy.js.map +1 -1
- package/dist/entitlement-namespace.d.ts +33 -0
- package/dist/entitlement-namespace.d.ts.map +1 -0
- package/dist/entitlement-namespace.js +58 -0
- package/dist/entitlement-namespace.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/mail-in.d.ts +213 -0
- package/dist/mail-in.d.ts.map +1 -0
- package/dist/mail-in.js +158 -0
- package/dist/mail-in.js.map +1 -0
- package/dist/manifest.d.ts +8 -0
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +9 -0
- package/dist/manifest.js.map +1 -1
- package/dist/registry.d.ts +46 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +12 -5
- package/dist/registry.js.map +1 -1
- package/dist/vertical-connector.d.ts +314 -0
- package/dist/vertical-connector.d.ts.map +1 -0
- package/dist/vertical-connector.js +221 -0
- package/dist/vertical-connector.js.map +1 -0
- package/dist/wire-signing.d.ts +4 -4
- package/dist/wire-signing.d.ts.map +1 -1
- package/dist/wire-signing.js +16 -5
- package/dist/wire-signing.js.map +1 -1
- package/package.json +1 -1
package/dist/registry.js
CHANGED
|
@@ -3,6 +3,7 @@ import { instant, permissionKey, tenantId, verticalSlug } from './ids.js';
|
|
|
3
3
|
import { envVarSpec, capability, lifecycleHold } from './manifest.js';
|
|
4
4
|
import { declaredSurface } from './routing.js';
|
|
5
5
|
import { platformScriptCollision, platformScriptRefusal } from './script-names.js';
|
|
6
|
+
import { verticalConnectorDeclarations } from './vertical-connector.js';
|
|
6
7
|
/**
|
|
7
8
|
* The vertical + version registry (#31 step 1; D-33's milestone one).
|
|
8
9
|
*
|
|
@@ -66,6 +67,12 @@ export const vertical = z.object({
|
|
|
66
67
|
ownerGrants: z.array(permissionKey).optional(),
|
|
67
68
|
provides: z.array(capability).optional(),
|
|
68
69
|
requires: z.array(capability).optional(),
|
|
70
|
+
/**
|
|
71
|
+
* The vertical-defined connectors its latest push declared (vertical-connectors.md §7.2), as
|
|
72
|
+
* `requires` is carried: what the dashboard renders a credential form from. The platform RUNS a
|
|
73
|
+
* connector from the running version's stored manifest, never from this. Optional and additive.
|
|
74
|
+
*/
|
|
75
|
+
connectors: verticalConnectorDeclarations.optional(),
|
|
69
76
|
/**
|
|
70
77
|
* The surfaces the vertical declares it serves (K-26 multi-surface; labels only —
|
|
71
78
|
* nothing platform-side branches on them). Rides the same install_spec bag as the
|
|
@@ -176,7 +183,7 @@ export const verticalServingState = z.object({
|
|
|
176
183
|
migrationTag: z.string().min(1),
|
|
177
184
|
});
|
|
178
185
|
export const registerVerticalInput = vertical
|
|
179
|
-
.pick({ slug: true, name: true, source: true, envSpec: true, entitlements: true, ownerGrants: true, provides: true, requires: true, provisions: true, sendsEmail: true, lifecycle: true, surfaces: true, listed: true })
|
|
186
|
+
.pick({ slug: true, name: true, source: true, envSpec: true, entitlements: true, ownerGrants: true, provides: true, requires: true, connectors: true, provisions: true, sendsEmail: true, lifecycle: true, surfaces: true, listed: true })
|
|
180
187
|
.extend({
|
|
181
188
|
/**
|
|
182
189
|
* #1923: a slug that would deploy under one of the platform's own script names is refused
|
|
@@ -389,9 +396,8 @@ export const promotionAcknowledgement = z.object({
|
|
|
389
396
|
* The host recomputes the digest from its own stored rows and refuses (`precondition_failed`,
|
|
390
397
|
* reason `promote_review_stale`) when the channel no longer points at `base` or the digest
|
|
391
398
|
* differs. The sent digest is only ever compared, never read as the diff. A consumed
|
|
392
|
-
* `migrationChange` without a binding is refused too
|
|
393
|
-
*
|
|
394
|
-
* promoting wherever no migration — and so no declared data loss — is involved.
|
|
399
|
+
* `permissionChange` or `migrationChange` without a binding is refused too
|
|
400
|
+
* (`promote_review_unbound`).
|
|
395
401
|
*/
|
|
396
402
|
review: z
|
|
397
403
|
.object({
|
|
@@ -411,7 +417,8 @@ export const bindAcknowledgement = promotionAcknowledgement.pick({ exportBreak:
|
|
|
411
417
|
/**
|
|
412
418
|
* #2333: the `reason` on the promote gate's two refusals of a review binding (both
|
|
413
419
|
* `precondition_failed`): `stale`, the binding's base or digest no longer holds, and `unbound`, a
|
|
414
|
-
* migration acknowledgement sent without one. A client answers either by reading
|
|
420
|
+
* permission or migration acknowledgement sent without one. A client answers either by reading
|
|
421
|
+
* the review again.
|
|
415
422
|
*/
|
|
416
423
|
export const PROMOTE_REVIEW_REASONS = {
|
|
417
424
|
stale: 'promote_review_stale',
|
package/dist/registry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.js","s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,OAAO,CAAC,OAAO,CAAC,CAAC,CAAE,MAAY,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5F,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,wBAAwB,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAGjH;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,KAAK,EAAE,qBAAqB;IAC5B,OAAO,EAAE,uBAAuB;CACxB,CAAC;AAGX,mGAAmG;AACnG,MAAM,UAAU,oBAAoB,CAAC,IAAa;IAChD,OAAO,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Vertical-defined connectors (docs/architecture/vertical-connectors.md): the vocabulary a
|
|
4
|
+
* vertical's connector declaration, the platform's call into the vertical's worker, and the
|
|
5
|
+
* vertical's answer share.
|
|
6
|
+
*
|
|
7
|
+
* The platform keeps every piece of state and authority it holds for a first-party connector —
|
|
8
|
+
* the sealed credential, the bindings, the connector state — and hands the vertical's code one
|
|
9
|
+
* connection's worth of it per call (§6). Everything that crosses that call is parsed by these
|
|
10
|
+
* schemas on both ends.
|
|
11
|
+
*/
|
|
12
|
+
/** A dot marks a vertical-defined provider (§4); first-party slugs never contain one. */
|
|
13
|
+
export declare function isVerticalConnectorProvider(provider: string): boolean;
|
|
14
|
+
export declare const verticalConnectorProvider: z.ZodString;
|
|
15
|
+
/**
|
|
16
|
+
* One field of the credential form the dashboard renders for a vertical-defined provider — the
|
|
17
|
+
* dashboard's own `ProviderField`, minus `toggle`. Every field is stored sealed regardless of
|
|
18
|
+
* `secret`, which only decides whether the UI echoes it back.
|
|
19
|
+
*/
|
|
20
|
+
export declare const verticalConnectorField: z.ZodObject<{
|
|
21
|
+
key: z.ZodString;
|
|
22
|
+
label: z.ZodString;
|
|
23
|
+
secret: z.ZodBoolean;
|
|
24
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
25
|
+
optional: z.ZodOptional<z.ZodLiteral<true>>;
|
|
26
|
+
}, z.core.$strict>;
|
|
27
|
+
export type VerticalConnectorField = z.infer<typeof verticalConnectorField>;
|
|
28
|
+
/**
|
|
29
|
+
* The static half of one `defineConnectors` entry (§5.1), as the push manifest carries it.
|
|
30
|
+
*
|
|
31
|
+
* `sweeps`, `binds` and `dispatches` say which optional hooks the code supplies. The probes are
|
|
32
|
+
* mandatory, so they carry no flag. `dispatches` is true exactly when `events` routes something:
|
|
33
|
+
* a routed event with no handler would fail every delivery, and a handler nothing routes to is
|
|
34
|
+
* dead code the declaration should not advertise.
|
|
35
|
+
*/
|
|
36
|
+
export declare const verticalConnectorDeclaration: z.ZodObject<{
|
|
37
|
+
provider: z.ZodString;
|
|
38
|
+
label: z.ZodString;
|
|
39
|
+
description: z.ZodString;
|
|
40
|
+
monogram: z.ZodOptional<z.ZodString>;
|
|
41
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
42
|
+
key: z.ZodString;
|
|
43
|
+
label: z.ZodString;
|
|
44
|
+
secret: z.ZodBoolean;
|
|
45
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
46
|
+
optional: z.ZodOptional<z.ZodLiteral<true>>;
|
|
47
|
+
}, z.core.$strict>>;
|
|
48
|
+
grants: z.ZodArray<z.core.$ZodBranded<z.ZodString, "PermissionKey", "out">>;
|
|
49
|
+
events: z.ZodArray<z.ZodString>;
|
|
50
|
+
sweeps: z.ZodBoolean;
|
|
51
|
+
binds: z.ZodBoolean;
|
|
52
|
+
dispatches: z.ZodBoolean;
|
|
53
|
+
}, z.core.$strict>;
|
|
54
|
+
export type VerticalConnectorDeclaration = z.infer<typeof verticalConnectorDeclaration>;
|
|
55
|
+
export declare const verticalConnectorDeclarations: z.ZodArray<z.ZodObject<{
|
|
56
|
+
provider: z.ZodString;
|
|
57
|
+
label: z.ZodString;
|
|
58
|
+
description: z.ZodString;
|
|
59
|
+
monogram: z.ZodOptional<z.ZodString>;
|
|
60
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
61
|
+
key: z.ZodString;
|
|
62
|
+
label: z.ZodString;
|
|
63
|
+
secret: z.ZodBoolean;
|
|
64
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
65
|
+
optional: z.ZodOptional<z.ZodLiteral<true>>;
|
|
66
|
+
}, z.core.$strict>>;
|
|
67
|
+
grants: z.ZodArray<z.core.$ZodBranded<z.ZodString, "PermissionKey", "out">>;
|
|
68
|
+
events: z.ZodArray<z.ZodString>;
|
|
69
|
+
sweeps: z.ZodBoolean;
|
|
70
|
+
binds: z.ZodBoolean;
|
|
71
|
+
dispatches: z.ZodBoolean;
|
|
72
|
+
}, z.core.$strict>>;
|
|
73
|
+
/** The platform-surface route the platform calls a vertical's connector through (§6.3). */
|
|
74
|
+
export declare const CONNECTOR_CALL_PATH = "/internal/connector-call";
|
|
75
|
+
/** The route the connection-level roles (`probe`, `probe-candidate`) take: no scope, no nonce (§6.3). */
|
|
76
|
+
export declare const CONNECTOR_PROBE_PATH = "/internal/connector-probe";
|
|
77
|
+
/** State per call, serialised, in and out (§6.2). */
|
|
78
|
+
export declare const CONNECTOR_CALL_STATE_MAX_BYTES: number;
|
|
79
|
+
/** State keys per call, in and out (§6.2). */
|
|
80
|
+
export declare const CONNECTOR_CALL_STATE_MAX_KEYS = 2000;
|
|
81
|
+
/** Recorded uses one call may report. */
|
|
82
|
+
export declare const CONNECTOR_CALL_MAX_USES = 100;
|
|
83
|
+
/** The connector-state key the platform keeps a scope's binding under (§6.1). */
|
|
84
|
+
export declare const VERTICAL_CONNECTOR_BINDING_PREFIX = "vc:binding:";
|
|
85
|
+
/** The connector-state prefix the vertical's own state lives under (§6.2). */
|
|
86
|
+
export declare const VERTICAL_CONNECTOR_STATE_PREFIX = "vc:state:";
|
|
87
|
+
export declare function verticalConnectorBindingKey(scopeId: string): string;
|
|
88
|
+
/** `vc:state:-:` for connection-level state, `vc:state:<scopeId>:` for one scope's. */
|
|
89
|
+
export declare function verticalConnectorStatePrefix(scopeId: string | null): string;
|
|
90
|
+
export declare function verticalConnectorStateKey(scopeId: string | null, key: string): string;
|
|
91
|
+
/** The connector's state as a call carries it in: the keys, without their storage prefix. */
|
|
92
|
+
export declare const connectorCallState: z.ZodArray<z.ZodObject<{
|
|
93
|
+
key: z.ZodString;
|
|
94
|
+
value: z.ZodUnknown;
|
|
95
|
+
}, z.core.$strict>>;
|
|
96
|
+
export type ConnectorCallState = z.infer<typeof connectorCallState>;
|
|
97
|
+
/** The connector's state writes as a call carries them out. A `null` value deletes the key. */
|
|
98
|
+
export declare const connectorCallStateWrites: z.ZodArray<z.ZodObject<{
|
|
99
|
+
key: z.ZodString;
|
|
100
|
+
value: z.ZodUnknown;
|
|
101
|
+
}, z.core.$strict>>;
|
|
102
|
+
export type ConnectorCallStateWrites = z.infer<typeof connectorCallStateWrites>;
|
|
103
|
+
/** One recorded use of the connection — the kernel's `ConnectionUseOutcome`, on the wire. */
|
|
104
|
+
export declare const connectionUseOutcome: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
105
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
106
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
107
|
+
timedOut: z.ZodOptional<z.ZodBoolean>;
|
|
108
|
+
ok: z.ZodLiteral<true>;
|
|
109
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
110
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
111
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
112
|
+
timedOut: z.ZodOptional<z.ZodBoolean>;
|
|
113
|
+
ok: z.ZodLiteral<false>;
|
|
114
|
+
error: z.ZodString;
|
|
115
|
+
}, z.core.$strict>], "ok">;
|
|
116
|
+
export type ConnectionUseOutcomeWire = z.infer<typeof connectionUseOutcome>;
|
|
117
|
+
/** A binding the platform holds for a vertical-defined connection (§6.1), at `vc:binding:<scopeId>`. */
|
|
118
|
+
export declare const verticalConnectorBinding: z.ZodObject<{
|
|
119
|
+
scopeId: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
|
|
120
|
+
operation: z.ZodString;
|
|
121
|
+
permission: z.core.$ZodBranded<z.ZodString, "PermissionKey", "out">;
|
|
122
|
+
options: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
123
|
+
declared: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
124
|
+
boundAt: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
|
|
125
|
+
}, z.core.$strict>;
|
|
126
|
+
export type VerticalConnectorBinding = z.infer<typeof verticalConnectorBinding>;
|
|
127
|
+
/** The connection a call is made for, with its opened credential. Never anything else's. */
|
|
128
|
+
export declare const connectorCallConnection: z.ZodObject<{
|
|
129
|
+
id: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
130
|
+
tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
|
|
131
|
+
vertical: z.ZodString;
|
|
132
|
+
provider: z.ZodString;
|
|
133
|
+
externalAccountRef: z.ZodNullable<z.ZodString>;
|
|
134
|
+
expiresAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
|
|
135
|
+
secret: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
136
|
+
}, z.core.$strict>;
|
|
137
|
+
export type ConnectorCallConnection = z.infer<typeof connectorCallConnection>;
|
|
138
|
+
/** The platform's call into a vertical's worker (§6.3), one per role. */
|
|
139
|
+
export declare const connectorCallRequest: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
140
|
+
role: z.ZodLiteral<"probe-candidate">;
|
|
141
|
+
provider: z.ZodString;
|
|
142
|
+
secret: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
143
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
144
|
+
role: z.ZodLiteral<"probe">;
|
|
145
|
+
provider: z.ZodString;
|
|
146
|
+
connection: z.ZodObject<{
|
|
147
|
+
id: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
148
|
+
tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
|
|
149
|
+
vertical: z.ZodString;
|
|
150
|
+
provider: z.ZodString;
|
|
151
|
+
externalAccountRef: z.ZodNullable<z.ZodString>;
|
|
152
|
+
expiresAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
|
|
153
|
+
secret: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
154
|
+
}, z.core.$strict>;
|
|
155
|
+
state: z.ZodArray<z.ZodObject<{
|
|
156
|
+
key: z.ZodString;
|
|
157
|
+
value: z.ZodUnknown;
|
|
158
|
+
}, z.core.$strict>>;
|
|
159
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
160
|
+
role: z.ZodLiteral<"bind">;
|
|
161
|
+
provider: z.ZodString;
|
|
162
|
+
connection: z.ZodObject<{
|
|
163
|
+
id: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
164
|
+
tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
|
|
165
|
+
vertical: z.ZodString;
|
|
166
|
+
provider: z.ZodString;
|
|
167
|
+
externalAccountRef: z.ZodNullable<z.ZodString>;
|
|
168
|
+
expiresAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
|
|
169
|
+
secret: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
170
|
+
}, z.core.$strict>;
|
|
171
|
+
scopeId: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
|
|
172
|
+
options: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
173
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
174
|
+
role: z.ZodLiteral<"sweep">;
|
|
175
|
+
provider: z.ZodString;
|
|
176
|
+
connection: z.ZodObject<{
|
|
177
|
+
id: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
178
|
+
tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
|
|
179
|
+
vertical: z.ZodString;
|
|
180
|
+
provider: z.ZodString;
|
|
181
|
+
externalAccountRef: z.ZodNullable<z.ZodString>;
|
|
182
|
+
expiresAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
|
|
183
|
+
secret: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
184
|
+
}, z.core.$strict>;
|
|
185
|
+
binding: z.ZodObject<{
|
|
186
|
+
scopeId: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
|
|
187
|
+
operation: z.ZodString;
|
|
188
|
+
permission: z.core.$ZodBranded<z.ZodString, "PermissionKey", "out">;
|
|
189
|
+
options: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
190
|
+
declared: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
191
|
+
boundAt: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
|
|
192
|
+
}, z.core.$strict>;
|
|
193
|
+
state: z.ZodArray<z.ZodObject<{
|
|
194
|
+
key: z.ZodString;
|
|
195
|
+
value: z.ZodUnknown;
|
|
196
|
+
}, z.core.$strict>>;
|
|
197
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
198
|
+
role: z.ZodLiteral<"dispatch">;
|
|
199
|
+
provider: z.ZodString;
|
|
200
|
+
connection: z.ZodObject<{
|
|
201
|
+
id: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
202
|
+
tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
|
|
203
|
+
vertical: z.ZodString;
|
|
204
|
+
provider: z.ZodString;
|
|
205
|
+
externalAccountRef: z.ZodNullable<z.ZodString>;
|
|
206
|
+
expiresAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
|
|
207
|
+
secret: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
208
|
+
}, z.core.$strict>;
|
|
209
|
+
scopeId: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
|
|
210
|
+
binding: z.ZodNullable<z.ZodObject<{
|
|
211
|
+
scopeId: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
|
|
212
|
+
operation: z.ZodString;
|
|
213
|
+
permission: z.core.$ZodBranded<z.ZodString, "PermissionKey", "out">;
|
|
214
|
+
options: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
215
|
+
declared: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
216
|
+
boundAt: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
|
|
217
|
+
}, z.core.$strict>>;
|
|
218
|
+
event: z.ZodObject<{
|
|
219
|
+
id: z.core.$ZodBranded<z.ZodString, "EventId", "out">;
|
|
220
|
+
type: z.ZodString;
|
|
221
|
+
schemaVersion: z.ZodNumber;
|
|
222
|
+
occurredAt: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
|
|
223
|
+
tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
|
|
224
|
+
scopeId: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
|
|
225
|
+
actor: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">, z.ZodObject<{
|
|
226
|
+
system: z.core.$ZodBranded<z.ZodString, "ModuleId", "out">;
|
|
227
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
228
|
+
connection: z.ZodString;
|
|
229
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
230
|
+
capability: z.core.$ZodBranded<z.ZodString, "CapabilityId", "out">;
|
|
231
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
232
|
+
vertical: z.ZodString;
|
|
233
|
+
scope: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
|
|
234
|
+
}, z.core.$strip>]>;
|
|
235
|
+
entity: z.ZodObject<{
|
|
236
|
+
entityType: z.ZodString;
|
|
237
|
+
entityId: z.ZodString;
|
|
238
|
+
}, z.core.$strip>;
|
|
239
|
+
piiClass: z.ZodEnum<{
|
|
240
|
+
direct: "direct";
|
|
241
|
+
none: "none";
|
|
242
|
+
pseudonymous: "pseudonymous";
|
|
243
|
+
}>;
|
|
244
|
+
subjectId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "DataSubjectId", "out">>;
|
|
245
|
+
authorization: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
246
|
+
permission: z.core.$ZodBranded<z.ZodString, "PermissionKey", "out">;
|
|
247
|
+
grant: z.ZodOptional<z.ZodString>;
|
|
248
|
+
}, z.core.$strip>>>;
|
|
249
|
+
impersonation: z.ZodOptional<z.ZodObject<{
|
|
250
|
+
session: z.core.$ZodBranded<z.ZodString, "ImpersonationSessionId", "out">;
|
|
251
|
+
by: z.core.$ZodBranded<z.ZodString, "PlatformActorId", "out">;
|
|
252
|
+
}, z.core.$strip>>;
|
|
253
|
+
operation: z.ZodOptional<z.ZodString>;
|
|
254
|
+
payload: z.ZodUnknown;
|
|
255
|
+
}, z.core.$strip>;
|
|
256
|
+
state: z.ZodArray<z.ZodObject<{
|
|
257
|
+
key: z.ZodString;
|
|
258
|
+
value: z.ZodUnknown;
|
|
259
|
+
}, z.core.$strict>>;
|
|
260
|
+
}, z.core.$strict>], "role">;
|
|
261
|
+
export type ConnectorCallRequest = z.infer<typeof connectorCallRequest>;
|
|
262
|
+
/**
|
|
263
|
+
* The vertical's answer. On `ok: false` no state write is applied; `refused` says the connector
|
|
264
|
+
* threw `ConnectorRefusal` (terminal) rather than failing in a way worth retrying.
|
|
265
|
+
*/
|
|
266
|
+
export declare const connectorCallResponse: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
267
|
+
ok: z.ZodLiteral<true>;
|
|
268
|
+
result: z.ZodUnknown;
|
|
269
|
+
state: z.ZodArray<z.ZodObject<{
|
|
270
|
+
key: z.ZodString;
|
|
271
|
+
value: z.ZodUnknown;
|
|
272
|
+
}, z.core.$strict>>;
|
|
273
|
+
uses: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
274
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
275
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
276
|
+
timedOut: z.ZodOptional<z.ZodBoolean>;
|
|
277
|
+
ok: z.ZodLiteral<true>;
|
|
278
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
279
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
280
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
281
|
+
timedOut: z.ZodOptional<z.ZodBoolean>;
|
|
282
|
+
ok: z.ZodLiteral<false>;
|
|
283
|
+
error: z.ZodString;
|
|
284
|
+
}, z.core.$strict>], "ok">>;
|
|
285
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
286
|
+
ok: z.ZodLiteral<false>;
|
|
287
|
+
refused: z.ZodBoolean;
|
|
288
|
+
error: z.ZodString;
|
|
289
|
+
uses: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
290
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
291
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
292
|
+
timedOut: z.ZodOptional<z.ZodBoolean>;
|
|
293
|
+
ok: z.ZodLiteral<true>;
|
|
294
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
295
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
296
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
297
|
+
timedOut: z.ZodOptional<z.ZodBoolean>;
|
|
298
|
+
ok: z.ZodLiteral<false>;
|
|
299
|
+
error: z.ZodString;
|
|
300
|
+
}, z.core.$strict>], "ok">>;
|
|
301
|
+
}, z.core.$strict>], "ok">;
|
|
302
|
+
export type ConnectorCallResponse = z.infer<typeof connectorCallResponse>;
|
|
303
|
+
/** `result` of a `sweep` call. A `probe` or `probe-candidate` call answers `connectionProbe`. */
|
|
304
|
+
export declare const connectorSweepResult: z.ZodObject<{
|
|
305
|
+
landed: z.ZodNumber;
|
|
306
|
+
more: z.ZodBoolean;
|
|
307
|
+
}, z.core.$strip>;
|
|
308
|
+
export type ConnectorSweepResult = z.infer<typeof connectorSweepResult>;
|
|
309
|
+
/** `result` of a `bind` call: the options normalised, which the platform stores on the binding. */
|
|
310
|
+
export declare const connectorBindResult: z.ZodObject<{
|
|
311
|
+
options: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
312
|
+
}, z.core.$strip>;
|
|
313
|
+
export type ConnectorBindResult = z.infer<typeof connectorBindResult>;
|
|
314
|
+
//# sourceMappingURL=vertical-connector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vertical-connector.d.ts","sourceRoot":"","sources":["../src/vertical-connector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;;;;;;;;GASG;AAEH,yFAAyF;AACzF,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAErE;AAED,eAAO,MAAM,yBAAyB,aAGrC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;;;;;;kBAQxB,CAAC;AACZ,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE5E;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;kBA+BrC,CAAC;AACL,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAExF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;mBAStC,CAAC;AAEL,2FAA2F;AAC3F,eAAO,MAAM,mBAAmB,6BAA6B,CAAC;AAC9D,yGAAyG;AACzG,eAAO,MAAM,oBAAoB,8BAA8B,CAAC;AAChE,qDAAqD;AACrD,eAAO,MAAM,8BAA8B,QAAa,CAAC;AACzD,8CAA8C;AAC9C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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BA0C7B,CAAC;AACL,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAIxE;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAGhC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE1E,iGAAiG;AACjG,eAAO,MAAM,oBAAoB;;;iBAA0E,CAAC;AAC5G,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,mGAAmG;AACnG,eAAO,MAAM,mBAAmB;;iBAA2D,CAAC;AAC5F,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { instant, permissionKey, scopeId, tenantId } from './ids.js';
|
|
3
|
+
import { connectionId, connectionProvider } from './connections.js';
|
|
4
|
+
import { connectionLandingOptions } from './connection-landing.js';
|
|
5
|
+
import { domainEvent, eventType } from './events.js';
|
|
6
|
+
/**
|
|
7
|
+
* Vertical-defined connectors (docs/architecture/vertical-connectors.md): the vocabulary a
|
|
8
|
+
* vertical's connector declaration, the platform's call into the vertical's worker, and the
|
|
9
|
+
* vertical's answer share.
|
|
10
|
+
*
|
|
11
|
+
* The platform keeps every piece of state and authority it holds for a first-party connector —
|
|
12
|
+
* the sealed credential, the bindings, the connector state — and hands the vertical's code one
|
|
13
|
+
* connection's worth of it per call (§6). Everything that crosses that call is parsed by these
|
|
14
|
+
* schemas on both ends.
|
|
15
|
+
*/
|
|
16
|
+
/** A dot marks a vertical-defined provider (§4); first-party slugs never contain one. */
|
|
17
|
+
export function isVerticalConnectorProvider(provider) {
|
|
18
|
+
return provider.includes('.');
|
|
19
|
+
}
|
|
20
|
+
export const verticalConnectorProvider = connectionProvider.refine(isVerticalConnectorProvider, 'a vertical-defined provider is <namespace>.<name>');
|
|
21
|
+
/**
|
|
22
|
+
* One field of the credential form the dashboard renders for a vertical-defined provider — the
|
|
23
|
+
* dashboard's own `ProviderField`, minus `toggle`. Every field is stored sealed regardless of
|
|
24
|
+
* `secret`, which only decides whether the UI echoes it back.
|
|
25
|
+
*/
|
|
26
|
+
export const verticalConnectorField = z
|
|
27
|
+
.object({
|
|
28
|
+
key: z.string().max(64).regex(/^[a-zA-Z][a-zA-Z0-9_]*$/, 'a field key is an identifier'),
|
|
29
|
+
label: z.string().min(1).max(80),
|
|
30
|
+
secret: z.boolean(),
|
|
31
|
+
placeholder: z.string().max(120).optional(),
|
|
32
|
+
optional: z.literal(true).optional(),
|
|
33
|
+
})
|
|
34
|
+
.strict();
|
|
35
|
+
/**
|
|
36
|
+
* The static half of one `defineConnectors` entry (§5.1), as the push manifest carries it.
|
|
37
|
+
*
|
|
38
|
+
* `sweeps`, `binds` and `dispatches` say which optional hooks the code supplies. The probes are
|
|
39
|
+
* mandatory, so they carry no flag. `dispatches` is true exactly when `events` routes something:
|
|
40
|
+
* a routed event with no handler would fail every delivery, and a handler nothing routes to is
|
|
41
|
+
* dead code the declaration should not advertise.
|
|
42
|
+
*/
|
|
43
|
+
export const verticalConnectorDeclaration = z
|
|
44
|
+
.object({
|
|
45
|
+
provider: verticalConnectorProvider,
|
|
46
|
+
label: z.string().min(1).max(80),
|
|
47
|
+
description: z.string().max(400),
|
|
48
|
+
monogram: z.string().min(1).max(3).optional(),
|
|
49
|
+
fields: z
|
|
50
|
+
.array(verticalConnectorField)
|
|
51
|
+
.min(1)
|
|
52
|
+
.max(12)
|
|
53
|
+
.refine((fs) => new Set(fs.map((f) => f.key)).size === fs.length, { message: 'field keys must be unique' }),
|
|
54
|
+
/** The connection's standing grants. Required, so a declaration states "none" as `[]`. */
|
|
55
|
+
grants: z.array(permissionKey).max(16),
|
|
56
|
+
/** The event types routed to `dispatch()`. Required for the same reason. */
|
|
57
|
+
events: z
|
|
58
|
+
.array(eventType)
|
|
59
|
+
.max(8)
|
|
60
|
+
.refine((es) => new Set(es).size === es.length, { message: 'routed event types must be unique' }),
|
|
61
|
+
sweeps: z.boolean(),
|
|
62
|
+
binds: z.boolean(),
|
|
63
|
+
dispatches: z.boolean(),
|
|
64
|
+
})
|
|
65
|
+
.strict()
|
|
66
|
+
.superRefine((d, ctx) => {
|
|
67
|
+
if (d.dispatches !== d.events.length > 0) {
|
|
68
|
+
ctx.addIssue({
|
|
69
|
+
code: 'custom',
|
|
70
|
+
path: ['dispatches'],
|
|
71
|
+
message: d.dispatches ? 'dispatches is true but no event is routed to it' : 'events are routed but dispatches is false',
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
export const verticalConnectorDeclarations = z
|
|
76
|
+
.array(verticalConnectorDeclaration)
|
|
77
|
+
.max(8)
|
|
78
|
+
.superRefine((ds, ctx) => {
|
|
79
|
+
const seen = new Set();
|
|
80
|
+
for (const [i, d] of ds.entries()) {
|
|
81
|
+
if (seen.has(d.provider))
|
|
82
|
+
ctx.addIssue({ code: 'custom', path: [i, 'provider'], message: `provider ${d.provider} is declared more than once` });
|
|
83
|
+
seen.add(d.provider);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
/** The platform-surface route the platform calls a vertical's connector through (§6.3). */
|
|
87
|
+
export const CONNECTOR_CALL_PATH = '/internal/connector-call';
|
|
88
|
+
/** The route the connection-level roles (`probe`, `probe-candidate`) take: no scope, no nonce (§6.3). */
|
|
89
|
+
export const CONNECTOR_PROBE_PATH = '/internal/connector-probe';
|
|
90
|
+
/** State per call, serialised, in and out (§6.2). */
|
|
91
|
+
export const CONNECTOR_CALL_STATE_MAX_BYTES = 512 * 1024;
|
|
92
|
+
/** State keys per call, in and out (§6.2). */
|
|
93
|
+
export const CONNECTOR_CALL_STATE_MAX_KEYS = 2000;
|
|
94
|
+
/** Recorded uses one call may report. */
|
|
95
|
+
export const CONNECTOR_CALL_MAX_USES = 100;
|
|
96
|
+
/** The connector-state key the platform keeps a scope's binding under (§6.1). */
|
|
97
|
+
export const VERTICAL_CONNECTOR_BINDING_PREFIX = 'vc:binding:';
|
|
98
|
+
/** The connector-state prefix the vertical's own state lives under (§6.2). */
|
|
99
|
+
export const VERTICAL_CONNECTOR_STATE_PREFIX = 'vc:state:';
|
|
100
|
+
export function verticalConnectorBindingKey(scopeId) {
|
|
101
|
+
return `${VERTICAL_CONNECTOR_BINDING_PREFIX}${scopeId}`;
|
|
102
|
+
}
|
|
103
|
+
/** `vc:state:-:` for connection-level state, `vc:state:<scopeId>:` for one scope's. */
|
|
104
|
+
export function verticalConnectorStatePrefix(scopeId) {
|
|
105
|
+
return `${VERTICAL_CONNECTOR_STATE_PREFIX}${scopeId ?? '-'}:`;
|
|
106
|
+
}
|
|
107
|
+
export function verticalConnectorStateKey(scopeId, key) {
|
|
108
|
+
return `${verticalConnectorStatePrefix(scopeId)}${key}`;
|
|
109
|
+
}
|
|
110
|
+
const stateEntries = (what) => z
|
|
111
|
+
.array(z.object({ key: z.string().min(1).max(200), value: z.unknown() }).strict())
|
|
112
|
+
.max(CONNECTOR_CALL_STATE_MAX_KEYS, { message: `${what} carries at most ${CONNECTOR_CALL_STATE_MAX_KEYS} keys` })
|
|
113
|
+
.superRefine((entries, ctx) => {
|
|
114
|
+
if (new Set(entries.map((e) => e.key)).size !== entries.length)
|
|
115
|
+
ctx.addIssue({ code: 'custom', message: `${what} names a key twice` });
|
|
116
|
+
const bytes = new TextEncoder().encode(JSON.stringify(entries)).byteLength;
|
|
117
|
+
if (bytes > CONNECTOR_CALL_STATE_MAX_BYTES) {
|
|
118
|
+
ctx.addIssue({ code: 'custom', message: `${what} is ${bytes} bytes serialised; at most ${CONNECTOR_CALL_STATE_MAX_BYTES}` });
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
/** The connector's state as a call carries it in: the keys, without their storage prefix. */
|
|
122
|
+
export const connectorCallState = stateEntries('connector state');
|
|
123
|
+
/** The connector's state writes as a call carries them out. A `null` value deletes the key. */
|
|
124
|
+
export const connectorCallStateWrites = stateEntries('connector state writes');
|
|
125
|
+
const useTiming = {
|
|
126
|
+
durationMs: z.number().nonnegative().optional(),
|
|
127
|
+
status: z.number().int().optional(),
|
|
128
|
+
timedOut: z.boolean().optional(),
|
|
129
|
+
};
|
|
130
|
+
/** One recorded use of the connection — the kernel's `ConnectionUseOutcome`, on the wire. */
|
|
131
|
+
export const connectionUseOutcome = z.discriminatedUnion('ok', [
|
|
132
|
+
z.object({ ok: z.literal(true), ...useTiming }).strict(),
|
|
133
|
+
z.object({ ok: z.literal(false), error: z.string().max(600), ...useTiming }).strict(),
|
|
134
|
+
]);
|
|
135
|
+
/** A binding the platform holds for a vertical-defined connection (§6.1), at `vc:binding:<scopeId>`. */
|
|
136
|
+
export const verticalConnectorBinding = z
|
|
137
|
+
.object({
|
|
138
|
+
scopeId,
|
|
139
|
+
operation: z.string().regex(/^[a-zA-Z0-9_-]+\/[a-zA-Z0-9_-]+$/, 'operation is `module/operation`'),
|
|
140
|
+
permission: permissionKey,
|
|
141
|
+
/** The options the connector sees: what its `bind` hook normalised them to. */
|
|
142
|
+
options: connectionLandingOptions,
|
|
143
|
+
/**
|
|
144
|
+
* The options as the landing or the binding door supplied them, before `bind` normalised
|
|
145
|
+
* them. What a declaration is compared with, so a hook that rewrites an option (a folder path
|
|
146
|
+
* to its id) does not read as a changed declaration and re-bind on every pass.
|
|
147
|
+
*/
|
|
148
|
+
declared: connectionLandingOptions,
|
|
149
|
+
boundAt: instant,
|
|
150
|
+
})
|
|
151
|
+
.strict();
|
|
152
|
+
/** The connection a call is made for, with its opened credential. Never anything else's. */
|
|
153
|
+
export const connectorCallConnection = z
|
|
154
|
+
.object({
|
|
155
|
+
id: connectionId,
|
|
156
|
+
tenantId,
|
|
157
|
+
vertical: z.string().min(1),
|
|
158
|
+
provider: verticalConnectorProvider,
|
|
159
|
+
externalAccountRef: z.string().nullable(),
|
|
160
|
+
expiresAt: instant.nullable(),
|
|
161
|
+
secret: z.record(z.string(), z.string()),
|
|
162
|
+
})
|
|
163
|
+
.strict();
|
|
164
|
+
/** The platform's call into a vertical's worker (§6.3), one per role. */
|
|
165
|
+
export const connectorCallRequest = z
|
|
166
|
+
.discriminatedUnion('role', [
|
|
167
|
+
z
|
|
168
|
+
.object({ role: z.literal('probe-candidate'), provider: verticalConnectorProvider, secret: z.record(z.string(), z.string()) })
|
|
169
|
+
.strict(),
|
|
170
|
+
z
|
|
171
|
+
.object({ role: z.literal('probe'), provider: verticalConnectorProvider, connection: connectorCallConnection, state: connectorCallState })
|
|
172
|
+
.strict(),
|
|
173
|
+
z
|
|
174
|
+
.object({
|
|
175
|
+
role: z.literal('bind'),
|
|
176
|
+
provider: verticalConnectorProvider,
|
|
177
|
+
connection: connectorCallConnection,
|
|
178
|
+
scopeId,
|
|
179
|
+
options: z.record(z.string(), z.unknown()),
|
|
180
|
+
})
|
|
181
|
+
.strict(),
|
|
182
|
+
z
|
|
183
|
+
.object({
|
|
184
|
+
role: z.literal('sweep'),
|
|
185
|
+
provider: verticalConnectorProvider,
|
|
186
|
+
connection: connectorCallConnection,
|
|
187
|
+
binding: verticalConnectorBinding,
|
|
188
|
+
state: connectorCallState,
|
|
189
|
+
})
|
|
190
|
+
.strict(),
|
|
191
|
+
z
|
|
192
|
+
.object({
|
|
193
|
+
role: z.literal('dispatch'),
|
|
194
|
+
provider: verticalConnectorProvider,
|
|
195
|
+
connection: connectorCallConnection,
|
|
196
|
+
scopeId,
|
|
197
|
+
binding: verticalConnectorBinding.nullable(),
|
|
198
|
+
event: domainEvent,
|
|
199
|
+
state: connectorCallState,
|
|
200
|
+
})
|
|
201
|
+
.strict(),
|
|
202
|
+
])
|
|
203
|
+
.superRefine((req, ctx) => {
|
|
204
|
+
if ('connection' in req && req.connection.provider !== req.provider) {
|
|
205
|
+
ctx.addIssue({ code: 'custom', path: ['connection', 'provider'], message: `the connection is for ${req.connection.provider}, not ${req.provider}` });
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
const uses = z.array(connectionUseOutcome).max(CONNECTOR_CALL_MAX_USES);
|
|
209
|
+
/**
|
|
210
|
+
* The vertical's answer. On `ok: false` no state write is applied; `refused` says the connector
|
|
211
|
+
* threw `ConnectorRefusal` (terminal) rather than failing in a way worth retrying.
|
|
212
|
+
*/
|
|
213
|
+
export const connectorCallResponse = z.discriminatedUnion('ok', [
|
|
214
|
+
z.object({ ok: z.literal(true), result: z.unknown(), state: connectorCallStateWrites, uses }).strict(),
|
|
215
|
+
z.object({ ok: z.literal(false), refused: z.boolean(), error: z.string().min(1).max(600), uses }).strict(),
|
|
216
|
+
]);
|
|
217
|
+
/** `result` of a `sweep` call. A `probe` or `probe-candidate` call answers `connectionProbe`. */
|
|
218
|
+
export const connectorSweepResult = z.object({ landed: z.number().int().nonnegative(), more: z.boolean() });
|
|
219
|
+
/** `result` of a `bind` call: the options normalised, which the platform stores on the binding. */
|
|
220
|
+
export const connectorBindResult = z.object({ options: z.record(z.string(), z.unknown()) });
|
|
221
|
+
//# sourceMappingURL=vertical-connector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vertical-connector.js","sourceRoot":"","sources":["../src/vertical-connector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBA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