@tinycloud/share-sdk 1.2.0-beta.0 → 1.2.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,86 +1,12 @@
1
- import { ShareEnvelopeV2, ShareEnvelopeV3, UnifiedPolicyCapability, ShareAction, UnifiedContentSource, PolicyCredentialRequirementV1 } from '@tinycloud/share-envelope';
1
+ import { ShareEnvelopeV3, ShareEnvelopeV2 } from '@tinycloud/share-envelope';
2
2
  export { CheckBearerDelegationOptions, DelegationCheckResult, canonicalize, checkBearerDelegation, fromBase64Url, requiredResourceUri, resourceUriCovers, toBase64Url } from '@tinycloud/share-envelope';
3
+ import { S as ShareAuthorizationMethod, O as OwnerShareAction, a as OwnerShareMatcher, P as PublishedShareDeliveryMaterial, b as OwnerSharePolicyRegistrationReceipt, D as DelegatedShareKey, c as PublishedShare, d as ShareAuthorizedContent, e as ShareAuthorizationAdapter, T as TargetPublishOutcome, f as TargetPublishInput, g as ShareAuthorizationResult, h as ShareTarget } from './addressed-publish-CsUS7-SI.js';
4
+ export { A as AddressedOwnerRootInput, i as AddressedOwnerRootReceipt, j as AddressedPolicyRegistrationInput, k as AddressedPolicyRegistrationReceipt, l as AddressedPublishAuthority, m as AddressedSharePublishOptions, n as AddressedShareRequest, C as CreateOwnerDelegationParams, o as DEFAULT_SHARE_LIFETIME_MS, M as MAX_CONTENT_BYTES, p as OWNER_SHARE_REGISTRATION_DOMAIN, q as OwnerDelegationPermission, r as OwnerDelegationReceipt, s as OwnerShareDecryption, t as OwnerSharePolicyRegistration, u as OwnerSharePolicyV2, v as PreparedAddressedShare, w as PublishedShareMetadata, R as RegisterOwnerSharePolicyParams, x as SHARE_CONTENT_LIMIT, y as SHARE_PUBLISH_RESULT_VERSION, z as ShareAuthorizationDenied, B as ShareAuthorizationReady, E as ShareAuthorizationRequired, F as SharePublishError, G as SharePublishErrorCode, H as SharePublishOptions, I as SharePublishTarget, J as SignedDelegation, K as TargetPublishAdapter, L as addressedCredentialRequirement, N as authorizationMethodForTarget, Q as authorizeShare, U as canonicalOwnerSharePolicy, V as computeOwnerShareRegistrationCid, W as createDelegatedShareKey, X as createPolicyEnforcementDelegation, Y as normalizeShareTarget, Z as prepareAddressedShare, _ as publishAddressedShare, $ as publishTargetShare, a0 as redactPublishedShare, a1 as restoreDelegatedShareKey, a2 as targetAuthorizationMethod, a3 as validateOwnerSharePolicyRegistration, a4 as validateOwnerSharePolicyRegistrationBytes } from './addressed-publish-CsUS7-SI.js';
3
5
 
4
6
  declare function hasUnsafeFilenameCodePoint(value: string): boolean;
5
7
  /** A single display/download filename, never a path. Returns the NFC form. */
6
8
  declare function canonicalShareFilename(value: string): string;
7
9
 
