@sparkvault/sdk-js 11.1.14 → 11.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,7 @@
8
8
  */
9
9
  import type { ResolvedConfig } from '../config';
10
10
  import { HttpClient } from '../http';
11
- import type { CreateVaultOptions, Vault, UnsealedVault, VaultPage, ListVaultsOptions, VaultDetail, UpdatedVault, VaultSharingConfig, VaultSharingOptions, AccessLogRetention, VaultUploadSettings, UpdateVaultUploadOptions } from './types';
11
+ import type { CreateVaultOptions, Vault, UnsealedVault, VaultPage, ListVaultsOptions, VaultDetail, ScheduledVaultDeletion, UpdatedVault, VaultSharingConfig, VaultSharingOptions, AccessLogRetention, VaultUploadSettings, UpdateVaultUploadOptions } from './types';
12
12
  import { type UploadOptions, type UploadAttachOptions, type UploadResult } from './upload';
13
13
  /**
14
14
  * Callable upload interface with methods.
@@ -100,7 +100,8 @@ export declare class VaultsModule {
100
100
  */
101
101
  seal(vaultId: string): Promise<void>;
102
102
  /**
103
- * Delete a vault and all its ingots. This action is irreversible!
103
+ * Schedule permanent deletion in seven days and immediately lock all vault access.
104
+ * Company admins only; cancelDeletion can abort this schedule before its deadline.
104
105
  *
105
106
  * Requires the vault's exact name as confirmation, matched case-sensitively.
106
107
  * The name is sent base64(UTF-8) as the `X-Confirm-Name-B64` header so a vault
@@ -110,7 +111,9 @@ export declare class VaultsModule {
110
111
  * @example
111
112
  * await sv.vaults.delete('vlt_abc', 'My Vault');
112
113
  */
113
- delete(vaultId: string, name: string): Promise<void>;
114
+ delete(vaultId: string, name: string): Promise<ScheduledVaultDeletion>;
115
+ /** Cancel this exact deletion schedule before its deadline; company admins only. */
116
+ cancelDeletion(vaultId: string, deletionScheduleId: string): Promise<VaultDetail>;
114
117
  /**
115
118
  * Get a vault's public-sharing configuration.
116
119
  *
@@ -206,6 +209,6 @@ export declare class VaultsModule {
206
209
  private toggleUploadChannel;
207
210
  private validateCreateOptions;
208
211
  }
209
- export type { CreateVaultOptions, Vault, UnsealedVault, VaultSummary, VaultPage, ListVaultsOptions, VaultDetail, UpdatedVault, VaultSharingConfig, VaultSharingOptions, AccessLogRetention, VaultUploadSettings, UpdateVaultUploadOptions, } from './types';
212
+ export type { CreateVaultOptions, Vault, UnsealedVault, VaultSummary, VaultPage, ListVaultsOptions, VaultDetail, VaultLifecycle, ScheduledVaultDeletion, UpdatedVault, VaultSharingConfig, VaultSharingOptions, AccessLogRetention, VaultUploadSettings, UpdateVaultUploadOptions, } from './types';
210
213
  export type { UploadOptions, UploadAttachOptions, UploadResult, UploadProgress, VaultUploadConfig, UploadBranding, } from './upload';
211
214
  export { VaultUploadModule } from './upload';
@@ -27,7 +27,27 @@ export interface UnsealedVault {
27
27
  /** VAT lifetime in seconds */
28
28
  ttlSeconds: number;
29
29
  }
30
- export interface VaultSummary {
30
+ /** Lifecycle metadata, including the lockout and seven-day cancellation window. */
31
+ export interface VaultLifecycle {
32
+ /** sealed, unsealed, deletion_scheduled, or deleting */
33
+ status: string;
34
+ /** Unix seconds when deletion was requested */
35
+ deletionRequestedAt?: number;
36
+ /** Unix seconds after which deletion cannot be cancelled */
37
+ deletionScheduledFor?: number;
38
+ deletionRequestedBy?: string;
39
+ /** Pass this exact schedule to cancelDeletion. */
40
+ deletionScheduleId?: string;
41
+ }
42
+ export interface ScheduledVaultDeletion {
43
+ id: string;
44
+ status: 'deletion_scheduled';
45
+ deletionRequestedAt: number;
46
+ deletionScheduledFor: number;
47
+ deletionRequestedBy: string;
48
+ deletionScheduleId: string;
49
+ }
50
+ export interface VaultSummary extends VaultLifecycle {
31
51
  /** Vault ID */
32
52
  id: string;
33
53
  /** Vault name */
@@ -54,15 +74,13 @@ export interface VaultPage {
54
74
  nextCursor?: string;
55
75
  }
56
76
  /** A single vault's detail, as returned by get. */
57
- export interface VaultDetail {
77
+ export interface VaultDetail extends VaultLifecycle {
58
78
  /** Vault ID */
59
79
  id: string;
60
80
  /** Vault name */
61
81
  name: string;
62
82
  /** Optional description */
63
83
  description: string | null;
64
- /** Sealed/unsealed status */
65
- status: string;
66
84
  /** Number of ingots */
67
85
  ingotCount: number;
68
86
  /** Total storage used in bytes */
@@ -151,21 +169,35 @@ export interface UnsealVaultResponse {
151
169
  expires_at: number;
152
170
  ttl_seconds: number;
153
171
  }
172
+ interface VaultLifecycleResponse {
173
+ status: string;
174
+ deletion_requested_at?: number;
175
+ deletion_scheduled_for?: number;
176
+ deletion_requested_by?: string;
177
+ deletion_schedule_id?: string;
178
+ }
179
+ export interface ScheduleVaultDeletionResponse {
180
+ vault_id: string;
181
+ status: 'deletion_scheduled';
182
+ deletion_requested_at: number;
183
+ deletion_scheduled_for: number;
184
+ deletion_requested_by: string;
185
+ deletion_schedule_id: string;
186
+ }
154
187
  export interface ListVaultsResponse {
155
- vaults: {
188
+ vaults: (VaultLifecycleResponse & {
156
189
  vault_id: string;
157
190
  name: string;
158
191
  created_at: number;
159
192
  ingot_count: number;
160
193
  storage_bytes: number;
161
- }[];
194
+ })[];
162
195
  next_cursor?: string;
163
196
  }
164
- export interface VaultDetailResponse {
197
+ export interface VaultDetailResponse extends VaultLifecycleResponse {
165
198
  vault_id: string;
166
199
  name: string;
167
200
  description?: string | null;
168
- status: string;
169
201
  ingot_count?: number;
170
202
  storage_bytes?: number;
171
203
  created_at: number;
@@ -207,3 +239,4 @@ export interface UploadChannelToggleResponse {
207
239
  disabled_at?: number;
208
240
  portal_url?: string;
209
241
  }
242
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sparkvault/sdk-js",
3
- "version": "11.1.14",
3
+ "version": "11.2.0",
4
4
  "description": "SparkVault JavaScript SDK - Identity Verification and Encrypted Vaults",
5
5
  "type": "module",
6
6
  "exports": {