@sparkvault/sdk-js 2.2.5 → 4.0.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.
Files changed (56) hide show
  1. package/dist/auto-init.d.ts +1 -1
  2. package/dist/entropy/index.d.ts +28 -0
  3. package/dist/entropy/types.d.ts +32 -0
  4. package/dist/folders/index.d.ts +77 -0
  5. package/dist/folders/types.d.ts +64 -0
  6. package/dist/http.d.ts +3 -1
  7. package/dist/index.d.ts +982 -78
  8. package/dist/ingots/index.d.ts +183 -0
  9. package/dist/ingots/types.d.ts +286 -0
  10. package/dist/{identity → products/identity}/api.d.ts +3 -3
  11. package/dist/{identity → products/identity}/embedder.d.ts +1 -1
  12. package/dist/{identity → products/identity}/index.d.ts +7 -7
  13. package/dist/{identity → products/identity}/utils.d.ts +1 -1
  14. package/dist/products/index.d.ts +18 -0
  15. package/dist/sparks/index.d.ts +65 -0
  16. package/dist/sparks/types.d.ts +174 -0
  17. package/dist/sparkvault.cjs.js +1077 -101
  18. package/dist/sparkvault.cjs.js.map +1 -1
  19. package/dist/sparkvault.esm.js +1071 -102
  20. package/dist/sparkvault.esm.js.map +1 -1
  21. package/dist/sparkvault.js +1 -1
  22. package/dist/sparkvault.js.map +1 -1
  23. package/dist/vaults/index.d.ts +102 -34
  24. package/dist/vaults/types.d.ts +121 -57
  25. package/dist/vaults/upload/api.d.ts +1 -1
  26. package/package.json +1 -1
  27. /package/dist/{identity → products/identity}/container.d.ts +0 -0
  28. /package/dist/{identity → products/identity}/handlers/index.d.ts +0 -0
  29. /package/dist/{identity → products/identity}/handlers/passkey-handler.d.ts +0 -0
  30. /package/dist/{identity → products/identity}/handlers/sparklink-handler.d.ts +0 -0
  31. /package/dist/{identity → products/identity}/handlers/totp-handler.d.ts +0 -0
  32. /package/dist/{identity → products/identity}/inline-container.d.ts +0 -0
  33. /package/dist/{identity → products/identity}/methods.d.ts +0 -0
  34. /package/dist/{identity → products/identity}/modal.d.ts +0 -0
  35. /package/dist/{identity → products/identity}/renderer.d.ts +0 -0
  36. /package/dist/{identity → products/identity}/state.d.ts +0 -0
  37. /package/dist/{identity → products/identity}/styles.d.ts +0 -0
  38. /package/dist/{identity → products/identity}/types.d.ts +0 -0
  39. /package/dist/{identity → products/identity}/utils/cooldown-timer.d.ts +0 -0
  40. /package/dist/{identity → products/identity}/utils/index.d.ts +0 -0
  41. /package/dist/{identity → products/identity}/views/backup-verify.d.ts +0 -0
  42. /package/dist/{identity → products/identity}/views/base.d.ts +0 -0
  43. /package/dist/{identity → products/identity}/views/error.d.ts +0 -0
  44. /package/dist/{identity → products/identity}/views/icons.d.ts +0 -0
  45. /package/dist/{identity → products/identity}/views/identity-input.d.ts +0 -0
  46. /package/dist/{identity → products/identity}/views/index.d.ts +0 -0
  47. /package/dist/{identity → products/identity}/views/loading.d.ts +0 -0
  48. /package/dist/{identity → products/identity}/views/method-select.d.ts +0 -0
  49. /package/dist/{identity → products/identity}/views/origin-not-allowed.d.ts +0 -0
  50. /package/dist/{identity → products/identity}/views/passkey-prompt.d.ts +0 -0
  51. /package/dist/{identity → products/identity}/views/passkey.d.ts +0 -0
  52. /package/dist/{identity → products/identity}/views/product-not-configured.d.ts +0 -0
  53. /package/dist/{identity → products/identity}/views/service-unavailable.d.ts +0 -0
  54. /package/dist/{identity → products/identity}/views/sparklink-waiting.d.ts +0 -0
  55. /package/dist/{identity → products/identity}/views/totp-verify.d.ts +0 -0
  56. /package/dist/{identity → products/identity}/views/two-factor.d.ts +0 -0
