@sparkvault/sdk-js 19.0.1 → 19.1.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.
Files changed (133) hide show
  1. package/README.md +26 -4
  2. package/dist/npm/chunks/index-C97091lF.mjs +12959 -0
  3. package/dist/npm/chunks/index-C97091lF.mjs.map +1 -0
  4. package/dist/npm/chunks/index-D_p_8VO7.cjs +13024 -0
  5. package/dist/npm/chunks/index-D_p_8VO7.cjs.map +1 -0
  6. package/dist/npm/identity.cjs +23 -0
  7. package/dist/npm/identity.cjs.map +1 -0
  8. package/dist/npm/identity.mjs +12 -0
  9. package/dist/npm/identity.mjs.map +1 -0
  10. package/dist/{index.cjs → npm/index.cjs} +802 -13759
  11. package/dist/npm/index.cjs.map +1 -0
  12. package/dist/{index.mjs → npm/index.mjs} +203 -13159
  13. package/dist/npm/index.mjs.map +1 -0
  14. package/dist/sparkvault-identity.js +2 -0
  15. package/dist/sparkvault-identity.js.map +1 -0
  16. package/dist/sparkvault.js +1 -1
  17. package/dist/sparkvault.js.map +1 -1
  18. package/dist/types/identity.d.ts +8 -0
  19. package/dist/{index.d.ts → types/index.d.ts} +4 -790
  20. package/dist/types/shared/errors-C-gjmGBs.d.ts +800 -0
  21. package/package.json +20 -9
  22. package/dist/api-base.d.ts +0 -116
  23. package/dist/auto-init.d.ts +0 -32
  24. package/dist/config.d.ts +0 -79
  25. package/dist/entropy/index.d.ts +0 -35
  26. package/dist/entropy/types.d.ts +0 -32
  27. package/dist/errors.d.ts +0 -146
  28. package/dist/folders/index.d.ts +0 -102
  29. package/dist/folders/types.d.ts +0 -91
  30. package/dist/health.d.ts +0 -18
  31. package/dist/http.d.ts +0 -46
  32. package/dist/index.cjs.map +0 -1
  33. package/dist/index.mjs.map +0 -1
  34. package/dist/ingots/fetch-download.d.ts +0 -78
  35. package/dist/ingots/history.d.ts +0 -4
  36. package/dist/ingots/index.d.ts +0 -388
  37. package/dist/ingots/revision.d.ts +0 -4
  38. package/dist/ingots/types.d.ts +0 -556
  39. package/dist/logger.d.ts +0 -32
  40. package/dist/notify/index.d.ts +0 -154
  41. package/dist/notify/types.d.ts +0 -232
  42. package/dist/products/help-desk/client.d.ts +0 -198
  43. package/dist/products/help-desk/desk-id.d.ts +0 -2
  44. package/dist/products/help-desk/form-draft.d.ts +0 -37
  45. package/dist/products/help-desk/form-types.d.ts +0 -123
  46. package/dist/products/help-desk/form.d.ts +0 -83
  47. package/dist/products/help-desk/index.d.ts +0 -47
  48. package/dist/products/help-desk/kb-client.d.ts +0 -48
  49. package/dist/products/help-desk/kb-types.d.ts +0 -59
  50. package/dist/products/help-desk/modal.d.ts +0 -8
  51. package/dist/products/help-desk/styles.d.ts +0 -9
  52. package/dist/products/help-desk/support-analytics-types.d.ts +0 -32
  53. package/dist/products/help-desk/support-analytics.d.ts +0 -3
  54. package/dist/products/help-desk/support-brand.d.ts +0 -49
  55. package/dist/products/help-desk/support-controller.d.ts +0 -4
  56. package/dist/products/help-desk/support-history.d.ts +0 -38
  57. package/dist/products/help-desk/support-launcher.d.ts +0 -12
  58. package/dist/products/help-desk/support-styles.d.ts +0 -14
  59. package/dist/products/help-desk/support-types.d.ts +0 -66
  60. package/dist/products/help-desk/support-view.d.ts +0 -173
  61. package/dist/products/help-desk/types.d.ts +0 -285
  62. package/dist/products/help-desk/widget-identity.d.ts +0 -32
  63. package/dist/products/identity/api.d.ts +0 -237
  64. package/dist/products/identity/container.d.ts +0 -44
  65. package/dist/products/identity/dialog-launcher.d.ts +0 -133
  66. package/dist/products/identity/federation-flow.d.ts +0 -31
  67. package/dist/products/identity/handlers/otp-handler.d.ts +0 -69
  68. package/dist/products/identity/handlers/passkey-handler.d.ts +0 -105
  69. package/dist/products/identity/handlers/sparklink-handler.d.ts +0 -34
  70. package/dist/products/identity/index.d.ts +0 -296
  71. package/dist/products/identity/inline-container.d.ts +0 -53
  72. package/dist/products/identity/methods.d.ts +0 -19
  73. package/dist/products/identity/modal.d.ts +0 -51
  74. package/dist/products/identity/pending-signin.d.ts +0 -102
  75. package/dist/products/identity/popup-launcher.d.ts +0 -73
  76. package/dist/products/identity/renderer.d.ts +0 -525
  77. package/dist/products/identity/state.d.ts +0 -84
  78. package/dist/products/identity/styles.d.ts +0 -31
  79. package/dist/products/identity/types.d.ts +0 -561
  80. package/dist/products/identity/utils/cooldown-timer.d.ts +0 -73
  81. package/dist/products/identity/utils.d.ts +0 -85
  82. package/dist/products/identity/views/backup-verify.d.ts +0 -42
  83. package/dist/products/identity/views/base.d.ts +0 -51
  84. package/dist/products/identity/views/error.d.ts +0 -65
  85. package/dist/products/identity/views/icons.d.ts +0 -41
  86. package/dist/products/identity/views/identity-input.d.ts +0 -80
  87. package/dist/products/identity/views/index.d.ts +0 -20
  88. package/dist/products/identity/views/loading.d.ts +0 -23
  89. package/dist/products/identity/views/method-button.d.ts +0 -14
  90. package/dist/products/identity/views/method-select.d.ts +0 -42
  91. package/dist/products/identity/views/origin-not-allowed.d.ts +0 -25
  92. package/dist/products/identity/views/otp-verify.d.ts +0 -58
  93. package/dist/products/identity/views/passkey-auto.d.ts +0 -22
  94. package/dist/products/identity/views/passkey-prompt.d.ts +0 -25
  95. package/dist/products/identity/views/passkey.d.ts +0 -38
  96. package/dist/products/identity/views/product-not-configured.d.ts +0 -21
  97. package/dist/products/identity/views/service-unavailable.d.ts +0 -21
  98. package/dist/products/identity/views/sms-consent.d.ts +0 -16
  99. package/dist/products/identity/views/sparklink-waiting.d.ts +0 -40
  100. package/dist/products/identity/views/two-factor.d.ts +0 -37
  101. package/dist/products/index.d.ts +0 -51
  102. package/dist/products/messaging/index.d.ts +0 -38
  103. package/dist/products/messaging/types.d.ts +0 -162
  104. package/dist/products/notify/index.d.ts +0 -436
  105. package/dist/products/notify/project-types.d.ts +0 -44
  106. package/dist/products/notify/projects.d.ts +0 -15
  107. package/dist/products/notify/types.d.ts +0 -1327
  108. package/dist/products/structured-ingots/index.d.ts +0 -31
  109. package/dist/products/structured-ingots/types-client.d.ts +0 -19
  110. package/dist/products/structured-ingots/types.d.ts +0 -293
  111. package/dist/products/structured-ingots/validation.d.ts +0 -25
  112. package/dist/request-path.d.ts +0 -44
  113. package/dist/sparks/index.d.ts +0 -91
  114. package/dist/sparks/types.d.ts +0 -304
  115. package/dist/ui/chrome.d.ts +0 -16
  116. package/dist/ui/ds-tokens.d.ts +0 -59
  117. package/dist/ui/inline-shell.d.ts +0 -19
  118. package/dist/ui/live-region.d.ts +0 -15
  119. package/dist/ui/modal-shell.d.ts +0 -67
  120. package/dist/ui/target.d.ts +0 -6
  121. package/dist/utils/dom.d.ts +0 -26
  122. package/dist/vault-session.d.ts +0 -2
  123. package/dist/vaults/index.d.ts +0 -254
  124. package/dist/vaults/types.d.ts +0 -368
  125. package/dist/vaults/upload/api.d.ts +0 -310
  126. package/dist/vaults/upload/chrome.d.ts +0 -21
  127. package/dist/vaults/upload/container.d.ts +0 -37
  128. package/dist/vaults/upload/index.d.ts +0 -76
  129. package/dist/vaults/upload/inline-container.d.ts +0 -41
  130. package/dist/vaults/upload/modal.d.ts +0 -55
  131. package/dist/vaults/upload/renderer.d.ts +0 -150
  132. package/dist/vaults/upload/styles.d.ts +0 -14
  133. package/dist/vaults/upload/types.d.ts +0 -220
