@substrat-run/contracts 0.218.0 → 0.220.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/broker-dead-letters.d.ts +5 -1
- package/dist/broker-dead-letters.d.ts.map +1 -1
- package/dist/broker-dead-letters.js +20 -5
- package/dist/broker-dead-letters.js.map +1 -1
- package/dist/connections.d.ts +40 -0
- package/dist/connections.d.ts.map +1 -1
- package/dist/connections.js +33 -0
- package/dist/connections.js.map +1 -1
- package/dist/control-plane.d.ts +80 -1
- package/dist/control-plane.d.ts.map +1 -1
- package/dist/control-plane.js +72 -2
- package/dist/control-plane.js.map +1 -1
- package/dist/credential-binding.d.ts +63 -0
- package/dist/credential-binding.d.ts.map +1 -0
- package/dist/credential-binding.js +94 -0
- package/dist/credential-binding.js.map +1 -0
- package/dist/deploy.d.ts +49 -20
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +33 -26
- package/dist/deploy.js.map +1 -1
- package/dist/email-intent.d.ts +67 -2
- package/dist/email-intent.d.ts.map +1 -1
- package/dist/email-intent.js +12 -7
- package/dist/email-intent.js.map +1 -1
- package/dist/environments.d.ts +89 -2
- package/dist/environments.d.ts.map +1 -1
- package/dist/environments.js +60 -3
- package/dist/environments.js.map +1 -1
- package/dist/errors.d.ts +12 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +15 -1
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/kernel-events.d.ts.map +1 -1
- package/dist/kernel-events.js +7 -0
- package/dist/kernel-events.js.map +1 -1
- package/dist/manifest.d.ts +9 -0
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +9 -0
- package/dist/manifest.js.map +1 -1
- package/dist/operations.d.ts +24 -0
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +63 -12
- package/dist/operations.js.map +1 -1
- package/dist/outbound-host.d.ts +21 -0
- package/dist/outbound-host.d.ts.map +1 -0
- package/dist/outbound-host.js +28 -0
- package/dist/outbound-host.js.map +1 -0
- package/dist/people.d.ts +79 -0
- package/dist/people.d.ts.map +1 -1
- package/dist/people.js +90 -0
- package/dist/people.js.map +1 -1
- package/dist/platform-request.d.ts +1 -0
- package/dist/platform-request.d.ts.map +1 -1
- package/dist/platform-request.js +7 -0
- package/dist/platform-request.js.map +1 -1
- package/dist/registry.d.ts +24 -0
- package/dist/registry.d.ts.map +1 -1
- package/dist/relay-intents.d.ts +193 -0
- package/dist/relay-intents.d.ts.map +1 -0
- package/dist/relay-intents.js +125 -0
- package/dist/relay-intents.js.map +1 -0
- package/dist/trace.d.ts +211 -0
- package/dist/trace.d.ts.map +1 -0
- package/dist/trace.js +128 -0
- package/dist/trace.js.map +1 -0
- package/dist/vertical-connector.d.ts +114 -1
- package/dist/vertical-connector.d.ts.map +1 -1
- package/dist/vertical-connector.js +48 -8
- package/dist/vertical-connector.js.map +1 -1
- package/package.json +1 -1
package/dist/platform-request.js
CHANGED
|
@@ -190,6 +190,13 @@ export const provisionChildPayload = z.object({
|
|
|
190
190
|
slug: z.string().min(1),
|
|
191
191
|
name: scopeText,
|
|
192
192
|
owner: principalId,
|
|
193
|
+
/**
|
|
194
|
+
* #3625 (K-64): `'home'` provisions the child under its app's home scope in the tenant (production)
|
|
195
|
+
* instead of under the scope the intent was drained from, so host code of another install of the
|
|
196
|
+
* app can place a child where the whole tenant's data lives. The platform resolves the home scope
|
|
197
|
+
* from its directory; the payload never names a scope. Absent: the drained scope is the parent.
|
|
198
|
+
*/
|
|
199
|
+
parent: z.literal('home').optional(),
|
|
193
200
|
});
|
|
194
201
|
/** The well-known intent kind string for `provisionChildPayload`. */
|
|
195
202
|
export const PROVISION_CHILD_KIND = 'provision-child';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-request.js","sourceRoot":"","sources":["../src/platform-request.ts"],"names":[],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C,QAAgB,EAAU,EAAE,CAChE,GAAG,8BAA8B,GAAG,QAAQ,EAAE,CAAC;AAEjD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B,KAAK,EAAE,WAAW;CACnB,CAAC,CAAC;AAGH;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IACrC,8EAA8E;IAC9E,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;IACnB,yFAAyF;IACzF,yFAAyF;IACzF,oEAAoE;IACpE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACvC;;;;;;OAMG;IACH,OAAO,EAAE,CAAC;SACP,MAAM,CAAC;QACN,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;QACrC,oFAAoF;QACpF,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB;;;WAGG;QACH,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE;KACnB,CAAC;SACD,QAAQ,EAAE;CACd,CAAC,CAAC"}
|
package/dist/registry.d.ts
CHANGED
|
@@ -112,6 +112,18 @@ export declare const vertical: z.ZodObject<{
|
|
|
112
112
|
secret: z.ZodBoolean;
|
|
113
113
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
114
114
|
optional: z.ZodOptional<z.ZodLiteral<true>>;
|
|
115
|
+
sentTo: z.ZodOptional<z.ZodObject<{
|
|
116
|
+
hosts: z.ZodArray<z.ZodString>;
|
|
117
|
+
methods: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
118
|
+
DELETE: "DELETE";
|
|
119
|
+
GET: "GET";
|
|
120
|
+
HEAD: "HEAD";
|
|
121
|
+
PATCH: "PATCH";
|
|
122
|
+
POST: "POST";
|
|
123
|
+
PUT: "PUT";
|
|
124
|
+
}>>>;
|
|
125
|
+
paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
126
|
+
}, z.core.$strict>>;
|
|
115
127
|
}, z.core.$strict>>;
|
|
116
128
|
grants: z.ZodArray<z.core.$ZodBranded<z.ZodString, "PermissionKey", "out">>;
|
|
117
129
|
events: z.ZodArray<z.ZodString>;
|
|
@@ -244,6 +256,18 @@ export declare const registerVerticalInput: z.ZodObject<{
|
|
|
244
256
|
secret: z.ZodBoolean;
|
|
245
257
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
246
258
|
optional: z.ZodOptional<z.ZodLiteral<true>>;
|
|
259
|
+
sentTo: z.ZodOptional<z.ZodObject<{
|
|
260
|
+
hosts: z.ZodArray<z.ZodString>;
|
|
261
|
+
methods: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
262
|
+
DELETE: "DELETE";
|
|
263
|
+
GET: "GET";
|
|
264
|
+
HEAD: "HEAD";
|
|
265
|
+
PATCH: "PATCH";
|
|
266
|
+
POST: "POST";
|
|
267
|
+
PUT: "PUT";
|
|
268
|
+
}>>>;
|
|
269
|
+
paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
270
|
+
}, z.core.$strict>>;
|
|
247
271
|
}, z.core.$strict>>;
|
|
248
272
|
grants: z.ZodArray<z.core.$ZodBranded<z.ZodString, "PermissionKey", "out">>;
|
|
249
273
|
events: z.ZodArray<z.ZodString>;
|
package/dist/registry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,C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 6,
|
|
4
|
+
* #3374 decision (d)(1)).
|
|
5
|
+
*
|
|
6
|
+
* A vertical's worker used to POST each of these to the control plane with the shared platform
|
|
7
|
+
* credential, naming its own (tenant, scope) and the principal whose check authorized the act. Each
|
|
8
|
+
* is now an intent the vertical's operation writes in its own transaction, after its own permission
|
|
9
|
+
* check. The platform's drain reads it out of the scope that wrote it, runs the same relay core the
|
|
10
|
+
* route runs, and writes what became of it back into the scope as an outcome event.
|
|
11
|
+
*
|
|
12
|
+
* So none of these payloads names a tenant, a scope or a principal. Which scope asked is the scope the
|
|
13
|
+
* drain read the row from, and who asked is the kernel's stamp on the row (`requestedBy`). Neither is
|
|
14
|
+
* something a payload can say, and neither is taken on a caller's word, as the relays took them.
|
|
15
|
+
*
|
|
16
|
+
* **Nothing here carries a credential, and no answer does either.** The relay writes that cannot meet
|
|
17
|
+
* that are not here: storing a pasted credential (`/internal/connections/upsert`), and minting a mailed
|
|
18
|
+
* connect link, whose URL is a bearer capability for up to thirty days. The mail-in address is a
|
|
19
|
+
* capability too, so a request or a rotation reports that it happened and never the address.
|
|
20
|
+
*/
|
|
21
|
+
/** Bind the scope's own connection to that scope, through the `on-request` landing its running version declares. */
|
|
22
|
+
export declare const CONNECTION_BIND_KIND = "connection-bind";
|
|
23
|
+
/** Drop that binding and take its landing key back on the scope. What the scope landed stays. */
|
|
24
|
+
export declare const CONNECTION_UNBIND_KIND = "connection-unbind";
|
|
25
|
+
/** Revoke a connect link this scope minted, by the id its mint answered. */
|
|
26
|
+
export declare const CONNECT_LINK_REVOKE_KIND = "connect-link-revoke";
|
|
27
|
+
/** Request, rotate or give up the scope's inbound mail address. */
|
|
28
|
+
export declare const MAIL_IN_ADDRESS_KIND = "mail-in-address";
|
|
29
|
+
export declare const RELAY_WRITE_KINDS: readonly ["connection-bind", "connection-unbind", "connect-link-revoke", "mail-in-address"];
|
|
30
|
+
/**
|
|
31
|
+
* `connection-bind`: the bind relay's body without the caller's identity. The operation and key come
|
|
32
|
+
* from the landing the scope's running version declares, never from here; the connector's bind
|
|
33
|
+
* validates and normalises `options`. A rebind keeps the options it does not name.
|
|
34
|
+
*/
|
|
35
|
+
export declare const connectionBindIntent: z.ZodObject<{
|
|
36
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
37
|
+
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
38
|
+
}, z.core.$strict>;
|
|
39
|
+
export type ConnectionBindIntent = z.infer<typeof connectionBindIntent>;
|
|
40
|
+
/** `connection-unbind`: idempotent; unbinding a connection the scope does not hold bound changes nothing. */
|
|
41
|
+
export declare const connectionUnbindIntent: z.ZodObject<{
|
|
42
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
43
|
+
}, z.core.$strict>;
|
|
44
|
+
export type ConnectionUnbindIntent = z.infer<typeof connectionUnbindIntent>;
|
|
45
|
+
/**
|
|
46
|
+
* `connect-link-revoke`: idempotent. A revoked link answers revoked again; a used one answers used,
|
|
47
|
+
* since a spent link has nothing left to revoke. A link of another scope is refused exactly as an
|
|
48
|
+
* unknown one.
|
|
49
|
+
*/
|
|
50
|
+
export declare const connectLinkRevokeIntent: z.ZodObject<{
|
|
51
|
+
linkId: z.core.$ZodBranded<z.ZodString, "ConnectLinkId", "out">;
|
|
52
|
+
}, z.core.$strict>;
|
|
53
|
+
export type ConnectLinkRevokeIntent = z.infer<typeof connectLinkRevokeIntent>;
|
|
54
|
+
/**
|
|
55
|
+
* `mail-in-address`: `request` mints the scope's address when it has none, `rotate` replaces it
|
|
56
|
+
* (carrying the allowlist and any mail in flight), `revoke` gives it up. `allowlist` on `request` or
|
|
57
|
+
* `rotate` replaces the list; absent keeps it. Which operation and key the address lands through is
|
|
58
|
+
* read from the manifest the scope runs, never from here.
|
|
59
|
+
*
|
|
60
|
+
* The address itself is never in the outcome: it is a capability that delivers into the scope. A
|
|
61
|
+
* screen reads it when it shows it, through the proven-caller read (`action: 'get'`).
|
|
62
|
+
*/
|
|
63
|
+
export declare const mailInAddressIntent: z.ZodObject<{
|
|
64
|
+
action: z.ZodEnum<{
|
|
65
|
+
request: "request";
|
|
66
|
+
revoke: "revoke";
|
|
67
|
+
rotate: "rotate";
|
|
68
|
+
}>;
|
|
69
|
+
allowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
70
|
+
}, z.core.$strict>;
|
|
71
|
+
export type MailInAddressIntent = z.infer<typeof mailInAddressIntent>;
|
|
72
|
+
/** A binding was made or changed (`bind`), or dropped (`unbind`). */
|
|
73
|
+
export declare const CONNECTION_BINDING_APPLIED = "connection.binding-applied";
|
|
74
|
+
/** The platform refused the bind or unbind, or gave up on it. Not retried. */
|
|
75
|
+
export declare const CONNECTION_BINDING_REFUSED = "connection.binding-refused";
|
|
76
|
+
/** The link can no longer be opened: revoked now, or already revoked or used. */
|
|
77
|
+
export declare const CONNECT_LINK_REVOKED = "connect-link.revoked";
|
|
78
|
+
/** The platform refused the revoke (an unknown link, say), or gave up on it. */
|
|
79
|
+
export declare const CONNECT_LINK_REVOKE_REFUSED = "connect-link.revoke-refused";
|
|
80
|
+
/** The scope's address was requested, rotated or given up. Never the address. */
|
|
81
|
+
export declare const MAIL_IN_ADDRESS_APPLIED = "mail-in.address-applied";
|
|
82
|
+
/** The platform refused the act, or gave up on it. */
|
|
83
|
+
export declare const MAIL_IN_ADDRESS_REFUSED = "mail-in.address-refused";
|
|
84
|
+
export declare const connectionBindingOutcomePayload: z.ZodObject<{
|
|
85
|
+
request: z.core.$ZodBranded<z.ZodString, "PlatformRequestId", "out">;
|
|
86
|
+
attempts: z.ZodNumber;
|
|
87
|
+
code: z.ZodNullable<z.ZodString>;
|
|
88
|
+
status: z.ZodNullable<z.ZodNumber>;
|
|
89
|
+
gaveUp: z.ZodBoolean;
|
|
90
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
91
|
+
action: z.ZodEnum<{
|
|
92
|
+
bind: "bind";
|
|
93
|
+
unbind: "unbind";
|
|
94
|
+
}>;
|
|
95
|
+
}, z.core.$strict>;
|
|
96
|
+
export type ConnectionBindingOutcomePayload = z.infer<typeof connectionBindingOutcomePayload>;
|
|
97
|
+
export declare const connectLinkRevokeOutcomePayload: z.ZodObject<{
|
|
98
|
+
request: z.core.$ZodBranded<z.ZodString, "PlatformRequestId", "out">;
|
|
99
|
+
attempts: z.ZodNumber;
|
|
100
|
+
code: z.ZodNullable<z.ZodString>;
|
|
101
|
+
status: z.ZodNullable<z.ZodNumber>;
|
|
102
|
+
gaveUp: z.ZodBoolean;
|
|
103
|
+
linkId: z.core.$ZodBranded<z.ZodString, "ConnectLinkId", "out">;
|
|
104
|
+
linkStatus: z.ZodNullable<z.ZodEnum<{
|
|
105
|
+
outstanding: "outstanding";
|
|
106
|
+
revoked: "revoked";
|
|
107
|
+
used: "used";
|
|
108
|
+
}>>;
|
|
109
|
+
}, z.core.$strict>;
|
|
110
|
+
export type ConnectLinkRevokeOutcomePayload = z.infer<typeof connectLinkRevokeOutcomePayload>;
|
|
111
|
+
export declare const mailInAddressOutcomePayload: z.ZodObject<{
|
|
112
|
+
request: z.core.$ZodBranded<z.ZodString, "PlatformRequestId", "out">;
|
|
113
|
+
attempts: z.ZodNumber;
|
|
114
|
+
code: z.ZodNullable<z.ZodString>;
|
|
115
|
+
status: z.ZodNullable<z.ZodNumber>;
|
|
116
|
+
gaveUp: z.ZodBoolean;
|
|
117
|
+
action: z.ZodEnum<{
|
|
118
|
+
request: "request";
|
|
119
|
+
revoke: "revoke";
|
|
120
|
+
rotate: "rotate";
|
|
121
|
+
}>;
|
|
122
|
+
active: z.ZodNullable<z.ZodBoolean>;
|
|
123
|
+
}, z.core.$strict>;
|
|
124
|
+
export type MailInAddressOutcomePayload = z.infer<typeof mailInAddressOutcomePayload>;
|
|
125
|
+
/** The relay-write outcome events a settle may write (one arm of `platformOutcomeEvent`). */
|
|
126
|
+
export declare const relayWriteOutcomeEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
127
|
+
type: z.ZodEnum<{
|
|
128
|
+
"connection.binding-applied": "connection.binding-applied";
|
|
129
|
+
"connection.binding-refused": "connection.binding-refused";
|
|
130
|
+
}>;
|
|
131
|
+
entity: z.ZodObject<{
|
|
132
|
+
entityType: z.ZodString;
|
|
133
|
+
entityId: z.ZodString;
|
|
134
|
+
}, z.core.$strip>;
|
|
135
|
+
payload: z.ZodObject<{
|
|
136
|
+
request: z.core.$ZodBranded<z.ZodString, "PlatformRequestId", "out">;
|
|
137
|
+
attempts: z.ZodNumber;
|
|
138
|
+
code: z.ZodNullable<z.ZodString>;
|
|
139
|
+
status: z.ZodNullable<z.ZodNumber>;
|
|
140
|
+
gaveUp: z.ZodBoolean;
|
|
141
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
142
|
+
action: z.ZodEnum<{
|
|
143
|
+
bind: "bind";
|
|
144
|
+
unbind: "unbind";
|
|
145
|
+
}>;
|
|
146
|
+
}, z.core.$strict>;
|
|
147
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
148
|
+
type: z.ZodEnum<{
|
|
149
|
+
"connect-link.revoke-refused": "connect-link.revoke-refused";
|
|
150
|
+
"connect-link.revoked": "connect-link.revoked";
|
|
151
|
+
}>;
|
|
152
|
+
entity: z.ZodObject<{
|
|
153
|
+
entityType: z.ZodString;
|
|
154
|
+
entityId: z.ZodString;
|
|
155
|
+
}, z.core.$strip>;
|
|
156
|
+
payload: z.ZodObject<{
|
|
157
|
+
request: z.core.$ZodBranded<z.ZodString, "PlatformRequestId", "out">;
|
|
158
|
+
attempts: z.ZodNumber;
|
|
159
|
+
code: z.ZodNullable<z.ZodString>;
|
|
160
|
+
status: z.ZodNullable<z.ZodNumber>;
|
|
161
|
+
gaveUp: z.ZodBoolean;
|
|
162
|
+
linkId: z.core.$ZodBranded<z.ZodString, "ConnectLinkId", "out">;
|
|
163
|
+
linkStatus: z.ZodNullable<z.ZodEnum<{
|
|
164
|
+
outstanding: "outstanding";
|
|
165
|
+
revoked: "revoked";
|
|
166
|
+
used: "used";
|
|
167
|
+
}>>;
|
|
168
|
+
}, z.core.$strict>;
|
|
169
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
170
|
+
type: z.ZodEnum<{
|
|
171
|
+
"mail-in.address-applied": "mail-in.address-applied";
|
|
172
|
+
"mail-in.address-refused": "mail-in.address-refused";
|
|
173
|
+
}>;
|
|
174
|
+
entity: z.ZodObject<{
|
|
175
|
+
entityType: z.ZodString;
|
|
176
|
+
entityId: z.ZodString;
|
|
177
|
+
}, z.core.$strip>;
|
|
178
|
+
payload: z.ZodObject<{
|
|
179
|
+
request: z.core.$ZodBranded<z.ZodString, "PlatformRequestId", "out">;
|
|
180
|
+
attempts: z.ZodNumber;
|
|
181
|
+
code: z.ZodNullable<z.ZodString>;
|
|
182
|
+
status: z.ZodNullable<z.ZodNumber>;
|
|
183
|
+
gaveUp: z.ZodBoolean;
|
|
184
|
+
action: z.ZodEnum<{
|
|
185
|
+
request: "request";
|
|
186
|
+
revoke: "revoke";
|
|
187
|
+
rotate: "rotate";
|
|
188
|
+
}>;
|
|
189
|
+
active: z.ZodNullable<z.ZodBoolean>;
|
|
190
|
+
}, z.core.$strict>;
|
|
191
|
+
}, z.core.$strict>], "type">;
|
|
192
|
+
export type RelayWriteOutcomeEvent = z.infer<typeof relayWriteOutcomeEvent>;
|
|
193
|
+
//# sourceMappingURL=relay-intents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relay-intents.d.ts","sourceRoot":"","sources":["../src/relay-intents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;;;;;;;;;;;;;;;;;GAkBG;AAEH,oHAAoH;AACpH,eAAO,MAAM,oBAAoB,oBAAoB,CAAC;AACtD,iGAAiG;AACjG,eAAO,MAAM,sBAAsB,sBAAsB,CAAC;AAC1D,4EAA4E;AAC5E,eAA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C;AACZ,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAE9F,eAAO,MAAM,2BAA2B;;;;;;;;;;;;kBAO7B,CAAC;AACZ,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEtF,6FAA6F;AAC7F,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAIjC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { connectLinkId, connectLinkStatus, connectionId } from './connections.js';
|
|
3
|
+
import { entityRef } from './events.js';
|
|
4
|
+
import { platformRequestId } from './ids.js';
|
|
5
|
+
import { MAIL_IN_MAX_ALLOWLIST, mailInAllowEntry } from './mail-in.js';
|
|
6
|
+
/**
|
|
7
|
+
* The relay WRITES a vertical used to make by calling up, asked for by writing instead (K-58 step 6,
|
|
8
|
+
* #3374 decision (d)(1)).
|
|
9
|
+
*
|
|
10
|
+
* A vertical's worker used to POST each of these to the control plane with the shared platform
|
|
11
|
+
* credential, naming its own (tenant, scope) and the principal whose check authorized the act. Each
|
|
12
|
+
* is now an intent the vertical's operation writes in its own transaction, after its own permission
|
|
13
|
+
* check. The platform's drain reads it out of the scope that wrote it, runs the same relay core the
|
|
14
|
+
* route runs, and writes what became of it back into the scope as an outcome event.
|
|
15
|
+
*
|
|
16
|
+
* So none of these payloads names a tenant, a scope or a principal. Which scope asked is the scope the
|
|
17
|
+
* drain read the row from, and who asked is the kernel's stamp on the row (`requestedBy`). Neither is
|
|
18
|
+
* something a payload can say, and neither is taken on a caller's word, as the relays took them.
|
|
19
|
+
*
|
|
20
|
+
* **Nothing here carries a credential, and no answer does either.** The relay writes that cannot meet
|
|
21
|
+
* that are not here: storing a pasted credential (`/internal/connections/upsert`), and minting a mailed
|
|
22
|
+
* connect link, whose URL is a bearer capability for up to thirty days. The mail-in address is a
|
|
23
|
+
* capability too, so a request or a rotation reports that it happened and never the address.
|
|
24
|
+
*/
|
|
25
|
+
/** Bind the scope's own connection to that scope, through the `on-request` landing its running version declares. */
|
|
26
|
+
export const CONNECTION_BIND_KIND = 'connection-bind';
|
|
27
|
+
/** Drop that binding and take its landing key back on the scope. What the scope landed stays. */
|
|
28
|
+
export const CONNECTION_UNBIND_KIND = 'connection-unbind';
|
|
29
|
+
/** Revoke a connect link this scope minted, by the id its mint answered. */
|
|
30
|
+
export const CONNECT_LINK_REVOKE_KIND = 'connect-link-revoke';
|
|
31
|
+
/** Request, rotate or give up the scope's inbound mail address. */
|
|
32
|
+
export const MAIL_IN_ADDRESS_KIND = 'mail-in-address';
|
|
33
|
+
export const RELAY_WRITE_KINDS = [CONNECTION_BIND_KIND, CONNECTION_UNBIND_KIND, CONNECT_LINK_REVOKE_KIND, MAIL_IN_ADDRESS_KIND];
|
|
34
|
+
/**
|
|
35
|
+
* `connection-bind`: the bind relay's body without the caller's identity. The operation and key come
|
|
36
|
+
* from the landing the scope's running version declares, never from here; the connector's bind
|
|
37
|
+
* validates and normalises `options`. A rebind keeps the options it does not name.
|
|
38
|
+
*/
|
|
39
|
+
export const connectionBindIntent = z
|
|
40
|
+
.object({
|
|
41
|
+
connectionId,
|
|
42
|
+
options: z.record(z.string().min(1), z.unknown()).optional(),
|
|
43
|
+
})
|
|
44
|
+
.strict();
|
|
45
|
+
/** `connection-unbind`: idempotent; unbinding a connection the scope does not hold bound changes nothing. */
|
|
46
|
+
export const connectionUnbindIntent = z.object({ connectionId }).strict();
|
|
47
|
+
/**
|
|
48
|
+
* `connect-link-revoke`: idempotent. A revoked link answers revoked again; a used one answers used,
|
|
49
|
+
* since a spent link has nothing left to revoke. A link of another scope is refused exactly as an
|
|
50
|
+
* unknown one.
|
|
51
|
+
*/
|
|
52
|
+
export const connectLinkRevokeIntent = z.object({ linkId: connectLinkId }).strict();
|
|
53
|
+
/**
|
|
54
|
+
* `mail-in-address`: `request` mints the scope's address when it has none, `rotate` replaces it
|
|
55
|
+
* (carrying the allowlist and any mail in flight), `revoke` gives it up. `allowlist` on `request` or
|
|
56
|
+
* `rotate` replaces the list; absent keeps it. Which operation and key the address lands through is
|
|
57
|
+
* read from the manifest the scope runs, never from here.
|
|
58
|
+
*
|
|
59
|
+
* The address itself is never in the outcome: it is a capability that delivers into the scope. A
|
|
60
|
+
* screen reads it when it shows it, through the proven-caller read (`action: 'get'`).
|
|
61
|
+
*/
|
|
62
|
+
export const mailInAddressIntent = z
|
|
63
|
+
.object({
|
|
64
|
+
action: z.enum(['request', 'rotate', 'revoke']),
|
|
65
|
+
allowlist: z.array(mailInAllowEntry).max(MAIL_IN_MAX_ALLOWLIST).optional(),
|
|
66
|
+
})
|
|
67
|
+
.strict()
|
|
68
|
+
.refine((m) => m.action !== 'revoke' || m.allowlist === undefined, {
|
|
69
|
+
message: 'a revoke gives the address up; it takes no allowlist',
|
|
70
|
+
path: ['allowlist'],
|
|
71
|
+
});
|
|
72
|
+
/** A binding was made or changed (`bind`), or dropped (`unbind`). */
|
|
73
|
+
export const CONNECTION_BINDING_APPLIED = 'connection.binding-applied';
|
|
74
|
+
/** The platform refused the bind or unbind, or gave up on it. Not retried. */
|
|
75
|
+
export const CONNECTION_BINDING_REFUSED = 'connection.binding-refused';
|
|
76
|
+
/** The link can no longer be opened: revoked now, or already revoked or used. */
|
|
77
|
+
export const CONNECT_LINK_REVOKED = 'connect-link.revoked';
|
|
78
|
+
/** The platform refused the revoke (an unknown link, say), or gave up on it. */
|
|
79
|
+
export const CONNECT_LINK_REVOKE_REFUSED = 'connect-link.revoke-refused';
|
|
80
|
+
/** The scope's address was requested, rotated or given up. Never the address. */
|
|
81
|
+
export const MAIL_IN_ADDRESS_APPLIED = 'mail-in.address-applied';
|
|
82
|
+
/** The platform refused the act, or gave up on it. */
|
|
83
|
+
export const MAIL_IN_ADDRESS_REFUSED = 'mail-in.address-refused';
|
|
84
|
+
/**
|
|
85
|
+
* What every relay-write outcome says beyond its own fields: which request (how a vertical joins the
|
|
86
|
+
* event to what it asked), the attempts made, and on a refusal the taxonomy code and the status the
|
|
87
|
+
* relay answered with. No platform prose: the full refusal stays on the intent row
|
|
88
|
+
* (`ctx.platformRequests`), and a connector's refusal can quote its provider.
|
|
89
|
+
*/
|
|
90
|
+
const outcomeCommon = {
|
|
91
|
+
request: platformRequestId,
|
|
92
|
+
attempts: z.number().int().positive(),
|
|
93
|
+
/** The taxonomy code of the refusal, when the relay named one; always `null` on an applied outcome. */
|
|
94
|
+
code: z.string().min(1).nullable(),
|
|
95
|
+
/** The status the relay refused with, when it gave one; always `null` on an applied outcome. */
|
|
96
|
+
status: z.number().int().nullable(),
|
|
97
|
+
/** The platform stopped retrying a transient failure, rather than being refused. */
|
|
98
|
+
gaveUp: z.boolean(),
|
|
99
|
+
};
|
|
100
|
+
export const connectionBindingOutcomePayload = z
|
|
101
|
+
.object({ ...outcomeCommon, connectionId, action: z.enum(['bind', 'unbind']) })
|
|
102
|
+
.strict();
|
|
103
|
+
export const connectLinkRevokeOutcomePayload = z
|
|
104
|
+
.object({
|
|
105
|
+
...outcomeCommon,
|
|
106
|
+
linkId: connectLinkId,
|
|
107
|
+
/** The link's status after the revoke (`revoked`, or `used` for a link already spent); `null` on a refusal. */
|
|
108
|
+
linkStatus: connectLinkStatus.nullable(),
|
|
109
|
+
})
|
|
110
|
+
.strict();
|
|
111
|
+
export const mailInAddressOutcomePayload = z
|
|
112
|
+
.object({
|
|
113
|
+
...outcomeCommon,
|
|
114
|
+
action: z.enum(['request', 'rotate', 'revoke']),
|
|
115
|
+
/** Whether the scope holds an address after the act. Never which. */
|
|
116
|
+
active: z.boolean().nullable(),
|
|
117
|
+
})
|
|
118
|
+
.strict();
|
|
119
|
+
/** The relay-write outcome events a settle may write (one arm of `platformOutcomeEvent`). */
|
|
120
|
+
export const relayWriteOutcomeEvent = z.discriminatedUnion('type', [
|
|
121
|
+
z.object({ type: z.enum([CONNECTION_BINDING_APPLIED, CONNECTION_BINDING_REFUSED]), entity: entityRef, payload: connectionBindingOutcomePayload }).strict(),
|
|
122
|
+
z.object({ type: z.enum([CONNECT_LINK_REVOKED, CONNECT_LINK_REVOKE_REFUSED]), entity: entityRef, payload: connectLinkRevokeOutcomePayload }).strict(),
|
|
123
|
+
z.object({ type: z.enum([MAIL_IN_ADDRESS_APPLIED, MAIL_IN_ADDRESS_REFUSED]), entity: entityRef, payload: mailInAddressOutcomePayload }).strict(),
|
|
124
|
+
]);
|
|
125
|
+
//# sourceMappingURL=relay-intents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relay-intents.js","sourceRoot":"","sources":["../src/relay-intents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEvE;;;;;;;;;;;;;;;;;;GAkBG;AAEH,oHAAoH;AACpH,MAAM,CAAC,MAAM,oBAAoB,GAAG,iBAAiB,CAAC;AACtD,iGAAiG;AACjG,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AAC1D,4EAA4E;AAC5E,MAAM,CAAC,MAAM,wBAAwB,GAAG,qBAAqB,CAAC;AAC9D,mEAAmE;AACnE,MAAM,CAAC,MAAM,oBAAoB,GAAG,iBAAiB,CAAC;AAEtD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,oBAAoB,EAAE,s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C,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC/C,qEAAqE;IACrE,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC;KACD,MAAM,EAAE,CAAC;AAGZ,6FAA6F;AAC7F,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IACjE,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,0BAA0B,EAAE,0BAA0B,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,+BAA+B,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1J,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,oBAAoB,EAAE,2BAA2B,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,+BAA+B,EAAE,CAAC,CAAC,MAAM,EAAE;IACrJ,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,uBAAuB,EAAE,uBAAuB,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,2BAA2B,EAAE,CAAC,CAAC,MAAM,EAAE;CACjJ,CAAC,CAAC"}
|
package/dist/trace.d.ts
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* #3628: one W3C trace, followed through every hop it has (target §11). The read that answers it
|
|
4
|
+
* lives in `@substrat-run/control-plane-api` (`trace-view.ts`); this is what a caller may ask and
|
|
5
|
+
* what comes back.
|
|
6
|
+
*
|
|
7
|
+
* **Ids, names, outcomes and times only.** No payload, no body, no header, no error text: a hop
|
|
8
|
+
* says which app and scope it ran in, what it was called, how it ended and how long it took. An
|
|
9
|
+
* event hop is its envelope (type, entity type, scope), never what it said.
|
|
10
|
+
*
|
|
11
|
+
* **A trace id is a correlation, never authority.** Anyone may send a `traceparent`, so a trace
|
|
12
|
+
* is always read under one tenant: a hop of another tenant's carrying the same id is never in the
|
|
13
|
+
* answer. A staff read names no tenant and is answered tenant by tenant.
|
|
14
|
+
*
|
|
15
|
+
* **A gap is said, not drawn.** Each source the read has says whether it was read
|
|
16
|
+
* (`sources`), and a hop the trace should have but the store has not received yet is listed in
|
|
17
|
+
* `awaiting` with how many are owed and how many arrived — so "the lake has not received the
|
|
18
|
+
* events yet" never reads as "the request emitted nothing".
|
|
19
|
+
*/
|
|
20
|
+
/** A W3C trace id: 32 lowercase hex, never all zeros (W3C Trace Context §3.2.2.3). */
|
|
21
|
+
export declare const traceIdSchema: z.ZodString;
|
|
22
|
+
export type TraceId = z.infer<typeof traceIdSchema>;
|
|
23
|
+
/**
|
|
24
|
+
* How far around the request's own time a trace is read. A trace starts at its request, so the
|
|
25
|
+
* window opens a little before it (clocks differ between scripts) and reaches far enough after
|
|
26
|
+
* for a broker's retries; the end is held to the reader's clock.
|
|
27
|
+
*/
|
|
28
|
+
export declare const TRACE_WINDOW_BEFORE_MS: number;
|
|
29
|
+
export declare const TRACE_WINDOW_AFTER_MS: number;
|
|
30
|
+
/** Most hops one answer carries; a trace with more says `incomplete`. */
|
|
31
|
+
export declare const TRACE_HOPS_MAX = 500;
|
|
32
|
+
/**
|
|
33
|
+
* What a hop is.
|
|
34
|
+
*
|
|
35
|
+
* - `request`: the router received it and dispatched it to an app.
|
|
36
|
+
* - `operation`: the app's own line for the call (an operation, or a route that is not one).
|
|
37
|
+
* - `peer`: a call from one app into another, as the called app's line records it.
|
|
38
|
+
* - `consumer` / `schedule` / `connector`: async work that ran under the trace.
|
|
39
|
+
* - `outbound` / `store`: a call the app's code made, as its line names it.
|
|
40
|
+
* - `event`: an event the trace's operations emitted, as the lake holds it, or one the lake says was
|
|
41
|
+
* emitted because of such an event (`causedBy`): a consumer's emission, in its own scope or
|
|
42
|
+
* another app's.
|
|
43
|
+
* - `handoff` / `delivery`: the scope handing messages to its broker, and the broker delivering,
|
|
44
|
+
* retrying or giving up on one.
|
|
45
|
+
*/
|
|
46
|
+
export declare const TRACE_HOP_KINDS: readonly ['request', 'operation', 'peer', 'consumer', 'schedule', 'connector', 'outbound', 'store', 'event', 'handoff', 'delivery'];
|
|
47
|
+
export declare const traceHopKind: z.ZodEnum<{
|
|
48
|
+
connector: "connector";
|
|
49
|
+
consumer: "consumer";
|
|
50
|
+
delivery: "delivery";
|
|
51
|
+
event: "event";
|
|
52
|
+
handoff: "handoff";
|
|
53
|
+
operation: "operation";
|
|
54
|
+
outbound: "outbound";
|
|
55
|
+
peer: "peer";
|
|
56
|
+
request: "request";
|
|
57
|
+
schedule: "schedule";
|
|
58
|
+
store: "store";
|
|
59
|
+
}>;
|
|
60
|
+
export type TraceHopKind = z.infer<typeof traceHopKind>;
|
|
61
|
+
/** One hop. `null` is "not recorded", never a value. */
|
|
62
|
+
export declare const traceHop: z.ZodObject<{
|
|
63
|
+
kind: z.ZodEnum<{
|
|
64
|
+
connector: "connector";
|
|
65
|
+
consumer: "consumer";
|
|
66
|
+
delivery: "delivery";
|
|
67
|
+
event: "event";
|
|
68
|
+
handoff: "handoff";
|
|
69
|
+
operation: "operation";
|
|
70
|
+
outbound: "outbound";
|
|
71
|
+
peer: "peer";
|
|
72
|
+
request: "request";
|
|
73
|
+
schedule: "schedule";
|
|
74
|
+
store: "store";
|
|
75
|
+
}>;
|
|
76
|
+
at: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
|
|
77
|
+
app: z.ZodNullable<z.ZodString>;
|
|
78
|
+
scopeId: z.ZodNullable<z.ZodString>;
|
|
79
|
+
name: z.ZodNullable<z.ZodString>;
|
|
80
|
+
result: z.ZodEnum<{
|
|
81
|
+
error: "error";
|
|
82
|
+
ok: "ok";
|
|
83
|
+
warn: "warn";
|
|
84
|
+
}>;
|
|
85
|
+
outcome: z.ZodNullable<z.ZodString>;
|
|
86
|
+
status: z.ZodNullable<z.ZodNumber>;
|
|
87
|
+
durationMs: z.ZodNullable<z.ZodNumber>;
|
|
88
|
+
invocationId: z.ZodNullable<z.ZodString>;
|
|
89
|
+
parentInvocationId: z.ZodNullable<z.ZodString>;
|
|
90
|
+
eventId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
91
|
+
causedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
export type TraceHop = z.infer<typeof traceHop>;
|
|
94
|
+
/** A hop the trace is owed that its store has not received yet. */
|
|
95
|
+
export declare const traceAwaiting: z.ZodObject<{
|
|
96
|
+
kind: z.ZodEnum<{
|
|
97
|
+
delivery: "delivery";
|
|
98
|
+
event: "event";
|
|
99
|
+
operation: "operation";
|
|
100
|
+
}>;
|
|
101
|
+
app: z.ZodNullable<z.ZodString>;
|
|
102
|
+
scopeId: z.ZodNullable<z.ZodString>;
|
|
103
|
+
invocationId: z.ZodNullable<z.ZodString>;
|
|
104
|
+
expected: z.ZodNullable<z.ZodNumber>;
|
|
105
|
+
received: z.ZodNumber;
|
|
106
|
+
reason: z.ZodString;
|
|
107
|
+
}, z.core.$strip>;
|
|
108
|
+
export type TraceAwaiting = z.infer<typeof traceAwaiting>;
|
|
109
|
+
/**
|
|
110
|
+
* Whether a source was read. `not-configured`: this platform has no such store (the lake's
|
|
111
|
+
* query engine, the broker's dataset). `not-permitted`: the caller may not read it (a team's
|
|
112
|
+
* lake events need `dashboard:read-event-lake`). `failed`: the store answered with an error, and
|
|
113
|
+
* `detail` says which. `expired`: the trace is older than the store keeps — Workers Logs keep
|
|
114
|
+
* `OBSERVABILITY_RETENTION_DAYS` — and so is the lake read, which is found through the
|
|
115
|
+
* invocations those lines name.
|
|
116
|
+
*/
|
|
117
|
+
export declare const traceSource: z.ZodObject<{
|
|
118
|
+
state: z.ZodEnum<{
|
|
119
|
+
expired: "expired";
|
|
120
|
+
failed: "failed";
|
|
121
|
+
"not-configured": "not-configured";
|
|
122
|
+
"not-permitted": "not-permitted";
|
|
123
|
+
read: "read";
|
|
124
|
+
}>;
|
|
125
|
+
detail: z.ZodNullable<z.ZodString>;
|
|
126
|
+
}, z.core.$strip>;
|
|
127
|
+
export type TraceSource = z.infer<typeof traceSource>;
|
|
128
|
+
export declare const traceView: z.ZodObject<{
|
|
129
|
+
traceId: z.ZodString;
|
|
130
|
+
since: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
|
|
131
|
+
until: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
|
|
132
|
+
hops: z.ZodArray<z.ZodObject<{
|
|
133
|
+
kind: z.ZodEnum<{
|
|
134
|
+
connector: "connector";
|
|
135
|
+
consumer: "consumer";
|
|
136
|
+
delivery: "delivery";
|
|
137
|
+
event: "event";
|
|
138
|
+
handoff: "handoff";
|
|
139
|
+
operation: "operation";
|
|
140
|
+
outbound: "outbound";
|
|
141
|
+
peer: "peer";
|
|
142
|
+
request: "request";
|
|
143
|
+
schedule: "schedule";
|
|
144
|
+
store: "store";
|
|
145
|
+
}>;
|
|
146
|
+
at: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
|
|
147
|
+
app: z.ZodNullable<z.ZodString>;
|
|
148
|
+
scopeId: z.ZodNullable<z.ZodString>;
|
|
149
|
+
name: z.ZodNullable<z.ZodString>;
|
|
150
|
+
result: z.ZodEnum<{
|
|
151
|
+
error: "error";
|
|
152
|
+
ok: "ok";
|
|
153
|
+
warn: "warn";
|
|
154
|
+
}>;
|
|
155
|
+
outcome: z.ZodNullable<z.ZodString>;
|
|
156
|
+
status: z.ZodNullable<z.ZodNumber>;
|
|
157
|
+
durationMs: z.ZodNullable<z.ZodNumber>;
|
|
158
|
+
invocationId: z.ZodNullable<z.ZodString>;
|
|
159
|
+
parentInvocationId: z.ZodNullable<z.ZodString>;
|
|
160
|
+
eventId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
161
|
+
causedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
162
|
+
}, z.core.$strip>>;
|
|
163
|
+
awaiting: z.ZodArray<z.ZodObject<{
|
|
164
|
+
kind: z.ZodEnum<{
|
|
165
|
+
delivery: "delivery";
|
|
166
|
+
event: "event";
|
|
167
|
+
operation: "operation";
|
|
168
|
+
}>;
|
|
169
|
+
app: z.ZodNullable<z.ZodString>;
|
|
170
|
+
scopeId: z.ZodNullable<z.ZodString>;
|
|
171
|
+
invocationId: z.ZodNullable<z.ZodString>;
|
|
172
|
+
expected: z.ZodNullable<z.ZodNumber>;
|
|
173
|
+
received: z.ZodNumber;
|
|
174
|
+
reason: z.ZodString;
|
|
175
|
+
}, z.core.$strip>>;
|
|
176
|
+
sources: z.ZodObject<{
|
|
177
|
+
logs: z.ZodObject<{
|
|
178
|
+
state: z.ZodEnum<{
|
|
179
|
+
expired: "expired";
|
|
180
|
+
failed: "failed";
|
|
181
|
+
"not-configured": "not-configured";
|
|
182
|
+
"not-permitted": "not-permitted";
|
|
183
|
+
read: "read";
|
|
184
|
+
}>;
|
|
185
|
+
detail: z.ZodNullable<z.ZodString>;
|
|
186
|
+
}, z.core.$strip>;
|
|
187
|
+
lake: z.ZodObject<{
|
|
188
|
+
state: z.ZodEnum<{
|
|
189
|
+
expired: "expired";
|
|
190
|
+
failed: "failed";
|
|
191
|
+
"not-configured": "not-configured";
|
|
192
|
+
"not-permitted": "not-permitted";
|
|
193
|
+
read: "read";
|
|
194
|
+
}>;
|
|
195
|
+
detail: z.ZodNullable<z.ZodString>;
|
|
196
|
+
}, z.core.$strip>;
|
|
197
|
+
broker: z.ZodObject<{
|
|
198
|
+
state: z.ZodEnum<{
|
|
199
|
+
expired: "expired";
|
|
200
|
+
failed: "failed";
|
|
201
|
+
"not-configured": "not-configured";
|
|
202
|
+
"not-permitted": "not-permitted";
|
|
203
|
+
read: "read";
|
|
204
|
+
}>;
|
|
205
|
+
detail: z.ZodNullable<z.ZodString>;
|
|
206
|
+
}, z.core.$strip>;
|
|
207
|
+
}, z.core.$strip>;
|
|
208
|
+
incomplete: z.ZodBoolean;
|
|
209
|
+
}, z.core.$strip>;
|
|
210
|
+
export type TraceView = z.infer<typeof traceView>;
|
|
211
|
+
//# sourceMappingURL=trace.d.ts.map
|