@heypointerhq/contracts 0.0.0-stage → 0.2.1
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/LICENSE +202 -0
- package/NOTICE +5 -0
- package/README.md +60 -2
- package/dist/index.d.ts +1458 -0
- package/dist/index.js +816 -0
- package/package.json +42 -4
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1458 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Contract version. Bump on any breaking schema change and note it in packages/contracts/README.md. */
|
|
3
|
+
export declare const CONTRACT_VERSION = "1.14.0";
|
|
4
|
+
/**
|
|
5
|
+
* `code` (added in 1.3.0) marks flows a model inferred from application source in
|
|
6
|
+
* `heypointer scan --llm`. Every such step still cites a real file, lines and excerpt.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SourceTypeSchema: z.ZodEnum<{
|
|
9
|
+
prd: "prd";
|
|
10
|
+
e2e: "e2e";
|
|
11
|
+
mermaid: "mermaid";
|
|
12
|
+
code: "code";
|
|
13
|
+
}>;
|
|
14
|
+
export type SourceType = z.infer<typeof SourceTypeSchema>;
|
|
15
|
+
/** Where a fact came from. Line numbers are 1-based and inclusive. */
|
|
16
|
+
export declare const ProvenanceSchema: z.ZodObject<{
|
|
17
|
+
sourceType: z.ZodEnum<{
|
|
18
|
+
prd: "prd";
|
|
19
|
+
e2e: "e2e";
|
|
20
|
+
mermaid: "mermaid";
|
|
21
|
+
code: "code";
|
|
22
|
+
}>;
|
|
23
|
+
path: z.ZodString;
|
|
24
|
+
lineStart: z.ZodNumber;
|
|
25
|
+
lineEnd: z.ZodNumber;
|
|
26
|
+
excerpt: z.ZodString;
|
|
27
|
+
sourceHash: z.ZodString;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
export type Provenance = z.infer<typeof ProvenanceSchema>;
|
|
30
|
+
export declare const StepActionSchema: z.ZodEnum<{
|
|
31
|
+
type: "type";
|
|
32
|
+
click: "click";
|
|
33
|
+
select: "select";
|
|
34
|
+
navigate: "navigate";
|
|
35
|
+
observe: "observe";
|
|
36
|
+
}>;
|
|
37
|
+
export type StepAction = z.infer<typeof StepActionSchema>;
|
|
38
|
+
/**
|
|
39
|
+
* How to find a live DOM element. Every field is copied from evidence; the
|
|
40
|
+
* server never invents selectors. SDK resolution order: selectors, then
|
|
41
|
+
* role+text, then label, then text.
|
|
42
|
+
*/
|
|
43
|
+
export declare const TargetSchema: z.ZodObject<{
|
|
44
|
+
selectors: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
45
|
+
role: z.ZodOptional<z.ZodString>;
|
|
46
|
+
text: z.ZodOptional<z.ZodString>;
|
|
47
|
+
label: z.ZodOptional<z.ZodString>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
export type Target = z.infer<typeof TargetSchema>;
|
|
50
|
+
export declare const NodeKindSchema: z.ZodEnum<{
|
|
51
|
+
screen: "screen";
|
|
52
|
+
action: "action";
|
|
53
|
+
outcome: "outcome";
|
|
54
|
+
requirement: "requirement";
|
|
55
|
+
}>;
|
|
56
|
+
export type NodeKind = z.infer<typeof NodeKindSchema>;
|
|
57
|
+
export declare const WorkflowNodeSchema: z.ZodObject<{
|
|
58
|
+
id: z.ZodString;
|
|
59
|
+
workflowId: z.ZodString;
|
|
60
|
+
kind: z.ZodEnum<{
|
|
61
|
+
screen: "screen";
|
|
62
|
+
action: "action";
|
|
63
|
+
outcome: "outcome";
|
|
64
|
+
requirement: "requirement";
|
|
65
|
+
}>;
|
|
66
|
+
label: z.ZodString;
|
|
67
|
+
order: z.ZodNumber;
|
|
68
|
+
action: z.ZodOptional<z.ZodEnum<{
|
|
69
|
+
type: "type";
|
|
70
|
+
click: "click";
|
|
71
|
+
select: "select";
|
|
72
|
+
navigate: "navigate";
|
|
73
|
+
observe: "observe";
|
|
74
|
+
}>>;
|
|
75
|
+
target: z.ZodOptional<z.ZodObject<{
|
|
76
|
+
selectors: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
77
|
+
role: z.ZodOptional<z.ZodString>;
|
|
78
|
+
text: z.ZodOptional<z.ZodString>;
|
|
79
|
+
label: z.ZodOptional<z.ZodString>;
|
|
80
|
+
}, z.core.$strip>>;
|
|
81
|
+
value: z.ZodOptional<z.ZodString>;
|
|
82
|
+
consequential: z.ZodDefault<z.ZodBoolean>;
|
|
83
|
+
provenance: z.ZodArray<z.ZodObject<{
|
|
84
|
+
sourceType: z.ZodEnum<{
|
|
85
|
+
prd: "prd";
|
|
86
|
+
e2e: "e2e";
|
|
87
|
+
mermaid: "mermaid";
|
|
88
|
+
code: "code";
|
|
89
|
+
}>;
|
|
90
|
+
path: z.ZodString;
|
|
91
|
+
lineStart: z.ZodNumber;
|
|
92
|
+
lineEnd: z.ZodNumber;
|
|
93
|
+
excerpt: z.ZodString;
|
|
94
|
+
sourceHash: z.ZodString;
|
|
95
|
+
}, z.core.$strip>>;
|
|
96
|
+
}, z.core.$strip>;
|
|
97
|
+
export type WorkflowNode = z.infer<typeof WorkflowNodeSchema>;
|
|
98
|
+
export declare const EdgeKindSchema: z.ZodEnum<{
|
|
99
|
+
next: "next";
|
|
100
|
+
same_as: "same_as";
|
|
101
|
+
}>;
|
|
102
|
+
export type EdgeKind = z.infer<typeof EdgeKindSchema>;
|
|
103
|
+
export declare const WorkflowEdgeSchema: z.ZodObject<{
|
|
104
|
+
from: z.ZodString;
|
|
105
|
+
to: z.ZodString;
|
|
106
|
+
kind: z.ZodEnum<{
|
|
107
|
+
next: "next";
|
|
108
|
+
same_as: "same_as";
|
|
109
|
+
}>;
|
|
110
|
+
weight: z.ZodNumber;
|
|
111
|
+
label: z.ZodOptional<z.ZodString>;
|
|
112
|
+
}, z.core.$strip>;
|
|
113
|
+
export type WorkflowEdge = z.infer<typeof WorkflowEdgeSchema>;
|
|
114
|
+
export declare const WorkflowSchema: z.ZodObject<{
|
|
115
|
+
id: z.ZodString;
|
|
116
|
+
title: z.ZodString;
|
|
117
|
+
sources: z.ZodArray<z.ZodString>;
|
|
118
|
+
}, z.core.$strip>;
|
|
119
|
+
export type Workflow = z.infer<typeof WorkflowSchema>;
|
|
120
|
+
export declare const VectorEntrySchema: z.ZodObject<{
|
|
121
|
+
nodeId: z.ZodString;
|
|
122
|
+
text: z.ZodString;
|
|
123
|
+
vector: z.ZodArray<z.ZodNumber>;
|
|
124
|
+
}, z.core.$strip>;
|
|
125
|
+
export type VectorEntry = z.infer<typeof VectorEntrySchema>;
|
|
126
|
+
export declare const KnowledgeBaseSnapshotSchema: z.ZodObject<{
|
|
127
|
+
version: z.ZodString;
|
|
128
|
+
createdAt: z.ZodString;
|
|
129
|
+
scannerVersion: z.ZodString;
|
|
130
|
+
embedder: z.ZodString;
|
|
131
|
+
workflows: z.ZodArray<z.ZodObject<{
|
|
132
|
+
id: z.ZodString;
|
|
133
|
+
title: z.ZodString;
|
|
134
|
+
sources: z.ZodArray<z.ZodString>;
|
|
135
|
+
}, z.core.$strip>>;
|
|
136
|
+
nodes: z.ZodArray<z.ZodObject<{
|
|
137
|
+
id: z.ZodString;
|
|
138
|
+
workflowId: z.ZodString;
|
|
139
|
+
kind: z.ZodEnum<{
|
|
140
|
+
screen: "screen";
|
|
141
|
+
action: "action";
|
|
142
|
+
outcome: "outcome";
|
|
143
|
+
requirement: "requirement";
|
|
144
|
+
}>;
|
|
145
|
+
label: z.ZodString;
|
|
146
|
+
order: z.ZodNumber;
|
|
147
|
+
action: z.ZodOptional<z.ZodEnum<{
|
|
148
|
+
type: "type";
|
|
149
|
+
click: "click";
|
|
150
|
+
select: "select";
|
|
151
|
+
navigate: "navigate";
|
|
152
|
+
observe: "observe";
|
|
153
|
+
}>>;
|
|
154
|
+
target: z.ZodOptional<z.ZodObject<{
|
|
155
|
+
selectors: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
156
|
+
role: z.ZodOptional<z.ZodString>;
|
|
157
|
+
text: z.ZodOptional<z.ZodString>;
|
|
158
|
+
label: z.ZodOptional<z.ZodString>;
|
|
159
|
+
}, z.core.$strip>>;
|
|
160
|
+
value: z.ZodOptional<z.ZodString>;
|
|
161
|
+
consequential: z.ZodDefault<z.ZodBoolean>;
|
|
162
|
+
provenance: z.ZodArray<z.ZodObject<{
|
|
163
|
+
sourceType: z.ZodEnum<{
|
|
164
|
+
prd: "prd";
|
|
165
|
+
e2e: "e2e";
|
|
166
|
+
mermaid: "mermaid";
|
|
167
|
+
code: "code";
|
|
168
|
+
}>;
|
|
169
|
+
path: z.ZodString;
|
|
170
|
+
lineStart: z.ZodNumber;
|
|
171
|
+
lineEnd: z.ZodNumber;
|
|
172
|
+
excerpt: z.ZodString;
|
|
173
|
+
sourceHash: z.ZodString;
|
|
174
|
+
}, z.core.$strip>>;
|
|
175
|
+
}, z.core.$strip>>;
|
|
176
|
+
edges: z.ZodArray<z.ZodObject<{
|
|
177
|
+
from: z.ZodString;
|
|
178
|
+
to: z.ZodString;
|
|
179
|
+
kind: z.ZodEnum<{
|
|
180
|
+
next: "next";
|
|
181
|
+
same_as: "same_as";
|
|
182
|
+
}>;
|
|
183
|
+
weight: z.ZodNumber;
|
|
184
|
+
label: z.ZodOptional<z.ZodString>;
|
|
185
|
+
}, z.core.$strip>>;
|
|
186
|
+
vectors: z.ZodArray<z.ZodObject<{
|
|
187
|
+
nodeId: z.ZodString;
|
|
188
|
+
text: z.ZodString;
|
|
189
|
+
vector: z.ZodArray<z.ZodNumber>;
|
|
190
|
+
}, z.core.$strip>>;
|
|
191
|
+
}, z.core.$strip>;
|
|
192
|
+
export type KnowledgeBaseSnapshot = z.infer<typeof KnowledgeBaseSnapshotSchema>;
|
|
193
|
+
export declare const EvidenceSchema: z.ZodObject<{
|
|
194
|
+
nodeId: z.ZodString;
|
|
195
|
+
sourceType: z.ZodEnum<{
|
|
196
|
+
prd: "prd";
|
|
197
|
+
e2e: "e2e";
|
|
198
|
+
mermaid: "mermaid";
|
|
199
|
+
code: "code";
|
|
200
|
+
}>;
|
|
201
|
+
path: z.ZodString;
|
|
202
|
+
lineStart: z.ZodNumber;
|
|
203
|
+
lineEnd: z.ZodNumber;
|
|
204
|
+
excerpt: z.ZodString;
|
|
205
|
+
}, z.core.$strip>;
|
|
206
|
+
export type Evidence = z.infer<typeof EvidenceSchema>;
|
|
207
|
+
export declare const WalkthroughStepSchema: z.ZodObject<{
|
|
208
|
+
id: z.ZodString;
|
|
209
|
+
title: z.ZodString;
|
|
210
|
+
instruction: z.ZodString;
|
|
211
|
+
target: z.ZodObject<{
|
|
212
|
+
selectors: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
213
|
+
role: z.ZodOptional<z.ZodString>;
|
|
214
|
+
text: z.ZodOptional<z.ZodString>;
|
|
215
|
+
label: z.ZodOptional<z.ZodString>;
|
|
216
|
+
}, z.core.$strip>;
|
|
217
|
+
action: z.ZodEnum<{
|
|
218
|
+
type: "type";
|
|
219
|
+
click: "click";
|
|
220
|
+
select: "select";
|
|
221
|
+
navigate: "navigate";
|
|
222
|
+
observe: "observe";
|
|
223
|
+
}>;
|
|
224
|
+
value: z.ZodOptional<z.ZodString>;
|
|
225
|
+
requiresConfirmation: z.ZodBoolean;
|
|
226
|
+
evidence: z.ZodArray<z.ZodObject<{
|
|
227
|
+
nodeId: z.ZodString;
|
|
228
|
+
sourceType: z.ZodEnum<{
|
|
229
|
+
prd: "prd";
|
|
230
|
+
e2e: "e2e";
|
|
231
|
+
mermaid: "mermaid";
|
|
232
|
+
code: "code";
|
|
233
|
+
}>;
|
|
234
|
+
path: z.ZodString;
|
|
235
|
+
lineStart: z.ZodNumber;
|
|
236
|
+
lineEnd: z.ZodNumber;
|
|
237
|
+
excerpt: z.ZodString;
|
|
238
|
+
}, z.core.$strip>>;
|
|
239
|
+
}, z.core.$strip>;
|
|
240
|
+
export type WalkthroughStep = z.infer<typeof WalkthroughStepSchema>;
|
|
241
|
+
export declare const WalkthroughStatusSchema: z.ZodEnum<{
|
|
242
|
+
ok: "ok";
|
|
243
|
+
insufficient_evidence: "insufficient_evidence";
|
|
244
|
+
}>;
|
|
245
|
+
export type WalkthroughStatus = z.infer<typeof WalkthroughStatusSchema>;
|
|
246
|
+
export declare const PlannerKindSchema: z.ZodEnum<{
|
|
247
|
+
llm: "llm";
|
|
248
|
+
deterministic: "deterministic";
|
|
249
|
+
fallback: "fallback";
|
|
250
|
+
}>;
|
|
251
|
+
export type PlannerKind = z.infer<typeof PlannerKindSchema>;
|
|
252
|
+
/** A guide the server can give, offered when it cannot cover the goal. The title works as a goal: ask for it to get the steps. Added in 1.5.0. */
|
|
253
|
+
export declare const FlowSuggestionSchema: z.ZodObject<{
|
|
254
|
+
workflowId: z.ZodString;
|
|
255
|
+
title: z.ZodString;
|
|
256
|
+
}, z.core.$strip>;
|
|
257
|
+
export type FlowSuggestion = z.infer<typeof FlowSuggestionSchema>;
|
|
258
|
+
export declare const WalkthroughSchema: z.ZodObject<{
|
|
259
|
+
id: z.ZodString;
|
|
260
|
+
goal: z.ZodString;
|
|
261
|
+
status: z.ZodEnum<{
|
|
262
|
+
ok: "ok";
|
|
263
|
+
insufficient_evidence: "insufficient_evidence";
|
|
264
|
+
}>;
|
|
265
|
+
workflowId: z.ZodOptional<z.ZodString>;
|
|
266
|
+
steps: z.ZodArray<z.ZodObject<{
|
|
267
|
+
id: z.ZodString;
|
|
268
|
+
title: z.ZodString;
|
|
269
|
+
instruction: z.ZodString;
|
|
270
|
+
target: z.ZodObject<{
|
|
271
|
+
selectors: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
272
|
+
role: z.ZodOptional<z.ZodString>;
|
|
273
|
+
text: z.ZodOptional<z.ZodString>;
|
|
274
|
+
label: z.ZodOptional<z.ZodString>;
|
|
275
|
+
}, z.core.$strip>;
|
|
276
|
+
action: z.ZodEnum<{
|
|
277
|
+
type: "type";
|
|
278
|
+
click: "click";
|
|
279
|
+
select: "select";
|
|
280
|
+
navigate: "navigate";
|
|
281
|
+
observe: "observe";
|
|
282
|
+
}>;
|
|
283
|
+
value: z.ZodOptional<z.ZodString>;
|
|
284
|
+
requiresConfirmation: z.ZodBoolean;
|
|
285
|
+
evidence: z.ZodArray<z.ZodObject<{
|
|
286
|
+
nodeId: z.ZodString;
|
|
287
|
+
sourceType: z.ZodEnum<{
|
|
288
|
+
prd: "prd";
|
|
289
|
+
e2e: "e2e";
|
|
290
|
+
mermaid: "mermaid";
|
|
291
|
+
code: "code";
|
|
292
|
+
}>;
|
|
293
|
+
path: z.ZodString;
|
|
294
|
+
lineStart: z.ZodNumber;
|
|
295
|
+
lineEnd: z.ZodNumber;
|
|
296
|
+
excerpt: z.ZodString;
|
|
297
|
+
}, z.core.$strip>>;
|
|
298
|
+
}, z.core.$strip>>;
|
|
299
|
+
kbVersion: z.ZodString;
|
|
300
|
+
confidence: z.ZodNumber;
|
|
301
|
+
planner: z.ZodEnum<{
|
|
302
|
+
llm: "llm";
|
|
303
|
+
deterministic: "deterministic";
|
|
304
|
+
fallback: "fallback";
|
|
305
|
+
}>;
|
|
306
|
+
message: z.ZodOptional<z.ZodString>;
|
|
307
|
+
missingEvidence: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
308
|
+
suggestions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
309
|
+
workflowId: z.ZodString;
|
|
310
|
+
title: z.ZodString;
|
|
311
|
+
}, z.core.$strip>>>;
|
|
312
|
+
}, z.core.$strip>;
|
|
313
|
+
export type Walkthrough = z.infer<typeof WalkthroughSchema>;
|
|
314
|
+
export declare const API_ROUTES: {
|
|
315
|
+
readonly health: "GET /api/health";
|
|
316
|
+
readonly ingest: "POST /api/ingest";
|
|
317
|
+
readonly knowledgeBase: "GET /api/kb";
|
|
318
|
+
/** Replace the base knowledge base with a scanned one (CI publish). Added in 1.7.0. */
|
|
319
|
+
readonly publishKnowledgeBase: "PUT /api/kb";
|
|
320
|
+
/** Requires the `X-HeyPointer-Client` header unless the server runs with HEYPOINTER_CLIENT_AUTH=off. Added in 1.8.0. */
|
|
321
|
+
readonly walkthrough: "POST /api/walkthrough";
|
|
322
|
+
readonly transcribe: "POST /api/transcribe";
|
|
323
|
+
/** Key-protected inference metrics. Added in 1.2.0. */
|
|
324
|
+
readonly metrics: "GET /api/metrics";
|
|
325
|
+
};
|
|
326
|
+
export declare const IngestRequestSchema: z.ZodObject<{
|
|
327
|
+
paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
328
|
+
}, z.core.$strip>;
|
|
329
|
+
export type IngestRequest = z.infer<typeof IngestRequestSchema>;
|
|
330
|
+
export declare const IngestResponseSchema: z.ZodObject<{
|
|
331
|
+
version: z.ZodString;
|
|
332
|
+
nodes: z.ZodNumber;
|
|
333
|
+
edges: z.ZodNumber;
|
|
334
|
+
workflows: z.ZodArray<z.ZodString>;
|
|
335
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
336
|
+
path: z.ZodString;
|
|
337
|
+
sourceType: z.ZodEnum<{
|
|
338
|
+
prd: "prd";
|
|
339
|
+
e2e: "e2e";
|
|
340
|
+
mermaid: "mermaid";
|
|
341
|
+
code: "code";
|
|
342
|
+
}>;
|
|
343
|
+
sourceHash: z.ZodString;
|
|
344
|
+
}, z.core.$strip>>;
|
|
345
|
+
warnings: z.ZodArray<z.ZodString>;
|
|
346
|
+
}, z.core.$strip>;
|
|
347
|
+
export type IngestResponse = z.infer<typeof IngestResponseSchema>;
|
|
348
|
+
/** Largest knowledge base the server accepts on `PUT /api/kb`, and the CLI refuses to send more. Added in 1.7.0. */
|
|
349
|
+
export declare const MAX_KB_PUBLISH_BYTES: number;
|
|
350
|
+
/**
|
|
351
|
+
* Body of `PUT /api/kb`: a scanned knowledge base (the `kb.json` the CLI writes), exactly as written.
|
|
352
|
+
* Unknown top-level fields are refused, and the graph must be internally consistent, so a corrupt or
|
|
353
|
+
* hand-edited file fails here instead of half-loading. Added in 1.7.0.
|
|
354
|
+
*/
|
|
355
|
+
export declare const PublishKbRequestSchema: z.ZodObject<{
|
|
356
|
+
version: z.ZodString;
|
|
357
|
+
createdAt: z.ZodString;
|
|
358
|
+
scannerVersion: z.ZodString;
|
|
359
|
+
embedder: z.ZodString;
|
|
360
|
+
workflows: z.ZodArray<z.ZodObject<{
|
|
361
|
+
id: z.ZodString;
|
|
362
|
+
title: z.ZodString;
|
|
363
|
+
sources: z.ZodArray<z.ZodString>;
|
|
364
|
+
}, z.core.$strip>>;
|
|
365
|
+
nodes: z.ZodArray<z.ZodObject<{
|
|
366
|
+
id: z.ZodString;
|
|
367
|
+
workflowId: z.ZodString;
|
|
368
|
+
kind: z.ZodEnum<{
|
|
369
|
+
screen: "screen";
|
|
370
|
+
action: "action";
|
|
371
|
+
outcome: "outcome";
|
|
372
|
+
requirement: "requirement";
|
|
373
|
+
}>;
|
|
374
|
+
label: z.ZodString;
|
|
375
|
+
order: z.ZodNumber;
|
|
376
|
+
action: z.ZodOptional<z.ZodEnum<{
|
|
377
|
+
type: "type";
|
|
378
|
+
click: "click";
|
|
379
|
+
select: "select";
|
|
380
|
+
navigate: "navigate";
|
|
381
|
+
observe: "observe";
|
|
382
|
+
}>>;
|
|
383
|
+
target: z.ZodOptional<z.ZodObject<{
|
|
384
|
+
selectors: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
385
|
+
role: z.ZodOptional<z.ZodString>;
|
|
386
|
+
text: z.ZodOptional<z.ZodString>;
|
|
387
|
+
label: z.ZodOptional<z.ZodString>;
|
|
388
|
+
}, z.core.$strip>>;
|
|
389
|
+
value: z.ZodOptional<z.ZodString>;
|
|
390
|
+
consequential: z.ZodDefault<z.ZodBoolean>;
|
|
391
|
+
provenance: z.ZodArray<z.ZodObject<{
|
|
392
|
+
sourceType: z.ZodEnum<{
|
|
393
|
+
prd: "prd";
|
|
394
|
+
e2e: "e2e";
|
|
395
|
+
mermaid: "mermaid";
|
|
396
|
+
code: "code";
|
|
397
|
+
}>;
|
|
398
|
+
path: z.ZodString;
|
|
399
|
+
lineStart: z.ZodNumber;
|
|
400
|
+
lineEnd: z.ZodNumber;
|
|
401
|
+
excerpt: z.ZodString;
|
|
402
|
+
sourceHash: z.ZodString;
|
|
403
|
+
}, z.core.$strip>>;
|
|
404
|
+
}, z.core.$strip>>;
|
|
405
|
+
edges: z.ZodArray<z.ZodObject<{
|
|
406
|
+
from: z.ZodString;
|
|
407
|
+
to: z.ZodString;
|
|
408
|
+
kind: z.ZodEnum<{
|
|
409
|
+
next: "next";
|
|
410
|
+
same_as: "same_as";
|
|
411
|
+
}>;
|
|
412
|
+
weight: z.ZodNumber;
|
|
413
|
+
label: z.ZodOptional<z.ZodString>;
|
|
414
|
+
}, z.core.$strip>>;
|
|
415
|
+
vectors: z.ZodArray<z.ZodObject<{
|
|
416
|
+
nodeId: z.ZodString;
|
|
417
|
+
text: z.ZodString;
|
|
418
|
+
vector: z.ZodArray<z.ZodNumber>;
|
|
419
|
+
}, z.core.$strip>>;
|
|
420
|
+
}, z.core.$strict>;
|
|
421
|
+
export type PublishKbRequest = z.infer<typeof PublishKbRequestSchema>;
|
|
422
|
+
export declare const PublishKbResponseSchema: z.ZodObject<{
|
|
423
|
+
status: z.ZodEnum<{
|
|
424
|
+
published: "published";
|
|
425
|
+
unchanged: "unchanged";
|
|
426
|
+
}>;
|
|
427
|
+
kbId: z.ZodString;
|
|
428
|
+
nodes: z.ZodNumber;
|
|
429
|
+
edges: z.ZodNumber;
|
|
430
|
+
workflows: z.ZodArray<z.ZodString>;
|
|
431
|
+
replaced: z.ZodObject<{
|
|
432
|
+
prevKbId: z.ZodNullable<z.ZodString>;
|
|
433
|
+
}, z.core.$strip>;
|
|
434
|
+
}, z.core.$strip>;
|
|
435
|
+
export type PublishKbResponse = z.infer<typeof PublishKbResponseSchema>;
|
|
436
|
+
export declare const WalkthroughRequestSchema: z.ZodObject<{
|
|
437
|
+
goal: z.ZodString;
|
|
438
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
439
|
+
url: z.ZodOptional<z.ZodString>;
|
|
440
|
+
}, z.core.$strip>>;
|
|
441
|
+
}, z.core.$strip>;
|
|
442
|
+
export type WalkthroughRequest = z.infer<typeof WalkthroughRequestSchema>;
|
|
443
|
+
/** Request body: raw audio bytes with Content-Type audio/* (e.g. audio/webm). */
|
|
444
|
+
export declare const TranscribeResponseSchema: z.ZodObject<{
|
|
445
|
+
text: z.ZodString;
|
|
446
|
+
provider: z.ZodString;
|
|
447
|
+
}, z.core.$strip>;
|
|
448
|
+
export type TranscribeResponse = z.infer<typeof TranscribeResponseSchema>;
|
|
449
|
+
export declare const HealthResponseSchema: z.ZodObject<{
|
|
450
|
+
ok: z.ZodBoolean;
|
|
451
|
+
contractVersion: z.ZodString;
|
|
452
|
+
kbVersion: z.ZodNullable<z.ZodString>;
|
|
453
|
+
mode: z.ZodEnum<{
|
|
454
|
+
offline: "offline";
|
|
455
|
+
openrouter: "openrouter";
|
|
456
|
+
}>;
|
|
457
|
+
transcription: z.ZodBoolean;
|
|
458
|
+
ready: z.ZodOptional<z.ZodBoolean>;
|
|
459
|
+
}, z.core.$strip>;
|
|
460
|
+
export type HealthResponse = z.infer<typeof HealthResponseSchema>;
|
|
461
|
+
export declare const ErrorCodeSchema: z.ZodEnum<{
|
|
462
|
+
bad_request: "bad_request";
|
|
463
|
+
unauthorized: "unauthorized";
|
|
464
|
+
not_found: "not_found";
|
|
465
|
+
payload_too_large: "payload_too_large";
|
|
466
|
+
unsupported_media_type: "unsupported_media_type";
|
|
467
|
+
transcription_unavailable: "transcription_unavailable";
|
|
468
|
+
spend_cap_exceeded: "spend_cap_exceeded";
|
|
469
|
+
metrics_unavailable: "metrics_unavailable";
|
|
470
|
+
forbidden: "forbidden";
|
|
471
|
+
rate_limited: "rate_limited";
|
|
472
|
+
kb_empty: "kb_empty";
|
|
473
|
+
embedder_mismatch: "embedder_mismatch";
|
|
474
|
+
scanner_too_old: "scanner_too_old";
|
|
475
|
+
conflict: "conflict";
|
|
476
|
+
client_required: "client_required";
|
|
477
|
+
client_invalid: "client_invalid";
|
|
478
|
+
client_origin_not_allowed: "client_origin_not_allowed";
|
|
479
|
+
plan_limit_reached: "plan_limit_reached";
|
|
480
|
+
invalid_credentials: "invalid_credentials";
|
|
481
|
+
account_exists_login_first: "account_exists_login_first";
|
|
482
|
+
accounts_disabled: "accounts_disabled";
|
|
483
|
+
csrf_failed: "csrf_failed";
|
|
484
|
+
operator_2fa_required: "operator_2fa_required";
|
|
485
|
+
internal: "internal";
|
|
486
|
+
}>;
|
|
487
|
+
export type ErrorCode = z.infer<typeof ErrorCodeSchema>;
|
|
488
|
+
/** Every non-2xx response has this body. transcription_unavailable uses HTTP 501. */
|
|
489
|
+
export declare const ErrorResponseSchema: z.ZodObject<{
|
|
490
|
+
error: z.ZodString;
|
|
491
|
+
code: z.ZodEnum<{
|
|
492
|
+
bad_request: "bad_request";
|
|
493
|
+
unauthorized: "unauthorized";
|
|
494
|
+
not_found: "not_found";
|
|
495
|
+
payload_too_large: "payload_too_large";
|
|
496
|
+
unsupported_media_type: "unsupported_media_type";
|
|
497
|
+
transcription_unavailable: "transcription_unavailable";
|
|
498
|
+
spend_cap_exceeded: "spend_cap_exceeded";
|
|
499
|
+
metrics_unavailable: "metrics_unavailable";
|
|
500
|
+
forbidden: "forbidden";
|
|
501
|
+
rate_limited: "rate_limited";
|
|
502
|
+
kb_empty: "kb_empty";
|
|
503
|
+
embedder_mismatch: "embedder_mismatch";
|
|
504
|
+
scanner_too_old: "scanner_too_old";
|
|
505
|
+
conflict: "conflict";
|
|
506
|
+
client_required: "client_required";
|
|
507
|
+
client_invalid: "client_invalid";
|
|
508
|
+
client_origin_not_allowed: "client_origin_not_allowed";
|
|
509
|
+
plan_limit_reached: "plan_limit_reached";
|
|
510
|
+
invalid_credentials: "invalid_credentials";
|
|
511
|
+
account_exists_login_first: "account_exists_login_first";
|
|
512
|
+
accounts_disabled: "accounts_disabled";
|
|
513
|
+
csrf_failed: "csrf_failed";
|
|
514
|
+
operator_2fa_required: "operator_2fa_required";
|
|
515
|
+
internal: "internal";
|
|
516
|
+
}>;
|
|
517
|
+
message: z.ZodOptional<z.ZodString>;
|
|
518
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
519
|
+
used: z.ZodOptional<z.ZodNumber>;
|
|
520
|
+
}, z.core.$strip>;
|
|
521
|
+
export type ErrorResponse = z.infer<typeof ErrorResponseSchema>;
|
|
522
|
+
/**
|
|
523
|
+
* Aggregate inference metrics. Key-protected. Never includes prompts, keys or
|
|
524
|
+
* response content. All numeric fields are finite and nonnegative.
|
|
525
|
+
*/
|
|
526
|
+
export declare const MetricsResponseSchema: z.ZodObject<{
|
|
527
|
+
calls: z.ZodNumber;
|
|
528
|
+
errors: z.ZodNumber;
|
|
529
|
+
p50Ms: z.ZodNumber;
|
|
530
|
+
p95Ms: z.ZodNumber;
|
|
531
|
+
estCostUsd: z.ZodNumber;
|
|
532
|
+
unpricedModels: z.ZodArray<z.ZodString>;
|
|
533
|
+
spendCapUsd: z.ZodNullable<z.ZodNumber>;
|
|
534
|
+
remainingUsd: z.ZodNullable<z.ZodNumber>;
|
|
535
|
+
}, z.core.$strip>;
|
|
536
|
+
export type MetricsResponse = z.infer<typeof MetricsResponseSchema>;
|
|
537
|
+
/** Routes under /api/cloud use `Authorization: Bearer <client token>`. Admin routes use the server API key. */
|
|
538
|
+
export declare const CLOUD_ROUTES: {
|
|
539
|
+
readonly enroll: "POST /api/cloud/enroll";
|
|
540
|
+
readonly me: "GET /api/cloud/me";
|
|
541
|
+
readonly logout: "POST /api/cloud/logout";
|
|
542
|
+
readonly createBatch: "POST /api/cloud/v1/batches";
|
|
543
|
+
readonly getBatch: "GET /api/cloud/v1/batches/{id}";
|
|
544
|
+
readonly decisions: "POST /api/cloud/alpha/decisions";
|
|
545
|
+
readonly adminCreateClient: "POST /api/admin/clients";
|
|
546
|
+
readonly adminListClients: "GET /api/admin/clients";
|
|
547
|
+
readonly adminNewCode: "POST /api/admin/clients/{id}/enrollment-codes";
|
|
548
|
+
readonly adminDisable: "POST /api/admin/clients/{id}/disable";
|
|
549
|
+
};
|
|
550
|
+
export declare const CloudModelsSchema: z.ZodObject<{
|
|
551
|
+
scan: z.ZodString;
|
|
552
|
+
decision: z.ZodString;
|
|
553
|
+
}, z.core.$strip>;
|
|
554
|
+
/** One-time enrollment code in, long-lived client token out. The token is shown once. */
|
|
555
|
+
export declare const CloudEnrollRequestSchema: z.ZodObject<{
|
|
556
|
+
code: z.ZodString;
|
|
557
|
+
deviceName: z.ZodOptional<z.ZodString>;
|
|
558
|
+
}, z.core.$strip>;
|
|
559
|
+
export type CloudEnrollRequest = z.infer<typeof CloudEnrollRequestSchema>;
|
|
560
|
+
export declare const CloudEnrollResponseSchema: z.ZodObject<{
|
|
561
|
+
clientId: z.ZodString;
|
|
562
|
+
name: z.ZodString;
|
|
563
|
+
token: z.ZodString;
|
|
564
|
+
budgetUsd: z.ZodNumber;
|
|
565
|
+
models: z.ZodObject<{
|
|
566
|
+
scan: z.ZodString;
|
|
567
|
+
decision: z.ZodString;
|
|
568
|
+
}, z.core.$strip>;
|
|
569
|
+
}, z.core.$strip>;
|
|
570
|
+
export type CloudEnrollResponse = z.infer<typeof CloudEnrollResponseSchema>;
|
|
571
|
+
export declare const CloudMeResponseSchema: z.ZodObject<{
|
|
572
|
+
clientId: z.ZodString;
|
|
573
|
+
name: z.ZodString;
|
|
574
|
+
budgetUsd: z.ZodNumber;
|
|
575
|
+
spentUsd: z.ZodNumber;
|
|
576
|
+
reservedUsd: z.ZodNumber;
|
|
577
|
+
remainingUsd: z.ZodNumber;
|
|
578
|
+
models: z.ZodObject<{
|
|
579
|
+
scan: z.ZodString;
|
|
580
|
+
decision: z.ZodString;
|
|
581
|
+
}, z.core.$strip>;
|
|
582
|
+
}, z.core.$strip>;
|
|
583
|
+
export type CloudMeResponse = z.infer<typeof CloudMeResponseSchema>;
|
|
584
|
+
export declare const AdminCreateClientRequestSchema: z.ZodObject<{
|
|
585
|
+
name: z.ZodString;
|
|
586
|
+
budgetUsd: z.ZodNumber;
|
|
587
|
+
}, z.core.$strip>;
|
|
588
|
+
export type AdminCreateClientRequest = z.infer<typeof AdminCreateClientRequestSchema>;
|
|
589
|
+
export declare const AdminClientSchema: z.ZodObject<{
|
|
590
|
+
id: z.ZodString;
|
|
591
|
+
name: z.ZodString;
|
|
592
|
+
budgetUsd: z.ZodNumber;
|
|
593
|
+
spentUsd: z.ZodNumber;
|
|
594
|
+
reservedUsd: z.ZodNumber;
|
|
595
|
+
disabled: z.ZodBoolean;
|
|
596
|
+
createdAt: z.ZodString;
|
|
597
|
+
}, z.core.$strip>;
|
|
598
|
+
export type AdminClient = z.infer<typeof AdminClientSchema>;
|
|
599
|
+
export declare const AdminCodeResponseSchema: z.ZodObject<{
|
|
600
|
+
client: z.ZodObject<{
|
|
601
|
+
id: z.ZodString;
|
|
602
|
+
name: z.ZodString;
|
|
603
|
+
budgetUsd: z.ZodNumber;
|
|
604
|
+
spentUsd: z.ZodNumber;
|
|
605
|
+
reservedUsd: z.ZodNumber;
|
|
606
|
+
disabled: z.ZodBoolean;
|
|
607
|
+
createdAt: z.ZodString;
|
|
608
|
+
}, z.core.$strip>;
|
|
609
|
+
enrollmentCode: z.ZodString;
|
|
610
|
+
expiresAt: z.ZodString;
|
|
611
|
+
}, z.core.$strip>;
|
|
612
|
+
export type AdminCodeResponse = z.infer<typeof AdminCodeResponseSchema>;
|
|
613
|
+
/** Routes use `Authorization: Bearer <server API key>` when the server has one. */
|
|
614
|
+
export declare const FLOW_ROUTES: {
|
|
615
|
+
readonly list: "GET /api/flows";
|
|
616
|
+
readonly create: "POST /api/flows";
|
|
617
|
+
readonly get: "GET /api/flows/{id}";
|
|
618
|
+
readonly update: "PUT /api/flows/{id}";
|
|
619
|
+
readonly delete: "DELETE /api/flows/{id}";
|
|
620
|
+
readonly publish: "POST /api/flows/{id}/publish";
|
|
621
|
+
readonly unpublish: "POST /api/flows/{id}/unpublish";
|
|
622
|
+
readonly rollback: "POST /api/flows/{id}/rollback";
|
|
623
|
+
readonly validate: "POST /api/flows/validate";
|
|
624
|
+
};
|
|
625
|
+
/** One step is a sentence in PRD style that quotes the control: `Click "Change plan"`. */
|
|
626
|
+
export declare const FlowInputSchema: z.ZodObject<{
|
|
627
|
+
title: z.ZodString;
|
|
628
|
+
steps: z.ZodArray<z.ZodString>;
|
|
629
|
+
note: z.ZodOptional<z.ZodString>;
|
|
630
|
+
}, z.core.$strip>;
|
|
631
|
+
export type FlowInput = z.infer<typeof FlowInputSchema>;
|
|
632
|
+
export declare const FlowVersionSchema: z.ZodObject<{
|
|
633
|
+
version: z.ZodNumber;
|
|
634
|
+
title: z.ZodString;
|
|
635
|
+
steps: z.ZodArray<z.ZodString>;
|
|
636
|
+
note: z.ZodOptional<z.ZodString>;
|
|
637
|
+
savedAt: z.ZodString;
|
|
638
|
+
}, z.core.$strip>;
|
|
639
|
+
export type FlowVersion = z.infer<typeof FlowVersionSchema>;
|
|
640
|
+
/**
|
|
641
|
+
* A flow as the API shows it. `version` is the latest saved one. Users are served only the
|
|
642
|
+
* published version: saving more edits never changes what they see until the flow is published again.
|
|
643
|
+
*/
|
|
644
|
+
export declare const FlowSchema: z.ZodObject<{
|
|
645
|
+
id: z.ZodString;
|
|
646
|
+
title: z.ZodString;
|
|
647
|
+
steps: z.ZodArray<z.ZodString>;
|
|
648
|
+
version: z.ZodNumber;
|
|
649
|
+
published: z.ZodBoolean;
|
|
650
|
+
publishedVersion: z.ZodOptional<z.ZodNumber>;
|
|
651
|
+
hasUnpublishedChanges: z.ZodBoolean;
|
|
652
|
+
problems: z.ZodArray<z.ZodString>;
|
|
653
|
+
createdAt: z.ZodString;
|
|
654
|
+
updatedAt: z.ZodString;
|
|
655
|
+
}, z.core.$strip>;
|
|
656
|
+
export type Flow = z.infer<typeof FlowSchema>;
|
|
657
|
+
export declare const FlowDetailSchema: z.ZodObject<{
|
|
658
|
+
id: z.ZodString;
|
|
659
|
+
title: z.ZodString;
|
|
660
|
+
steps: z.ZodArray<z.ZodString>;
|
|
661
|
+
version: z.ZodNumber;
|
|
662
|
+
published: z.ZodBoolean;
|
|
663
|
+
publishedVersion: z.ZodOptional<z.ZodNumber>;
|
|
664
|
+
hasUnpublishedChanges: z.ZodBoolean;
|
|
665
|
+
problems: z.ZodArray<z.ZodString>;
|
|
666
|
+
createdAt: z.ZodString;
|
|
667
|
+
updatedAt: z.ZodString;
|
|
668
|
+
versions: z.ZodArray<z.ZodObject<{
|
|
669
|
+
version: z.ZodNumber;
|
|
670
|
+
title: z.ZodString;
|
|
671
|
+
steps: z.ZodArray<z.ZodString>;
|
|
672
|
+
note: z.ZodOptional<z.ZodString>;
|
|
673
|
+
savedAt: z.ZodString;
|
|
674
|
+
}, z.core.$strip>>;
|
|
675
|
+
}, z.core.$strip>;
|
|
676
|
+
export type FlowDetail = z.infer<typeof FlowDetailSchema>;
|
|
677
|
+
export declare const FlowListResponseSchema: z.ZodObject<{
|
|
678
|
+
flows: z.ZodArray<z.ZodObject<{
|
|
679
|
+
id: z.ZodString;
|
|
680
|
+
title: z.ZodString;
|
|
681
|
+
steps: z.ZodArray<z.ZodString>;
|
|
682
|
+
version: z.ZodNumber;
|
|
683
|
+
published: z.ZodBoolean;
|
|
684
|
+
publishedVersion: z.ZodOptional<z.ZodNumber>;
|
|
685
|
+
hasUnpublishedChanges: z.ZodBoolean;
|
|
686
|
+
problems: z.ZodArray<z.ZodString>;
|
|
687
|
+
createdAt: z.ZodString;
|
|
688
|
+
updatedAt: z.ZodString;
|
|
689
|
+
}, z.core.$strip>>;
|
|
690
|
+
}, z.core.$strip>;
|
|
691
|
+
export type FlowListResponse = z.infer<typeof FlowListResponseSchema>;
|
|
692
|
+
export declare const FlowRollbackRequestSchema: z.ZodObject<{
|
|
693
|
+
version: z.ZodNumber;
|
|
694
|
+
}, z.core.$strip>;
|
|
695
|
+
export type FlowRollbackRequest = z.infer<typeof FlowRollbackRequestSchema>;
|
|
696
|
+
/** Dry run: how the server reads these steps, without saving anything. */
|
|
697
|
+
export declare const FlowValidateResponseSchema: z.ZodObject<{
|
|
698
|
+
ok: z.ZodBoolean;
|
|
699
|
+
problems: z.ZodArray<z.ZodString>;
|
|
700
|
+
steps: z.ZodArray<z.ZodObject<{
|
|
701
|
+
text: z.ZodString;
|
|
702
|
+
action: z.ZodOptional<z.ZodEnum<{
|
|
703
|
+
type: "type";
|
|
704
|
+
click: "click";
|
|
705
|
+
select: "select";
|
|
706
|
+
navigate: "navigate";
|
|
707
|
+
observe: "observe";
|
|
708
|
+
}>>;
|
|
709
|
+
target: z.ZodOptional<z.ZodString>;
|
|
710
|
+
gated: z.ZodBoolean;
|
|
711
|
+
}, z.core.$strip>>;
|
|
712
|
+
}, z.core.$strip>;
|
|
713
|
+
export type FlowValidateResponse = z.infer<typeof FlowValidateResponseSchema>;
|
|
714
|
+
/**
|
|
715
|
+
* The header every walkthrough request carries. The value is a client id, which is a PUBLISHABLE
|
|
716
|
+
* identifier: it ships in web pages and app packages, so it is not a secret and must not be
|
|
717
|
+
* treated as one. It names who is asking (for revocation, origin limits, rate limits and
|
|
718
|
+
* usage counts); it does not prove who is asking.
|
|
719
|
+
*/
|
|
720
|
+
export declare const CLIENT_ID_HEADER = "X-HeyPointer-Client";
|
|
721
|
+
/** `hpc_` and 24 lowercase hex characters (96 random bits). Ids issued before 1.14.0 start with `gfc_` and stay valid. */
|
|
722
|
+
export declare const CLIENT_ID_PATTERN: RegExp;
|
|
723
|
+
export declare const ClientIdSchema: z.ZodString;
|
|
724
|
+
/** Routes use `Authorization: Bearer <server API key>`. */
|
|
725
|
+
export declare const CLIENT_ROUTES: {
|
|
726
|
+
readonly create: "POST /api/clients";
|
|
727
|
+
readonly list: "GET /api/clients";
|
|
728
|
+
/** Revokes: the row stays, the id stops working. Repeating it is fine. */
|
|
729
|
+
readonly revoke: "DELETE /api/clients/{id}";
|
|
730
|
+
};
|
|
731
|
+
export declare const MAX_CLIENT_ORIGINS = 20;
|
|
732
|
+
/** `scheme://host[:port]` with no path, query or fragment, exactly as a browser sends `Origin`. No wildcard. */
|
|
733
|
+
export declare const ClientOriginSchema: z.ZodString;
|
|
734
|
+
export declare const CreateClientRequestSchema: z.ZodObject<{
|
|
735
|
+
name: z.ZodString;
|
|
736
|
+
origins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
737
|
+
}, z.core.$strip>;
|
|
738
|
+
export type CreateClientRequest = z.infer<typeof CreateClientRequestSchema>;
|
|
739
|
+
export declare const CreateClientResponseSchema: z.ZodObject<{
|
|
740
|
+
clientId: z.ZodString;
|
|
741
|
+
name: z.ZodString;
|
|
742
|
+
origins: z.ZodArray<z.ZodString>;
|
|
743
|
+
createdAt: z.ZodString;
|
|
744
|
+
revoked: z.ZodLiteral<false>;
|
|
745
|
+
}, z.core.$strip>;
|
|
746
|
+
export type CreateClientResponse = z.infer<typeof CreateClientResponseSchema>;
|
|
747
|
+
export declare const AppClientSchema: z.ZodObject<{
|
|
748
|
+
clientId: z.ZodString;
|
|
749
|
+
name: z.ZodString;
|
|
750
|
+
origins: z.ZodArray<z.ZodString>;
|
|
751
|
+
createdAt: z.ZodString;
|
|
752
|
+
revoked: z.ZodBoolean;
|
|
753
|
+
revokedAt: z.ZodOptional<z.ZodString>;
|
|
754
|
+
lastUsedAt: z.ZodNullable<z.ZodString>;
|
|
755
|
+
requests: z.ZodNumber;
|
|
756
|
+
}, z.core.$strip>;
|
|
757
|
+
export type AppClient = z.infer<typeof AppClientSchema>;
|
|
758
|
+
export declare const ClientListResponseSchema: z.ZodObject<{
|
|
759
|
+
clients: z.ZodArray<z.ZodObject<{
|
|
760
|
+
clientId: z.ZodString;
|
|
761
|
+
name: z.ZodString;
|
|
762
|
+
origins: z.ZodArray<z.ZodString>;
|
|
763
|
+
createdAt: z.ZodString;
|
|
764
|
+
revoked: z.ZodBoolean;
|
|
765
|
+
revokedAt: z.ZodOptional<z.ZodString>;
|
|
766
|
+
lastUsedAt: z.ZodNullable<z.ZodString>;
|
|
767
|
+
requests: z.ZodNumber;
|
|
768
|
+
}, z.core.$strip>>;
|
|
769
|
+
}, z.core.$strip>;
|
|
770
|
+
export type ClientListResponse = z.infer<typeof ClientListResponseSchema>;
|
|
771
|
+
/**
|
|
772
|
+
* A tenant owns its keys, app clients, flows and knowledge base. Nothing is shared between tenants.
|
|
773
|
+
* The server operator (the server API key) creates tenants; a tenant's owner exchanges a one-time
|
|
774
|
+
* enrollment code for a secret admin key and manages the tenant with it.
|
|
775
|
+
*/
|
|
776
|
+
export declare const TENANT_ID_PATTERN: RegExp;
|
|
777
|
+
export declare const TenantIdSchema: z.ZodString;
|
|
778
|
+
/** The tenant every pre-1.9.0 install is migrated into. Requests that name no tenant act on it. */
|
|
779
|
+
export declare const DEFAULT_TENANT_ID = "tn_000000000000";
|
|
780
|
+
/** A secret key: `hpk_a_` (admin), `hpk_g_` (guide) or `hpk_m_` (MCP, added in 1.12.0) and 48 lowercase hex characters (192 random bits). Shown once. Admin and guide keys issued before 1.14.0 start with `gfk_a_` / `gfk_g_` and stay valid. */
|
|
781
|
+
export declare const KEY_SECRET_PATTERN: RegExp;
|
|
782
|
+
export declare const ADMIN_KEY_PATTERN: RegExp;
|
|
783
|
+
export declare const GUIDE_KEY_PATTERN: RegExp;
|
|
784
|
+
export declare const MCP_KEY_PATTERN: RegExp;
|
|
785
|
+
/** A key handle (not a secret): used to list and revoke keys. */
|
|
786
|
+
export declare const KEY_ID_PATTERN: RegExp;
|
|
787
|
+
export declare const KeyIdSchema: z.ZodString;
|
|
788
|
+
/** A one-time enrollment code: `hpe_` and 32 lowercase hex characters. Valid for 15 minutes. */
|
|
789
|
+
export declare const ENROLL_CODE_PATTERN: RegExp;
|
|
790
|
+
export declare const ENROLLMENT_TTL_MS: number;
|
|
791
|
+
/** `mcp` (1.12.0) is read-only and works only on the hosted MCP endpoint (`POST /mcp`); every other route refuses it. */
|
|
792
|
+
export declare const KeyScopeSchema: z.ZodEnum<{
|
|
793
|
+
admin: "admin";
|
|
794
|
+
guide: "guide";
|
|
795
|
+
mcp: "mcp";
|
|
796
|
+
}>;
|
|
797
|
+
export type KeyScope = z.infer<typeof KeyScopeSchema>;
|
|
798
|
+
/**
|
|
799
|
+
* Tenant routes use a tenant admin key (`Authorization: Bearer hpk_a_...`). A guide key (`hpk_g_...`) may only fetch walkthroughs.
|
|
800
|
+
* An MCP key (`hpk_m_...`, 1.12.0) may only call the hosted MCP endpoint, `POST /mcp`.
|
|
801
|
+
*/
|
|
802
|
+
export declare const TENANT_ROUTES: {
|
|
803
|
+
/** No authentication: the code is the credential. Rate limited like failed key checks. */
|
|
804
|
+
readonly enroll: "POST /api/tenant/enroll";
|
|
805
|
+
readonly self: "GET /api/tenant";
|
|
806
|
+
readonly createKey: "POST /api/keys";
|
|
807
|
+
readonly listKeys: "GET /api/keys";
|
|
808
|
+
/** Revokes. A tenant cannot revoke its last active admin key. Repeating it is fine. */
|
|
809
|
+
readonly revokeKey: "DELETE /api/keys/{id}";
|
|
810
|
+
};
|
|
811
|
+
/**
|
|
812
|
+
* A plan names a set of limits. Plans are data on the server (`HEYPOINTER_PLAN_LIMITS_JSON` adds or changes
|
|
813
|
+
* them), so a new tier needs no code. New tenants start on `free`; the migrated default tenant is `internal`.
|
|
814
|
+
*/
|
|
815
|
+
export declare const PlanNameSchema: z.ZodString;
|
|
816
|
+
export type PlanName = z.infer<typeof PlanNameSchema>;
|
|
817
|
+
export declare const DEFAULT_PLAN = "free";
|
|
818
|
+
/** What a tenant may hold at once. Revoked clients and keys do not count; they stay on record. */
|
|
819
|
+
export declare const PlanLimitsSchema: z.ZodObject<{
|
|
820
|
+
clients: z.ZodNumber;
|
|
821
|
+
keys: z.ZodNumber;
|
|
822
|
+
flows: z.ZodNumber;
|
|
823
|
+
members: z.ZodOptional<z.ZodNumber>;
|
|
824
|
+
}, z.core.$strip>;
|
|
825
|
+
export type PlanLimits = z.infer<typeof PlanLimitsSchema>;
|
|
826
|
+
export declare const PlanUsageSchema: z.ZodObject<{
|
|
827
|
+
clients: z.ZodNumber;
|
|
828
|
+
keys: z.ZodNumber;
|
|
829
|
+
flows: z.ZodNumber;
|
|
830
|
+
members: z.ZodOptional<z.ZodNumber>;
|
|
831
|
+
}, z.core.$strip>;
|
|
832
|
+
export type PlanUsage = z.infer<typeof PlanUsageSchema>;
|
|
833
|
+
/** A tenant's plan, what it allows, and what the tenant uses now. */
|
|
834
|
+
export declare const TenantPlanSchema: z.ZodObject<{
|
|
835
|
+
plan: z.ZodString;
|
|
836
|
+
limits: z.ZodObject<{
|
|
837
|
+
clients: z.ZodNumber;
|
|
838
|
+
keys: z.ZodNumber;
|
|
839
|
+
flows: z.ZodNumber;
|
|
840
|
+
members: z.ZodOptional<z.ZodNumber>;
|
|
841
|
+
}, z.core.$strip>;
|
|
842
|
+
usage: z.ZodObject<{
|
|
843
|
+
clients: z.ZodNumber;
|
|
844
|
+
keys: z.ZodNumber;
|
|
845
|
+
flows: z.ZodNumber;
|
|
846
|
+
members: z.ZodOptional<z.ZodNumber>;
|
|
847
|
+
}, z.core.$strip>;
|
|
848
|
+
}, z.core.$strip>;
|
|
849
|
+
export type TenantPlan = z.infer<typeof TenantPlanSchema>;
|
|
850
|
+
export declare const EnrollTenantRequestSchema: z.ZodObject<{
|
|
851
|
+
code: z.ZodString;
|
|
852
|
+
}, z.core.$strip>;
|
|
853
|
+
export type EnrollTenantRequest = z.infer<typeof EnrollTenantRequestSchema>;
|
|
854
|
+
export declare const CreatedKeySchema: z.ZodObject<{
|
|
855
|
+
keyId: z.ZodString;
|
|
856
|
+
scope: z.ZodEnum<{
|
|
857
|
+
admin: "admin";
|
|
858
|
+
guide: "guide";
|
|
859
|
+
mcp: "mcp";
|
|
860
|
+
}>;
|
|
861
|
+
secret: z.ZodString;
|
|
862
|
+
}, z.core.$strip>;
|
|
863
|
+
export type CreatedKey = z.infer<typeof CreatedKeySchema>;
|
|
864
|
+
export declare const EnrollTenantResponseSchema: z.ZodObject<{
|
|
865
|
+
tenantId: z.ZodString;
|
|
866
|
+
name: z.ZodString;
|
|
867
|
+
key: z.ZodObject<{
|
|
868
|
+
keyId: z.ZodString;
|
|
869
|
+
secret: z.ZodString;
|
|
870
|
+
scope: z.ZodLiteral<"admin">;
|
|
871
|
+
}, z.core.$strip>;
|
|
872
|
+
}, z.core.$strip>;
|
|
873
|
+
export type EnrollTenantResponse = z.infer<typeof EnrollTenantResponseSchema>;
|
|
874
|
+
/**
|
|
875
|
+
* What an MCP key or an OAuth sign-in lets an agent do on the hosted MCP endpoint (1.13.0). `mcp:read` covers the tools that only
|
|
876
|
+
* read or validate; `mcp:write` adds the tools that change the tenant (a draft flow, never a live one). The customer picks.
|
|
877
|
+
*/
|
|
878
|
+
export declare const McpScopeSchema: z.ZodEnum<{
|
|
879
|
+
"mcp:read": "mcp:read";
|
|
880
|
+
"mcp:write": "mcp:write";
|
|
881
|
+
}>;
|
|
882
|
+
export type McpScope = z.infer<typeof McpScopeSchema>;
|
|
883
|
+
export declare const MCP_SCOPES: readonly ["mcp:read", "mcp:write"];
|
|
884
|
+
/** `mcpScopes` applies to `scope: "mcp"` only and must include `mcp:read`; it defaults to read only. */
|
|
885
|
+
export declare const CreateKeyRequestSchema: z.ZodObject<{
|
|
886
|
+
name: z.ZodString;
|
|
887
|
+
scope: z.ZodEnum<{
|
|
888
|
+
admin: "admin";
|
|
889
|
+
guide: "guide";
|
|
890
|
+
mcp: "mcp";
|
|
891
|
+
}>;
|
|
892
|
+
mcpScopes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
893
|
+
"mcp:read": "mcp:read";
|
|
894
|
+
"mcp:write": "mcp:write";
|
|
895
|
+
}>>>;
|
|
896
|
+
}, z.core.$strip>;
|
|
897
|
+
export type CreateKeyRequest = z.infer<typeof CreateKeyRequestSchema>;
|
|
898
|
+
/** `expiresAt` (1.13.0): an MCP key stops working at this time (7 days after creation unless the operator set another lifetime). Other keys do not expire (`null`). */
|
|
899
|
+
export declare const CreateKeyResponseSchema: z.ZodObject<{
|
|
900
|
+
keyId: z.ZodString;
|
|
901
|
+
scope: z.ZodEnum<{
|
|
902
|
+
admin: "admin";
|
|
903
|
+
guide: "guide";
|
|
904
|
+
mcp: "mcp";
|
|
905
|
+
}>;
|
|
906
|
+
secret: z.ZodString;
|
|
907
|
+
name: z.ZodString;
|
|
908
|
+
createdAt: z.ZodString;
|
|
909
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
910
|
+
mcpScopes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
911
|
+
"mcp:read": "mcp:read";
|
|
912
|
+
"mcp:write": "mcp:write";
|
|
913
|
+
}>>>;
|
|
914
|
+
}, z.core.$strip>;
|
|
915
|
+
export type CreateKeyResponse = z.infer<typeof CreateKeyResponseSchema>;
|
|
916
|
+
export declare const KeySummarySchema: z.ZodObject<{
|
|
917
|
+
keyId: z.ZodString;
|
|
918
|
+
scope: z.ZodEnum<{
|
|
919
|
+
admin: "admin";
|
|
920
|
+
guide: "guide";
|
|
921
|
+
mcp: "mcp";
|
|
922
|
+
}>;
|
|
923
|
+
name: z.ZodString;
|
|
924
|
+
prefix: z.ZodString;
|
|
925
|
+
createdAt: z.ZodString;
|
|
926
|
+
lastUsedAt: z.ZodNullable<z.ZodString>;
|
|
927
|
+
revoked: z.ZodBoolean;
|
|
928
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
929
|
+
mcpScopes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
930
|
+
"mcp:read": "mcp:read";
|
|
931
|
+
"mcp:write": "mcp:write";
|
|
932
|
+
}>>>;
|
|
933
|
+
}, z.core.$strip>;
|
|
934
|
+
export type KeySummary = z.infer<typeof KeySummarySchema>;
|
|
935
|
+
export declare const KeyListResponseSchema: z.ZodObject<{
|
|
936
|
+
keys: z.ZodArray<z.ZodObject<{
|
|
937
|
+
keyId: z.ZodString;
|
|
938
|
+
scope: z.ZodEnum<{
|
|
939
|
+
admin: "admin";
|
|
940
|
+
guide: "guide";
|
|
941
|
+
mcp: "mcp";
|
|
942
|
+
}>;
|
|
943
|
+
name: z.ZodString;
|
|
944
|
+
prefix: z.ZodString;
|
|
945
|
+
createdAt: z.ZodString;
|
|
946
|
+
lastUsedAt: z.ZodNullable<z.ZodString>;
|
|
947
|
+
revoked: z.ZodBoolean;
|
|
948
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
949
|
+
mcpScopes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
950
|
+
"mcp:read": "mcp:read";
|
|
951
|
+
"mcp:write": "mcp:write";
|
|
952
|
+
}>>>;
|
|
953
|
+
}, z.core.$strip>>;
|
|
954
|
+
}, z.core.$strip>;
|
|
955
|
+
export type KeyListResponse = z.infer<typeof KeyListResponseSchema>;
|
|
956
|
+
export declare const TenantSelfResponseSchema: z.ZodObject<{
|
|
957
|
+
plan: z.ZodString;
|
|
958
|
+
limits: z.ZodObject<{
|
|
959
|
+
clients: z.ZodNumber;
|
|
960
|
+
keys: z.ZodNumber;
|
|
961
|
+
flows: z.ZodNumber;
|
|
962
|
+
members: z.ZodOptional<z.ZodNumber>;
|
|
963
|
+
}, z.core.$strip>;
|
|
964
|
+
usage: z.ZodObject<{
|
|
965
|
+
clients: z.ZodNumber;
|
|
966
|
+
keys: z.ZodNumber;
|
|
967
|
+
flows: z.ZodNumber;
|
|
968
|
+
members: z.ZodOptional<z.ZodNumber>;
|
|
969
|
+
}, z.core.$strip>;
|
|
970
|
+
tenantId: z.ZodString;
|
|
971
|
+
name: z.ZodString;
|
|
972
|
+
createdAt: z.ZodString;
|
|
973
|
+
counts: z.ZodObject<{
|
|
974
|
+
clients: z.ZodNumber;
|
|
975
|
+
keys: z.ZodNumber;
|
|
976
|
+
flows: z.ZodNumber;
|
|
977
|
+
members: z.ZodOptional<z.ZodNumber>;
|
|
978
|
+
}, z.core.$strip>;
|
|
979
|
+
}, z.core.$strip>;
|
|
980
|
+
export type TenantSelfResponse = z.infer<typeof TenantSelfResponseSchema>;
|
|
981
|
+
/**
|
|
982
|
+
* People sign in to the web console with an email and password (OIDC providers come later) and get a session
|
|
983
|
+
* cookie instead of pasting a key. Signup is invite-only. A user belongs to one or more tenants with a role.
|
|
984
|
+
* Accounts exist only when the operator sets `HEYPOINTER_PUBLIC_URL` and `HEYPOINTER_AUTH_SECRET`; otherwise every
|
|
985
|
+
* account route answers 404 `accounts_disabled` and keys keep working as before.
|
|
986
|
+
*/
|
|
987
|
+
export declare const USER_ID_PATTERN: RegExp;
|
|
988
|
+
export declare const UserIdSchema: z.ZodString;
|
|
989
|
+
export declare const SESSION_ID_PATTERN: RegExp;
|
|
990
|
+
export declare const INVITE_ID_PATTERN: RegExp;
|
|
991
|
+
/** An invite link token: shown once to the inviter inside the link. */
|
|
992
|
+
export declare const INVITE_TOKEN_PATTERN: RegExp;
|
|
993
|
+
/** A password reset token: shown once inside the reset link; valid one hour. */
|
|
994
|
+
export declare const RESET_TOKEN_PATTERN: RegExp;
|
|
995
|
+
/** The device code the CLI polls with. A secret: only its hash is stored. */
|
|
996
|
+
export declare const DEVICE_CODE_PATTERN: RegExp;
|
|
997
|
+
/** What the person types in the browser: `ABCD-EFGH`, no vowels and no look-alike characters. */
|
|
998
|
+
export declare const USER_CODE_PATTERN: RegExp;
|
|
999
|
+
export declare const RECOVERY_CODE_PATTERN: RegExp;
|
|
1000
|
+
/** The session cookie. With an https public URL the server sends it as `__Host-hp_session` (Secure). */
|
|
1001
|
+
export declare const SESSION_COOKIE = "hp_session";
|
|
1002
|
+
/** Every state-changing request authenticated by the session cookie must send the session's CSRF token here. */
|
|
1003
|
+
export declare const CSRF_HEADER = "X-HeyPointer-CSRF";
|
|
1004
|
+
export declare const SESSION_IDLE_MS: number;
|
|
1005
|
+
export declare const SESSION_ABSOLUTE_MS: number;
|
|
1006
|
+
export declare const INVITE_TTL_MS: number;
|
|
1007
|
+
export declare const RESET_TTL_MS: number;
|
|
1008
|
+
export declare const DEVICE_TTL_SECONDS = 600;
|
|
1009
|
+
export declare const DEVICE_POLL_INTERVAL_SECONDS = 5;
|
|
1010
|
+
export declare const MemberRoleSchema: z.ZodEnum<{
|
|
1011
|
+
admin: "admin";
|
|
1012
|
+
owner: "owner";
|
|
1013
|
+
member: "member";
|
|
1014
|
+
}>;
|
|
1015
|
+
export type MemberRole = z.infer<typeof MemberRoleSchema>;
|
|
1016
|
+
export declare const EmailSchema: z.ZodString;
|
|
1017
|
+
/** The routes added in 1.10.0. Session routes need the cookie and, when they change anything, the CSRF header and a same-origin `Origin`. */
|
|
1018
|
+
export declare const ACCOUNT_ROUTES: {
|
|
1019
|
+
readonly config: "GET /api/auth/config";
|
|
1020
|
+
readonly login: "POST /api/auth/login";
|
|
1021
|
+
readonly logout: "POST /api/auth/logout";
|
|
1022
|
+
readonly session: "GET /api/auth/session";
|
|
1023
|
+
readonly switchTenant: "POST /api/auth/tenant";
|
|
1024
|
+
readonly inviteInfo: "GET /api/auth/invite/{token}";
|
|
1025
|
+
readonly acceptInvite: "POST /api/auth/accept-invite";
|
|
1026
|
+
readonly changePassword: "POST /api/auth/password";
|
|
1027
|
+
readonly reset: "POST /api/auth/reset";
|
|
1028
|
+
readonly totpEnroll: "POST /api/auth/totp/enroll";
|
|
1029
|
+
readonly totpVerify: "POST /api/auth/totp/verify";
|
|
1030
|
+
readonly totpDisable: "DELETE /api/auth/totp";
|
|
1031
|
+
readonly listSessions: "GET /api/auth/sessions";
|
|
1032
|
+
readonly revokeSession: "DELETE /api/auth/sessions/{id}";
|
|
1033
|
+
readonly deviceStart: "POST /api/auth/device";
|
|
1034
|
+
readonly deviceLookup: "GET /api/auth/device/lookup?userCode=";
|
|
1035
|
+
readonly deviceApprove: "POST /api/auth/device/approve";
|
|
1036
|
+
readonly deviceDeny: "POST /api/auth/device/deny";
|
|
1037
|
+
readonly deviceToken: "POST /api/auth/device/token";
|
|
1038
|
+
readonly cliLogin: "POST /api/auth/cli-login";
|
|
1039
|
+
readonly listMembers: "GET /api/members";
|
|
1040
|
+
readonly updateMember: "PATCH /api/members/{userId}";
|
|
1041
|
+
readonly removeMember: "DELETE /api/members/{userId}";
|
|
1042
|
+
readonly resetMember: "POST /api/members/{userId}/reset";
|
|
1043
|
+
readonly listInvites: "GET /api/invites";
|
|
1044
|
+
readonly createInvite: "POST /api/invites";
|
|
1045
|
+
readonly revokeInvite: "DELETE /api/invites/{id}";
|
|
1046
|
+
readonly audit: "GET /api/audit";
|
|
1047
|
+
};
|
|
1048
|
+
/** A server without accounts answers `GET /api/auth/config` with 200 `{accounts:false}` (every other account route is a 404). */
|
|
1049
|
+
export declare const AuthConfigDisabledSchema: z.ZodObject<{
|
|
1050
|
+
accounts: z.ZodLiteral<false>;
|
|
1051
|
+
}, z.core.$strip>;
|
|
1052
|
+
export declare const AuthConfigResponseSchema: z.ZodObject<{
|
|
1053
|
+
accounts: z.ZodLiteral<true>;
|
|
1054
|
+
passwordLogin: z.ZodBoolean;
|
|
1055
|
+
providers: z.ZodArray<z.ZodObject<{
|
|
1056
|
+
id: z.ZodString;
|
|
1057
|
+
name: z.ZodString;
|
|
1058
|
+
}, z.core.$strip>>;
|
|
1059
|
+
publicUrl: z.ZodString;
|
|
1060
|
+
}, z.core.$strip>;
|
|
1061
|
+
export type AuthConfigResponse = z.infer<typeof AuthConfigResponseSchema>;
|
|
1062
|
+
export declare const AccountUserSchema: z.ZodObject<{
|
|
1063
|
+
userId: z.ZodString;
|
|
1064
|
+
email: z.ZodString;
|
|
1065
|
+
totpEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
1066
|
+
operator: z.ZodOptional<z.ZodBoolean>;
|
|
1067
|
+
}, z.core.$strip>;
|
|
1068
|
+
export type AccountUser = z.infer<typeof AccountUserSchema>;
|
|
1069
|
+
export declare const MembershipSchema: z.ZodObject<{
|
|
1070
|
+
tenantId: z.ZodString;
|
|
1071
|
+
name: z.ZodString;
|
|
1072
|
+
role: z.ZodEnum<{
|
|
1073
|
+
admin: "admin";
|
|
1074
|
+
owner: "owner";
|
|
1075
|
+
member: "member";
|
|
1076
|
+
}>;
|
|
1077
|
+
}, z.core.$strip>;
|
|
1078
|
+
export type Membership = z.infer<typeof MembershipSchema>;
|
|
1079
|
+
export declare const LoginRequestSchema: z.ZodObject<{
|
|
1080
|
+
email: z.ZodString;
|
|
1081
|
+
password: z.ZodString;
|
|
1082
|
+
totp: z.ZodOptional<z.ZodString>;
|
|
1083
|
+
}, z.core.$strip>;
|
|
1084
|
+
export type LoginRequest = z.infer<typeof LoginRequestSchema>;
|
|
1085
|
+
export declare const LoginResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1086
|
+
status: z.ZodLiteral<"ok">;
|
|
1087
|
+
user: z.ZodObject<{
|
|
1088
|
+
userId: z.ZodString;
|
|
1089
|
+
email: z.ZodString;
|
|
1090
|
+
totpEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
1091
|
+
operator: z.ZodOptional<z.ZodBoolean>;
|
|
1092
|
+
}, z.core.$strip>;
|
|
1093
|
+
tenants: z.ZodArray<z.ZodObject<{
|
|
1094
|
+
tenantId: z.ZodString;
|
|
1095
|
+
name: z.ZodString;
|
|
1096
|
+
role: z.ZodEnum<{
|
|
1097
|
+
admin: "admin";
|
|
1098
|
+
owner: "owner";
|
|
1099
|
+
member: "member";
|
|
1100
|
+
}>;
|
|
1101
|
+
}, z.core.$strip>>;
|
|
1102
|
+
activeTenantId: z.ZodNullable<z.ZodString>;
|
|
1103
|
+
csrfToken: z.ZodString;
|
|
1104
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1105
|
+
status: z.ZodLiteral<"totp_required">;
|
|
1106
|
+
}, z.core.$strip>], "status">;
|
|
1107
|
+
export type LoginResponse = z.infer<typeof LoginResponseSchema>;
|
|
1108
|
+
export declare const SessionResponseSchema: z.ZodObject<{
|
|
1109
|
+
user: z.ZodObject<{
|
|
1110
|
+
userId: z.ZodString;
|
|
1111
|
+
email: z.ZodString;
|
|
1112
|
+
totpEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
1113
|
+
operator: z.ZodOptional<z.ZodBoolean>;
|
|
1114
|
+
}, z.core.$strip>;
|
|
1115
|
+
tenants: z.ZodArray<z.ZodObject<{
|
|
1116
|
+
tenantId: z.ZodString;
|
|
1117
|
+
name: z.ZodString;
|
|
1118
|
+
role: z.ZodEnum<{
|
|
1119
|
+
admin: "admin";
|
|
1120
|
+
owner: "owner";
|
|
1121
|
+
member: "member";
|
|
1122
|
+
}>;
|
|
1123
|
+
}, z.core.$strip>>;
|
|
1124
|
+
activeTenantId: z.ZodNullable<z.ZodString>;
|
|
1125
|
+
role: z.ZodNullable<z.ZodEnum<{
|
|
1126
|
+
admin: "admin";
|
|
1127
|
+
owner: "owner";
|
|
1128
|
+
member: "member";
|
|
1129
|
+
}>>;
|
|
1130
|
+
csrfToken: z.ZodString;
|
|
1131
|
+
operator: z.ZodOptional<z.ZodBoolean>;
|
|
1132
|
+
plan: z.ZodOptional<z.ZodString>;
|
|
1133
|
+
limits: z.ZodOptional<z.ZodObject<{
|
|
1134
|
+
clients: z.ZodNumber;
|
|
1135
|
+
keys: z.ZodNumber;
|
|
1136
|
+
flows: z.ZodNumber;
|
|
1137
|
+
members: z.ZodOptional<z.ZodNumber>;
|
|
1138
|
+
}, z.core.$strip>>;
|
|
1139
|
+
usage: z.ZodOptional<z.ZodObject<{
|
|
1140
|
+
clients: z.ZodNumber;
|
|
1141
|
+
keys: z.ZodNumber;
|
|
1142
|
+
flows: z.ZodNumber;
|
|
1143
|
+
members: z.ZodOptional<z.ZodNumber>;
|
|
1144
|
+
}, z.core.$strip>>;
|
|
1145
|
+
}, z.core.$strip>;
|
|
1146
|
+
export type SessionResponse = z.infer<typeof SessionResponseSchema>;
|
|
1147
|
+
export declare const SwitchTenantRequestSchema: z.ZodObject<{
|
|
1148
|
+
tenantId: z.ZodString;
|
|
1149
|
+
}, z.core.$strip>;
|
|
1150
|
+
export type SwitchTenantRequest = z.infer<typeof SwitchTenantRequestSchema>;
|
|
1151
|
+
export declare const InviteInfoResponseSchema: z.ZodObject<{
|
|
1152
|
+
email: z.ZodString;
|
|
1153
|
+
tenantName: z.ZodString;
|
|
1154
|
+
role: z.ZodEnum<{
|
|
1155
|
+
admin: "admin";
|
|
1156
|
+
owner: "owner";
|
|
1157
|
+
member: "member";
|
|
1158
|
+
}>;
|
|
1159
|
+
kind: z.ZodOptional<z.ZodLiteral<"operator">>;
|
|
1160
|
+
}, z.core.$strip>;
|
|
1161
|
+
export type InviteInfoResponse = z.infer<typeof InviteInfoResponseSchema>;
|
|
1162
|
+
export declare const AcceptInviteRequestSchema: z.ZodObject<{
|
|
1163
|
+
token: z.ZodString;
|
|
1164
|
+
password: z.ZodOptional<z.ZodString>;
|
|
1165
|
+
}, z.core.$strip>;
|
|
1166
|
+
export type AcceptInviteRequest = z.infer<typeof AcceptInviteRequestSchema>;
|
|
1167
|
+
export declare const ChangePasswordRequestSchema: z.ZodObject<{
|
|
1168
|
+
current: z.ZodString;
|
|
1169
|
+
next: z.ZodString;
|
|
1170
|
+
}, z.core.$strip>;
|
|
1171
|
+
export type ChangePasswordRequest = z.infer<typeof ChangePasswordRequestSchema>;
|
|
1172
|
+
export declare const ResetPasswordRequestSchema: z.ZodObject<{
|
|
1173
|
+
token: z.ZodString;
|
|
1174
|
+
password: z.ZodString;
|
|
1175
|
+
}, z.core.$strip>;
|
|
1176
|
+
export type ResetPasswordRequest = z.infer<typeof ResetPasswordRequestSchema>;
|
|
1177
|
+
export declare const TotpEnrollResponseSchema: z.ZodObject<{
|
|
1178
|
+
secretBase32: z.ZodString;
|
|
1179
|
+
otpauthUri: z.ZodString;
|
|
1180
|
+
}, z.core.$strip>;
|
|
1181
|
+
export type TotpEnrollResponse = z.infer<typeof TotpEnrollResponseSchema>;
|
|
1182
|
+
export declare const TotpVerifyRequestSchema: z.ZodObject<{
|
|
1183
|
+
code: z.ZodString;
|
|
1184
|
+
}, z.core.$strip>;
|
|
1185
|
+
export type TotpVerifyRequest = z.infer<typeof TotpVerifyRequestSchema>;
|
|
1186
|
+
/** Shown once. Each works once in place of an authenticator code. */
|
|
1187
|
+
export declare const TotpVerifyResponseSchema: z.ZodObject<{
|
|
1188
|
+
recoveryCodes: z.ZodArray<z.ZodString>;
|
|
1189
|
+
}, z.core.$strip>;
|
|
1190
|
+
export type TotpVerifyResponse = z.infer<typeof TotpVerifyResponseSchema>;
|
|
1191
|
+
export declare const TotpDisableRequestSchema: z.ZodObject<{
|
|
1192
|
+
password: z.ZodString;
|
|
1193
|
+
}, z.core.$strip>;
|
|
1194
|
+
export type TotpDisableRequest = z.infer<typeof TotpDisableRequestSchema>;
|
|
1195
|
+
export declare const SessionSummarySchema: z.ZodObject<{
|
|
1196
|
+
sessionId: z.ZodString;
|
|
1197
|
+
current: z.ZodBoolean;
|
|
1198
|
+
createdAt: z.ZodString;
|
|
1199
|
+
lastSeenAt: z.ZodString;
|
|
1200
|
+
expiresAt: z.ZodString;
|
|
1201
|
+
ip: z.ZodString;
|
|
1202
|
+
userAgent: z.ZodString;
|
|
1203
|
+
tenantId: z.ZodNullable<z.ZodString>;
|
|
1204
|
+
}, z.core.$strip>;
|
|
1205
|
+
export type SessionSummary = z.infer<typeof SessionSummarySchema>;
|
|
1206
|
+
export declare const SessionListResponseSchema: z.ZodObject<{
|
|
1207
|
+
sessions: z.ZodArray<z.ZodObject<{
|
|
1208
|
+
sessionId: z.ZodString;
|
|
1209
|
+
current: z.ZodBoolean;
|
|
1210
|
+
createdAt: z.ZodString;
|
|
1211
|
+
lastSeenAt: z.ZodString;
|
|
1212
|
+
expiresAt: z.ZodString;
|
|
1213
|
+
ip: z.ZodString;
|
|
1214
|
+
userAgent: z.ZodString;
|
|
1215
|
+
tenantId: z.ZodNullable<z.ZodString>;
|
|
1216
|
+
}, z.core.$strip>>;
|
|
1217
|
+
}, z.core.$strip>;
|
|
1218
|
+
export type SessionListResponse = z.infer<typeof SessionListResponseSchema>;
|
|
1219
|
+
export declare const MemberSchema: z.ZodObject<{
|
|
1220
|
+
userId: z.ZodString;
|
|
1221
|
+
email: z.ZodString;
|
|
1222
|
+
role: z.ZodEnum<{
|
|
1223
|
+
admin: "admin";
|
|
1224
|
+
owner: "owner";
|
|
1225
|
+
member: "member";
|
|
1226
|
+
}>;
|
|
1227
|
+
createdAt: z.ZodString;
|
|
1228
|
+
lastLoginAt: z.ZodNullable<z.ZodString>;
|
|
1229
|
+
totpEnabled: z.ZodBoolean;
|
|
1230
|
+
}, z.core.$strip>;
|
|
1231
|
+
export type Member = z.infer<typeof MemberSchema>;
|
|
1232
|
+
export declare const MemberListResponseSchema: z.ZodObject<{
|
|
1233
|
+
members: z.ZodArray<z.ZodObject<{
|
|
1234
|
+
userId: z.ZodString;
|
|
1235
|
+
email: z.ZodString;
|
|
1236
|
+
role: z.ZodEnum<{
|
|
1237
|
+
admin: "admin";
|
|
1238
|
+
owner: "owner";
|
|
1239
|
+
member: "member";
|
|
1240
|
+
}>;
|
|
1241
|
+
createdAt: z.ZodString;
|
|
1242
|
+
lastLoginAt: z.ZodNullable<z.ZodString>;
|
|
1243
|
+
totpEnabled: z.ZodBoolean;
|
|
1244
|
+
}, z.core.$strip>>;
|
|
1245
|
+
}, z.core.$strip>;
|
|
1246
|
+
export type MemberListResponse = z.infer<typeof MemberListResponseSchema>;
|
|
1247
|
+
export declare const UpdateMemberRequestSchema: z.ZodObject<{
|
|
1248
|
+
role: z.ZodEnum<{
|
|
1249
|
+
admin: "admin";
|
|
1250
|
+
owner: "owner";
|
|
1251
|
+
member: "member";
|
|
1252
|
+
}>;
|
|
1253
|
+
}, z.core.$strip>;
|
|
1254
|
+
export type UpdateMemberRequest = z.infer<typeof UpdateMemberRequestSchema>;
|
|
1255
|
+
export declare const CreateInviteRequestSchema: z.ZodObject<{
|
|
1256
|
+
email: z.ZodString;
|
|
1257
|
+
role: z.ZodEnum<{
|
|
1258
|
+
admin: "admin";
|
|
1259
|
+
owner: "owner";
|
|
1260
|
+
member: "member";
|
|
1261
|
+
}>;
|
|
1262
|
+
}, z.core.$strip>;
|
|
1263
|
+
export type CreateInviteRequest = z.infer<typeof CreateInviteRequestSchema>;
|
|
1264
|
+
/** The link is shown once: the server sends no email, so the inviter passes it on. */
|
|
1265
|
+
export declare const CreateInviteResponseSchema: z.ZodObject<{
|
|
1266
|
+
inviteId: z.ZodString;
|
|
1267
|
+
email: z.ZodString;
|
|
1268
|
+
role: z.ZodEnum<{
|
|
1269
|
+
admin: "admin";
|
|
1270
|
+
owner: "owner";
|
|
1271
|
+
member: "member";
|
|
1272
|
+
}>;
|
|
1273
|
+
inviteLink: z.ZodString;
|
|
1274
|
+
expiresAt: z.ZodString;
|
|
1275
|
+
}, z.core.$strip>;
|
|
1276
|
+
export type CreateInviteResponse = z.infer<typeof CreateInviteResponseSchema>;
|
|
1277
|
+
export declare const InviteSummarySchema: z.ZodObject<{
|
|
1278
|
+
inviteId: z.ZodString;
|
|
1279
|
+
email: z.ZodString;
|
|
1280
|
+
role: z.ZodEnum<{
|
|
1281
|
+
admin: "admin";
|
|
1282
|
+
owner: "owner";
|
|
1283
|
+
member: "member";
|
|
1284
|
+
}>;
|
|
1285
|
+
invitedBy: z.ZodString;
|
|
1286
|
+
createdAt: z.ZodString;
|
|
1287
|
+
expiresAt: z.ZodString;
|
|
1288
|
+
status: z.ZodEnum<{
|
|
1289
|
+
pending: "pending";
|
|
1290
|
+
expired: "expired";
|
|
1291
|
+
}>;
|
|
1292
|
+
}, z.core.$strip>;
|
|
1293
|
+
export type InviteSummary = z.infer<typeof InviteSummarySchema>;
|
|
1294
|
+
export declare const InviteListResponseSchema: z.ZodObject<{
|
|
1295
|
+
invites: z.ZodArray<z.ZodObject<{
|
|
1296
|
+
inviteId: z.ZodString;
|
|
1297
|
+
email: z.ZodString;
|
|
1298
|
+
role: z.ZodEnum<{
|
|
1299
|
+
admin: "admin";
|
|
1300
|
+
owner: "owner";
|
|
1301
|
+
member: "member";
|
|
1302
|
+
}>;
|
|
1303
|
+
invitedBy: z.ZodString;
|
|
1304
|
+
createdAt: z.ZodString;
|
|
1305
|
+
expiresAt: z.ZodString;
|
|
1306
|
+
status: z.ZodEnum<{
|
|
1307
|
+
pending: "pending";
|
|
1308
|
+
expired: "expired";
|
|
1309
|
+
}>;
|
|
1310
|
+
}, z.core.$strip>>;
|
|
1311
|
+
}, z.core.$strip>;
|
|
1312
|
+
export type InviteListResponse = z.infer<typeof InviteListResponseSchema>;
|
|
1313
|
+
export declare const ResetLinkResponseSchema: z.ZodObject<{
|
|
1314
|
+
resetLink: z.ZodString;
|
|
1315
|
+
expiresAt: z.ZodString;
|
|
1316
|
+
}, z.core.$strip>;
|
|
1317
|
+
export type ResetLinkResponse = z.infer<typeof ResetLinkResponseSchema>;
|
|
1318
|
+
export declare const DeviceStartRequestSchema: z.ZodObject<{
|
|
1319
|
+
deviceName: z.ZodString;
|
|
1320
|
+
}, z.core.$strip>;
|
|
1321
|
+
export type DeviceStartRequest = z.infer<typeof DeviceStartRequestSchema>;
|
|
1322
|
+
export declare const DeviceStartResponseSchema: z.ZodObject<{
|
|
1323
|
+
deviceCode: z.ZodString;
|
|
1324
|
+
userCode: z.ZodString;
|
|
1325
|
+
verificationUri: z.ZodString;
|
|
1326
|
+
verificationUriComplete: z.ZodString;
|
|
1327
|
+
expiresIn: z.ZodNumber;
|
|
1328
|
+
interval: z.ZodNumber;
|
|
1329
|
+
}, z.core.$strip>;
|
|
1330
|
+
export type DeviceStartResponse = z.infer<typeof DeviceStartResponseSchema>;
|
|
1331
|
+
export declare const DeviceLookupResponseSchema: z.ZodObject<{
|
|
1332
|
+
deviceName: z.ZodString;
|
|
1333
|
+
requestedAt: z.ZodString;
|
|
1334
|
+
}, z.core.$strip>;
|
|
1335
|
+
export type DeviceLookupResponse = z.infer<typeof DeviceLookupResponseSchema>;
|
|
1336
|
+
export declare const DeviceDecisionRequestSchema: z.ZodObject<{
|
|
1337
|
+
userCode: z.ZodString;
|
|
1338
|
+
tenantId: z.ZodOptional<z.ZodString>;
|
|
1339
|
+
}, z.core.$strip>;
|
|
1340
|
+
export type DeviceDecisionRequest = z.infer<typeof DeviceDecisionRequestSchema>;
|
|
1341
|
+
export declare const DeviceTokenRequestSchema: z.ZodObject<{
|
|
1342
|
+
deviceCode: z.ZodString;
|
|
1343
|
+
}, z.core.$strip>;
|
|
1344
|
+
export type DeviceTokenRequest = z.infer<typeof DeviceTokenRequestSchema>;
|
|
1345
|
+
export declare const DeviceTokenResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1346
|
+
status: z.ZodLiteral<"pending">;
|
|
1347
|
+
interval: z.ZodNumber;
|
|
1348
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1349
|
+
status: z.ZodLiteral<"slow_down">;
|
|
1350
|
+
interval: z.ZodNumber;
|
|
1351
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1352
|
+
status: z.ZodLiteral<"denied">;
|
|
1353
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1354
|
+
status: z.ZodLiteral<"expired">;
|
|
1355
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1356
|
+
status: z.ZodLiteral<"approved">;
|
|
1357
|
+
tenantId: z.ZodString;
|
|
1358
|
+
tenantName: z.ZodString;
|
|
1359
|
+
key: z.ZodObject<{
|
|
1360
|
+
keyId: z.ZodString;
|
|
1361
|
+
secret: z.ZodString;
|
|
1362
|
+
scope: z.ZodLiteral<"admin">;
|
|
1363
|
+
}, z.core.$strip>;
|
|
1364
|
+
}, z.core.$strip>], "status">;
|
|
1365
|
+
export type DeviceTokenResponse = z.infer<typeof DeviceTokenResponseSchema>;
|
|
1366
|
+
export declare const CliLoginRequestSchema: z.ZodObject<{
|
|
1367
|
+
email: z.ZodString;
|
|
1368
|
+
password: z.ZodString;
|
|
1369
|
+
totp: z.ZodOptional<z.ZodString>;
|
|
1370
|
+
tenantId: z.ZodOptional<z.ZodString>;
|
|
1371
|
+
deviceName: z.ZodString;
|
|
1372
|
+
}, z.core.$strip>;
|
|
1373
|
+
export type CliLoginRequest = z.infer<typeof CliLoginRequestSchema>;
|
|
1374
|
+
export declare const CliLoginResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1375
|
+
status: z.ZodLiteral<"ok">;
|
|
1376
|
+
tenantId: z.ZodString;
|
|
1377
|
+
tenantName: z.ZodString;
|
|
1378
|
+
key: z.ZodObject<{
|
|
1379
|
+
keyId: z.ZodString;
|
|
1380
|
+
secret: z.ZodString;
|
|
1381
|
+
scope: z.ZodLiteral<"admin">;
|
|
1382
|
+
}, z.core.$strip>;
|
|
1383
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1384
|
+
status: z.ZodLiteral<"totp_required">;
|
|
1385
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1386
|
+
status: z.ZodLiteral<"tenant_required">;
|
|
1387
|
+
tenants: z.ZodArray<z.ZodObject<{
|
|
1388
|
+
tenantId: z.ZodString;
|
|
1389
|
+
name: z.ZodString;
|
|
1390
|
+
role: z.ZodEnum<{
|
|
1391
|
+
admin: "admin";
|
|
1392
|
+
owner: "owner";
|
|
1393
|
+
member: "member";
|
|
1394
|
+
}>;
|
|
1395
|
+
}, z.core.$strip>>;
|
|
1396
|
+
}, z.core.$strip>], "status">;
|
|
1397
|
+
export type CliLoginResponse = z.infer<typeof CliLoginResponseSchema>;
|
|
1398
|
+
export declare const AuditActorSchema: z.ZodObject<{
|
|
1399
|
+
type: z.ZodEnum<{
|
|
1400
|
+
key: "key";
|
|
1401
|
+
operator: "operator";
|
|
1402
|
+
user: "user";
|
|
1403
|
+
anonymous: "anonymous";
|
|
1404
|
+
}>;
|
|
1405
|
+
id: z.ZodString;
|
|
1406
|
+
}, z.core.$strip>;
|
|
1407
|
+
export declare const AuditEntrySchema: z.ZodObject<{
|
|
1408
|
+
id: z.ZodNumber;
|
|
1409
|
+
ts: z.ZodString;
|
|
1410
|
+
tenantId: z.ZodNullable<z.ZodString>;
|
|
1411
|
+
actor: z.ZodObject<{
|
|
1412
|
+
type: z.ZodEnum<{
|
|
1413
|
+
key: "key";
|
|
1414
|
+
operator: "operator";
|
|
1415
|
+
user: "user";
|
|
1416
|
+
anonymous: "anonymous";
|
|
1417
|
+
}>;
|
|
1418
|
+
id: z.ZodString;
|
|
1419
|
+
}, z.core.$strip>;
|
|
1420
|
+
action: z.ZodString;
|
|
1421
|
+
target: z.ZodNullable<z.ZodString>;
|
|
1422
|
+
result: z.ZodEnum<{
|
|
1423
|
+
ok: "ok";
|
|
1424
|
+
denied: "denied";
|
|
1425
|
+
failed: "failed";
|
|
1426
|
+
}>;
|
|
1427
|
+
byStaff: z.ZodOptional<z.ZodBoolean>;
|
|
1428
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1429
|
+
}, z.core.$strip>;
|
|
1430
|
+
export type AuditEntry = z.infer<typeof AuditEntrySchema>;
|
|
1431
|
+
/** Newest first. Pass `next` back as `before` for the following page; null when there is none. */
|
|
1432
|
+
export declare const AuditListResponseSchema: z.ZodObject<{
|
|
1433
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
1434
|
+
id: z.ZodNumber;
|
|
1435
|
+
ts: z.ZodString;
|
|
1436
|
+
tenantId: z.ZodNullable<z.ZodString>;
|
|
1437
|
+
actor: z.ZodObject<{
|
|
1438
|
+
type: z.ZodEnum<{
|
|
1439
|
+
key: "key";
|
|
1440
|
+
operator: "operator";
|
|
1441
|
+
user: "user";
|
|
1442
|
+
anonymous: "anonymous";
|
|
1443
|
+
}>;
|
|
1444
|
+
id: z.ZodString;
|
|
1445
|
+
}, z.core.$strip>;
|
|
1446
|
+
action: z.ZodString;
|
|
1447
|
+
target: z.ZodNullable<z.ZodString>;
|
|
1448
|
+
result: z.ZodEnum<{
|
|
1449
|
+
ok: "ok";
|
|
1450
|
+
denied: "denied";
|
|
1451
|
+
failed: "failed";
|
|
1452
|
+
}>;
|
|
1453
|
+
byStaff: z.ZodOptional<z.ZodBoolean>;
|
|
1454
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1455
|
+
}, z.core.$strip>>;
|
|
1456
|
+
next: z.ZodNullable<z.ZodNumber>;
|
|
1457
|
+
}, z.core.$strip>;
|
|
1458
|
+
export type AuditListResponse = z.infer<typeof AuditListResponseSchema>;
|