@tinycloud/sdk-core 3.1.0-beta.1 → 3.1.0-beta.11
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 +35 -9
- package/dist/delegations/index.cjs.map +1 -1
- package/dist/delegations/index.d.cts +2 -2
- package/dist/delegations/index.d.ts +2 -2
- package/dist/delegations/index.js +33 -7
- package/dist/delegations/index.js.map +1 -1
- package/dist/index.cjs +464 -358
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +42 -9
- package/dist/index.d.ts +42 -9
- package/dist/index.js +300 -186
- package/dist/index.js.map +1 -1
- package/dist/policy/index.cjs +36 -16
- package/dist/policy/index.cjs.map +1 -1
- package/dist/policy/index.js +36 -16
- package/dist/policy/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/{recipient-types.schema-D9AI8tjN.d.cts → recipient-types.schema-_JkBDZB6.d.cts} +2 -2
- package/dist/{recipient-types.schema-D9AI8tjN.d.ts → recipient-types.schema-_JkBDZB6.d.ts} +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as ICapabilityKeyRegistry, D as DelegationManager, R as Result, a as DelegationError } from '../recipient-types.schema-
|
|
2
|
-
export { A as AccountDelegationPage, b as AccountDelegationQueryOptions, c as AccountDelegationRecord, d as AccountDelegationResource, C as CREDENTIAL_INVITATION_REQUEST_DOMAIN, e as CapabilityEntry, f as CreateDelegationParams, g as CreateDelegationWasmParams, h as CreateDelegationWasmResult, i as CreateOwnerDelegationParams, j as CredentialInvitationRequest, k as DELIVERY_ADMISSION_DOMAIN, l as DelegateReceivedShareParams, m as DelegatedResource, n as DelegatedShareAccess, o as DelegatedShareKey, p as Delegation, q as DelegationApiResponse, r as DelegationChain, s as DelegationChainV2, t as DelegationDirection, u as DelegationErrorCode, v as DelegationErrorCodes, w as DelegationFilters, x as DelegationManagerConfig, y as DelegationRecord, z as DelegationRevocationReceipt, B as DelegationStatus, E as DeliveryAdmission, F as EncodedShareData, G as GenerateShareParams, H as ISharingService, J as IngestOptions, K as JWK, L as KeyInfo, M as KeyProvider, N as KeyType, O as MAX_CONTENT_BYTES, P as MAX_SEALED_SHARE_CONTENT_BYTES, Q as MAX_SHARE_ARTIFACT_BYTES, S as MAX_SHARE_CONTENT_BYTES, T as MemorySenderShareKeyStorage, U as MemorySenderShareRecordStorage, V as MemoryShareCache, W as OwnerDelegationPermission, X as OwnerDelegationReceipt, Y as OwnerShareAction, Z as OwnerShareDecryption, _ as OwnerShareMatcher, $ as OwnerSharePolicyRegistration, a0 as OwnerSharePolicyRegistrationReceipt, a1 as OwnerSharePolicyV2, a2 as PortableDelegationImportReceipt, a3 as ReceiveOptions, a4 as RegisterOwnerSharePolicyParams, a5 as SenderShareKeyStorage, a6 as SenderShareRecord, a7 as SenderShareRecordStorage, a8 as SenderShareRevocationScope, a9 as SenderShareStore, aa as ShareAccess, ab as ShareAccessError, ac as ShareAccessV2, ad as ShareAction, ae as ShareActionSchema, af as ShareAddressedDelegationEnvelopeV2, ag as ShareAddressedDelegationEnvelopeV2Schema, ah as ShareAddressedDelegationRequestV2, ai as ShareAddressedDelegationRequestV2Schema, aj as ShareAddressedDelegationResponseV2, ak as ShareAddressedDelegationResponseV2Schema, al as ShareAddressedRecipientMatcher, am as ShareArtifactInput, an as ShareArtifactResult, ao as ShareArtifactV2, ap as ShareCache, aq as ShareCacheEntry, ar as ShareCacheKey, as as ShareCacheMetadata, at as ShareCapabilityLike, au as ShareConflict, av as ShareContentMetadata, aw as ShareContentSource, ax as ShareDelegationPreflight, ay as ShareDeliveryAuthorizationV3Receipt, az as ShareDeliveryAuthorizationV3Request, aA as ShareDetachedProof, aB as ShareEnvelopeError, aC as ShareEnvelopeV2, aD as ShareExpiryBounds, aE as ShareKvContentSource, aF as ShareLink, aG as ShareLinkData, aH as ShareLinkLocation, aI as ShareListEntry, aJ as ShareListResult, aK as ShareNativeAction, aL as ShareNativeInvokeEnvelopeV1, aM as ShareNativeInvokeErrorResult, aN as ShareNativeInvokeInput, aO as ShareNativeInvokeResult, aP as ShareNativeInvokeSuccessResult, aQ as ShareNativeResponse, aR as ShareNativeResponseSchema, aS as SharePolicy, aT as SharePolicyBinding, aU as SharePolicySession, aV as SharePolicySessionV1, aW as SharePolicySessionWireV1, aX as SharePortableDelegation, aY as ShareReadInvocationV1, aZ as ShareReadResult, a_ as ShareRecipientClient, a$ as ShareRecipientClientOptions, b0 as ShareRecipientClientOptionsSchema, b1 as ShareRecipientPolicy, b2 as ShareRecipientPolicySchema, b3 as ShareRecipientResult, b4 as ShareRecipientTarget, b5 as ShareRecipientTargetSchema, b6 as ShareResource, b7 as ShareResourceSchema, b8 as ShareSaveOptions, b9 as ShareSchema, ba as ShareSqlContentSource, bb as ShareWireAction, bc as SharingService, bd as SharingServiceConfig, be as SignedDelegation, bf as SpaceInfo, bg as SpaceOwnership, bh as VerifyShareEnvelopeOptions, bi as canonicalOwnerSharePolicy, bj as computeOwnerShareRegistrationCid, bk as computeShareCid, bl as createDelegatedShareKey, bm as createPolicyEnforcementDelegation, bn as createShareArtifact, bo as createShareArtifactAsync, bp as createSharePolicy, bq as createSharingService, br as decryptShareBytesAsync, bs as delegatePortablePolicySession, bt as encodeInlineShareUrl, bu as encodeShareArtifact, bv as encodeShareUrl, bw as encryptShareBytes, bx as encryptShareBytesAsync, by as importPortableDelegation, bz as intersectShareCapabilities, bA as isV2ShareLink, bB as normalizeShareActions, bC as normalizeShareRecipientTarget, bD as normalizeShareResource, bE as parsePortableDelegation, bF as parseShareArtifact, bG as parseShareUrl, bH as restoreDelegatedShareKey, bI as serializePortableDelegation, bJ as shareCapabilityAllows, bK as signShareEnvelope, bL as validateOwnerSharePolicyRegistration, bM as validateOwnerSharePolicyRegistrationBytes, bN as validateShareDeliveryAuthorizationV3Bytes, bO as verifyShareCid, bP as verifyShareEnvelope } from '../recipient-types.schema-
|
|
1
|
+
import { I as ICapabilityKeyRegistry, D as DelegationManager, R as Result, a as DelegationError } from '../recipient-types.schema-_JkBDZB6.cjs';
|
|
2
|
+
export { A as AccountDelegationPage, b as AccountDelegationQueryOptions, c as AccountDelegationRecord, d as AccountDelegationResource, C as CREDENTIAL_INVITATION_REQUEST_DOMAIN, e as CapabilityEntry, f as CreateDelegationParams, g as CreateDelegationWasmParams, h as CreateDelegationWasmResult, i as CreateOwnerDelegationParams, j as CredentialInvitationRequest, k as DELIVERY_ADMISSION_DOMAIN, l as DelegateReceivedShareParams, m as DelegatedResource, n as DelegatedShareAccess, o as DelegatedShareKey, p as Delegation, q as DelegationApiResponse, r as DelegationChain, s as DelegationChainV2, t as DelegationDirection, u as DelegationErrorCode, v as DelegationErrorCodes, w as DelegationFilters, x as DelegationManagerConfig, y as DelegationRecord, z as DelegationRevocationReceipt, B as DelegationStatus, E as DeliveryAdmission, F as EncodedShareData, G as GenerateShareParams, H as ISharingService, J as IngestOptions, K as JWK, L as KeyInfo, M as KeyProvider, N as KeyType, O as MAX_CONTENT_BYTES, P as MAX_SEALED_SHARE_CONTENT_BYTES, Q as MAX_SHARE_ARTIFACT_BYTES, S as MAX_SHARE_CONTENT_BYTES, T as MemorySenderShareKeyStorage, U as MemorySenderShareRecordStorage, V as MemoryShareCache, W as OwnerDelegationPermission, X as OwnerDelegationReceipt, Y as OwnerShareAction, Z as OwnerShareDecryption, _ as OwnerShareMatcher, $ as OwnerSharePolicyRegistration, a0 as OwnerSharePolicyRegistrationReceipt, a1 as OwnerSharePolicyV2, a2 as PortableDelegationImportReceipt, a3 as ReceiveOptions, a4 as RegisterOwnerSharePolicyParams, a5 as SenderShareKeyStorage, a6 as SenderShareRecord, a7 as SenderShareRecordStorage, a8 as SenderShareRevocationScope, a9 as SenderShareStore, aa as ShareAccess, ab as ShareAccessError, ac as ShareAccessV2, ad as ShareAction, ae as ShareActionSchema, af as ShareAddressedDelegationEnvelopeV2, ag as ShareAddressedDelegationEnvelopeV2Schema, ah as ShareAddressedDelegationRequestV2, ai as ShareAddressedDelegationRequestV2Schema, aj as ShareAddressedDelegationResponseV2, ak as ShareAddressedDelegationResponseV2Schema, al as ShareAddressedRecipientMatcher, am as ShareArtifactInput, an as ShareArtifactResult, ao as ShareArtifactV2, ap as ShareCache, aq as ShareCacheEntry, ar as ShareCacheKey, as as ShareCacheMetadata, at as ShareCapabilityLike, au as ShareConflict, av as ShareContentMetadata, aw as ShareContentSource, ax as ShareDelegationPreflight, ay as ShareDeliveryAuthorizationV3Receipt, az as ShareDeliveryAuthorizationV3Request, aA as ShareDetachedProof, aB as ShareEnvelopeError, aC as ShareEnvelopeV2, aD as ShareExpiryBounds, aE as ShareKvContentSource, aF as ShareLink, aG as ShareLinkData, aH as ShareLinkLocation, aI as ShareListEntry, aJ as ShareListResult, aK as ShareNativeAction, aL as ShareNativeInvokeEnvelopeV1, aM as ShareNativeInvokeErrorResult, aN as ShareNativeInvokeInput, aO as ShareNativeInvokeResult, aP as ShareNativeInvokeSuccessResult, aQ as ShareNativeResponse, aR as ShareNativeResponseSchema, aS as SharePolicy, aT as SharePolicyBinding, aU as SharePolicySession, aV as SharePolicySessionV1, aW as SharePolicySessionWireV1, aX as SharePortableDelegation, aY as ShareReadInvocationV1, aZ as ShareReadResult, a_ as ShareRecipientClient, a$ as ShareRecipientClientOptions, b0 as ShareRecipientClientOptionsSchema, b1 as ShareRecipientPolicy, b2 as ShareRecipientPolicySchema, b3 as ShareRecipientResult, b4 as ShareRecipientTarget, b5 as ShareRecipientTargetSchema, b6 as ShareResource, b7 as ShareResourceSchema, b8 as ShareSaveOptions, b9 as ShareSchema, ba as ShareSqlContentSource, bb as ShareWireAction, bc as SharingService, bd as SharingServiceConfig, be as SignedDelegation, bf as SpaceInfo, bg as SpaceOwnership, bh as VerifyShareEnvelopeOptions, bi as canonicalOwnerSharePolicy, bj as computeOwnerShareRegistrationCid, bk as computeShareCid, bl as createDelegatedShareKey, bm as createPolicyEnforcementDelegation, bn as createShareArtifact, bo as createShareArtifactAsync, bp as createSharePolicy, bq as createSharingService, br as decryptShareBytesAsync, bs as delegatePortablePolicySession, bt as encodeInlineShareUrl, bu as encodeShareArtifact, bv as encodeShareUrl, bw as encryptShareBytes, bx as encryptShareBytesAsync, by as importPortableDelegation, bz as intersectShareCapabilities, bA as isV2ShareLink, bB as normalizeShareActions, bC as normalizeShareRecipientTarget, bD as normalizeShareResource, bE as parsePortableDelegation, bF as parseShareArtifact, bG as parseShareUrl, bH as restoreDelegatedShareKey, bI as serializePortableDelegation, bJ as shareCapabilityAllows, bK as signShareEnvelope, bL as validateOwnerSharePolicyRegistration, bM as validateOwnerSharePolicyRegistrationBytes, bN as validateShareDeliveryAuthorizationV3Bytes, bO as verifyShareCid, bP as verifyShareEnvelope } from '../recipient-types.schema-_JkBDZB6.cjs';
|
|
3
3
|
export { EncryptedSenderShareHistory, EncryptedShareHistoryStorage, MemoryEncryptedShareHistoryStorage, ShareAuthorizationAdapter, ShareAuthorizationDenied, ShareAuthorizationMethod, ShareAuthorizationReady, ShareAuthorizationRequired, ShareAuthorizationResult, ShareDeliveryAdapter, ShareErrorCode, ShareErrorInfo, ShareFetchOptions, ShareHistoryView, ShareInspection, ShareMetadata, ShareNotifyResult, ShareNotifyState, SharePolicyPublishAdapter, ShareReceiveError, ShareReceiveResult, ShareRevocationAdapter, ShareRevocationResult, ShareTarget, TargetPublishAdapter, TargetPublishInput, TargetPublishOutcome, authorizationMethodForTarget, authorizeShare, claimShare, inspectShare, listShares, notifyShare, publishPolicyShare, publishTargetShare, receiveShare, resumeShareAuthorization, revokeShare, showShare, toShareErrorInfo } from '@tinycloud/share-sdk';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { ServiceSession, InvokeFunction, FetchFunction, IKVService } from '@tinycloud/sdk-services';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as ICapabilityKeyRegistry, D as DelegationManager, R as Result, a as DelegationError } from '../recipient-types.schema-
|
|
2
|
-
export { A as AccountDelegationPage, b as AccountDelegationQueryOptions, c as AccountDelegationRecord, d as AccountDelegationResource, C as CREDENTIAL_INVITATION_REQUEST_DOMAIN, e as CapabilityEntry, f as CreateDelegationParams, g as CreateDelegationWasmParams, h as CreateDelegationWasmResult, i as CreateOwnerDelegationParams, j as CredentialInvitationRequest, k as DELIVERY_ADMISSION_DOMAIN, l as DelegateReceivedShareParams, m as DelegatedResource, n as DelegatedShareAccess, o as DelegatedShareKey, p as Delegation, q as DelegationApiResponse, r as DelegationChain, s as DelegationChainV2, t as DelegationDirection, u as DelegationErrorCode, v as DelegationErrorCodes, w as DelegationFilters, x as DelegationManagerConfig, y as DelegationRecord, z as DelegationRevocationReceipt, B as DelegationStatus, E as DeliveryAdmission, F as EncodedShareData, G as GenerateShareParams, H as ISharingService, J as IngestOptions, K as JWK, L as KeyInfo, M as KeyProvider, N as KeyType, O as MAX_CONTENT_BYTES, P as MAX_SEALED_SHARE_CONTENT_BYTES, Q as MAX_SHARE_ARTIFACT_BYTES, S as MAX_SHARE_CONTENT_BYTES, T as MemorySenderShareKeyStorage, U as MemorySenderShareRecordStorage, V as MemoryShareCache, W as OwnerDelegationPermission, X as OwnerDelegationReceipt, Y as OwnerShareAction, Z as OwnerShareDecryption, _ as OwnerShareMatcher, $ as OwnerSharePolicyRegistration, a0 as OwnerSharePolicyRegistrationReceipt, a1 as OwnerSharePolicyV2, a2 as PortableDelegationImportReceipt, a3 as ReceiveOptions, a4 as RegisterOwnerSharePolicyParams, a5 as SenderShareKeyStorage, a6 as SenderShareRecord, a7 as SenderShareRecordStorage, a8 as SenderShareRevocationScope, a9 as SenderShareStore, aa as ShareAccess, ab as ShareAccessError, ac as ShareAccessV2, ad as ShareAction, ae as ShareActionSchema, af as ShareAddressedDelegationEnvelopeV2, ag as ShareAddressedDelegationEnvelopeV2Schema, ah as ShareAddressedDelegationRequestV2, ai as ShareAddressedDelegationRequestV2Schema, aj as ShareAddressedDelegationResponseV2, ak as ShareAddressedDelegationResponseV2Schema, al as ShareAddressedRecipientMatcher, am as ShareArtifactInput, an as ShareArtifactResult, ao as ShareArtifactV2, ap as ShareCache, aq as ShareCacheEntry, ar as ShareCacheKey, as as ShareCacheMetadata, at as ShareCapabilityLike, au as ShareConflict, av as ShareContentMetadata, aw as ShareContentSource, ax as ShareDelegationPreflight, ay as ShareDeliveryAuthorizationV3Receipt, az as ShareDeliveryAuthorizationV3Request, aA as ShareDetachedProof, aB as ShareEnvelopeError, aC as ShareEnvelopeV2, aD as ShareExpiryBounds, aE as ShareKvContentSource, aF as ShareLink, aG as ShareLinkData, aH as ShareLinkLocation, aI as ShareListEntry, aJ as ShareListResult, aK as ShareNativeAction, aL as ShareNativeInvokeEnvelopeV1, aM as ShareNativeInvokeErrorResult, aN as ShareNativeInvokeInput, aO as ShareNativeInvokeResult, aP as ShareNativeInvokeSuccessResult, aQ as ShareNativeResponse, aR as ShareNativeResponseSchema, aS as SharePolicy, aT as SharePolicyBinding, aU as SharePolicySession, aV as SharePolicySessionV1, aW as SharePolicySessionWireV1, aX as SharePortableDelegation, aY as ShareReadInvocationV1, aZ as ShareReadResult, a_ as ShareRecipientClient, a$ as ShareRecipientClientOptions, b0 as ShareRecipientClientOptionsSchema, b1 as ShareRecipientPolicy, b2 as ShareRecipientPolicySchema, b3 as ShareRecipientResult, b4 as ShareRecipientTarget, b5 as ShareRecipientTargetSchema, b6 as ShareResource, b7 as ShareResourceSchema, b8 as ShareSaveOptions, b9 as ShareSchema, ba as ShareSqlContentSource, bb as ShareWireAction, bc as SharingService, bd as SharingServiceConfig, be as SignedDelegation, bf as SpaceInfo, bg as SpaceOwnership, bh as VerifyShareEnvelopeOptions, bi as canonicalOwnerSharePolicy, bj as computeOwnerShareRegistrationCid, bk as computeShareCid, bl as createDelegatedShareKey, bm as createPolicyEnforcementDelegation, bn as createShareArtifact, bo as createShareArtifactAsync, bp as createSharePolicy, bq as createSharingService, br as decryptShareBytesAsync, bs as delegatePortablePolicySession, bt as encodeInlineShareUrl, bu as encodeShareArtifact, bv as encodeShareUrl, bw as encryptShareBytes, bx as encryptShareBytesAsync, by as importPortableDelegation, bz as intersectShareCapabilities, bA as isV2ShareLink, bB as normalizeShareActions, bC as normalizeShareRecipientTarget, bD as normalizeShareResource, bE as parsePortableDelegation, bF as parseShareArtifact, bG as parseShareUrl, bH as restoreDelegatedShareKey, bI as serializePortableDelegation, bJ as shareCapabilityAllows, bK as signShareEnvelope, bL as validateOwnerSharePolicyRegistration, bM as validateOwnerSharePolicyRegistrationBytes, bN as validateShareDeliveryAuthorizationV3Bytes, bO as verifyShareCid, bP as verifyShareEnvelope } from '../recipient-types.schema-
|
|
1
|
+
import { I as ICapabilityKeyRegistry, D as DelegationManager, R as Result, a as DelegationError } from '../recipient-types.schema-_JkBDZB6.js';
|
|
2
|
+
export { A as AccountDelegationPage, b as AccountDelegationQueryOptions, c as AccountDelegationRecord, d as AccountDelegationResource, C as CREDENTIAL_INVITATION_REQUEST_DOMAIN, e as CapabilityEntry, f as CreateDelegationParams, g as CreateDelegationWasmParams, h as CreateDelegationWasmResult, i as CreateOwnerDelegationParams, j as CredentialInvitationRequest, k as DELIVERY_ADMISSION_DOMAIN, l as DelegateReceivedShareParams, m as DelegatedResource, n as DelegatedShareAccess, o as DelegatedShareKey, p as Delegation, q as DelegationApiResponse, r as DelegationChain, s as DelegationChainV2, t as DelegationDirection, u as DelegationErrorCode, v as DelegationErrorCodes, w as DelegationFilters, x as DelegationManagerConfig, y as DelegationRecord, z as DelegationRevocationReceipt, B as DelegationStatus, E as DeliveryAdmission, F as EncodedShareData, G as GenerateShareParams, H as ISharingService, J as IngestOptions, K as JWK, L as KeyInfo, M as KeyProvider, N as KeyType, O as MAX_CONTENT_BYTES, P as MAX_SEALED_SHARE_CONTENT_BYTES, Q as MAX_SHARE_ARTIFACT_BYTES, S as MAX_SHARE_CONTENT_BYTES, T as MemorySenderShareKeyStorage, U as MemorySenderShareRecordStorage, V as MemoryShareCache, W as OwnerDelegationPermission, X as OwnerDelegationReceipt, Y as OwnerShareAction, Z as OwnerShareDecryption, _ as OwnerShareMatcher, $ as OwnerSharePolicyRegistration, a0 as OwnerSharePolicyRegistrationReceipt, a1 as OwnerSharePolicyV2, a2 as PortableDelegationImportReceipt, a3 as ReceiveOptions, a4 as RegisterOwnerSharePolicyParams, a5 as SenderShareKeyStorage, a6 as SenderShareRecord, a7 as SenderShareRecordStorage, a8 as SenderShareRevocationScope, a9 as SenderShareStore, aa as ShareAccess, ab as ShareAccessError, ac as ShareAccessV2, ad as ShareAction, ae as ShareActionSchema, af as ShareAddressedDelegationEnvelopeV2, ag as ShareAddressedDelegationEnvelopeV2Schema, ah as ShareAddressedDelegationRequestV2, ai as ShareAddressedDelegationRequestV2Schema, aj as ShareAddressedDelegationResponseV2, ak as ShareAddressedDelegationResponseV2Schema, al as ShareAddressedRecipientMatcher, am as ShareArtifactInput, an as ShareArtifactResult, ao as ShareArtifactV2, ap as ShareCache, aq as ShareCacheEntry, ar as ShareCacheKey, as as ShareCacheMetadata, at as ShareCapabilityLike, au as ShareConflict, av as ShareContentMetadata, aw as ShareContentSource, ax as ShareDelegationPreflight, ay as ShareDeliveryAuthorizationV3Receipt, az as ShareDeliveryAuthorizationV3Request, aA as ShareDetachedProof, aB as ShareEnvelopeError, aC as ShareEnvelopeV2, aD as ShareExpiryBounds, aE as ShareKvContentSource, aF as ShareLink, aG as ShareLinkData, aH as ShareLinkLocation, aI as ShareListEntry, aJ as ShareListResult, aK as ShareNativeAction, aL as ShareNativeInvokeEnvelopeV1, aM as ShareNativeInvokeErrorResult, aN as ShareNativeInvokeInput, aO as ShareNativeInvokeResult, aP as ShareNativeInvokeSuccessResult, aQ as ShareNativeResponse, aR as ShareNativeResponseSchema, aS as SharePolicy, aT as SharePolicyBinding, aU as SharePolicySession, aV as SharePolicySessionV1, aW as SharePolicySessionWireV1, aX as SharePortableDelegation, aY as ShareReadInvocationV1, aZ as ShareReadResult, a_ as ShareRecipientClient, a$ as ShareRecipientClientOptions, b0 as ShareRecipientClientOptionsSchema, b1 as ShareRecipientPolicy, b2 as ShareRecipientPolicySchema, b3 as ShareRecipientResult, b4 as ShareRecipientTarget, b5 as ShareRecipientTargetSchema, b6 as ShareResource, b7 as ShareResourceSchema, b8 as ShareSaveOptions, b9 as ShareSchema, ba as ShareSqlContentSource, bb as ShareWireAction, bc as SharingService, bd as SharingServiceConfig, be as SignedDelegation, bf as SpaceInfo, bg as SpaceOwnership, bh as VerifyShareEnvelopeOptions, bi as canonicalOwnerSharePolicy, bj as computeOwnerShareRegistrationCid, bk as computeShareCid, bl as createDelegatedShareKey, bm as createPolicyEnforcementDelegation, bn as createShareArtifact, bo as createShareArtifactAsync, bp as createSharePolicy, bq as createSharingService, br as decryptShareBytesAsync, bs as delegatePortablePolicySession, bt as encodeInlineShareUrl, bu as encodeShareArtifact, bv as encodeShareUrl, bw as encryptShareBytes, bx as encryptShareBytesAsync, by as importPortableDelegation, bz as intersectShareCapabilities, bA as isV2ShareLink, bB as normalizeShareActions, bC as normalizeShareRecipientTarget, bD as normalizeShareResource, bE as parsePortableDelegation, bF as parseShareArtifact, bG as parseShareUrl, bH as restoreDelegatedShareKey, bI as serializePortableDelegation, bJ as shareCapabilityAllows, bK as signShareEnvelope, bL as validateOwnerSharePolicyRegistration, bM as validateOwnerSharePolicyRegistrationBytes, bN as validateShareDeliveryAuthorizationV3Bytes, bO as verifyShareCid, bP as verifyShareEnvelope } from '../recipient-types.schema-_JkBDZB6.js';
|
|
3
3
|
export { EncryptedSenderShareHistory, EncryptedShareHistoryStorage, MemoryEncryptedShareHistoryStorage, ShareAuthorizationAdapter, ShareAuthorizationDenied, ShareAuthorizationMethod, ShareAuthorizationReady, ShareAuthorizationRequired, ShareAuthorizationResult, ShareDeliveryAdapter, ShareErrorCode, ShareErrorInfo, ShareFetchOptions, ShareHistoryView, ShareInspection, ShareMetadata, ShareNotifyResult, ShareNotifyState, SharePolicyPublishAdapter, ShareReceiveError, ShareReceiveResult, ShareRevocationAdapter, ShareRevocationResult, ShareTarget, TargetPublishAdapter, TargetPublishInput, TargetPublishOutcome, authorizationMethodForTarget, authorizeShare, claimShare, inspectShare, listShares, notifyShare, publishPolicyShare, publishTargetShare, receiveShare, resumeShareAuthorization, revokeShare, showShare, toShareErrorInfo } from '@tinycloud/share-sdk';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { ServiceSession, InvokeFunction, FetchFunction, IKVService } from '@tinycloud/sdk-services';
|
|
@@ -1396,8 +1396,17 @@ function canonicalizeRecapCaveats(caveats) {
|
|
|
1396
1396
|
}
|
|
1397
1397
|
return `[${branches.join(",")}]`;
|
|
1398
1398
|
}
|
|
1399
|
+
var EXPLICIT_ONLY_ACTIONS = {
|
|
1400
|
+
"tinycloud.kv/sync": true,
|
|
1401
|
+
"tinycloud.kv/retain": true
|
|
1402
|
+
};
|
|
1403
|
+
function isExplicitOnlyAction(action) {
|
|
1404
|
+
return Object.prototype.hasOwnProperty.call(EXPLICIT_ONLY_ACTIONS, action);
|
|
1405
|
+
}
|
|
1399
1406
|
function actionContains(grantedAction, requestedAction) {
|
|
1400
|
-
if (grantedAction ===
|
|
1407
|
+
if (grantedAction === requestedAction) return true;
|
|
1408
|
+
if (isExplicitOnlyAction(requestedAction)) return false;
|
|
1409
|
+
if (grantedAction === "*") return true;
|
|
1401
1410
|
if (!grantedAction.endsWith("/*")) return false;
|
|
1402
1411
|
const service = grantedAction.slice(0, -2);
|
|
1403
1412
|
return requestedAction === service || requestedAction.startsWith(`${service}/`);
|
|
@@ -2571,7 +2580,7 @@ import { ed25519 as ed255194 } from "@noble/curves/ed25519";
|
|
|
2571
2580
|
|
|
2572
2581
|
// src/delegations/ShareRecipientClient.ts
|
|
2573
2582
|
import {
|
|
2574
|
-
ErrorCodes,
|
|
2583
|
+
ErrorCodes as ErrorCodes2,
|
|
2575
2584
|
KVService,
|
|
2576
2585
|
ServiceContext
|
|
2577
2586
|
} from "@tinycloud/sdk-services";
|
|
@@ -3852,6 +3861,21 @@ function assertUnicodeScalarString(value, path) {
|
|
|
3852
3861
|
}
|
|
3853
3862
|
}
|
|
3854
3863
|
|
|
3864
|
+
// src/http-error.ts
|
|
3865
|
+
import { ErrorCodes, serviceError } from "@tinycloud/sdk-services";
|
|
3866
|
+
async function httpResponseError(response, context) {
|
|
3867
|
+
let body;
|
|
3868
|
+
try {
|
|
3869
|
+
body = await response.text();
|
|
3870
|
+
} catch {
|
|
3871
|
+
body = response.statusText;
|
|
3872
|
+
}
|
|
3873
|
+
body = body.trim().slice(0, 512);
|
|
3874
|
+
return Object.assign(new Error(`${context}: HTTP ${response.status}${body ? ` - ${body}` : ""}`), {
|
|
3875
|
+
status: response.status
|
|
3876
|
+
});
|
|
3877
|
+
}
|
|
3878
|
+
|
|
3855
3879
|
// src/policy/unified.ts
|
|
3856
3880
|
var POLICY_SESSION_UCAN_V1_PROFILE = "policy-session-ucan/v1";
|
|
3857
3881
|
var POLICY_SESSION_FACT_KEYS = [
|
|
@@ -4116,7 +4140,7 @@ async function importPortableDelegation(fetchFn, host, delegation) {
|
|
|
4116
4140
|
headers: { Authorization: parsed.delegationHeader.Authorization }
|
|
4117
4141
|
});
|
|
4118
4142
|
if (!response.ok)
|
|
4119
|
-
throw
|
|
4143
|
+
throw await httpResponseError(response, "node rejected delegation import");
|
|
4120
4144
|
const body = await response.json().catch(() => ({}));
|
|
4121
4145
|
if (body === null || typeof body !== "object" || Array.isArray(body))
|
|
4122
4146
|
return {};
|
|
@@ -4185,7 +4209,7 @@ function redactedCode(error) {
|
|
|
4185
4209
|
if (error instanceof ShareConflict) return error.code;
|
|
4186
4210
|
const code3 = error && typeof error === "object" && "code" in error ? error.code : void 0;
|
|
4187
4211
|
if (typeof code3 !== "string") return "SHARE_INVALID";
|
|
4188
|
-
if (code3 ===
|
|
4212
|
+
if (code3 === ErrorCodes2.KV_PRECONDITION_FAILED || code3 === ErrorCodes2.KV_CONFLICT || code3 === "412") return "SHARE_CONFLICT";
|
|
4189
4213
|
if (code3 === "KV_NOT_FOUND" || code3 === "NOT_FOUND" || code3 === "404") return "SHARE_NOT_FOUND";
|
|
4190
4214
|
if (code3.includes("EXPIRED") || code3 === "expired") return "SHARE_EXPIRED";
|
|
4191
4215
|
if (code3.includes("REVOK")) return "SHARE_REVOKED";
|
|
@@ -4424,7 +4448,7 @@ var ShareRecipientClient = class {
|
|
|
4424
4448
|
if (portableDelegation !== void 0 && kv !== void 0) {
|
|
4425
4449
|
const result2 = await kv.put(resolvedPath, bytes2, { contentType: input.contentType ?? envelope.content.mimeType, ifMatch: input.etag });
|
|
4426
4450
|
if (!result2.ok) {
|
|
4427
|
-
if (result2.error.code ===
|
|
4451
|
+
if (result2.error.code === ErrorCodes2.KV_PRECONDITION_FAILED || result2.error.code === ErrorCodes2.KV_CONFLICT) throw new ShareConflict(resolvedPath, result2.error.meta?.etag);
|
|
4428
4452
|
throw result2.error;
|
|
4429
4453
|
}
|
|
4430
4454
|
return { etag: result2.data.headers.etag };
|
|
@@ -4432,7 +4456,7 @@ var ShareRecipientClient = class {
|
|
|
4432
4456
|
if (policySession !== void 0) return this.nativeSave(envelope, policySession, resolvedPath, bytes2, input);
|
|
4433
4457
|
const result = await kv.put(resolvedPath, bytes2, { contentType: input.contentType ?? envelope.content.mimeType, ifMatch: input.etag });
|
|
4434
4458
|
if (!result.ok) {
|
|
4435
|
-
if (result.error.code ===
|
|
4459
|
+
if (result.error.code === ErrorCodes2.KV_PRECONDITION_FAILED || result.error.code === ErrorCodes2.KV_CONFLICT) throw new ShareConflict(resolvedPath, result.error.meta?.etag);
|
|
4436
4460
|
throw result.error;
|
|
4437
4461
|
}
|
|
4438
4462
|
return { etag: result.data.headers.etag };
|
|
@@ -5618,7 +5642,9 @@ var SharingService = class {
|
|
|
5618
5642
|
if (delegation.allowSubDelegation === false) continue;
|
|
5619
5643
|
if (!this.pathMatches(delegation.path || "", path)) continue;
|
|
5620
5644
|
const delegationActions = delegation.actions || [];
|
|
5621
|
-
if (!actions.every(
|
|
5645
|
+
if (!actions.every(
|
|
5646
|
+
(action) => delegationActions.some((granted) => actionContains(granted, action))
|
|
5647
|
+
)) {
|
|
5622
5648
|
continue;
|
|
5623
5649
|
}
|
|
5624
5650
|
if ((delegation.caveats?.length ?? 0) > 0) {
|