8
- /** The only interactive boundary exposed by the headless SDK. */
9
- type ShareAuthorizationMethod = "openkey-device" | "email-claim" | "email-otp";
10
- interface ShareAuthorizationRequired {
11
- readonly state: "authorization-required";
12
- readonly method: ShareAuthorizationMethod;
13
- /** A browser-safe continuation location. It must never contain a claim secret. */
14
- readonly continueUrl?: string;
15
- /** An opaque, short-lived, nonce-bound handle. It is not a bearer credential. */
16
- readonly resumeToken?: string;
17
- }
18
- interface ShareAuthorizationDenied {
19
- readonly state: "denied";
20
- readonly reason: "rejected" | "expired" | "revoked" | "unsupported";
21
- }
22
- interface ShareAuthorizationReady<T> {
23
- readonly state: "ready";
24
- readonly value: T;
25
- }
26
- type ShareAuthorizationResult<T> = ShareAuthorizationReady<T> | ShareAuthorizationRequired | ShareAuthorizationDenied;
27
- interface ShareAuthorizationAdapter<T> {
28
- begin(input: {
29
- readonly envelope: ShareEnvelopeV2;
30
- readonly method: ShareAuthorizationMethod;
31
- }): Promise<ShareAuthorizationResult<T>>;
32
- resume(input: {
33
- readonly envelope: ShareEnvelopeV2;
34
- readonly method: ShareAuthorizationMethod;
35
- readonly resumeToken: string;
36
- readonly proof?: unknown;
37
- }): Promise<ShareAuthorizationResult<T>>;
38
- /** Verify the detached node proof against a pinned authority trust bundle. */
39
- readonly verifyResult?: (input: {
40
- readonly envelope: ShareEnvelopeV2;
41
- readonly value: T;
42
- readonly proof: unknown;
43
- }) => Promise<boolean>;
44
- }
45
- /**
46
- * A node-authorized addressed read. Returning plaintext alone is not an
47
- * authorization result: the caller must also return the signed response
48
- * binding and digest that the node produced for that exact share.
49
- */
50
- interface ShareAuthorizedContent {
51
- readonly bytes: Uint8Array;
52
- readonly bodyDigest: string;
53
- readonly contentSourceDigest: string;
54
- readonly binding: {
55
- readonly shareId: string;
56
- readonly delegationCid: string;
57
- readonly authorityMaterialHandle: string;
58
- readonly authorityMaterialDigest: string;
59
- readonly resource: {
60
- readonly kind: "exact" | "prefix";
61
- readonly path: string;
62
- };
63
- readonly action?: string;
64
- };
65
- /** A detached node proof; self-reported bytes and digests are not authorization. */
66
- readonly proof: unknown;
67
- }
68
- /**
69
- * Start or continue a target authorization without ever guessing a device,
70
- * claim, or delegation secret. Adapters own their protocol and are expected
71
- * to bind their resume token to a server challenge and expiry.
72
- */
73
- declare function authorizeShare<T>(input: {
74
- readonly envelope: ShareEnvelopeV2;
75
- readonly method: ShareAuthorizationMethod;
76
- readonly adapter: ShareAuthorizationAdapter<T>;
77
- readonly resumeToken?: string;
78
- readonly proof?: unknown;
79
- }): Promise<ShareAuthorizationResult<T>>;
80
- declare function authorizationMethodForTarget(target: {
81
- readonly kind: string;
82
- }): ShareAuthorizationMethod | undefined;
83
-
84
10
  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";
85
11
  declare const SHARE_RESULT_VERSION: 1;
86
12
  declare const DEFAULT_MAX_SEALED_BLOB_BYTES: number;
@@ -166,114 +92,6 @@ declare function inspectShare(link: string, options?: ShareFetchOptions): Promis
166
92
  */
167
93
  declare function receiveShare(link: string, options?: ShareFetchOptions): Promise<ShareReceiveOutcome>;
168
94
 
