@sparkvault/sdk 1.24.0 → 1.24.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.
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import type { ResolvedConfig } from '../config';
8
8
  import { HttpClient } from '../http';
9
- import type { CreateVaultOptions, Vault, UnsealedVault, VaultSummary, Ingot, UploadIngotOptions } from './types';
9
+ import type { CreateVaultOptions, Vault, UnsealedVault, VaultSummary, Ingot, CreatedIngot, UploadIngotOptions } from './types';
10
10
  import { type UploadOptions, type UploadAttachOptions, type UploadResult } from './upload';
11
11
  /**
12
12
  * Callable upload interface with methods.
@@ -18,6 +18,7 @@ export interface UploadCallable {
18
18
  close(): void;
19
19
  }
20
20
  export declare class VaultsModule {
21
+ private readonly config;
21
22
  private readonly http;
22
23
  private readonly uploadModule;
23
24
  /**
@@ -77,7 +78,7 @@ export declare class VaultsModule {
77
78
  * name: 'document.pdf'
78
79
  * });
79
80
  */
80
- uploadIngot(vault: UnsealedVault, options: UploadIngotOptions): Promise<Ingot>;
81
+ uploadIngot(vault: UnsealedVault, options: UploadIngotOptions): Promise<CreatedIngot>;
81
82
  /**
82
83
  * Download an ingot from an unsealed vault.
83
84
  *
@@ -103,7 +104,8 @@ export declare class VaultsModule {
103
104
  deleteIngot(vault: UnsealedVault, ingotId: string): Promise<void>;
104
105
  private validateCreateOptions;
105
106
  private validateUploadOptions;
107
+ private validateDownloadUrl;
106
108
  }
107
- export type { CreateVaultOptions, Vault, UnsealedVault, VaultSummary, Ingot, UploadIngotOptions, } from './types';
109
+ export type { CreateVaultOptions, Vault, UnsealedVault, VaultSummary, Ingot, CreatedIngot, UploadIngotOptions, } from './types';
108
110
  export type { UploadOptions, UploadAttachOptions, UploadResult, UploadProgress, VaultUploadConfig, UploadBranding, } from './upload';
109
111
  export { VaultUploadModule, UploadApiError } from './upload';
@@ -28,16 +28,14 @@ export interface UnsealVaultOptions {
28
28
  export interface UnsealedVault {
29
29
  /** Vault ID */
30
30
  id: string;
31
- /** Vault name */
32
- name: string;
33
- /** Vault Access Token (short-lived session) */
31
+ /** Vault Access Token (short-lived session, required for all ingot operations) */
34
32
  vatToken: string;
33
+ /** VAT issued-at timestamp (Unix seconds) */
34
+ issuedAt: number;
35
35
  /** VAT expiry timestamp (Unix seconds) */
36
36
  expiresAt: number;
37
- /** Number of ingots in vault */
38
- ingotCount: number;
39
- /** Total storage used in bytes */
40
- storageBytes: number;
37
+ /** VAT lifetime in seconds */
38
+ ttlSeconds: number;
41
39
  }
42
40
  export interface VaultSummary {
43
41
  /** Vault ID */
@@ -64,8 +62,18 @@ export interface Ingot {
64
62
  size: number;
65
63
  /** Creation timestamp (Unix seconds) */
66
64
  createdAt: number;
67
- /** Ingot type: 'standard' or 'structured' */
68
- type: 'standard' | 'structured';
65
+ }
66
+ export interface CreatedIngot {
67
+ /** Ingot ID */
68
+ id: string;
69
+ /** Ingot name */
70
+ name: string;
71
+ /** Content type (MIME) */
72
+ contentType: string;
73
+ /** Size in bytes */
74
+ size: number;
75
+ /** Forge upload session expiry (Unix seconds) */
76
+ uploadExpiresAt: number;
69
77
  }
70
78
  export interface UploadIngotOptions {
71
79
  /** File to upload */
@@ -74,6 +82,8 @@ export interface UploadIngotOptions {
74
82
  name?: string;
75
83
  /** Content type (auto-detected if not provided) */
76
84
  contentType?: string;
85
+ /** Progress callback for Forge/TUS upload */
86
+ onProgress?: (bytesUploaded: number, bytesTotal: number) => void;
77
87
  }
78
88
  export interface CreateVaultResponse {
79
89
  vault_id: string;
@@ -83,12 +93,11 @@ export interface CreateVaultResponse {
83
93
  hosted_vmk: boolean;
84
94
  }
85
95
  export interface UnsealVaultResponse {
96
+ vat: string;
86
97
  vault_id: string;
87
- name: string;
88
- vat_token: string;
98
+ issued_at: number;
89
99
  expires_at: number;
90
- ingot_count: number;
91
- storage_bytes: number;
100
+ ttl_seconds: number;
92
101
  }
93
102
  export interface ListVaultsResponse {
94
103
  vaults: {
@@ -107,7 +116,6 @@ export interface ListIngotsResponse {
107
116
  content_type: string;
108
117
  size_bytes: number;
109
118
  created_at: number;
110
- ingot_type: 'standard' | 'structured';
111
119
  }[];
112
120
  }
113
121
  export interface CreateIngotResponse {
@@ -115,6 +123,10 @@ export interface CreateIngotResponse {
115
123
  name: string;
116
124
  content_type: string;
117
125
  size_bytes: number;
118
- created_at: number;
119
- ingot_type: 'standard' | 'structured';
126
+ status: 'uploading';
127
+ forge_url: string;
128
+ expires_at: number;
129
+ }
130
+ export interface DownloadIngotResponse {
131
+ download_url: string;
120
132
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sparkvault/sdk",
3
- "version": "1.24.0",
3
+ "version": "1.24.2",
4
4
  "description": "SparkVault JavaScript SDK - Identity Verification and Encrypted Vaults",
5
5
  "type": "module",
6
6
  "main": "dist/sparkvault.cjs.js",