@opengeni/contracts 3.1.2 → 3.2.2

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.
@@ -0,0 +1,856 @@
1
+ /**
2
+ * `opengeni.vault.v1`: the signed remote vault-provider protocol.
3
+ *
4
+ * Opengeni POSTs one JSON request per operation to a registered endpoint,
5
+ * signed over the exact body with the existing `OpenGeni-Signature` scheme
6
+ * (`signOpenGeniPayload`). The receiver verifies the signature, then maps the
7
+ * trusted native authority tuple to its own tenant and user and rechecks
8
+ * access on every operation: a valid MAC authenticates Opengeni, it is not an
9
+ * authorization decision. Responses are signed with a response-only derived
10
+ * key (`vaultProviderWireResponseKey`) so a response can never be replayed as
11
+ * a request.
12
+ *
13
+ * Every shape is strict and bounded. Metadata shapes have no value fields.
14
+ * Mutations carry an idempotency key; Opengeni never retries a mutation
15
+ * automatically and reports an ambiguous outcome instead.
16
+ */
17
+ import { z } from "zod";
18
+ export declare const VAULT_PROVIDER_WIRE_VERSION: "opengeni.vault.v1";
19
+ /** Response signature header. Requests use the shared `OpenGeni-Signature` header. */
20
+ export declare const VAULT_PROVIDER_WIRE_RESPONSE_SIGNATURE_HEADER = "OpenGeni-Vault-Response-Signature";
21
+ /**
22
+ * The response signing key is derived from the connection secret with a fixed
23
+ * domain label, so request and response MACs are never interchangeable.
24
+ */
25
+ export declare function vaultProviderWireResponseKey(signingSecret: string): string;
26
+ export declare const VAULT_PROVIDER_WIRE_LIMITS: {
27
+ readonly maxRequestBytes: number;
28
+ readonly maxResponseBytes: number;
29
+ /** Sum of returned secret value bytes in one read. */
30
+ readonly maxReadValueBytes: number;
31
+ readonly pageSizeMax: 100;
32
+ readonly cursorMaxChars: 1024;
33
+ readonly snapshotMaxChars: 1024;
34
+ readonly externalIdMaxChars: 300;
35
+ readonly vaultNameMaxChars: 300;
36
+ readonly nativeIdMaxChars: 200;
37
+ readonly readFieldsMax: 50;
38
+ readonly idempotencyKeyMaxChars: 200;
39
+ readonly accountIdMaxChars: 300;
40
+ readonly accountNameMaxChars: 300;
41
+ readonly versionMaxChars: 300;
42
+ readonly cacheEpochMaxChars: 200;
43
+ /** Per request deadline enforced by Opengeni's transport. */
44
+ readonly defaultTimeoutMs: 15000;
45
+ readonly maxTimeoutMs: 60000;
46
+ /** Accepted request age; matches `OPENGENI_SIGNATURE_TOLERANCE_SECONDS`. */
47
+ readonly signatureToleranceSeconds: 300;
48
+ };
49
+ /** Mirrors `VAULT_PROVIDER_ERROR_CODES` in `@opengeni/vaults` (parity tested there). */
50
+ export declare const VAULT_PROVIDER_WIRE_ERROR_CODES: readonly ["provider_auth_invalid", "provider_auth_expired", "provider_rate_limited", "provider_unavailable", "provider_conflict", "provider_not_found", "provider_permission_denied", "provider_locked", "provider_inventory_incomplete", "provider_outcome_unknown"];
51
+ export type VaultProviderWireErrorCode = (typeof VAULT_PROVIDER_WIRE_ERROR_CODES)[number];
52
+ export declare const VAULT_PROVIDER_WIRE_OPERATIONS: readonly ["describe", "refresh", "list_vaults", "list_items", "read_fields", "write_item", "archive_item"];
53
+ export type VaultProviderWireOperationName = (typeof VAULT_PROVIDER_WIRE_OPERATIONS)[number];
54
+ export type VaultProviderWireMutationName = "write_item" | "archive_item";
55
+ export declare function isVaultProviderWireMutation(op: VaultProviderWireOperationName): op is VaultProviderWireMutationName;
56
+ /** Remote providers that use this protocol. */
57
+ export declare const VaultProviderWireProvider: z.ZodEnum<{
58
+ bitwarden: "bitwarden";
59
+ external: "external";
60
+ }>;
61
+ export type VaultProviderWireProvider = z.infer<typeof VaultProviderWireProvider>;
62
+ export declare function vaultProviderWireUtf8Bytes(value: string): number;
63
+ /** Case-insensitive name identity used for field-name uniqueness. */
64
+ export declare function vaultProviderWireNameKey(name: string): string;
65
+ /**
66
+ * The trusted native caller. Opengeni fills it from the authorized registry,
67
+ * never from model or body-supplied arguments.
68
+ */
69
+ export declare const VaultProviderWireAuthority: z.ZodObject<{
70
+ accountId: z.ZodString;
71
+ workspaceId: z.ZodString;
72
+ subjectId: z.ZodNullable<z.ZodString>;
73
+ connectionWorkspaceId: z.ZodString;
74
+ sessionId: z.ZodOptional<z.ZodString>;
75
+ turnId: z.ZodOptional<z.ZodString>;
76
+ attemptId: z.ZodOptional<z.ZodString>;
77
+ siteId: z.ZodOptional<z.ZodString>;
78
+ }, z.core.$strict>;
79
+ export type VaultProviderWireAuthority = z.infer<typeof VaultProviderWireAuthority>;
80
+ export declare const VaultProviderWirePage: z.ZodObject<{
81
+ limit: z.ZodNumber;
82
+ cursor: z.ZodOptional<z.ZodString>;
83
+ snapshot: z.ZodOptional<z.ZodString>;
84
+ }, z.core.$strict>;
85
+ export type VaultProviderWirePage = z.infer<typeof VaultProviderWirePage>;
86
+ export declare const VaultProviderWireWriteField: z.ZodObject<{
87
+ externalFieldId: z.ZodOptional<z.ZodString>;
88
+ name: z.ZodString;
89
+ kind: z.ZodEnum<{
90
+ concealed: "concealed";
91
+ file: "file";
92
+ text: "text";
93
+ totp: "totp";
94
+ }>;
95
+ value: z.ZodOptional<z.ZodString>;
96
+ remove: z.ZodOptional<z.ZodLiteral<true>>;
97
+ }, z.core.$strict>;
98
+ export type VaultProviderWireWriteField = z.infer<typeof VaultProviderWireWriteField>;
99
+ export declare const VaultProviderWireWriteItem: z.ZodObject<{
100
+ externalItemId: z.ZodOptional<z.ZodString>;
101
+ expectedVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
102
+ name: z.ZodString;
103
+ type: z.ZodEnum<{
104
+ api_key: "api_key";
105
+ file: "file";
106
+ login: "login";
107
+ note: "note";
108
+ passkey: "passkey";
109
+ }> & z.ZodType<"api_key" | "file" | "login" | "note", "api_key" | "file" | "login" | "note" | "passkey", z.core.$ZodTypeInternals<"api_key" | "file" | "login" | "note", "api_key" | "file" | "login" | "note" | "passkey">>;
110
+ websites: z.ZodArray<z.ZodString>;
111
+ fields: z.ZodArray<z.ZodObject<{
112
+ externalFieldId: z.ZodOptional<z.ZodString>;
113
+ name: z.ZodString;
114
+ kind: z.ZodEnum<{
115
+ concealed: "concealed";
116
+ file: "file";
117
+ text: "text";
118
+ totp: "totp";
119
+ }>;
120
+ value: z.ZodOptional<z.ZodString>;
121
+ remove: z.ZodOptional<z.ZodLiteral<true>>;
122
+ }, z.core.$strict>>;
123
+ }, z.core.$strict>;
124
+ export type VaultProviderWireWriteItem = z.infer<typeof VaultProviderWireWriteItem>;
125
+ export declare const VaultProviderWireOperation: z.ZodDiscriminatedUnion<[z.ZodObject<{
126
+ op: z.ZodLiteral<"describe">;
127
+ }, z.core.$strict>, z.ZodObject<{
128
+ op: z.ZodLiteral<"refresh">;
129
+ }, z.core.$strict>, z.ZodObject<{
130
+ forceRefresh: z.ZodBoolean;
131
+ cacheEpoch: z.ZodNullable<z.ZodString>;
132
+ op: z.ZodLiteral<"list_vaults">;
133
+ page: z.ZodObject<{
134
+ limit: z.ZodNumber;
135
+ cursor: z.ZodOptional<z.ZodString>;
136
+ snapshot: z.ZodOptional<z.ZodString>;
137
+ }, z.core.$strict>;
138
+ }, z.core.$strict>, z.ZodObject<{
139
+ forceRefresh: z.ZodBoolean;
140
+ cacheEpoch: z.ZodNullable<z.ZodString>;
141
+ op: z.ZodLiteral<"list_items">;
142
+ externalVaultId: z.ZodString;
143
+ page: z.ZodObject<{
144
+ limit: z.ZodNumber;
145
+ cursor: z.ZodOptional<z.ZodString>;
146
+ snapshot: z.ZodOptional<z.ZodString>;
147
+ }, z.core.$strict>;
148
+ }, z.core.$strict>, z.ZodObject<{
149
+ forceRefresh: z.ZodBoolean;
150
+ cacheEpoch: z.ZodNullable<z.ZodString>;
151
+ op: z.ZodLiteral<"read_fields">;
152
+ externalVaultId: z.ZodString;
153
+ externalItemId: z.ZodString;
154
+ externalFieldIds: z.ZodArray<z.ZodString>;
155
+ }, z.core.$strict>, z.ZodObject<{
156
+ op: z.ZodLiteral<"write_item">;
157
+ externalVaultId: z.ZodString;
158
+ item: z.ZodObject<{
159
+ externalItemId: z.ZodOptional<z.ZodString>;
160
+ expectedVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
161
+ name: z.ZodString;
162
+ type: z.ZodEnum<{
163
+ api_key: "api_key";
164
+ file: "file";
165
+ login: "login";
166
+ note: "note";
167
+ passkey: "passkey";
168
+ }> & z.ZodType<"api_key" | "file" | "login" | "note", "api_key" | "file" | "login" | "note" | "passkey", z.core.$ZodTypeInternals<"api_key" | "file" | "login" | "note", "api_key" | "file" | "login" | "note" | "passkey">>;
169
+ websites: z.ZodArray<z.ZodString>;
170
+ fields: z.ZodArray<z.ZodObject<{
171
+ externalFieldId: z.ZodOptional<z.ZodString>;
172
+ name: z.ZodString;
173
+ kind: z.ZodEnum<{
174
+ concealed: "concealed";
175
+ file: "file";
176
+ text: "text";
177
+ totp: "totp";
178
+ }>;
179
+ value: z.ZodOptional<z.ZodString>;
180
+ remove: z.ZodOptional<z.ZodLiteral<true>>;
181
+ }, z.core.$strict>>;
182
+ }, z.core.$strict>;
183
+ idempotencyKey: z.ZodString;
184
+ }, z.core.$strict>, z.ZodObject<{
185
+ op: z.ZodLiteral<"archive_item">;
186
+ externalVaultId: z.ZodString;
187
+ externalItemId: z.ZodString;
188
+ idempotencyKey: z.ZodString;
189
+ }, z.core.$strict>], "op">;
190
+ export type VaultProviderWireOperation = z.infer<typeof VaultProviderWireOperation>;
191
+ export type VaultProviderWireOperationOf<Op extends VaultProviderWireOperationName> = Extract<VaultProviderWireOperation, {
192
+ op: Op;
193
+ }>;
194
+ export declare const VaultProviderWireRequest: z.ZodObject<{
195
+ version: z.ZodLiteral<"opengeni.vault.v1">;
196
+ type: z.ZodLiteral<"request">;
197
+ requestId: z.ZodString;
198
+ sentAt: z.ZodString;
199
+ provider: z.ZodEnum<{
200
+ bitwarden: "bitwarden";
201
+ external: "external";
202
+ }>;
203
+ connectionId: z.ZodString;
204
+ authority: z.ZodObject<{
205
+ accountId: z.ZodString;
206
+ workspaceId: z.ZodString;
207
+ subjectId: z.ZodNullable<z.ZodString>;
208
+ connectionWorkspaceId: z.ZodString;
209
+ sessionId: z.ZodOptional<z.ZodString>;
210
+ turnId: z.ZodOptional<z.ZodString>;
211
+ attemptId: z.ZodOptional<z.ZodString>;
212
+ siteId: z.ZodOptional<z.ZodString>;
213
+ }, z.core.$strict>;
214
+ operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
215
+ op: z.ZodLiteral<"describe">;
216
+ }, z.core.$strict>, z.ZodObject<{
217
+ op: z.ZodLiteral<"refresh">;
218
+ }, z.core.$strict>, z.ZodObject<{
219
+ forceRefresh: z.ZodBoolean;
220
+ cacheEpoch: z.ZodNullable<z.ZodString>;
221
+ op: z.ZodLiteral<"list_vaults">;
222
+ page: z.ZodObject<{
223
+ limit: z.ZodNumber;
224
+ cursor: z.ZodOptional<z.ZodString>;
225
+ snapshot: z.ZodOptional<z.ZodString>;
226
+ }, z.core.$strict>;
227
+ }, z.core.$strict>, z.ZodObject<{
228
+ forceRefresh: z.ZodBoolean;
229
+ cacheEpoch: z.ZodNullable<z.ZodString>;
230
+ op: z.ZodLiteral<"list_items">;
231
+ externalVaultId: z.ZodString;
232
+ page: z.ZodObject<{
233
+ limit: z.ZodNumber;
234
+ cursor: z.ZodOptional<z.ZodString>;
235
+ snapshot: z.ZodOptional<z.ZodString>;
236
+ }, z.core.$strict>;
237
+ }, z.core.$strict>, z.ZodObject<{
238
+ forceRefresh: z.ZodBoolean;
239
+ cacheEpoch: z.ZodNullable<z.ZodString>;
240
+ op: z.ZodLiteral<"read_fields">;
241
+ externalVaultId: z.ZodString;
242
+ externalItemId: z.ZodString;
243
+ externalFieldIds: z.ZodArray<z.ZodString>;
244
+ }, z.core.$strict>, z.ZodObject<{
245
+ op: z.ZodLiteral<"write_item">;
246
+ externalVaultId: z.ZodString;
247
+ item: z.ZodObject<{
248
+ externalItemId: z.ZodOptional<z.ZodString>;
249
+ expectedVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
250
+ name: z.ZodString;
251
+ type: z.ZodEnum<{
252
+ api_key: "api_key";
253
+ file: "file";
254
+ login: "login";
255
+ note: "note";
256
+ passkey: "passkey";
257
+ }> & z.ZodType<"api_key" | "file" | "login" | "note", "api_key" | "file" | "login" | "note" | "passkey", z.core.$ZodTypeInternals<"api_key" | "file" | "login" | "note", "api_key" | "file" | "login" | "note" | "passkey">>;
258
+ websites: z.ZodArray<z.ZodString>;
259
+ fields: z.ZodArray<z.ZodObject<{
260
+ externalFieldId: z.ZodOptional<z.ZodString>;
261
+ name: z.ZodString;
262
+ kind: z.ZodEnum<{
263
+ concealed: "concealed";
264
+ file: "file";
265
+ text: "text";
266
+ totp: "totp";
267
+ }>;
268
+ value: z.ZodOptional<z.ZodString>;
269
+ remove: z.ZodOptional<z.ZodLiteral<true>>;
270
+ }, z.core.$strict>>;
271
+ }, z.core.$strict>;
272
+ idempotencyKey: z.ZodString;
273
+ }, z.core.$strict>, z.ZodObject<{
274
+ op: z.ZodLiteral<"archive_item">;
275
+ externalVaultId: z.ZodString;
276
+ externalItemId: z.ZodString;
277
+ idempotencyKey: z.ZodString;
278
+ }, z.core.$strict>], "op">;
279
+ }, z.core.$strict>;
280
+ export type VaultProviderWireRequest = z.infer<typeof VaultProviderWireRequest>;
281
+ export declare const VaultProviderWireErrorCode: z.ZodEnum<{
282
+ provider_auth_expired: "provider_auth_expired";
283
+ provider_auth_invalid: "provider_auth_invalid";
284
+ provider_conflict: "provider_conflict";
285
+ provider_inventory_incomplete: "provider_inventory_incomplete";
286
+ provider_locked: "provider_locked";
287
+ provider_not_found: "provider_not_found";
288
+ provider_outcome_unknown: "provider_outcome_unknown";
289
+ provider_permission_denied: "provider_permission_denied";
290
+ provider_rate_limited: "provider_rate_limited";
291
+ provider_unavailable: "provider_unavailable";
292
+ }>;
293
+ /** Receiver freshness. Opengeni adds its own `lastCheckedAt`. */
294
+ export declare const VaultProviderWireFreshness: z.ZodObject<{
295
+ state: z.ZodEnum<{
296
+ current: "current";
297
+ refreshing: "refreshing";
298
+ stale: "stale";
299
+ unavailable: "unavailable";
300
+ }>;
301
+ sourceSyncedAt: z.ZodNullable<z.ZodString>;
302
+ source: z.ZodEnum<{
303
+ cache: "cache";
304
+ live: "live";
305
+ unknown: "unknown";
306
+ }>;
307
+ errorCode: z.ZodNullable<z.ZodEnum<{
308
+ provider_auth_expired: "provider_auth_expired";
309
+ provider_auth_invalid: "provider_auth_invalid";
310
+ provider_conflict: "provider_conflict";
311
+ provider_inventory_incomplete: "provider_inventory_incomplete";
312
+ provider_locked: "provider_locked";
313
+ provider_not_found: "provider_not_found";
314
+ provider_outcome_unknown: "provider_outcome_unknown";
315
+ provider_permission_denied: "provider_permission_denied";
316
+ provider_rate_limited: "provider_rate_limited";
317
+ provider_unavailable: "provider_unavailable";
318
+ }>>;
319
+ retryAt: z.ZodNullable<z.ZodString>;
320
+ }, z.core.$strict>;
321
+ export type VaultProviderWireFreshness = z.infer<typeof VaultProviderWireFreshness>;
322
+ export declare const VaultProviderWireVault: z.ZodObject<{
323
+ externalVaultId: z.ZodString;
324
+ name: z.ZodString;
325
+ contentVersion: z.ZodNullable<z.ZodString>;
326
+ itemCount: z.ZodNullable<z.ZodNumber>;
327
+ writeAccess: z.ZodEnum<{
328
+ read_only: "read_only";
329
+ read_write: "read_write";
330
+ unknown: "unknown";
331
+ }>;
332
+ operations: z.ZodOptional<z.ZodObject<{
333
+ createItemTypes: z.ZodArray<z.ZodEnum<{
334
+ api_key: "api_key";
335
+ file: "file";
336
+ login: "login";
337
+ note: "note";
338
+ passkey: "passkey";
339
+ }>>;
340
+ updateItem: z.ZodBoolean;
341
+ removeField: z.ZodBoolean;
342
+ archiveItem: z.ZodBoolean;
343
+ archiveKind: z.ZodEnum<{
344
+ archive: "archive";
345
+ none: "none";
346
+ trash: "trash";
347
+ }>;
348
+ deleteItem: z.ZodLiteral<false>;
349
+ restoreItem: z.ZodBoolean;
350
+ readFiles: z.ZodBoolean;
351
+ writeFiles: z.ZodBoolean;
352
+ createTotp: z.ZodBoolean;
353
+ updateTotp: z.ZodBoolean;
354
+ createVault: z.ZodBoolean;
355
+ restoreFieldHistory: z.ZodBoolean;
356
+ }, z.core.$strict>>;
357
+ }, z.core.$strict>;
358
+ export type VaultProviderWireVault = z.infer<typeof VaultProviderWireVault>;
359
+ export declare const VaultProviderWireFieldMeta: z.ZodObject<{
360
+ externalFieldId: z.ZodString;
361
+ name: z.ZodString;
362
+ kind: z.ZodEnum<{
363
+ concealed: "concealed";
364
+ file: "file";
365
+ text: "text";
366
+ totp: "totp";
367
+ }>;
368
+ }, z.core.$strict>;
369
+ export type VaultProviderWireFieldMeta = z.infer<typeof VaultProviderWireFieldMeta>;
370
+ /** Item metadata. There is deliberately no value field. */
371
+ export declare const VaultProviderWireItemMeta: z.ZodObject<{
372
+ externalItemId: z.ZodString;
373
+ name: z.ZodString;
374
+ type: z.ZodEnum<{
375
+ api_key: "api_key";
376
+ file: "file";
377
+ login: "login";
378
+ note: "note";
379
+ passkey: "passkey";
380
+ }>;
381
+ websites: z.ZodArray<z.ZodString>;
382
+ fields: z.ZodArray<z.ZodObject<{
383
+ externalFieldId: z.ZodString;
384
+ name: z.ZodString;
385
+ kind: z.ZodEnum<{
386
+ concealed: "concealed";
387
+ file: "file";
388
+ text: "text";
389
+ totp: "totp";
390
+ }>;
391
+ }, z.core.$strict>>;
392
+ version: z.ZodNullable<z.ZodString>;
393
+ updatedAt: z.ZodNullable<z.ZodString>;
394
+ }, z.core.$strict>;
395
+ export type VaultProviderWireItemMeta = z.infer<typeof VaultProviderWireItemMeta>;
396
+ export declare const VaultProviderWireFieldValue: z.ZodObject<{
397
+ externalFieldId: z.ZodString;
398
+ value: z.ZodDiscriminatedUnion<[z.ZodObject<{
399
+ type: z.ZodLiteral<"text">;
400
+ value: z.ZodString;
401
+ }, z.core.$strict>, z.ZodObject<{
402
+ type: z.ZodLiteral<"totp">;
403
+ value: z.ZodString;
404
+ }, z.core.$strict>, z.ZodObject<{
405
+ type: z.ZodLiteral<"bytes">;
406
+ base64: z.ZodString;
407
+ }, z.core.$strict>], "type">;
408
+ }, z.core.$strict>;
409
+ export type VaultProviderWireFieldValue = z.infer<typeof VaultProviderWireFieldValue>;
410
+ export declare const VaultProviderWireDescribeResult: z.ZodObject<{
411
+ accountId: z.ZodString;
412
+ accountName: z.ZodNullable<z.ZodString>;
413
+ operations: z.ZodObject<{
414
+ createItemTypes: z.ZodArray<z.ZodEnum<{
415
+ api_key: "api_key";
416
+ file: "file";
417
+ login: "login";
418
+ note: "note";
419
+ passkey: "passkey";
420
+ }>>;
421
+ updateItem: z.ZodBoolean;
422
+ removeField: z.ZodBoolean;
423
+ archiveItem: z.ZodBoolean;
424
+ archiveKind: z.ZodEnum<{
425
+ archive: "archive";
426
+ none: "none";
427
+ trash: "trash";
428
+ }>;
429
+ deleteItem: z.ZodLiteral<false>;
430
+ restoreItem: z.ZodBoolean;
431
+ readFiles: z.ZodBoolean;
432
+ writeFiles: z.ZodBoolean;
433
+ createTotp: z.ZodBoolean;
434
+ updateTotp: z.ZodBoolean;
435
+ createVault: z.ZodBoolean;
436
+ restoreFieldHistory: z.ZodBoolean;
437
+ }, z.core.$strict>;
438
+ capabilities: z.ZodObject<{
439
+ totp: z.ZodBoolean;
440
+ files: z.ZodBoolean;
441
+ }, z.core.$strict>;
442
+ inventoryScope: z.ZodLiteral<"connection">;
443
+ }, z.core.$strict>;
444
+ export type VaultProviderWireDescribeResult = z.infer<typeof VaultProviderWireDescribeResult>;
445
+ export declare const VaultProviderWireListVaultsResult: z.ZodObject<{
446
+ items: z.ZodArray<z.ZodObject<{
447
+ externalVaultId: z.ZodString;
448
+ name: z.ZodString;
449
+ contentVersion: z.ZodNullable<z.ZodString>;
450
+ itemCount: z.ZodNullable<z.ZodNumber>;
451
+ writeAccess: z.ZodEnum<{
452
+ read_only: "read_only";
453
+ read_write: "read_write";
454
+ unknown: "unknown";
455
+ }>;
456
+ operations: z.ZodOptional<z.ZodObject<{
457
+ createItemTypes: z.ZodArray<z.ZodEnum<{
458
+ api_key: "api_key";
459
+ file: "file";
460
+ login: "login";
461
+ note: "note";
462
+ passkey: "passkey";
463
+ }>>;
464
+ updateItem: z.ZodBoolean;
465
+ removeField: z.ZodBoolean;
466
+ archiveItem: z.ZodBoolean;
467
+ archiveKind: z.ZodEnum<{
468
+ archive: "archive";
469
+ none: "none";
470
+ trash: "trash";
471
+ }>;
472
+ deleteItem: z.ZodLiteral<false>;
473
+ restoreItem: z.ZodBoolean;
474
+ readFiles: z.ZodBoolean;
475
+ writeFiles: z.ZodBoolean;
476
+ createTotp: z.ZodBoolean;
477
+ updateTotp: z.ZodBoolean;
478
+ createVault: z.ZodBoolean;
479
+ restoreFieldHistory: z.ZodBoolean;
480
+ }, z.core.$strict>>;
481
+ }, z.core.$strict>>;
482
+ nextCursor: z.ZodNullable<z.ZodString>;
483
+ snapshot: z.ZodNullable<z.ZodString>;
484
+ }, z.core.$strict>;
485
+ export declare const VaultProviderWireListItemsResult: z.ZodObject<{
486
+ items: z.ZodArray<z.ZodObject<{
487
+ externalItemId: z.ZodString;
488
+ name: z.ZodString;
489
+ type: z.ZodEnum<{
490
+ api_key: "api_key";
491
+ file: "file";
492
+ login: "login";
493
+ note: "note";
494
+ passkey: "passkey";
495
+ }>;
496
+ websites: z.ZodArray<z.ZodString>;
497
+ fields: z.ZodArray<z.ZodObject<{
498
+ externalFieldId: z.ZodString;
499
+ name: z.ZodString;
500
+ kind: z.ZodEnum<{
501
+ concealed: "concealed";
502
+ file: "file";
503
+ text: "text";
504
+ totp: "totp";
505
+ }>;
506
+ }, z.core.$strict>>;
507
+ version: z.ZodNullable<z.ZodString>;
508
+ updatedAt: z.ZodNullable<z.ZodString>;
509
+ }, z.core.$strict>>;
510
+ nextCursor: z.ZodNullable<z.ZodString>;
511
+ snapshot: z.ZodNullable<z.ZodString>;
512
+ }, z.core.$strict>;
513
+ export declare const VaultProviderWireReadFieldsResult: z.ZodObject<{
514
+ fields: z.ZodArray<z.ZodObject<{
515
+ externalFieldId: z.ZodString;
516
+ value: z.ZodDiscriminatedUnion<[z.ZodObject<{
517
+ type: z.ZodLiteral<"text">;
518
+ value: z.ZodString;
519
+ }, z.core.$strict>, z.ZodObject<{
520
+ type: z.ZodLiteral<"totp">;
521
+ value: z.ZodString;
522
+ }, z.core.$strict>, z.ZodObject<{
523
+ type: z.ZodLiteral<"bytes">;
524
+ base64: z.ZodString;
525
+ }, z.core.$strict>], "type">;
526
+ }, z.core.$strict>>;
527
+ }, z.core.$strict>;
528
+ export declare const VaultProviderWireRefreshResult: z.ZodObject<{
529
+ refreshed: z.ZodLiteral<true>;
530
+ }, z.core.$strict>;
531
+ export declare const VaultProviderWireWriteItemResult: z.ZodObject<{
532
+ item: z.ZodObject<{
533
+ externalItemId: z.ZodString;
534
+ name: z.ZodString;
535
+ type: z.ZodEnum<{
536
+ api_key: "api_key";
537
+ file: "file";
538
+ login: "login";
539
+ note: "note";
540
+ passkey: "passkey";
541
+ }>;
542
+ websites: z.ZodArray<z.ZodString>;
543
+ fields: z.ZodArray<z.ZodObject<{
544
+ externalFieldId: z.ZodString;
545
+ name: z.ZodString;
546
+ kind: z.ZodEnum<{
547
+ concealed: "concealed";
548
+ file: "file";
549
+ text: "text";
550
+ totp: "totp";
551
+ }>;
552
+ }, z.core.$strict>>;
553
+ version: z.ZodNullable<z.ZodString>;
554
+ updatedAt: z.ZodNullable<z.ZodString>;
555
+ }, z.core.$strict>;
556
+ }, z.core.$strict>;
557
+ export declare const VaultProviderWireArchiveItemResult: z.ZodObject<{
558
+ archived: z.ZodLiteral<true>;
559
+ }, z.core.$strict>;
560
+ export declare const VaultProviderWireResults: {
561
+ readonly describe: z.ZodObject<{
562
+ accountId: z.ZodString;
563
+ accountName: z.ZodNullable<z.ZodString>;
564
+ operations: z.ZodObject<{
565
+ createItemTypes: z.ZodArray<z.ZodEnum<{
566
+ api_key: "api_key";
567
+ file: "file";
568
+ login: "login";
569
+ note: "note";
570
+ passkey: "passkey";
571
+ }>>;
572
+ updateItem: z.ZodBoolean;
573
+ removeField: z.ZodBoolean;
574
+ archiveItem: z.ZodBoolean;
575
+ archiveKind: z.ZodEnum<{
576
+ archive: "archive";
577
+ none: "none";
578
+ trash: "trash";
579
+ }>;
580
+ deleteItem: z.ZodLiteral<false>;
581
+ restoreItem: z.ZodBoolean;
582
+ readFiles: z.ZodBoolean;
583
+ writeFiles: z.ZodBoolean;
584
+ createTotp: z.ZodBoolean;
585
+ updateTotp: z.ZodBoolean;
586
+ createVault: z.ZodBoolean;
587
+ restoreFieldHistory: z.ZodBoolean;
588
+ }, z.core.$strict>;
589
+ capabilities: z.ZodObject<{
590
+ totp: z.ZodBoolean;
591
+ files: z.ZodBoolean;
592
+ }, z.core.$strict>;
593
+ inventoryScope: z.ZodLiteral<"connection">;
594
+ }, z.core.$strict>;
595
+ readonly refresh: z.ZodObject<{
596
+ refreshed: z.ZodLiteral<true>;
597
+ }, z.core.$strict>;
598
+ readonly list_vaults: z.ZodObject<{
599
+ items: z.ZodArray<z.ZodObject<{
600
+ externalVaultId: z.ZodString;
601
+ name: z.ZodString;
602
+ contentVersion: z.ZodNullable<z.ZodString>;
603
+ itemCount: z.ZodNullable<z.ZodNumber>;
604
+ writeAccess: z.ZodEnum<{
605
+ read_only: "read_only";
606
+ read_write: "read_write";
607
+ unknown: "unknown";
608
+ }>;
609
+ operations: z.ZodOptional<z.ZodObject<{
610
+ createItemTypes: z.ZodArray<z.ZodEnum<{
611
+ api_key: "api_key";
612
+ file: "file";
613
+ login: "login";
614
+ note: "note";
615
+ passkey: "passkey";
616
+ }>>;
617
+ updateItem: z.ZodBoolean;
618
+ removeField: z.ZodBoolean;
619
+ archiveItem: z.ZodBoolean;
620
+ archiveKind: z.ZodEnum<{
621
+ archive: "archive";
622
+ none: "none";
623
+ trash: "trash";
624
+ }>;
625
+ deleteItem: z.ZodLiteral<false>;
626
+ restoreItem: z.ZodBoolean;
627
+ readFiles: z.ZodBoolean;
628
+ writeFiles: z.ZodBoolean;
629
+ createTotp: z.ZodBoolean;
630
+ updateTotp: z.ZodBoolean;
631
+ createVault: z.ZodBoolean;
632
+ restoreFieldHistory: z.ZodBoolean;
633
+ }, z.core.$strict>>;
634
+ }, z.core.$strict>>;
635
+ nextCursor: z.ZodNullable<z.ZodString>;
636
+ snapshot: z.ZodNullable<z.ZodString>;
637
+ }, z.core.$strict>;
638
+ readonly list_items: z.ZodObject<{
639
+ items: z.ZodArray<z.ZodObject<{
640
+ externalItemId: z.ZodString;
641
+ name: z.ZodString;
642
+ type: z.ZodEnum<{
643
+ api_key: "api_key";
644
+ file: "file";
645
+ login: "login";
646
+ note: "note";
647
+ passkey: "passkey";
648
+ }>;
649
+ websites: z.ZodArray<z.ZodString>;
650
+ fields: z.ZodArray<z.ZodObject<{
651
+ externalFieldId: z.ZodString;
652
+ name: z.ZodString;
653
+ kind: z.ZodEnum<{
654
+ concealed: "concealed";
655
+ file: "file";
656
+ text: "text";
657
+ totp: "totp";
658
+ }>;
659
+ }, z.core.$strict>>;
660
+ version: z.ZodNullable<z.ZodString>;
661
+ updatedAt: z.ZodNullable<z.ZodString>;
662
+ }, z.core.$strict>>;
663
+ nextCursor: z.ZodNullable<z.ZodString>;
664
+ snapshot: z.ZodNullable<z.ZodString>;
665
+ }, z.core.$strict>;
666
+ readonly read_fields: z.ZodObject<{
667
+ fields: z.ZodArray<z.ZodObject<{
668
+ externalFieldId: z.ZodString;
669
+ value: z.ZodDiscriminatedUnion<[z.ZodObject<{
670
+ type: z.ZodLiteral<"text">;
671
+ value: z.ZodString;
672
+ }, z.core.$strict>, z.ZodObject<{
673
+ type: z.ZodLiteral<"totp">;
674
+ value: z.ZodString;
675
+ }, z.core.$strict>, z.ZodObject<{
676
+ type: z.ZodLiteral<"bytes">;
677
+ base64: z.ZodString;
678
+ }, z.core.$strict>], "type">;
679
+ }, z.core.$strict>>;
680
+ }, z.core.$strict>;
681
+ readonly write_item: z.ZodObject<{
682
+ item: z.ZodObject<{
683
+ externalItemId: z.ZodString;
684
+ name: z.ZodString;
685
+ type: z.ZodEnum<{
686
+ api_key: "api_key";
687
+ file: "file";
688
+ login: "login";
689
+ note: "note";
690
+ passkey: "passkey";
691
+ }>;
692
+ websites: z.ZodArray<z.ZodString>;
693
+ fields: z.ZodArray<z.ZodObject<{
694
+ externalFieldId: z.ZodString;
695
+ name: z.ZodString;
696
+ kind: z.ZodEnum<{
697
+ concealed: "concealed";
698
+ file: "file";
699
+ text: "text";
700
+ totp: "totp";
701
+ }>;
702
+ }, z.core.$strict>>;
703
+ version: z.ZodNullable<z.ZodString>;
704
+ updatedAt: z.ZodNullable<z.ZodString>;
705
+ }, z.core.$strict>;
706
+ }, z.core.$strict>;
707
+ readonly archive_item: z.ZodObject<{
708
+ archived: z.ZodLiteral<true>;
709
+ }, z.core.$strict>;
710
+ };
711
+ export type VaultProviderWireResult<Op extends VaultProviderWireOperationName> = z.infer<(typeof VaultProviderWireResults)[Op]>;
712
+ export declare const VaultProviderWireError: z.ZodObject<{
713
+ code: z.ZodEnum<{
714
+ provider_auth_expired: "provider_auth_expired";
715
+ provider_auth_invalid: "provider_auth_invalid";
716
+ provider_conflict: "provider_conflict";
717
+ provider_inventory_incomplete: "provider_inventory_incomplete";
718
+ provider_locked: "provider_locked";
719
+ provider_not_found: "provider_not_found";
720
+ provider_outcome_unknown: "provider_outcome_unknown";
721
+ provider_permission_denied: "provider_permission_denied";
722
+ provider_rate_limited: "provider_rate_limited";
723
+ provider_unavailable: "provider_unavailable";
724
+ }>;
725
+ retryAfterMs: z.ZodNullable<z.ZodNumber>;
726
+ }, z.core.$strict>;
727
+ export type VaultProviderWireError = z.infer<typeof VaultProviderWireError>;
728
+ /**
729
+ * Response envelope. `result` is validated separately against
730
+ * `VaultProviderWireResults[op]` for the operation that was requested.
731
+ */
732
+ export declare const VaultProviderWireResponseEnvelope: z.ZodDiscriminatedUnion<[z.ZodObject<{
733
+ version: z.ZodLiteral<"opengeni.vault.v1">;
734
+ type: z.ZodLiteral<"response">;
735
+ requestId: z.ZodString;
736
+ ok: z.ZodLiteral<true>;
737
+ op: z.ZodEnum<{
738
+ archive_item: "archive_item";
739
+ describe: "describe";
740
+ list_items: "list_items";
741
+ list_vaults: "list_vaults";
742
+ read_fields: "read_fields";
743
+ refresh: "refresh";
744
+ write_item: "write_item";
745
+ }>;
746
+ result: z.ZodUnknown;
747
+ freshness: z.ZodNullable<z.ZodObject<{
748
+ state: z.ZodEnum<{
749
+ current: "current";
750
+ refreshing: "refreshing";
751
+ stale: "stale";
752
+ unavailable: "unavailable";
753
+ }>;
754
+ sourceSyncedAt: z.ZodNullable<z.ZodString>;
755
+ source: z.ZodEnum<{
756
+ cache: "cache";
757
+ live: "live";
758
+ unknown: "unknown";
759
+ }>;
760
+ errorCode: z.ZodNullable<z.ZodEnum<{
761
+ provider_auth_expired: "provider_auth_expired";
762
+ provider_auth_invalid: "provider_auth_invalid";
763
+ provider_conflict: "provider_conflict";
764
+ provider_inventory_incomplete: "provider_inventory_incomplete";
765
+ provider_locked: "provider_locked";
766
+ provider_not_found: "provider_not_found";
767
+ provider_outcome_unknown: "provider_outcome_unknown";
768
+ provider_permission_denied: "provider_permission_denied";
769
+ provider_rate_limited: "provider_rate_limited";
770
+ provider_unavailable: "provider_unavailable";
771
+ }>>;
772
+ retryAt: z.ZodNullable<z.ZodString>;
773
+ }, z.core.$strict>>;
774
+ }, z.core.$strict>, z.ZodObject<{
775
+ version: z.ZodLiteral<"opengeni.vault.v1">;
776
+ type: z.ZodLiteral<"response">;
777
+ requestId: z.ZodString;
778
+ ok: z.ZodLiteral<false>;
779
+ op: z.ZodEnum<{
780
+ archive_item: "archive_item";
781
+ describe: "describe";
782
+ list_items: "list_items";
783
+ list_vaults: "list_vaults";
784
+ read_fields: "read_fields";
785
+ refresh: "refresh";
786
+ write_item: "write_item";
787
+ }>;
788
+ error: z.ZodObject<{
789
+ code: z.ZodEnum<{
790
+ provider_auth_expired: "provider_auth_expired";
791
+ provider_auth_invalid: "provider_auth_invalid";
792
+ provider_conflict: "provider_conflict";
793
+ provider_inventory_incomplete: "provider_inventory_incomplete";
794
+ provider_locked: "provider_locked";
795
+ provider_not_found: "provider_not_found";
796
+ provider_outcome_unknown: "provider_outcome_unknown";
797
+ provider_permission_denied: "provider_permission_denied";
798
+ provider_rate_limited: "provider_rate_limited";
799
+ provider_unavailable: "provider_unavailable";
800
+ }>;
801
+ retryAfterMs: z.ZodNullable<z.ZodNumber>;
802
+ }, z.core.$strict>;
803
+ freshness: z.ZodNullable<z.ZodObject<{
804
+ state: z.ZodEnum<{
805
+ current: "current";
806
+ refreshing: "refreshing";
807
+ stale: "stale";
808
+ unavailable: "unavailable";
809
+ }>;
810
+ sourceSyncedAt: z.ZodNullable<z.ZodString>;
811
+ source: z.ZodEnum<{
812
+ cache: "cache";
813
+ live: "live";
814
+ unknown: "unknown";
815
+ }>;
816
+ errorCode: z.ZodNullable<z.ZodEnum<{
817
+ provider_auth_expired: "provider_auth_expired";
818
+ provider_auth_invalid: "provider_auth_invalid";
819
+ provider_conflict: "provider_conflict";
820
+ provider_inventory_incomplete: "provider_inventory_incomplete";
821
+ provider_locked: "provider_locked";
822
+ provider_not_found: "provider_not_found";
823
+ provider_outcome_unknown: "provider_outcome_unknown";
824
+ provider_permission_denied: "provider_permission_denied";
825
+ provider_rate_limited: "provider_rate_limited";
826
+ provider_unavailable: "provider_unavailable";
827
+ }>>;
828
+ retryAt: z.ZodNullable<z.ZodString>;
829
+ }, z.core.$strict>>;
830
+ }, z.core.$strict>], "ok">;
831
+ export type VaultProviderWireSuccess<Op extends VaultProviderWireOperationName = VaultProviderWireOperationName> = {
832
+ [K in Op]: {
833
+ version: typeof VAULT_PROVIDER_WIRE_VERSION;
834
+ type: "response";
835
+ requestId: string;
836
+ ok: true;
837
+ op: K;
838
+ result: VaultProviderWireResult<K>;
839
+ freshness: VaultProviderWireFreshness | null;
840
+ };
841
+ }[Op];
842
+ export type VaultProviderWireFailure = {
843
+ version: typeof VAULT_PROVIDER_WIRE_VERSION;
844
+ type: "response";
845
+ requestId: string;
846
+ ok: false;
847
+ op: VaultProviderWireOperationName;
848
+ error: VaultProviderWireError;
849
+ freshness: VaultProviderWireFreshness | null;
850
+ };
851
+ export type VaultProviderWireResponse = VaultProviderWireSuccess | VaultProviderWireFailure;
852
+ /** Parse one response envelope and its operation-specific result. */
853
+ export declare function parseVaultProviderWireResponse<Op extends VaultProviderWireOperationName>(value: unknown, expected: {
854
+ requestId: string;
855
+ op: Op;
856
+ }): VaultProviderWireSuccess<Op> | VaultProviderWireFailure | null;