@tinycloud/sdk-core 2.11.0-beta.5 → 2.11.0-beta.7
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/delegations/index.cjs +92 -10
- package/dist/delegations/index.cjs.map +1 -1
- package/dist/delegations/index.d.cts +3 -2
- package/dist/delegations/index.d.ts +3 -2
- package/dist/delegations/index.js +94 -10
- package/dist/delegations/index.js.map +1 -1
- package/dist/index.cjs +52 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +74 -10
- package/dist/index.js.map +1 -1
- package/dist/{recipient-types.schema-CWIt63Qp.d.cts → recipient-types.schema-D5pDlIqn.d.cts} +82 -1
- package/dist/{recipient-types.schema-CWIt63Qp.d.ts → recipient-types.schema-D5pDlIqn.d.ts} +82 -1
- package/package.json +4 -2
|
@@ -35,10 +35,12 @@ __export(delegations_exports, {
|
|
|
35
35
|
DelegationErrorCodes: () => DelegationErrorCodes,
|
|
36
36
|
DelegationManager: () => DelegationManager,
|
|
37
37
|
EncodedShareDataSchema: () => EncodedShareDataSchema,
|
|
38
|
+
EncryptedSenderShareHistory: () => import_share_sdk.EncryptedSenderShareHistory,
|
|
38
39
|
MAX_CONTENT_BYTES: () => MAX_CONTENT_BYTES,
|
|
39
40
|
MAX_SEALED_SHARE_CONTENT_BYTES: () => MAX_SEALED_SHARE_CONTENT_BYTES,
|
|
40
41
|
MAX_SHARE_ARTIFACT_BYTES: () => MAX_SHARE_ARTIFACT_BYTES,
|
|
41
42
|
MAX_SHARE_CONTENT_BYTES: () => MAX_SHARE_CONTENT_BYTES,
|
|
43
|
+
MemoryEncryptedShareHistoryStorage: () => import_share_sdk.MemoryEncryptedShareHistoryStorage,
|
|
42
44
|
MemorySenderShareKeyStorage: () => MemorySenderShareKeyStorage,
|
|
43
45
|
MemorySenderShareRecordStorage: () => MemorySenderShareRecordStorage,
|
|
44
46
|
MemoryShareCache: () => MemoryShareCache,
|
|
@@ -53,6 +55,7 @@ __export(delegations_exports, {
|
|
|
53
55
|
ShareConflict: () => ShareConflict,
|
|
54
56
|
ShareEnvelopeError: () => ShareEnvelopeError,
|
|
55
57
|
ShareNativeResponseSchema: () => ShareNativeResponseSchema,
|
|
58
|
+
ShareReceiveError: () => import_share_sdk2.ShareReceiveError,
|
|
56
59
|
ShareRecipientClient: () => ShareRecipientClient,
|
|
57
60
|
ShareRecipientClientOptionsSchema: () => ShareRecipientClientOptionsSchema,
|
|
58
61
|
ShareRecipientPolicySchema: () => ShareRecipientPolicySchema,
|
|
@@ -60,7 +63,10 @@ __export(delegations_exports, {
|
|
|
60
63
|
ShareResourceSchema: () => ShareResourceSchema,
|
|
61
64
|
SharingService: () => SharingService,
|
|
62
65
|
SharingServiceConfigSchema: () => SharingServiceConfigSchema,
|
|
66
|
+
authorizationMethodForTarget: () => import_share_sdk.authorizationMethodForTarget,
|
|
67
|
+
authorizeShare: () => import_share_sdk.authorizeShare,
|
|
63
68
|
canonicalOwnerSharePolicy: () => canonicalOwnerSharePolicy,
|
|
69
|
+
claimShare: () => import_share_sdk.claimShare,
|
|
64
70
|
computeOwnerShareRegistrationCid: () => computeOwnerShareRegistrationCid,
|
|
65
71
|
computeShareCid: () => computeShareCid,
|
|
66
72
|
createDelegatedShareKey: () => createDelegatedShareKey,
|
|
@@ -75,23 +81,37 @@ __export(delegations_exports, {
|
|
|
75
81
|
encodeShareUrl: () => encodeShareUrl,
|
|
76
82
|
encryptShareBytes: () => encryptShareBytes,
|
|
77
83
|
encryptShareBytesAsync: () => encryptShareBytesAsync,
|
|
84
|
+
inspectShare: () => import_share_sdk2.inspectShare,
|
|
78
85
|
intersectShareCapabilities: () => intersectShareCapabilities,
|
|
86
|
+
isLegacyShareLink: () => import_share_sdk.isLegacyShareLink,
|
|
79
87
|
isV2ShareLink: () => isV2ShareLink,
|
|
88
|
+
listShares: () => import_share_sdk.listShares,
|
|
89
|
+
migrateShare: () => import_share_sdk.migrateShare,
|
|
80
90
|
normalizeShareActions: () => normalizeShareActions,
|
|
81
91
|
normalizeShareRecipientTarget: () => normalizeShareRecipientTarget,
|
|
82
92
|
normalizeShareResource: () => normalizeShareResource,
|
|
93
|
+
notifyShare: () => import_share_sdk.notifyShare,
|
|
83
94
|
parseShareArtifact: () => parseShareArtifact,
|
|
84
95
|
parseShareUrl: () => parseShareUrl,
|
|
96
|
+
publishPolicyShare: () => import_share_sdk.publishPolicyShare,
|
|
97
|
+
publishTargetShare: () => import_share_sdk.publishTargetShare,
|
|
98
|
+
receiveLegacyShare: () => import_share_sdk.receiveLegacyShare,
|
|
99
|
+
receiveShare: () => import_share_sdk2.receiveShare,
|
|
85
100
|
restoreDelegatedShareKey: () => restoreDelegatedShareKey,
|
|
101
|
+
resumeShareAuthorization: () => import_share_sdk.resumeShareAuthorization,
|
|
102
|
+
revokeShare: () => import_share_sdk.revokeShare,
|
|
86
103
|
shareCapabilityAllows: () => shareCapabilityAllows,
|
|
87
104
|
shareDeliveryTrustedKid: () => shareDeliveryTrustedKid,
|
|
105
|
+
showShare: () => import_share_sdk.showShare,
|
|
88
106
|
signShareEnvelope: () => signShareEnvelope,
|
|
107
|
+
toShareErrorInfo: () => import_share_sdk2.toShareErrorInfo,
|
|
89
108
|
validateEncodedShareData: () => validateEncodedShareData,
|
|
90
109
|
validateOwnerSharePolicyRegistration: () => validateOwnerSharePolicyRegistration,
|
|
91
110
|
validateOwnerSharePolicyRegistrationBytes: () => validateOwnerSharePolicyRegistrationBytes,
|
|
92
111
|
validateReceiveOptions: () => validateReceiveOptions,
|
|
93
112
|
validateShareDeliveryAuthorizationBytes: () => validateShareDeliveryAuthorizationBytes,
|
|
94
113
|
validateSharingServiceConfig: () => validateSharingServiceConfig,
|
|
114
|
+
verifyBearerEnvelope: () => import_share_sdk2.verifyBearerEnvelope,
|
|
95
115
|
verifyShareCid: () => verifyShareCid,
|
|
96
116
|
verifyShareEnvelope: () => verifyShareEnvelope
|
|
97
117
|
});
|
|
@@ -2820,6 +2840,10 @@ function normalizeRecipient(recipient) {
|
|
|
2820
2840
|
}
|
|
2821
2841
|
return { kind: recipient.kind, value: domain };
|
|
2822
2842
|
}
|
|
2843
|
+
if (recipient.kind === "recipientDid") {
|
|
2844
|
+
if (!isCanonicalRecipientDid(recipient.value)) throw new ShareEnvelopeError("invalid-envelope", "recipient DID is invalid");
|
|
2845
|
+
return { kind: recipient.kind, value: recipient.value };
|
|
2846
|
+
}
|
|
2823
2847
|
const exact = recipient.value.trim();
|
|
2824
2848
|
const at = exact.lastIndexOf("@");
|
|
2825
2849
|
const normalizedExact = at > 0 ? `${exact.slice(0, at)}@${exact.slice(at + 1).toLowerCase()}` : exact;
|
|
@@ -2828,6 +2852,28 @@ function normalizeRecipient(recipient) {
|
|
|
2828
2852
|
}
|
|
2829
2853
|
return { kind: recipient.kind, value: normalizedExact };
|
|
2830
2854
|
}
|
|
2855
|
+
function isCanonicalRecipientDid(value) {
|
|
2856
|
+
if (value.length === 0 || value.length > 2048 || /[\u0000-\u0020\u007f]/.test(value)) return false;
|
|
2857
|
+
const parts = value.split(":");
|
|
2858
|
+
if (parts.length < 3 || parts[0] !== "did" || !/^[a-z0-9]+$/.test(parts[1] ?? "")) return false;
|
|
2859
|
+
const identifier = parts.slice(2);
|
|
2860
|
+
if (identifier.some((part) => part.length === 0)) return false;
|
|
2861
|
+
if (parts[1] === "web") {
|
|
2862
|
+
const host = identifier[0] ?? "";
|
|
2863
|
+
if (host.length > 253 || host.split(".").some((label) => !label || label.length > 63 || !/^[A-Za-z0-9-]+$/.test(label) || label.startsWith("-") || label.endsWith("-"))) return false;
|
|
2864
|
+
return identifier.slice(1).every((part) => /^[A-Za-z0-9._%-]+$/.test(part));
|
|
2865
|
+
}
|
|
2866
|
+
if (parts[1] === "pkh") return identifier.length >= 3 && identifier.every((part) => /^[A-Za-z0-9._%-]+$/.test(part));
|
|
2867
|
+
if (parts[1] === "key") {
|
|
2868
|
+
try {
|
|
2869
|
+
const bytes2 = base58btc.decode(identifier.join(":"));
|
|
2870
|
+
return bytes2.length === 34 && bytes2[0] === 237 && bytes2[1] === 1;
|
|
2871
|
+
} catch {
|
|
2872
|
+
return false;
|
|
2873
|
+
}
|
|
2874
|
+
}
|
|
2875
|
+
return false;
|
|
2876
|
+
}
|
|
2831
2877
|
function normalizeShareRecipientTarget(recipient) {
|
|
2832
2878
|
const normalized = normalizeRecipient(recipient);
|
|
2833
2879
|
if (normalized === void 0) throw new ShareEnvelopeError("invalid-envelope", "recipient matcher is required");
|
|
@@ -2914,9 +2960,9 @@ function verifyShareEnvelope(envelope, options = {}) {
|
|
|
2914
2960
|
const recipient = normalizeRecipient(envelope.recipient);
|
|
2915
2961
|
if (recipient !== void 0 && JSON.stringify(recipient) !== JSON.stringify(envelope.recipient)) throw new ShareEnvelopeError("invalid-envelope", "recipient is not canonical");
|
|
2916
2962
|
if (recipient?.kind === "exactEmail" || recipient?.kind === "emailDomain") throw new ShareEnvelopeError("unsafe-plaintext", "recipient matchers are not public envelope fields");
|
|
2917
|
-
if (envelope.recipientKind !== void 0 && !["exactEmail", "emailDomain", "bearer"].includes(envelope.recipientKind)) throw new ShareEnvelopeError("invalid-envelope", "recipient mode is invalid");
|
|
2963
|
+
if (envelope.recipientKind !== void 0 && !["exactEmail", "emailDomain", "recipientDid", "bearer"].includes(envelope.recipientKind)) throw new ShareEnvelopeError("invalid-envelope", "recipient mode is invalid");
|
|
2918
2964
|
if (envelope.recipientKind === "bearer" && recipient?.kind !== void 0 && recipient.kind !== "bearer") throw new ShareEnvelopeError("invalid-envelope", "recipient mode does not match recipient");
|
|
2919
|
-
if ((envelope.recipientKind === "exactEmail" || envelope.recipientKind === "emailDomain") && !envelope.encrypted) throw new ShareEnvelopeError("unsafe-plaintext", "
|
|
2965
|
+
if ((envelope.recipientKind === "exactEmail" || envelope.recipientKind === "emailDomain" || envelope.recipientKind === "recipientDid") && !envelope.encrypted) throw new ShareEnvelopeError("unsafe-plaintext", "addressed shares require encryption");
|
|
2920
2966
|
if (typeof envelope.spaceId !== "string" || envelope.spaceId.length === 0 || typeof envelope.content.mimeType !== "string" || envelope.content.mimeType.length === 0 || typeof envelope.content.digest !== "string" || !/^[A-Za-z0-9_-]+$/.test(envelope.content.digest)) throw new ShareEnvelopeError("invalid-envelope", "content metadata is invalid");
|
|
2921
2967
|
const maxContentBytes = envelope.encrypted ? options.maxSealedContentBytes ?? MAX_SEALED_SHARE_CONTENT_BYTES : options.maxContentBytes ?? MAX_SHARE_CONTENT_BYTES;
|
|
2922
2968
|
if (!Number.isInteger(envelope.content.size) || envelope.content.size < 0 || envelope.content.size > maxContentBytes) throw new ShareEnvelopeError("content-too-large", "share content exceeds the configured limit");
|
|
@@ -3055,7 +3101,7 @@ function parsePolicyMetadata(policyBytes, target, expectedExpiry) {
|
|
|
3055
3101
|
assertKeys(policy, ["type", "version", "issuerDid", "recipientMatcher", "target", "delegation", "authority", "actions", "resource", "content-source", "expiresAt"], "published canonical policy material");
|
|
3056
3102
|
if (typeof policy.issuerDid !== "string" || typeof policy.expiresAt !== "string" || policy.expiresAt !== expectedExpiry) throw new ShareEnvelopeError("invalid-envelope", "policy expiry is not bound to the envelope");
|
|
3057
3103
|
const matcherValue = policy.recipientMatcher;
|
|
3058
|
-
if (!isPlainObject(matcherValue) || matcherValue.kind !== "exactEmail" && matcherValue.kind !== "emailDomain" || typeof matcherValue.value !== "string") throw new ShareEnvelopeError("invalid-envelope", "policy matcher is invalid");
|
|
3104
|
+
if (!isPlainObject(matcherValue) || matcherValue.kind !== "exactEmail" && matcherValue.kind !== "emailDomain" && matcherValue.kind !== "recipientDid" || typeof matcherValue.value !== "string") throw new ShareEnvelopeError("invalid-envelope", "policy matcher is invalid");
|
|
3059
3105
|
const matcher2 = normalizeRecipient(matcherValue);
|
|
3060
3106
|
if (matcher2 === void 0 || matcher2.kind === "bearer") throw new ShareEnvelopeError("invalid-envelope", "policy matcher is invalid");
|
|
3061
3107
|
if (!isPlainObject(policy.target)) throw new ShareEnvelopeError("invalid-envelope", "policy target is invalid");
|
|
@@ -3142,7 +3188,7 @@ function parseCanonicalPublishedV2(value, options) {
|
|
|
3142
3188
|
if (!Number.isFinite(expiry) || expiry <= (options.now ?? /* @__PURE__ */ new Date()).getTime() || new Date(expiry).toISOString() !== value.expiry) throw new ShareEnvelopeError("expired", "published share envelope has expired");
|
|
3143
3189
|
if (typeof delegation.cid !== "string" || typeof delegation.issuerDid !== "string" || typeof delegation.audience !== "string" || typeof delegation.expiresAt !== "string" || Date.parse(delegation.expiresAt) > expiry) throw new ShareEnvelopeError("invalid-envelope", "published v2 delegation is invalid");
|
|
3144
3190
|
const matcher = value.recipientMatcher;
|
|
3145
|
-
if (!isPlainObject(matcher) || matcher.kind !== "exactEmail" && matcher.kind !== "emailDomain" || typeof matcher.value !== "string") throw new ShareEnvelopeError("invalid-envelope", "published v2 recipient matcher is invalid");
|
|
3191
|
+
if (!isPlainObject(matcher) || matcher.kind !== "exactEmail" && matcher.kind !== "emailDomain" && matcher.kind !== "recipientDid" || typeof matcher.value !== "string") throw new ShareEnvelopeError("invalid-envelope", "published v2 recipient matcher is invalid");
|
|
3146
3192
|
const normalizedMatcher = normalizeRecipient(matcher);
|
|
3147
3193
|
if (normalizedMatcher === void 0 || normalizedMatcher.kind === "bearer") throw new ShareEnvelopeError("invalid-envelope", "published v2 recipient matcher is invalid");
|
|
3148
3194
|
if (!Array.isArray(value.actions)) throw new ShareEnvelopeError("invalid-envelope", "published v2 actions are invalid");
|
|
@@ -3583,10 +3629,11 @@ var ShareConflict = class extends Error {
|
|
|
3583
3629
|
}
|
|
3584
3630
|
};
|
|
3585
3631
|
var ShareAccessError = class extends Error {
|
|
3586
|
-
constructor(code3, message) {
|
|
3632
|
+
constructor(code3, message, details) {
|
|
3587
3633
|
super(message ?? "shared access could not be completed");
|
|
3588
3634
|
this.name = "ShareAccessError";
|
|
3589
3635
|
this.code = code3;
|
|
3636
|
+
this.details = details;
|
|
3590
3637
|
}
|
|
3591
3638
|
};
|
|
3592
3639
|
|
|
@@ -3595,6 +3642,7 @@ var import_zod3 = require("zod");
|
|
|
3595
3642
|
var ShareRecipientTargetSchema = import_zod3.z.discriminatedUnion("kind", [
|
|
3596
3643
|
import_zod3.z.object({ kind: import_zod3.z.literal("exactEmail"), value: import_zod3.z.string().min(1) }).strict(),
|
|
3597
3644
|
import_zod3.z.object({ kind: import_zod3.z.literal("emailDomain"), value: import_zod3.z.string().min(1) }).strict(),
|
|
3645
|
+
import_zod3.z.object({ kind: import_zod3.z.literal("recipientDid"), value: import_zod3.z.string().regex(/^did:[a-z0-9]+:.+$/) }).strict(),
|
|
3598
3646
|
import_zod3.z.object({ kind: import_zod3.z.literal("bearer") }).strict()
|
|
3599
3647
|
]);
|
|
3600
3648
|
var ShareResourceSchema = import_zod3.z.discriminatedUnion("kind", [
|
|
@@ -3638,7 +3686,8 @@ var ShareContentSourceSchema = import_zod3.z.discriminatedUnion("kind", [
|
|
|
3638
3686
|
]);
|
|
3639
3687
|
var ShareAddressedRecipientSchema = import_zod3.z.discriminatedUnion("kind", [
|
|
3640
3688
|
import_zod3.z.object({ kind: import_zod3.z.literal("exactEmail"), value: import_zod3.z.string().min(1) }).strict(),
|
|
3641
|
-
import_zod3.z.object({ kind: import_zod3.z.literal("emailDomain"), value: import_zod3.z.string().min(1) }).strict()
|
|
3689
|
+
import_zod3.z.object({ kind: import_zod3.z.literal("emailDomain"), value: import_zod3.z.string().min(1) }).strict(),
|
|
3690
|
+
import_zod3.z.object({ kind: import_zod3.z.literal("recipientDid"), value: import_zod3.z.string().regex(/^did:[a-z0-9]+:.+$/) }).strict()
|
|
3642
3691
|
]);
|
|
3643
3692
|
var ShareAddressedDelegationRequestV2Schema = import_zod3.z.object({
|
|
3644
3693
|
version: import_zod3.z.literal(2),
|
|
@@ -3893,12 +3942,21 @@ var ShareRecipientClient = class {
|
|
|
3893
3942
|
const { envelope } = resolved.artifact;
|
|
3894
3943
|
const { location } = resolved;
|
|
3895
3944
|
const bearer = isBearerEnvelope(envelope);
|
|
3896
|
-
const policy = envelope.recipientKind === "exactEmail" || envelope.recipientKind === "emailDomain";
|
|
3945
|
+
const policy = envelope.recipientKind === "exactEmail" || envelope.recipientKind === "emailDomain" || envelope.authorizationTargetKind === "recipientDid";
|
|
3897
3946
|
const legacyBearer = !policy && envelope.recipientKind === void 0;
|
|
3898
|
-
|
|
3947
|
+
let recipientDidSession;
|
|
3948
|
+
if (envelope.authorizationTargetKind === "recipientDid") {
|
|
3949
|
+
if (this.options.establishRecipientDidSession === void 0) throw new ShareAccessError("SHARE_DEVICE_AUTH_REQUIRED", "an OpenKey device authorization is required");
|
|
3950
|
+
const authorization = await this.options.establishRecipientDidSession({ envelope, recipientDid: envelope.recipient?.kind === "recipientDid" ? envelope.recipient.value : "" });
|
|
3951
|
+
if ("state" in authorization) {
|
|
3952
|
+
if (authorization.state === "authorization-required") throw new ShareAccessError("SHARE_DEVICE_AUTH_REQUIRED", "an OpenKey device authorization is required", authorization);
|
|
3953
|
+
throw new ShareAccessError("SHARE_DENIED", "recipient DID authorization was denied", authorization);
|
|
3954
|
+
}
|
|
3955
|
+
recipientDidSession = authorization;
|
|
3956
|
+
}
|
|
3899
3957
|
if (policy && this.options.bearerSession !== void 0) throw new ShareAccessError("SHARE_POLICY_BEARER_MISMATCH");
|
|
3900
3958
|
if (bearer && this.options.presentation !== void 0) throw new ShareAccessError("SHARE_BEARER_PRESENTATION_MISMATCH");
|
|
3901
|
-
const session = bearer || legacyBearer ? this.options.bearerSession : policy && this.options.establishPolicySession !== void 0 ? await this.options.establishPolicySession({ envelope, presentation: this.options.presentation }) : policy ? await this.establishPolicySession(envelope) : void 0;
|
|
3959
|
+
const session = bearer || legacyBearer ? this.options.bearerSession : recipientDidSession ? recipientDidSession : policy && this.options.establishPolicySession !== void 0 ? await this.options.establishPolicySession({ envelope, presentation: this.options.presentation }) : policy ? await this.establishPolicySession(envelope) : void 0;
|
|
3902
3960
|
const kv = bearer || legacyBearer ? session === void 0 ? void 0 : this.createKV(envelope.origin, session) : void 0;
|
|
3903
3961
|
const policySession = policy ? session : void 0;
|
|
3904
3962
|
if (policySession !== void 0) this.assertProvidedPolicySession(policySession, envelope);
|
|
@@ -6336,7 +6394,7 @@ function validateShareDeliveryAuthorizationBytes(bytesValue, expected) {
|
|
|
6336
6394
|
const authorization = assertObject2(root.authorization, AUTHORIZATION_KEYS, "share delivery authorization");
|
|
6337
6395
|
const proof = assertObject2(root.proof, ["alg", "kid", "signature"], "share delivery authorization proof");
|
|
6338
6396
|
const request = expected.request;
|
|
6339
|
-
if (authorization.type !== "TinyCloudShareDeliveryAuthorization" || authorization.version !== 2 || authorization.dataAuthority !== false || authorization.jti !== request.jti || authorization.shareCid !== request.shareCid || authorization.shareId !== request.shareId || authorization.registrationCid !== request.registrationCid || authorization.delegationCid !== request.delegationCid || authorization.enforcementDelegationCid !== request.enforcementDelegationCid || authorization.envelopeCid !== request.envelopeCid || authorization.policyCid !== request.policyCid || authorization.deliveryEmail !== request.recipientEmail || authorization.shareUrl !== request.shareUrl || authorization.documentName !== request.documentName || authorization.requestBodyDigest !== request.requestBodyDigest || authorization.expiresAt !== request.expiresAt || authorization.idempotencyKey !== request.
|
|
6397
|
+
if (authorization.type !== "TinyCloudShareDeliveryAuthorization" || authorization.version !== 2 || authorization.dataAuthority !== false || authorization.jti !== request.jti || authorization.shareCid !== request.shareCid || authorization.shareId !== request.shareId || authorization.registrationCid !== request.registrationCid || authorization.delegationCid !== request.delegationCid || authorization.enforcementDelegationCid !== request.enforcementDelegationCid || authorization.envelopeCid !== request.envelopeCid || authorization.policyCid !== request.policyCid || authorization.deliveryEmail !== request.recipientEmail || authorization.shareUrl !== request.shareUrl || authorization.documentName !== request.documentName || authorization.requestBodyDigest !== request.requestBodyDigest || authorization.expiresAt !== request.expiresAt || authorization.idempotencyKey !== request.idempotencyKey || authorization.reportAbuseToken !== request.jti || authorization.authorityMaterialHandle !== request.registrationCid) {
|
|
6340
6398
|
throw new Error("share delivery authorization is not bound to the submitted request");
|
|
6341
6399
|
}
|
|
6342
6400
|
if (typeof authorization.issuedAt !== "string" || Date.parse(authorization.issuedAt) > Date.now() + 6e4) throw new Error("share delivery authorization issuedAt is invalid");
|
|
@@ -6470,15 +6528,21 @@ var SenderShareStore = class {
|
|
|
6470
6528
|
await this.keys.delete(shareId);
|
|
6471
6529
|
}
|
|
6472
6530
|
};
|
|
6531
|
+
|
|
6532
|
+
// src/delegations/index.ts
|
|
6533
|
+
var import_share_sdk = require("@tinycloud/share-sdk");
|
|
6534
|
+
var import_share_sdk2 = require("@tinycloud/share-sdk");
|
|
6473
6535
|
// Annotate the CommonJS export names for ESM import in node:
|
|
6474
6536
|
0 && (module.exports = {
|
|
6475
6537
|
DelegationErrorCodes,
|
|
6476
6538
|
DelegationManager,
|
|
6477
6539
|
EncodedShareDataSchema,
|
|
6540
|
+
EncryptedSenderShareHistory,
|
|
6478
6541
|
MAX_CONTENT_BYTES,
|
|
6479
6542
|
MAX_SEALED_SHARE_CONTENT_BYTES,
|
|
6480
6543
|
MAX_SHARE_ARTIFACT_BYTES,
|
|
6481
6544
|
MAX_SHARE_CONTENT_BYTES,
|
|
6545
|
+
MemoryEncryptedShareHistoryStorage,
|
|
6482
6546
|
MemorySenderShareKeyStorage,
|
|
6483
6547
|
MemorySenderShareRecordStorage,
|
|
6484
6548
|
MemoryShareCache,
|
|
@@ -6493,6 +6557,7 @@ var SenderShareStore = class {
|
|
|
6493
6557
|
ShareConflict,
|
|
6494
6558
|
ShareEnvelopeError,
|
|
6495
6559
|
ShareNativeResponseSchema,
|
|
6560
|
+
ShareReceiveError,
|
|
6496
6561
|
ShareRecipientClient,
|
|
6497
6562
|
ShareRecipientClientOptionsSchema,
|
|
6498
6563
|
ShareRecipientPolicySchema,
|
|
@@ -6500,7 +6565,10 @@ var SenderShareStore = class {
|
|
|
6500
6565
|
ShareResourceSchema,
|
|
6501
6566
|
SharingService,
|
|
6502
6567
|
SharingServiceConfigSchema,
|
|
6568
|
+
authorizationMethodForTarget,
|
|
6569
|
+
authorizeShare,
|
|
6503
6570
|
canonicalOwnerSharePolicy,
|
|
6571
|
+
claimShare,
|
|
6504
6572
|
computeOwnerShareRegistrationCid,
|
|
6505
6573
|
computeShareCid,
|
|
6506
6574
|
createDelegatedShareKey,
|
|
@@ -6515,23 +6583,37 @@ var SenderShareStore = class {
|
|
|
6515
6583
|
encodeShareUrl,
|
|
6516
6584
|
encryptShareBytes,
|
|
6517
6585
|
encryptShareBytesAsync,
|
|
6586
|
+
inspectShare,
|
|
6518
6587
|
intersectShareCapabilities,
|
|
6588
|
+
isLegacyShareLink,
|
|
6519
6589
|
isV2ShareLink,
|
|
6590
|
+
listShares,
|
|
6591
|
+
migrateShare,
|
|
6520
6592
|
normalizeShareActions,
|
|
6521
6593
|
normalizeShareRecipientTarget,
|
|
6522
6594
|
normalizeShareResource,
|
|
6595
|
+
notifyShare,
|
|
6523
6596
|
parseShareArtifact,
|
|
6524
6597
|
parseShareUrl,
|
|
6598
|
+
publishPolicyShare,
|
|
6599
|
+
publishTargetShare,
|
|
6600
|
+
receiveLegacyShare,
|
|
6601
|
+
receiveShare,
|
|
6525
6602
|
restoreDelegatedShareKey,
|
|
6603
|
+
resumeShareAuthorization,
|
|
6604
|
+
revokeShare,
|
|
6526
6605
|
shareCapabilityAllows,
|
|
6527
6606
|
shareDeliveryTrustedKid,
|
|
6607
|
+
showShare,
|
|
6528
6608
|
signShareEnvelope,
|
|
6609
|
+
toShareErrorInfo,
|
|
6529
6610
|
validateEncodedShareData,
|
|
6530
6611
|
validateOwnerSharePolicyRegistration,
|
|
6531
6612
|
validateOwnerSharePolicyRegistrationBytes,
|
|
6532
6613
|
validateReceiveOptions,
|
|
6533
6614
|
validateShareDeliveryAuthorizationBytes,
|
|
6534
6615
|
validateSharingServiceConfig,
|
|
6616
|
+
verifyBearerEnvelope,
|
|
6535
6617
|
verifyShareCid,
|
|
6536
6618
|
verifyShareEnvelope
|
|
6537
6619
|
});
|