@sparkvault/sdk-js 14.1.0 → 14.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.
@@ -0,0 +1,2 @@
1
+ import type { ResolvedConfig } from './config';
2
+ export declare function publishVaultSessionTiming(config: ResolvedConfig, vat: string | undefined, response: Response, requestStartedAtMs: number): void;
@@ -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, ScheduledVaultDeletion, StartedVaultDeletion, UpdatedVault, VaultSharingConfig, VaultSharingOptions, AccessLogRetention, VaultUploadSettings, UpdateVaultUploadOptions } from './types';
11
+ import type { CreateVaultOptions, Vault, UnsealedVault, UnsealVaultOptions, VaultSessionExtension, VaultResealSettings, VaultResealSettingsResult, VaultPage, ListVaultsOptions, VaultDetail, ScheduledVaultDeletion, StartedVaultDeletion, 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.
@@ -61,7 +61,14 @@ export declare class VaultsModule {
61
61
  * const delegated = await sv.vaults.unseal('vlt_abc', 'dvak_...');
62
62
  * console.log('Token:', unsealed.vatToken);
63
63
  */
64
- unseal(vaultId: string, key: string): Promise<UnsealedVault>;
64
+ unseal(vaultId: string, key: string, options?: UnsealVaultOptions): Promise<UnsealedVault>;
65
+ /**
66
+ * Explicitly extend this live session's inactivity window, up to the
67
+ * original unseal's fixed maximum. No key is needed and no new VAT is minted.
68
+ * A fixed-duration session or one at its maximum is refused by Core; another
69
+ * unseal is required. The normal timing observer receives the new deadline.
70
+ */
71
+ extendSession(vaultId: string, vat: string): Promise<VaultSessionExtension>;
65
72
  /**
66
73
  * List vaults for the account. Results are paginated (server default 100 per
67
74
  * page, max 500); follow `nextCursor` to fetch subsequent pages.
@@ -83,6 +90,12 @@ export declare class VaultsModule {
83
90
  * console.log(vault.status, vault.ingotCount);
84
91
  */
85
92
  get(vaultId: string): Promise<VaultDetail>;
93
+ /**
94
+ * Set when this vault reseals after inactivity and after an unseal.
95
+ * Company administrators only. Changes apply on the next unseal.
96
+ * Null values inherit system defaults; zero idle seconds disables extensions.
97
+ */
98
+ updateResealSettings(vaultId: string, settings: VaultResealSettings): Promise<VaultResealSettingsResult>;
86
99
  /**
87
100
  * Rename a vault.
88
101
  *
@@ -214,6 +227,6 @@ export declare class VaultsModule {
214
227
  private toggleUploadChannel;
215
228
  private validateCreateOptions;
216
229
  }
217
- export type { CreateVaultOptions, Vault, UnsealedVault, VaultSummary, VaultPage, ListVaultsOptions, VaultDetail, VaultLifecycle, ScheduledVaultDeletion, StartedVaultDeletion, UnreachedAdmin, UpdatedVault, VaultSharingConfig, VaultSharingOptions, AccessLogRetention, VaultUploadSettings, UpdateVaultUploadOptions, } from './types';
230
+ 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';
218
231
  export type { UploadOptions, UploadAttachOptions, UploadResult, UploadProgress, VaultUploadConfig, UploadBranding, } from './upload';
219
232
  export { VaultUploadModule } from './upload';
@@ -25,10 +25,42 @@ export interface UnsealedVault {
25
25
  vatToken: string;
26
26
  /** VAT issued-at timestamp (Unix seconds) */
27
27
  issuedAt: number;
28
- /** VAT expiry timestamp (Unix seconds) */
28
+ /** Current reseal deadline (Unix seconds); server activity responses may extend it. */
29
29
  expiresAt: number;
30
- /** VAT lifetime in seconds */
30
+ /** Seconds until the initial reseal deadline. */
31
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;
32
64
  }
33
65
  /** Lifecycle metadata, including the lockout and seven-day cancellation window. */
34
66
  export interface VaultLifecycle {
@@ -123,6 +155,11 @@ export interface VaultDetail extends VaultLifecycle {
123
155
  lastUnsealedAt: number | null;
124
156
  /** Lifetime unseal count */
125
157
  unsealCount: number;
158
+ /** Explicit inactivity setting, or null to inherit the system default. */
159
+ resealIdleSeconds?: number | null;
160
+ /** Explicit maximum unsealed lifetime, or null to inherit the system default. */
161
+ resealMaxSeconds?: number | null;
162
+ resealDefaults?: VaultResealDefaults;
126
163
  /**
127
164
  * With `deletion_scheduled`, read in a company admin's signed-in session:
128
165
  * each administrator the schedule's notice could not reach, empty when it
@@ -207,6 +244,16 @@ export interface UnsealVaultResponse {
207
244
  issued_at: number;
208
245
  expires_at: number;
209
246
  ttl_seconds: number;
247
+ hard_expires_at?: number;
248
+ idle_timeout_seconds?: number;
249
+ }
250
+ export interface ExtendVaultSessionResponse {
251
+ vault_id: string;
252
+ expires_at: number;
253
+ hard_expires_at: number;
254
+ idle_timeout_seconds: number;
255
+ ttl_seconds: number;
256
+ can_extend: boolean;
210
257
  }
211
258
  interface VaultLifecycleResponse {
212
259
  status: string;
@@ -254,8 +301,23 @@ export interface VaultDetailResponse extends VaultLifecycleResponse {
254
301
  created_at: number;
255
302
  last_unsealed_at?: number | null;
256
303
  unseal_count?: number;
304
+ reseal_idle_seconds?: number | null;
305
+ reseal_max_seconds?: number | null;
306
+ reseal_defaults?: {
307
+ idle_seconds: number;
308
+ max_seconds: number;
309
+ };
257
310
  deletion_notice_unreached?: UnreachedAdminResponse[] | null;
258
311
  }
312
+ export interface VaultResealSettingsResponse {
313
+ vault_id: string;
314
+ reseal_idle_seconds: number | null;
315
+ reseal_max_seconds: number | null;
316
+ reseal_defaults: {
317
+ idle_seconds: number;
318
+ max_seconds: number;
319
+ };
320
+ }
259
321
  export interface UpdateVaultResponse {
260
322
  vault_id: string;
261
323
  name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sparkvault/sdk-js",
3
- "version": "14.1.0",
3
+ "version": "14.2.0",
4
4
  "description": "SparkVault JavaScript SDK - Identity, Secure Help Desk, Notifications and Encrypted Vaults",
5
5
  "type": "module",
6
6
  "exports": {