@@ -1,254 +0,0 @@
1
- /**
2
- * Vaults Module
3
- *
4
- * Create and manage encrypted vaults (the control plane). Uses Triple
5
- * Zero-Trust encryption (SVMK + AMK + VMK). Ingot, folder, spark, and entropy
6
- * operations live in their own modules; this module owns the vault record,
7
- * its sharing/upload configuration, and the browser upload widget.
8
- */
9
- import type { ResolvedConfig } from '../config';
10
- import { HttpClient } from '../http';
11
- import type { CreateVaultOptions, Vault, UnsealedVault, UnsealVaultOptions, VaultSessionExtension, VaultResealSettings, VaultResealSettingsResult, VaultPage, ListVaultsOptions, VaultDetail, ScheduledVaultDeletion, StartedVaultDeletion, UpdatedVault, VaultSharingConfig, VaultSharingOptions, AccessLogRetention, VaultUploadSettings, UpdateVaultUploadOptions } from './types';
12
- import { type UploadOptions, type UploadAttachOptions, type UploadResult } from './upload';
13
- /**
14
- * Callable upload interface with methods.
15
- * Allows both `sv.vaults.upload(options)` and `sv.vaults.upload.attach(selector, options)`.
16
- */
17
- export interface UploadCallable {
18
- (options: UploadOptions): Promise<UploadResult>;
19
- attach(selector: string, options: UploadAttachOptions): () => void;
20
- close(): void;
21
- /** Open the upload widget as a popup. Equivalent to calling `upload(options)`. */
22
- pop(options: UploadOptions): Promise<UploadResult>;
23
- /** Render the upload widget inline. Equivalent to `upload({ ...options, target })`. */
24
- render(options: UploadOptions): Promise<UploadResult>;
25
- }
26
- export declare class VaultsModule {
27
- private readonly http;
28
- private readonly uploadModule;
29
- /**
30
- * Upload to a vault with public upload enabled.
31
- *
32
- * @example Dialog mode
33
- * const result = await sv.vaults.upload({ vaultId: 'vlt_abc123' });
34
- *
35
- * @example Attach to clicks
36
- * sv.vaults.upload.attach('.upload-btn', { vaultId: 'vlt_abc123' });
37
- *
38
- * @example Inline mode
39
- * sv.vaults.upload({ vaultId: 'vlt_abc123', target: '#upload-area' });
40
- */
41
- readonly upload: UploadCallable;
42
- constructor(config: ResolvedConfig, http: HttpClient);
43
- /**
44
- * Create a new encrypted vault.
45
- * IMPORTANT: Store the VMK securely - it cannot be recovered!
46
- *
47
- * @example
48
- * const vault = await sv.vaults.create({ name: 'My Vault' });
49
- * // Returned once and never again: hand the VMK to the person who keeps it,
50
- * // or to your own secret store. Never log it.
51
- * await yourSecretStore.put(`vmk/${vault.id}`, vault.vmk);
52
- */
53
- create(options: CreateVaultOptions): Promise<Vault>;
54
- /**
55
- * Unseal a vault to access its contents.
56
- * Returns a short-lived Vault Access Token (VAT).
57
- *
58
- * @param vaultId - The vault to unseal.
59
- * @param key - The vault's VMK, or a DVAK token issued for it.
60
- *
61
- * @example
62
- * const unsealed = await sv.vaults.unseal('vlt_abc', vmk);
63
- * const delegated = await sv.vaults.unseal('vlt_abc', 'dvak_...');
64
- * // The unsealed vault carries its VAT: hand it to the ingot and folder
65
- * // calls, never to a log.
66
- * const page = await sv.ingots.list(unsealed);
67
- */
68
- unseal(vaultId: string, key: string, options?: UnsealVaultOptions): Promise<UnsealedVault>;
69
- /**
70
- * Explicitly extend this live session's inactivity window, up to the
71
- * original unseal's fixed maximum. No key is needed and no new VAT is minted.
72
- * A fixed-duration session or one at its maximum is refused by Core; another
73
- * unseal is required. The normal timing observer receives the new deadline.
74
- */
75
- extendSession(vaultId: string, vat: string): Promise<VaultSessionExtension>;
76
- /**
77
- * List vaults for the account. Results are paginated (server default 100 per
78
- * page, max 500); follow `nextCursor` to fetch subsequent pages.
79
- *
80
- * @example
81
- * let cursor: string | undefined;
82
- * do {
83
- * const page = await sv.vaults.list({ cursor });
84
- * page.vaults.forEach((v) => console.log(v.name));
85
- * cursor = page.nextCursor;
86
- * } while (cursor);
87
- */
88
- list(options?: ListVaultsOptions): Promise<VaultPage>;
89
- /**
90
- * Get a single vault's detail.
91
- *
92
- * @example
93
- * const vault = await sv.vaults.get('vlt_abc');
94
- * console.log(vault.status, vault.ingotCount);
95
- */
96
- get(vaultId: string): Promise<VaultDetail>;
97
- /**
98
- * Set when this vault reseals after inactivity and after an unseal.
99
- * Company administrators only. Changes apply on the next unseal.
100
- * Null values inherit system defaults; zero idle seconds disables extensions.
101
- */
102
- updateResealSettings(vaultId: string, settings: VaultResealSettings): Promise<VaultResealSettingsResult>;
103
- /**
104
- * Retain this many previous versions of each file or structured object (0 to 50,
105
- * default 0). Interactive company administrators only. Applies on each ingot's
106
- * next successful content change; retained versions count toward storage usage.
107
- */
108
- updateVersionHistory(vaultId: string, settings: {
109
- versionLimit: number;
110
- }): Promise<{
111
- vaultId: string;
112
- versionLimit: number;
113
- }>;
114
- /** @deprecated Use updateVersionHistory; retention applies to files and structured objects. */
115
- updateStructuredIngotSettings(vaultId: string, settings: {
116
- versionLimit: number;
117
- }): Promise<{
118
- vaultId: string;
119
- versionLimit: number;
120
- }>;
121
- /**
122
- * Rename a vault.
123
- *
124
- * @example
125
- * await sv.vaults.update('vlt_abc', { name: 'Renamed Vault' });
126
- */
127
- update(vaultId: string, options: {
128
- name: string;
129
- }): Promise<UpdatedVault>;
130
- /**
131
- * Seal a vault, revoking all active access tokens.
132
- *
133
- * @example
134
- * await sv.vaults.seal('vlt_abc');
135
- */
136
- seal(vaultId: string): Promise<void>;
137
- /**
138
- * Schedule permanent deletion in seven days and immediately lock all vault access.
139
- * Company admins only; cancelDeletion can abort this schedule before its deadline.
140
- * A vault whose irreversible cleanup has already started answers that cleanup
141
- * (`status: 'deleting'`) instead, which nothing can cancel.
142
- *
143
- * Requires the vault's exact name as confirmation, matched case-sensitively.
144
- * The name is sent base64(UTF-8) as the `X-Confirm-Name-B64` header so a vault
145
- * named with any Unicode (emoji, CJK, the U+202F in macOS-style names) is
146
- * deletable: an HTTP header value cannot carry non-latin1 characters.
147
- *
148
- * @example
149
- * await sv.vaults.delete('vlt_abc', 'My Vault');
150
- */
151
- delete(vaultId: string, name: string): Promise<ScheduledVaultDeletion | StartedVaultDeletion>;
152
- /** Cancel this exact deletion schedule before its deadline; company admins only. */
153
- cancelDeletion(vaultId: string, deletionScheduleId: string): Promise<VaultDetail>;
154
- /**
155
- * Get a vault's public-sharing configuration. Every sharing write below
156
- * answers the same configuration as that write left it.
157
- *
158
- * @example
159
- * const sharing = await sv.vaults.getSharingConfig('vlt_abc');
160
- */
161
- getSharingConfig(vaultId: string): Promise<VaultSharingConfig>;
162
- /**
163
- * Enable public sharing for a vault.
164
- *
165
- * @example
166
- * await sv.vaults.enableSharing('vlt_abc', vmk, { sessionLengthSeconds: 3600 });
167
- */
168
- enableSharing(vaultId: string, vmk: string, options?: VaultSharingOptions): Promise<VaultSharingConfig>;
169
- /**
170
- * Disable public sharing for a vault.
171
- *
172
- * @example
173
- * await sv.vaults.disableSharing('vlt_abc');
174
- */
175
- disableSharing(vaultId: string): Promise<VaultSharingConfig>;
176
- /**
177
- * Update a vault's sharing configuration (without changing enabled state).
178
- *
179
- * Making every ingot public publishes each file to anyone holding its URL,
180
- * so the API accepts `allIngotsPublic: true` only with a read-write VAT for
181
- * the vault: pass the unsealed vault for that change.
182
- *
183
- * @example
184
- * await sv.vaults.updateSharingConfig('vlt_abc', { sessionLengthSeconds: 1800 });
185
- *
186
- * @example Make every ingot public
187
- * const unsealed = await sv.vaults.unseal('vlt_abc', vmk);
188
- * await sv.vaults.updateSharingConfig('vlt_abc', { allIngotsPublic: true }, unsealed);
189
- */
190
- updateSharingConfig(vaultId: string, config: VaultSharingOptions, vault?: UnsealedVault): Promise<VaultSharingConfig>;
191
- /**
192
- * Get a vault's access-log retention window.
193
- *
194
- * @example
195
- * const { retentionSeconds } = await sv.vaults.getAccessLogRetention('vlt_abc');
196
- */
197
- getAccessLogRetention(vaultId: string): Promise<AccessLogRetention>;
198
- /**
199
- * Update a vault's access-log retention window.
200
- *
201
- * @example
202
- * await sv.vaults.updateAccessLogRetention('vlt_abc', 7776000);
203
- */
204
- updateAccessLogRetention(vaultId: string, seconds: number): Promise<AccessLogRetention>;
205
- /**
206
- * Get a vault's upload-channel configuration. Every upload write below
207
- * answers the same configuration as that write left it: both channels, the
208
- * shared settings, and the portal's URL while the portal is on.
209
- *
210
- * @example
211
- * const upload = await sv.vaults.getUploadConfig('vlt_abc');
212
- */
213
- getUploadConfig(vaultId: string): Promise<VaultUploadSettings>;
214
- /**
215
- * Enable the public upload portal for a vault.
216
- *
217
- * @example
218
- * await sv.vaults.enableUploadPortal('vlt_abc', vmk);
219
- */
220
- enableUploadPortal(vaultId: string, vmk: string): Promise<VaultUploadSettings>;
221
- /**
222
- * Disable the public upload portal for a vault.
223
- *
224
- * @example
225
- * await sv.vaults.disableUploadPortal('vlt_abc');
226
- */
227
- disableUploadPortal(vaultId: string): Promise<VaultUploadSettings>;
228
- /**
229
- * Enable the upload widget for a vault.
230
- *
231
- * @example
232
- * await sv.vaults.enableUploadWidget('vlt_abc', vmk);
233
- */
234
- enableUploadWidget(vaultId: string, vmk: string): Promise<VaultUploadSettings>;
235
- /**
236
- * Disable the upload widget for a vault.
237
- *
238
- * @example
239
- * await sv.vaults.disableUploadWidget('vlt_abc');
240
- */
241
- disableUploadWidget(vaultId: string): Promise<VaultUploadSettings>;
242
- /**
243
- * Update a vault's upload settings (max size, notification email).
244
- *
245
- * @example
246
- * await sv.vaults.updateUploadConfig('vlt_abc', { maxSizeBytes: 5 * 1024 ** 4 });
247
- */
248
- updateUploadConfig(vaultId: string, config: UpdateVaultUploadOptions): Promise<VaultUploadSettings>;
249
- private toggleUploadChannel;
250
- private validateCreateOptions;
251
- }
252
- export type { CreateVaultOptions, Vault, UnsealedVault, UnsealVaultOptions, VaultSessionExtension, VaultResealSettings, VaultResealDefaults, VaultResealSettingsResult, VaultSummary, VaultPage, ListVaultsOptions, VaultDetail, VaultLifecycle, ScheduledVaultDeletion, StartedVaultDeletion, UnreachedAdmin, UpdatedVault, VaultSharingConfig, VaultSharingOptions, AccessLogRetention, VaultUploadSettings, UpdateVaultUploadOptions, } from './types';
253
- export type { UploadOptions, UploadAttachOptions, UploadResult, UploadProgress, VaultUploadConfig, UploadBranding, } from './upload';
254
- export { VaultUploadModule } from './upload';
@@ -1,368 +0,0 @@
1
- /**
2
- * Vaults Module Types
3
- */
4
- export interface CreateVaultOptions {
5
- /** Vault name */
6
- name: string;
7
- }
8
- export interface Vault {
9
- /** Vault ID */
10
- id: string;
11
- /** Vault name */
12
- name: string;
13
- /**
14
- * Vault Master Key, minted by Core and returned only here, by create: 144
15
- * random bits in Base62, at most 25 characters. STORE SECURELY!
16
- */
17
- vmk: string;
18
- /** Creation timestamp (Unix seconds) */
19
- createdAt: number;
20
- }
21
- export interface UnsealedVault {
22
- /** Vault ID */
23
- id: string;
24
- /** Vault Access Token (short-lived session, required for all ingot operations) */
25
- vatToken: string;
26
- /** VAT issued-at timestamp (Unix seconds) */
27
- issuedAt: number;
28
- /** Current reseal deadline (Unix seconds); server activity responses may extend it. */
29
- expiresAt: number;
30
- /** Seconds until the initial reseal deadline. */
31
- ttlSeconds: number;
32
- /** Fixed maximum deadline from this unseal (Unix seconds). */
33
- hardExpiresAt?: number;
34
- /** Inactivity window in seconds; zero means a fixed maximum with no extensions. */
35
- idleTimeoutSeconds?: number;
36
- }
37
- /** A shorter hard lifetime for this unseal; omitted to follow the vault settings. */
38
- export interface UnsealVaultOptions {
39
- ttlSeconds?: number;
40
- }
41
- /** The existing VAT session after an explicit activity extension. */
42
- export interface VaultSessionExtension {
43
- vaultId: string;
44
- expiresAt: number;
45
- hardExpiresAt: number;
46
- idleTimeoutSeconds: number;
47
- ttlSeconds: number;
48
- /** False once the fixed maximum has been reached; another unseal is needed. */
49
- canExtend: boolean;
50
- }
51
- /** Null inherits the system default; zero idle seconds disables activity extensions. */
52
- export interface VaultResealSettings {
53
- idleSeconds: number | null;
54
- maxSeconds: number | null;
55
- }
56
- /** Current system defaults, in seconds. */
57
- export interface VaultResealDefaults {
58
- idleSeconds: number;
59
- maxSeconds: number;
60
- }
61
- export interface VaultResealSettingsResult extends VaultResealSettings {
62
- vaultId: string;
63
- defaults: VaultResealDefaults;
64
- }
65
- /** Lifecycle metadata, including the lockout and seven-day cancellation window. */
66
- export interface VaultLifecycle {
67
- /** sealed, unsealed, deletion_scheduled, or deleting */
68
- status: string;
69
- /** Unix seconds when deletion was requested */
70
- deletionRequestedAt?: number;
71
- /** Unix seconds after which deletion cannot be cancelled */
72
- deletionScheduledFor?: number;
73
- deletionRequestedBy?: string;
74
- /** Pass this exact schedule to cancelDeletion. */
75
- deletionScheduleId?: string;
76
- }
77
- /**
78
- * A company administrator a vault deletion's notice could not reach: the mail
79
- * service declined their address, and the deletion does not wait for that
80
- * notice. Until the deadline the notice is tried again at the address they
81
- * hold then; one it reaches is named no longer.
82
- */
83
- export interface UnreachedAdmin {
84
- userId: string;
85
- /** The name the roster shows them by; null when they have none */
86
- name: string | null;
87
- /** The address the mail service declined their notice for, which their roster entry still holds */
88
- email: string;
89
- /** Why: `deliverability` (the address bounced or was reported as spam) or `consent` (email to it is blocked) */
90
- reason: string;
91
- }
92
- /** A vault's deletion schedule: a company admin can cancel it until `deletionScheduledFor`. */
93
- export interface ScheduledVaultDeletion {
94
- id: string;
95
- status: 'deletion_scheduled';
96
- deletionRequestedAt: number;
97
- deletionScheduledFor: number;
98
- deletionRequestedBy: string;
99
- deletionScheduleId: string;
100
- /**
101
- * Each administrator the schedule's notice could not reach, empty when it
102
- * reached every one; null while its notices are still being sent, when
103
- * get names them once they are.
104
- */
105
- deletionNoticeUnreached: UnreachedAdmin[] | null;
106
- }
107
- /** A vault's irreversible cleanup, started: no schedule is left to cancel. */
108
- export interface StartedVaultDeletion {
109
- id: string;
110
- status: 'deleting';
111
- /** Unix seconds when the cleanup started */
112
- startedAt: number;
113
- }
114
- export interface VaultSummary extends VaultLifecycle {
115
- /** Vault ID */
116
- id: string;
117
- /** Vault name */
118
- name: string;
119
- /** Creation timestamp (Unix seconds) */
120
- createdAt: number;
121
- /** Number of ingots */
122
- ingotCount: number;
123
- /** Total storage used in bytes */
124
- storageBytes: number;
125
- /** Previous versions retained per file or structured object (0 to 50); absent on older servers. */
126
- ingotVersionLimit?: number;
127
- /** @deprecated Use ingotVersionLimit. */
128
- structuredIngotVersionLimit?: number;
129
- /** Whether this vault uses the Structured Ingots browser, including when empty. */
130
- structuredIngotsEnabled?: boolean;
131
- }
132
- /** Options for list. */
133
- export interface ListVaultsOptions {
134
- /** Page size (1 to 500; server default 100) */
135
- limit?: number;
136
- /** Pagination cursor from a prior page's `nextCursor` */
137
- cursor?: string;
138
- }
139
- /** A page of vaults. */
140
- export interface VaultPage {
141
- /** Vaults on this page */
142
- vaults: VaultSummary[];
143
- /** Cursor for the next page, when more results exist */
144
- nextCursor?: string;
145
- }
146
- /** A single vault's detail, as returned by get. */
147
- export interface VaultDetail extends VaultLifecycle {
148
- /** Vault ID */
149
- id: string;
150
- /** Vault name */
151
- name: string;
152
- /** Optional description */
153
- description: string | null;
154
- /** Number of ingots */
155
- ingotCount: number;
156
- /** Total storage used in bytes */
157
- storageBytes: number;
158
- /** Previous versions retained per file or structured object, in addition to current content (default 0). */
159
- ingotVersionLimit?: number;
160
- /** @deprecated Use ingotVersionLimit. */
161
- structuredIngotVersionLimit?: number;
162
- /** Whether this vault is enabled for Structured Ingots, independent of record count. */
163
- structuredIngotsEnabled?: boolean;
164
- /** Creation timestamp (Unix seconds) */
165
- createdAt: number;
166
- /** Last unseal timestamp (Unix seconds), or null */
167
- lastUnsealedAt: number | null;
168
- /** Lifetime unseal count */
169
- unsealCount: number;
170
- /** Explicit inactivity setting, or null to inherit the system default. */
171
- resealIdleSeconds?: number | null;
172
- /** Explicit maximum unsealed lifetime, or null to inherit the system default. */
173
- resealMaxSeconds?: number | null;
174
- resealDefaults?: VaultResealDefaults;
175
- /**
176
- * With `deletion_scheduled`, read in a company admin's signed-in session:
177
- * each administrator the schedule's notice could not reach, empty when it
178
- * reached every one; null while its notices are still being sent. Absent
179
- * otherwise.
180
- */
181
- deletionNoticeUnreached?: UnreachedAdmin[] | null;
182
- }
183
- /** The result of renaming a vault. */
184
- export interface UpdatedVault {
185
- /** Vault ID */
186
- id: string;
187
- /** Vault name */
188
- name: string;
189
- /** Optional description */
190
- description: string | null;
191
- /** Update timestamp (Unix seconds) */
192
- updatedAt: number;
193
- }
194
- /** Vault public-sharing configuration. */
195
- export interface VaultSharingConfig {
196
- /** Vault ID */
197
- vaultId: string;
198
- /** Whether public sharing is enabled */
199
- publicSharingEnabled: boolean;
200
- /** Whether all ingots are public */
201
- allIngotsPublic: boolean;
202
- /** Public-session lifetime in seconds, or null */
203
- sessionLengthSeconds: number | null;
204
- /** Timestamp sharing was enabled (Unix seconds), or null */
205
- enabledAt: number | null;
206
- }
207
- /** Options for enabling/updating vault sharing. */
208
- export interface VaultSharingOptions {
209
- /** Make all ingots public */
210
- allIngotsPublic?: boolean;
211
- /** Public-session lifetime in seconds */
212
- sessionLengthSeconds?: number;
213
- }
214
- /** Vault access-log retention configuration. */
215
- export interface AccessLogRetention {
216
- /** Vault ID */
217
- vaultId: string;
218
- /** Retention window in seconds */
219
- retentionSeconds: number;
220
- }
221
- /** Vault upload-channel configuration. */
222
- export interface VaultUploadSettings {
223
- /** Vault ID */
224
- vaultId: string;
225
- /** Whether the upload portal is enabled */
226
- uploadPortalEnabled: boolean;
227
- /** Timestamp the portal was enabled (Unix seconds), or null */
228
- uploadPortalEnabledAt: number | null;
229
- /** Whether the upload widget is enabled */
230
- uploadWidgetEnabled: boolean;
231
- /** Timestamp the widget was enabled (Unix seconds), or null */
232
- uploadWidgetEnabledAt: number | null;
233
- /** Max upload size in bytes, or null for the account default */
234
- maxSizeBytes: number | null;
235
- /** Upload notification email, or null */
236
- notificationEmail: string | null;
237
- /** Public portal URL (present when the portal is enabled) */
238
- portalUrl?: string;
239
- }
240
- /** Options for updating vault upload settings. */
241
- export interface UpdateVaultUploadOptions {
242
- /** Max upload size in bytes */
243
- maxSizeBytes?: number;
244
- /** Upload notification email, or null to clear */
245
- notificationEmail?: string | null;
246
- }
247
- export interface CreateVaultResponse {
248
- vault_id: string;
249
- name: string;
250
- vmk: string;
251
- created_at: number;
252
- }
253
- export interface UnsealVaultResponse {
254
- vat: string;
255
- vault_id: string;
256
- issued_at: number;
257
- expires_at: number;
258
- ttl_seconds: number;
259
- hard_expires_at?: number;
260
- idle_timeout_seconds?: number;
261
- }
262
- export interface ExtendVaultSessionResponse {
263
- vault_id: string;
264
- expires_at: number;
265
- hard_expires_at: number;
266
- idle_timeout_seconds: number;
267
- ttl_seconds: number;
268
- can_extend: boolean;
269
- }
270
- interface VaultLifecycleResponse {
271
- status: string;
272
- deletion_requested_at?: number;
273
- deletion_scheduled_for?: number;
274
- deletion_requested_by?: string;
275
- deletion_schedule_id?: string;
276
- }
277
- export interface UnreachedAdminResponse {
278
- user_id: string;
279
- name: string | null;
280
- email: string;
281
- reason: string;
282
- }
283
- /** DELETE /v1/vaults/:id: the schedule, or, once a schedule's deadline has passed, the cleanup it started. */
284
- export type ScheduleVaultDeletionResponse = {
285
- vault_id: string;
286
- status: 'deletion_scheduled';
287
- deletion_requested_at: number;
288
- deletion_scheduled_for: number;
289
- deletion_requested_by: string;
290
- deletion_schedule_id: string;
291
- deletion_notice_unreached: UnreachedAdminResponse[] | null;
292
- } | {
293
- vault_id: string;
294
- status: 'deleting';
295
- started_at: number;
296
- };
297
- export interface ListVaultsResponse {
298
- vaults: (VaultLifecycleResponse & {
299
- vault_id: string;
300
- name: string;
301
- created_at: number;
302
- ingot_count: number;
303
- storage_bytes: number;
304
- ingot_version_limit?: number;
305
- structured_ingot_version_limit?: number;
306
- structured_ingots_enabled?: boolean;
307
- })[];
308
- next_cursor?: string;
309
- }
310
- export interface VaultDetailResponse extends VaultLifecycleResponse {
311
- vault_id: string;
312
- name: string;
313
- description?: string | null;
314
- ingot_count?: number;
315
- storage_bytes?: number;
316
- ingot_version_limit?: number;
317
- structured_ingot_version_limit?: number;
318
- structured_ingots_enabled?: boolean;
319
- created_at: number;
320
- last_unsealed_at?: number | null;
321
- unseal_count?: number;
322
- reseal_idle_seconds?: number | null;
323
- reseal_max_seconds?: number | null;
324
- reseal_defaults?: {
325
- idle_seconds: number;
326
- max_seconds: number;
327
- };
328
- deletion_notice_unreached?: UnreachedAdminResponse[] | null;
329
- }
330
- export interface VaultResealSettingsResponse {
331
- vault_id: string;
332
- reseal_idle_seconds: number | null;
333
- reseal_max_seconds: number | null;
334
- reseal_defaults: {
335
- idle_seconds: number;
336
- max_seconds: number;
337
- };
338
- }
339
- export interface UpdateVaultResponse {
340
- vault_id: string;
341
- name: string;
342
- description?: string | null;
343
- updated_at: number;
344
- }
345
- /** GET /v1/vaults/:id/sharing, and the configuration every sharing write answers. */
346
- export interface VaultSharingConfigResponse {
347
- vault_id: string;
348
- public_sharing_enabled: boolean;
349
- all_ingots_public: boolean;
350
- session_length_seconds: number | null;
351
- enabled_at: number | null;
352
- }
353
- export interface AccessLogRetentionResponse {
354
- vault_id: string;
355
- access_log_retention_seconds: number;
356
- }
357
- /** GET /v1/vaults/:id/upload, and the configuration every upload write answers. */
358
- export interface VaultUploadSettingsResponse {
359
- vault_id: string;
360
- upload_portal_enabled: boolean;
361
- upload_portal_enabled_at?: number | null;
362
- upload_widget_enabled: boolean;
363
- upload_widget_enabled_at?: number | null;
364
- max_size_bytes?: number | null;
365
- notification_email?: string | null;
366
- portal_url?: string;
367
- }
368
- export {};