@tinycloud/sdk-core 3.3.0-beta.7 → 3.3.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.
- package/dist/delegations/index.d.cts +29 -29
- package/dist/delegations/index.d.ts +29 -29
- package/dist/index.cjs +36 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +43 -15
- package/dist/index.d.ts +43 -15
- package/dist/index.js +36 -3
- package/dist/index.js.map +1 -1
- package/dist/policy/index.d.cts +2 -2
- package/dist/policy/index.d.ts +2 -2
- package/dist/{recipient-types.schema-ZCBMchyn.d.cts → recipient-types.schema-CPDoAVh4.d.cts} +177 -177
- package/dist/{recipient-types.schema-ZCBMchyn.d.ts → recipient-types.schema-CPDoAVh4.d.ts} +177 -177
- package/package.json +1 -1
- package/dist/{credential-admission-CqXwBvDS.d.ts → credential-admission-7I_ymo-C.d.ts} +4 -4
- package/dist/{credential-admission-CaWVn8yO.d.cts → credential-admission-Cg1M9uyV.d.cts} +4 -4
|
@@ -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-CPDoAVh4.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-CPDoAVh4.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-CPDoAVh4.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-CPDoAVh4.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
|
}>;
|
package/dist/index.cjs
CHANGED
|
@@ -221,6 +221,7 @@ __export(index_exports, {
|
|
|
221
221
|
SpaceService: () => SpaceService,
|
|
222
222
|
StorageFullMonitor: () => import_sdk_services9.StorageFullMonitor,
|
|
223
223
|
TC832_RESERVED_SCOPES: () => import_sdk_services9.TC832_RESERVED_SCOPES,
|
|
224
|
+
TERMINAL_DELEGATION_FACT: () => TERMINAL_DELEGATION_FACT,
|
|
224
225
|
TINYCLOUD_ACCOUNT_SPACE_MANIFEST: () => import_bootstrap4.TINYCLOUD_ACCOUNT_SPACE_MANIFEST,
|
|
225
226
|
TINYCLOUD_AGENTS_SPACE_MANIFEST: () => import_bootstrap4.TINYCLOUD_AGENTS_SPACE_MANIFEST,
|
|
226
227
|
TINYCLOUD_APPLICATIONS_SPACE_MANIFEST: () => import_bootstrap4.TINYCLOUD_APPLICATIONS_SPACE_MANIFEST,
|
|
@@ -381,6 +382,7 @@ __export(index_exports, {
|
|
|
381
382
|
makePkhSpaceId: () => makePkhSpaceId,
|
|
382
383
|
makePublicSpaceId: () => makePublicSpaceId,
|
|
383
384
|
manifestAbilitiesUnion: () => manifestAbilitiesUnion,
|
|
385
|
+
markDelegationTerminal: () => markDelegationTerminal,
|
|
384
386
|
multiaddrToHttpUrl: () => multiaddrToHttpUrl,
|
|
385
387
|
networkDiscoveryKey: () => import_sdk_services9.networkDiscoveryKey,
|
|
386
388
|
normalizeDefaults: () => normalizeDefaults,
|
|
@@ -12794,6 +12796,37 @@ async function parseSignedSiweCacao(authorization, expectedCid) {
|
|
|
12794
12796
|
return { cid: cid2, issuer, audience, attenuation, ...expiresAt === void 0 ? {} : { expiresAt } };
|
|
12795
12797
|
}
|
|
12796
12798
|
|
|
12799
|
+
// src/delegations/terminal.ts
|
|
12800
|
+
var import_blake35 = require("@noble/hashes/blake3");
|
|
12801
|
+
var import_ed2551910 = require("@noble/curves/ed25519");
|
|
12802
|
+
var TERMINAL_DELEGATION_FACT = Object.freeze({
|
|
12803
|
+
"xyz.tinycloud.policy/delegationMode": "terminal"
|
|
12804
|
+
});
|
|
12805
|
+
function markDelegationTerminal(token, key) {
|
|
12806
|
+
const [headerSegment, payloadSegment, signatureSegment] = token.split(".");
|
|
12807
|
+
const decoder = new TextDecoder();
|
|
12808
|
+
const header = JSON.parse(decoder.decode(decodeBase64Url(headerSegment)));
|
|
12809
|
+
const payload = JSON.parse(decoder.decode(decodeBase64Url(payloadSegment)));
|
|
12810
|
+
if (signatureSegment === void 0 || header.alg !== "EdDSA" || key.kty !== "OKP" || key.crv !== "Ed25519" || !key.d) {
|
|
12811
|
+
throw new Error("terminal delegations require an Ed25519 session key");
|
|
12812
|
+
}
|
|
12813
|
+
const privateKey = decodeBase64Url(key.d);
|
|
12814
|
+
const signer = `did:key:${base58btc.encode(Uint8Array.of(237, 1, ...import_ed2551910.ed25519.getPublicKey(privateKey)))}`;
|
|
12815
|
+
if (typeof payload.iss !== "string" || payload.iss.split("#")[0] !== signer) {
|
|
12816
|
+
throw new Error("session key is not the delegation issuer");
|
|
12817
|
+
}
|
|
12818
|
+
const facts = payload.fct ?? [];
|
|
12819
|
+
if (!Array.isArray(facts)) throw new Error("delegation facts are not an array");
|
|
12820
|
+
const encoder = new TextEncoder();
|
|
12821
|
+
let delegation = token;
|
|
12822
|
+
if (!facts.some((fact) => fact?.["xyz.tinycloud.policy/delegationMode"] === "terminal")) {
|
|
12823
|
+
payload.fct = [...facts, { ...TERMINAL_DELEGATION_FACT }];
|
|
12824
|
+
const signingInput = `${headerSegment}.${encodeBase64Url(encoder.encode(JSON.stringify(payload)))}`;
|
|
12825
|
+
delegation = `${signingInput}.${encodeBase64Url(import_ed2551910.ed25519.sign(encoder.encode(signingInput), privateKey))}`;
|
|
12826
|
+
}
|
|
12827
|
+
return { delegation, cid: CID.createV1(85, create(30, (0, import_blake35.blake3)(encoder.encode(delegation)))).toString() };
|
|
12828
|
+
}
|
|
12829
|
+
|
|
12797
12830
|
// src/networkId.ts
|
|
12798
12831
|
var import_sdk_services4 = require("@tinycloud/sdk-services");
|
|
12799
12832
|
function canonicalizeNetworkId(networkId) {
|
|
@@ -18381,7 +18414,7 @@ function portForProtocol(protocol) {
|
|
|
18381
18414
|
}
|
|
18382
18415
|
|
|
18383
18416
|
// src/location.ts
|
|
18384
|
-
var
|
|
18417
|
+
var import_ed2551911 = require("@noble/curves/ed25519");
|
|
18385
18418
|
var import_viem6 = require("viem");
|
|
18386
18419
|
var DEFAULT_TINYCLOUD_LOCATION_REGISTRY_URL = "https://registry.tinycloud.xyz";
|
|
18387
18420
|
var DEFAULT_TINYCLOUD_FALLBACK_HOST = "https://node.tinycloud.xyz";
|
|
@@ -19149,7 +19182,7 @@ function verifyDidKeySignature(did, payload, signature) {
|
|
|
19149
19182
|
"did:key signature must be a base64url Ed25519 signature"
|
|
19150
19183
|
);
|
|
19151
19184
|
}
|
|
19152
|
-
return
|
|
19185
|
+
return import_ed2551911.ed25519.verify(
|
|
19153
19186
|
signatureBytes,
|
|
19154
19187
|
new TextEncoder().encode(payload),
|
|
19155
19188
|
publicKey
|
|
@@ -19157,7 +19190,7 @@ function verifyDidKeySignature(did, payload, signature) {
|
|
|
19157
19190
|
}
|
|
19158
19191
|
function verifyDidKeyEd25519Signature(did, payload, signature) {
|
|
19159
19192
|
const publicKey = ed25519PublicKeyFromDidKey2(did);
|
|
19160
|
-
return
|
|
19193
|
+
return import_ed2551911.ed25519.verify(signature, payload, publicKey);
|
|
19161
19194
|
}
|
|
19162
19195
|
function ed25519PublicKeyFromDidKey2(did) {
|
|
19163
19196
|
const identifier = did.slice("did:key:".length);
|