@tinycloud/share-sdk 0.2.0-beta.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/dist/index.cjs +8850 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1147 -0
- package/dist/index.d.ts +1147 -0
- package/dist/index.js +8766 -0
- package/dist/index.js.map +1 -0
- package/package.json +41 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1147 @@
|
|
|
1
|
+
import { ShareEnvelopeV2, ShareEnvelope, ShareAction, ContentSource } from '@tinycloud/share-envelope';
|
|
2
|
+
export { CheckBearerDelegationOptions, DelegationCheckResult, canonicalize, checkBearerDelegation, fromBase64Url, requiredResourceUri, resourceUriCovers, toBase64Url } from '@tinycloud/share-envelope';
|
|
3
|
+
|
|
4
|
+
/** The only interactive boundary exposed by the headless SDK. */
|
|
5
|
+
type ShareAuthorizationMethod = "openkey-device" | "email-claim" | "email-otp";
|
|
6
|
+
interface ShareAuthorizationRequired {
|
|
7
|
+
readonly state: "authorization-required";
|
|
8
|
+
readonly method: ShareAuthorizationMethod;
|
|
9
|
+
/** A browser-safe continuation location. It must never contain a claim secret. */
|
|
10
|
+
readonly continueUrl?: string;
|
|
11
|
+
/** An opaque, short-lived, nonce-bound handle. It is not a bearer credential. */
|
|
12
|
+
readonly resumeToken?: string;
|
|
13
|
+
}
|
|
14
|
+
interface ShareAuthorizationDenied {
|
|
15
|
+
readonly state: "denied";
|
|
16
|
+
readonly reason: "rejected" | "expired" | "revoked" | "unsupported";
|
|
17
|
+
}
|
|
18
|
+
interface ShareAuthorizationReady<T> {
|
|
19
|
+
readonly state: "ready";
|
|
20
|
+
readonly value: T;
|
|
21
|
+
}
|
|
22
|
+
type ShareAuthorizationResult<T> = ShareAuthorizationReady<T> | ShareAuthorizationRequired | ShareAuthorizationDenied;
|
|
23
|
+
interface ShareAuthorizationAdapter<T> {
|
|
24
|
+
begin(input: {
|
|
25
|
+
readonly envelope: ShareEnvelopeV2;
|
|
26
|
+
readonly method: ShareAuthorizationMethod;
|
|
27
|
+
}): Promise<ShareAuthorizationResult<T>>;
|
|
28
|
+
resume(input: {
|
|
29
|
+
readonly envelope: ShareEnvelopeV2;
|
|
30
|
+
readonly method: ShareAuthorizationMethod;
|
|
31
|
+
readonly resumeToken: string;
|
|
32
|
+
readonly proof?: unknown;
|
|
33
|
+
}): Promise<ShareAuthorizationResult<T>>;
|
|
34
|
+
/** Verify the detached node proof against a pinned authority trust bundle. */
|
|
35
|
+
readonly verifyResult?: (input: {
|
|
36
|
+
readonly envelope: ShareEnvelopeV2;
|
|
37
|
+
readonly value: T;
|
|
38
|
+
readonly proof: unknown;
|
|
39
|
+
}) => Promise<boolean>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A node-authorized addressed read. Returning plaintext alone is not an
|
|
43
|
+
* authorization result: the caller must also return the signed response
|
|
44
|
+
* binding and digest that the node produced for that exact share.
|
|
45
|
+
*/
|
|
46
|
+
interface ShareAuthorizedContent {
|
|
47
|
+
readonly bytes: Uint8Array;
|
|
48
|
+
readonly bodyDigest: string;
|
|
49
|
+
readonly contentSourceDigest: string;
|
|
50
|
+
readonly binding: {
|
|
51
|
+
readonly shareId: string;
|
|
52
|
+
readonly delegationCid: string;
|
|
53
|
+
readonly authorityMaterialHandle: string;
|
|
54
|
+
readonly authorityMaterialDigest: string;
|
|
55
|
+
readonly resource: {
|
|
56
|
+
readonly kind: "exact" | "prefix";
|
|
57
|
+
readonly path: string;
|
|
58
|
+
};
|
|
59
|
+
readonly action?: string;
|
|
60
|
+
};
|
|
61
|
+
/** A detached node proof; self-reported bytes and digests are not authorization. */
|
|
62
|
+
readonly proof: unknown;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Start or continue a target authorization without ever guessing a device,
|
|
66
|
+
* claim, or delegation secret. Adapters own their protocol and are expected
|
|
67
|
+
* to bind their resume token to a server challenge and expiry.
|
|
68
|
+
*/
|
|
69
|
+
declare function authorizeShare<T>(input: {
|
|
70
|
+
readonly envelope: ShareEnvelopeV2;
|
|
71
|
+
readonly method: ShareAuthorizationMethod;
|
|
72
|
+
readonly adapter: ShareAuthorizationAdapter<T>;
|
|
73
|
+
readonly resumeToken?: string;
|
|
74
|
+
readonly proof?: unknown;
|
|
75
|
+
}): Promise<ShareAuthorizationResult<T>>;
|
|
76
|
+
declare function authorizationMethodForTarget(target: {
|
|
77
|
+
readonly kind: string;
|
|
78
|
+
}): ShareAuthorizationMethod | undefined;
|
|
79
|
+
|
|
80
|
+
type ShareErrorCode = "invalid-link" | "fetch-failed" | "max-bytes-exceeded" | "cid-mismatch" | "decrypt-failed" | "envelope-invalid" | "origin-mismatch" | "signature-invalid" | "capability-invalid" | "expired" | "unsupported-target" | "authorization-denied" | "content-integrity-failed";
|
|
81
|
+
declare const SHARE_RESULT_VERSION: 1;
|
|
82
|
+
/** Maximum stored-block size accepted by the headless verifier by default. */
|
|
83
|
+
declare const DEFAULT_MAX_SEALED_BLOB_BYTES: number;
|
|
84
|
+
/** Content metadata permits at most 100 MiB of plaintext plus sealed overhead. */
|
|
85
|
+
declare const DEFAULT_MAX_CONTENT_BLOB_BYTES: number;
|
|
86
|
+
declare class ShareReceiveError extends Error {
|
|
87
|
+
readonly code: ShareErrorCode;
|
|
88
|
+
readonly details: {
|
|
89
|
+
readonly expiresAt?: string;
|
|
90
|
+
readonly stage?: "envelope" | "content";
|
|
91
|
+
readonly reason?: "policy-target" | "recipient-did-target" | "prefix-resource";
|
|
92
|
+
} | undefined;
|
|
93
|
+
constructor(code: ShareErrorCode, message: string, details?: {
|
|
94
|
+
readonly expiresAt?: string;
|
|
95
|
+
readonly stage?: "envelope" | "content";
|
|
96
|
+
readonly reason?: "policy-target" | "recipient-did-target" | "prefix-resource";
|
|
97
|
+
});
|
|
98
|
+
/** Machine output is deliberately code-only; diagnostics belong on stderr. */
|
|
99
|
+
toJSON(): ShareErrorInfo;
|
|
100
|
+
}
|
|
101
|
+
interface ShareErrorInfo {
|
|
102
|
+
readonly protocol: "tinycloud-share";
|
|
103
|
+
readonly version: typeof SHARE_RESULT_VERSION;
|
|
104
|
+
readonly error: {
|
|
105
|
+
readonly code: ShareErrorCode;
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/** Convert unknown failures to the redacted public error schema. */
|
|
109
|
+
declare function toShareErrorInfo(error: unknown): ShareErrorInfo;
|
|
110
|
+
interface ShareFetchOptions {
|
|
111
|
+
readonly registryBaseUrl?: string;
|
|
112
|
+
readonly fetchBlob?: (input: {
|
|
113
|
+
readonly origin: string;
|
|
114
|
+
readonly cid: string;
|
|
115
|
+
}) => Promise<Uint8Array>;
|
|
116
|
+
readonly fetchFn?: typeof globalThis.fetch;
|
|
117
|
+
readonly expectedOrigin?: string;
|
|
118
|
+
/** Out-of-band signer trust root for addressed envelopes. */
|
|
119
|
+
readonly trustedSignerDid?: string;
|
|
120
|
+
/**
|
|
121
|
+
* Out-of-band policy authority. The policy bytes carried by an envelope
|
|
122
|
+
* are only a CID-addressed integrity witness; they are never a trust root.
|
|
123
|
+
*/
|
|
124
|
+
readonly trustedPolicyAuthority?: SharePolicyAuthority;
|
|
125
|
+
readonly now?: () => number;
|
|
126
|
+
readonly maxSealedBlobBytes?: number;
|
|
127
|
+
readonly maxContentBlobBytes?: number;
|
|
128
|
+
/** Observability-only hook; the SDK zeroes this authority-bearing buffer. */
|
|
129
|
+
readonly onKeyParsed?: (key32: Uint8Array) => void;
|
|
130
|
+
/** Optional node/OpenKey/email adapter for addressed v2 shares. */
|
|
131
|
+
readonly authorization?: ShareAuthorizationAdapter<ShareAuthorizedContent>;
|
|
132
|
+
readonly authorizationResumeToken?: string;
|
|
133
|
+
readonly authorizationProof?: unknown;
|
|
134
|
+
/** Addressed-only presentation hook. Bearer envelopes and their keys never cross this boundary. */
|
|
135
|
+
readonly onResolvedAddressedEnvelope?: (envelope: ShareEnvelope | ShareEnvelopeV2, cid: string) => void;
|
|
136
|
+
}
|
|
137
|
+
interface SharePolicyEvidence {
|
|
138
|
+
readonly policyCid: string;
|
|
139
|
+
readonly signerDid: string;
|
|
140
|
+
readonly registrationCid: string;
|
|
141
|
+
readonly shareId: string;
|
|
142
|
+
readonly recipientMatcher: unknown;
|
|
143
|
+
readonly target: {
|
|
144
|
+
readonly origin: string;
|
|
145
|
+
readonly nodeAudience: string;
|
|
146
|
+
readonly spaceId: string;
|
|
147
|
+
};
|
|
148
|
+
readonly resource: {
|
|
149
|
+
readonly kind: "exact" | "prefix";
|
|
150
|
+
readonly path: string;
|
|
151
|
+
};
|
|
152
|
+
readonly actions: readonly string[];
|
|
153
|
+
readonly contentSource: unknown;
|
|
154
|
+
readonly contentSourceDigest: string;
|
|
155
|
+
readonly delegationCid: string;
|
|
156
|
+
readonly authorityMaterialHandle: string;
|
|
157
|
+
readonly authorityMaterialDigest: string;
|
|
158
|
+
readonly expiresAt: string;
|
|
159
|
+
}
|
|
160
|
+
interface SharePolicyAuthority {
|
|
161
|
+
resolve(input: {
|
|
162
|
+
readonly policyCid: string;
|
|
163
|
+
readonly envelope: ShareEnvelopeV2;
|
|
164
|
+
}): Promise<SharePolicyEvidence | undefined>;
|
|
165
|
+
}
|
|
166
|
+
interface VerifyBearerEnvelopeOptions {
|
|
167
|
+
readonly expectedOrigin?: string;
|
|
168
|
+
readonly now?: () => number;
|
|
169
|
+
}
|
|
170
|
+
/** Redacted metadata; link keys, delegations, policy bytes, and claims never appear here. */
|
|
171
|
+
interface ShareMetadata {
|
|
172
|
+
readonly protocol: "tinycloud-share";
|
|
173
|
+
readonly version: 1;
|
|
174
|
+
readonly shareId: string;
|
|
175
|
+
readonly origin: string;
|
|
176
|
+
readonly target: {
|
|
177
|
+
readonly kind: "bearer" | "recipientDid" | "email" | "emailDomain";
|
|
178
|
+
readonly origin: string;
|
|
179
|
+
readonly nodeAudience: string;
|
|
180
|
+
readonly spaceId: string;
|
|
181
|
+
};
|
|
182
|
+
readonly resource: {
|
|
183
|
+
readonly kind: "exact" | "prefix";
|
|
184
|
+
readonly path: string;
|
|
185
|
+
};
|
|
186
|
+
readonly actions: readonly string[];
|
|
187
|
+
readonly expiresAt: string;
|
|
188
|
+
readonly display: {
|
|
189
|
+
readonly senderName?: string;
|
|
190
|
+
readonly filename?: string;
|
|
191
|
+
readonly mode?: string;
|
|
192
|
+
};
|
|
193
|
+
readonly content?: {
|
|
194
|
+
readonly cid: string;
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
interface ShareInspection {
|
|
198
|
+
readonly metadata: ShareMetadata;
|
|
199
|
+
readonly link: {
|
|
200
|
+
readonly origin: string;
|
|
201
|
+
readonly cid: string;
|
|
202
|
+
readonly kind: "compact" | "inline";
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
interface ShareReceiveAuthorizationRequired {
|
|
206
|
+
readonly state: "authorization-required";
|
|
207
|
+
readonly method: ShareAuthorizationMethod;
|
|
208
|
+
readonly continueUrl?: string;
|
|
209
|
+
readonly resumeToken?: string;
|
|
210
|
+
}
|
|
211
|
+
interface ShareReceiveResult extends ShareInspection {
|
|
212
|
+
readonly bytes: Uint8Array;
|
|
213
|
+
readonly text?: string;
|
|
214
|
+
}
|
|
215
|
+
type ShareReceiveOutcome = ShareReceiveResult | ShareReceiveAuthorizationRequired;
|
|
216
|
+
/** Verify a decrypted bearer envelope for browser adapters that own transport. */
|
|
217
|
+
declare function verifyBearerEnvelope(envelope: ShareEnvelope, linkOrigin: string, options?: VerifyBearerEnvelopeOptions): Promise<void>;
|
|
218
|
+
declare function inspectShare(link: string, options?: ShareFetchOptions): Promise<ShareInspection>;
|
|
219
|
+
declare function receiveShare(link: string, options?: ShareFetchOptions): Promise<ShareReceiveOutcome>;
|
|
220
|
+
|
|
221
|
+
declare const SHARE_CONTENT_LIMIT: number;
|
|
222
|
+
declare const SHARE_SEALED_OVERHEAD: number;
|
|
223
|
+
declare const SHARE_PUBLISH_RESULT_VERSION: 1;
|
|
224
|
+
declare const DEFAULT_SHARE_LIFETIME_MS: number;
|
|
225
|
+
type SharePublishTarget = {
|
|
226
|
+
readonly kind: "bearer";
|
|
227
|
+
} | {
|
|
228
|
+
readonly kind: "recipientDid";
|
|
229
|
+
readonly did: string;
|
|
230
|
+
} | {
|
|
231
|
+
readonly kind: "email";
|
|
232
|
+
readonly address: string;
|
|
233
|
+
} | {
|
|
234
|
+
readonly kind: "emailDomain";
|
|
235
|
+
readonly domain: string;
|
|
236
|
+
};
|
|
237
|
+
interface ShareUploadInput {
|
|
238
|
+
readonly blob: Uint8Array;
|
|
239
|
+
readonly cid: string;
|
|
240
|
+
readonly deleteAfter: string;
|
|
241
|
+
readonly contentLength: number;
|
|
242
|
+
}
|
|
243
|
+
interface ShareUploadResult {
|
|
244
|
+
readonly cid: string;
|
|
245
|
+
readonly deleteAfter: string;
|
|
246
|
+
}
|
|
247
|
+
type ShareUpload = (input: ShareUploadInput) => Promise<ShareUploadResult>;
|
|
248
|
+
type ShareUploadAuthorization = string | HeadersInit;
|
|
249
|
+
interface SharePublishOptions {
|
|
250
|
+
readonly source: Uint8Array | AsyncIterable<Uint8Array>;
|
|
251
|
+
readonly filename: string;
|
|
252
|
+
readonly mediaType?: string;
|
|
253
|
+
/** Browser Share also publishes binary files; the CLI leaves this false. */
|
|
254
|
+
readonly allowBinary?: boolean;
|
|
255
|
+
readonly target?: SharePublishTarget;
|
|
256
|
+
readonly expiresAt?: Date;
|
|
257
|
+
readonly origin: string;
|
|
258
|
+
readonly nodeAudience?: string;
|
|
259
|
+
readonly spaceId?: string;
|
|
260
|
+
readonly inline?: boolean;
|
|
261
|
+
readonly maxBytes?: number;
|
|
262
|
+
readonly now?: () => number;
|
|
263
|
+
readonly registryBaseUrl?: string;
|
|
264
|
+
readonly fetchFn?: typeof globalThis.fetch;
|
|
265
|
+
/**
|
|
266
|
+
* Signs the complete upload request, including its digest, size, expiry,
|
|
267
|
+
* and session binding. Production callers must provide this or explicitly
|
|
268
|
+
* opt into browser cookie credentials; an unsigned public upload is never
|
|
269
|
+
* attempted.
|
|
270
|
+
*/
|
|
271
|
+
readonly authorizeUpload?: (input: ShareUploadInput) => Promise<ShareUploadAuthorization>;
|
|
272
|
+
/** Origin to which any cookie-bearing upload authorization is scoped. */
|
|
273
|
+
readonly authorizationOrigin?: string;
|
|
274
|
+
readonly credentials?: RequestCredentials;
|
|
275
|
+
/** Test/dev-only escape hatch for a local HTTP registry. */
|
|
276
|
+
readonly allowInsecureRegistry?: boolean;
|
|
277
|
+
/** A hermetic or service-specific uploader can own transport completely. */
|
|
278
|
+
readonly uploadBlob?: ShareUpload;
|
|
279
|
+
}
|
|
280
|
+
interface PublishedShareMetadata {
|
|
281
|
+
readonly protocol: "tinycloud-share";
|
|
282
|
+
readonly version: 1;
|
|
283
|
+
readonly shareId: string;
|
|
284
|
+
readonly origin: string;
|
|
285
|
+
readonly target: {
|
|
286
|
+
readonly kind: "bearer" | "recipientDid" | "email" | "emailDomain";
|
|
287
|
+
readonly origin: string;
|
|
288
|
+
readonly nodeAudience: string;
|
|
289
|
+
readonly spaceId: string;
|
|
290
|
+
};
|
|
291
|
+
readonly resource: {
|
|
292
|
+
readonly kind: "exact" | "prefix";
|
|
293
|
+
readonly path: string;
|
|
294
|
+
};
|
|
295
|
+
readonly actions: readonly string[];
|
|
296
|
+
readonly expiresAt: string;
|
|
297
|
+
readonly display: {
|
|
298
|
+
readonly filename?: string;
|
|
299
|
+
readonly senderName?: string;
|
|
300
|
+
};
|
|
301
|
+
readonly content?: {
|
|
302
|
+
readonly cid: string;
|
|
303
|
+
};
|
|
304
|
+
/** Addressed publication receipts are copied into encrypted history only. */
|
|
305
|
+
readonly recipientMatcher?: {
|
|
306
|
+
readonly kind: "bearer" | "recipientDid" | "exactEmail" | "emailDomain";
|
|
307
|
+
readonly value?: string;
|
|
308
|
+
};
|
|
309
|
+
readonly registrationCid?: string;
|
|
310
|
+
readonly policyCid?: string;
|
|
311
|
+
readonly ownerDelegationCid?: string;
|
|
312
|
+
readonly enforcementDelegationCid?: string;
|
|
313
|
+
readonly ownerDid?: string;
|
|
314
|
+
readonly shareKeyDid?: string;
|
|
315
|
+
readonly enforcerDid?: string;
|
|
316
|
+
readonly envelopeCid?: string;
|
|
317
|
+
readonly shareCid?: string;
|
|
318
|
+
}
|
|
319
|
+
interface PublishedShare {
|
|
320
|
+
readonly protocol: "tinycloud-share";
|
|
321
|
+
readonly version: typeof SHARE_PUBLISH_RESULT_VERSION;
|
|
322
|
+
/** The only authority-bearing value returned by publish. */
|
|
323
|
+
readonly url: string;
|
|
324
|
+
readonly link: {
|
|
325
|
+
readonly kind: "compact" | "inline";
|
|
326
|
+
readonly cid: string;
|
|
327
|
+
};
|
|
328
|
+
readonly metadata: PublishedShareMetadata;
|
|
329
|
+
readonly registryDeleteAfter: string;
|
|
330
|
+
}
|
|
331
|
+
/** Machine-readable output omits the complete bearer capability. */
|
|
332
|
+
declare function redactPublishedShare(result: PublishedShare): Omit<PublishedShare, "url">;
|
|
333
|
+
type SharePublishErrorCode = "invalid-argument" | "unsupported-target" | "upload-auth-required" | "upload-failed" | "max-bytes-exceeded" | "inline-too-large";
|
|
334
|
+
declare class SharePublishError extends Error {
|
|
335
|
+
readonly code: SharePublishErrorCode;
|
|
336
|
+
constructor(code: SharePublishErrorCode, message: string);
|
|
337
|
+
}
|
|
338
|
+
/** Publish a bounded bearer Markdown artifact using the canonical envelope. */
|
|
339
|
+
declare function publishShare(options: SharePublishOptions): Promise<PublishedShare>;
|
|
340
|
+
|
|
341
|
+
interface ParsedAddressedEnvelope {
|
|
342
|
+
readonly envelope: ShareEnvelopeV2;
|
|
343
|
+
readonly policy: Record<string, unknown>;
|
|
344
|
+
readonly policyCid: string;
|
|
345
|
+
}
|
|
346
|
+
/** Parse and bind the signed policy bytes before any holder or node effect. */
|
|
347
|
+
declare function parseAddressedEnvelope(value: unknown): Promise<ParsedAddressedEnvelope>;
|
|
348
|
+
|
|
349
|
+
interface OwnerDelegationReceipt {
|
|
350
|
+
readonly delegationCid: string;
|
|
351
|
+
readonly signedDagCbor: Uint8Array;
|
|
352
|
+
readonly delegation: {
|
|
353
|
+
readonly delegateDID: string;
|
|
354
|
+
readonly spaceId: string;
|
|
355
|
+
readonly path: string;
|
|
356
|
+
readonly actions: readonly string[];
|
|
357
|
+
readonly expiry: Date;
|
|
358
|
+
};
|
|
359
|
+
/** Exact service-scoped capabilities encoded in the signed owner delegation. */
|
|
360
|
+
readonly permissions?: readonly OwnerDelegationPermission[];
|
|
361
|
+
}
|
|
362
|
+
interface OwnerDelegationPermission {
|
|
363
|
+
readonly service: string;
|
|
364
|
+
readonly path: string;
|
|
365
|
+
readonly actions: readonly string[];
|
|
366
|
+
}
|
|
367
|
+
interface CreateOwnerDelegationBase {
|
|
368
|
+
readonly delegateDid: string;
|
|
369
|
+
readonly spaceId: string;
|
|
370
|
+
readonly expiresAt: Date;
|
|
371
|
+
}
|
|
372
|
+
type CreateOwnerDelegationParams = CreateOwnerDelegationBase & ({
|
|
373
|
+
readonly path: string;
|
|
374
|
+
readonly actions: readonly string[];
|
|
375
|
+
readonly permissions?: never;
|
|
376
|
+
} | {
|
|
377
|
+
readonly permissions: readonly OwnerDelegationPermission[];
|
|
378
|
+
readonly path?: never;
|
|
379
|
+
readonly actions?: never;
|
|
380
|
+
});
|
|
381
|
+
declare const MAX_CONTENT_BYTES: number;
|
|
382
|
+
declare const OWNER_SHARE_REGISTRATION_DOMAIN = "xyz.tinycloud.share/policy-registration/v2\0";
|
|
383
|
+
type OwnerShareAction = "tinycloud.kv/get" | "tinycloud.kv/list" | "tinycloud.kv/metadata" | "tinycloud.kv/put";
|
|
384
|
+
interface OwnerShareDecryption {
|
|
385
|
+
readonly networkId: string;
|
|
386
|
+
readonly action: "tinycloud.encryption/decrypt";
|
|
387
|
+
}
|
|
388
|
+
type OwnerShareMatcher = {
|
|
389
|
+
readonly kind: "exactEmail";
|
|
390
|
+
readonly value: string;
|
|
391
|
+
} | {
|
|
392
|
+
readonly kind: "emailDomain";
|
|
393
|
+
readonly value: string;
|
|
394
|
+
} | {
|
|
395
|
+
readonly kind: "recipientDid";
|
|
396
|
+
readonly value: string;
|
|
397
|
+
} | {
|
|
398
|
+
readonly kind: "bearer";
|
|
399
|
+
};
|
|
400
|
+
interface OwnerSharePolicyV2 {
|
|
401
|
+
readonly type: "TinyCloudSharePolicy";
|
|
402
|
+
readonly version: 2;
|
|
403
|
+
readonly shareId: string;
|
|
404
|
+
readonly ownerDid: string;
|
|
405
|
+
readonly shareKeyDid: string;
|
|
406
|
+
readonly recipientMatcher: OwnerShareMatcher;
|
|
407
|
+
readonly target: {
|
|
408
|
+
readonly origin: string;
|
|
409
|
+
readonly nodeAudience: string;
|
|
410
|
+
readonly enforcerDid: string;
|
|
411
|
+
readonly spaceId: string;
|
|
412
|
+
};
|
|
413
|
+
readonly resource: {
|
|
414
|
+
readonly kind: "exact" | "prefix";
|
|
415
|
+
readonly path: string;
|
|
416
|
+
};
|
|
417
|
+
readonly actions: readonly OwnerShareAction[];
|
|
418
|
+
readonly decryption?: OwnerShareDecryption;
|
|
419
|
+
readonly contentSource: {
|
|
420
|
+
readonly kind: "kv";
|
|
421
|
+
readonly space: string;
|
|
422
|
+
readonly path: string;
|
|
423
|
+
readonly action: "tinycloud.kv/get";
|
|
424
|
+
};
|
|
425
|
+
readonly contentSourceDigest: string;
|
|
426
|
+
readonly ownerDelegationCid: string;
|
|
427
|
+
readonly expiresAt: string;
|
|
428
|
+
}
|
|
429
|
+
interface DelegatedShareKey {
|
|
430
|
+
readonly did: string;
|
|
431
|
+
readonly publicKey: Uint8Array;
|
|
432
|
+
readonly extractable: boolean;
|
|
433
|
+
/** The underlying WebCrypto private key handle; private JWK material is never returned. */
|
|
434
|
+
readonly cryptoKey: CryptoKey;
|
|
435
|
+
sign(bytes: Uint8Array): Promise<Uint8Array>;
|
|
436
|
+
clear(): void;
|
|
437
|
+
}
|
|
438
|
+
interface SignedDelegation {
|
|
439
|
+
readonly cid: string;
|
|
440
|
+
readonly dagCbor: string;
|
|
441
|
+
readonly issuerDid: string;
|
|
442
|
+
readonly audienceDid: string;
|
|
443
|
+
readonly facts: Record<string, string | readonly string[]>;
|
|
444
|
+
readonly signature: string;
|
|
445
|
+
}
|
|
446
|
+
interface RegisterOwnerSharePolicyParams {
|
|
447
|
+
readonly policy: {
|
|
448
|
+
readonly bytes: Uint8Array;
|
|
449
|
+
readonly cid: string;
|
|
450
|
+
readonly proof: string;
|
|
451
|
+
};
|
|
452
|
+
readonly ownerDelegation: OwnerDelegationReceipt;
|
|
453
|
+
readonly enforcementDelegation: SignedDelegation;
|
|
454
|
+
readonly contentSourceDigest: string;
|
|
455
|
+
/** The enrolled receipt key from the node trust bundle. */
|
|
456
|
+
readonly nodeProof?: {
|
|
457
|
+
readonly kid: string;
|
|
458
|
+
readonly publicKey: Uint8Array;
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
interface OwnerSharePolicyRegistration {
|
|
462
|
+
readonly registrationCid: string;
|
|
463
|
+
readonly policyCid: string;
|
|
464
|
+
readonly ownerDelegationCid: string;
|
|
465
|
+
readonly enforcementDelegationCid: string;
|
|
466
|
+
readonly ownerDid: string;
|
|
467
|
+
readonly shareKeyDid: string;
|
|
468
|
+
readonly enforcerDid: string;
|
|
469
|
+
readonly shareId: string;
|
|
470
|
+
readonly recipientMatcher: OwnerShareMatcher;
|
|
471
|
+
readonly target: {
|
|
472
|
+
readonly origin: string;
|
|
473
|
+
readonly nodeAudience: string;
|
|
474
|
+
readonly spaceId: string;
|
|
475
|
+
};
|
|
476
|
+
readonly resource: {
|
|
477
|
+
readonly kind: "exact" | "prefix";
|
|
478
|
+
readonly path: string;
|
|
479
|
+
};
|
|
480
|
+
readonly actions: readonly OwnerShareAction[];
|
|
481
|
+
readonly contentSource: {
|
|
482
|
+
readonly kind: "kv";
|
|
483
|
+
readonly space: string;
|
|
484
|
+
readonly path: string;
|
|
485
|
+
readonly action: "tinycloud.kv/get";
|
|
486
|
+
};
|
|
487
|
+
readonly contentSourceDigest: string;
|
|
488
|
+
readonly registeredAt: string;
|
|
489
|
+
readonly expiresAt: string;
|
|
490
|
+
}
|
|
491
|
+
interface OwnerSharePolicyRegistrationReceipt {
|
|
492
|
+
readonly registration: OwnerSharePolicyRegistration;
|
|
493
|
+
readonly proof: {
|
|
494
|
+
readonly alg: "EdDSA";
|
|
495
|
+
readonly kid: string;
|
|
496
|
+
readonly signature: string;
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
declare function createDelegatedShareKey(options: {
|
|
500
|
+
readonly extractable: boolean;
|
|
501
|
+
}): Promise<DelegatedShareKey>;
|
|
502
|
+
/**
|
|
503
|
+
* Rehydrate a signer wrapper around a `DelegatedShareKey`'s private
|
|
504
|
+
* `CryptoKey` handle that was persisted (e.g. via IndexedDB structured
|
|
505
|
+
* clone) and recovered after a reload. `privateKey` must be the same
|
|
506
|
+
* non-extractable Ed25519 `CryptoKey` originally produced by
|
|
507
|
+
* {@link createDelegatedShareKey}.
|
|
508
|
+
*/
|
|
509
|
+
declare function restoreDelegatedShareKey(input: {
|
|
510
|
+
readonly privateKey: CryptoKey;
|
|
511
|
+
readonly publicKey: Uint8Array;
|
|
512
|
+
readonly extractable: boolean;
|
|
513
|
+
}): DelegatedShareKey;
|
|
514
|
+
declare function createPolicyEnforcementDelegation(input: {
|
|
515
|
+
readonly ownerDelegation: OwnerDelegationReceipt;
|
|
516
|
+
readonly shareKey: DelegatedShareKey;
|
|
517
|
+
readonly enforcerDid: string;
|
|
518
|
+
readonly policyCid: string;
|
|
519
|
+
readonly shareId: string;
|
|
520
|
+
readonly spaceId: string;
|
|
521
|
+
readonly nodeAudience: string;
|
|
522
|
+
readonly path: string;
|
|
523
|
+
readonly actions: readonly OwnerShareAction[];
|
|
524
|
+
readonly contentSourceDigest: string;
|
|
525
|
+
readonly expiresAt: string;
|
|
526
|
+
}): Promise<SignedDelegation>;
|
|
527
|
+
declare function canonicalOwnerSharePolicy(policy: OwnerSharePolicyV2): Promise<{
|
|
528
|
+
readonly bytes: Uint8Array;
|
|
529
|
+
readonly cid: string;
|
|
530
|
+
readonly digest: string;
|
|
531
|
+
}>;
|
|
532
|
+
declare function computeOwnerShareRegistrationCid(registration: Omit<OwnerSharePolicyRegistration, "registrationCid">): string;
|
|
533
|
+
declare function validateOwnerSharePolicyRegistration(value: unknown, expected: RegisterOwnerSharePolicyParams): OwnerSharePolicyRegistrationReceipt;
|
|
534
|
+
/** Validate the exact UTF-8 response bytes emitted by the registration route. */
|
|
535
|
+
declare function validateOwnerSharePolicyRegistrationBytes(bytesValue: Uint8Array, expected: RegisterOwnerSharePolicyParams): OwnerSharePolicyRegistrationReceipt;
|
|
536
|
+
|
|
537
|
+
type ShareTarget = SharePublishTarget;
|
|
538
|
+
interface TargetPublishInput {
|
|
539
|
+
readonly source: Uint8Array;
|
|
540
|
+
readonly filename: string;
|
|
541
|
+
/** Additional files for a prefix resource; source remains the first file for compatibility. */
|
|
542
|
+
readonly files?: readonly {
|
|
543
|
+
readonly bytes: Uint8Array;
|
|
544
|
+
readonly filename: string;
|
|
545
|
+
readonly mediaType?: string;
|
|
546
|
+
}[];
|
|
547
|
+
readonly target: Exclude<ShareTarget, {
|
|
548
|
+
readonly kind: "bearer";
|
|
549
|
+
}>;
|
|
550
|
+
readonly expiresAt: Date;
|
|
551
|
+
readonly origin: string;
|
|
552
|
+
readonly mediaType?: string;
|
|
553
|
+
readonly resourceKind?: "exact" | "prefix";
|
|
554
|
+
readonly actions?: readonly ("read" | "list" | "edit")[];
|
|
555
|
+
readonly inline?: boolean;
|
|
556
|
+
readonly upload?: AddressedSharePublishOptions["upload"];
|
|
557
|
+
readonly notify?: boolean;
|
|
558
|
+
}
|
|
559
|
+
type TargetPublishOutcome = PublishedShare | ShareAuthorizationRequired;
|
|
560
|
+
interface TargetPublishAdapter {
|
|
561
|
+
publish(input: TargetPublishInput): Promise<TargetPublishOutcome>;
|
|
562
|
+
}
|
|
563
|
+
declare function normalizeShareTarget(target: ShareTarget): ShareTarget;
|
|
564
|
+
declare function targetAuthorizationMethod(target: ShareTarget): ShareAuthorizationMethod | undefined;
|
|
565
|
+
/** Publish bearer shares locally, and route addressed shares to an authority adapter. */
|
|
566
|
+
declare function publishTargetShare(input: SharePublishOptions & {
|
|
567
|
+
readonly target: ShareTarget;
|
|
568
|
+
readonly notify?: boolean;
|
|
569
|
+
readonly targetAdapter?: TargetPublishAdapter;
|
|
570
|
+
readonly files?: readonly {
|
|
571
|
+
readonly bytes: Uint8Array;
|
|
572
|
+
readonly filename: string;
|
|
573
|
+
readonly mediaType?: string;
|
|
574
|
+
}[];
|
|
575
|
+
readonly resourceKind?: "exact" | "prefix";
|
|
576
|
+
readonly actions?: readonly ("read" | "list" | "edit")[];
|
|
577
|
+
}): Promise<TargetPublishOutcome>;
|
|
578
|
+
|
|
579
|
+
interface AddressedPublishAuthority {
|
|
580
|
+
readonly ownerDid: string;
|
|
581
|
+
createOwnerDelegation(input: CreateOwnerDelegationParams): Promise<OwnerDelegationReceipt>;
|
|
582
|
+
registerOwnerSharePolicy(input: RegisterOwnerSharePolicyParams): Promise<OwnerSharePolicyRegistrationReceipt>;
|
|
583
|
+
}
|
|
584
|
+
interface AddressedSharePublishOptions {
|
|
585
|
+
readonly shareId: string;
|
|
586
|
+
readonly shareOrigin: string;
|
|
587
|
+
readonly nodeOrigin: string;
|
|
588
|
+
readonly nodeAudience: string;
|
|
589
|
+
readonly enforcerDid: string;
|
|
590
|
+
readonly spaceId: string;
|
|
591
|
+
readonly target: Exclude<ShareTarget, {
|
|
592
|
+
readonly kind: "bearer";
|
|
593
|
+
}>;
|
|
594
|
+
readonly resource: {
|
|
595
|
+
readonly kind: "exact" | "prefix";
|
|
596
|
+
readonly path: string;
|
|
597
|
+
};
|
|
598
|
+
readonly actions: readonly ShareAction[];
|
|
599
|
+
readonly policyActions: readonly OwnerShareAction[];
|
|
600
|
+
readonly contentSource: ContentSource;
|
|
601
|
+
readonly contentSourceDigest?: string;
|
|
602
|
+
readonly filename: string;
|
|
603
|
+
readonly mediaType: string;
|
|
604
|
+
readonly byteLength: number;
|
|
605
|
+
readonly artifact?: "html";
|
|
606
|
+
readonly deliveryEmail?: string;
|
|
607
|
+
readonly expiresAt: Date;
|
|
608
|
+
readonly decryption?: OwnerShareDecryption;
|
|
609
|
+
readonly inline?: boolean;
|
|
610
|
+
readonly authority: AddressedPublishAuthority;
|
|
611
|
+
readonly upload: Pick<SharePublishOptions, "registryBaseUrl" | "fetchFn" | "authorizeUpload" | "authorizationOrigin" | "credentials" | "allowInsecureRegistry" | "uploadBlob">;
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* Canonical addressed publisher shared by browser and CLI.
|
|
615
|
+
*
|
|
616
|
+
* Callers own authenticated KV writes and transport. This function alone owns
|
|
617
|
+
* the policy, delegation, outer-authority, signed-envelope, encryption, and
|
|
618
|
+
* link bytes.
|
|
619
|
+
*/
|
|
620
|
+
declare function publishAddressedShare(options: AddressedSharePublishOptions): Promise<PublishedShare>;
|
|
621
|
+
|
|
622
|
+
interface RegisteredPolicyAuthorityOptions {
|
|
623
|
+
readonly nodeProof: {
|
|
624
|
+
readonly kid: string;
|
|
625
|
+
readonly publicKey: Uint8Array;
|
|
626
|
+
};
|
|
627
|
+
readonly expectedTarget: {
|
|
628
|
+
readonly origin: string;
|
|
629
|
+
readonly nodeAudience: string;
|
|
630
|
+
readonly enforcerDid: string;
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* Build a policy authority from an enrolled node receipt key. The encrypted
|
|
635
|
+
* envelope carries the receipt as evidence, but only the separately pinned
|
|
636
|
+
* key can make that evidence authoritative.
|
|
637
|
+
*/
|
|
638
|
+
declare function createRegisteredPolicyAuthority(options: RegisteredPolicyAuthorityOptions): SharePolicyAuthority;
|
|
639
|
+
|
|
640
|
+
interface ShareCacheKey {
|
|
641
|
+
readonly cid: string;
|
|
642
|
+
readonly expiresAt: string;
|
|
643
|
+
}
|
|
644
|
+
interface ShareCacheMetadata {
|
|
645
|
+
readonly contentType: string;
|
|
646
|
+
readonly size: number;
|
|
647
|
+
readonly encrypted: boolean;
|
|
648
|
+
}
|
|
649
|
+
interface ShareCacheEntry {
|
|
650
|
+
readonly key: ShareCacheKey;
|
|
651
|
+
readonly bytes: Uint8Array;
|
|
652
|
+
readonly digest: Uint8Array;
|
|
653
|
+
readonly metadata: ShareCacheMetadata;
|
|
654
|
+
}
|
|
655
|
+
interface ShareCache {
|
|
656
|
+
get(key: ShareCacheKey, now?: Date): Promise<Uint8Array | undefined>;
|
|
657
|
+
/** Retrieve a valid entry without a process-local expiry index. */
|
|
658
|
+
getByCid?(cid: string, now?: Date): Promise<ShareCacheEntry | undefined>;
|
|
659
|
+
set(key: ShareCacheKey, bytes: Uint8Array, metadata: ShareCacheMetadata): Promise<void>;
|
|
660
|
+
delete(key: ShareCacheKey): Promise<void>;
|
|
661
|
+
clear(): Promise<void>;
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
* A deliberately memory-only cache. It stores verified artifact bytes and
|
|
665
|
+
* non-secret metadata only; fragment keys, presentations, sessions, and
|
|
666
|
+
* decrypted content never cross this boundary.
|
|
667
|
+
*/
|
|
668
|
+
declare class MemoryShareCache implements ShareCache {
|
|
669
|
+
private readonly now;
|
|
670
|
+
private readonly entries;
|
|
671
|
+
constructor(now?: () => Date);
|
|
672
|
+
get(key: ShareCacheKey, now?: Date): Promise<Uint8Array | undefined>;
|
|
673
|
+
getByCid(cid: string, now?: Date): Promise<ShareCacheEntry | undefined>;
|
|
674
|
+
set(key: ShareCacheKey, bytes: Uint8Array, metadata: ShareCacheMetadata): Promise<void>;
|
|
675
|
+
delete(key: ShareCacheKey): Promise<void>;
|
|
676
|
+
clear(): Promise<void>;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
/** Matches V2_DELIVERY_DOMAIN in tinycloud-node-server/src/share_v2.rs. */
|
|
680
|
+
declare const SHARE_DELIVERY_AUTHORIZATION_DOMAIN = "xyz.tinycloud.share/delivery-authorization/v2\0";
|
|
681
|
+
/** Exact camelCase mirror of the Rust `V2DeliveryRequest` wire struct. */
|
|
682
|
+
interface ShareDeliveryAuthorizationRequest {
|
|
683
|
+
readonly envelopeCid: string;
|
|
684
|
+
readonly shareCid: string;
|
|
685
|
+
readonly shareId: string;
|
|
686
|
+
readonly registrationCid: string;
|
|
687
|
+
readonly policyCid: string;
|
|
688
|
+
readonly delegationCid: string;
|
|
689
|
+
readonly enforcementDelegationCid: string;
|
|
690
|
+
readonly recipientEmail: string;
|
|
691
|
+
readonly shareUrl: string;
|
|
692
|
+
readonly documentName: string;
|
|
693
|
+
readonly jti: string;
|
|
694
|
+
readonly idempotencyKey: string;
|
|
695
|
+
readonly expiresAt: string;
|
|
696
|
+
readonly requestBodyDigest: string;
|
|
697
|
+
}
|
|
698
|
+
/** Exact mirror of the `authorization` object the Node route signs and returns. */
|
|
699
|
+
interface ShareDeliveryAuthorization {
|
|
700
|
+
readonly type: "TinyCloudShareDeliveryAuthorization";
|
|
701
|
+
readonly version: 2;
|
|
702
|
+
readonly jti: string;
|
|
703
|
+
readonly shareCid: string;
|
|
704
|
+
readonly shareId: string;
|
|
705
|
+
readonly registrationCid: string;
|
|
706
|
+
readonly delegationCid: string;
|
|
707
|
+
readonly enforcementDelegationCid: string;
|
|
708
|
+
readonly envelopeCid: string;
|
|
709
|
+
readonly policyCid: string;
|
|
710
|
+
readonly nodeAudience: string;
|
|
711
|
+
readonly targetOrigin: string;
|
|
712
|
+
/**
|
|
713
|
+
* The OpenCredentials witness this delivery is scoped to, sourced from
|
|
714
|
+
* Node's own trusted credentials origin. Deliberately distinct from
|
|
715
|
+
* `nodeAudience` (the node's own DID) and `returnOrigin` (Share's page
|
|
716
|
+
* origin) — conflating any of these three would let a party impersonate
|
|
717
|
+
* another's audience.
|
|
718
|
+
*/
|
|
719
|
+
readonly openCredentialsAudience: string;
|
|
720
|
+
readonly holder: string;
|
|
721
|
+
readonly recipientMatcher: unknown;
|
|
722
|
+
readonly deliveryEmail: string;
|
|
723
|
+
readonly shareUrl: string;
|
|
724
|
+
readonly returnOrigin: string;
|
|
725
|
+
readonly documentName: string;
|
|
726
|
+
readonly senderDid: string;
|
|
727
|
+
readonly senderTrust: string;
|
|
728
|
+
readonly contentSource: unknown;
|
|
729
|
+
readonly contentSourceDigest: string;
|
|
730
|
+
readonly shareExpiresAt: string;
|
|
731
|
+
readonly issuedAt: string;
|
|
732
|
+
readonly reportAbuseToken: string;
|
|
733
|
+
readonly actions: readonly string[];
|
|
734
|
+
readonly resource: string;
|
|
735
|
+
readonly authorityMaterialHandle: string;
|
|
736
|
+
readonly authorityMaterialDigest: string;
|
|
737
|
+
readonly requestBodyDigest: string;
|
|
738
|
+
readonly idempotencyKey: string;
|
|
739
|
+
readonly expiresAt: string;
|
|
740
|
+
readonly dataAuthority: false;
|
|
741
|
+
}
|
|
742
|
+
interface ShareDeliveryAuthorizationReceipt {
|
|
743
|
+
readonly authorization: ShareDeliveryAuthorization;
|
|
744
|
+
readonly proof: {
|
|
745
|
+
readonly alg: "EdDSA";
|
|
746
|
+
readonly kid: string;
|
|
747
|
+
readonly signature: string;
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
interface ValidateShareDeliveryAuthorizationExpected {
|
|
751
|
+
readonly request: ShareDeliveryAuthorizationRequest;
|
|
752
|
+
/** The enrolled receipt key from the node trust bundle. */
|
|
753
|
+
readonly nodeProof: {
|
|
754
|
+
readonly kid: string;
|
|
755
|
+
readonly publicKey: Uint8Array;
|
|
756
|
+
};
|
|
757
|
+
/**
|
|
758
|
+
* The OpenCredentials witness origin the caller trusts, from the same
|
|
759
|
+
* trust bundle as `nodeProof`. Validated independently of the
|
|
760
|
+
* authorization's own `nodeAudience`/`returnOrigin` fields so a Node that
|
|
761
|
+
* mislabels or omits its credentials origin fails closed here rather than
|
|
762
|
+
* silently inheriting one of those unrelated identities.
|
|
763
|
+
*/
|
|
764
|
+
readonly credentialsAudience: string;
|
|
765
|
+
}
|
|
766
|
+
/**
|
|
767
|
+
* Validate the exact UTF-8 response bytes emitted by
|
|
768
|
+
* `POST /share/v2/deliveries/authorize`, bind them to the submitted
|
|
769
|
+
* request, and verify the Node's detached EdDSA proof.
|
|
770
|
+
*/
|
|
771
|
+
declare function validateShareDeliveryAuthorizationBytes(bytesValue: Uint8Array, expected: ValidateShareDeliveryAuthorizationExpected): ShareDeliveryAuthorizationReceipt;
|
|
772
|
+
/** Build the trusted-signer descriptor `did:key:...#z...` expects from a raw node signing key. */
|
|
773
|
+
declare function shareDeliveryTrustedKid(publicKey: Uint8Array): string;
|
|
774
|
+
|
|
775
|
+
interface EncryptedShareHistoryStorage {
|
|
776
|
+
put(value: Uint8Array): Promise<void>;
|
|
777
|
+
list(): Promise<readonly Uint8Array[]>;
|
|
778
|
+
clear(): Promise<void>;
|
|
779
|
+
}
|
|
780
|
+
declare class MemoryEncryptedShareHistoryStorage implements EncryptedShareHistoryStorage {
|
|
781
|
+
private readonly values;
|
|
782
|
+
put(value: Uint8Array): Promise<void>;
|
|
783
|
+
list(): Promise<readonly Uint8Array[]>;
|
|
784
|
+
clear(): Promise<void>;
|
|
785
|
+
}
|
|
786
|
+
/**
|
|
787
|
+
* The durable record a sender needs, after a reload, to display and manage
|
|
788
|
+
* a share it created. Every identity/CID here comes verbatim from the
|
|
789
|
+
* Node-verified {@link OwnerSharePolicyRegistrationReceipt}; nothing is
|
|
790
|
+
* re-derived or guessed.
|
|
791
|
+
*/
|
|
792
|
+
interface SenderShareRecord {
|
|
793
|
+
readonly shareId: string;
|
|
794
|
+
readonly registrationCid?: string;
|
|
795
|
+
readonly policyCid?: string;
|
|
796
|
+
readonly ownerDelegationCid?: string;
|
|
797
|
+
readonly enforcementDelegationCid?: string;
|
|
798
|
+
readonly shareKeyDid?: string;
|
|
799
|
+
readonly ownerDid?: string;
|
|
800
|
+
readonly enforcerDid?: string;
|
|
801
|
+
readonly target: {
|
|
802
|
+
readonly origin: string;
|
|
803
|
+
readonly nodeAudience: string;
|
|
804
|
+
readonly spaceId: string;
|
|
805
|
+
};
|
|
806
|
+
readonly resource: {
|
|
807
|
+
readonly kind: "exact" | "prefix";
|
|
808
|
+
readonly path: string;
|
|
809
|
+
};
|
|
810
|
+
readonly actions: readonly OwnerShareAction[];
|
|
811
|
+
readonly recipientMatcher: OwnerShareMatcher;
|
|
812
|
+
/** The signed target discriminator, retained separately from the email matcher. */
|
|
813
|
+
readonly targetKind?: "bearer" | "recipientDid" | "email" | "emailDomain";
|
|
814
|
+
readonly registeredAt: string;
|
|
815
|
+
readonly expiresAt: string;
|
|
816
|
+
readonly revokedAt?: string;
|
|
817
|
+
readonly envelopeCid?: string;
|
|
818
|
+
readonly shareCid?: string;
|
|
819
|
+
/** Complete bearer links are encrypted at rest and only revealed explicitly. */
|
|
820
|
+
readonly link?: string;
|
|
821
|
+
readonly filename?: string;
|
|
822
|
+
}
|
|
823
|
+
/** Create the durable encrypted-history shape from canonical publication receipts. */
|
|
824
|
+
declare function historyRecordForPublishedShare(result: PublishedShare, now?: Date): SenderShareRecord;
|
|
825
|
+
/**
|
|
826
|
+
* "direct" revokes only this share's enforcement delegation. "ancestor"
|
|
827
|
+
* revokes the owner delegation the share descends from, which transitively
|
|
828
|
+
* denies every share built on it (see `revocation_in_ancestry` in
|
|
829
|
+
* `tinycloud-node-server/src/share_v2.rs`). Both are existing CIDs that a
|
|
830
|
+
* caller passes to the node's generic `tinycloud.delegation/revoke`
|
|
831
|
+
* invocation (`DelegationManager.revoke` / `TinyCloudNode.revokeDelegation`)
|
|
832
|
+
* -- there is no share-v2-specific revoke route.
|
|
833
|
+
*/
|
|
834
|
+
type SenderShareRevocationScope = "direct" | "ancestor";
|
|
835
|
+
interface SenderShareRecordStorage {
|
|
836
|
+
put(record: SenderShareRecord): Promise<void>;
|
|
837
|
+
list(): Promise<readonly SenderShareRecord[]>;
|
|
838
|
+
get(shareId: string): Promise<SenderShareRecord | undefined>;
|
|
839
|
+
delete(shareId: string): Promise<void>;
|
|
840
|
+
}
|
|
841
|
+
interface StoredSenderShareKey {
|
|
842
|
+
readonly cryptoKey: CryptoKey;
|
|
843
|
+
readonly publicKey: Uint8Array;
|
|
844
|
+
readonly extractable: boolean;
|
|
845
|
+
}
|
|
846
|
+
interface SenderShareKeyStorage {
|
|
847
|
+
put(shareId: string, key: StoredSenderShareKey): Promise<void>;
|
|
848
|
+
get(shareId: string): Promise<StoredSenderShareKey | undefined>;
|
|
849
|
+
delete(shareId: string): Promise<void>;
|
|
850
|
+
}
|
|
851
|
+
/** In-memory reference implementation. Real deployments back these with IndexedDB so the non-extractable `CryptoKey` survives a reload via structured clone. */
|
|
852
|
+
declare class MemorySenderShareRecordStorage implements SenderShareRecordStorage {
|
|
853
|
+
private readonly records;
|
|
854
|
+
put(record: SenderShareRecord): Promise<void>;
|
|
855
|
+
list(): Promise<readonly SenderShareRecord[]>;
|
|
856
|
+
get(shareId: string): Promise<SenderShareRecord | undefined>;
|
|
857
|
+
delete(shareId: string): Promise<void>;
|
|
858
|
+
}
|
|
859
|
+
declare class MemorySenderShareKeyStorage implements SenderShareKeyStorage {
|
|
860
|
+
private readonly keys;
|
|
861
|
+
put(shareId: string, key: StoredSenderShareKey): Promise<void>;
|
|
862
|
+
get(shareId: string): Promise<StoredSenderShareKey | undefined>;
|
|
863
|
+
delete(shareId: string): Promise<void>;
|
|
864
|
+
}
|
|
865
|
+
interface SenderShareStoreOptions {
|
|
866
|
+
readonly records: SenderShareRecordStorage;
|
|
867
|
+
readonly keys: SenderShareKeyStorage;
|
|
868
|
+
readonly now?: () => Date;
|
|
869
|
+
}
|
|
870
|
+
/**
|
|
871
|
+
* Reload-safe sender-side management for shares created through
|
|
872
|
+
* {@link canonicalOwnerSharePolicy} / `registerOwnerSharePolicy`. Persists
|
|
873
|
+
* the registration receipt's canonical identity tuple plus the ephemeral
|
|
874
|
+
* share key's non-extractable `CryptoKey` handle, so a sender can list,
|
|
875
|
+
* inspect, and revoke shares it created in an earlier session -- without
|
|
876
|
+
* ever re-exporting private key material.
|
|
877
|
+
*/
|
|
878
|
+
declare class SenderShareStore {
|
|
879
|
+
private readonly records;
|
|
880
|
+
private readonly keys;
|
|
881
|
+
private readonly now;
|
|
882
|
+
constructor(options: SenderShareStoreOptions);
|
|
883
|
+
/** Persist a Node-verified registration receipt and its share key handle. */
|
|
884
|
+
save(receipt: OwnerSharePolicyRegistrationReceipt, key: DelegatedShareKey): Promise<SenderShareRecord>;
|
|
885
|
+
/** List shares created in any session, most recent first. */
|
|
886
|
+
list(options?: {
|
|
887
|
+
readonly includeRevoked?: boolean;
|
|
888
|
+
readonly includeExpired?: boolean;
|
|
889
|
+
}): Promise<readonly SenderShareRecord[]>;
|
|
890
|
+
get(shareId: string): Promise<SenderShareRecord | undefined>;
|
|
891
|
+
/** Recover a signer for the persisted share key after a reload. */
|
|
892
|
+
loadKey(shareId: string): Promise<DelegatedShareKey | undefined>;
|
|
893
|
+
/**
|
|
894
|
+
* The delegation CID to pass to the node's existing generic
|
|
895
|
+
* `tinycloud.delegation/revoke` invocation to revoke this share at the
|
|
896
|
+
* requested scope. Does not itself call the node -- callers invoke
|
|
897
|
+
* their own `revokeDelegation`/`DelegationManager.revoke` with the
|
|
898
|
+
* returned CID, then call {@link markRevoked} once that succeeds.
|
|
899
|
+
*/
|
|
900
|
+
revocationTarget(shareId: string, scope: SenderShareRevocationScope): Promise<string>;
|
|
901
|
+
/** Mark a share revoked locally after the caller's node-side revoke call succeeds. */
|
|
902
|
+
markRevoked(shareId: string, revokedAt?: string): Promise<SenderShareRecord>;
|
|
903
|
+
/** Forget a share and clear its persisted key handle. */
|
|
904
|
+
remove(shareId: string): Promise<void>;
|
|
905
|
+
}
|
|
906
|
+
/** WebCrypto-backed persistence adapter; links and private material are absent. */
|
|
907
|
+
declare class EncryptedSenderShareHistory {
|
|
908
|
+
private readonly storage;
|
|
909
|
+
private readonly key;
|
|
910
|
+
private readonly now;
|
|
911
|
+
constructor(storage: EncryptedShareHistoryStorage, key: CryptoKey, now?: () => Date);
|
|
912
|
+
put(record: SenderShareRecord): Promise<void>;
|
|
913
|
+
list(): Promise<readonly SenderShareRecord[]>;
|
|
914
|
+
clear(): Promise<void>;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
type ShareNotifyState = "delivered" | "already-delivered" | "partial-failure";
|
|
918
|
+
interface ShareNotifyResult {
|
|
919
|
+
readonly protocol: "tinycloud-share";
|
|
920
|
+
readonly version: 1;
|
|
921
|
+
readonly shareId: string;
|
|
922
|
+
readonly state: ShareNotifyState;
|
|
923
|
+
readonly idempotencyKey: string;
|
|
924
|
+
readonly attempts: number;
|
|
925
|
+
readonly retryable?: boolean;
|
|
926
|
+
}
|
|
927
|
+
interface ShareNotifyInput {
|
|
928
|
+
readonly shareId: string;
|
|
929
|
+
readonly recipient: string;
|
|
930
|
+
readonly record?: SenderShareRecord;
|
|
931
|
+
readonly idempotencyKey?: string;
|
|
932
|
+
readonly signal?: AbortSignal;
|
|
933
|
+
}
|
|
934
|
+
interface ShareDeliveryAdapter {
|
|
935
|
+
/** The server must deduplicate this key before any message is sent. */
|
|
936
|
+
deliver(input: ShareNotifyInput): Promise<"delivered" | "already-delivered">;
|
|
937
|
+
}
|
|
938
|
+
declare class ShareNotifyError extends Error {
|
|
939
|
+
readonly code: "delivery-failed";
|
|
940
|
+
constructor(message?: string);
|
|
941
|
+
}
|
|
942
|
+
/** Match a delivery address against the recipient constraint recorded when the share was created. */
|
|
943
|
+
declare function recipientMatchesShareRecord(record: SenderShareRecord, recipient: string): boolean;
|
|
944
|
+
/**
|
|
945
|
+
* Delivery is deliberately separate from publication. A failed notification
|
|
946
|
+
* never causes a second envelope or link to be minted.
|
|
947
|
+
*/
|
|
948
|
+
declare function notifyShare(input: {
|
|
949
|
+
readonly shareId: string;
|
|
950
|
+
readonly recipient: string;
|
|
951
|
+
readonly record?: SenderShareRecord;
|
|
952
|
+
readonly adapter: ShareDeliveryAdapter;
|
|
953
|
+
readonly idempotencyKey?: string;
|
|
954
|
+
readonly maxAttempts?: number;
|
|
955
|
+
readonly signal?: AbortSignal;
|
|
956
|
+
}): Promise<ShareNotifyResult>;
|
|
957
|
+
|
|
958
|
+
type ShareRevocationResult = {
|
|
959
|
+
readonly state: "revoked";
|
|
960
|
+
readonly target: "recipientDid" | "email" | "emailDomain";
|
|
961
|
+
readonly delegationCid: string;
|
|
962
|
+
readonly revokedAt: string;
|
|
963
|
+
} | {
|
|
964
|
+
readonly state: "retention-only";
|
|
965
|
+
readonly target: "bearer";
|
|
966
|
+
readonly reason: "bearer-capability-cannot-be-revoked";
|
|
967
|
+
} | {
|
|
968
|
+
readonly state: "unsupported";
|
|
969
|
+
readonly target: string;
|
|
970
|
+
readonly reason: string;
|
|
971
|
+
readonly code: "unsupported-target";
|
|
972
|
+
};
|
|
973
|
+
interface ShareRevocationAdapter {
|
|
974
|
+
revokeDelegation(input: {
|
|
975
|
+
readonly delegationCid: string;
|
|
976
|
+
readonly scope: "direct" | "ancestor";
|
|
977
|
+
}): Promise<void>;
|
|
978
|
+
}
|
|
979
|
+
/** Report retention for bearer shares; only node-enforced targets are revokeable. */
|
|
980
|
+
declare function revokeShare(input: {
|
|
981
|
+
readonly record: SenderShareRecord;
|
|
982
|
+
/** Optional durable store; successful revocation is persisted before return. */
|
|
983
|
+
readonly records?: SenderShareRecordStorage;
|
|
984
|
+
readonly adapter?: ShareRevocationAdapter;
|
|
985
|
+
readonly scope?: "direct" | "ancestor";
|
|
986
|
+
readonly now?: () => Date;
|
|
987
|
+
}): Promise<ShareRevocationResult>;
|
|
988
|
+
interface ShareHistoryView {
|
|
989
|
+
readonly shareId: string;
|
|
990
|
+
readonly target: string;
|
|
991
|
+
readonly recipient?: string;
|
|
992
|
+
readonly expiresAt: string;
|
|
993
|
+
readonly revoked: boolean;
|
|
994
|
+
readonly link?: string;
|
|
995
|
+
}
|
|
996
|
+
declare function listShares(storage: SenderShareRecordStorage): Promise<readonly ShareHistoryView[]>;
|
|
997
|
+
declare function showShare(input: {
|
|
998
|
+
readonly storage: SenderShareRecordStorage;
|
|
999
|
+
readonly shareId: string;
|
|
1000
|
+
readonly revealLink?: boolean;
|
|
1001
|
+
readonly link?: string;
|
|
1002
|
+
}): Promise<ShareHistoryView>;
|
|
1003
|
+
|
|
1004
|
+
interface LegacyShareReader<T> {
|
|
1005
|
+
read(link: string): Promise<T>;
|
|
1006
|
+
}
|
|
1007
|
+
interface LegacyMigrationResult<T> {
|
|
1008
|
+
readonly protocol: "tinycloud-share";
|
|
1009
|
+
readonly version: 1;
|
|
1010
|
+
readonly legacy: true;
|
|
1011
|
+
readonly migrated: PublishedShare;
|
|
1012
|
+
readonly value: T;
|
|
1013
|
+
}
|
|
1014
|
+
declare function isLegacyShareLink(value: string): boolean;
|
|
1015
|
+
/** Modern commands never call this function implicitly. */
|
|
1016
|
+
declare function receiveLegacyShare<T>(link: string, reader: LegacyShareReader<T>): Promise<T>;
|
|
1017
|
+
/** Read tc1, then explicitly re-mint through the modern publisher. */
|
|
1018
|
+
declare function migrateShare<T>(input: {
|
|
1019
|
+
readonly link: string;
|
|
1020
|
+
readonly reader: LegacyShareReader<T>;
|
|
1021
|
+
readonly publish: (value: T) => Promise<PublishedShare>;
|
|
1022
|
+
}): Promise<LegacyMigrationResult<T>>;
|
|
1023
|
+
|
|
1024
|
+
interface ShareNodeTrust {
|
|
1025
|
+
readonly invitationKid: string;
|
|
1026
|
+
readonly invitationPublicKey: Uint8Array;
|
|
1027
|
+
}
|
|
1028
|
+
interface SharePresentationMaterial {
|
|
1029
|
+
readonly holderDid: string;
|
|
1030
|
+
readonly credential: string;
|
|
1031
|
+
readonly credentialDigest?: string;
|
|
1032
|
+
readonly holderBinding: Record<string, unknown>;
|
|
1033
|
+
readonly proof: Record<string, unknown>;
|
|
1034
|
+
readonly sign?: (bytes: Uint8Array) => Promise<Uint8Array>;
|
|
1035
|
+
readonly email?: string;
|
|
1036
|
+
}
|
|
1037
|
+
interface SharePolicyChallenge {
|
|
1038
|
+
readonly challengeId: string;
|
|
1039
|
+
readonly nonce: string;
|
|
1040
|
+
readonly expiresAt: string;
|
|
1041
|
+
readonly enforcerDid?: string;
|
|
1042
|
+
readonly action: string;
|
|
1043
|
+
readonly requestBodyDigest: string;
|
|
1044
|
+
readonly [key: string]: unknown;
|
|
1045
|
+
}
|
|
1046
|
+
interface ShareRecipientClientOptions {
|
|
1047
|
+
readonly nodeOrigin: string;
|
|
1048
|
+
readonly trustedNode: ShareNodeTrust;
|
|
1049
|
+
readonly holderDid: string;
|
|
1050
|
+
readonly envelope: ShareEnvelopeV2;
|
|
1051
|
+
readonly fetchFn?: typeof fetch;
|
|
1052
|
+
readonly buildPresentation?: (input: {
|
|
1053
|
+
readonly challenge: SharePolicyChallenge;
|
|
1054
|
+
readonly envelope: ShareEnvelopeV2;
|
|
1055
|
+
readonly policy: Record<string, unknown>;
|
|
1056
|
+
}) => Promise<SharePresentationMaterial>;
|
|
1057
|
+
readonly sign?: (bytes: Uint8Array) => Promise<Uint8Array>;
|
|
1058
|
+
}
|
|
1059
|
+
interface SharePolicySession {
|
|
1060
|
+
readonly sessionId: string;
|
|
1061
|
+
readonly expiresAt: string;
|
|
1062
|
+
readonly actions: readonly ("read" | "list" | "edit")[];
|
|
1063
|
+
readonly resource: {
|
|
1064
|
+
readonly kind: "exact" | "prefix";
|
|
1065
|
+
readonly path: string;
|
|
1066
|
+
};
|
|
1067
|
+
}
|
|
1068
|
+
declare class ShareRecipientClient {
|
|
1069
|
+
private readonly options;
|
|
1070
|
+
private readonly fetchFn;
|
|
1071
|
+
private session;
|
|
1072
|
+
private signer;
|
|
1073
|
+
private holderProof;
|
|
1074
|
+
constructor(options: ShareRecipientClientOptions);
|
|
1075
|
+
beginChallenge(envelope: ShareEnvelopeV2): Promise<SharePolicyChallenge>;
|
|
1076
|
+
private establish;
|
|
1077
|
+
authorize(envelope: ShareEnvelopeV2): Promise<ShareAuthorizedContent>;
|
|
1078
|
+
establishPolicySession(): Promise<SharePolicySession>;
|
|
1079
|
+
resumeWithProof(envelope: ShareEnvelopeV2, resumeToken: string, proof: unknown): Promise<ShareAuthorizedContent>;
|
|
1080
|
+
nativeInvoke(request: {
|
|
1081
|
+
readonly action: string;
|
|
1082
|
+
readonly resource?: Record<string, unknown>;
|
|
1083
|
+
readonly body?: number[];
|
|
1084
|
+
readonly bodyDigest?: number[];
|
|
1085
|
+
readonly ifMatch?: string;
|
|
1086
|
+
readonly contentType?: string;
|
|
1087
|
+
}): Promise<Response>;
|
|
1088
|
+
}
|
|
1089
|
+
declare function createAddressedAuthorization(input: Omit<ShareRecipientClientOptions, "envelope">): ShareAuthorizationAdapter<ShareAuthorizedContent>;
|
|
1090
|
+
|
|
1091
|
+
declare const SHARE_V2_PROTOCOL: Readonly<{
|
|
1092
|
+
readonly challengeDomain: "xyz.tinycloud.share/policy-challenge/v2\0";
|
|
1093
|
+
readonly sessionDomain: "xyz.tinycloud.share/policy-session/v2\0";
|
|
1094
|
+
readonly invocationDomain: "xyz.tinycloud.share/invocation/v2\0";
|
|
1095
|
+
readonly readResponseDomain: "xyz.tinycloud.share/read-response/v2\0";
|
|
1096
|
+
readonly holderBindingDomain: "xyz.tinycloud.share/email-claim-holder-binding/v1\0";
|
|
1097
|
+
readonly holderBindingName: "holderBinding";
|
|
1098
|
+
readonly holderBindingType: "TinyCloudEmailClaimHolderBinding";
|
|
1099
|
+
readonly holderBindingVersion: 1;
|
|
1100
|
+
}>;
|
|
1101
|
+
declare function createShareV2HolderBindingArtifact(input: {
|
|
1102
|
+
readonly holderDid: string;
|
|
1103
|
+
readonly message: Record<string, unknown>;
|
|
1104
|
+
readonly sign: (bytes: Uint8Array) => Promise<Uint8Array>;
|
|
1105
|
+
}): Promise<Record<string, unknown>>;
|
|
1106
|
+
|
|
1107
|
+
interface SharePolicyPublishAdapter<TPublishOutcome = TargetPublishOutcome> {
|
|
1108
|
+
publishPolicy(input: TargetPublishInput & {
|
|
1109
|
+
readonly notify: boolean;
|
|
1110
|
+
}): Promise<TPublishOutcome>;
|
|
1111
|
+
claim(input: {
|
|
1112
|
+
readonly envelope: ShareEnvelopeV2;
|
|
1113
|
+
readonly method: "email-claim" | "email-otp";
|
|
1114
|
+
readonly resumeToken?: string;
|
|
1115
|
+
readonly proof?: unknown;
|
|
1116
|
+
}): Promise<ShareAuthorizationResult<unknown>>;
|
|
1117
|
+
}
|
|
1118
|
+
/** Canonical exact-email/domain publication seam shared by web and CLI. */
|
|
1119
|
+
declare function publishPolicyShare<TPublishOutcome = TargetPublishOutcome>(input: {
|
|
1120
|
+
readonly source: Uint8Array;
|
|
1121
|
+
readonly filename: string;
|
|
1122
|
+
readonly target: Extract<ShareTarget, {
|
|
1123
|
+
readonly kind: "email" | "emailDomain";
|
|
1124
|
+
}>;
|
|
1125
|
+
readonly expiresAt: Date;
|
|
1126
|
+
readonly origin: string;
|
|
1127
|
+
readonly notify?: boolean;
|
|
1128
|
+
readonly adapter: SharePolicyPublishAdapter<TPublishOutcome>;
|
|
1129
|
+
}): Promise<TPublishOutcome>;
|
|
1130
|
+
/** Claim, OTP, or resume a policy share without exposing mailbox material. */
|
|
1131
|
+
declare function claimShare(input: {
|
|
1132
|
+
readonly envelope: ShareEnvelopeV2;
|
|
1133
|
+
readonly adapter: SharePolicyPublishAdapter;
|
|
1134
|
+
readonly method?: "email-claim" | "email-otp";
|
|
1135
|
+
readonly resumeToken?: string;
|
|
1136
|
+
readonly proof?: unknown;
|
|
1137
|
+
}): Promise<ShareAuthorizationResult<unknown>>;
|
|
1138
|
+
/** Explicit name for noninteractive callers resuming a previously returned step. */
|
|
1139
|
+
declare function resumeShareAuthorization<T>(input: {
|
|
1140
|
+
readonly envelope: ShareEnvelopeV2;
|
|
1141
|
+
readonly method: "openkey-device" | "email-claim" | "email-otp";
|
|
1142
|
+
readonly resumeToken: string;
|
|
1143
|
+
readonly proof?: unknown;
|
|
1144
|
+
readonly adapter: ShareAuthorizationAdapter<T>;
|
|
1145
|
+
}): Promise<ShareAuthorizationResult<T>>;
|
|
1146
|
+
|
|
1147
|
+
export { type AddressedPublishAuthority, type AddressedSharePublishOptions, type CreateOwnerDelegationParams, DEFAULT_MAX_CONTENT_BLOB_BYTES, DEFAULT_MAX_SEALED_BLOB_BYTES, DEFAULT_SHARE_LIFETIME_MS, type DelegatedShareKey, EncryptedSenderShareHistory, type EncryptedShareHistoryStorage, type LegacyMigrationResult, type LegacyShareReader, MAX_CONTENT_BYTES, MemoryEncryptedShareHistoryStorage, MemorySenderShareKeyStorage, MemorySenderShareRecordStorage, MemoryShareCache, OWNER_SHARE_REGISTRATION_DOMAIN, type OwnerDelegationPermission, type OwnerDelegationReceipt, type OwnerShareAction, type OwnerShareDecryption, type OwnerShareMatcher, type OwnerSharePolicyRegistration, type OwnerSharePolicyRegistrationReceipt, type OwnerSharePolicyV2, type ParsedAddressedEnvelope, type PublishedShare, type PublishedShareMetadata, type RegisterOwnerSharePolicyParams, type RegisteredPolicyAuthorityOptions, SHARE_CONTENT_LIMIT, SHARE_DELIVERY_AUTHORIZATION_DOMAIN, SHARE_PUBLISH_RESULT_VERSION, SHARE_RESULT_VERSION, SHARE_SEALED_OVERHEAD, SHARE_V2_PROTOCOL, type SenderShareKeyStorage, type SenderShareRecord, type SenderShareRecordStorage, type SenderShareRevocationScope, SenderShareStore, type ShareAuthorizationAdapter, type ShareAuthorizationDenied, type ShareAuthorizationMethod, type ShareAuthorizationReady, type ShareAuthorizationRequired, type ShareAuthorizationResult, type ShareAuthorizedContent, type ShareCache, type ShareCacheEntry, type ShareCacheKey, type ShareCacheMetadata, type ShareDeliveryAdapter, type ShareDeliveryAuthorization, type ShareDeliveryAuthorizationReceipt, type ShareDeliveryAuthorizationRequest, type ShareErrorCode, type ShareErrorInfo, type ShareFetchOptions, type ShareHistoryView, type ShareInspection, type ShareMetadata, type ShareNodeTrust, ShareNotifyError, type ShareNotifyInput, type ShareNotifyResult, type ShareNotifyState, type SharePolicyAuthority, type SharePolicyChallenge, type SharePolicyEvidence, type SharePolicyPublishAdapter, type SharePolicySession, type SharePresentationMaterial, SharePublishError, type SharePublishErrorCode, type SharePublishOptions, type SharePublishTarget, type ShareReceiveAuthorizationRequired, ShareReceiveError, type ShareReceiveOutcome, type ShareReceiveResult, ShareRecipientClient, type ShareRecipientClientOptions, type ShareRevocationAdapter, type ShareRevocationResult, type ShareTarget, type ShareUpload, type ShareUploadAuthorization, type ShareUploadInput, type ShareUploadResult, type SignedDelegation, type TargetPublishAdapter, type TargetPublishInput, type TargetPublishOutcome, type ValidateShareDeliveryAuthorizationExpected, type VerifyBearerEnvelopeOptions, authorizationMethodForTarget, authorizeShare, canonicalOwnerSharePolicy, claimShare, computeOwnerShareRegistrationCid, createAddressedAuthorization, createDelegatedShareKey, createPolicyEnforcementDelegation, createRegisteredPolicyAuthority, createShareV2HolderBindingArtifact, historyRecordForPublishedShare, inspectShare, isLegacyShareLink, listShares, migrateShare, normalizeShareTarget, notifyShare, parseAddressedEnvelope, publishAddressedShare, publishPolicyShare, publishShare, publishTargetShare, receiveLegacyShare, receiveShare, recipientMatchesShareRecord, redactPublishedShare, restoreDelegatedShareKey, resumeShareAuthorization, revokeShare, shareDeliveryTrustedKid, showShare, targetAuthorizationMethod, toShareErrorInfo, validateOwnerSharePolicyRegistration, validateOwnerSharePolicyRegistrationBytes, validateShareDeliveryAuthorizationBytes, verifyBearerEnvelope };
|