sealnet 2.0.4 → 3.1.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.
- package/README.md +12 -9
- package/THIRD-PARTY-NOTICES.txt +1 -1
- package/dist/index.cjs +2546 -1336
- package/dist/index.d.cts +113 -42
- package/dist/index.d.ts +113 -42
- package/dist/index.js +2546 -1336
- package/dist/seal.global.js +3 -3
- package/dist/seal.global.js.sha384 +1 -1
- package/dist/seal_crypto.wasm +0 -0
- package/dist/seal_crypto.wasm.sha384 +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* What an intake request asks for (SPEC-AGENTS §4.4): `pair` and `device`
|
|
3
3
|
* are the inbox's own (SPEC-ADDRESS F3), answered on box.seal.net.
|
|
4
4
|
*/
|
|
5
|
-
type IntakeKind = 'secret' | 'file' | 'any' | 'pair' | 'device';
|
|
5
|
+
type IntakeKind = 'secret' | 'file' | 'any' | 'pair' | 'device' | 'guard';
|
|
6
6
|
/** A file's plaintext, and what it turned out to be once the stream ended. */
|
|
7
7
|
interface OpenedStream {
|
|
8
8
|
readonly stream: ReadableStream<Uint8Array>;
|
|
@@ -17,36 +17,99 @@ interface OpenedStream {
|
|
|
17
17
|
declare const TTL_OPTIONS: readonly string[];
|
|
18
18
|
/** A seal's lifetime, one of the contract's `ttl_options`. */
|
|
19
19
|
type TTL = (typeof TTL_OPTIONS)[number];
|
|
20
|
+
/**
|
|
21
|
+
* A file's bytes: a `File` or `Blob` (in Node, `fs.openAsBlob(path)` reads one from disk as it goes up), an
|
|
22
|
+
* `ArrayBuffer` or a `Uint8Array`.
|
|
23
|
+
*/
|
|
24
|
+
type SealSource = File | Blob | ArrayBuffer | Uint8Array;
|
|
25
|
+
/** One file of a seal, as the recipient sees it. */
|
|
26
|
+
interface SealFile {
|
|
27
|
+
readonly file: SealSource;
|
|
28
|
+
/** The name the recipient sees: a `File`'s own when omitted; bytes need one. */
|
|
29
|
+
readonly filename?: string;
|
|
30
|
+
/** The type the recipient sees: a `File`'s own when omitted, else `application/octet-stream`. */
|
|
31
|
+
readonly mimeType?: string;
|
|
32
|
+
/** A secret — a key, a password: the recipient's page shows it hidden, a receiving agent saves it and never prints it. */
|
|
33
|
+
readonly secret?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/** One file of a folder: its path in the folder, `/` between folders, is its name in the seal (`docs/q3/report.pdf`). */
|
|
36
|
+
interface SealFolderFile {
|
|
37
|
+
readonly path: string;
|
|
38
|
+
readonly file: SealSource;
|
|
39
|
+
readonly mimeType?: string;
|
|
40
|
+
}
|
|
41
|
+
/** Where a send stands: the whole seal's `percent` (0–100, never back), and the phase and name of the file moving now. */
|
|
42
|
+
interface SendProgress {
|
|
43
|
+
readonly phase: string;
|
|
44
|
+
readonly percent: number;
|
|
45
|
+
readonly fileIndex: number;
|
|
46
|
+
readonly totalFiles: number;
|
|
47
|
+
readonly fileName: string;
|
|
48
|
+
}
|
|
20
49
|
interface CreateAnonymousSealOptions {
|
|
21
|
-
/**
|
|
22
|
-
file
|
|
23
|
-
/**
|
|
24
|
-
filename
|
|
25
|
-
/** MIME type (optional,
|
|
50
|
+
/** One file (File, ArrayBuffer, Uint8Array, or Blob); `files`, `folder` and `secret` add to the same seal */
|
|
51
|
+
file?: SealSource;
|
|
52
|
+
/** The name the recipient sees for `file`: a `File`'s own when omitted; bytes need one */
|
|
53
|
+
filename?: string;
|
|
54
|
+
/** MIME type of `file` (optional: a `File`'s own, else application/octet-stream) */
|
|
26
55
|
mimeType?: string;
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
|
|
56
|
+
/** More files, after `file`, in this order */
|
|
57
|
+
files?: ReadonlyArray<SealFile>;
|
|
58
|
+
/**
|
|
59
|
+
* A folder, file by file under its paths, no ZIP: a `File` of a folder picker (`<input webkitdirectory>`) carries
|
|
60
|
+
* its path, any other file says it (`{ path, file }`).
|
|
61
|
+
*/
|
|
62
|
+
folder?: ReadonlyArray<File | SealFolderFile>;
|
|
63
|
+
/**
|
|
64
|
+
* A password, a key or a text, sealed first as `Secret`: the recipient's page shows it hidden. Read it from the
|
|
65
|
+
* environment or a file, never write it into code. An empty one is refused, and so is one given unset
|
|
66
|
+
* (`secret: process.env.KEY` with no `KEY`).
|
|
67
|
+
*/
|
|
68
|
+
secret?: string | Uint8Array | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Time to live: one of the lifetimes seal.net offers. Omitted, as on seal.net: a secret alone in the seal lives an
|
|
71
|
+
* hour, anything else the longest lifetime.
|
|
72
|
+
*/
|
|
73
|
+
ttl?: TTL;
|
|
74
|
+
/**
|
|
75
|
+
* Optional password (OTP) for download protection. Read it from the environment, never write it into code; an empty
|
|
76
|
+
* one, or one given unset (`otp: process.env.PASSWORD` with no `PASSWORD`), is refused.
|
|
77
|
+
*/
|
|
78
|
+
otp?: string | undefined;
|
|
31
79
|
/** Require NDA signature before download */
|
|
32
80
|
nda?: boolean;
|
|
33
81
|
/** Owner email (required if nda=true) */
|
|
34
82
|
ownerEmail?: string;
|
|
35
|
-
/**
|
|
83
|
+
/**
|
|
84
|
+
* The document the recipient signs for (with `nda`, instead of `message`): sent last, marked as the NDA's. The
|
|
85
|
+
* agreement then reads "NDA document attached: <name> (<size>)", as on seal.net.
|
|
86
|
+
*/
|
|
87
|
+
ndaFile?: SealFile;
|
|
88
|
+
/**
|
|
89
|
+
* A note to the recipient (up to 5000 characters), encrypted inside the seal. With `nda` it is the agreement's
|
|
90
|
+
* text; an NDA with neither it nor `ndaFile` reads "Confidentiality Agreement".
|
|
91
|
+
*/
|
|
36
92
|
message?: string;
|
|
37
|
-
/**
|
|
93
|
+
/**
|
|
94
|
+
* One open. Omitted, as on seal.net: a secret alone in the seal opens once unless `maxOpens` is given.
|
|
95
|
+
*/
|
|
38
96
|
singleUse?: boolean;
|
|
39
|
-
/**
|
|
97
|
+
/** The most opens, 1 to 10; with `singleUse` the seal opens once and this is not sent */
|
|
40
98
|
maxOpens?: number;
|
|
41
|
-
/**
|
|
99
|
+
/**
|
|
100
|
+
* The countries it opens from, two-letter codes in any case (`UK` is written `GB`): the country of the network the
|
|
101
|
+
* recipient opens it from, which a VPN changes. A code that names no country is refused before anything is sent.
|
|
102
|
+
*/
|
|
42
103
|
geoAllowlist?: string[];
|
|
43
104
|
/**
|
|
44
105
|
* The recipient's address (their `keygen().address`): the link opens only
|
|
45
106
|
* with their seed and also lands in their inbox (`inbox()`). Its key must
|
|
46
107
|
* be published (`inbox()` or `keygen` of any SEAL client does it), else
|
|
47
|
-
* nothing is uploaded and `RESOURCE_NOT_FOUND` is thrown.
|
|
108
|
+
* nothing is uploaded and `RESOURCE_NOT_FOUND` is thrown. An empty one is
|
|
109
|
+
* refused, and so is one given unset (`to: process.env.ADDRESS` with no
|
|
110
|
+
* `ADDRESS`).
|
|
48
111
|
*/
|
|
49
|
-
to?: string;
|
|
112
|
+
to?: string | undefined;
|
|
50
113
|
/**
|
|
51
114
|
* The address of a person's SEAL inbox (`pair()`): the seal also lands
|
|
52
115
|
* there, for them to manage and revoke. Best effort: if the inbox has no
|
|
@@ -62,8 +125,8 @@ interface CreateAnonymousSealOptions {
|
|
|
62
125
|
};
|
|
63
126
|
/**
|
|
64
127
|
* Over 1 GB: the tier the person pays for once by card (prices and terms:
|
|
65
|
-
* seal.net/pricing). Needs `onPaymentRequired
|
|
66
|
-
* a
|
|
128
|
+
* seal.net/pricing). Needs `onPaymentRequired`. A lifetime shorter than a
|
|
129
|
+
* day becomes a day, as on seal.net: the seal waits for its payment.
|
|
67
130
|
*/
|
|
68
131
|
tier?: '5gb' | '50gb' | '500gb';
|
|
69
132
|
/**
|
|
@@ -73,11 +136,8 @@ interface CreateAnonymousSealOptions {
|
|
|
73
136
|
* Not paid by then: the seal is revoked and `PAYMENT_REQUIRED` is thrown.
|
|
74
137
|
*/
|
|
75
138
|
onPaymentRequired?: (checkoutUrl: string) => void | Promise<void>;
|
|
76
|
-
/** Progress
|
|
77
|
-
onProgress?: (progress:
|
|
78
|
-
phase: string;
|
|
79
|
-
percent: number;
|
|
80
|
-
}) => void;
|
|
139
|
+
/** Progress of the whole seal, and of the file moving now */
|
|
140
|
+
onProgress?: (progress: SendProgress) => void;
|
|
81
141
|
/** Abort signal */
|
|
82
142
|
signal?: AbortSignal;
|
|
83
143
|
}
|
|
@@ -102,10 +162,15 @@ interface CreateAnonymousSealResult {
|
|
|
102
162
|
ownerToken: string;
|
|
103
163
|
/** Expiration datetime (ISO string) */
|
|
104
164
|
expiresAt: string;
|
|
105
|
-
/** Encryption key (base64) - only returned, never stored */
|
|
165
|
+
/** Encryption key of the seal's first file (base64) - only returned, never stored */
|
|
106
166
|
encryptionKey: string;
|
|
107
|
-
/** File ID */
|
|
167
|
+
/** File ID of the seal's first file */
|
|
108
168
|
fileId: string;
|
|
169
|
+
/** Every file of the seal in the order sent, by the name the recipient sees: a folder's by its path. */
|
|
170
|
+
files: ReadonlyArray<{
|
|
171
|
+
readonly fileId: string;
|
|
172
|
+
readonly name: string;
|
|
173
|
+
}>;
|
|
109
174
|
/** The link is in the recipient's inbox (`to` was given). */
|
|
110
175
|
delivered: boolean;
|
|
111
176
|
/** The seal is in the owner's inbox (`owner` was given and it took it). */
|
|
@@ -137,7 +202,9 @@ type SealErrorCode = 'AUTH_INVALID_KEY' | 'AUTH_EXPIRED_TOKEN' | 'AUTH_INSUFFICI
|
|
|
137
202
|
*
|
|
138
203
|
* When a failure happens AFTER the seal became live on the server, these
|
|
139
204
|
* carry everything needed to manage it — so an interrupted call never
|
|
140
|
-
* leaves a seal nobody can revoke.
|
|
205
|
+
* leaves a seal nobody can revoke. The owner token and the link key are read
|
|
206
|
+
* by the caller and never written out: `JSON.stringify`, `toJSON` and
|
|
207
|
+
* `console.log` of the error or its details leave them out (AUDIT M20).
|
|
141
208
|
*/
|
|
142
209
|
interface SealErrorDetails {
|
|
143
210
|
/** Present when the seal exists remotely despite the failure. */
|
|
@@ -161,8 +228,9 @@ declare class SealError extends Error {
|
|
|
161
228
|
|
|
162
229
|
/**
|
|
163
230
|
* An identity: give `address` to senders (and `bundle` to a request), keep
|
|
164
|
-
* `secretKey` — the
|
|
165
|
-
* of the CLI and the MCP server. `words` name the address to a
|
|
231
|
+
* `secretKey` — the 64-byte seed, 86 base64url characters, the same value as
|
|
232
|
+
* `SEAL_SEED` of the CLI and the MCP server. `words` name the address to a
|
|
233
|
+
* person.
|
|
166
234
|
*/
|
|
167
235
|
interface KeyPair {
|
|
168
236
|
readonly secretKey: string;
|
|
@@ -172,10 +240,10 @@ interface KeyPair {
|
|
|
172
240
|
readonly words: string;
|
|
173
241
|
}
|
|
174
242
|
interface OpenOptions {
|
|
175
|
-
/** Opens a link addressed to this seed
|
|
243
|
+
/** Opens a link addressed to this seed. */
|
|
176
244
|
readonly keyPair?: Pick<KeyPair, 'secretKey'>;
|
|
177
245
|
/** The seal's password, when it has one. */
|
|
178
|
-
readonly password?: string;
|
|
246
|
+
readonly password?: string | undefined;
|
|
179
247
|
readonly signal?: AbortSignal;
|
|
180
248
|
/** Ciphertext bytes received so far, out of the seal's total. */
|
|
181
249
|
readonly onProgress?: (done: number, total: number) => void;
|
|
@@ -231,7 +299,7 @@ interface RequestResult {
|
|
|
231
299
|
readonly intakeId: string;
|
|
232
300
|
/** Give this to the person — or to an MCP client as a URL-mode elicitation. */
|
|
233
301
|
readonly url: string;
|
|
234
|
-
/**
|
|
302
|
+
/** Eight words of your address, one space apart; the page shows the same ones. */
|
|
235
303
|
readonly words: string;
|
|
236
304
|
readonly expiresAt: string;
|
|
237
305
|
}
|
|
@@ -245,7 +313,7 @@ interface PairOptions {
|
|
|
245
313
|
interface PairResult {
|
|
246
314
|
/** Give this to the person: they open it on the device with their SEAL inbox. */
|
|
247
315
|
readonly url: string;
|
|
248
|
-
/**
|
|
316
|
+
/** Eight words of your address, one space apart; the page shows the same ones. */
|
|
249
317
|
readonly words: string;
|
|
250
318
|
readonly expiresAt: string;
|
|
251
319
|
/** Wait until they connect: their inbox's address (use it as `owner`) and name. */
|
|
@@ -257,7 +325,7 @@ interface PairResult {
|
|
|
257
325
|
/** Something sent to your address: open it with `open(item, {keyPair})`. */
|
|
258
326
|
interface InboxItem {
|
|
259
327
|
readonly id: string;
|
|
260
|
-
/**
|
|
328
|
+
/** Eight words of the sender's address when it proved one. */
|
|
261
329
|
readonly fromWords: string | null;
|
|
262
330
|
/** What the sender called itself, in the clear: never content. */
|
|
263
331
|
readonly label: string | null;
|
|
@@ -312,7 +380,7 @@ interface SealClientOptions {
|
|
|
312
380
|
* import { SealClient } from 'sealnet'
|
|
313
381
|
*
|
|
314
382
|
* const seal = new SealClient()
|
|
315
|
-
* const { shareUrl } = await seal.send({ file, filename: 'dump.sql', ttl: '1d' })
|
|
383
|
+
* const { shareUrl } = await seal.send({ file, filename: 'dump.sql', secret: process.env.DB_PASSWORD, ttl: '1d' })
|
|
316
384
|
* const opened = await seal.open(shareUrl, { to: './downloads' }) // Node
|
|
317
385
|
* ```
|
|
318
386
|
*/
|
|
@@ -322,8 +390,10 @@ declare class SealClient {
|
|
|
322
390
|
private readonly site;
|
|
323
391
|
constructor(options?: SealClientOptions);
|
|
324
392
|
/**
|
|
325
|
-
* Encrypt
|
|
326
|
-
*
|
|
393
|
+
* Encrypt files client-side — one or several, a folder file by file under
|
|
394
|
+
* its paths, a secret the recipient's page shows hidden — into one seal,
|
|
395
|
+
* upload the ciphertext, and return the recipient share link plus the
|
|
396
|
+
* owner management material. The rules go as seal.net reads and sends them.
|
|
327
397
|
*
|
|
328
398
|
* `filename` and `mimeType` are what the RECIPIENT sees — they override
|
|
329
399
|
* the name and type of a `File` you pass in.
|
|
@@ -331,11 +401,12 @@ declare class SealClient {
|
|
|
331
401
|
send(options: SendOptions): Promise<SendResult>;
|
|
332
402
|
/**
|
|
333
403
|
* Open a link, or an item of your inbox (with `keyPair`). With `to` (Node)
|
|
334
|
-
* every file is streamed into that directory —
|
|
335
|
-
* header matched the one registered at
|
|
336
|
-
*
|
|
337
|
-
* fails if the file was changed.
|
|
338
|
-
* whatever the size. `keyPair` opens a
|
|
404
|
+
* every file is streamed into that directory — a folder's under its path
|
|
405
|
+
* in it — 0600, named only after its header matched the one registered at
|
|
406
|
+
* upload and its last segment opened. Without it each file is downloaded
|
|
407
|
+
* when you `read()` it, as a stream that fails if the file was changed.
|
|
408
|
+
* Either way memory stays one segment whatever the size. `keyPair` opens a
|
|
409
|
+
* link addressed to your address.
|
|
339
410
|
*/
|
|
340
411
|
open(link: string | InboxItem, options: OpenOptions & {
|
|
341
412
|
to: string;
|
|
@@ -389,4 +460,4 @@ declare class SealClient {
|
|
|
389
460
|
}
|
|
390
461
|
declare const VERSION: string;
|
|
391
462
|
|
|
392
|
-
export { type Inbox, type InboxItem, type InboxOptions, type KeyPair, type OpenOptions, type OpenedSeal, type OpenedSealFile, type PairOptions, type PairResult, type RequestOptions, type RequestResult, type SavedSealFile, SealClient, type SealClientOptions, SealError, type SealErrorCode, type SealErrorDetails, type SendOptions, type SendResult, type TTL, VERSION };
|
|
463
|
+
export { type Inbox, type InboxItem, type InboxOptions, type KeyPair, type OpenOptions, type OpenedSeal, type OpenedSealFile, type PairOptions, type PairResult, type RequestOptions, type RequestResult, type SavedSealFile, SealClient, type SealClientOptions, SealError, type SealErrorCode, type SealErrorDetails, type SealFile, type SealFolderFile, type SealSource, type SendOptions, type SendProgress, type SendResult, type TTL, VERSION };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* What an intake request asks for (SPEC-AGENTS §4.4): `pair` and `device`
|
|
3
3
|
* are the inbox's own (SPEC-ADDRESS F3), answered on box.seal.net.
|
|
4
4
|
*/
|
|
5
|
-
type IntakeKind = 'secret' | 'file' | 'any' | 'pair' | 'device';
|
|
5
|
+
type IntakeKind = 'secret' | 'file' | 'any' | 'pair' | 'device' | 'guard';
|
|
6
6
|
/** A file's plaintext, and what it turned out to be once the stream ended. */
|
|
7
7
|
interface OpenedStream {
|
|
8
8
|
readonly stream: ReadableStream<Uint8Array>;
|
|
@@ -17,36 +17,99 @@ interface OpenedStream {
|
|
|
17
17
|
declare const TTL_OPTIONS: readonly string[];
|
|
18
18
|
/** A seal's lifetime, one of the contract's `ttl_options`. */
|
|
19
19
|
type TTL = (typeof TTL_OPTIONS)[number];
|
|
20
|
+
/**
|
|
21
|
+
* A file's bytes: a `File` or `Blob` (in Node, `fs.openAsBlob(path)` reads one from disk as it goes up), an
|
|
22
|
+
* `ArrayBuffer` or a `Uint8Array`.
|
|
23
|
+
*/
|
|
24
|
+
type SealSource = File | Blob | ArrayBuffer | Uint8Array;
|
|
25
|
+
/** One file of a seal, as the recipient sees it. */
|
|
26
|
+
interface SealFile {
|
|
27
|
+
readonly file: SealSource;
|
|
28
|
+
/** The name the recipient sees: a `File`'s own when omitted; bytes need one. */
|
|
29
|
+
readonly filename?: string;
|
|
30
|
+
/** The type the recipient sees: a `File`'s own when omitted, else `application/octet-stream`. */
|
|
31
|
+
readonly mimeType?: string;
|
|
32
|
+
/** A secret — a key, a password: the recipient's page shows it hidden, a receiving agent saves it and never prints it. */
|
|
33
|
+
readonly secret?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/** One file of a folder: its path in the folder, `/` between folders, is its name in the seal (`docs/q3/report.pdf`). */
|
|
36
|
+
interface SealFolderFile {
|
|
37
|
+
readonly path: string;
|
|
38
|
+
readonly file: SealSource;
|
|
39
|
+
readonly mimeType?: string;
|
|
40
|
+
}
|
|
41
|
+
/** Where a send stands: the whole seal's `percent` (0–100, never back), and the phase and name of the file moving now. */
|
|
42
|
+
interface SendProgress {
|
|
43
|
+
readonly phase: string;
|
|
44
|
+
readonly percent: number;
|
|
45
|
+
readonly fileIndex: number;
|
|
46
|
+
readonly totalFiles: number;
|
|
47
|
+
readonly fileName: string;
|
|
48
|
+
}
|
|
20
49
|
interface CreateAnonymousSealOptions {
|
|
21
|
-
/**
|
|
22
|
-
file
|
|
23
|
-
/**
|
|
24
|
-
filename
|
|
25
|
-
/** MIME type (optional,
|
|
50
|
+
/** One file (File, ArrayBuffer, Uint8Array, or Blob); `files`, `folder` and `secret` add to the same seal */
|
|
51
|
+
file?: SealSource;
|
|
52
|
+
/** The name the recipient sees for `file`: a `File`'s own when omitted; bytes need one */
|
|
53
|
+
filename?: string;
|
|
54
|
+
/** MIME type of `file` (optional: a `File`'s own, else application/octet-stream) */
|
|
26
55
|
mimeType?: string;
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
|
|
56
|
+
/** More files, after `file`, in this order */
|
|
57
|
+
files?: ReadonlyArray<SealFile>;
|
|
58
|
+
/**
|
|
59
|
+
* A folder, file by file under its paths, no ZIP: a `File` of a folder picker (`<input webkitdirectory>`) carries
|
|
60
|
+
* its path, any other file says it (`{ path, file }`).
|
|
61
|
+
*/
|
|
62
|
+
folder?: ReadonlyArray<File | SealFolderFile>;
|
|
63
|
+
/**
|
|
64
|
+
* A password, a key or a text, sealed first as `Secret`: the recipient's page shows it hidden. Read it from the
|
|
65
|
+
* environment or a file, never write it into code. An empty one is refused, and so is one given unset
|
|
66
|
+
* (`secret: process.env.KEY` with no `KEY`).
|
|
67
|
+
*/
|
|
68
|
+
secret?: string | Uint8Array | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Time to live: one of the lifetimes seal.net offers. Omitted, as on seal.net: a secret alone in the seal lives an
|
|
71
|
+
* hour, anything else the longest lifetime.
|
|
72
|
+
*/
|
|
73
|
+
ttl?: TTL;
|
|
74
|
+
/**
|
|
75
|
+
* Optional password (OTP) for download protection. Read it from the environment, never write it into code; an empty
|
|
76
|
+
* one, or one given unset (`otp: process.env.PASSWORD` with no `PASSWORD`), is refused.
|
|
77
|
+
*/
|
|
78
|
+
otp?: string | undefined;
|
|
31
79
|
/** Require NDA signature before download */
|
|
32
80
|
nda?: boolean;
|
|
33
81
|
/** Owner email (required if nda=true) */
|
|
34
82
|
ownerEmail?: string;
|
|
35
|
-
/**
|
|
83
|
+
/**
|
|
84
|
+
* The document the recipient signs for (with `nda`, instead of `message`): sent last, marked as the NDA's. The
|
|
85
|
+
* agreement then reads "NDA document attached: <name> (<size>)", as on seal.net.
|
|
86
|
+
*/
|
|
87
|
+
ndaFile?: SealFile;
|
|
88
|
+
/**
|
|
89
|
+
* A note to the recipient (up to 5000 characters), encrypted inside the seal. With `nda` it is the agreement's
|
|
90
|
+
* text; an NDA with neither it nor `ndaFile` reads "Confidentiality Agreement".
|
|
91
|
+
*/
|
|
36
92
|
message?: string;
|
|
37
|
-
/**
|
|
93
|
+
/**
|
|
94
|
+
* One open. Omitted, as on seal.net: a secret alone in the seal opens once unless `maxOpens` is given.
|
|
95
|
+
*/
|
|
38
96
|
singleUse?: boolean;
|
|
39
|
-
/**
|
|
97
|
+
/** The most opens, 1 to 10; with `singleUse` the seal opens once and this is not sent */
|
|
40
98
|
maxOpens?: number;
|
|
41
|
-
/**
|
|
99
|
+
/**
|
|
100
|
+
* The countries it opens from, two-letter codes in any case (`UK` is written `GB`): the country of the network the
|
|
101
|
+
* recipient opens it from, which a VPN changes. A code that names no country is refused before anything is sent.
|
|
102
|
+
*/
|
|
42
103
|
geoAllowlist?: string[];
|
|
43
104
|
/**
|
|
44
105
|
* The recipient's address (their `keygen().address`): the link opens only
|
|
45
106
|
* with their seed and also lands in their inbox (`inbox()`). Its key must
|
|
46
107
|
* be published (`inbox()` or `keygen` of any SEAL client does it), else
|
|
47
|
-
* nothing is uploaded and `RESOURCE_NOT_FOUND` is thrown.
|
|
108
|
+
* nothing is uploaded and `RESOURCE_NOT_FOUND` is thrown. An empty one is
|
|
109
|
+
* refused, and so is one given unset (`to: process.env.ADDRESS` with no
|
|
110
|
+
* `ADDRESS`).
|
|
48
111
|
*/
|
|
49
|
-
to?: string;
|
|
112
|
+
to?: string | undefined;
|
|
50
113
|
/**
|
|
51
114
|
* The address of a person's SEAL inbox (`pair()`): the seal also lands
|
|
52
115
|
* there, for them to manage and revoke. Best effort: if the inbox has no
|
|
@@ -62,8 +125,8 @@ interface CreateAnonymousSealOptions {
|
|
|
62
125
|
};
|
|
63
126
|
/**
|
|
64
127
|
* Over 1 GB: the tier the person pays for once by card (prices and terms:
|
|
65
|
-
* seal.net/pricing). Needs `onPaymentRequired
|
|
66
|
-
* a
|
|
128
|
+
* seal.net/pricing). Needs `onPaymentRequired`. A lifetime shorter than a
|
|
129
|
+
* day becomes a day, as on seal.net: the seal waits for its payment.
|
|
67
130
|
*/
|
|
68
131
|
tier?: '5gb' | '50gb' | '500gb';
|
|
69
132
|
/**
|
|
@@ -73,11 +136,8 @@ interface CreateAnonymousSealOptions {
|
|
|
73
136
|
* Not paid by then: the seal is revoked and `PAYMENT_REQUIRED` is thrown.
|
|
74
137
|
*/
|
|
75
138
|
onPaymentRequired?: (checkoutUrl: string) => void | Promise<void>;
|
|
76
|
-
/** Progress
|
|
77
|
-
onProgress?: (progress:
|
|
78
|
-
phase: string;
|
|
79
|
-
percent: number;
|
|
80
|
-
}) => void;
|
|
139
|
+
/** Progress of the whole seal, and of the file moving now */
|
|
140
|
+
onProgress?: (progress: SendProgress) => void;
|
|
81
141
|
/** Abort signal */
|
|
82
142
|
signal?: AbortSignal;
|
|
83
143
|
}
|
|
@@ -102,10 +162,15 @@ interface CreateAnonymousSealResult {
|
|
|
102
162
|
ownerToken: string;
|
|
103
163
|
/** Expiration datetime (ISO string) */
|
|
104
164
|
expiresAt: string;
|
|
105
|
-
/** Encryption key (base64) - only returned, never stored */
|
|
165
|
+
/** Encryption key of the seal's first file (base64) - only returned, never stored */
|
|
106
166
|
encryptionKey: string;
|
|
107
|
-
/** File ID */
|
|
167
|
+
/** File ID of the seal's first file */
|
|
108
168
|
fileId: string;
|
|
169
|
+
/** Every file of the seal in the order sent, by the name the recipient sees: a folder's by its path. */
|
|
170
|
+
files: ReadonlyArray<{
|
|
171
|
+
readonly fileId: string;
|
|
172
|
+
readonly name: string;
|
|
173
|
+
}>;
|
|
109
174
|
/** The link is in the recipient's inbox (`to` was given). */
|
|
110
175
|
delivered: boolean;
|
|
111
176
|
/** The seal is in the owner's inbox (`owner` was given and it took it). */
|
|
@@ -137,7 +202,9 @@ type SealErrorCode = 'AUTH_INVALID_KEY' | 'AUTH_EXPIRED_TOKEN' | 'AUTH_INSUFFICI
|
|
|
137
202
|
*
|
|
138
203
|
* When a failure happens AFTER the seal became live on the server, these
|
|
139
204
|
* carry everything needed to manage it — so an interrupted call never
|
|
140
|
-
* leaves a seal nobody can revoke.
|
|
205
|
+
* leaves a seal nobody can revoke. The owner token and the link key are read
|
|
206
|
+
* by the caller and never written out: `JSON.stringify`, `toJSON` and
|
|
207
|
+
* `console.log` of the error or its details leave them out (AUDIT M20).
|
|
141
208
|
*/
|
|
142
209
|
interface SealErrorDetails {
|
|
143
210
|
/** Present when the seal exists remotely despite the failure. */
|
|
@@ -161,8 +228,9 @@ declare class SealError extends Error {
|
|
|
161
228
|
|
|
162
229
|
/**
|
|
163
230
|
* An identity: give `address` to senders (and `bundle` to a request), keep
|
|
164
|
-
* `secretKey` — the
|
|
165
|
-
* of the CLI and the MCP server. `words` name the address to a
|
|
231
|
+
* `secretKey` — the 64-byte seed, 86 base64url characters, the same value as
|
|
232
|
+
* `SEAL_SEED` of the CLI and the MCP server. `words` name the address to a
|
|
233
|
+
* person.
|
|
166
234
|
*/
|
|
167
235
|
interface KeyPair {
|
|
168
236
|
readonly secretKey: string;
|
|
@@ -172,10 +240,10 @@ interface KeyPair {
|
|
|
172
240
|
readonly words: string;
|
|
173
241
|
}
|
|
174
242
|
interface OpenOptions {
|
|
175
|
-
/** Opens a link addressed to this seed
|
|
243
|
+
/** Opens a link addressed to this seed. */
|
|
176
244
|
readonly keyPair?: Pick<KeyPair, 'secretKey'>;
|
|
177
245
|
/** The seal's password, when it has one. */
|
|
178
|
-
readonly password?: string;
|
|
246
|
+
readonly password?: string | undefined;
|
|
179
247
|
readonly signal?: AbortSignal;
|
|
180
248
|
/** Ciphertext bytes received so far, out of the seal's total. */
|
|
181
249
|
readonly onProgress?: (done: number, total: number) => void;
|
|
@@ -231,7 +299,7 @@ interface RequestResult {
|
|
|
231
299
|
readonly intakeId: string;
|
|
232
300
|
/** Give this to the person — or to an MCP client as a URL-mode elicitation. */
|
|
233
301
|
readonly url: string;
|
|
234
|
-
/**
|
|
302
|
+
/** Eight words of your address, one space apart; the page shows the same ones. */
|
|
235
303
|
readonly words: string;
|
|
236
304
|
readonly expiresAt: string;
|
|
237
305
|
}
|
|
@@ -245,7 +313,7 @@ interface PairOptions {
|
|
|
245
313
|
interface PairResult {
|
|
246
314
|
/** Give this to the person: they open it on the device with their SEAL inbox. */
|
|
247
315
|
readonly url: string;
|
|
248
|
-
/**
|
|
316
|
+
/** Eight words of your address, one space apart; the page shows the same ones. */
|
|
249
317
|
readonly words: string;
|
|
250
318
|
readonly expiresAt: string;
|
|
251
319
|
/** Wait until they connect: their inbox's address (use it as `owner`) and name. */
|
|
@@ -257,7 +325,7 @@ interface PairResult {
|
|
|
257
325
|
/** Something sent to your address: open it with `open(item, {keyPair})`. */
|
|
258
326
|
interface InboxItem {
|
|
259
327
|
readonly id: string;
|
|
260
|
-
/**
|
|
328
|
+
/** Eight words of the sender's address when it proved one. */
|
|
261
329
|
readonly fromWords: string | null;
|
|
262
330
|
/** What the sender called itself, in the clear: never content. */
|
|
263
331
|
readonly label: string | null;
|
|
@@ -312,7 +380,7 @@ interface SealClientOptions {
|
|
|
312
380
|
* import { SealClient } from 'sealnet'
|
|
313
381
|
*
|
|
314
382
|
* const seal = new SealClient()
|
|
315
|
-
* const { shareUrl } = await seal.send({ file, filename: 'dump.sql', ttl: '1d' })
|
|
383
|
+
* const { shareUrl } = await seal.send({ file, filename: 'dump.sql', secret: process.env.DB_PASSWORD, ttl: '1d' })
|
|
316
384
|
* const opened = await seal.open(shareUrl, { to: './downloads' }) // Node
|
|
317
385
|
* ```
|
|
318
386
|
*/
|
|
@@ -322,8 +390,10 @@ declare class SealClient {
|
|
|
322
390
|
private readonly site;
|
|
323
391
|
constructor(options?: SealClientOptions);
|
|
324
392
|
/**
|
|
325
|
-
* Encrypt
|
|
326
|
-
*
|
|
393
|
+
* Encrypt files client-side — one or several, a folder file by file under
|
|
394
|
+
* its paths, a secret the recipient's page shows hidden — into one seal,
|
|
395
|
+
* upload the ciphertext, and return the recipient share link plus the
|
|
396
|
+
* owner management material. The rules go as seal.net reads and sends them.
|
|
327
397
|
*
|
|
328
398
|
* `filename` and `mimeType` are what the RECIPIENT sees — they override
|
|
329
399
|
* the name and type of a `File` you pass in.
|
|
@@ -331,11 +401,12 @@ declare class SealClient {
|
|
|
331
401
|
send(options: SendOptions): Promise<SendResult>;
|
|
332
402
|
/**
|
|
333
403
|
* Open a link, or an item of your inbox (with `keyPair`). With `to` (Node)
|
|
334
|
-
* every file is streamed into that directory —
|
|
335
|
-
* header matched the one registered at
|
|
336
|
-
*
|
|
337
|
-
* fails if the file was changed.
|
|
338
|
-
* whatever the size. `keyPair` opens a
|
|
404
|
+
* every file is streamed into that directory — a folder's under its path
|
|
405
|
+
* in it — 0600, named only after its header matched the one registered at
|
|
406
|
+
* upload and its last segment opened. Without it each file is downloaded
|
|
407
|
+
* when you `read()` it, as a stream that fails if the file was changed.
|
|
408
|
+
* Either way memory stays one segment whatever the size. `keyPair` opens a
|
|
409
|
+
* link addressed to your address.
|
|
339
410
|
*/
|
|
340
411
|
open(link: string | InboxItem, options: OpenOptions & {
|
|
341
412
|
to: string;
|
|
@@ -389,4 +460,4 @@ declare class SealClient {
|
|
|
389
460
|
}
|
|
390
461
|
declare const VERSION: string;
|
|
391
462
|
|
|
392
|
-
export { type Inbox, type InboxItem, type InboxOptions, type KeyPair, type OpenOptions, type OpenedSeal, type OpenedSealFile, type PairOptions, type PairResult, type RequestOptions, type RequestResult, type SavedSealFile, SealClient, type SealClientOptions, SealError, type SealErrorCode, type SealErrorDetails, type SendOptions, type SendResult, type TTL, VERSION };
|
|
463
|
+
export { type Inbox, type InboxItem, type InboxOptions, type KeyPair, type OpenOptions, type OpenedSeal, type OpenedSealFile, type PairOptions, type PairResult, type RequestOptions, type RequestResult, type SavedSealFile, SealClient, type SealClientOptions, SealError, type SealErrorCode, type SealErrorDetails, type SealFile, type SealFolderFile, type SealSource, type SendOptions, type SendProgress, type SendResult, type TTL, VERSION };
|