@@ -0,0 +1,174 @@
1
+ /**
2
+ * Sparks Module Types
3
+ *
4
+ * Sparks are end-to-end encrypted, read-once ephemeral secrets scoped to the
5
+ * account (no vault/VAT). Public domain objects are camelCase; wire shapes
6
+ * (snake_case) stay private to the module.
7
+ */
8
+ /** A spark summary as returned by list. */
9
+ export interface SparkSummary {
10
+ /** Spark ID */
11
+ id: string;
12
+ /** Content type (MIME) */
13
+ contentType: string;
14
+ /** Size in bytes */
15
+ size: number;
16
+ /** Lifecycle status (active | expired | ash) */
17
+ status: string;
18
+ /** Creation timestamp (Unix seconds) */
19
+ createdAt: number;
20
+ /** Expiry timestamp (Unix seconds) */
21
+ expiresAt: number;
22
+ /** Burn timestamp (Unix seconds), or null if not yet read */
23
+ burnedAt: number | null;
24
+ /** Seconds remaining until expiry */
25
+ timeRemaining: number;
26
+ /** Optional file name (for file payloads) */
27
+ filename?: string;
28
+ /** Optional kindling family ID */
29
+ kindling?: string;
30
+ }
31
+ /** The decrypted spark, returned by get (reading burns it). */
32
+ export interface Spark {
33
+ /** Spark ID */
34
+ id: string;
35
+ /** Decrypted payload (text, or base64 for binary content types) */
36
+ payload: string;
37
+ /** Content type (MIME) */
38
+ contentType: string;
39
+ /** Size in bytes */
40
+ size: number;
41
+ /** Lifecycle status after the read (ash) */
42
+ status: string;
43
+ /** Creation timestamp (Unix seconds) */
44
+ createdAt: number;
45
+ /** Burn timestamp (Unix seconds) */
46
+ burnedAt: number;
47
+ /** Optional file name (for file payloads) */
48
+ filename?: string;
49
+ }
50
+ /** A newly created spark. */
51
+ export interface CreatedSpark {
52
+ /** Spark ID */
53
+ id: string;
54
+ /** Size in bytes */
55
+ size: number;
56
+ /** Lifecycle status (active) */
57
+ status: string;
58
+ /** Creation timestamp (Unix seconds) */
59
+ createdAt: number;
60
+ /** Expiry timestamp (Unix seconds) */
61
+ expiresAt: number;
62
+ /** Time-to-live in minutes */
63
+ ttlMinutes: number;
64
+ /** Optional file name (echoed when provided) */
65
+ filename?: string;
66
+ /** Optional kindling family ID (echoed when provided) */
67
+ kindling?: string;
68
+ }
69
+ /** Options for list. */
70
+ export interface ListSparksOptions {
71
+ /** Filter to a kindling family */
72
+ kindling?: string;
73
+ /** Filter by status */
74
+ status?: string;
75
+ /** Page size */
76
+ limit?: number;
77
+ /** Pagination cursor */
78
+ cursor?: string;
79
+ }
80
+ /** A page of sparks. */
81
+ export interface SparkPage {
82
+ /** Sparks on this page */
83
+ sparks: SparkSummary[];
84
+ /** Cursor for the next page, when more results exist */
85
+ nextCursor?: string;
86
+ }
87
+ /** Options for create. */
88
+ export interface CreateSparkOptions {
89
+ /** Payload (text, or base64 for binary content types) */
90
+ payload: string;
91
+ /** Content type (MIME). Defaults to text/plain. */
92
+ contentType?: string;
93
+ /** Time-to-live in minutes. Defaults to 1440 (24h). */
94
+ ttlMinutes?: number;
95
+ /** Join an existing kindling family by ID */
96
+ kindling?: string;
97
+ /** Generate a new kindling family for this spark */
98
+ withKindling?: boolean;
99
+ /** Optional file name (for file payloads) */
100
+ filename?: string;
101
+ }
102
+ /** Visibility mode for a shared spark. */
103
+ export type SparkVisibility = 'public' | 'authenticated' | 'invite_only';
104
+ /** Options for share. */
105
+ export interface ShareSparkOptions {
106
+ /** Visibility mode. Defaults to public. */
107
+ visibility?: SparkVisibility;
108
+ /** Invited identities (emails/phones) */
109
+ invites?: string[];
110
+ /** Link lifetime in seconds */
111
+ expiresInSeconds?: number;
112
+ }
113
+ /** The result of sharing a spark. */
114
+ export interface SparkShare {
115
+ /** Whether the spark is shared */
116
+ shared: boolean;
117
+ /** Public share URL (x.sv link) */
118
+ shareUrl?: string;
119
+ /** Short link code */
120
+ linkCode?: string;
121
+ /** Visibility mode */
122
+ visibility?: SparkVisibility;
123
+ /** Invited identities */
124
+ invites?: string[];
125
+ /** Link expiry timestamp (Unix seconds) */
126
+ expiresAt?: number;
127
+ /** Link creation timestamp (Unix seconds) */
128
+ createdAt?: number;
129
+ }
130
+ export interface SparkSummaryWire {
131
+ spark_id: string;
132
+ content_type?: string;
133
+ size_bytes: number;
134
+ status: string;
135
+ created_at: number;
136
+ expires_at: number;
137
+ burned_at?: number | null;
138
+ time_remaining?: number;
139
+ filename?: string;
140
+ kindling?: string;
141
+ }
142
+ export interface ListSparksResponse {
143
+ sparks: SparkSummaryWire[];
144
+ next_cursor?: string;
145
+ }
146
+ export interface SparkResponse {
147
+ spark_id: string;
148
+ payload: string;
149
+ content_type?: string;
150
+ size_bytes: number;
151
+ status: string;
152
+ created_at: number;
153
+ burned_at: number;
154
+ filename?: string;
155
+ }
156
+ export interface CreateSparkResponse {
157
+ spark_id: string;
158
+ size_bytes: number;
159
+ status: string;
160
+ created_at: number;
161
+ expires_at: number;
162
+ ttl_minutes: number;
163
+ filename?: string;
164
+ kindling?: string;
165
+ }
166
+ export interface SparkShareResponse {
167
+ shared: boolean;
168
+ share_url?: string;
169
+ link_code?: string;
170
+ visibility?: SparkVisibility;
171
+ invites?: string[];
172
+ expires_at?: number;
173
+ created_at?: number;
174
+ }