169
- declare const SHARE_CONTENT_LIMIT: number;
170
- declare const SHARE_PUBLISH_RESULT_VERSION: 1;
171
- declare const DEFAULT_SHARE_LIFETIME_MS: number;
172
- type SharePublishTarget = {
173
- readonly kind: "bearer";
174
- } | {
175
- readonly kind: "recipientDid";
176
- readonly did: string;
177
- } | {
178
- readonly kind: "email";
179
- readonly address: string;
180
- } | {
181
- readonly kind: "emailDomain";
182
- readonly domain: string;
183
- };
184
- /** Input shared by the native bearer and Policy/v3 addressed publishers. */
185
- interface SharePublishOptions {
186
- readonly source: Uint8Array | AsyncIterable<Uint8Array>;
187
- readonly filename: string;
188
- readonly mediaType?: string;
189
- readonly allowBinary?: boolean;
190
- readonly target?: SharePublishTarget;
191
- readonly expiresAt?: Date;
192
- readonly expiryWasExplicit?: boolean;
193
- readonly origin: string;
194
- readonly maxBytes?: number;
195
- readonly now?: () => number;
196
- }
197
- interface PublishedShareMetadata {
198
- readonly protocol: "tinycloud-share";
199
- readonly version: 1;
200
- readonly shareId: string;
201
- readonly origin: string;
202
- readonly target: {
203
- readonly kind: "bearer" | "recipientDid" | "email" | "emailDomain";
204
- readonly origin: string;
205
- readonly nodeAudience: string;
206
- readonly spaceId: string;
207
- };
208
- readonly resource: {
209
- readonly kind: "exact" | "prefix";
210
- readonly path: string;
211
- };
212
- readonly actions: readonly string[];
213
- readonly expiryClamped?: boolean;
214
- readonly expiresAt: string;
215
- readonly display: {
216
- readonly filename?: string;
217
- readonly senderName?: string;
218
- };
219
- readonly recipientMatcher?: {
220
- readonly kind: "bearer" | "recipientDid" | "exactEmail" | "emailDomain";
221
- readonly value?: string;
222
- };
223
- readonly registrationCid?: string;
224
- readonly policyCid?: string;
225
- readonly ownerDelegationCid?: string;
226
- readonly enforcementDelegationCid?: string;
227
- readonly ownerDid?: string;
228
- readonly shareKeyDid?: string;
229
- readonly enforcerDid?: string;
230
- readonly envelopeCid?: string;
231
- readonly shareCid?: string;
232
- /** Set when the content is a numbered artifact version (TC-1428). Pinned: the share can only ever read this version. */
233
- readonly artifact?: {
234
- readonly id: string;
235
- readonly version: number;
236
- readonly mode: "pinned";
237
- };
238
- }
239
- /** Sender-only Policy/v3 material retained in encrypted history for delivery retries. */
240
- interface PublishedShareDeliveryMaterial {
241
- /**
242
- * The signed plaintext policy envelope. It is retained only in encrypted
243
- * sender history so a delivery can be retried; it never travels in a URL.
244
- */
245
- readonly envelope: Readonly<Record<string, unknown>>;
246
- /** CIDv1/raw/sha2-256 of `sealedEnvelope`, and the CID in the share URL. */
247
- readonly shareCid: string;
248
- /**
249
- * Canonical `version || nonce || AES-256-GCM ciphertext+tag`, base64url.
250
- * Node reopens this exact value before authorizing email delivery.
251
- */
252
- readonly sealedEnvelope: string;
253
- /** 32-byte AES-GCM key for `sealedEnvelope`, base64url and fragment-only in the URL. */
254
- readonly envelopeKey: string;
255
- }
256
- interface PublishedShare {
257
- readonly protocol: "tinycloud-share";
258
- readonly version: typeof SHARE_PUBLISH_RESULT_VERSION;
259
- /** The complete link is deliberately non-enumerable on production results. */
260
- readonly url: string;
261
- readonly link: {
262
- readonly kind: "native" | "policy";
263
- readonly cid: string;
264
- };
265
- readonly metadata: PublishedShareMetadata;
266
- /** Non-enumerable Policy/v3 delivery material; never included in command output. */
267
- readonly deliveryMaterial?: PublishedShareDeliveryMaterial;
268
- }
269
- /** Machine-readable output omits the complete bearer capability and delivery material. */
270
- declare function redactPublishedShare(result: PublishedShare): Omit<PublishedShare, "url" | "deliveryMaterial">;
271
- type SharePublishErrorCode = "invalid-argument" | "authority-required" | "max-bytes-exceeded";
272
- declare class SharePublishError extends Error {
273
- readonly code: SharePublishErrorCode;
274
- constructor(code: SharePublishErrorCode, message: string);
275
- }
276
-
277
95
  interface ParsedAddressedEnvelope {
278
96
  readonly envelope: ShareEnvelopeV2;
279
97
  readonly policy: Record<string, unknown>;
@@ -282,354 +100,6 @@ interface ParsedAddressedEnvelope {
282
100
  /** Parse and bind the signed policy bytes before any holder or node effect. */
283
101
  declare function parseAddressedEnvelope(value: unknown): Promise<ParsedAddressedEnvelope>;
284
102
 
285
- type ShareTarget = SharePublishTarget;
286
- interface TargetPublishInput {
287
- readonly source: Uint8Array;
288
- readonly filename: string;
289
- readonly mediaType?: string;
290
- /** Additional files for a prefix resource; source remains the first file for compatibility. */
291
- readonly files?: readonly {
292
- readonly bytes: Uint8Array;
293
- readonly filename: string;
294
- readonly mediaType?: string;
295
- }[];
296
- readonly target: ShareTarget;
297
- readonly expiresAt: Date;
298
- readonly expiryWasExplicit?: boolean;
299
- readonly origin: string;
300
- readonly resourceKind?: "exact" | "prefix";
301
- readonly actions?: readonly ("read" | "list" | "edit")[];
302
- readonly notify?: boolean;
303
- /** Publish as the next write-once version of this artifact and pin the share to it (TC-1428). */
304
- readonly artifact?: {
305
- readonly id: string;
306
- readonly note?: string;
307
- };
308
- }
309
- type TargetPublishOutcome = PublishedShare | ShareAuthorizationRequired;
310
- interface TargetPublishAdapter {
311
- publish(input: TargetPublishInput): Promise<TargetPublishOutcome>;
312
- }
313
- declare function normalizeShareTarget(target: ShareTarget): ShareTarget;
314
- declare function targetAuthorizationMethod(target: ShareTarget): ShareAuthorizationMethod | undefined;
315
- /** Route every share through the authenticated TinyCloud authority adapter. */
316
- declare function publishTargetShare(input: SharePublishOptions & {
317
- readonly target: ShareTarget;
318
- readonly notify?: boolean;
319
- readonly targetAdapter?: TargetPublishAdapter;
320
- readonly files?: readonly {
321
- readonly bytes: Uint8Array;
322
- readonly filename: string;
323
- readonly mediaType?: string;
324
- }[];
325
- readonly resourceKind?: "exact" | "prefix";
326
- readonly actions?: readonly ("read" | "list" | "edit")[];
327
- }): Promise<TargetPublishOutcome>;
328
-
329
- interface OwnerDelegationReceipt {
330
- readonly delegationCid: string;
331
- readonly signedDagCbor: Uint8Array;
332
- readonly delegation: {
333
- readonly delegateDID: string;
334
- readonly spaceId: string;
335
- readonly path: string;
336
- readonly actions: readonly string[];
337
- readonly expiry: Date;
338
- };
339
- /** Exact service-scoped capabilities encoded in the signed owner delegation. */
340
- readonly permissions?: readonly OwnerDelegationPermission[];
341
- }
342
- interface OwnerDelegationPermission {
343
- readonly service: string;
344
- readonly path: string;
345
- readonly actions: readonly string[];
346
- }
347
- interface CreateOwnerDelegationBase {
348
- readonly delegateDid: string;
349
- readonly spaceId: string;
350
- readonly expiresAt: Date;
351
- }
352
- type CreateOwnerDelegationParams = CreateOwnerDelegationBase & ({
353
- readonly path: string;
354
- readonly actions: readonly string[];
355
- readonly permissions?: never;
356
- } | {
357
- readonly permissions: readonly OwnerDelegationPermission[];
358
- readonly path?: never;
359
- readonly actions?: never;
360
- });
361
- declare const MAX_CONTENT_BYTES: number;
362
- declare const OWNER_SHARE_REGISTRATION_DOMAIN = "xyz.tinycloud.share/policy-registration/v2\0";
363
- type OwnerShareAction = "tinycloud.kv/get" | "tinycloud.kv/list" | "tinycloud.kv/metadata" | "tinycloud.kv/put";
364
- interface OwnerShareDecryption {
365
- readonly networkId: string;
366
- readonly action: "tinycloud.encryption/decrypt";
367
- }
368
- type OwnerShareMatcher = {
369
- readonly kind: "exactEmail";
370
- readonly value: string;
371
- } | {
372
- readonly kind: "emailDomain";
373
- readonly value: string;
374
- } | {
375
- readonly kind: "recipientDid";
376
- readonly value: string;
377
- } | {
378
- readonly kind: "bearer";
379
- };
380
- interface OwnerSharePolicyV2 {
381
- readonly type: "TinyCloudSharePolicy";
382
- readonly version: 2;
383
- readonly shareId: string;
384
- readonly ownerDid: string;
385
- readonly shareKeyDid: string;
386
- readonly recipientMatcher: OwnerShareMatcher;
387
- readonly target: {
388
- readonly origin: string;
389
- readonly nodeAudience: string;
390
- readonly enforcerDid: string;
391
- readonly spaceId: string;
392
- };
393
- readonly resource: {
394
- readonly kind: "exact" | "prefix";
395
- readonly path: string;
396
- };
397
- readonly actions: readonly OwnerShareAction[];
398
- readonly decryption?: OwnerShareDecryption;
399
- readonly contentSource: {
400
- readonly kind: "kv";
401
- readonly space: string;
402
- readonly path: string;
403
- readonly action: "tinycloud.kv/get";
404
- };
405
- readonly contentSourceDigest: string;
406
- readonly ownerDelegationCid: string;
407
- readonly expiresAt: string;
408
- }
409
- interface DelegatedShareKey {
410
- readonly did: string;
411
- readonly publicKey: Uint8Array;
412
- readonly extractable: boolean;
413
- /** The underlying WebCrypto private key handle; private JWK material is never returned. */
414
- readonly cryptoKey: CryptoKey;
415
- sign(bytes: Uint8Array): Promise<Uint8Array>;
416
- clear(): void;
417
- }
418
- interface SignedDelegation {
419
- readonly cid: string;
420
- readonly dagCbor: string;
421
- readonly issuerDid: string;
422
- readonly audienceDid: string;
423
- readonly facts: Record<string, string | readonly string[]>;
424
- readonly signature: string;
425
- }
426
- interface RegisterOwnerSharePolicyParams {
427
- readonly policy: {
428
- readonly bytes: Uint8Array;
429
- readonly cid: string;
430
- readonly proof: string;
431
- };
432
- readonly ownerDelegation: OwnerDelegationReceipt;
433
- readonly enforcementDelegation: SignedDelegation;
434
- readonly contentSourceDigest: string;
435
- /** The enrolled receipt key from the node trust bundle. */
436
- readonly nodeProof?: {
437
- readonly kid: string;
438
- readonly publicKey: Uint8Array;
439
- };
440
- }
441
- interface OwnerSharePolicyRegistration {
442
- readonly registrationCid: string;
443
- readonly policyCid: string;
444
- readonly ownerDelegationCid: string;
445
- readonly enforcementDelegationCid: string;
446
- readonly ownerDid: string;
447
- readonly shareKeyDid: string;
448
- readonly enforcerDid: string;
449
- readonly shareId: string;
450
- readonly recipientMatcher: OwnerShareMatcher;
451
- readonly target: {
452
- readonly origin: string;
453
- readonly nodeAudience: string;
454
- readonly spaceId: string;
455
- };
456
- readonly resource: {
457
- readonly kind: "exact" | "prefix";
458
- readonly path: string;
459
- };
460
- readonly actions: readonly OwnerShareAction[];
461
- readonly contentSource: {
462
- readonly kind: "kv";
463
- readonly space: string;
464
- readonly path: string;
465
- readonly action: "tinycloud.kv/get";
466
- };
467
- readonly contentSourceDigest: string;
468
- readonly registeredAt: string;
469
- readonly expiresAt: string;
470
- }
471
- interface OwnerSharePolicyRegistrationReceipt {
472
- readonly registration: OwnerSharePolicyRegistration;
473
- readonly proof: {
474
- readonly alg: "EdDSA";
475
- readonly kid: string;
476
- readonly signature: string;
477
- };
478
- }
479
- declare function createDelegatedShareKey(options: {
480
- readonly extractable: boolean;
481
- }): Promise<DelegatedShareKey>;
482
- /**
483
- * Rehydrate a signer wrapper around a `DelegatedShareKey`'s private
484
- * `CryptoKey` handle that was persisted (e.g. via IndexedDB structured
485
- * clone) and recovered after a reload. `privateKey` must be the same
486
- * non-extractable Ed25519 `CryptoKey` originally produced by
487
- * {@link createDelegatedShareKey}.
488
- */
489
- declare function restoreDelegatedShareKey(input: {
490
- readonly privateKey: CryptoKey;
491
- readonly publicKey: Uint8Array;
492
- readonly extractable: boolean;
493
- }): DelegatedShareKey;
494
- declare function createPolicyEnforcementDelegation(input: {
495
- readonly ownerDelegation: OwnerDelegationReceipt;
496
- readonly shareKey: DelegatedShareKey;
497
- readonly enforcerDid: string;
498
- readonly policyCid: string;
499
- readonly shareId: string;
500
- readonly spaceId: string;
501
- readonly nodeAudience: string;
502
- readonly path: string;
503
- readonly actions: readonly OwnerShareAction[];
504
- readonly contentSourceDigest: string;
505
- readonly expiresAt: string;
506
- }): Promise<SignedDelegation>;
507
- declare function canonicalOwnerSharePolicy(policy: OwnerSharePolicyV2): Promise<{
508
- readonly bytes: Uint8Array;
509
- readonly cid: string;
510
- readonly digest: string;
511
- }>;
512
- declare function computeOwnerShareRegistrationCid(registration: Omit<OwnerSharePolicyRegistration, "registrationCid">): string;
513
- declare function validateOwnerSharePolicyRegistration(value: unknown, expected: RegisterOwnerSharePolicyParams): OwnerSharePolicyRegistrationReceipt;
514
- /** Validate the exact UTF-8 response bytes emitted by the registration route. */
515
- declare function validateOwnerSharePolicyRegistrationBytes(bytesValue: Uint8Array, expected: RegisterOwnerSharePolicyParams): OwnerSharePolicyRegistrationReceipt;
516
-
517
- interface AddressedOwnerRootInput {
518
- readonly ownerDid: string;
519
- readonly role: "policy-authority" | "policy-enforcement";
520
- readonly audienceDid: string;
521
- readonly policyId: string;
522
- readonly policyDigestHex: string;
523
- readonly policyCid: string;
524
- readonly contentSourceDigestHex: string;
525
- readonly capabilityCeilingHashHex: string;
526
- readonly nativeProjectionHashHex: string;
527
- readonly notBefore: Date;
528
- readonly expiresAt: Date;
529
- readonly nodeAudience: string;
530
- readonly capabilities: readonly UnifiedPolicyCapability[];
531
- }
532
- interface AddressedOwnerRootReceipt {
533
- readonly cid: string;
534
- readonly delegationHeader: {
535
- readonly Authorization: string;
536
- };
537
- }
538
- interface AddressedPolicyRegistrationInput {
539
- readonly policyCid: string;
540
- readonly policy: Readonly<Record<string, unknown>>;
541
- readonly policyRoot: {
542
- readonly cid: string;
543
- readonly authorization: string;
544
- };
545
- readonly enforcementRoot: {
546
- readonly cid: string;
547
- readonly authorization: string;
548
- };
549
- readonly contentSourceDigestHex: string;
550
- readonly nativeProjectionHashHex: string;
551
- readonly rootExpiresAt: string;
552
- readonly enforcerDid: string;
553
- readonly expectedNodeAudience: string;
554
- }
555
- interface AddressedPolicyRegistrationReceipt {
556
- readonly policyCid: string;
557
- readonly policyRootCid: string;
558
- readonly enforcementRootCid: string;
559
- readonly attestedEnforcerBinding: {
560
- readonly schema: "xyz.tinycloud.policy/attested-enforcer/v2";
561
- readonly enforcerDid: string;
562
- readonly nodeAudience: string;
563
- readonly attestationBindingDigestHex: string;
564
- readonly issuedAt: string;
565
- readonly expiresAt: string;
566
- readonly signature: {
567
- readonly suite: "Ed25519";
568
- readonly signerDid: string;
569
- readonly value: string;
570
- };
571
- };
572
- }
573
- /** App-neutral owner authority. Node SDK owns all Policy/v3 transport. */
574
- interface AddressedPublishAuthority {
575
- readonly ownerDid: string;
576
- createOwnerRoot(input: AddressedOwnerRootInput): Promise<AddressedOwnerRootReceipt>;
577
- sign(bytes: Uint8Array): Promise<Uint8Array>;
578
- registerPolicy(input: AddressedPolicyRegistrationInput): Promise<AddressedPolicyRegistrationReceipt>;
579
- }
580
- interface AddressedSharePublishOptions {
581
- readonly shareId: string;
582
- readonly shareOrigin: string;
583
- readonly nodeOrigin: string;
584
- readonly nodeAudience: string;
585
- readonly enforcerDid: string;
586
- readonly spaceId: string;
587
- readonly target: Exclude<ShareTarget, {
588
- readonly kind: "bearer";
589
- }>;
590
- readonly resource: {
591
- readonly kind: "exact" | "prefix";
592
- readonly path: string;
593
- };
594
- readonly actions: readonly ShareAction[];
595
- readonly policyActions: readonly OwnerShareAction[];
596
- readonly contentSource: UnifiedContentSource;
597
- readonly credentialRequirement?: PolicyCredentialRequirementV1;
598
- readonly filename: string;
599
- readonly mediaType: string;
600
- readonly byteLength: number;
601
- readonly artifact?: "html";
602
- readonly deliveryEmail?: string;
603
- readonly expiresAt: Date;
604
- /** Sender-history material required by Node's Policy/v3 delivery authorization. */
605
- readonly onDeliveryMaterial?: (input: PublishedShareDeliveryMaterial) => void;
606
- readonly authority: AddressedPublishAuthority;
607
- }
608
- type MailboxTarget = Extract<ShareTarget, {
609
- readonly kind: "email" | "emailDomain";
610
- }>;
611
- /** The Policy/v2 credential commitment a share addressed to `target` must carry. */
612
- declare function addressedCredentialRequirement(target: MailboxTarget): PolicyCredentialRequirementV1;
613
- /** Facts every addressed-share check needs, available before any side effect. */
614
- type AddressedShareRequest = Pick<AddressedSharePublishOptions, "target" | "actions" | "policyActions" | "filename" | "deliveryEmail">;
615
- interface PreparedAddressedShare {
616
- /** The canonical target the envelope's recipient matcher will carry. */
617
- readonly target: Exclude<ShareTarget, {
618
- readonly kind: "bearer";
619
- }>;
620
- /** Present for mailbox targets: the Policy/v2 commitment to pass to `publishAddressedShare`. */
621
- readonly credentialRequirement?: PolicyCredentialRequirementV1;
622
- }
623
- /**
624
- * Runs every argument and target check of `publishAddressedShare` that does
625
- * not depend on stored content, and derives the credential commitment. It has
626
- * no side effects, so senders call it before uploading content or publishing
627
- * a location record; a refused share then leaves nothing behind.
628
- */
629
- declare function prepareAddressedShare(request: AddressedShareRequest): PreparedAddressedShare;
630
- /** Canonical application-neutral Policy/v3 addressed publisher shared by browser and CLI. */
631
- declare function publishAddressedShare(input: AddressedSharePublishOptions): Promise<PublishedShare>;
632
-
633
103
  interface ShareCacheKey {
634
104
  readonly cid: string;
635
105
  readonly expiresAt: string;
@@ -1162,4 +632,4 @@ declare function parseNativeShareUrl(value: string): string;
1162
632
  /** Receive through the public SDK without creating another transport protocol. */
1163
633
  declare function openNativeShare(sharing: NativeSharingService, link: string): Promise<unknown>;
1164
634
 
1165
- export { type AddressedOwnerRootInput, type AddressedOwnerRootReceipt, type AddressedPolicyRegistrationInput, type AddressedPolicyRegistrationReceipt, type AddressedPublishAuthority, type AddressedSharePublishOptions, type AddressedShareRequest, type CreateOwnerDelegationParams, CredentialInvitationError, type CredentialInvitationErrorCode, type CredentialInvitationReceipt, type CredentialInvitationResult, DEFAULT_MAX_CONTENT_BLOB_BYTES, DEFAULT_MAX_SEALED_BLOB_BYTES, DEFAULT_SHARE_LIFETIME_MS, type DelegatedShareKey, EncryptedSenderShareHistory, type EncryptedShareHistoryStorage, MAX_CONTENT_BYTES, MemoryEncryptedShareHistoryStorage, MemorySenderShareKeyStorage, MemorySenderShareRecordStorage, MemoryShareCache, NATIVE_SHARE_FRAGMENT_PARAMETER, type NativeShareResult, type NativeSharingService, OWNER_SHARE_REGISTRATION_DOMAIN, type OwnerDelegationPermission, type OwnerDelegationReceipt, type OwnerShareAction, type OwnerShareDecryption, type OwnerShareMatcher, type OwnerSharePolicyRegistration, type OwnerSharePolicyRegistrationReceipt, type OwnerSharePolicyV2, type ParsedAddressedEnvelope, type PreparedAddressedShare, type PublishedShare, type PublishedShareDeliveryMaterial, type PublishedShareMetadata, type RegisterOwnerSharePolicyParams, SHARE_CONTENT_LIMIT, SHARE_PUBLISH_RESULT_VERSION, SHARE_RESULT_VERSION, 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 ShareErrorCode, type ShareErrorInfo, type ShareFetchOptions, type ShareHistoryView, type ShareInspection, type ShareMetadata, type ShareNodeTrust, ShareNotifyError, type ShareNotifyInput, type ShareNotifyResult, type ShareNotifyState, type SharePolicyChallenge, type SharePolicyDelegationLink, type SharePolicyPublishAdapter, type SharePolicyRootRevocation, 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 SignedDelegation, type TargetPublishAdapter, type TargetPublishInput, type TargetPublishOutcome, addressedCredentialRequirement, authorizationMethodForTarget, authorizeShare, canonicalOwnerSharePolicy, canonicalShareFilename, claimShare, computeOwnerShareRegistrationCid, createAddressedAuthorization, createDelegatedShareKey, createNativeShare, createPolicyEnforcementDelegation, createShareV2HolderBindingArtifact, deliverCredentialInvitation, hasUnsafeFilenameCodePoint, historyRecordForPublishedShare, inspectShare, listShares, normalizeShareTarget, notifyShare, openNativeShare, parseAddressedEnvelope, parseNativeShareUrl, prepareAddressedShare, publishAddressedShare, publishPolicyShare, publishTargetShare, receiveShare, recipientMatchesShareRecord, redactPublishedShare, restoreDelegatedShareKey, resumeShareAuthorization, revokeShare, shareDeliveryWindowExpiresAt, showShare, targetAuthorizationMethod, toShareErrorInfo, validateOwnerSharePolicyRegistration, validateOwnerSharePolicyRegistrationBytes };
635
+ export { CredentialInvitationError, type CredentialInvitationErrorCode, type CredentialInvitationReceipt, type CredentialInvitationResult, DEFAULT_MAX_CONTENT_BLOB_BYTES, DEFAULT_MAX_SEALED_BLOB_BYTES, DelegatedShareKey, EncryptedSenderShareHistory, type EncryptedShareHistoryStorage, MemoryEncryptedShareHistoryStorage, MemorySenderShareKeyStorage, MemorySenderShareRecordStorage, MemoryShareCache, NATIVE_SHARE_FRAGMENT_PARAMETER, type NativeShareResult, type NativeSharingService, OwnerShareAction, OwnerShareMatcher, OwnerSharePolicyRegistrationReceipt, type ParsedAddressedEnvelope, PublishedShare, PublishedShareDeliveryMaterial, SHARE_RESULT_VERSION, SHARE_V2_PROTOCOL, type SenderShareKeyStorage, type SenderShareRecord, type SenderShareRecordStorage, type SenderShareRevocationScope, SenderShareStore, ShareAuthorizationAdapter, ShareAuthorizationMethod, ShareAuthorizationResult, ShareAuthorizedContent, type ShareCache, type ShareCacheEntry, type ShareCacheKey, type ShareCacheMetadata, type ShareDeliveryAdapter, type ShareErrorCode, type ShareErrorInfo, type ShareFetchOptions, type ShareHistoryView, type ShareInspection, type ShareMetadata, type ShareNodeTrust, ShareNotifyError, type ShareNotifyInput, type ShareNotifyResult, type ShareNotifyState, type SharePolicyChallenge, type SharePolicyDelegationLink, type SharePolicyPublishAdapter, type SharePolicyRootRevocation, type SharePolicySession, type SharePresentationMaterial, type ShareReceiveAuthorizationRequired, ShareReceiveError, type ShareReceiveOutcome, type ShareReceiveResult, ShareRecipientClient, type ShareRecipientClientOptions, type ShareRevocationAdapter, type ShareRevocationResult, ShareTarget, TargetPublishInput, TargetPublishOutcome, canonicalShareFilename, claimShare, createAddressedAuthorization, createNativeShare, createShareV2HolderBindingArtifact, deliverCredentialInvitation, hasUnsafeFilenameCodePoint, historyRecordForPublishedShare, inspectShare, listShares, notifyShare, openNativeShare, parseAddressedEnvelope, parseNativeShareUrl, publishPolicyShare, receiveShare, recipientMatchesShareRecord, resumeShareAuthorization, revokeShare, shareDeliveryWindowExpiresAt, showShare, toShareErrorInfo };