@tinycloud/sdk-core 2.11.0-beta.5 → 2.11.0-beta.8

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.
@@ -2259,6 +2259,9 @@ type ShareRecipientTarget = {
2259
2259
  } | {
2260
2260
  readonly kind: "emailDomain";
2261
2261
  readonly value: string;
2262
+ } | {
2263
+ readonly kind: "recipientDid";
2264
+ readonly value: string;
2262
2265
  } | {
2263
2266
  readonly kind: "bearer";
2264
2267
  };
@@ -2536,6 +2539,19 @@ interface ShareRecipientClientOptions {
2536
2539
  readonly envelope: ShareEnvelopeV2;
2537
2540
  readonly presentation?: unknown;
2538
2541
  }) => Promise<SharePolicySession>;
2542
+ /** Direct DID authorization is explicit and may return a resumable device step. */
2543
+ readonly establishRecipientDidSession?: (input: {
2544
+ readonly envelope: ShareEnvelopeV2;
2545
+ readonly recipientDid: string;
2546
+ }) => Promise<SharePolicySession | {
2547
+ readonly state: "authorization-required";
2548
+ readonly method: "openkey-device";
2549
+ readonly continueUrl?: string;
2550
+ readonly resumeToken: string;
2551
+ } | {
2552
+ readonly state: "denied";
2553
+ readonly reason: string;
2554
+ }>;
2539
2555
  /**
2540
2556
  * Builds the holder presentation/session request after Node returns a
2541
2557
  * fresh challenge. The callback is deliberately invoked only after the
@@ -2740,7 +2756,8 @@ declare class ShareConflict extends Error {
2740
2756
  }
2741
2757
  declare class ShareAccessError extends Error {
2742
2758
  readonly code: string;
2743
- constructor(code: string, message?: string);
2759
+ readonly details?: unknown;
2760
+ constructor(code: string, message?: string, details?: unknown);
2744
2761
  }
2745
2762
  interface ShareAccessV2 {
2746
2763
  readonly kind: "share-v2";
@@ -3272,6 +3289,9 @@ type OwnerShareMatcher = {
3272
3289
  } | {
3273
3290
  readonly kind: "emailDomain";
3274
3291
  readonly value: string;
3292
+ } | {
3293
+ readonly kind: "recipientDid";
3294
+ readonly value: string;
3275
3295
  };
3276
3296
  interface OwnerSharePolicyV2 {
3277
3297
  readonly type: "TinyCloudSharePolicy";
@@ -3432,6 +3452,7 @@ interface ShareDeliveryAuthorizationRequest {
3432
3452
  readonly shareUrl: string;
3433
3453
  readonly documentName: string;
3434
3454
  readonly jti: string;
3455
+ readonly idempotencyKey: string;
3435
3456
  readonly expiresAt: string;
3436
3457
  readonly requestBodyDigest: string;
3437
3458
  }
@@ -3642,6 +3663,15 @@ declare const ShareRecipientTargetSchema: z.ZodDiscriminatedUnion<"kind", [z.Zod
3642
3663
  }, {
3643
3664
  value: string;
3644
3665
  kind: "emailDomain";
3666
+ }>, z.ZodObject<{
3667
+ kind: z.ZodLiteral<"recipientDid">;
3668
+ value: z.ZodString;
3669
+ }, "strict", z.ZodTypeAny, {
3670
+ value: string;
3671
+ kind: "recipientDid";
3672
+ }, {
3673
+ value: string;
3674
+ kind: "recipientDid";
3645
3675
  }>, z.ZodObject<{
3646
3676
  kind: z.ZodLiteral<"bearer">;
3647
3677
  }, "strict", z.ZodTypeAny, {
@@ -3688,6 +3718,15 @@ declare const ShareRecipientPolicySchema: z.ZodObject<{
3688
3718
  }, {
3689
3719
  value: string;
3690
3720
  kind: "emailDomain";
3721
+ }>, z.ZodObject<{
3722
+ kind: z.ZodLiteral<"recipientDid">;
3723
+ value: z.ZodString;
3724
+ }, "strict", z.ZodTypeAny, {
3725
+ value: string;
3726
+ kind: "recipientDid";
3727
+ }, {
3728
+ value: string;
3729
+ kind: "recipientDid";
3691
3730
  }>, z.ZodObject<{
3692
3731
  kind: z.ZodLiteral<"bearer">;
3693
3732
  }, "strict", z.ZodTypeAny, {
@@ -3734,6 +3773,9 @@ declare const ShareRecipientPolicySchema: z.ZodObject<{
3734
3773
  } | {
3735
3774
  value: string;
3736
3775
  kind: "emailDomain";
3776
+ } | {
3777
+ value: string;
3778
+ kind: "recipientDid";
3737
3779
  } | {
3738
3780
  kind: "bearer";
3739
3781
  };
@@ -3754,6 +3796,9 @@ declare const ShareRecipientPolicySchema: z.ZodObject<{
3754
3796
  } | {
3755
3797
  value: string;
3756
3798
  kind: "emailDomain";
3799
+ } | {
3800
+ value: string;
3801
+ kind: "recipientDid";
3757
3802
  } | {
3758
3803
  kind: "bearer";
3759
3804
  };
@@ -3800,6 +3845,15 @@ declare const ShareAddressedDelegationRequestV2Schema: z.ZodObject<{
3800
3845
  }, {
3801
3846
  value: string;
3802
3847
  kind: "emailDomain";
3848
+ }>, z.ZodObject<{
3849
+ kind: z.ZodLiteral<"recipientDid">;
3850
+ value: z.ZodString;
3851
+ }, "strict", z.ZodTypeAny, {
3852
+ value: string;
3853
+ kind: "recipientDid";
3854
+ }, {
3855
+ value: string;
3856
+ kind: "recipientDid";
3803
3857
  }>]>;
3804
3858
  targetOrigin: z.ZodString;
3805
3859
  nodeAudience: z.ZodString;
@@ -3881,6 +3935,9 @@ declare const ShareAddressedDelegationRequestV2Schema: z.ZodObject<{
3881
3935
  } | {
3882
3936
  value: string;
3883
3937
  kind: "emailDomain";
3938
+ } | {
3939
+ value: string;
3940
+ kind: "recipientDid";
3884
3941
  };
3885
3942
  nodeAudience: string;
3886
3943
  contentSource: {
@@ -3923,6 +3980,9 @@ declare const ShareAddressedDelegationRequestV2Schema: z.ZodObject<{
3923
3980
  } | {
3924
3981
  value: string;
3925
3982
  kind: "emailDomain";
3983
+ } | {
3984
+ value: string;
3985
+ kind: "recipientDid";
3926
3986
  };
3927
3987
  nodeAudience: string;
3928
3988
  contentSource: {
@@ -3974,6 +4034,15 @@ declare const ShareAddressedDelegationEnvelopeV2Schema: z.ZodObject<{
3974
4034
  }, {
3975
4035
  value: string;
3976
4036
  kind: "emailDomain";
4037
+ }>, z.ZodObject<{
4038
+ kind: z.ZodLiteral<"recipientDid">;
4039
+ value: z.ZodString;
4040
+ }, "strict", z.ZodTypeAny, {
4041
+ value: string;
4042
+ kind: "recipientDid";
4043
+ }, {
4044
+ value: string;
4045
+ kind: "recipientDid";
3977
4046
  }>]>;
3978
4047
  targetOrigin: z.ZodString;
3979
4048
  nodeAudience: z.ZodString;
@@ -4055,6 +4124,9 @@ declare const ShareAddressedDelegationEnvelopeV2Schema: z.ZodObject<{
4055
4124
  } | {
4056
4125
  value: string;
4057
4126
  kind: "emailDomain";
4127
+ } | {
4128
+ value: string;
4129
+ kind: "recipientDid";
4058
4130
  };
4059
4131
  nodeAudience: string;
4060
4132
  contentSource: {
@@ -4097,6 +4169,9 @@ declare const ShareAddressedDelegationEnvelopeV2Schema: z.ZodObject<{
4097
4169
  } | {
4098
4170
  value: string;
4099
4171
  kind: "emailDomain";
4172
+ } | {
4173
+ value: string;
4174
+ kind: "recipientDid";
4100
4175
  };
4101
4176
  nodeAudience: string;
4102
4177
  contentSource: {
@@ -4154,6 +4229,9 @@ declare const ShareAddressedDelegationEnvelopeV2Schema: z.ZodObject<{
4154
4229
  } | {
4155
4230
  value: string;
4156
4231
  kind: "emailDomain";
4232
+ } | {
4233
+ value: string;
4234
+ kind: "recipientDid";
4157
4235
  };
4158
4236
  nodeAudience: string;
4159
4237
  contentSource: {
@@ -4203,6 +4281,9 @@ declare const ShareAddressedDelegationEnvelopeV2Schema: z.ZodObject<{
4203
4281
  } | {
4204
4282
  value: string;
4205
4283
  kind: "emailDomain";
4284
+ } | {
4285
+ value: string;
4286
+ kind: "recipientDid";
4206
4287
  };
4207
4288
  nodeAudience: string;
4208
4289
  contentSource: {
@@ -2259,6 +2259,9 @@ type ShareRecipientTarget = {
2259
2259
  } | {
2260
2260
  readonly kind: "emailDomain";
2261
2261
  readonly value: string;
2262
+ } | {
2263
+ readonly kind: "recipientDid";
2264
+ readonly value: string;
2262
2265
  } | {
2263
2266
  readonly kind: "bearer";
2264
2267
  };
@@ -2536,6 +2539,19 @@ interface ShareRecipientClientOptions {
2536
2539
  readonly envelope: ShareEnvelopeV2;
2537
2540
  readonly presentation?: unknown;
2538
2541
  }) => Promise<SharePolicySession>;
2542
+ /** Direct DID authorization is explicit and may return a resumable device step. */
2543
+ readonly establishRecipientDidSession?: (input: {
2544
+ readonly envelope: ShareEnvelopeV2;
2545
+ readonly recipientDid: string;
2546
+ }) => Promise<SharePolicySession | {
2547
+ readonly state: "authorization-required";
2548
+ readonly method: "openkey-device";
2549
+ readonly continueUrl?: string;
2550
+ readonly resumeToken: string;
2551
+ } | {
2552
+ readonly state: "denied";
2553
+ readonly reason: string;
2554
+ }>;
2539
2555
  /**
2540
2556
  * Builds the holder presentation/session request after Node returns a
2541
2557
  * fresh challenge. The callback is deliberately invoked only after the
@@ -2740,7 +2756,8 @@ declare class ShareConflict extends Error {
2740
2756
  }
2741
2757
  declare class ShareAccessError extends Error {
2742
2758
  readonly code: string;
2743
- constructor(code: string, message?: string);
2759
+ readonly details?: unknown;
2760
+ constructor(code: string, message?: string, details?: unknown);
2744
2761
  }
2745
2762
  interface ShareAccessV2 {
2746
2763
  readonly kind: "share-v2";
@@ -3272,6 +3289,9 @@ type OwnerShareMatcher = {
3272
3289
  } | {
3273
3290
  readonly kind: "emailDomain";
3274
3291
  readonly value: string;
3292
+ } | {
3293
+ readonly kind: "recipientDid";
3294
+ readonly value: string;
3275
3295
  };
3276
3296
  interface OwnerSharePolicyV2 {
3277
3297
  readonly type: "TinyCloudSharePolicy";
@@ -3432,6 +3452,7 @@ interface ShareDeliveryAuthorizationRequest {
3432
3452
  readonly shareUrl: string;
3433
3453
  readonly documentName: string;
3434
3454
  readonly jti: string;
3455
+ readonly idempotencyKey: string;
3435
3456
  readonly expiresAt: string;
3436
3457
  readonly requestBodyDigest: string;
3437
3458
  }
@@ -3642,6 +3663,15 @@ declare const ShareRecipientTargetSchema: z.ZodDiscriminatedUnion<"kind", [z.Zod
3642
3663
  }, {
3643
3664
  value: string;
3644
3665
  kind: "emailDomain";
3666
+ }>, z.ZodObject<{
3667
+ kind: z.ZodLiteral<"recipientDid">;
3668
+ value: z.ZodString;
3669
+ }, "strict", z.ZodTypeAny, {
3670
+ value: string;
3671
+ kind: "recipientDid";
3672
+ }, {
3673
+ value: string;
3674
+ kind: "recipientDid";
3645
3675
  }>, z.ZodObject<{
3646
3676
  kind: z.ZodLiteral<"bearer">;
3647
3677
  }, "strict", z.ZodTypeAny, {
@@ -3688,6 +3718,15 @@ declare const ShareRecipientPolicySchema: z.ZodObject<{
3688
3718
  }, {
3689
3719
  value: string;
3690
3720
  kind: "emailDomain";
3721
+ }>, z.ZodObject<{
3722
+ kind: z.ZodLiteral<"recipientDid">;
3723
+ value: z.ZodString;
3724
+ }, "strict", z.ZodTypeAny, {
3725
+ value: string;
3726
+ kind: "recipientDid";
3727
+ }, {
3728
+ value: string;
3729
+ kind: "recipientDid";
3691
3730
  }>, z.ZodObject<{
3692
3731
  kind: z.ZodLiteral<"bearer">;
3693
3732
  }, "strict", z.ZodTypeAny, {
@@ -3734,6 +3773,9 @@ declare const ShareRecipientPolicySchema: z.ZodObject<{
3734
3773
  } | {
3735
3774
  value: string;
3736
3775
  kind: "emailDomain";
3776
+ } | {
3777
+ value: string;
3778
+ kind: "recipientDid";
3737
3779
  } | {
3738
3780
  kind: "bearer";
3739
3781
  };
@@ -3754,6 +3796,9 @@ declare const ShareRecipientPolicySchema: z.ZodObject<{
3754
3796
  } | {
3755
3797
  value: string;
3756
3798
  kind: "emailDomain";
3799
+ } | {
3800
+ value: string;
3801
+ kind: "recipientDid";
3757
3802
  } | {
3758
3803
  kind: "bearer";
3759
3804
  };
@@ -3800,6 +3845,15 @@ declare const ShareAddressedDelegationRequestV2Schema: z.ZodObject<{
3800
3845
  }, {
3801
3846
  value: string;
3802
3847
  kind: "emailDomain";
3848
+ }>, z.ZodObject<{
3849
+ kind: z.ZodLiteral<"recipientDid">;
3850
+ value: z.ZodString;
3851
+ }, "strict", z.ZodTypeAny, {
3852
+ value: string;
3853
+ kind: "recipientDid";
3854
+ }, {
3855
+ value: string;
3856
+ kind: "recipientDid";
3803
3857
  }>]>;
3804
3858
  targetOrigin: z.ZodString;
3805
3859
  nodeAudience: z.ZodString;
@@ -3881,6 +3935,9 @@ declare const ShareAddressedDelegationRequestV2Schema: z.ZodObject<{
3881
3935
  } | {
3882
3936
  value: string;
3883
3937
  kind: "emailDomain";
3938
+ } | {
3939
+ value: string;
3940
+ kind: "recipientDid";
3884
3941
  };
3885
3942
  nodeAudience: string;
3886
3943
  contentSource: {
@@ -3923,6 +3980,9 @@ declare const ShareAddressedDelegationRequestV2Schema: z.ZodObject<{
3923
3980
  } | {
3924
3981
  value: string;
3925
3982
  kind: "emailDomain";
3983
+ } | {
3984
+ value: string;
3985
+ kind: "recipientDid";
3926
3986
  };
3927
3987
  nodeAudience: string;
3928
3988
  contentSource: {
@@ -3974,6 +4034,15 @@ declare const ShareAddressedDelegationEnvelopeV2Schema: z.ZodObject<{
3974
4034
  }, {
3975
4035
  value: string;
3976
4036
  kind: "emailDomain";
4037
+ }>, z.ZodObject<{
4038
+ kind: z.ZodLiteral<"recipientDid">;
4039
+ value: z.ZodString;
4040
+ }, "strict", z.ZodTypeAny, {
4041
+ value: string;
4042
+ kind: "recipientDid";
4043
+ }, {
4044
+ value: string;
4045
+ kind: "recipientDid";
3977
4046
  }>]>;
3978
4047
  targetOrigin: z.ZodString;
3979
4048
  nodeAudience: z.ZodString;
@@ -4055,6 +4124,9 @@ declare const ShareAddressedDelegationEnvelopeV2Schema: z.ZodObject<{
4055
4124
  } | {
4056
4125
  value: string;
4057
4126
  kind: "emailDomain";
4127
+ } | {
4128
+ value: string;
4129
+ kind: "recipientDid";
4058
4130
  };
4059
4131
  nodeAudience: string;
4060
4132
  contentSource: {
@@ -4097,6 +4169,9 @@ declare const ShareAddressedDelegationEnvelopeV2Schema: z.ZodObject<{
4097
4169
  } | {
4098
4170
  value: string;
4099
4171
  kind: "emailDomain";
4172
+ } | {
4173
+ value: string;
4174
+ kind: "recipientDid";
4100
4175
  };
4101
4176
  nodeAudience: string;
4102
4177
  contentSource: {
@@ -4154,6 +4229,9 @@ declare const ShareAddressedDelegationEnvelopeV2Schema: z.ZodObject<{
4154
4229
  } | {
4155
4230
  value: string;
4156
4231
  kind: "emailDomain";
4232
+ } | {
4233
+ value: string;
4234
+ kind: "recipientDid";
4157
4235
  };
4158
4236
  nodeAudience: string;
4159
4237
  contentSource: {
@@ -4203,6 +4281,9 @@ declare const ShareAddressedDelegationEnvelopeV2Schema: z.ZodObject<{
4203
4281
  } | {
4204
4282
  value: string;
4205
4283
  kind: "emailDomain";
4284
+ } | {
4285
+ value: string;
4286
+ kind: "recipientDid";
4206
4287
  };
4207
4288
  nodeAudience: string;
4208
4289
  contentSource: {
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@tinycloud/sdk-core",
3
- "version": "2.11.0-beta.5",
3
+ "version": "2.11.0-beta.8",
4
4
  "description": "Core TinyCloud SDK - shared interfaces and TinyCloud class",
5
5
  "author": "TinyCloud, Inc.",
6
6
  "license": "EGPL",
7
+ "sideEffects": false,
7
8
  "engines": {
8
9
  "node": ">=20"
9
10
  },
@@ -52,8 +53,10 @@
52
53
  "@multiformats/multiaddr-to-uri": "^12.0.0",
53
54
  "@multiformats/uri-to-multiaddr": "^10.0.0",
54
55
  "@noble/curves": "^1.9.7",
55
- "@tinycloud/bootstrap": "2.6.0",
56
- "@tinycloud/sdk-services": "2.11.0-beta.5",
56
+ "@tinycloud/share-envelope": "0.2.0-beta.0",
57
+ "@tinycloud/share-sdk": "0.2.0-beta.0",
58
+ "@tinycloud/bootstrap": "2.6.1-beta.0",
59
+ "@tinycloud/sdk-services": "2.11.0-beta.8",
57
60
  "multiformats": "^13.4.1",
58
61
  "ms": "^2.1.3",
59
62
  "siwe": "^3.0.0",