@tinycloud/sdk-core 3.1.0-beta.8 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{credential-admission-CFsYiCPH.d.ts → credential-admission-BaP4pdpy.d.ts} +13 -5
- package/dist/{credential-admission-Cfum4B79.d.cts → credential-admission-ohx0XnQr.d.cts} +13 -5
- package/dist/delegations/index.cjs +32 -14
- package/dist/delegations/index.cjs.map +1 -1
- package/dist/delegations/index.d.cts +29 -29
- package/dist/delegations/index.d.ts +29 -29
- package/dist/delegations/index.js +32 -14
- package/dist/delegations/index.js.map +1 -1
- package/dist/index.cjs +111 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -17
- package/dist/index.d.ts +30 -17
- package/dist/index.js +113 -14
- package/dist/index.js.map +1 -1
- package/dist/policy/index.cjs +27 -0
- package/dist/policy/index.cjs.map +1 -1
- package/dist/policy/index.d.cts +2 -2
- package/dist/policy/index.d.ts +2 -2
- package/dist/policy/index.js +27 -0
- package/dist/policy/index.js.map +1 -1
- package/dist/{recipient-types.schema-B5vpbtf-.d.cts → recipient-types.schema-D-IMys0b.d.cts} +181 -178
- package/dist/{recipient-types.schema-B5vpbtf-.d.ts → recipient-types.schema-D-IMys0b.d.ts} +181 -178
- package/package.json +5 -5
|
@@ -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-D-IMys0b.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-D-IMys0b.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';
|
|
@@ -101,10 +101,10 @@ declare const EncodedShareDataSchema: z.ZodObject<{
|
|
|
101
101
|
authHeader: z.ZodOptional<z.ZodString>;
|
|
102
102
|
}, "strip", z.ZodTypeAny, {
|
|
103
103
|
path: string;
|
|
104
|
-
spaceId: string;
|
|
105
|
-
cid: string;
|
|
106
104
|
expiry: Date;
|
|
107
105
|
actions: string[];
|
|
106
|
+
spaceId: string;
|
|
107
|
+
cid: string;
|
|
108
108
|
delegateDID: string;
|
|
109
109
|
isRevoked: boolean;
|
|
110
110
|
caveats?: Record<string, unknown>[] | undefined;
|
|
@@ -115,10 +115,10 @@ declare const EncodedShareDataSchema: z.ZodObject<{
|
|
|
115
115
|
authHeader?: string | undefined;
|
|
116
116
|
}, {
|
|
117
117
|
path: string;
|
|
118
|
-
spaceId: string;
|
|
119
|
-
cid: string;
|
|
120
118
|
expiry: Date;
|
|
121
119
|
actions: string[];
|
|
120
|
+
spaceId: string;
|
|
121
|
+
cid: string;
|
|
122
122
|
delegateDID: string;
|
|
123
123
|
isRevoked: boolean;
|
|
124
124
|
caveats?: Record<string, unknown>[] | undefined;
|
|
@@ -138,22 +138,6 @@ declare const EncodedShareDataSchema: z.ZodObject<{
|
|
|
138
138
|
version: z.ZodLiteral<1>;
|
|
139
139
|
}, "strip", z.ZodTypeAny, {
|
|
140
140
|
path: string;
|
|
141
|
-
spaceId: string;
|
|
142
|
-
delegation: {
|
|
143
|
-
path: string;
|
|
144
|
-
spaceId: string;
|
|
145
|
-
cid: string;
|
|
146
|
-
expiry: Date;
|
|
147
|
-
actions: string[];
|
|
148
|
-
delegateDID: string;
|
|
149
|
-
isRevoked: boolean;
|
|
150
|
-
caveats?: Record<string, unknown>[] | undefined;
|
|
151
|
-
createdAt?: Date | undefined;
|
|
152
|
-
delegatorDID?: string | undefined;
|
|
153
|
-
parentCid?: string | undefined;
|
|
154
|
-
allowSubDelegation?: boolean | undefined;
|
|
155
|
-
authHeader?: string | undefined;
|
|
156
|
-
};
|
|
157
141
|
version: 1;
|
|
158
142
|
key: {
|
|
159
143
|
kty: string;
|
|
@@ -168,17 +152,12 @@ declare const EncodedShareDataSchema: z.ZodObject<{
|
|
|
168
152
|
use?: string | undefined;
|
|
169
153
|
key_ops?: string[] | undefined;
|
|
170
154
|
};
|
|
171
|
-
keyDid: string;
|
|
172
|
-
host: string;
|
|
173
|
-
}, {
|
|
174
|
-
path: string;
|
|
175
|
-
spaceId: string;
|
|
176
155
|
delegation: {
|
|
177
156
|
path: string;
|
|
178
|
-
spaceId: string;
|
|
179
|
-
cid: string;
|
|
180
157
|
expiry: Date;
|
|
181
158
|
actions: string[];
|
|
159
|
+
spaceId: string;
|
|
160
|
+
cid: string;
|
|
182
161
|
delegateDID: string;
|
|
183
162
|
isRevoked: boolean;
|
|
184
163
|
caveats?: Record<string, unknown>[] | undefined;
|
|
@@ -188,6 +167,11 @@ declare const EncodedShareDataSchema: z.ZodObject<{
|
|
|
188
167
|
allowSubDelegation?: boolean | undefined;
|
|
189
168
|
authHeader?: string | undefined;
|
|
190
169
|
};
|
|
170
|
+
spaceId: string;
|
|
171
|
+
keyDid: string;
|
|
172
|
+
host: string;
|
|
173
|
+
}, {
|
|
174
|
+
path: string;
|
|
191
175
|
version: 1;
|
|
192
176
|
key: {
|
|
193
177
|
kty: string;
|
|
@@ -202,6 +186,22 @@ declare const EncodedShareDataSchema: z.ZodObject<{
|
|
|
202
186
|
use?: string | undefined;
|
|
203
187
|
key_ops?: string[] | undefined;
|
|
204
188
|
};
|
|
189
|
+
delegation: {
|
|
190
|
+
path: string;
|
|
191
|
+
expiry: Date;
|
|
192
|
+
actions: string[];
|
|
193
|
+
spaceId: string;
|
|
194
|
+
cid: string;
|
|
195
|
+
delegateDID: string;
|
|
196
|
+
isRevoked: boolean;
|
|
197
|
+
caveats?: Record<string, unknown>[] | undefined;
|
|
198
|
+
createdAt?: Date | undefined;
|
|
199
|
+
delegatorDID?: string | undefined;
|
|
200
|
+
parentCid?: string | undefined;
|
|
201
|
+
allowSubDelegation?: boolean | undefined;
|
|
202
|
+
authHeader?: string | undefined;
|
|
203
|
+
};
|
|
204
|
+
spaceId: string;
|
|
205
205
|
keyDid: string;
|
|
206
206
|
host: string;
|
|
207
207
|
}>;
|
|
@@ -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-D-IMys0b.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-D-IMys0b.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';
|
|
@@ -101,10 +101,10 @@ declare const EncodedShareDataSchema: z.ZodObject<{
|
|
|
101
101
|
authHeader: z.ZodOptional<z.ZodString>;
|
|
102
102
|
}, "strip", z.ZodTypeAny, {
|
|
103
103
|
path: string;
|
|
104
|
-
spaceId: string;
|
|
105
|
-
cid: string;
|
|
106
104
|
expiry: Date;
|
|
107
105
|
actions: string[];
|
|
106
|
+
spaceId: string;
|
|
107
|
+
cid: string;
|
|
108
108
|
delegateDID: string;
|
|
109
109
|
isRevoked: boolean;
|
|
110
110
|
caveats?: Record<string, unknown>[] | undefined;
|
|
@@ -115,10 +115,10 @@ declare const EncodedShareDataSchema: z.ZodObject<{
|
|
|
115
115
|
authHeader?: string | undefined;
|
|
116
116
|
}, {
|
|
117
117
|
path: string;
|
|
118
|
-
spaceId: string;
|
|
119
|
-
cid: string;
|
|
120
118
|
expiry: Date;
|
|
121
119
|
actions: string[];
|
|
120
|
+
spaceId: string;
|
|
121
|
+
cid: string;
|
|
122
122
|
delegateDID: string;
|
|
123
123
|
isRevoked: boolean;
|
|
124
124
|
caveats?: Record<string, unknown>[] | undefined;
|
|
@@ -138,22 +138,6 @@ declare const EncodedShareDataSchema: z.ZodObject<{
|
|
|
138
138
|
version: z.ZodLiteral<1>;
|
|
139
139
|
}, "strip", z.ZodTypeAny, {
|
|
140
140
|
path: string;
|
|
141
|
-
spaceId: string;
|
|
142
|
-
delegation: {
|
|
143
|
-
path: string;
|
|
144
|
-
spaceId: string;
|
|
145
|
-
cid: string;
|
|
146
|
-
expiry: Date;
|
|
147
|
-
actions: string[];
|
|
148
|
-
delegateDID: string;
|
|
149
|
-
isRevoked: boolean;
|
|
150
|
-
caveats?: Record<string, unknown>[] | undefined;
|
|
151
|
-
createdAt?: Date | undefined;
|
|
152
|
-
delegatorDID?: string | undefined;
|
|
153
|
-
parentCid?: string | undefined;
|
|
154
|
-
allowSubDelegation?: boolean | undefined;
|
|
155
|
-
authHeader?: string | undefined;
|
|
156
|
-
};
|
|
157
141
|
version: 1;
|
|
158
142
|
key: {
|
|
159
143
|
kty: string;
|
|
@@ -168,17 +152,12 @@ declare const EncodedShareDataSchema: z.ZodObject<{
|
|
|
168
152
|
use?: string | undefined;
|
|
169
153
|
key_ops?: string[] | undefined;
|
|
170
154
|
};
|
|
171
|
-
keyDid: string;
|
|
172
|
-
host: string;
|
|
173
|
-
}, {
|
|
174
|
-
path: string;
|
|
175
|
-
spaceId: string;
|
|
176
155
|
delegation: {
|
|
177
156
|
path: string;
|
|
178
|
-
spaceId: string;
|
|
179
|
-
cid: string;
|
|
180
157
|
expiry: Date;
|
|
181
158
|
actions: string[];
|
|
159
|
+
spaceId: string;
|
|
160
|
+
cid: string;
|
|
182
161
|
delegateDID: string;
|
|
183
162
|
isRevoked: boolean;
|
|
184
163
|
caveats?: Record<string, unknown>[] | undefined;
|
|
@@ -188,6 +167,11 @@ declare const EncodedShareDataSchema: z.ZodObject<{
|
|
|
188
167
|
allowSubDelegation?: boolean | undefined;
|
|
189
168
|
authHeader?: string | undefined;
|
|
190
169
|
};
|
|
170
|
+
spaceId: string;
|
|
171
|
+
keyDid: string;
|
|
172
|
+
host: string;
|
|
173
|
+
}, {
|
|
174
|
+
path: string;
|
|
191
175
|
version: 1;
|
|
192
176
|
key: {
|
|
193
177
|
kty: string;
|
|
@@ -202,6 +186,22 @@ declare const EncodedShareDataSchema: z.ZodObject<{
|
|
|
202
186
|
use?: string | undefined;
|
|
203
187
|
key_ops?: string[] | undefined;
|
|
204
188
|
};
|
|
189
|
+
delegation: {
|
|
190
|
+
path: string;
|
|
191
|
+
expiry: Date;
|
|
192
|
+
actions: string[];
|
|
193
|
+
spaceId: string;
|
|
194
|
+
cid: string;
|
|
195
|
+
delegateDID: string;
|
|
196
|
+
isRevoked: boolean;
|
|
197
|
+
caveats?: Record<string, unknown>[] | undefined;
|
|
198
|
+
createdAt?: Date | undefined;
|
|
199
|
+
delegatorDID?: string | undefined;
|
|
200
|
+
parentCid?: string | undefined;
|
|
201
|
+
allowSubDelegation?: boolean | undefined;
|
|
202
|
+
authHeader?: string | undefined;
|
|
203
|
+
};
|
|
204
|
+
spaceId: string;
|
|
205
205
|
keyDid: string;
|
|
206
206
|
host: string;
|
|
207
207
|
}>;
|
|
@@ -620,7 +620,7 @@ var DelegationManager = class {
|
|
|
620
620
|
* }
|
|
621
621
|
* ```
|
|
622
622
|
*/
|
|
623
|
-
async revoke(cid2) {
|
|
623
|
+
async revoke(cid2, options) {
|
|
624
624
|
if (!cid2) {
|
|
625
625
|
return {
|
|
626
626
|
ok: false,
|
|
@@ -640,15 +640,20 @@ var DelegationManager = class {
|
|
|
640
640
|
)
|
|
641
641
|
};
|
|
642
642
|
}
|
|
643
|
-
const
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
643
|
+
const entry = {
|
|
644
|
+
resource: `urn:cid:${cid2}`,
|
|
645
|
+
...options?.targetSpaceId === void 0 ? {} : { spaceId: options.targetSpaceId },
|
|
646
|
+
service: "delegation",
|
|
647
|
+
path: "",
|
|
648
|
+
action: DelegationAction.REVOKE
|
|
649
|
+
};
|
|
650
|
+
if (options?.authorityCid !== void 0) {
|
|
651
|
+
Object.defineProperty(entry, "revokeAuthorityCid", {
|
|
652
|
+
value: options.authorityCid,
|
|
653
|
+
enumerable: false
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
const headers = this.invokeAny(this.session, [entry]);
|
|
652
657
|
const response = await this.fetchFn(`${this.host}/revoke`, {
|
|
653
658
|
method: "POST",
|
|
654
659
|
headers
|
|
@@ -806,7 +811,8 @@ var DelegationManager = class {
|
|
|
806
811
|
)
|
|
807
812
|
};
|
|
808
813
|
}
|
|
809
|
-
|
|
814
|
+
const accountSpaceId = this.accountSpaceId;
|
|
815
|
+
if (!accountSpaceId) {
|
|
810
816
|
return {
|
|
811
817
|
ok: false,
|
|
812
818
|
error: createError(
|
|
@@ -817,7 +823,7 @@ var DelegationManager = class {
|
|
|
817
823
|
}
|
|
818
824
|
try {
|
|
819
825
|
const invocationHeaders = this.invokeAny(this.session, [{
|
|
820
|
-
spaceId:
|
|
826
|
+
spaceId: accountSpaceId,
|
|
821
827
|
service: "delegation",
|
|
822
828
|
path: "",
|
|
823
829
|
action: DelegationAction.LIST
|
|
@@ -1396,8 +1402,17 @@ function canonicalizeRecapCaveats(caveats) {
|
|
|
1396
1402
|
}
|
|
1397
1403
|
return `[${branches.join(",")}]`;
|
|
1398
1404
|
}
|
|
1405
|
+
var EXPLICIT_ONLY_ACTIONS = {
|
|
1406
|
+
"tinycloud.kv/sync": true,
|
|
1407
|
+
"tinycloud.kv/retain": true
|
|
1408
|
+
};
|
|
1409
|
+
function isExplicitOnlyAction(action) {
|
|
1410
|
+
return Object.prototype.hasOwnProperty.call(EXPLICIT_ONLY_ACTIONS, action);
|
|
1411
|
+
}
|
|
1399
1412
|
function actionContains(grantedAction, requestedAction) {
|
|
1400
|
-
if (grantedAction ===
|
|
1413
|
+
if (grantedAction === requestedAction) return true;
|
|
1414
|
+
if (isExplicitOnlyAction(requestedAction)) return false;
|
|
1415
|
+
if (grantedAction === "*") return true;
|
|
1401
1416
|
if (!grantedAction.endsWith("/*")) return false;
|
|
1402
1417
|
const service = grantedAction.slice(0, -2);
|
|
1403
1418
|
return requestedAction === service || requestedAction.startsWith(`${service}/`);
|
|
@@ -4041,6 +4056,7 @@ function parseCompactUcanAuthorization(input, expectedCid) {
|
|
|
4041
4056
|
throw new Error("compact UCAN CID does not match exact Authorization bytes");
|
|
4042
4057
|
return { authorization: input, cid: cid2, header, payload };
|
|
4043
4058
|
}
|
|
4059
|
+
var SignedCompactAttenuationSchema = z4.record(z4.record(z4.array(z4.unknown()).min(1)));
|
|
4044
4060
|
function parsePolicySessionUcan(authorization, expectedProofs) {
|
|
4045
4061
|
const parsed = parseCompactUcanAuthorization(authorization);
|
|
4046
4062
|
const fact = parsed.payload.fct[0];
|
|
@@ -5633,7 +5649,9 @@ var SharingService = class {
|
|
|
5633
5649
|
if (delegation.allowSubDelegation === false) continue;
|
|
5634
5650
|
if (!this.pathMatches(delegation.path || "", path)) continue;
|
|
5635
5651
|
const delegationActions = delegation.actions || [];
|
|
5636
|
-
if (!actions.every(
|
|
5652
|
+
if (!actions.every(
|
|
5653
|
+
(action) => delegationActions.some((granted) => actionContains(granted, action))
|
|
5654
|
+
)) {
|
|
5637
5655
|
continue;
|
|
5638
5656
|
}
|
|
5639
5657
|
if ((delegation.caveats?.length ?? 0) > 0) {
|